Skip to content

Commit c2d2323

Browse files
author
Gusted
authored
Configure update checker on installation page (#21655)
- 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. ![image](https://user-images.githubusercontent.com/25481501/199260613-a77a1b10-347a-4542-8982-9b9b24dad28c.png)
1 parent f211d23 commit c2d2323

File tree

4 files changed

+11
-0
lines changed

4 files changed

+11
-0
lines changed

options/locale/locale_en-US.ini

+2
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,8 @@ no_reply_address = Hidden Email Domain
238238
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'.
239239
password_algorithm = Password Hash Algorithm
240240
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.
241+
enable_update_checker = Enable Update Checker
242+
enable_update_checker_helper = Checks for new version releases periodically by connecting to gitea.io.
241243

242244
[home]
243245
uname_holder = Username or Email Address

routers/install/install.go

+1
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,7 @@ func SubmitInstall(ctx *context.Context) {
457457
cfg.Section("service").Key("DEFAULT_ALLOW_CREATE_ORGANIZATION").SetValue(fmt.Sprint(form.DefaultAllowCreateOrganization))
458458
cfg.Section("service").Key("DEFAULT_ENABLE_TIMETRACKING").SetValue(fmt.Sprint(form.DefaultEnableTimetracking))
459459
cfg.Section("service").Key("NO_REPLY_ADDRESS").SetValue(fmt.Sprint(form.NoReplyAddress))
460+
cfg.Section("cron.update_checker").Key("ENABLED").SetValue(fmt.Sprint(form.EnableUpdateChecker))
460461

461462
cfg.Section("").Key("RUN_MODE").SetValue("prod")
462463

services/forms/user_form.go

+1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ type InstallForm struct {
6060
DefaultKeepEmailPrivate bool
6161
DefaultAllowCreateOrganization bool
6262
DefaultEnableTimetracking bool
63+
EnableUpdateChecker bool
6364
NoReplyAddress string
6465

6566
PasswordAlgorithm string

templates/install.tmpl

+7
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,13 @@
162162
<input id="log_root_path" name="log_root_path" value="{{.log_root_path}}" placeholder="log" required>
163163
<span class="help">{{.locale.Tr "install.log_root_path_helper"}}</span>
164164
</div>
165+
<div class="inline field">
166+
<label for="enable_update_checker">{{.locale.Tr "install.enable_update_checker"}}</label>
167+
<div class="ui checkbox">
168+
<input name="enable_update_checker" type="checkbox">
169+
</div>
170+
<span class="help">{{.locale.Tr "install.enable_update_checker_helper"}}</span>
171+
</div>
165172

166173

167174
<!-- Optional Settings -->

0 commit comments

Comments
 (0)