Added gitea server

This commit is contained in:
Justus Grunow 2024-11-12 14:45:02 -05:00
parent 39d1ef9859
commit 873bb7c13b
10 changed files with 102 additions and 1 deletions

View File

@ -82,6 +82,8 @@ services:
- 'matrix matrix.mycomputer.party:10.11.1.16'
- 'wiki wiki.injust.us:10.11.1.13'
- 'git git.mycomputer.party:10.11.1.17'
- 'gitea gitea.injust.us:10.11.1.18'
- 'gitea.mycomputer.party:10.11.1.15'
restart: always

View File

@ -12,7 +12,7 @@ http:
service-gitea:
loadBalancer:
servers:
- url: "http://git:3000"
- url: "http://gitea.injust.us:3000"
#certificatesResolvers:
# myresolver:

View File

@ -0,0 +1,13 @@
version: '3.3'
services:
runner:
image: gitea/act_runner:nightly
environment:
CONFIG_FILE: /config.yaml
GITEA_INSTANCE_URL: "{{ gitea_instance_url }}"
GITEA_RUNNER_REGISTRATION_TOKEN: "{{ gitea_runner_token }}"
GITEA_RUNNER_NAME: "{{ gitea_runner_name }}"
volumes:
- ./config.yaml:/config.yaml
- ./data:/data
- /var/run/docker.sock:/var/run/docker.sock

View File

@ -1,6 +1,7 @@
- name: Setup Docker hosts
hosts:
- docker
- gitea
vars:
tasks:
- name: Docker Prereqs

View File

@ -0,0 +1,7 @@
---
- name: Install Gitea
hosts:
- gitea
roles:
- install_gitea

View File

@ -0,0 +1,3 @@
gitea_instance_url: https://gitea.mycomputer.party
gitea_runner_token: "{{ vault_runner_token }}"
gitea_runner_name: runner1

View File

@ -0,0 +1,8 @@
$ANSIBLE_VAULT;1.1;AES256
33326335326536306338373536323931313161363731353734366231616238396237363438346365
3131616263646364623264356537636462363533636439320a346162313663626230306266643030
34393961393564363162323031346133386337383338316136623738366236376131633339363364
3262393335646163340a633831393434366262346262626532376265303336616532663933383463
30666533303966326166353565363263313964386435306465633532643162636535366262396535
62343339643264643039333838383534383662303637326563386261643061313264353234636337
353063336363326466343538666235303833

View File

@ -15,3 +15,5 @@ docker:
basementpi:
ansible_host: 10.11.1.10
ansible_ssh_user: root
gitea:
ansible_ssh_user: root

View File

@ -0,0 +1,2 @@
gitea_version: 1.22.3
gitea_minor_version: 1.22

View File

@ -0,0 +1,63 @@
- name: Install Git
ansible.builtin.package:
name: git
state: present
- name: Download Gitea binary
ansible.builtin.get_url:
url: https://dl.gitea.com/gitea/{{ gitea_version }}/gitea-{{ gitea_version }}-linux-amd64
dest: /usr/local/bin/gitea
mode: +x
- name: Create git user
ansible.builtin.user:
name: git
state: present
system: true
shell: /bin/bash
comment: Git Version Control
password: !
create_home: true
- name: Create /var/lib/gitea
ansible.builtin.file:
state: directory
path: /var/lib/gitea
owner: git
group: git
mode: '750'
- name: Create /var/lib/gitea subdirs
ansible.builtin.file:
state: directory
path: "{{ item.path }}"
owner: git
group: git
mode: '750'
loop:
- { path: /var/lib/gitea/custom}
- { path: /var/lib/gitea/data}
- { path: /var/lib/gitea/log}
- name: Create /etc/gitea
ansible.builtin.file:
path: /etc/gitea
state: directory
owner: root
group: git
mode: '770'
- name: Get systemd unit file
ansible.builtin.get_url:
url: https://raw.githubusercontent.com/go-gitea/gitea/refs/heads/release/v{{ gitea_minor_version }}/contrib/systemd/gitea.service
dest: /etc/systemd/system/gitea.service
- name: Start service
ansible.builtin.systemd_service:
name: gitea
enabled: true
state: started
#- name: Set permissions after install
# ansible.builtin.file:
# state: "{{ item.state }}"
# path: "{{ item.path }}"
# mode: "{{ item.mode }}"
# loop:
# - { state: directory, path: /etc/gitea, mode: '750' }
# - { state: file, path: /etc/gitea/app.ini, mode: '640' }