From 0cbc0ec15d9d952b0ecfb68a36bf58cbae0c43dd Mon Sep 17 00:00:00 2001 From: Caesar Schinas Date: Mon, 19 Dec 2022 20:01:46 +0000 Subject: [PATCH] [BRANDING] Rebrand default config settings for new installs (#140) Replaces `Gitea` with `Forgejo` in the default config settings for new installs. This will not affect existing installs. Co-authored-by: Caesar Schinas Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/140 Co-authored-by: Caesar Schinas Co-committed-by: Caesar Schinas (cherry picked from commit ca1319aa16128516e50dabdc8e8cadc23eb71d2f) (cherry picked from commit 52a4d238a0b5bbea28b28e55e35f28c51ecbb2de) (cherry picked from commit f63536538cfe4b010ebb5a6323f4b5e5b6ec7232) Conflicts: web_src/js/features/install.js (cherry picked from commit 861cc434e129f3fbd932ee36067c560e754dab9a) (cherry picked from commit 0e6ea60c802d6cfd95dea4aad5df96bb6e4bc7a5) --- custom/conf/app.example.ini | 2 +- modules/setting/database.go | 2 +- modules/setting/repository.go | 2 +- modules/setting/server.go | 2 +- routers/install/install.go | 2 +- web_src/js/features/install.js | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/custom/conf/app.example.ini b/custom/conf/app.example.ini index 813028d64e..c53599d44f 100644 --- a/custom/conf/app.example.ini +++ b/custom/conf/app.example.ini @@ -365,7 +365,7 @@ USER = root ;; SQLite Configuration ;; ;DB_TYPE = sqlite3 -;PATH= ; defaults to data/gitea.db +;PATH= ; defaults to data/forgejo.db ;SQLITE_TIMEOUT = ; Query timeout defaults to: 500 ;SQLITE_JOURNAL_MODE = ; defaults to sqlite database default (often DELETE), can be used to enable WAL mode. https://www.sqlite.org/pragma.html#pragma_journal_mode ;; diff --git a/modules/setting/database.go b/modules/setting/database.go index 8c4dfb21d7..bf7508c25c 100644 --- a/modules/setting/database.go +++ b/modules/setting/database.go @@ -79,7 +79,7 @@ func loadDBSetting(rootCfg ConfigProvider) { log.Error("Deprecated database mysql charset utf8 support, please use utf8mb4 or convert utf8 to utf8mb4.") } - Database.Path = sec.Key("PATH").MustString(filepath.Join(AppDataPath, "gitea.db")) + Database.Path = sec.Key("PATH").MustString(filepath.Join(AppDataPath, "forgejo.db")) Database.Timeout = sec.Key("SQLITE_TIMEOUT").MustInt(500) Database.SQLiteJournalMode = sec.Key("SQLITE_JOURNAL_MODE").MustString("") diff --git a/modules/setting/repository.go b/modules/setting/repository.go index 4964704dba..08359d413e 100644 --- a/modules/setting/repository.go +++ b/modules/setting/repository.go @@ -278,7 +278,7 @@ func loadRepositoryFrom(rootCfg ConfigProvider) { Repository.UseCompatSSHURI = sec.Key("USE_COMPAT_SSH_URI").MustBool() Repository.MaxCreationLimit = sec.Key("MAX_CREATION_LIMIT").MustInt(-1) Repository.DefaultBranch = sec.Key("DEFAULT_BRANCH").MustString(Repository.DefaultBranch) - RepoRootPath = sec.Key("ROOT").MustString(path.Join(AppDataPath, "gitea-repositories")) + RepoRootPath = sec.Key("ROOT").MustString(path.Join(AppDataPath, "forgejo-repositories")) forcePathSeparator(RepoRootPath) if !filepath.IsAbs(RepoRootPath) { RepoRootPath = filepath.Join(AppWorkPath, RepoRootPath) diff --git a/modules/setting/server.go b/modules/setting/server.go index 1839062685..aff0cfba33 100644 --- a/modules/setting/server.go +++ b/modules/setting/server.go @@ -167,7 +167,7 @@ func MakeAbsoluteAssetURL(appURL, staticURLPrefix string) string { func loadServerFrom(rootCfg ConfigProvider) { sec := rootCfg.Section("server") - AppName = rootCfg.Section("").Key("APP_NAME").MustString("Gitea: Git with a cup of tea") + AppName = rootCfg.Section("").Key("APP_NAME").MustString("Forgejo: Beyond coding. We Forge.") Domain = sec.Key("DOMAIN").MustString("localhost") HTTPAddr = sec.Key("HTTP_ADDR").MustString("0.0.0.0") diff --git a/routers/install/install.go b/routers/install/install.go index 8e2d19c732..f70cdfa135 100644 --- a/routers/install/install.go +++ b/routers/install/install.go @@ -185,7 +185,7 @@ func checkDatabase(ctx *context.Context, form *forms.InstallForm) bool { if err = db.InitEngine(ctx); err != nil { if strings.Contains(err.Error(), `Unknown database type: sqlite3`) { ctx.Data["Err_DbType"] = true - ctx.RenderWithErr(ctx.Tr("install.sqlite3_not_available", "https://docs.gitea.io/en-us/install-from-binary/"), tplInstall, form) + ctx.RenderWithErr(ctx.Tr("install.sqlite3_not_available", "https://forgejo.org/download#installation-from-binary"), tplInstall, form) } else { ctx.Data["Err_DbSetting"] = true ctx.RenderWithErr(ctx.Tr("install.invalid_db_setting", err), tplInstall, form) diff --git a/web_src/js/features/install.js b/web_src/js/features/install.js index 23122ca4c3..32381a7b37 100644 --- a/web_src/js/features/install.js +++ b/web_src/js/features/install.js @@ -14,8 +14,8 @@ export function initInstall() { } function initPreInstall() { - const defaultDbUser = 'gitea'; - const defaultDbName = 'gitea'; + const defaultDbUser = 'forgejo'; + const defaultDbName = 'forgejo'; const defaultDbHosts = { mysql: '127.0.0.1:3306',