diff --git a/group_vars/all/07_applications.yml b/group_vars/all/07_applications.yml index dc3afb02..1303146f 100644 --- a/group_vars/all/07_applications.yml +++ b/group_vars/all/07_applications.yml @@ -98,9 +98,14 @@ defaults_applications: ## Gitea gitea: - version: "latest" + version: "latest" # Use latest docker image database: - central_storage: True # Activate Central Database Storage + central_storage: True # Activate Central Database Storage + configuration: + repository: + enable_push_create_user: True # Allow users to push local repositories to Gitea and have them automatically created for a user. + default_private: last # Default private when creating a new repository: last, private, public + default_push_create_private: True # Default private when creating a new repository with push-to-create. ## Gitlab gitlab: diff --git a/roles/docker-gitea/templates/env.j2 b/roles/docker-gitea/templates/env.j2 index ade88d2d..b1739829 100644 --- a/roles/docker-gitea/templates/env.j2 +++ b/roles/docker-gitea/templates/env.j2 @@ -1,3 +1,6 @@ +# Configuration +# @see https://docs.gitea.com/next/administration/config-cheat-sheet#repository-repository + USER_UID=1000 USER_GID=1000 DB_TYPE=mysql @@ -10,4 +13,21 @@ SSH_LISTEN_PORT=22 DOMAIN={{domains[application_id]}} SSH_DOMAIN={{domains[application_id]}} RUN_MODE="{{run_mode}}" -ROOT_URL="https://{{domains[application_id]}}/" \ No newline at end of file +ROOT_URL="https://{{domains[application_id]}}/" + +# Mail Configuration +# @see https://docs.gitea.com/next/installation/install-with-docker#managing-deployments-with-environment-variables +# @todo test +GITEA__mailer__ENABLED=true +GITEA__mailer__FROM={{ system_email.from }} +GITEA__mailer__PROTOCOL=smtps +GITEA__mailer__SMTP_ADDR={{ system_email.host }} +GITEA__mailer__SMTP_PORT={{ system_email.port }} +GITEA__mailer__USER={{system_email.username}} +GITEA__mailer__PASSWD={{ system_email.password }} + +# Allow push creation +# @see https://github.com/go-gitea/gitea/issues/17619 +GITEA__REPOSITORY__ENABLE_PUSH_CREATE_USER={{ applications[application_id].configuration.repository.enable_push_create_user | lower }} +GITEA__REPOSITORY__DEFAULT_PRIVATE={{ applications[application_id].configuration.repository.default_private | lower }} +GITEA__REPOSITORY__DEFAULT_PUSH_CREATE_PRIVATE={{ applications[application_id].configuration.repository.default_push_create_private | lower }} \ No newline at end of file