From 268262426c16c3d1ce873b4fa8aed27397b556e1 Mon Sep 17 00:00:00 2001 From: Quentin Duchemin Date: Thu, 10 Aug 2023 15:41:24 +0200 Subject: [PATCH] Bump Gitea, fix bad usage of environment Effectively disabling self registrations --- ansible.cfg | 2 +- roles/gitea/templates/docker-compose.yml.j2 | 23 +++++++++++---------- roles/gitea/vars/main.yml | 2 +- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/ansible.cfg b/ansible.cfg index b893919..8af9ebb 100644 --- a/ansible.cfg +++ b/ansible.cfg @@ -3,7 +3,7 @@ # No cows because I am not a funny person nocows = 1 force_color = True -stdout_callback = unixy +#stdout_callback = unixy # Default inventory file, override with -i inventory = ./inv/static.yml diff --git a/roles/gitea/templates/docker-compose.yml.j2 b/roles/gitea/templates/docker-compose.yml.j2 index 13f368e..04237d5 100644 --- a/roles/gitea/templates/docker-compose.yml.j2 +++ b/roles/gitea/templates/docker-compose.yml.j2 @@ -19,17 +19,18 @@ services: environment: USER_UID: 1000 USER_GID: 1000 - DB_TYPE: postgres - DB_HOST: db:5432 - APP_NAME: {{ gitea_name }} - RUN_MODE: prod - DOMAIN: {{ gitea_subdomain }}.{{ domain_name }} - SSH_DOMAIN: {{ gitea_subdomain }}.{{ domain_name }} - ROOT_URL: https://{{ gitea_subdomain }}.{{ domain_name }} - DISABLE_REGISTRATION: "true" - DB_NAME: gitea - DB_USER: gitea - DB_PASSWD: "{{ gitea_db_password }}" + # See https://docs.gitea.com/installation/install-with-docker#managing-deployments-with-environment-variables + GITEA__database__DB_TYPE: postgres + GITEA__database__DB_HOST: db:5432 + GITEA__database__NAME: gitea + GITEA__database__USER: gitea + GITEA__database__PASSWD: "{{ gitea_db_password }}" + GITEA__DEFAULT__APP_NAME: {{ gitea_name }} + GITEA__DEFAULT__RUN_MODE: prod + GITEA__server__DOMAIN: {{ gitea_subdomain }}.{{ domain_name }} + GITEA__server__SSH_DOMAIN: {{ gitea_subdomain }}.{{ domain_name }} + GITEA__server__ROOT_URL: https://{{ gitea_subdomain }}.{{ domain_name }} + GITEA__service__DISABLE_REGISTRATION: "true" networks: - proxy - db diff --git a/roles/gitea/vars/main.yml b/roles/gitea/vars/main.yml index 0d9db20..bc2cc15 100644 --- a/roles/gitea/vars/main.yml +++ b/roles/gitea/vars/main.yml @@ -1,4 +1,4 @@ -gitea_version: "1.14.1" +gitea_version: "1.20" gitea_folder_name: "{{ docker_files }}/gitea" postgres_version: "13" gitea_name: Chostea