gitea/modules/setting
Giteabot b369ed579d
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>
2023-05-19 15:17:48 +02:00
..
actions.go
admin.go
api.go
attachment.go Add `.patch` to `attachment.ALLOWED_TYPES` (#23580) (#23582) 2023-03-19 16:48:44 -04:00
cache.go
camo.go
config_provider.go
cors.go Fix incorrect CORS default values (#24206) (#24217) 2023-04-19 16:23:25 -04:00
cron.go
cron_test.go
database.go
database_sqlite.go
database_test.go
federation.go
git.go Support reflogs (#22451) (#23438) 2023-03-13 12:20:10 +00:00
highlight.go
i18n.go
incoming_email.go
indexer.go
indexer_test.go
lfs.go
log.go
mailer.go Make mailer SMTP check have timed context (#24751) (#24759) 2023-05-17 06:08:39 -04:00
mailer_test.go
markup.go
metrics.go
migrations.go
mime_type_map.go
mirror.go
oauth2.go
other.go
packages.go
packages_test.go
picture.go
project.go
proxy.go
queue.go
repository.go Fix Actions being enabled accidentally (#24802) (#24810) 2023-05-19 15:17:48 +02:00
security.go
server.go
service.go
session.go
setting.go Fix incorrect CurrentUser check for docker rootless (#24435) 2023-04-29 23:47:04 -04:00
setting_test.go
ssh.go
storage.go Make minio package support legacy MD5 checksum (#23768) (#23770) 2023-03-29 00:02:13 +08:00
storage_test.go
task.go
time.go
ui.go Don't set meta `theme-color` by default (#24340) (#24346) 2023-04-26 01:33:15 -04:00
webhook.go