mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2026-02-06 18:00:29 +00:00
Update the Forgejo driver for gof3 with modifications for non-backward compatible changes. The changes are isolated behind the f3.Enable flag and not yet functional. The purpose of this upgrade is to not drift from the gof3 implementation while the work continues.
The `fix: include remote users when counting users` commit is a functional change to Forgejo itself but does not change the behavior because the remote users are only created in fixtures or by F3.
59c721d26b/models/user/user.go (L65-L66)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/10673
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: limiting-factor <limiting-factor@posteo.com>
Co-committed-by: limiting-factor <limiting-factor@posteo.com>
41 lines
709 B
Go
41 lines
709 B
Go
// SPDX-License-Identifier: MIT
|
|
|
|
package setting
|
|
|
|
import (
|
|
"os"
|
|
"path/filepath"
|
|
|
|
"forgejo.org/modules/log"
|
|
)
|
|
|
|
// Friendly Forge Format (F3) settings
|
|
var (
|
|
F3 = struct {
|
|
Enabled bool
|
|
Path string
|
|
}{
|
|
Enabled: false,
|
|
Path: "f3",
|
|
}
|
|
)
|
|
|
|
func LoadF3Setting() {
|
|
loadF3From(CfgProvider)
|
|
}
|
|
|
|
func loadF3From(rootCfg ConfigProvider) {
|
|
if err := rootCfg.Section("f3").MapTo(&F3); err != nil {
|
|
log.Fatal("Failed to map F3 settings: %v", err)
|
|
}
|
|
|
|
if !filepath.IsAbs(F3.Path) {
|
|
F3.Path = filepath.Join(AppDataPath, F3.Path)
|
|
} else {
|
|
F3.Path = filepath.Clean(F3.Path)
|
|
}
|
|
|
|
if err := os.MkdirAll(F3.Path, os.ModePerm); err != nil {
|
|
log.Fatal("Failed to create F3 path %s: %v", F3.Path, err)
|
|
}
|
|
}
|