From c774c029648606f5d690455f4978528449c5bf36 Mon Sep 17 00:00:00 2001 From: therojam Date: Thu, 12 Nov 2020 01:04:33 +0100 Subject: [PATCH 1/6] added new vars for lfs remote usage git lfs can be hosted elsewhere and therefore need some config --- defaults/main.yml | 2 ++ templates/gitea.ini.j2 | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index 5a90792..8837b9e 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -22,6 +22,8 @@ gitea_offline_mode: true gitea_lfs_server_enabled: false gitea_lfs_content_path: "data/lfs" +gitea_lfs_secret: SomethingVeryLong +gitea_lfs_mode: true gitea_db_type: sqlite3 gitea_db_host: 127.0.0.0:3306 diff --git a/templates/gitea.ini.j2 b/templates/gitea.ini.j2 index f70ec57..6e07f99 100644 --- a/templates/gitea.ini.j2 +++ b/templates/gitea.ini.j2 @@ -58,8 +58,10 @@ APP_DATA_PATH = {{ gitea_home }}/data LFS_START_SERVER = true ; Where to store LFS files. LFS_CONTENT_PATH = {{ gitea_lfs_content_path }} +; if the LFS sotre is not offline/local +LFS_JWT_SECRET = {{ gitea_lfs_secret }} +OFFLINE_MODE = {{ gitea_lfs_mode }} {%- endif %} - [database] ; Either "mysql", "postgres", "mssql" or "sqlite3", it's your choice DB_TYPE = {{ gitea_db_type }} From 2e112c14bd55224302daa5867faef4a509ae8245 Mon Sep 17 00:00:00 2001 From: therojam Date: Thu, 12 Nov 2020 01:10:29 +0100 Subject: [PATCH 2/6] added configuration describtion for lfs vars --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 46c2378..3b35ea6 100644 --- a/README.md +++ b/README.md @@ -136,6 +136,9 @@ As this will only deploy config files, fail2ban already has to be installed or o * `gitea_oauth2_enabled`: Enable the Oauth2 provider (true/false) * `gitea_oauth2_jwt_secret`: JWT secret, cannot be longer than 32 characters +### GIT LFS configuration +* `gitea_lfs_enabled`: Enable GIT LFS (large filesystem) +* `gitea_lfs_mode`: should lfs be in offline mode (true/false) ### Metrics endpoint configuration From 320f9341913ec969fa5c93e222efa2fe511aed51 Mon Sep 17 00:00:00 2001 From: therojam Date: Thu, 12 Nov 2020 14:00:45 +0100 Subject: [PATCH 3/6] added new vars for notifications --- defaults/main.yml | 4 ++++ templates/gitea.ini.j2 | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/defaults/main.yml b/defaults/main.yml index 8837b9e..81fe86e 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -49,6 +49,10 @@ gitea_require_signin: true gitea_enable_captcha: true gitea_only_allow_external_registration: false gitea_enable_notify_mail: false +gitea_mail_default: onmention +gitea_autowatch_new_repo: false +gitea_autowatch_on_change: true +gitea_show_mailstones_dashboard: true gitea_force_private: false diff --git a/templates/gitea.ini.j2 b/templates/gitea.ini.j2 index 6e07f99..ff63327 100644 --- a/templates/gitea.ini.j2 +++ b/templates/gitea.ini.j2 @@ -119,6 +119,11 @@ RECAPTCHA_SITEKEY = SHOW_REGISTRATION_BUTTON = {{ gitea_show_registration_button }} ALLOW_ONLY_EXTERNAL_REGISTRATION = {{ gitea_only_allow_external_registration }} ENABLE_NOTIFY_MAIL = {{ gitea_enable_notify_mail }} +DEFAULT_EMAIL_NOTIFICATIONS = {{ gitea_mail_default }} +AUTO_WATCH_NEW_REPOS = {{ gitea_autowatch_new_repo }} +AUTO_WATCH_ON_CHANGES = {{ gitea_autowatch_on_change }} +SHOW_MILESTONES_DASHBOARD_PAGE = {{ gitea_show_mailstones_dashboard }} + [mailer] ENABLED = {{ gitea_mailer_enabled }} From 1c8fae32b0c1df99af98332e0d77421b2f44074c Mon Sep 17 00:00:00 2001 From: therojam Date: Thu, 12 Nov 2020 14:11:07 +0100 Subject: [PATCH 4/6] added describtion for new vars for mail notis --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 3b35ea6..168c8a2 100644 --- a/README.md +++ b/README.md @@ -118,6 +118,10 @@ The following code has been tested with Debian 8, it should work on Ubuntu as we * `gitea_mailer_password`: SMTP server password * `gitea_mailer_from`: Sender mail address * `gitea_enable_notify_mail`: Whether e-mail should be send to watchers of a repository when something happens. Default: `false` +* `gitea_mail_default`: Default configuration for email notifications for users (user configurable). Options: enabled, onmention, disable (Default: `onmention` ) +* `gitea_autowatch_new_repo`: Enable this to let all organisation users watch new repos when they are created (Default: `false`) +* `gitea_autowatch_on_change`: Enable this to make users watch a repository after their first commit to it (Default: `true`) +* `gitea_show_mailstones_dashboard`: Enable this to show the milestones dashboard page - a view of all the user’s milestones (Default: `true`) ### Fail2Ban configuration From 906c8e4e635bf0b5f0a892eb10b04055eee85ddb Mon Sep 17 00:00:00 2001 From: therojam Date: Thu, 12 Nov 2020 23:24:39 +0100 Subject: [PATCH 5/6] added gitea_lfs_secret describtion to README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 168c8a2..fa32fa9 100644 --- a/README.md +++ b/README.md @@ -143,6 +143,7 @@ As this will only deploy config files, fail2ban already has to be installed or o ### GIT LFS configuration * `gitea_lfs_enabled`: Enable GIT LFS (large filesystem) * `gitea_lfs_mode`: should lfs be in offline mode (true/false) +* `gitea_lfs_secret`: JWT secret for remote LFS usage ### Metrics endpoint configuration From f000dc15ddf37d5b0646072ac88fea2b02316f01 Mon Sep 17 00:00:00 2001 From: therojam Date: Thu, 12 Nov 2020 23:25:21 +0100 Subject: [PATCH 6/6] remove whitespaces and lines --- templates/gitea.ini.j2 | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/templates/gitea.ini.j2 b/templates/gitea.ini.j2 index ff63327..60b7265 100644 --- a/templates/gitea.ini.j2 +++ b/templates/gitea.ini.j2 @@ -59,8 +59,8 @@ LFS_START_SERVER = true ; Where to store LFS files. LFS_CONTENT_PATH = {{ gitea_lfs_content_path }} ; if the LFS sotre is not offline/local -LFS_JWT_SECRET = {{ gitea_lfs_secret }} -OFFLINE_MODE = {{ gitea_lfs_mode }} +LFS_JWT_SECRET = {{ gitea_lfs_secret }} +OFFLINE_MODE = {{ gitea_lfs_mode }} {%- endif %} [database] ; Either "mysql", "postgres", "mssql" or "sqlite3", it's your choice @@ -124,7 +124,6 @@ AUTO_WATCH_NEW_REPOS = {{ gitea_autowatch_new_repo }} AUTO_WATCH_ON_CHANGES = {{ gitea_autowatch_on_change }} SHOW_MILESTONES_DASHBOARD_PAGE = {{ gitea_show_mailstones_dashboard }} - [mailer] ENABLED = {{ gitea_mailer_enabled }} ; Mail server