From c7ba51518cd460669434f30869e29ea47d0e7d8f Mon Sep 17 00:00:00 2001 From: 0ko <0ko@noreply.codeberg.org> Date: Sun, 21 Apr 2024 21:26:15 +0500 Subject: [PATCH] s/Gitea/Forgejo in various log messages and comments (cherry picked from commit 469c214ec8af393bb65f847f2ba53f16d41fa87a) --- build/generate-emoji.go | 2 +- models/db/collation.go | 2 +- models/migrations/migrations.go | 8 ++++---- modules/charset/escape_test.go | 2 +- modules/indexer/code/indexer.go | 4 ++-- modules/indexer/internal/bleve/indexer.go | 2 +- modules/indexer/internal/elasticsearch/util.go | 2 +- modules/indexer/internal/meilisearch/util.go | 2 +- modules/indexer/issues/indexer.go | 2 +- modules/markup/html.go | 2 +- modules/nosql/manager_redis.go | 2 +- modules/setting/setting.go | 12 ++++++------ modules/templates/htmlrenderer.go | 6 +++--- routers/init.go | 2 +- routers/install/install.go | 6 +++--- routers/web/admin/queue.go | 2 +- routers/web/repo/view.go | 2 +- services/webhook/slack.go | 2 +- web_src/js/features/comp/EasyMDEToolbarActions.js | 2 +- 19 files changed, 32 insertions(+), 32 deletions(-) diff --git a/build/generate-emoji.go b/build/generate-emoji.go index 17a9670f06..5a88e456ee 100644 --- a/build/generate-emoji.go +++ b/build/generate-emoji.go @@ -142,7 +142,7 @@ func generate() ([]byte, error) { } } - // gitea customizations + // Forgejo customizations i, ok := aliasMap["tada"] if ok { data[i].Aliases = append(data[i].Aliases, "hooray") diff --git a/models/db/collation.go b/models/db/collation.go index c128cf5029..149e74a85c 100644 --- a/models/db/collation.go +++ b/models/db/collation.go @@ -181,7 +181,7 @@ func preprocessDatabaseCollation(x *xorm.Engine) { // check column collation, and show warning/error to end users -- no need to fatal, do not block the startup if !r.IsCollationCaseSensitive(r.DatabaseCollation) { - log.Warn("Current database is using a case-insensitive collation %q, although Gitea could work with it, there might be some rare cases which don't work as expected.", r.DatabaseCollation) + log.Warn("Current database is using a case-insensitive collation %q, although Forgejo could work with it, there might be some rare cases which don't work as expected.", r.DatabaseCollation) } if len(r.InconsistentCollationColumns) > 0 { diff --git a/models/migrations/migrations.go b/models/migrations/migrations.go index 0fa46a8d0b..df8ffc3308 100644 --- a/models/migrations/migrations.go +++ b/models/migrations/migrations.go @@ -650,15 +650,15 @@ func Migrate(x *xorm.Engine) error { v := currentVersion.Version if minDBVersion > v { - log.Fatal(`Gitea no longer supports auto-migration from your previously installed version. + log.Fatal(`Forgejo no longer supports auto-migration from your previously installed version. Please try upgrading to a lower version first (suggested v1.6.4), then upgrade to this version.`) return nil } - // Downgrading Gitea's database version not supported + // Downgrading Forgejo database version is not supported if int(v-minDBVersion) > len(migrations) { - msg := fmt.Sprintf("Your database (migration version: %d) is for a newer Gitea, you can not use the newer database for this old Gitea release (%d).", v, minDBVersion+len(migrations)) - msg += "\nGitea will exit to keep your database safe and unchanged. Please use the correct Gitea release, do not change the migration version manually (incorrect manual operation may lose data)." + msg := fmt.Sprintf("Your database (migration version: %d) is for a newer Forgejo, you can not use the newer database for this old Forgejo release (%d).", v, minDBVersion+len(migrations)) + msg += "\nForgejo will exit to keep your database safe and unchanged. Please use the correct Forgejo release, do not change the migration version manually (incorrect manual operation may lose data)." if !setting.IsProd { msg += fmt.Sprintf("\nIf you are in development and really know what you're doing, you can force changing the migration version by executing: UPDATE version SET version=%d WHERE id=1;", minDBVersion+len(migrations)) } diff --git a/modules/charset/escape_test.go b/modules/charset/escape_test.go index 7442a80d7f..83dda16c53 100644 --- a/modules/charset/escape_test.go +++ b/modules/charset/escape_test.go @@ -130,7 +130,7 @@ then resh (ר), and finally heh (ה) (which should appear leftmost).`, }, { // UTF-8/16/32 all use the same codepoint for BOM - // Gitea could read UTF-16/32 content and convert into UTF-8 internally then render it, so we only process UTF-8 internally + // Forgejo could read UTF-16/32 content and convert into UTF-8 internally then render it, so we only process UTF-8 internally name: "UTF BOM", text: "\xef\xbb\xbftest", result: "\xef\xbb\xbftest", diff --git a/modules/indexer/code/indexer.go b/modules/indexer/code/indexer.go index 31adce10e0..0a8ce27907 100644 --- a/modules/indexer/code/indexer.go +++ b/modules/indexer/code/indexer.go @@ -158,7 +158,7 @@ func Init() { if err := recover(); err != nil { log.Error("PANIC whilst initializing repository indexer: %v\nStacktrace: %s", err, log.Stack(2)) log.Error("The indexer files are likely corrupted and may need to be deleted") - log.Error("You can completely remove the \"%s\" directory to make Gitea recreate the indexes", setting.Indexer.RepoPath) + log.Error("You can completely remove the \"%s\" directory to make Forgejo recreate the indexes", setting.Indexer.RepoPath) } }() @@ -176,7 +176,7 @@ func Init() { if err := recover(); err != nil { log.Error("PANIC whilst initializing repository indexer: %v\nStacktrace: %s", err, log.Stack(2)) log.Error("The indexer files are likely corrupted and may need to be deleted") - log.Error("You can completely remove the \"%s\" index to make Gitea recreate the indexes", setting.Indexer.RepoConnStr) + log.Error("You can completely remove the \"%s\" index to make Forgejo recreate the indexes", setting.Indexer.RepoConnStr) } }() diff --git a/modules/indexer/internal/bleve/indexer.go b/modules/indexer/internal/bleve/indexer.go index a168e0cb9b..1435d2f519 100644 --- a/modules/indexer/internal/bleve/indexer.go +++ b/modules/indexer/internal/bleve/indexer.go @@ -55,7 +55,7 @@ func (i *Indexer) Init(_ context.Context) (bool, error) { } if version != 0 { - log.Warn("Found older bleve index with version %d, Gitea will remove it and rebuild", version) + log.Warn("Found older bleve index with version %d, Forgejo will remove it and rebuild", version) } indexMapping, err := i.mappingGetter() diff --git a/modules/indexer/internal/elasticsearch/util.go b/modules/indexer/internal/elasticsearch/util.go index 9e034bd553..18cb152d3c 100644 --- a/modules/indexer/internal/elasticsearch/util.go +++ b/modules/indexer/internal/elasticsearch/util.go @@ -62,7 +62,7 @@ func (i *Indexer) checkOldIndexes(ctx context.Context) { indexName := versionedIndexName(i.indexName, v) exists, err := i.Client.IndexExists(indexName).Do(ctx) if err == nil && exists { - log.Warn("Found older elasticsearch index named %q, Gitea will keep the old NOT DELETED. You can delete the old version after the upgrade succeed.", indexName) + log.Warn("Found older elasticsearch index named %q, Forgejo will keep the old NOT DELETED. You can delete the old version after the upgrade succeed.", indexName) } } } diff --git a/modules/indexer/internal/meilisearch/util.go b/modules/indexer/internal/meilisearch/util.go index e6d8fefade..845bdb6e7f 100644 --- a/modules/indexer/internal/meilisearch/util.go +++ b/modules/indexer/internal/meilisearch/util.go @@ -32,7 +32,7 @@ func (i *Indexer) checkOldIndexes() { indexName := versionedIndexName(i.indexName, v) _, err := i.Client.GetIndex(indexName) if err == nil { - log.Warn("Found older meilisearch index named %q, Gitea will keep the old NOT DELETED. You can delete the old version after the upgrade succeed.", indexName) + log.Warn("Found older meilisearch index named %q, Forgejo will keep the old NOT DELETED. You can delete the old version after the upgrade succeed.", indexName) } } } diff --git a/modules/indexer/issues/indexer.go b/modules/indexer/issues/indexer.go index 1cb86feb82..9f56cb00f2 100644 --- a/modules/indexer/issues/indexer.go +++ b/modules/indexer/issues/indexer.go @@ -85,7 +85,7 @@ func InitIssueIndexer(syncReindex bool) { if err := recover(); err != nil { log.Error("PANIC whilst initializing issue indexer: %v\nStacktrace: %s", err, log.Stack(2)) log.Error("The indexer files are likely corrupted and may need to be deleted") - log.Error("You can completely remove the %q directory to make Gitea recreate the indexes", setting.Indexer.IssuePath) + log.Error("You can completely remove the %q directory to make Forgejo recreate the indexes", setting.Indexer.IssuePath) globalIndexer.Store(dummyIndexer) log.Fatal("PID: %d Unable to initialize the Bleve Issue Indexer at path: %s Error: %v", os.Getpid(), setting.Indexer.IssuePath, err) } diff --git a/modules/markup/html.go b/modules/markup/html.go index b4fd008aa7..7a5ca14aeb 100644 --- a/modules/markup/html.go +++ b/modules/markup/html.go @@ -893,7 +893,7 @@ func issueIndexPatternProcessor(ctx *RenderContext, node *html.Node) { } else { // Path determines the type of link that will be rendered. It's unknown at this point whether // the linked item is actually a PR or an issue. Luckily it's of no real consequence because - // Gitea will redirect on click as appropriate. + // Forgejo will redirect on click as appropriate. path := "issues" if ref.IsPull { path = "pulls" diff --git a/modules/nosql/manager_redis.go b/modules/nosql/manager_redis.go index 3c82651541..3c5502f979 100644 --- a/modules/nosql/manager_redis.go +++ b/modules/nosql/manager_redis.go @@ -224,7 +224,7 @@ func getRedisOptions(uri *url.URL) *redis.UniversalOptions { if db, err := strconv.Atoi(uri.Path[1:]); err == nil { opts.DB = db } else { - log.Error("Provided database identifier '%s' is not a valid integer. Gitea will ignore this option.", uri.Path) + log.Error("Provided database identifier '%s' is not a valid integer. Forgejo will ignore this option.", uri.Path) } } diff --git a/modules/setting/setting.go b/modules/setting/setting.go index 781e794d5d..c906429a71 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -67,8 +67,8 @@ func IsRunUserMatchCurrentUser(runUser string) (string, bool) { // PrepareAppDataPath creates app data directory if necessary func PrepareAppDataPath() error { // FIXME: There are too many calls to MkdirAll in old code. It is incorrect. - // For example, if someDir=/mnt/vol1/gitea-home/data, if the mount point /mnt/vol1 is not mounted when Gitea runs, - // then gitea will make new empty directories in /mnt/vol1, all are stored in the root filesystem. + // For example, if someDir=/mnt/vol1/gitea-home/data, if the mount point /mnt/vol1 is not mounted when Forgejo runs, + // then Forgejo will make new empty directories in /mnt/vol1, all are stored in the root filesystem. // The correct behavior should be: creating parent directories is end users' duty. We only create sub-directories in existing parent directories. // For quickstart, the parent directories should be created automatically for first startup (eg: a flag or a check of INSTALL_LOCK). // Now we can take the first step to do correctly (using Mkdir) in other packages, and prepare the AppDataPath here, then make a refactor in future. @@ -103,7 +103,7 @@ func InitCfgProvider(file string) { func MustInstalled() { if !InstallLock { - log.Fatal(`Unable to load config file for a installed Gitea instance, you should either use "--config" to set your config file (app.ini), or run "gitea web" command to install Gitea.`) + log.Fatal(`Unable to load config file for a installed Forgejo instance, you should either use "--config" to set your config file (app.ini), or run "forgejo web" command to install Forgejo.`) } } @@ -163,7 +163,7 @@ func loadRunModeFrom(rootCfg ConfigProvider) { rootSec := rootCfg.Section("") RunUser = rootSec.Key("RUN_USER").MustString(user.CurrentUsername()) - // The following is a purposefully undocumented option. Please do not run Gitea as root. It will only cause future headaches. + // The following is a purposefully undocumented option. Please do not run Forgejo as root. It will only cause future headaches. // Please don't use root as a bandaid to "fix" something that is broken, instead the broken thing should instead be fixed properly. unsafeAllowRunAsRoot := ConfigSectionKeyBool(rootSec, "I_AM_BEING_UNSAFE_RUNNING_AS_ROOT") unsafeAllowRunAsRoot = unsafeAllowRunAsRoot || util.OptionalBoolParse(os.Getenv("GITEA_I_AM_BEING_UNSAFE_RUNNING_AS_ROOT")).Value() @@ -183,9 +183,9 @@ func loadRunModeFrom(rootCfg ConfigProvider) { if os.Getuid() == 0 { if !unsafeAllowRunAsRoot { // Special thanks to VLC which inspired the wording of this messaging. - log.Fatal("Gitea is not supposed to be run as root. Sorry. If you need to use privileged TCP ports please instead use setcap and the `cap_net_bind_service` permission") + log.Fatal("Forgejo is not supposed to be run as root. Sorry. If you need to use privileged TCP ports please instead use setcap and the `cap_net_bind_service` permission") } - log.Critical("You are running Gitea using the root user, and have purposely chosen to skip built-in protections around this. You have been warned against this.") + log.Critical("You are running Forgejo using the root user, and have purposely chosen to skip built-in protections around this. You have been warned against this.") } } diff --git a/modules/templates/htmlrenderer.go b/modules/templates/htmlrenderer.go index 40941285aa..8661653adf 100644 --- a/modules/templates/htmlrenderer.go +++ b/modules/templates/htmlrenderer.go @@ -136,11 +136,11 @@ func wrapTmplErrMsg(msg string) { return } if setting.IsProd { - // in prod mode, Gitea must have correct templates to run - log.Fatal("Gitea can't run with template errors: %s", msg) + // in prod mode, Forgejo must have correct templates to run + log.Fatal("Forgejo can't run with template errors: %s", msg) } else { // in dev mode, do not need to really exit, because the template errors could be fixed by developer soon and the templates get reloaded - log.Error("There are template errors but Gitea continues to run in dev mode: %s", msg) + log.Error("There are template errors but Forgejo continues to run in dev mode: %s", msg) } } diff --git a/routers/init.go b/routers/init.go index 28e1c49801..821a0ef38c 100644 --- a/routers/init.go +++ b/routers/init.go @@ -132,7 +132,7 @@ func InitWebInstalled(ctx context.Context) { if setting.EnableSQLite3 { log.Info("SQLite3 support is enabled") } else if setting.Database.Type.IsSQLite3() { - log.Fatal("SQLite3 support is disabled, but it is used for database setting. Please get or build a Gitea release with SQLite3 support.") + log.Fatal("SQLite3 support is disabled, but it is used for database setting. Please get or build a Forgejo release with SQLite3 support.") } mustInitCtx(ctx, common.InitDBEngine) diff --git a/routers/install/install.go b/routers/install/install.go index d5503db31f..282ebe9ead 100644 --- a/routers/install/install.go +++ b/routers/install/install.go @@ -212,7 +212,7 @@ func checkDatabase(ctx *context.Context, form *forms.InstallForm) bool { } if hasPostInstallationUser && dbMigrationVersion > 0 { - log.Error("The database is likely to have been used by Gitea before, database migration version=%d", dbMigrationVersion) + log.Error("The database is likely to have been used by Forgejo before, database migration version=%d", dbMigrationVersion) confirmed := form.ReinstallConfirmFirst && form.ReinstallConfirmSecond && form.ReinstallConfirmThird if !confirmed { ctx.Data["Err_DbInstalledBefore"] = true @@ -220,11 +220,11 @@ func checkDatabase(ctx *context.Context, form *forms.InstallForm) bool { return false } - log.Info("User confirmed re-installation of Gitea into a pre-existing database") + log.Info("User confirmed re-installation of Forgejo into a pre-existing database") } if hasPostInstallationUser || dbMigrationVersion > 0 { - log.Info("Gitea will be installed in a database with: hasPostInstallationUser=%v, dbMigrationVersion=%v", hasPostInstallationUser, dbMigrationVersion) + log.Info("Forgejo will be installed in a database with: hasPostInstallationUser=%v, dbMigrationVersion=%v", hasPostInstallationUser, dbMigrationVersion) } return true diff --git a/routers/web/admin/queue.go b/routers/web/admin/queue.go index d8c50730b1..246ab379b5 100644 --- a/routers/web/admin/queue.go +++ b/routers/web/admin/queue.go @@ -69,7 +69,7 @@ func QueueSet(ctx *context.Context) { } func QueueRemoveAllItems(ctx *context.Context) { - // Gitea's queue doesn't have transaction support + // Queue in Forgejo doesn't have transaction support // So in rare cases, the queue could be corrupted/out-of-sync // Site admin could remove all items from the queue to make it work again qid := ctx.ParamsInt64("qid") diff --git a/routers/web/repo/view.go b/routers/web/repo/view.go index a65a100212..e98cd46c4e 100644 --- a/routers/web/repo/view.go +++ b/routers/web/repo/view.go @@ -556,7 +556,7 @@ func renderFile(ctx *context.Context, entry *git.TreeEntry) { // The Open Group Base Specification: https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html // empty: 0 lines; "a": 1 incomplete-line; "a\n": 1 line; "a\nb": 1 line, 1 incomplete-line; - // Gitea uses the definition (like most modern editors): + // Forgejo uses the definition (like most modern editors): // empty: 0 lines; "a": 1 line; "a\n": 2 lines; "a\nb": 2 lines; // When rendering, the last empty line is not rendered in UI, while the line-number is still counted, to tell users that the file contains a trailing EOL. // To make the UI more consistent, it could use an icon mark to indicate that there is no trailing EOL, and show line-number as the rendered lines. diff --git a/services/webhook/slack.go b/services/webhook/slack.go index c835d59984..3af483a90e 100644 --- a/services/webhook/slack.go +++ b/services/webhook/slack.go @@ -356,7 +356,7 @@ var slackChannel = regexp.MustCompile(`^#?[a-z0-9_-]{1,80}$`) // IsValidSlackChannel validates a channel name conforms to what slack expects: // https://api.slack.com/methods/conversations.rename#naming // Conversation names can only contain lowercase letters, numbers, hyphens, and underscores, and must be 80 characters or less. -// Gitea accepts if it starts with a #. +// Forgejo accepts if it starts with a #. func IsValidSlackChannel(name string) bool { return slackChannel.MatchString(name) } diff --git a/web_src/js/features/comp/EasyMDEToolbarActions.js b/web_src/js/features/comp/EasyMDEToolbarActions.js index c97d683704..35abb877d7 100644 --- a/web_src/js/features/comp/EasyMDEToolbarActions.js +++ b/web_src/js/features/comp/EasyMDEToolbarActions.js @@ -99,7 +99,7 @@ export function easyMDEToolbarActions(EasyMDE, editor) { title: 'Side by Side', }, - // gitea's custom actions + // Forgejo custom actions 'gitea-checkbox-empty': { action(e) { const cm = e.codemirror;