mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-27 06:03:51 +03:00
[BRANDING] s/Gitea/Forgejo/g in CLI output
This commit is contained in:
parent
d84ce3ff20
commit
7543c126bb
10 changed files with 28 additions and 28 deletions
|
@ -17,7 +17,7 @@ var (
|
||||||
CmdActions = &cli.Command{
|
CmdActions = &cli.Command{
|
||||||
Name: "actions",
|
Name: "actions",
|
||||||
Usage: "",
|
Usage: "",
|
||||||
Description: "Commands for managing Gitea Actions",
|
Description: "Commands for managing Forgejo Actions",
|
||||||
Subcommands: []*cli.Command{
|
Subcommands: []*cli.Command{
|
||||||
subcmdActionsGenRunnerToken,
|
subcmdActionsGenRunnerToken,
|
||||||
},
|
},
|
||||||
|
|
|
@ -136,7 +136,7 @@ func runCert(c *cli.Context) error {
|
||||||
SerialNumber: serialNumber,
|
SerialNumber: serialNumber,
|
||||||
Subject: pkix.Name{
|
Subject: pkix.Name{
|
||||||
Organization: []string{"Acme Co"},
|
Organization: []string{"Acme Co"},
|
||||||
CommonName: "Gitea",
|
CommonName: "Forgejo",
|
||||||
},
|
},
|
||||||
NotBefore: notBefore,
|
NotBefore: notBefore,
|
||||||
NotAfter: notAfter,
|
NotAfter: notAfter,
|
||||||
|
|
|
@ -15,7 +15,7 @@ import (
|
||||||
var CmdDocs = &cli.Command{
|
var CmdDocs = &cli.Command{
|
||||||
Name: "docs",
|
Name: "docs",
|
||||||
Usage: "Output CLI documentation",
|
Usage: "Output CLI documentation",
|
||||||
Description: "A command to output Gitea's CLI documentation, optionally to a file.",
|
Description: "A command to output Forgejo's CLI documentation, optionally to a file.",
|
||||||
Action: runDocs,
|
Action: runDocs,
|
||||||
Flags: []cli.Flag{
|
Flags: []cli.Flag{
|
||||||
&cli.BoolFlag{
|
&cli.BoolFlag{
|
||||||
|
|
|
@ -25,7 +25,7 @@ import (
|
||||||
var cmdDoctorCheck = &cli.Command{
|
var cmdDoctorCheck = &cli.Command{
|
||||||
Name: "check",
|
Name: "check",
|
||||||
Usage: "Diagnose and optionally fix problems",
|
Usage: "Diagnose and optionally fix problems",
|
||||||
Description: "A command to diagnose problems with the current Gitea instance according to the given configuration. Some problems can optionally be fixed by modifying the database or data storage.",
|
Description: "A command to diagnose problems with the current Forgejo instance according to the given configuration. Some problems can optionally be fixed by modifying the database or data storage.",
|
||||||
Action: runDoctorCheck,
|
Action: runDoctorCheck,
|
||||||
Flags: []cli.Flag{
|
Flags: []cli.Flag{
|
||||||
&cli.BoolFlag{
|
&cli.BoolFlag{
|
||||||
|
@ -64,7 +64,7 @@ var cmdDoctorCheck = &cli.Command{
|
||||||
var CmdDoctor = &cli.Command{
|
var CmdDoctor = &cli.Command{
|
||||||
Name: "doctor",
|
Name: "doctor",
|
||||||
Usage: "Diagnose and optionally fix problems",
|
Usage: "Diagnose and optionally fix problems",
|
||||||
Description: "A command to diagnose problems with the current Gitea instance according to the given configuration. Some problems can optionally be fixed by modifying the database or data storage.",
|
Description: "A command to diagnose problems with the current Forgejo instance according to the given configuration. Some problems can optionally be fixed by modifying the database or data storage.",
|
||||||
|
|
||||||
Subcommands: []*cli.Command{
|
Subcommands: []*cli.Command{
|
||||||
cmdDoctorCheck,
|
cmdDoctorCheck,
|
||||||
|
@ -83,7 +83,7 @@ var cmdRecreateTable = &cli.Command{
|
||||||
Usage: "Print SQL commands sent",
|
Usage: "Print SQL commands sent",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Description: `The database definitions Gitea uses change across versions, sometimes changing default values and leaving old unused columns.
|
Description: `The database definitions Forgejo uses change across versions, sometimes changing default values and leaving old unused columns.
|
||||||
|
|
||||||
This command will cause Xorm to recreate tables, copying over the data and deleting the old table.
|
This command will cause Xorm to recreate tables, copying over the data and deleting the old table.
|
||||||
|
|
||||||
|
|
12
cmd/hook.go
12
cmd/hook.go
|
@ -172,9 +172,9 @@ func runHookPreReceive(c *cli.Context) error {
|
||||||
|
|
||||||
if len(os.Getenv("SSH_ORIGINAL_COMMAND")) == 0 {
|
if len(os.Getenv("SSH_ORIGINAL_COMMAND")) == 0 {
|
||||||
if setting.OnlyAllowPushIfGiteaEnvironmentSet {
|
if setting.OnlyAllowPushIfGiteaEnvironmentSet {
|
||||||
return fail(ctx, `Rejecting changes as Gitea environment not set.
|
return fail(ctx, `Rejecting changes as Forgejo environment not set.
|
||||||
If you are pushing over SSH you must push with a key managed by
|
If you are pushing over SSH you must push with a key managed by
|
||||||
Gitea or set your environment appropriately.`, "")
|
Forgejo or set your environment appropriately.`, "")
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -316,9 +316,9 @@ func runHookPostReceive(c *cli.Context) error {
|
||||||
|
|
||||||
if len(os.Getenv("SSH_ORIGINAL_COMMAND")) == 0 {
|
if len(os.Getenv("SSH_ORIGINAL_COMMAND")) == 0 {
|
||||||
if setting.OnlyAllowPushIfGiteaEnvironmentSet {
|
if setting.OnlyAllowPushIfGiteaEnvironmentSet {
|
||||||
return fail(ctx, `Rejecting changes as Gitea environment not set.
|
return fail(ctx, `Rejecting changes as Forgejo environment not set.
|
||||||
If you are pushing over SSH you must push with a key managed by
|
If you are pushing over SSH you must push with a key managed by
|
||||||
Gitea or set your environment appropriately.`, "")
|
Forgejo or set your environment appropriately.`, "")
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -485,9 +485,9 @@ func runHookProcReceive(c *cli.Context) error {
|
||||||
|
|
||||||
if len(os.Getenv("SSH_ORIGINAL_COMMAND")) == 0 {
|
if len(os.Getenv("SSH_ORIGINAL_COMMAND")) == 0 {
|
||||||
if setting.OnlyAllowPushIfGiteaEnvironmentSet {
|
if setting.OnlyAllowPushIfGiteaEnvironmentSet {
|
||||||
return fail(ctx, `Rejecting changes as Gitea environment not set.
|
return fail(ctx, `Rejecting changes as Forgejo environment not set.
|
||||||
If you are pushing over SSH you must push with a key managed by
|
If you are pushing over SSH you must push with a key managed by
|
||||||
Gitea or set your environment appropriately.`, "")
|
Forgejo or set your environment appropriately.`, "")
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@ import (
|
||||||
// CmdKeys represents the available keys sub-command
|
// CmdKeys represents the available keys sub-command
|
||||||
var CmdKeys = &cli.Command{
|
var CmdKeys = &cli.Command{
|
||||||
Name: "keys",
|
Name: "keys",
|
||||||
Usage: "This command queries the Gitea database to get the authorized command for a given ssh key fingerprint",
|
Usage: "This command queries the Forgejo database to get the authorized command for a given ssh key fingerprint",
|
||||||
Before: PrepareConsoleLoggerLevel(log.FATAL),
|
Before: PrepareConsoleLoggerLevel(log.FATAL),
|
||||||
Action: runKeys,
|
Action: runKeys,
|
||||||
Flags: []cli.Flag{
|
Flags: []cli.Flag{
|
||||||
|
|
|
@ -78,7 +78,7 @@ func appGlobalFlags() []cli.Flag {
|
||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
Name: "work-path",
|
Name: "work-path",
|
||||||
Aliases: []string{"w"},
|
Aliases: []string{"w"},
|
||||||
Usage: "Set Gitea's working path (defaults to the Gitea's binary directory)",
|
Usage: "Set Forgejo's working path (defaults to the directory of the Forgejo binary)",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,7 +62,7 @@ var (
|
||||||
Subcommands: []*cli.Command{
|
Subcommands: []*cli.Command{
|
||||||
{
|
{
|
||||||
Name: "pause",
|
Name: "pause",
|
||||||
Usage: "Pause logging (Gitea will buffer logs up to a certain point and will drop them after that point)",
|
Usage: "Pause logging (Forgejo will buffer logs up to a certain point and will drop them after that point)",
|
||||||
Flags: []cli.Flag{
|
Flags: []cli.Flag{
|
||||||
&cli.BoolFlag{
|
&cli.BoolFlag{
|
||||||
Name: "debug",
|
Name: "debug",
|
||||||
|
@ -80,7 +80,7 @@ var (
|
||||||
Action: runResumeLogging,
|
Action: runResumeLogging,
|
||||||
}, {
|
}, {
|
||||||
Name: "release-and-reopen",
|
Name: "release-and-reopen",
|
||||||
Usage: "Cause Gitea to release and re-open files used for logging",
|
Usage: "Cause Forgejo to release and re-open files used for logging",
|
||||||
Flags: []cli.Flag{
|
Flags: []cli.Flag{
|
||||||
&cli.BoolFlag{
|
&cli.BoolFlag{
|
||||||
Name: "debug",
|
Name: "debug",
|
||||||
|
|
|
@ -103,12 +103,12 @@ func fail(ctx context.Context, userMessage, logMsgFmt string, args ...any) error
|
||||||
// There appears to be a chance to cause a zombie process and failure to read the Exit status
|
// There appears to be a chance to cause a zombie process and failure to read the Exit status
|
||||||
// if nothing is outputted on stdout.
|
// if nothing is outputted on stdout.
|
||||||
_, _ = fmt.Fprintln(os.Stdout, "")
|
_, _ = fmt.Fprintln(os.Stdout, "")
|
||||||
_, _ = fmt.Fprintln(os.Stderr, "Gitea:", userMessage)
|
_, _ = fmt.Fprintln(os.Stderr, "Forgejo:", userMessage)
|
||||||
|
|
||||||
if logMsgFmt != "" {
|
if logMsgFmt != "" {
|
||||||
logMsg := fmt.Sprintf(logMsgFmt, args...)
|
logMsg := fmt.Sprintf(logMsgFmt, args...)
|
||||||
if !setting.IsProd {
|
if !setting.IsProd {
|
||||||
_, _ = fmt.Fprintln(os.Stderr, "Gitea:", logMsg)
|
_, _ = fmt.Fprintln(os.Stderr, "Forgejo:", logMsg)
|
||||||
}
|
}
|
||||||
if userMessage != "" {
|
if userMessage != "" {
|
||||||
if unicode.IsPunct(rune(userMessage[len(userMessage)-1])) {
|
if unicode.IsPunct(rune(userMessage[len(userMessage)-1])) {
|
||||||
|
@ -143,7 +143,7 @@ func runServ(c *cli.Context) error {
|
||||||
setup(ctx, c.Bool("debug"))
|
setup(ctx, c.Bool("debug"))
|
||||||
|
|
||||||
if setting.SSH.Disabled {
|
if setting.SSH.Disabled {
|
||||||
println("Gitea: SSH has been disabled")
|
println("Forgejo: SSH has been disabled")
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
18
cmd/web.go
18
cmd/web.go
|
@ -34,8 +34,8 @@ var PIDFile = "/run/gitea.pid"
|
||||||
// CmdWeb represents the available web sub-command.
|
// CmdWeb represents the available web sub-command.
|
||||||
var CmdWeb = &cli.Command{
|
var CmdWeb = &cli.Command{
|
||||||
Name: "web",
|
Name: "web",
|
||||||
Usage: "Start Gitea web server",
|
Usage: "Start the Forgejo web server",
|
||||||
Description: `Gitea web server is the only thing you need to run,
|
Description: `The Forgejo web server is the only thing you need to run,
|
||||||
and it takes care of all the other things for you`,
|
and it takes care of all the other things for you`,
|
||||||
Before: PrepareConsoleLoggerLevel(log.INFO),
|
Before: PrepareConsoleLoggerLevel(log.INFO),
|
||||||
Action: runWeb,
|
Action: runWeb,
|
||||||
|
@ -108,7 +108,7 @@ func createPIDFile(pidPath string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func showWebStartupMessage(msg string) {
|
func showWebStartupMessage(msg string) {
|
||||||
log.Info("Gitea version: %s%s", setting.AppVer, setting.AppBuiltWith)
|
log.Info("Forgejo version: %s%s", setting.AppVer, setting.AppBuiltWith)
|
||||||
log.Info("* RunMode: %s", setting.RunMode)
|
log.Info("* RunMode: %s", setting.RunMode)
|
||||||
log.Info("* AppPath: %s", setting.AppPath)
|
log.Info("* AppPath: %s", setting.AppPath)
|
||||||
log.Info("* WorkPath: %s", setting.AppWorkPath)
|
log.Info("* WorkPath: %s", setting.AppWorkPath)
|
||||||
|
@ -136,13 +136,13 @@ func serveInstall(ctx *cli.Context) error {
|
||||||
c := install.Routes()
|
c := install.Routes()
|
||||||
err := listen(c, false)
|
err := listen(c, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Critical("Unable to open listener for installer. Is Gitea already running?")
|
log.Critical("Unable to open listener for installer. Is Forgejo already running?")
|
||||||
graceful.GetManager().DoGracefulShutdown()
|
graceful.GetManager().DoGracefulShutdown()
|
||||||
}
|
}
|
||||||
select {
|
select {
|
||||||
case <-graceful.GetManager().IsShutdown():
|
case <-graceful.GetManager().IsShutdown():
|
||||||
<-graceful.GetManager().Done()
|
<-graceful.GetManager().Done()
|
||||||
log.Info("PID: %d Gitea Web Finished", os.Getpid())
|
log.Info("PID: %d Forgejo Web Finished", os.Getpid())
|
||||||
log.GetManager().Close()
|
log.GetManager().Close()
|
||||||
return err
|
return err
|
||||||
default:
|
default:
|
||||||
|
@ -211,7 +211,7 @@ func serveInstalled(ctx *cli.Context) error {
|
||||||
webRoutes := routers.NormalRoutes()
|
webRoutes := routers.NormalRoutes()
|
||||||
err := listen(webRoutes, true)
|
err := listen(webRoutes, true)
|
||||||
<-graceful.GetManager().Done()
|
<-graceful.GetManager().Done()
|
||||||
log.Info("PID: %d Gitea Web Finished", os.Getpid())
|
log.Info("PID: %d Forgejo Web Finished", os.Getpid())
|
||||||
log.GetManager().Close()
|
log.GetManager().Close()
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -237,9 +237,9 @@ func runWeb(ctx *cli.Context) error {
|
||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
||||||
if os.Getppid() > 1 && len(os.Getenv("LISTEN_FDS")) > 0 {
|
if os.Getppid() > 1 && len(os.Getenv("LISTEN_FDS")) > 0 {
|
||||||
log.Info("Restarting Gitea on PID: %d from parent PID: %d", os.Getpid(), os.Getppid())
|
log.Info("Restarting Forgejo on PID: %d from parent PID: %d", os.Getpid(), os.Getppid())
|
||||||
} else {
|
} else {
|
||||||
log.Info("Starting Gitea on PID: %d", os.Getpid())
|
log.Info("Starting Forgejo on PID: %d", os.Getpid())
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set pid file setting
|
// Set pid file setting
|
||||||
|
@ -299,7 +299,7 @@ func listen(m http.Handler, handleRedirector bool) error {
|
||||||
if setting.Protocol != setting.HTTPUnix && setting.Protocol != setting.FCGIUnix {
|
if setting.Protocol != setting.HTTPUnix && setting.Protocol != setting.FCGIUnix {
|
||||||
listenAddr = net.JoinHostPort(listenAddr, setting.HTTPPort)
|
listenAddr = net.JoinHostPort(listenAddr, setting.HTTPPort)
|
||||||
}
|
}
|
||||||
_, _, finished := process.GetManager().AddTypedContext(graceful.GetManager().HammerContext(), "Web: Gitea Server", process.SystemProcessType, true)
|
_, _, finished := process.GetManager().AddTypedContext(graceful.GetManager().HammerContext(), "Web: Forgejo Server", process.SystemProcessType, true)
|
||||||
defer finished()
|
defer finished()
|
||||||
log.Info("Listen: %v://%s%s", setting.Protocol, listenAddr, setting.AppSubURL)
|
log.Info("Listen: %v://%s%s", setting.Protocol, listenAddr, setting.AppSubURL)
|
||||||
// This can be useful for users, many users do wrong to their config and get strange behaviors behind a reverse-proxy.
|
// This can be useful for users, many users do wrong to their config and get strange behaviors behind a reverse-proxy.
|
||||||
|
|
Loading…
Reference in a new issue