Commit 24c0aad9bf

24c0aad9bf75f925497b0f6de2c8e831e67eaac9

parent: f6cb7d04f1

Verified · cmc

cmc <hello@cleberg.net> · 2026-08-24 00:14 UTC

rename: forge -> gitbay (gitbay.org)

- module path gitbay.org/gitbay; binaries gitbay and gitbayd
- config: /etc/gitbay/config.toml, /var/lib/gitbay, ~/.config/gitbay,
  gitbay.db, gitbay_session cookie, GITBAY_* hook/import env vars
- user-facing strings, usage text, ssh banner, test hostnames renamed;
  generic 'a code forge' prose kept where it means the category
- all tests updated and green

Layout: unified · split

.gitignore +2 −2
@@ -1,3 +1,3 @@
1/forge
2/forged
1/gitbay
2/gitbayd
33*.db
cmd/forge/local.go → cmd/gitbay/local.go renamed +18 −18
@@ -9,8 +9,8 @@ import (
99
1010 "golang.org/x/term"
1111
12 "github.com/krazywarez/forge/internal/cliconfig"
13 "github.com/krazywarez/forge/internal/protocol"
12 "gitbay.org/gitbay/internal/cliconfig"
13 "gitbay.org/gitbay/internal/protocol"
1414)
1515
1616// hasBodyFlag reports whether args already carry body/message input.
@@ -37,7 +37,7 @@ func maybeEditor(args []string, kind string) ([]string, *strings.Reader, bool, e
3737 // failing — bodies are optional everywhere.
3838 return args, nil, true, nil
3939 }
40 f, err := os.CreateTemp("", "forge-"+kind+"-*.md")
40 f, err := os.CreateTemp("", "gitbay-"+kind+"-*.md")
4141 if err != nil {
4242 return nil, nil, false, err
4343 }
@@ -75,7 +75,7 @@ func runGitLocal(args ...string) int {
7575 if ee, ok := err.(*exec.ExitError); ok {
7676 return ee.ExitCode()
7777 }
78 fmt.Fprintln(os.Stderr, "forge:", err)
78 fmt.Fprintln(os.Stderr, "gitbay:", err)
7979 return protocol.ExitFailure
8080 }
8181 return 0
@@ -84,12 +84,12 @@ func runGitLocal(args ...string) int {
8484// cmdRepoClone implements `forge repo clone <owner/name> [dir]`.
8585func cmdRepoClone(args []string) int {
8686 if len(args) < 1 || strings.HasPrefix(args[0], "-") {
87 fmt.Fprintln(os.Stderr, "usage: forge repo clone <owner/name> [dir]")
87 fmt.Fprintln(os.Stderr, "usage: gitbay repo clone <owner/name> [dir]")
8888 return protocol.ExitUsage
8989 }
9090 t, err := resolveTarget()
9191 if err != nil {
92 fmt.Fprintln(os.Stderr, "forge:", err)
92 fmt.Fprintln(os.Stderr, "gitbay:", err)
9393 return protocol.ExitFailure
9494 }
9595 gitArgs := append([]string{"clone", t.inst.CloneURL(args[0])}, args[1:]...)
@@ -103,7 +103,7 @@ func cmdRepoClone(args []string) int {
103103// origin and check it out as a local branch.
104104func cmdMRCheckout(args []string) int {
105105 if len(args) != 1 {
106 fmt.Fprintln(os.Stderr, "usage: forge mr checkout <n>")
106 fmt.Fprintln(os.Stderr, "usage: gitbay mr checkout <n>")
107107 return protocol.ExitUsage
108108 }
109109 n := args[0]
@@ -124,7 +124,7 @@ func cmdInit(args []string) int {
124124 case a == "--private":
125125 private = true
126126 case strings.HasPrefix(a, "-"):
127 fmt.Fprintln(os.Stderr, "usage: forge init [name] [--private]")
127 fmt.Fprintln(os.Stderr, "usage: gitbay init [name] [--private]")
128128 return protocol.ExitUsage
129129 default:
130130 name = a
@@ -133,7 +133,7 @@ func cmdInit(args []string) int {
133133 if name == "" {
134134 wd, err := os.Getwd()
135135 if err != nil {
136 fmt.Fprintln(os.Stderr, "forge:", err)
136 fmt.Fprintln(os.Stderr, "gitbay:", err)
137137 return protocol.ExitFailure
138138 }
139139 name = filepath.Base(wd)
@@ -141,12 +141,12 @@ func cmdInit(args []string) int {
141141
142142 cfg, err := cliconfig.Load()
143143 if err != nil {
144 fmt.Fprintln(os.Stderr, "forge:", err)
144 fmt.Fprintln(os.Stderr, "gitbay:", err)
145145 return protocol.ExitFailure
146146 }
147147 inst, _, err := cfg.DefaultInstance()
148148 if err != nil {
149 fmt.Fprintln(os.Stderr, "forge:", err)
149 fmt.Fprintln(os.Stderr, "gitbay:", err)
150150 return protocol.ExitFailure
151151 }
152152 t := target{inst: inst}
@@ -196,7 +196,7 @@ func captureSSH(t target, serverArgv []string) (string, int) {
196196 if ee, ok := err.(*exec.ExitError); ok {
197197 return "", ee.ExitCode()
198198 }
199 fmt.Fprintln(os.Stderr, "forge: running ssh:", err)
199 fmt.Fprintln(os.Stderr, "gitbay: running ssh:", err)
200200 return "", protocol.ExitProtocol
201201 }
202202 return string(out), 0
@@ -210,7 +210,7 @@ func quoteAll(args []string) []string {
210210 return out
211211}
212212
213// cmdRemoteAdd implements `forge remote add <name> <host> [flags]`.
213// cmdRemoteAdd implements `gitbay remote add <name> <host> [flags]`.
214214func cmdRemoteAdd(args []string) int {
215215 var name, host, user string
216216 var port int
@@ -250,19 +250,19 @@ func cmdRemoteAdd(args []string) int {
250250 } else if host == "" {
251251 host = a
252252 } else {
253 fmt.Fprintln(os.Stderr, "usage: forge remote add <name> <host> [--port n] [--user u] [--ssh-option opt]... [--default]")
253 fmt.Fprintln(os.Stderr, "usage: gitbay remote add <name> <host> [--port n] [--user u] [--ssh-option opt]... [--default]")
254254 return protocol.ExitUsage
255255 }
256256 i++
257257 }
258258 }
259259 if name == "" || host == "" {
260 fmt.Fprintln(os.Stderr, "usage: forge remote add <name> <host> [--port n] [--user u] [--ssh-option opt]... [--default]")
260 fmt.Fprintln(os.Stderr, "usage: gitbay remote add <name> <host> [--port n] [--user u] [--ssh-option opt]... [--default]")
261261 return protocol.ExitUsage
262262 }
263263 cfg, err := cliconfig.Load()
264264 if err != nil {
265 fmt.Fprintln(os.Stderr, "forge:", err)
265 fmt.Fprintln(os.Stderr, "gitbay:", err)
266266 return protocol.ExitFailure
267267 }
268268 cfg.Instances[name] = cliconfig.Instance{Host: host, Port: port, User: user, SSHOptions: sshOptions}
@@ -270,7 +270,7 @@ func cmdRemoteAdd(args []string) int {
270270 cfg.Default = name
271271 }
272272 if err := cliconfig.Save(cfg); err != nil {
273 fmt.Fprintln(os.Stderr, "forge:", err)
273 fmt.Fprintln(os.Stderr, "gitbay:", err)
274274 return protocol.ExitFailure
275275 }
276276 fmt.Printf("added instance %s (%s)\n", name, host)
@@ -280,7 +280,7 @@ func cmdRemoteAdd(args []string) int {
280280func cmdRemoteList() int {
281281 cfg, err := cliconfig.Load()
282282 if err != nil {
283 fmt.Fprintln(os.Stderr, "forge:", err)
283 fmt.Fprintln(os.Stderr, "gitbay:", err)
284284 return protocol.ExitFailure
285285 }
286286 for name, inst := range cfg.Instances {
cmd/forge/main.go → cmd/gitbay/main.go renamed +12 −12
@@ -13,12 +13,12 @@ import (
1313 "github.com/spf13/cobra"
1414 "github.com/spf13/cobra/doc"
1515
16 "github.com/krazywarez/forge/internal/protocol"
16 "gitbay.org/gitbay/internal/protocol"
1717)
1818
1919func main() {
2020 root := &cobra.Command{
21 Use: "forge",
21 Use: "gitbay",
2222 Short: "CLI-first git forge client",
2323 SilenceUsage: true,
2424 SilenceErrors: true,
@@ -36,7 +36,7 @@ func main() {
3636 )
3737
3838 if err := root.Execute(); err != nil {
39 fmt.Fprintln(os.Stderr, "forge:", err)
39 fmt.Fprintln(os.Stderr, "gitbay:", err)
4040 os.Exit(protocol.ExitUsage)
4141 }
4242}
@@ -72,13 +72,13 @@ func pass(use, short string, o passOpts) *cobra.Command {
7272func runPass(o passOpts, args []string) int {
7373 t, err := resolveTarget()
7474 if err != nil {
75 fmt.Fprintln(os.Stderr, "forge:", err)
75 fmt.Fprintln(os.Stderr, "gitbay:", err)
7676 return protocol.ExitFailure
7777 }
7878 if o.needsRepo {
7979 args, err = withRepo(t, args)
8080 if err != nil {
81 fmt.Fprintln(os.Stderr, "forge:", err)
81 fmt.Fprintln(os.Stderr, "gitbay:", err)
8282 return protocol.ExitUsage
8383 }
8484 }
@@ -87,7 +87,7 @@ func runPass(o passOpts, args []string) int {
8787 if o.editor != "" {
8888 extended, body, ok, err := maybeEditor(args, o.editor)
8989 if err != nil {
90 fmt.Fprintln(os.Stderr, "forge:", err)
90 fmt.Fprintln(os.Stderr, "gitbay:", err)
9191 return protocol.ExitFailure
9292 }
9393 if !ok {
@@ -186,14 +186,14 @@ func authCmd() *cobra.Command {
186186
187187func repoCmd() *cobra.Command {
188188 return group("repo", "create and manage repositories",
189 pass("create", "create a repository: forge repo create <owner/name> [--private]",
189 pass("create", "create a repository: gitbay repo create <owner/name> [--private]",
190190 passOpts{server: []string{"repo", "create"}}),
191191 pass("list", "list repositories you own or can access", passOpts{server: []string{"repo", "list"}}),
192192 pass("show", "show repository details", passOpts{server: []string{"repo", "show"}, needsRepo: true}),
193193 pass("log", "commit log with signature states", passOpts{server: []string{"repo", "log"}, needsRepo: true}),
194194 pass("delete", "delete a repository (--yes)", passOpts{server: []string{"repo", "delete"}, needsRepo: true}),
195195 pass("fork", "fork a repository under your account", passOpts{server: []string{"repo", "fork"}, needsRepo: true}),
196 local("clone", "clone via ssh: forge repo clone <owner/name> [dir]", cmdRepoClone),
196 local("clone", "clone via ssh: gitbay repo clone <owner/name> [dir]", cmdRepoClone),
197197 importCmd(),
198198 group("access", "manage access grants",
199199 pass("grant", "grant access: ... <user> read|write|admin", passOpts{server: []string{"repo", "access", "grant"}, needsRepo: true}),
@@ -232,7 +232,7 @@ func mrCmd() *cobra.Command {
232232 pass("list", "list merge requests [--state ...]", passOpts{server: []string{"mr", "list"}, needsRepo: true}),
233233 pass("show", "show a merge request", passOpts{server: []string{"mr", "show"}, needsRepo: true}),
234234 pass("diff", "show the diff", passOpts{server: []string{"mr", "diff"}, needsRepo: true}),
235 local("checkout", "fetch and check out the MR head locally: forge mr checkout <n>", cmdMRCheckout),
235 local("checkout", "fetch and check out the MR head locally: gitbay mr checkout <n>", cmdMRCheckout),
236236 pass("comment", "comment on a merge request", passOpts{server: []string{"mr", "comment"}, needsRepo: true, stdinOK: true, editor: "comment"}),
237237 pass("review", "review: --approve|--request-changes|--comment", passOpts{server: []string{"mr", "review"}, needsRepo: true}),
238238 pass("merge", "merge (fast-forward or merge-commit): [--strategy ff|merge]", passOpts{server: []string{"mr", "merge"}, needsRepo: true}),
@@ -244,7 +244,7 @@ func mrCmd() *cobra.Command {
244244func importCmd() *cobra.Command {
245245 return &cobra.Command{
246246 Use: "import",
247 Short: "server-side mirror of a foreign repo: forge repo import <owner/name> --from <url> [--private] [--token-stdin]",
247 Short: "server-side mirror of a foreign repo: gitbay repo import <owner/name> --from <url> [--private] [--token-stdin]",
248248 DisableFlagParsing: true,
249249 RunE: func(cmd *cobra.Command, args []string) error {
250250 for _, a := range args {
@@ -283,14 +283,14 @@ func webCmd() *cobra.Command {
283283
284284func remoteCmd() *cobra.Command {
285285 return group("remote", "local instance profiles (no server contact)",
286 local("add", "add a named forge instance: forge remote add <name> <host> [--port n] [--user u] [--ssh-option o]... [--default]",
286 local("add", "add a named gitbay instance: gitbay remote add <name> <host> [--port n] [--user u] [--ssh-option o]... [--default]",
287287 cmdRemoteAdd),
288288 local("list", "list configured instances", func([]string) int { return cmdRemoteList() }),
289289 )
290290}
291291
292292func initCmd() *cobra.Command {
293 return local("init", "git init + repo create + set origin, in one step: forge init [name] [--private]", cmdInit)
293 return local("init", "git init + repo create + set origin, in one step: gitbay init [name] [--private]", cmdInit)
294294}
295295
296296// manCmd generates man pages; a CLI-first tool without man pages is not
cmd/forge/ssh.go → cmd/gitbay/ssh.go renamed +4 −4
@@ -9,8 +9,8 @@ import (
99 "strconv"
1010 "strings"
1111
12 "github.com/krazywarez/forge/internal/cliconfig"
13 "github.com/krazywarez/forge/internal/protocol"
12 "gitbay.org/gitbay/internal/cliconfig"
13 "gitbay.org/gitbay/internal/protocol"
1414)
1515
1616// context is the resolved target for a command: which instance to talk to
@@ -105,7 +105,7 @@ func runSSH(t target, serverArgv []string, stdin io.Reader) int {
105105 }
106106 return code
107107 }
108 fmt.Fprintln(os.Stderr, "forge: running ssh:", err)
108 fmt.Fprintln(os.Stderr, "gitbay: running ssh:", err)
109109 return protocol.ExitProtocol
110110}
111111
@@ -117,7 +117,7 @@ func withRepo(t target, args []string) ([]string, error) {
117117 return args, nil // explicit owner/name
118118 }
119119 if t.repo == "" {
120 return nil, fmt.Errorf("no repository given and none inferable: pass <owner/name> or run inside a clone of a forge repository")
120 return nil, fmt.Errorf("no repository given and none inferable: pass <owner/name> or run inside a clone of a gitbay repository")
121121 }
122122 return append([]string{t.repo}, args...), nil
123123}
cmd/forged/hook.go → cmd/gitbayd/hook.go renamed +5 −5
@@ -10,9 +10,9 @@ import (
1010
1111 "github.com/spf13/cobra"
1212
13 "github.com/krazywarez/forge/internal/gitutil"
14 "github.com/krazywarez/forge/internal/hookd"
15 "github.com/krazywarez/forge/internal/policy"
13 "gitbay.org/gitbay/internal/gitutil"
14 "gitbay.org/gitbay/internal/hookd"
15 "gitbay.org/gitbay/internal/policy"
1616)
1717
1818// collectIncomingCommits lists the commits this push introduces and reads
@@ -58,7 +58,7 @@ func hookCmd() *cobra.Command {
5858 repoID, err1 := strconv.ParseInt(os.Getenv(hookd.EnvRepoID), 10, 64)
5959 userID, err2 := strconv.ParseInt(os.Getenv(hookd.EnvUserID), 10, 64)
6060 if sock == "" || err1 != nil || err2 != nil {
61 return fmt.Errorf("missing FORGE_* environment; this command only runs as a git hook")
61 return fmt.Errorf("missing GITBAY_* environment; this command only runs as a git hook")
6262 }
6363
6464 var updates []policy.RefUpdate
@@ -92,7 +92,7 @@ func hookCmd() *cobra.Command {
9292 return collectIncomingCommits(updates)
9393 })
9494 if err != nil {
95 return fmt.Errorf("forge daemon unreachable: %w", err)
95 return fmt.Errorf("gitbay daemon unreachable: %w", err)
9696 }
9797 if !resp.Allow {
9898 fmt.Fprintln(os.Stderr, resp.Message)
cmd/forged/main.go → cmd/gitbayd/main.go renamed +15 −15
@@ -1,4 +1,4 @@
1// forged is the forge server daemon. The same binary also runs in hook mode
1// gitbayd is the forge server daemon. The same binary also runs in hook mode
22// (invoked by git via core.hooksPath) and hosts the host-local admin commands.
33package main
44
@@ -14,18 +14,18 @@ import (
1414 "github.com/spf13/cobra"
1515 "golang.org/x/crypto/ssh"
1616
17 "github.com/krazywarez/forge/internal/config"
18 "github.com/krazywarez/forge/internal/control"
19 "github.com/krazywarez/forge/internal/gitd"
20 "github.com/krazywarez/forge/internal/hookd"
21 "github.com/krazywarez/forge/internal/httpd"
22 "github.com/krazywarez/forge/internal/policy"
23 "github.com/krazywarez/forge/internal/sshd"
24 "github.com/krazywarez/forge/internal/store"
17 "gitbay.org/gitbay/internal/config"
18 "gitbay.org/gitbay/internal/control"
19 "gitbay.org/gitbay/internal/gitd"
20 "gitbay.org/gitbay/internal/hookd"
21 "gitbay.org/gitbay/internal/httpd"
22 "gitbay.org/gitbay/internal/policy"
23 "gitbay.org/gitbay/internal/sshd"
24 "gitbay.org/gitbay/internal/store"
2525)
2626
2727func openStore(cfg config.Config) (*store.Store, error) {
28 s, err := store.Open(filepath.Join(cfg.Server.Root, "forge.db"))
28 s, err := store.Open(filepath.Join(cfg.Server.Root, "gitbay.db"))
2929 if err != nil {
3030 return nil, err
3131 }
@@ -40,12 +40,12 @@ var configPath string
4040
4141func main() {
4242 root := &cobra.Command{
43 Use: "forged",
44 Short: "forge server daemon",
43 Use: "gitbayd",
44 Short: "gitbay server daemon",
4545 SilenceUsage: true,
4646 SilenceErrors: true,
4747 }
48 root.PersistentFlags().StringVar(&configPath, "config", "/etc/forge/config.toml", "path to config file")
48 root.PersistentFlags().StringVar(&configPath, "config", "/etc/gitbay/config.toml", "path to config file")
4949
5050 root.AddCommand(
5151 checkConfigCmd(),
@@ -58,7 +58,7 @@ func main() {
5858 )
5959
6060 if err := root.Execute(); err != nil {
61 fmt.Fprintln(os.Stderr, "forged:", err)
61 fmt.Fprintln(os.Stderr, "gitbayd:", err)
6262 os.Exit(1)
6363 }
6464}
@@ -173,7 +173,7 @@ func migrateCmd() *cobra.Command {
173173 if err != nil {
174174 return err
175175 }
176 s, err := store.Open(cfg.Server.Root + "/forge.db")
176 s, err := store.Open(cfg.Server.Root + "/gitbay.db")
177177 if err != nil {
178178 return err
179179 }
cmd/forged/system.go → cmd/gitbayd/system.go renamed +5 −5
@@ -7,14 +7,14 @@ import (
77 "github.com/spf13/cobra"
88 "golang.org/x/crypto/ssh"
99
10 "github.com/krazywarez/forge/internal/config"
11 "github.com/krazywarez/forge/internal/protocol"
12 "github.com/krazywarez/forge/internal/sshd"
10 "gitbay.org/gitbay/internal/config"
11 "gitbay.org/gitbay/internal/protocol"
12 "gitbay.org/gitbay/internal/sshd"
1313)
1414
1515// authorizedKeysCmd backs sshd's AuthorizedKeysCommand in system mode:
1616//
17// AuthorizedKeysCommand /usr/bin/forged --config /etc/forge/config.toml authorized-keys %t %k
17// AuthorizedKeysCommand /usr/bin/gitbayd --config /etc/gitbay/config.toml authorized-keys %t %k
1818// AuthorizedKeysCommandUser git
1919//
2020// It prints a forced-command authorized_keys line for registered keys and
@@ -90,7 +90,7 @@ func shellCmd() *cobra.Command {
9090
9191 cmdline := os.Getenv("SSH_ORIGINAL_COMMAND")
9292 if cmdline == "" {
93 fmt.Fprintf(os.Stderr, "forge control plane: interactive shells are not available.\nTry: ssh <host> help\n")
93 fmt.Fprintf(os.Stderr, "gitbay control plane: interactive shells are not available.\nTry: ssh <host> help\n")
9494 os.Exit(protocol.ExitUsage)
9595 }
9696 code := sshd.Exec(cfg, st, user, key.Scope, cmdline, os.Stdin, os.Stdout, os.Stderr)
e2e/cli_test.go +7 −7
@@ -10,13 +10,13 @@ import (
1010 "testing"
1111)
1212
13func buildForgeCLI(t *testing.T) string {
13func buildGitbayCLI(t *testing.T) string {
1414 t.Helper()
15 bin := filepath.Join(t.TempDir(), "forge")
16 cmd := exec.Command("go", "build", "-o", bin, "github.com/krazywarez/forge/cmd/forge")
15 bin := filepath.Join(t.TempDir(), "gitbay")
16 cmd := exec.Command("go", "build", "-o", bin, "gitbay.org/gitbay/cmd/gitbay")
1717 cmd.Dir = ".."
1818 if out, err := cmd.CombinedOutput(); err != nil {
19 t.Fatalf("build forge: %v\n%s", err, out)
19 t.Fatalf("build gitbay: %v\n%s", err, out)
2020 }
2121 return bin
2222}
@@ -51,7 +51,7 @@ func (c *cli) run(t *testing.T, dir, stdin string, args ...string) (string, stri
5151 if ee, ok := err.(*exec.ExitError); ok {
5252 code = ee.ExitCode()
5353 } else if err != nil {
54 t.Fatalf("forge %v: %v", args, err)
54 t.Fatalf("gitbay %v: %v", args, err)
5555 }
5656 return out.String(), errOut.String(), code
5757}
@@ -60,7 +60,7 @@ func (c *cli) must(t *testing.T, dir, stdin string, args ...string) string {
6060 t.Helper()
6161 out, errOut, code := c.run(t, dir, stdin, args...)
6262 if code != 0 {
63 t.Fatalf("forge %v: exit %d\nstdout: %s\nstderr: %s", args, code, out, errOut)
63 t.Fatalf("gitbay %v: exit %d\nstdout: %s\nstderr: %s", args, code, out, errOut)
6464 }
6565 return out
6666}
@@ -72,7 +72,7 @@ func TestCLI(t *testing.T) {
7272 "--key", aliceKey+".pub", "--email", "alice@example.test", "--verified")
7373
7474 c := &cli{
75 bin: buildForgeCLI(t),
75 bin: buildGitbayCLI(t),
7676 configDir: t.TempDir(),
7777 inst: inst,
7878 key: aliceKey,
e2e/http_test.go +1 −1
@@ -90,7 +90,7 @@ func TestHTTPTransport(t *testing.T) {
9090 }
9191 if !strings.Contains(out, "remote error:") ||
9292 !strings.Contains(out, "pushes to this forge go over SSH") ||
93 !strings.Contains(out, "git@forge.test:alice/pub.git") {
93 !strings.Contains(out, "git@gitbay.test:alice/pub.git") {
9494 t.Fatalf("[%s] push refusal output:\n%s", gitBin, out)
9595 }
9696 for _, banned := range []string{"Username", "Password", "Authentication failed", "terminal prompts disabled", "401", "403"} {
e2e/mr_test.go +1 −1
@@ -9,7 +9,7 @@ import (
99
1010 "golang.org/x/crypto/ssh"
1111
12 "github.com/krazywarez/forge/internal/sig"
12 "gitbay.org/gitbay/internal/sig"
1313)
1414
1515type mrShow struct {
e2e/sig_test.go +2 −2
@@ -16,7 +16,7 @@ import (
1616 "github.com/ProtonMail/go-crypto/openpgp/packet"
1717 "golang.org/x/crypto/ssh"
1818
19 "github.com/krazywarez/forge/internal/sig"
19 "gitbay.org/gitbay/internal/sig"
2020)
2121
2222// --- fixture key helpers -------------------------------------------------
@@ -361,7 +361,7 @@ func TestSignatureVerification(t *testing.T) {
361361 vc.Dir = dir
362362 vc.Env = gpgEnv
363363 if out, err := vc.CombinedOutput(); err != nil {
364 t.Errorf("git verify-commit disagrees with forge verification: %v\n%s", err, out)
364 t.Errorf("git verify-commit disagrees with gitbay verification: %v\n%s", err, out)
365365 }
366366 } else {
367367 t.Log("gpg not installed; skipping git verify-commit cross-check")
e2e/ssh_test.go +13 −13
@@ -1,4 +1,4 @@
1// Package e2e drives a real forged with the real ssh and git clients.
1// Package e2e drives a real gitbayd with the real ssh and git clients.
22package e2e
33
44import (
@@ -14,7 +14,7 @@ import (
1414)
1515
1616type instance struct {
17 forged string // path to built binary
17 gitbayd string // path to built binary
1818 root string
1919 config string
2020 port int
@@ -24,13 +24,13 @@ type instance struct {
2424 sshDir string // per-user client keys live here
2525}
2626
27func buildForged(t *testing.T) string {
27func buildGitbayd(t *testing.T) string {
2828 t.Helper()
29 bin := filepath.Join(t.TempDir(), "forged")
30 cmd := exec.Command("go", "build", "-o", bin, "github.com/krazywarez/forge/cmd/forged")
29 bin := filepath.Join(t.TempDir(), "gitbayd")
30 cmd := exec.Command("go", "build", "-o", bin, "gitbay.org/gitbay/cmd/gitbayd")
3131 cmd.Dir = ".."
3232 if out, err := cmd.CombinedOutput(); err != nil {
33 t.Fatalf("build forged: %v\n%s", err, out)
33 t.Fatalf("build gitbayd: %v\n%s", err, out)
3434 }
3535 return bin
3636}
@@ -53,7 +53,7 @@ func startInstance(t *testing.T) *instance {
5353func startInstanceWith(t *testing.T, extra string) *instance {
5454 t.Helper()
5555 inst := &instance{
56 forged: buildForged(t),
56 gitbayd: buildGitbayd(t),
5757 root: t.TempDir(),
5858 port: freePort(t),
5959 httpPort: freePort(t),
@@ -64,7 +64,7 @@ func startInstanceWith(t *testing.T, extra string) *instance {
6464 cfg := fmt.Sprintf(`
6565[server]
6666root = %q
67site_url = "https://forge.test"
67site_url = "https://gitbay.test"
6868[ssh]
6969port = %d
7070[http]
@@ -79,7 +79,7 @@ port = %d
7979 t.Fatal(err)
8080 }
8181
82 inst.proc = exec.Command(inst.forged, "--config", inst.config, "serve")
82 inst.proc = exec.Command(inst.gitbayd, "--config", inst.config, "serve")
8383 inst.proc.Stderr = os.Stderr
8484 if err := inst.proc.Start(); err != nil {
8585 t.Fatal(err)
@@ -98,19 +98,19 @@ port = %d
9898 return inst
9999 }
100100 if time.Now().After(deadline) {
101 t.Fatal("forged did not start listening")
101 t.Fatal("gitbayd did not start listening")
102102 }
103103 time.Sleep(50 * time.Millisecond)
104104 }
105105}
106106
107// admin runs a forged admin command against the instance's database.
107// admin runs a gitbayd admin command against the instance's database.
108108func (i *instance) admin(t *testing.T, args ...string) string {
109109 t.Helper()
110 cmd := exec.Command(i.forged, append([]string{"--config", i.config}, args...)...)
110 cmd := exec.Command(i.gitbayd, append([]string{"--config", i.config}, args...)...)
111111 out, err := cmd.CombinedOutput()
112112 if err != nil {
113 t.Fatalf("forged %v: %v\n%s", args, err, out)
113 t.Fatalf("gitbayd %v: %v\n%s", args, err, out)
114114 }
115115 return string(out)
116116}
e2e/system_test.go +4 −4
@@ -24,14 +24,14 @@ func TestSystemSSHMode(t *testing.T) {
2424 t.Fatal(err)
2525 }
2626
27 // forged in system mode: no embedded SSH listener; hookd + http still run.
27 // gitbayd in system mode: no embedded SSH listener; hookd + http still run.
2828 inst := startInstanceWith(t, "") // placeholder to reuse helpers; killed below
2929 inst.proc.Process.Kill()
3030 inst.proc.Wait()
3131 cfg := fmt.Sprintf(`
3232[server]
3333root = %q
34site_url = "https://forge.test"
34site_url = "https://gitbay.test"
3535[ssh]
3636mode = "system"
3737[http]
@@ -41,7 +41,7 @@ tls = "off"
4141 if err := os.WriteFile(inst.config, []byte(cfg), 0o600); err != nil {
4242 t.Fatal(err)
4343 }
44 inst.proc = exec.Command(inst.forged, "--config", inst.config, "serve")
44 inst.proc = exec.Command(inst.gitbayd, "--config", inst.config, "serve")
4545 inst.proc.Stderr = os.Stderr
4646 if err := inst.proc.Start(); err != nil {
4747 t.Fatal(err)
@@ -65,7 +65,7 @@ tls = "off"
6565 // wrapper script argument — only the command path is ownership-checked.
6666 wrapper := filepath.Join(sshdDir, "akc.sh")
6767 script := fmt.Sprintf("#!/bin/sh\nexec %q --config %q authorized-keys \"$1\" \"$2\"\n",
68 inst.forged, inst.config)
68 inst.gitbayd, inst.config)
6969 if err := os.WriteFile(wrapper, []byte(script), 0o755); err != nil {
7070 t.Fatal(err)
7171 }
e2e/web_test.go +1 −1
@@ -12,7 +12,7 @@ import (
1212
1313 "golang.org/x/crypto/ssh"
1414
15 "github.com/krazywarez/forge/internal/sig"
15 "gitbay.org/gitbay/internal/sig"
1616)
1717
1818func (i *instance) get(t *testing.T, path string) (int, string) {
go.mod +1 −1
@@ -1,4 +1,4 @@
1module github.com/krazywarez/forge
1module gitbay.org/gitbay
22
33go 1.27.0
44
internal/cliconfig/cliconfig.go +3 −3
@@ -46,10 +46,10 @@ type Config struct {
4646
4747func Path() string {
4848 if x := os.Getenv("XDG_CONFIG_HOME"); x != "" {
49 return filepath.Join(x, "forge", "config.toml")
49 return filepath.Join(x, "gitbay", "config.toml")
5050 }
5151 home, _ := os.UserHomeDir()
52 return filepath.Join(home, ".config", "forge", "config.toml")
52 return filepath.Join(home, ".config", "gitbay", "config.toml")
5353}
5454
5555func Load() (Config, error) {
@@ -95,7 +95,7 @@ func (c Config) DefaultInstance() (Instance, string, error) {
9595 return inst, name, nil
9696 }
9797 }
98 return Instance{}, "", fmt.Errorf("no forge instance configured; run: forge remote add <name> <host>")
98 return Instance{}, "", fmt.Errorf("no gitbay instance configured; run: gitbay remote add <name> <host>")
9999}
100100
101101var (
internal/cliconfig/cliconfig_test.go +10 −10
@@ -11,12 +11,12 @@ func TestParseRemoteURL(t *testing.T) {
1111 repo string
1212 ok bool
1313 }{
14 {"ssh://git@forge.example/alice/proj.git", "forge.example", 0, "git", "alice/proj", true},
15 {"ssh://git@forge.example:2222/alice/proj.git", "forge.example", 2222, "git", "alice/proj", true},
16 {"ssh://forge.example/alice/proj", "forge.example", 0, "", "alice/proj", true},
17 {"git@forge.example:alice/proj.git", "forge.example", 0, "git", "alice/proj", true},
18 {"git@forge.example:alice/proj", "forge.example", 0, "git", "alice/proj", true},
19 {"https://forge.example/alice/proj.git", "", 0, "", "", false},
14 {"ssh://git@gitbay.example/alice/proj.git", "gitbay.example", 0, "git", "alice/proj", true},
15 {"ssh://git@gitbay.example:2222/alice/proj.git", "gitbay.example", 2222, "git", "alice/proj", true},
16 {"ssh://gitbay.example/alice/proj", "gitbay.example", 0, "", "alice/proj", true},
17 {"git@gitbay.example:alice/proj.git", "gitbay.example", 0, "git", "alice/proj", true},
18 {"git@gitbay.example:alice/proj", "gitbay.example", 0, "git", "alice/proj", true},
19 {"https://gitbay.example/alice/proj.git", "", 0, "", "", false},
2020 {"/local/path/repo.git", "", 0, "", "", false},
2121 }
2222 for _, tc := range cases {
@@ -35,12 +35,12 @@ func TestParseRemoteURL(t *testing.T) {
3535}
3636
3737func TestCloneURL(t *testing.T) {
38 i := Instance{Host: "forge.example"}
39 if got := i.CloneURL("a/b"); got != "ssh://git@forge.example/a/b.git" {
38 i := Instance{Host: "gitbay.example"}
39 if got := i.CloneURL("a/b"); got != "ssh://git@gitbay.example/a/b.git" {
4040 t.Errorf("CloneURL = %s", got)
4141 }
42 i = Instance{Host: "forge.example", Port: 2222, User: "u"}
43 if got := i.CloneURL("a/b"); got != "ssh://u@forge.example:2222/a/b.git" {
42 i = Instance{Host: "gitbay.example", Port: 2222, User: "u"}
43 if got := i.CloneURL("a/b"); got != "ssh://u@gitbay.example:2222/a/b.git" {
4444 t.Errorf("CloneURL = %s", got)
4545 }
4646}
internal/config/config.go +3 −3
@@ -1,4 +1,4 @@
1// Package config loads and validates the forged server configuration.
1// Package config loads and validates the gitbayd server configuration.
22package config
33
44import (
@@ -69,7 +69,7 @@ type Mail struct {
6969// Default returns the configuration used when a key is absent from the file.
7070func Default() Config {
7171 return Config{
72 Server: Server{Root: "/var/lib/forge"},
72 Server: Server{Root: "/var/lib/gitbay"},
7373 SSH: SSH{Mode: "embedded", Port: 22},
7474 HTTP: HTTP{Addr: ":443", TLS: "acme"},
7575 Web: Web{Mode: "view_only"},
@@ -154,7 +154,7 @@ func (c Config) Validate() error {
154154 }
155155 if c.Web.PasswordAuth && c.Web.Mode == "accounts" {
156156 errs = append(errs, errors.New(
157 "web.password_auth is not implemented yet; browser sessions are minted over SSH (forge web login)"))
157 "web.password_auth is not implemented yet; browser sessions are minted over SSH (gitbay web login)"))
158158 }
159159
160160 return errors.Join(errs...)
internal/config/config_test.go +6 −6
@@ -18,8 +18,8 @@ func writeConfig(t *testing.T, body string) string {
1818
1919const minimal = `
2020[server]
21root = "/var/lib/forge"
22site_url = "https://forge.example"
21root = "/var/lib/gitbay"
22site_url = "https://gitbay.example"
2323`
2424
2525func TestLoadMinimal(t *testing.T) {
@@ -52,7 +52,7 @@ func TestContradictions(t *testing.T) {
5252 },
5353 {
5454 "system ssh with open registration",
55 minimal + "\n[ssh]\nmode = \"system\"\n[registration]\nmode = \"open\"\n[mail]\nsmtp_host = \"mx.example\"\nfrom = \"forge@example\"\n",
55 minimal + "\n[ssh]\nmode = \"system\"\n[registration]\nmode = \"open\"\n[mail]\nsmtp_host = \"mx.example\"\nfrom = \"gitbay@example\"\n",
5656 "requires registration.mode = \"closed\"",
5757 },
5858 {
@@ -72,12 +72,12 @@ func TestContradictions(t *testing.T) {
7272 },
7373 {
7474 "unknown key",
75 "[server]\nroot = \"/var/lib/forge\"\nsite_url = \"https://forge.example\"\nbogus = 1\n",
75 "[server]\nroot = \"/var/lib/gitbay\"\nsite_url = \"https://gitbay.example\"\nbogus = 1\n",
7676 "unknown config key",
7777 },
7878 {
7979 "missing site_url",
80 "[server]\nroot = \"/var/lib/forge\"\n",
80 "[server]\nroot = \"/var/lib/gitbay\"\n",
8181 "site_url",
8282 },
8383 }
@@ -101,7 +101,7 @@ func TestValidCombinations(t *testing.T) {
101101 }{
102102 {
103103 "invite with smtp",
104 minimal + "\n[registration]\nmode = \"invite\"\n[mail]\nsmtp_host = \"mx.example\"\nfrom = \"forge@example\"\n",
104 minimal + "\n[registration]\nmode = \"invite\"\n[mail]\nsmtp_host = \"mx.example\"\nfrom = \"gitbay@example\"\n",
105105 },
106106 {
107107 "system ssh closed registration",
internal/control/control.go +3 −3
@@ -10,9 +10,9 @@ import (
1010 "reflect"
1111 "slices"
1212
13 "github.com/krazywarez/forge/internal/config"
14 "github.com/krazywarez/forge/internal/protocol"
15 "github.com/krazywarez/forge/internal/store"
13 "gitbay.org/gitbay/internal/config"
14 "gitbay.org/gitbay/internal/protocol"
15 "gitbay.org/gitbay/internal/store"
1616)
1717
1818type Ctx struct {
internal/control/control_test.go +1 −1
@@ -4,7 +4,7 @@ import (
44 "strings"
55 "testing"
66
7 "github.com/krazywarez/forge/internal/protocol"
7 "gitbay.org/gitbay/internal/protocol"
88)
99
1010// TestEveryCommandReachableFromBareSSH asserts that each registered command's
internal/control/identity.go +2 −2
@@ -7,8 +7,8 @@ import (
77
88 "golang.org/x/crypto/ssh"
99
10 "github.com/krazywarez/forge/internal/protocol"
11 "github.com/krazywarez/forge/internal/store"
10 "gitbay.org/gitbay/internal/protocol"
11 "gitbay.org/gitbay/internal/store"
1212)
1313
1414func init() {
internal/control/import.go +5 −5
@@ -10,9 +10,9 @@ import (
1010 "strings"
1111 "time"
1212
13 "github.com/krazywarez/forge/internal/gitutil"
14 "github.com/krazywarez/forge/internal/policy"
15 "github.com/krazywarez/forge/internal/protocol"
13 "gitbay.org/gitbay/internal/gitutil"
14 "gitbay.org/gitbay/internal/policy"
15 "gitbay.org/gitbay/internal/protocol"
1616)
1717
1818func init() {
@@ -27,7 +27,7 @@ func init() {
2727const askpassScript = `#!/bin/sh
2828case "$1" in
2929 Username*) echo "x-access-token" ;;
30 *) echo "${FORGE_IMPORT_TOKEN}" ;;
30 *) echo "${GITBAY_IMPORT_TOKEN}" ;;
3131esac
3232`
3333
@@ -96,7 +96,7 @@ func runRepoImport(c *Ctx, args []string) int {
9696 }
9797 env = []string{
9898 "GIT_ASKPASS=" + askpass,
99 "FORGE_IMPORT_TOKEN=" + token,
99 "GITBAY_IMPORT_TOKEN=" + token,
100100 "GIT_TERMINAL_PROMPT=0",
101101 }
102102 } else {
internal/control/issue.go +3 −3
@@ -7,9 +7,9 @@ import (
77 "strconv"
88 "strings"
99
10 "github.com/krazywarez/forge/internal/policy"
11 "github.com/krazywarez/forge/internal/protocol"
12 "github.com/krazywarez/forge/internal/store"
10 "gitbay.org/gitbay/internal/policy"
11 "gitbay.org/gitbay/internal/protocol"
12 "gitbay.org/gitbay/internal/store"
1313)
1414
1515const maxBodyBytes = 64 << 10
internal/control/mr.go +4 −4
@@ -7,10 +7,10 @@ import (
77 "strconv"
88 "strings"
99
10 "github.com/krazywarez/forge/internal/gitutil"
11 "github.com/krazywarez/forge/internal/policy"
12 "github.com/krazywarez/forge/internal/protocol"
13 "github.com/krazywarez/forge/internal/store"
10 "gitbay.org/gitbay/internal/gitutil"
11 "gitbay.org/gitbay/internal/policy"
12 "gitbay.org/gitbay/internal/protocol"
13 "gitbay.org/gitbay/internal/store"
1414)
1515
1616func init() {
internal/control/repo.go +4 −4
@@ -9,10 +9,10 @@ import (
99 "slices"
1010 "strings"
1111
12 "github.com/krazywarez/forge/internal/gitutil"
13 "github.com/krazywarez/forge/internal/policy"
14 "github.com/krazywarez/forge/internal/protocol"
15 "github.com/krazywarez/forge/internal/store"
12 "gitbay.org/gitbay/internal/gitutil"
13 "gitbay.org/gitbay/internal/policy"
14 "gitbay.org/gitbay/internal/protocol"
15 "gitbay.org/gitbay/internal/store"
1616)
1717
1818// RepoDir returns the on-disk path for a repository.
internal/control/sig.go +5 −5
@@ -8,11 +8,11 @@ import (
88 "strconv"
99 "time"
1010
11 "github.com/krazywarez/forge/internal/gitutil"
12 "github.com/krazywarez/forge/internal/policy"
13 "github.com/krazywarez/forge/internal/protocol"
14 "github.com/krazywarez/forge/internal/sig"
15 "github.com/krazywarez/forge/internal/store"
11 "gitbay.org/gitbay/internal/gitutil"
12 "gitbay.org/gitbay/internal/policy"
13 "gitbay.org/gitbay/internal/protocol"
14 "gitbay.org/gitbay/internal/sig"
15 "gitbay.org/gitbay/internal/store"
1616)
1717
1818func init() {
internal/control/web.go +2 −2
@@ -5,8 +5,8 @@ import (
55 "io"
66 "time"
77
8 "github.com/krazywarez/forge/internal/protocol"
9 "github.com/krazywarez/forge/internal/store"
8 "gitbay.org/gitbay/internal/protocol"
9 "gitbay.org/gitbay/internal/store"
1010)
1111
1212func newStoredToken() (token, hash string, err error) { return store.NewToken() }
internal/gitd/gitd.go +3 −3
@@ -13,9 +13,9 @@ import (
1313 "strings"
1414 "time"
1515
16 "github.com/krazywarez/forge/internal/config"
17 "github.com/krazywarez/forge/internal/control"
18 "github.com/krazywarez/forge/internal/store"
16 "gitbay.org/gitbay/internal/config"
17 "gitbay.org/gitbay/internal/control"
18 "gitbay.org/gitbay/internal/store"
1919)
2020
2121type Server struct {
internal/gitutil/gitutil.go +1 −1
@@ -31,7 +31,7 @@ func InitBare(path, defaultBranch, hooksPath string) error {
3131
3232// Transport streams one git transport service (upload-pack, receive-pack,
3333// upload-archive). extraEnv entries are appended to the process environment;
34// hooks read the FORGE_* variables from it.
34// hooks read the GITBAY_* variables from it.
3535func Transport(service, repoPath string, stdin io.Reader, stdout, errW io.Writer, extraEnv []string) error {
3636 var args []string
3737 switch service {
internal/gitutil/merge.go +1 −1
@@ -137,7 +137,7 @@ func CommitFileChange(dir, branch, path string, content []byte, name, email, mes
137137
138138 // Stage the parent tree in a temporary index, splice the blob in, and
139139 // write the new tree.
140 idx, err := os.CreateTemp("", "forge-index-*")
140 idx, err := os.CreateTemp("", "gitbay-index-*")
141141 if err != nil {
142142 return "", err
143143 }
internal/hookd/hookd.go +14 −14
@@ -1,5 +1,5 @@
11// Package hookd is the unix-socket bridge between git hooks and the daemon.
2// The hook process (forged in hook mode) computes git facts — it inherits
2// The hook process (gitbayd in hook mode) computes git facts — it inherits
33// git's quarantine environment, which the daemon does not see — and sends
44// them here; the daemon answers with a policy decision.
55//
@@ -17,20 +17,20 @@ import (
1717 "os"
1818 "path/filepath"
1919
20 "github.com/krazywarez/forge/internal/config"
21 "github.com/krazywarez/forge/internal/control"
22 "github.com/krazywarez/forge/internal/gitutil"
23 "github.com/krazywarez/forge/internal/policy"
24 "github.com/krazywarez/forge/internal/sig"
25 "github.com/krazywarez/forge/internal/store"
20 "gitbay.org/gitbay/internal/config"
21 "gitbay.org/gitbay/internal/control"
22 "gitbay.org/gitbay/internal/gitutil"
23 "gitbay.org/gitbay/internal/policy"
24 "gitbay.org/gitbay/internal/sig"
25 "gitbay.org/gitbay/internal/store"
2626)
2727
2828// Env variable names passed to git transport subprocesses and inherited by
2929// hooks.
3030const (
31 EnvSocket = "FORGE_HOOK_SOCKET"
32 EnvRepoID = "FORGE_REPO_ID"
33 EnvUserID = "FORGE_USER_ID"
31 EnvSocket = "GITBAY_HOOK_SOCKET"
32 EnvRepoID = "GITBAY_REPO_ID"
33 EnvUserID = "GITBAY_USER_ID"
3434)
3535
3636type Request struct {
@@ -59,7 +59,7 @@ type Response struct {
5959// SocketPath returns the hook socket location. It prefers the server root,
6060// but unix socket paths are capped (~104 bytes on macOS, 108 on Linux), so
6161// deep roots fall back to a hashed name under the system temp directory.
62// Hooks receive the chosen path via FORGE_HOOK_SOCKET, so both sides always
62// Hooks receive the chosen path via GITBAY_HOOK_SOCKET, so both sides always
6363// agree.
6464func SocketPath(root string) string {
6565 p := filepath.Join(root, "hook.sock")
@@ -67,7 +67,7 @@ func SocketPath(root string) string {
6767 return p
6868 }
6969 sum := sha256.Sum256([]byte(root))
70 return filepath.Join(os.TempDir(), fmt.Sprintf("forge-%x.sock", sum[:8]))
70 return filepath.Join(os.TempDir(), fmt.Sprintf("gitbay-%x.sock", sum[:8]))
7171}
7272
7373type Server struct {
@@ -250,12 +250,12 @@ func Ask(socketPath string, req Request, commits func() (CommitsPayload, error))
250250// WriteHookScripts (re)generates the shared hooks directory. Called at
251251// daemon startup so a moved binary self-heals; every repo points here via
252252// core.hooksPath.
253func WriteHookScripts(hooksDir, forgedPath string) error {
253func WriteHookScripts(hooksDir, gitbaydPath string) error {
254254 if err := os.MkdirAll(hooksDir, 0o755); err != nil {
255255 return err
256256 }
257257 for _, hook := range []string{"pre-receive", "post-receive"} {
258 script := fmt.Sprintf("#!/bin/sh\nexec %q hook %s\n", forgedPath, hook)
258 script := fmt.Sprintf("#!/bin/sh\nexec %q hook %s\n", gitbaydPath, hook)
259259 if err := os.WriteFile(filepath.Join(hooksDir, hook), []byte(script), 0o755); err != nil {
260260 return err
261261 }
internal/httpd/accounts.go +5 −5
@@ -7,13 +7,13 @@ import (
77 "strings"
88 "time"
99
10 "github.com/krazywarez/forge/internal/control"
11 "github.com/krazywarez/forge/internal/gitutil"
12 "github.com/krazywarez/forge/internal/policy"
13 "github.com/krazywarez/forge/internal/store"
10 "gitbay.org/gitbay/internal/control"
11 "gitbay.org/gitbay/internal/gitutil"
12 "gitbay.org/gitbay/internal/policy"
13 "gitbay.org/gitbay/internal/store"
1414)
1515
16const sessionCookie = "forge_session"
16const sessionCookie = "gitbay_session"
1717
1818// viewer returns the logged-in user, or a zero User for anonymous visitors.
1919// Only meaningful in accounts mode; in view_only no session route exists so
internal/httpd/routes_test.go +2 −2
@@ -4,8 +4,8 @@ import (
44 "strings"
55 "testing"
66
7 "github.com/krazywarez/forge/internal/config"
8 "github.com/krazywarez/forge/internal/policy"
7 "gitbay.org/gitbay/internal/config"
8 "gitbay.org/gitbay/internal/policy"
99)
1010
1111// TestViewOnlyHasNoMutatingRoutes is the structural guarantee from the plan:
internal/httpd/smart.go +3 −3
@@ -14,9 +14,9 @@ import (
1414 "os/exec"
1515 "strings"
1616
17 "github.com/krazywarez/forge/internal/config"
18 "github.com/krazywarez/forge/internal/control"
19 "github.com/krazywarez/forge/internal/store"
17 "gitbay.org/gitbay/internal/config"
18 "gitbay.org/gitbay/internal/control"
19 "gitbay.org/gitbay/internal/store"
2020)
2121
2222type Server struct {
internal/httpd/web.go +6 −6
@@ -4,7 +4,7 @@ import (
44 "bytes"
55 "fmt"
66
7 "github.com/krazywarez/forge/internal/policy"
7 "gitbay.org/gitbay/internal/policy"
88 "html/template"
99 "net/http"
1010 "path"
@@ -17,11 +17,11 @@ import (
1717 "github.com/alecthomas/chroma/v2/styles"
1818 "github.com/yuin/goldmark"
1919
20 "github.com/krazywarez/forge/internal/control"
21 "github.com/krazywarez/forge/internal/gitutil"
22 "github.com/krazywarez/forge/internal/sig"
23 "github.com/krazywarez/forge/internal/store"
24 "github.com/krazywarez/forge/internal/web"
20 "gitbay.org/gitbay/internal/control"
21 "gitbay.org/gitbay/internal/gitutil"
22 "gitbay.org/gitbay/internal/sig"
23 "gitbay.org/gitbay/internal/store"
24 "gitbay.org/gitbay/internal/web"
2525)
2626
2727const maxRenderBytes = 1 << 20 // largest blob rendered inline
internal/policy/access.go +1 −1
@@ -3,7 +3,7 @@ package policy
33import (
44 "strings"
55
6 "github.com/krazywarez/forge/internal/store"
6 "gitbay.org/gitbay/internal/store"
77)
88
99// CanRead reports whether user may read repo over an authenticated channel.
internal/policy/access_test.go +1 −1
@@ -3,7 +3,7 @@ package policy
33import (
44 "testing"
55
6 "github.com/krazywarez/forge/internal/store"
6 "gitbay.org/gitbay/internal/store"
77)
88
99var (
internal/sshd/sshd.go +10 −10
@@ -17,13 +17,13 @@ import (
1717
1818 "golang.org/x/crypto/ssh"
1919
20 "github.com/krazywarez/forge/internal/config"
21 "github.com/krazywarez/forge/internal/control"
22 "github.com/krazywarez/forge/internal/gitutil"
23 "github.com/krazywarez/forge/internal/hookd"
24 "github.com/krazywarez/forge/internal/policy"
25 "github.com/krazywarez/forge/internal/protocol"
26 "github.com/krazywarez/forge/internal/store"
20 "gitbay.org/gitbay/internal/config"
21 "gitbay.org/gitbay/internal/control"
22 "gitbay.org/gitbay/internal/gitutil"
23 "gitbay.org/gitbay/internal/hookd"
24 "gitbay.org/gitbay/internal/policy"
25 "gitbay.org/gitbay/internal/protocol"
26 "gitbay.org/gitbay/internal/store"
2727)
2828
2929type Server struct {
@@ -37,7 +37,7 @@ func New(cfg config.Config, st *store.Store) (*Server, error) {
3737
3838 sc := &ssh.ServerConfig{
3939 PublicKeyCallback: s.authenticate,
40 ServerVersion: "SSH-2.0-forged",
40 ServerVersion: "SSH-2.0-gitbayd",
4141 }
4242 signers, err := loadHostKeys(cfg)
4343 if err != nil {
@@ -158,7 +158,7 @@ func (s *Server) handleSession(sconn *ssh.ServerConn, ch ssh.Channel, reqs <-cha
158158 return
159159 case "shell":
160160 req.Reply(true, nil)
161 fmt.Fprintf(ch, "forge control plane: interactive shells are not available.\nTry: ssh %s help\n", s.cfg.Server.SiteURL)
161 fmt.Fprintf(ch, "gitbay control plane: interactive shells are not available.\nTry: ssh %s help\n", s.cfg.Server.SiteURL)
162162 sendExit(ch, protocol.ExitUsage)
163163 return
164164 case "pty-req", "env":
@@ -190,7 +190,7 @@ func (s *Server) runExec(sconn *ssh.ServerConn, ch ssh.Channel, cmdline string)
190190
191191// Exec runs one SSH exec command line for an authenticated key. It is the
192192// single dispatch path shared by the embedded listener and the system-sshd
193// forced command (forged shell).
193// forced command (gitbayd shell).
194194func Exec(cfg config.Config, st *store.Store, user store.User, scope, cmdline string,
195195 stdin io.Reader, stdout, stderr io.Writer) int {
196196 argv, err := protocol.Tokenize(cmdline)
internal/store/signatures.go +1 −1
@@ -5,7 +5,7 @@ import (
55 "errors"
66 "time"
77
8 "github.com/krazywarez/forge/internal/sig"
8 "gitbay.org/gitbay/internal/sig"
99)
1010
1111// AddPGPKey registers an OpenPGP key and bumps the key epoch.
internal/store/store_test.go +1 −1
@@ -8,7 +8,7 @@ import (
88
99func open(t *testing.T) *Store {
1010 t.Helper()
11 s, err := Open(filepath.Join(t.TempDir(), "forge.db"))
11 s, err := Open(filepath.Join(t.TempDir(), "gitbay.db"))
1212 if err != nil {
1313 t.Fatal(err)
1414 }