From d8a98e36cf02fd6dce23033a4489b55f06c4085c Mon Sep 17 00:00:00 2001 From: Gusted Date: Tue, 1 Nov 2022 15:22:37 +0100 Subject: [PATCH 1/6] Don't enable update checker by-default - I recently became aware that this was enabled by-default, I don't necessary agree with that and this should rather be configured by the user(this patch does that on the installation page) as it connects to a homeserver, which I'd prefer to avoid on my instance. --- options/locale/locale_en-US.ini | 2 ++ routers/install/install.go | 1 + services/cron/tasks_extended.go | 2 +- services/forms/user_form.go | 1 + templates/install.tmpl | 7 ++++++- 5 files changed, 11 insertions(+), 2 deletions(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 1566dfc97d422..5f340c176c3c4 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -238,6 +238,8 @@ no_reply_address = Hidden Email Domain no_reply_address_helper = Domain name for users with a hidden email address. For example, the username 'joe' will be logged in Git as 'joe@noreply.example.org' if the hidden email domain is set to 'noreply.example.org'. password_algorithm = Password Hash Algorithm password_algorithm_helper = Set the password hashing algorithm. Algorithms have differing requirements and strength. `argon2` whilst having good characteristics uses a lot of memory and may be inappropriate for small systems. +enable_update_checker = Enable the update checker +enable_update_checker_helper = Checks for new version releases periodically by connecting to gitea.io [home] uname_holder = Username or Email Address diff --git a/routers/install/install.go b/routers/install/install.go index 962dee8c8609a..6bac5b5ff7f4b 100644 --- a/routers/install/install.go +++ b/routers/install/install.go @@ -457,6 +457,7 @@ func SubmitInstall(ctx *context.Context) { cfg.Section("service").Key("DEFAULT_ALLOW_CREATE_ORGANIZATION").SetValue(fmt.Sprint(form.DefaultAllowCreateOrganization)) cfg.Section("service").Key("DEFAULT_ENABLE_TIMETRACKING").SetValue(fmt.Sprint(form.DefaultEnableTimetracking)) cfg.Section("service").Key("NO_REPLY_ADDRESS").SetValue(fmt.Sprint(form.NoReplyAddress)) + cfg.Section("cron.update_checker").Key("ENABLED").SetValue(fmt.Sprint(form.EnableUpdateChecker)) cfg.Section("").Key("RUN_MODE").SetValue("prod") diff --git a/services/cron/tasks_extended.go b/services/cron/tasks_extended.go index c730477cbd063..976ce26ba64a1 100644 --- a/services/cron/tasks_extended.go +++ b/services/cron/tasks_extended.go @@ -151,7 +151,7 @@ func registerUpdateGiteaChecker() { } RegisterTaskFatal("update_checker", &UpdateCheckerConfig{ BaseConfig: BaseConfig{ - Enabled: true, + Enabled: false, RunAtStart: false, Schedule: "@every 168h", }, diff --git a/services/forms/user_form.go b/services/forms/user_form.go index 036c2ca3ec2c5..95e4f9ed0e6c1 100644 --- a/services/forms/user_form.go +++ b/services/forms/user_form.go @@ -60,6 +60,7 @@ type InstallForm struct { DefaultKeepEmailPrivate bool DefaultAllowCreateOrganization bool DefaultEnableTimetracking bool + EnableUpdateChecker bool NoReplyAddress string PasswordAlgorithm string diff --git a/templates/install.tmpl b/templates/install.tmpl index 36f58218d4638..359b0a0dd562a 100644 --- a/templates/install.tmpl +++ b/templates/install.tmpl @@ -163,7 +163,6 @@ {{.locale.Tr "install.log_root_path_helper"}} -

{{.locale.Tr "install.optional_title"}}

