initial commit
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
- name: Restart gitea
|
||||
runit:
|
||||
name: gitea
|
||||
state: restarted
|
||||
@@ -0,0 +1,75 @@
|
||||
---
|
||||
- name: Install gitea package
|
||||
ansible.builtin.xbps:
|
||||
pkg:
|
||||
- gitea
|
||||
- python3-dnspython
|
||||
- python3-psycopg2
|
||||
state: present
|
||||
|
||||
- name: add dns entry
|
||||
community.general.nsupdate:
|
||||
key_name: "ansible"
|
||||
key_secret: "{{ dns_tsig_key }}"
|
||||
key_algorithm: "hmac-sha512"
|
||||
server: "127.0.0.1"
|
||||
zone: "cosmosim.dev"
|
||||
record: "{{ gitea_domain }}."
|
||||
type: "CNAME"
|
||||
value: "cosmosim.dev."
|
||||
state: present
|
||||
|
||||
- name: Create _gitea role
|
||||
community.postgresql.postgresql_user:
|
||||
name: _gitea
|
||||
state: present
|
||||
become: true
|
||||
become_user: postgres
|
||||
|
||||
- name: Create postgres database
|
||||
community.postgresql.postgresql_db:
|
||||
name: gitea
|
||||
owner: _gitea
|
||||
state: present
|
||||
become: true
|
||||
become_user: postgres
|
||||
|
||||
- name: Create run directory
|
||||
ansible.builtin.file:
|
||||
path: /run/gitea
|
||||
owner: _gitea
|
||||
group: _gitea
|
||||
mode: 0750
|
||||
state: directory
|
||||
|
||||
- name: Set run dir acl
|
||||
ansible.posix.acl:
|
||||
path: /run/gitea
|
||||
entity: caddy
|
||||
etype: user
|
||||
permissions: rX
|
||||
state: present
|
||||
|
||||
- name: Set run dir acl
|
||||
ansible.posix.acl:
|
||||
path: /run/gitea
|
||||
entity: caddy
|
||||
etype: user
|
||||
permissions: rw
|
||||
default: true
|
||||
state: present
|
||||
|
||||
- name: Upload gitea.conf
|
||||
ansible.builtin.template:
|
||||
src: templates/gitea.conf.j2
|
||||
dest: /etc/gitea.conf
|
||||
owner: root
|
||||
group: _gitea
|
||||
mode: 0640
|
||||
notify:
|
||||
- Restart gitea
|
||||
|
||||
- name: Enable gitea Service
|
||||
runit:
|
||||
name: gitea
|
||||
enabled: true
|
||||
@@ -0,0 +1,65 @@
|
||||
;; see https://docs.gitea.com/administration/config-cheat-sheet for additional documentation.
|
||||
|
||||
RUN_USER = _gitea
|
||||
APP_NAME = gitea
|
||||
[server]
|
||||
PROTOCOL = fcgi+unix
|
||||
DOMAIN = {{ gitea_domain }}
|
||||
ROOT_URL = https://{{ gitea_domain }}/
|
||||
HTTP_ADDR = /run/gitea/gitea.sock
|
||||
UNIX_SOCKET_PERMISSION = 660
|
||||
SSH_ROOT_PATH = /var/lib/gitea/.ssh
|
||||
STATIC_ROOT_PATH = /var/lib/gitea
|
||||
LFS_JWT_SECRET = {{ gitea_lfs_jwt_secret }}
|
||||
[database]
|
||||
DB_TYPE = postgres
|
||||
HOST = /tmp/
|
||||
NAME = gitea
|
||||
USER = _gitea
|
||||
PASSWD =
|
||||
[security]
|
||||
INSTALL_LOCK = true
|
||||
SECRET_KEY = {{ gitea_secret_key }}
|
||||
INTERNAL_TOKEN = {{ gitea_internal_token }}
|
||||
[camo]
|
||||
[oauth2]
|
||||
ENABLED = true
|
||||
JWT_SECRET = {{ gitea_jwt_secret }}
|
||||
[log]
|
||||
ROOT_PATH = /var/log/gitea
|
||||
MODE = console
|
||||
LEVEL = Info
|
||||
[mailer]
|
||||
ENABLED = true
|
||||
PROTOCOL = smtps
|
||||
SMTP_ADDR = mail.johnnynator.de
|
||||
SMTP_PORT = 465
|
||||
FROM = "Gitea <{{gitea_mail }}>"
|
||||
USER = {{ gitea_mail }}
|
||||
PASSWD = {{ gitea_mail_password }}
|
||||
[email.incoming]
|
||||
ENABLED = true
|
||||
HOST = mail.johnnynator.de
|
||||
PORT = 993
|
||||
USERNAME = {{ gitea_mail }}
|
||||
PASSWORD = {{ gitea_mail_password }}
|
||||
USE_TLS = true
|
||||
REPLY_TO_ADDRESS = git+%{token}@cosmosim.dev
|
||||
[session]
|
||||
COOKIE_SECURE = true
|
||||
[git]
|
||||
[service]
|
||||
REGISTER_EMAIL_CONFIRM = true
|
||||
ENABLE_NOTIFY_MAIL = true
|
||||
DISABLE_REGISTRATION = true
|
||||
[service.explore]
|
||||
DISABLE_USERS_PAGE = true
|
||||
[repository]
|
||||
ROOT = /var/lib/gitea/repositories
|
||||
[repository.upload]
|
||||
[indexer]
|
||||
ISSUE_INDEXER_PATH = /var/lib/gitea/indexers/issues.bleve
|
||||
[picture]
|
||||
AVATAR_UPLOAD_PATH = /var/lib/gitea/data/avatars
|
||||
[lfs]
|
||||
PATH = /var/lib/gitea/lfs
|
||||
Reference in New Issue
Block a user