forgejo/modules/setting
Giteabot 88bde31515
Fix Actions being enabled accidentally (#24802) (#24810)
Backport #24802 by @wolfogre

Regression of #24536. If the user doesn't explicitly disable Actions, it
will be enabled.

1. Gitea will call `loadRepositoryFrom` before `loadActionsFrom`.

25d4f95df2/modules/setting/setting.go (L234-L237)
2. In `loadRepositoryFrom`,
`rootCfg.Section("actions").Key("ENABLED").MustBool(true)` will set
`actions.ENABLED` with `true`.

25d4f95df2/modules/setting/repository.go (L313-L315)
3. In `loadActionsFrom`, `rootCfg.Section("actions")` will get a section
with Actions enabled.

25d4f95df2/modules/setting/actions.go (L23-L26)

Although the cause of the problem was using `true` by copy-paste
mistake, it also surprised me that
**`rootCfg.Section("actions").Key("ENABLED").MustBool(true)` doesn't
only read, but also write.**

Co-authored-by: Jason Song <i@wolfogre.com>
(cherry picked from commit b369ed579d)
2023-05-23 07:42:34 +02:00
..
actions.go [BRANDING] DEFAULT_ACTIONS_URL = https://codeberg.org 2023-05-10 11:05:22 +02:00
admin.go Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
api.go Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
attachment.go Add .patch to attachment.ALLOWED_TYPES (#23580) (#23582) 2023-03-19 16:48:44 -04:00
cache.go Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
camo.go Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
config_provider.go handle deprecated settings (#22992) 2023-02-20 16:18:26 -06:00
cors.go Fix incorrect CORS default values (#24206) (#24217) 2023-04-19 16:23:25 -04:00
cron.go Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
cron_test.go Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
database.go [BRANDING] Rebrand default config settings for new installs (#140) 2023-05-10 11:05:21 +02:00
database_sqlite.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
database_test.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
federation.go Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
git.go Support reflogs (#22451) (#23438) 2023-03-13 12:20:10 +00:00
highlight.go Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
i18n.go Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
incoming_email.go Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
indexer.go handle deprecated settings (#22992) 2023-02-20 16:18:26 -06:00
indexer_test.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
lfs.go handle deprecated settings (#22992) 2023-02-20 16:18:26 -06:00
log.go [BRANDING] cosmetic s/Gitea/Forgejo/ in logs, messages, etc. 2023-05-10 11:05:22 +02:00
mailer.go Make mailer SMTP check have timed context (#24751) (#24759) 2023-05-23 07:42:34 +02:00
mailer_test.go Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
markup.go Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
metrics.go Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
migrations.go Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
mime_type_map.go Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
mirror.go handle deprecated settings (#22992) 2023-02-20 16:18:26 -06:00
oauth2.go Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
other.go Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
packages.go Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
packages_test.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
picture.go Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
project.go Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
proxy.go Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
queue.go Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
repository.go Fix Actions being enabled accidentally (#24802) (#24810) 2023-05-23 07:42:34 +02:00
security.go Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
server.go [BRANDING] Rebrand default config settings for new installs (#140) 2023-05-10 11:05:21 +02:00
service.go Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
session.go Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
setting.go [BRANDING] alias {FORGEJO,GITEA}_{CUSTOM,WORK_DIR} 2023-05-10 11:05:22 +02:00
setting_test.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
ssh.go Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
storage.go Make minio package support legacy MD5 checksum (#23768) (#23770) 2023-03-29 00:02:13 +08:00
storage_test.go Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
task.go handle deprecated settings (#22992) 2023-02-20 16:18:26 -06:00
time.go Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
ui.go [BRANDING] Rebrand default meta tags 2023-05-10 11:05:22 +02:00
webhook.go [BRANDING] define the forgejo webhook type 2023-05-10 11:05:22 +02:00