diff --git a/README.md b/README.md index 23ad026..54daa70 100644 --- a/README.md +++ b/README.md @@ -183,8 +183,9 @@ Either you define exactly which release you install. Or you use the option ``lat | variable name | default value | description | | ------------- | ------------- | ----------- | | `gitea_secret_key` | `''` | Global secret key. Will be autogenerated if not defined. Should be unique. | -| `gitea_internal_token` | `''` | Internal API token. Will be autogenerated if not defined. Should be unique. | | `gitea_disable_git_hooks` | `true` | Set to false to enable users with git hook privilege to create custom git hooks. Can be dangerous. | +| `gitea_disable_webhooks` | `false` | Set to true to disable webhooks feature. | +| `gitea_internal_token` | `''` | Internal API token. Will be autogenerated if not defined. Should be unique. | | `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. | @@ -206,15 +207,20 @@ Either you define exactly which release you install. Or you use the option ``lat | variable name | default value | description | | ------------- | ------------- | ----------- | | `gitea_mailer_enabled` | `false` | Whether to enable the mailer. | -| `gitea_mailer_host` | `localhost:25` | SMTP server hostname and port | -| `gitea_mailer_skip_verify` | `false` | Skip SMTP TLS certificate verification (true/false) | -| `gitea_mailer_tls_enabled` | `true` | Forcibly use TLS to connect even if not on a default SMTPS port. | -| `gitea_mailer_from` | `noreply@{{ gitea_http_domain }}` | Mail from address, RFC 5322. This can be just an email address, or the “Name” format. | -| `gitea_mailer_user` | `''` | Username of mailing user *(usually the sender’s e-mail address)*. | -| `gitea_mailer_password` | `''` | SMTP server password | -| `gitea_subject_prefix` | `''` | Prefix to be placed before e-mail subject lines | -| `gitea_mailer_type` | `smtp` | `[smtp, sendmail, dummy]` | -| `gitea_mailer_extra_config` | `''` | you can use this variable to pass additional config parameters in the `[mailer]` section of the config. | +| `gitea_mailer_protocol` | `dummy` |Mail server protocol. One of “smtp”, “smtps”, “smtp+starttls”, “smtp+unix”, “sendmail”, “dummy”.| +| `gitea_mailer_smtp_addr` | | Mail server address. e.g. smtp.gmail.com. For smtp+unix, this should be a path to a unix socket instead. | +| `gitea_mailer_smtp_port` | | Mail server port | +| `gitea_mailer_use_client_cert` | `false` | Use client certificate for TLS/SSL. | +| `gitea_mailer_client_cert_file` | | Client certificate file. | +| `gitea_mailer_client_key_file` | | Client key file. | +| `gitea_mailer_force_trust_server_cert` | `false` | completely ignores server certificate validation errors. This option is unsafe. Consider adding the certificate to the system trust store instead. | +| `gitea_mailer_user` | | Username of mailing user (usually the sender’s e-mail address). | +| `gitea_mailer_password ` | |Password of mailing user. Use `your password` for quoting if you use special characters in the password. | +| `gitea_mailer_enable_helo` | `true` |Enable HELO operation. | +| `gitea_mailer_from` | `noreply@{{ gitea_http_domain }}` | Mail from address, RFC 5322. | +| `gitea_subject_prefix` | |Prefix to be placed before e-mail subject lines. | +| `gitea_mailer_send_as_plaintext` | `false` | Send mails only in plain text, without HTML alternative. | +| `gitea_mailer_extra_config` | | you can use this variable to pass additional config parameters in the `[mailer]` section of the config. | ### Session ([session](https://docs.gitea.io/en-us/config-cheat-sheet/#session-session)) | variable name | default value | description | diff --git a/defaults/main.yml b/defaults/main.yml index 041dfa3..71e4ae9 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -135,8 +135,9 @@ gitea_queue_issue_indexer_extra_config: '' # Security (security) # -> https://docs.gitea.io/en-us/config-cheat-sheet/#security-security gitea_secret_key: '' -gitea_internal_token: '' gitea_disable_git_hooks: true +gitea_disable_webhooks: false +gitea_internal_token: '' gitea_password_check_pwn: false gitea_security_extra_config: '' @@ -156,14 +157,19 @@ gitea_service_extra_config: '' # Mailer [mailer] # -> https://docs.gitea.io/en-us/config-cheat-sheet/#mailer-mailer gitea_mailer_enabled: false -gitea_mailer_host: 'localhost:25' -gitea_mailer_skip_verify: false -gitea_mailer_tls_enabled: true -gitea_mailer_from: "noreply@{{ gitea_http_domain }}" +gitea_mailer_protocol: 'dummy' +gitea_mailer_smtp_addr: '' +gitea_mailer_smtp_port: '' +gitea_mailer_use_client_cert: false +gitea_mailer_client_cert_file: '' +gitea_mailer_client_key_file: '' +gitea_mailer_force_trust_server_cert: false gitea_mailer_user: '' gitea_mailer_password: '' +gitea_mailer_enable_helo: true +gitea_mailer_from: "noreply@{{ gitea_http_domain }}" gitea_subject_prefix: '' -gitea_mailer_type: smtp +gitea_mailer_send_as_plaintext: false gitea_mailer_extra_config: '' # Session (session) diff --git a/templates/gitea.ini.j2 b/templates/gitea.ini.j2 index eb28765..72c54d3 100644 --- a/templates/gitea.ini.j2 +++ b/templates/gitea.ini.j2 @@ -147,10 +147,11 @@ DATADIR = {{ gitea_home }}/indexers/issues.queue [security] INSTALL_LOCK = true SECRET_KEY = {{ gitea_secret_key }} -INTERNAL_TOKEN = {{ gitea_internal_token }} DISABLE_GIT_HOOKS = {{ gitea_disable_git_hooks | ternary('true', 'false') }} +DISABLE_WEBHOOKS = { gitea_disable_webhooks | ternary('true', 'false') } +INTERNAL_TOKEN = {{ gitea_internal_token }} PASSWORD_CHECK_PWN = {{ gitea_password_check_pwn | ternary('true', 'false') }} -{{ gitea_security_extra_config }} +{% if gitea_security_extra_config != '' %}{{ gitea_security_extra_config }}{% else %};{% endif %} ; ; ; -> https://docs.gitea.io/en-us/config-cheat-sheet/#service-service @@ -164,28 +165,37 @@ SHOW_REGISTRATION_BUTTON = {{ gitea_show_registration_button | ternary( 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 }} +{% if gitea_service_extra_config != '' %}{{ gitea_service_extra_config }}{% else %};{% endif %} ; ; ; -> https://docs.gitea.io/en-us/config-cheat-sheet/#mailer-mailer [mailer] -ENABLED = {{ gitea_mailer_enabled | ternary('true', 'false') }} -HOST = {{ gitea_mailer_host }} -SKIP_VERIFY = {{ gitea_mailer_skip_verify | ternary('true', 'false') }} -IS_TLS_ENABLED = {{ gitea_mailer_tls_enabled | ternary('true', 'false') }} -FROM = {{ gitea_mailer_from }} -USER = {{ gitea_mailer_user }} -PASSWD = `{{ gitea_mailer_password }}` -SUBJECT_PREFIX = {{ gitea_subject_prefix }} -MAILER_TYPE = {{ gitea_mailer_type }} -{{ gitea_mailer_extra_config }} +ENABLED = {{ gitea_mailer_enabled | ternary('true', 'false') }} +{%- if gitea_mailer_enabled | bool %} +PROTOCOL = {{ gitea_mailer_protocol }} +SMTP_ADDR = {{ gitea_mailer_smtp_addr }} +SMTP_PORT = {{ gitea_mailer_smtp_port }} +USE_CLIENT_CERT = {{ gitea_mailer_use_client_cert | ternary('true', 'false') }} +{%- if gitea_mailer_use_client_cert | bool %} +CLIENT_CERT_FILE = {{ gitea_mailer_client_cert_file }} +CLIENT_KEY_FILE = {{ gitea_mailer_client_key_file }} +{%- endif %} +FORCE_TRUST_SERVER_CERT = {{ gitea_mailer_force_trust_server_cert | ternary('true', 'false') }} +USER = {{ gitea_mailer_user }} +PASSWD = `{{ gitea_mailer_password }}` +ENABLE_HELO = {{ gitea_mailer_enable_helo | ternary('true', 'false') }} +FROM = {{ gitea_mailer_from }} +SUBJECT_PREFIX = {{ gitea_subject_prefix }} +SEND_AS_PLAIN_TEXT = {{ gitea_mailer_send_as_plaintext | ternary('true', 'false') }} +{% if gitea_mailer_extra_config != '' %}{{ gitea_mailer_extra_config }}{% else %};{% endif %} +{%- endif %} ; ; ; -> https://docs.gitea.io/en-us/config-cheat-sheet/#session-session [session] PROVIDER = {{ gitea_session_provider }} PROVIDER_CONFIG = {{ gitea_home }}/data/sessions -{{ gitea_session_extra_config }} +{% if gitea_session_extra_config != '' %}{{ gitea_session_extra_config }}{% else %};{% endif %} ; ; ; -> https://docs.gitea.io/en-us/config-cheat-sheet/#picture-picture