@@ -284,6 +283,12 @@ +
+
+ + +
+
From d4533e897af7f3b23a2fee9c9086b9f7c34d4631 Mon Sep 17 00:00:00 2001 From: Gusted Date: Tue, 1 Nov 2022 15:28:40 +0100 Subject: [PATCH 2/6] Use correct variable --- options/locale/locale_en-US.ini | 2 +- templates/install.tmpl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 5f340c176c3c4..ec77493f460b3 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -239,7 +239,7 @@ no_reply_address_helper = Domain name for users with a hidden email address. For password_algorithm = Password Hash Algorithm password_algorithm_helper = Set the password hashing algorithm. Algorithms have differing requirements and strength. `argon2` whilst having good characteristics uses a lot of memory and may be inappropriate for small systems. enable_update_checker = Enable the update checker -enable_update_checker_helper = Checks for new version releases periodically by connecting to gitea.io +enable_update_checker_popup = Checks for new version releases periodically by connecting to gitea.io [home] uname_holder = Username or Email Address diff --git a/templates/install.tmpl b/templates/install.tmpl index 359b0a0dd562a..d2e1fd5f1712a 100644 --- a/templates/install.tmpl +++ b/templates/install.tmpl @@ -285,7 +285,7 @@
- +
From 3516afcd0c69280cce1d7e914b78db15ef2d5263 Mon Sep 17 00:00:00 2001 From: Gusted Date: Tue, 1 Nov 2022 15:29:24 +0100 Subject: [PATCH 3/6] Revert whitespace --- templates/install.tmpl | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/install.tmpl b/templates/install.tmpl index d2e1fd5f1712a..b72184143e31b 100644 --- a/templates/install.tmpl +++ b/templates/install.tmpl @@ -163,6 +163,7 @@ {{.locale.Tr "install.log_root_path_helper"}} +

{{.locale.Tr "install.optional_title"}}

From 43b4a9e6fcc1cb9038a6881b740ce662422b14df Mon Sep 17 00:00:00 2001 From: Gusted Date: Tue, 1 Nov 2022 15:42:11 +0100 Subject: [PATCH 4/6] Move option to General section --- options/locale/locale_en-US.ini | 4 ++-- templates/install.tmpl | 13 +++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index ec77493f460b3..ac2b2ecc99d8a 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -238,8 +238,8 @@ no_reply_address = Hidden Email Domain no_reply_address_helper = Domain name for users with a hidden email address. For example, the username 'joe' will be logged in Git as 'joe@noreply.example.org' if the hidden email domain is set to 'noreply.example.org'. password_algorithm = Password Hash Algorithm password_algorithm_helper = Set the password hashing algorithm. Algorithms have differing requirements and strength. `argon2` whilst having good characteristics uses a lot of memory and may be inappropriate for small systems. -enable_update_checker = Enable the update checker -enable_update_checker_popup = Checks for new version releases periodically by connecting to gitea.io +enable_update_checker = Enable Update Checker +enable_update_checker_helper = Checks for new version releases periodically by connecting to gitea.io. [home] uname_holder = Username or Email Address diff --git a/templates/install.tmpl b/templates/install.tmpl index b72184143e31b..d8512b243a888 100644 --- a/templates/install.tmpl +++ b/templates/install.tmpl @@ -162,6 +162,13 @@ {{.locale.Tr "install.log_root_path_helper"}} +
+ +
+ +
+ {{.locale.Tr "install.enable_update_checker_helper"}} +
@@ -284,12 +291,6 @@ -
-
- - -
-
From c47cd923ffa9e88893d34dd0ce5e21ab85c513c7 Mon Sep 17 00:00:00 2001 From: Gusted Date: Tue, 1 Nov 2022 19:45:54 +0100 Subject: [PATCH 5/6] Revert disable-by-default --- services/cron/tasks_extended.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/cron/tasks_extended.go b/services/cron/tasks_extended.go index 976ce26ba64a1..c730477cbd063 100644 --- a/services/cron/tasks_extended.go +++ b/services/cron/tasks_extended.go @@ -151,7 +151,7 @@ func registerUpdateGiteaChecker() { } RegisterTaskFatal("update_checker", &UpdateCheckerConfig{ BaseConfig: BaseConfig{ - Enabled: false, + Enabled: true, RunAtStart: false, Schedule: "@every 168h", }, From 2f1ed0b3be6eef992af7dc7f506bd763ee2d8c5b Mon Sep 17 00:00:00 2001 From: Gusted Date: Tue, 1 Nov 2022 19:47:21 +0100 Subject: [PATCH 6/6] Remove unnecessary code --- templates/install.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/install.tmpl b/templates/install.tmpl index d8512b243a888..8d6918e6a29c5 100644 --- a/templates/install.tmpl +++ b/templates/install.tmpl @@ -165,7 +165,7 @@
- +
{{.locale.Tr "install.enable_update_checker_helper"}}