summaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorEarl Warren <contact@earl-warren.org>2024-06-16 13:09:52 +0200
committerEarl Warren <contact@earl-warren.org>2024-06-16 13:33:33 +0200
commit50afca7961ed330f1ce107a8c9a4f77c90f720d4 (patch)
treedb27b655e2ea0f207db25bfa470f44ed9b986cd6 /cmd
parent[FEAT] folding results for repo search (#4134) (diff)
downloadforgejo-50afca7961ed330f1ce107a8c9a4f77c90f720d4.tar.xz
forgejo-50afca7961ed330f1ce107a8c9a4f77c90f720d4.zip
fix(f3): do not run the F3 CLI if F3 is disabled
Diffstat (limited to 'cmd')
-rw-r--r--cmd/forgejo/f3.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/cmd/forgejo/f3.go b/cmd/forgejo/f3.go
index 574c776ded..5a0d0ac036 100644
--- a/cmd/forgejo/f3.go
+++ b/cmd/forgejo/f3.go
@@ -6,10 +6,12 @@ package forgejo
import (
"context"
+ "errors"
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/modules/log"
+ "code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/storage"
"code.gitea.io/gitea/services/f3/util"
@@ -41,6 +43,11 @@ func SubcmdF3Mirror(ctx context.Context) *cli.Command {
}
func runMirror(ctx context.Context, c *cli.Context, action cli.ActionFunc) error {
+ setting.LoadF3Setting()
+ if !setting.F3.Enabled {
+ return errors.New("F3 is disabled, it is not ready to be used and is only present for development purposes")
+ }
+
var cancel context.CancelFunc
if !ContextGetNoInit(ctx) {
ctx, cancel = installSignals(ctx)