summaryrefslogtreecommitdiffstats
path: root/modules/setting/repository.go
diff options
context:
space:
mode:
authorGergely Nagy <forgejo@gergo.csillger.hu>2024-02-25 11:58:23 +0100
committerGergely Nagy <forgejo@gergo.csillger.hu>2024-02-25 12:00:17 +0100
commit0ea021c8c94a11372c0edf6ed5f9705da8750e01 (patch)
treec8b12a9a9c020888224d9c5661b6fd639d590bb3 /modules/setting/repository.go
parentMerge pull request 'Fixes #2452 - Skipping SHA256 tests if unsupported' (#245... (diff)
downloadforgejo-0ea021c8c94a11372c0edf6ed5f9705da8750e01.tar.xz
forgejo-0ea021c8c94a11372c0edf6ed5f9705da8750e01.zip
Allow instance-wide disabling of forking
For small, personal self-hosted instances with no user signups, the fork button is just a noise. This patch allows disabling them like stars can be disabled too. Disabling forks does not only remove the buttons from the web UI, it also disables the routes that could be used to create forks. Fixes #2441. Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
Diffstat (limited to 'modules/setting/repository.go')
-rw-r--r--modules/setting/repository.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/modules/setting/repository.go b/modules/setting/repository.go
index 4ab566b7ff..34eff196b8 100644
--- a/modules/setting/repository.go
+++ b/modules/setting/repository.go
@@ -50,6 +50,7 @@ var (
PrefixArchiveFiles bool
DisableMigrations bool
DisableStars bool `ini:"DISABLE_STARS"`
+ DisableForks bool
DefaultBranch string
AllowAdoptionOfUnadoptedRepositories bool
AllowDeleteOfUnadoptedRepositories bool
@@ -172,6 +173,7 @@ var (
PrefixArchiveFiles: true,
DisableMigrations: false,
DisableStars: false,
+ DisableForks: false,
DefaultBranch: "main",
AllowForkWithoutMaximumLimit: true,