From 9e98056b43e9e8b64838a0ddb8ec2f5e7df3aebc Mon Sep 17 00:00:00 2001 From: L3D Date: Sun, 21 Mar 2021 22:58:34 +0100 Subject: [PATCH] reorder service variables --- README.md | 19 +++++++++++-------- defaults/main.yml | 12 ++++++++---- templates/gitea.ini.j2 | 21 ++++++++------------- 3 files changed, 27 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index efe3dba..104509e 100644 --- a/README.md +++ b/README.md @@ -145,6 +145,17 @@ Here is a deeper insight into the variables of this gitea role. For the exact fu | `gitea_password_check_pwn` | `false` | Check [HaveIBeenPwned](https://haveibeenpwned.com/Passwords) to see if a password has been exposed. | | `gitea_security_extra_config` | `''` | you can use this variable to pass additional config parameters in the `[security]` section of the config. | +### Service ([service](https://docs.gitea.io/en-us/config-cheat-sheet/#service-service)) +| `gitea_disable_registration` | `false` | Do you want to disable user registration? (true/false) | +| `gitea_register_email_confirm` | `false` | Enable this to ask for mail confirmation of registration. Requires `gitea_mailer_enabled` to be enabled. | +| `gitea_require_signin` | `true` | Do you require a signin to see repo's (even public ones)? (true/false)| +| `gitea_enable_captcha` | `true` | Do you want to enable captcha's ? (true/false)| +| `gitea_show_registration_button` | `true` | Here you can hide the registration button. This will not disable registration! (true/false)| +| `gitea_only_allow_external_registration` | `false` | Set to true to force registration only using third-party services (true/false) | +| `gitea_enable_notify_mail` | `false` | Enable this to send e-mail to watchers of a repository when something happens, like creating issues (true/false) | +| `gitea_auto_watch_new_repos` | `true` | Enable this to let all organisation users watch new repos when they are created (true/false) | +| `gitea_service_extra_config` | `''` | you can use this variable to pass additional config parameters in the `[service]` section of the config. | + @@ -153,14 +164,6 @@ Here is a deeper insight into the variables of this gitea role. For the exact fu | variable name | default value | description | | ------------- | ------------- | ----------- | | `gitea_disable_gravatar` | `true` | Do you want to disable Gravatar ? (privacy and so on) (true/false) | -| `gitea_disable_registration` | `false` | Do you want to disable user registration? (true/false) | -| `gitea_register_email_confirm` | `false` | Enable this to ask for mail confirmation of registration. Requires `gitea_mailer_enabled` to be enabled. | -| `gitea_only_allow_external_registration` | `false` | Set to true to force registration only using third-party services (true/false) | -| `gitea_show_registration_button` | `true` | Here you can hide the registration button. This will not disable registration! (true/false)| -| `gitea_require_signin` | `true` | Do you require a signin to see repo's (even public ones)? (true/false)| -| `gitea_enable_captcha` | `true` | Do you want to enable captcha's ? (true/false)| -| `gitea_enable_notify_mail` | `false` | Enable this to send e-mail to watchers of a repository when something happens, like creating issues (true/false) | -| `gitea_auto_watch_new_repos` | `true` | Enable this to let all organisation users watch new repos when they are created (true/false) | ### Security diff --git a/defaults/main.yml b/defaults/main.yml index 55012c2..4d7bb70 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -78,16 +78,20 @@ gitea_disable_git_hooks: true gitea_password_check_pwn: false gitea_security_extra_config: '' -# look and feel -gitea_disable_gravatar: true +# Service (service) +# -> https://docs.gitea.io/en-us/config-cheat-sheet/#service-service gitea_disable_registration: false gitea_register_email_confirm: false -gitea_only_allow_external_registration: false -gitea_show_registration_button: true gitea_require_signin: true gitea_enable_captcha: true +gitea_show_registration_button: true +gitea_only_allow_external_registration: false gitea_enable_notify_mail: false gitea_auto_watch_new_repos: true +gitea_service_extra_config: '' + +# look and feel +gitea_disable_gravatar: true # security gitea_lfs_jwt_secret: '' diff --git a/templates/gitea.ini.j2 b/templates/gitea.ini.j2 index a38f2ed..a5a9ffa 100644 --- a/templates/gitea.ini.j2 +++ b/templates/gitea.ini.j2 @@ -96,26 +96,21 @@ PASSWORD_CHECK_PWN = {{ gitea_password_check_pwn | ternary('true', 'false') }} {{ gitea_security_extra_config }} ; ; -; +; -> https://docs.gitea.io/en-us/config-cheat-sheet/#service-service [service] -; Disallow registration, only allow admins to create accounts. -DISABLE_REGISTRATION = {{ gitea_disable_registration }} -REGISTER_EMAIL_CONFIRM = {{ gitea_register_email_confirm }} -; User must sign in to view anything. +DISABLE_REGISTRATION = {{ gitea_disable_registration | ternary('true', 'false') }} +REGISTER_EMAIL_CONFIRM = {{ gitea_register_email_confirm | ternary('true', 'false') }} REQUIRE_SIGNIN_VIEW = {{ gitea_require_signin | ternary('true', 'false') }} -; Enable captcha validation for registration ENABLE_CAPTCHA = {{ gitea_enable_captcha | ternary('true', 'false') }} -; Type of captcha you want to use. Options: image, recaptcha -CAPTCHA_TYPE = image -; Enable recaptcha to use Google's recaptcha service -; Go to https://www.google.com/recaptcha/admin to sign up for a key -RECAPTCHA_SECRET = -RECAPTCHA_SITEKEY = -; Show Registration button SHOW_REGISTRATION_BUTTON = {{ gitea_show_registration_button | ternary('true', 'false') }} ALLOW_ONLY_EXTERNAL_REGISTRATION = {{ gitea_only_allow_external_registration | ternary('true', 'false') }} ENABLE_NOTIFY_MAIL = {{ gitea_enable_notify_mail | ternary('true', 'false') }} AUTO_WATCH_NEW_REPOS = {{ gitea_auto_watch_new_repos | ternary('true', 'false') }} +{{ gitea_service_extra_config }} +; +; +; + [mailer] ENABLED = {{ gitea_mailer_enabled | ternary('true', 'false') }} ; Mail server