Skip to content

Commit fb884c7

Browse files
committed
resolve merge conflicts from thomas-maurice/ansible-role-gitea#62
1 parent ab415b8 commit fb884c7

File tree

4 files changed

+43
-8
lines changed

4 files changed

+43
-8
lines changed

README.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ The following code has been tested with Debian 8, it should work on Ubuntu as we
6868
* `gitea_disable_gravatar`: Do you want to disable Gravatar ? (privacy and so on) (true/false)
6969
* `gitea_offline_mode`: Same but for disabling CDNs for frontend assets (true/false)
7070
* `gitea_disable_registration`: Do you want to disable user registration ? (true/false)
71+
* `gitea_register_email_confirm`: Enable this to ask for mail confirmation of registration. Requires `gitea_mailer_enabled` to be enabled (Default: `false`)
7172
* `gitea_only_allow_external_registration`: Do you want to force registration only using third-party services ? (true/false)
7273
* `gitea_show_registration_button`: Do you want to show the registration button? (true/false)
7374
* `gitea_require_signin`: Do you require a signin to see repo's (even public ones) ? (true/false)
@@ -90,8 +91,9 @@ The following code has been tested with Debian 8, it should work on Ubuntu as we
9091
* `gitea_root_url`: Root URL used to access your web app (full URL)
9192
* `gitea_protocol`: Listening protocol (http/https)
9293
* `gitea_http_listen`: Bind address
93-
* `gitea_http_port`: Bind port
94+
* `gitea_http_port`: Bind port (redirect from `80` will be activated if value is `443` - Default: `3000`)
9495
* `gitea_disable_http_git`: Disable the use of Git over HTTP ? (true/false)
96+
* `gitea_http_letsencrypt_mail` Enable Let`s Encrypt if a email address is given
9597

9698
### SSH configuration
9799

@@ -119,6 +121,7 @@ The following code has been tested with Debian 8, it should work on Ubuntu as we
119121
* `gitea_mailer_user`: SMTP server username
120122
* `gitea_mailer_password`: SMTP server password
121123
* `gitea_mailer_from`: Sender mail address
124+
* `gitea_subject_prefix`: Prefix to be placed before e-mail subject lines (Default: ``)
122125
* `gitea_enable_notify_mail`: Whether e-mail should be send to watchers of a repository when something happens. Default: `false`
123126

124127
### LFS configuration
@@ -127,6 +130,9 @@ The following code has been tested with Debian 8, it should work on Ubuntu as we
127130
* `gitea_lfs_content_path`: path where the lfs files are stored
128131
* `gitea_lfs_secret`: JWT secret for remote LFS usage. Can be generated with ``gitea generate secret JWT_SECRET``
129132

133+
### Log configuration
134+
* `gitea_log_systemd` Disable logging into `file`, use systemd-journald
135+
* `gitea_log_only_warning` Log only warnings or above, no http access or sql logging (Default: `true`)
130136

131137
### Fail2Ban configuration
132138

defaults/main.yml

+6
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ gitea_root_url: http://localhost:3000
2020
gitea_protocol: http
2121
gitea_http_listen: 127.0.0.1
2222
gitea_http_port: 3000
23+
# gitea_http_letsencrypt_mail: - required
2324
gitea_disable_http_git: false
2425
gitea_offline_mode: true
2526

@@ -47,6 +48,7 @@ gitea_disable_git_hooks: true
4748
gitea_show_user_email: false
4849
gitea_disable_gravatar: true
4950
gitea_disable_registration: false
51+
gitea_register_email_confirm: false
5052
gitea_show_registration_button: true
5153
gitea_require_signin: true
5254
gitea_enable_captcha: true
@@ -62,8 +64,12 @@ gitea_mailer_host: localhost:25
6264
gitea_mailer_from: [email protected]
6365
gitea_mailer_user: ""
6466
gitea_mailer_password: ""
67+
gitea_subject_prefix: ""
6568
gitea_mailer_type: smtp
6669

70+
gitea_log_systemd: false
71+
gitea_log_only_warning: true
72+
6773
gitea_fail2ban_enabled: false
6874
gitea_fail2ban_jail_maxretry: 10
6975
gitea_fail2ban_jail_findtime: 3600

templates/gitea.ini.j2

+29-6
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,16 @@ PROTOCOL = {{ gitea_protocol }}
3535
DOMAIN = {{ gitea_http_domain }}
3636
ROOT_URL = {{ gitea_root_url }}
3737
; The address to listen on. Either a IPv4/IPv6 address or the path to a unix socket.
38-
HTTP_ADDR = {{ gitea_http_listen }}
39-
HTTP_PORT = {{ gitea_http_port }}
38+
HTTP_ADDR = {{ gitea_http_listen }}
39+
HTTP_PORT = {{ gitea_http_port }}
40+
{% if gitea_http_port == 443 %}
41+
PORT_TO_REDIRECT = 80
42+
{% endif %}
43+
{% if gitea_http_letsencrypt_mail is defined %}
44+
ENABLE_LETSENCRYPT = true
45+
LETSENCRYPT_ACCEPTTOS = true
46+
LETSENCRYPT_EMAIL = {{ gitea_http_letsencrypt_mail }}
47+
{% endif %}
4048
; Disable SSH feature when not available
4149
DISABLE_SSH = false
4250
; Whether to use the builtin SSH server or not.
@@ -74,7 +82,10 @@ PASSWD = {{ gitea_db_password }}
7482
; For MySQL, either "false" (default), "true", or "skip-verify"
7583
SSL_MODE = {{ gitea_db_ssl }}
7684
; For "sqlite3" and "tidb", use an absolute path when you start gitea as service
77-
PATH = {{ gitea_db_path }}
85+
PATH = {{ gitea_db_path }}
86+
{% if gitea_log_only_warning %}
87+
LOG_SQL = false
88+
{% endif %}
7889

7990
[indexer]
8091
; Issue indexer storage path, available when ISSUE_INDEXER_TYPE is bleve
@@ -104,7 +115,8 @@ DISABLE_GIT_HOOKS = {{ gitea_disable_git_hooks | ternary('true', 'false') }}
104115

105116
[service]
106117
; Disallow registration, only allow admins to create accounts.
107-
DISABLE_REGISTRATION = {{ gitea_disable_registration }}
118+
DISABLE_REGISTRATION = {{ gitea_disable_registration }}
119+
REGISTER_EMAIL_CONFIRM = {{ gitea_register_email_confirm }}
108120
; User must sign in to view anything.
109121
REQUIRE_SIGNIN_VIEW = {{ gitea_require_signin | ternary('true', 'false') }}
110122
; Enable captcha validation for registration
@@ -143,6 +155,7 @@ USER = {{ gitea_mailer_user }}
143155
PASSWD = {{ gitea_mailer_password }}
144156
; Send mails as plain text
145157
SEND_AS_PLAIN_TEXT = false
158+
SUBJECT_PREFIX = {{ gitea_subject_prefix }}
146159
; Set Mailer Type (either SMTP, sendmail or dummy to just send to the log)
147160
MAILER_TYPE = {{ gitea_mailer_type }}
148161
; Specify an alternative sendmail binary
@@ -173,12 +186,22 @@ PATH = {{ gitea_home }}/data/attachments
173186
ROOT_PATH = {{ gitea_home }}/log
174187
; Either "console", "file", "conn", "smtp" or "database", default is "console"
175188
; Use comma to separate multiple modes, e.g. "console, file"
176-
MODE = file
189+
{% if gitea_log_systemd %}
190+
MODE = console
191+
MACARON = console
192+
{% else %}
193+
MODE = file
194+
{% endif %}
177195
; Buffer length of the channel, keep it as it is if you don't know what it is.
178196
BUFFER_LEN = 10000
179197
; Either "Trace", "Debug", "Info", "Warn", "Error", "Critical", default is "Trace"
180-
LEVEL = {{ gitea_log_level }}
198+
{% if gitea_log_only_warning %}
199+
LEVEL = Warn
200+
REDIRECT_MACARON_LOG = true
201+
{% else %}
202+
LEVEL = Info
181203
REDIRECT_MACARON_LOG = false
204+
{% endif %}
182205

183206
[oauth2]
184207
ENABLE = {{ gitea_oauth2_enabled }}

templates/gitea.service.j2

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ After=network.target
55
[Service]
66
User={{ gitea_user }}
77
Group={{ gitea_group }}
8-
ExecStart=/usr/local/bin/gitea web -c /etc/gitea/gitea.ini
8+
ExecStart=/usr/local/bin/gitea web -c /etc/gitea/gitea.ini --custom-path {{ gitea_home }}/custom/
99
Restart=on-failure
1010
WorkingDirectory={{ gitea_home }}
1111
{% if gitea_systemd_cap_net_bind_service %}

0 commit comments

Comments
 (0)