0
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-12-01 10:01:50 +01:00
gitea/modules/setting
Jason Song 7985cde84d
Fix Actions being enabled accidentally (#24802)
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.**
2023-05-19 19:35:12 +08:00
..
actions.go
admin.go
api.go
asset_dynamic.go
asset_static.go
attachment.go
cache.go
camo.go
config_provider.go Remove unnecessary code (#24610) 2023-05-10 04:57:06 +00:00
cors.go Fix incorrect CORS default values (#24206) 2023-04-19 15:30:10 -04:00
cron_test.go Rewrite queue (#24505) 2023-05-08 19:49:59 +08:00
cron.go
database_sqlite.go
database_test.go
database.go
federation.go
git.go
highlight.go
i18n.go
incoming_email.go
indexer_test.go
indexer.go Rewrite queue (#24505) 2023-05-08 19:49:59 +08:00
lfs.go Increase default LFS auth timeout from 20m to 24h (#24628) 2023-05-10 22:23:47 +08:00
log.go Refactor config provider (#24245) 2023-04-25 23:06:39 +08:00
mailer_test.go Remove unnecessary code (#24610) 2023-05-10 04:57:06 +00:00
mailer.go Make mailer SMTP check have timed context (#24751) 2023-05-16 22:55:51 +02:00
markup.go Add .livemd as a markdown extension (#22730) 2023-04-26 11:22:54 -04:00
metrics.go
migrations.go
mime_type_map.go
mirror.go
oauth2.go Refactor config provider (#24245) 2023-04-25 23:06:39 +08:00
other.go Refactor setting.Other and remove unused SHOW_FOOTER_BRANDING (#24270) 2023-04-22 19:38:25 -04:00
packages_test.go Remove unnecessary code (#24610) 2023-05-10 04:57:06 +00:00
packages.go Add Go package registry (#24687) 2023-05-14 23:38:40 +08:00
picture.go Improve avatar uploading / resizing / compressing, remove Fomantic card module (#24653) 2023-05-13 20:59:11 +02:00
project.go
proxy.go
queue.go Rewrite queue (#24505) 2023-05-08 19:49:59 +08:00
repository.go Fix Actions being enabled accidentally (#24802) 2023-05-19 19:35:12 +08:00
security.go Refactor config provider (#24245) 2023-04-25 23:06:39 +08:00
server.go
service.go
session.go Refactor cookie (#24107) 2023-04-13 15:45:33 -04:00
setting_test.go
setting.go Merge setting.InitXXX into one function with options (#24389) 2023-05-04 11:55:35 +08:00
ssh.go
storage_test.go Rewrite queue (#24505) 2023-05-08 19:49:59 +08:00
storage.go Refactor config provider (#24245) 2023-04-25 23:06:39 +08:00
task.go
time.go Remove unused setting time.FORMAT (#24430) 2023-04-29 22:51:43 +02:00
ui.go Don't set meta theme-color by default (#24340) 2023-04-26 00:56:42 -04:00
webhook.go