浏览代码

Removed App Name Completely

Yoginth 7 年之前
父节点
当前提交
1e0f15d116

+ 0 - 2
conf/app.ini

@@ -1,5 +1,3 @@
-; App name that shows on every page title
-APP_NAME = Gitote
 ; The name of the system user that runs Gitote
 RUN_USER = git
 ; Either "dev", "prod" or "test"

+ 0 - 2
conf/locale/locale_en-GB.ini

@@ -70,8 +70,6 @@ no_admin_and_disable_registration = You cannot disable registration without crea
 err_empty_admin_password = Admin password cannot be empty.
 
 general_title = Application General Settings
-app_name = Application Name
-app_name_helper = Put your organization name here huge and loud!
 repo_path = Repository Root Path
 repo_path_helper = All Git remote repositories will be saved to this directory.
 run_user = Run User

+ 0 - 2
conf/locale/locale_en-US.ini

@@ -70,8 +70,6 @@ no_admin_and_disable_registration = You cannot disable registration without crea
 err_empty_admin_password = Admin password cannot be empty.
 
 general_title = Application General Settings
-app_name = Application Name
-app_name_helper = Put your organization name here huge and loud!
 repo_path = Repository Root Path
 repo_path_helper = All Git remote repositories will be saved to this directory.
 run_user = Run User

+ 0 - 1
pkg/form/user.go

@@ -16,7 +16,6 @@ type Install struct {
 	SSLMode  string
 	DbPath   string
 
-	AppName             string `binding:"Required" locale:"install.app_name"`
 	RepoRootPath        string `binding:"Required"`
 	RunUser             string `binding:"Required"`
 	Domain              string `binding:"Required"`

+ 2 - 4
pkg/setting/setting.go

@@ -50,7 +50,6 @@ var (
 	// App settings
 	AppVer         string
 	APIVer         string
-	AppName        string
 	AppURL         string
 	AppSubURL      string
 	AppSubURLDepth int // Number of slashes
@@ -439,7 +438,6 @@ func NewContext() {
 	forcePathSeparator(LogRootPath)
 
 	sec := Cfg.Section("server")
-	AppName = Cfg.Section("").Key("APP_NAME").MustString("Gitote")
 	AppURL = sec.Key("ROOT_URL").MustString("http://localhost:3000/")
 	if AppURL[len(AppURL)-1] != '/' {
 		AppURL += "/"
@@ -798,7 +796,7 @@ func newLogService() {
 	}
 
 	// Make sure everyone gets version info printed.
-	log.Info("%s %s", AppName, AppVer)
+	log.Info("%s %s", "Gitote", AppVer)
 	if !hasConsole {
 		log.Delete(log.CONSOLE)
 	}
@@ -862,7 +860,7 @@ func newMailService() {
 
 	MailService = &Mailer{
 		QueueLength:    sec.Key("SEND_BUFFER_LEN").MustInt(100),
-		SubjectPrefix:  sec.Key("SUBJECT_PREFIX").MustString("[" + AppName + "] "),
+		SubjectPrefix:  sec.Key("SUBJECT_PREFIX").MustString("[" + "Gitote" + "] "),
 		Host:           sec.Key("HOST").String(),
 		User:           sec.Key("USER").String(),
 		Passwd:         sec.Key("PASSWD").String(),

+ 0 - 3
pkg/template/template.go

@@ -31,9 +31,6 @@ func NewFuncMap() []template.FuncMap {
 		"UseHTTPS": func() bool {
 			return strings.HasPrefix(setting.AppURL, "https")
 		},
-		"AppName": func() string {
-			return setting.AppName
-		},
 		"AppSubURL": func() string {
 			return setting.AppSubURL
 		},

+ 0 - 1
routes/dev/template.go

@@ -8,7 +8,6 @@ import (
 
 func TemplatePreview(c *context.Context) {
 	c.Data["User"] = models.User{Name: "Yoginth"}
-	c.Data["AppName"] = setting.AppName
 	c.Data["AppVer"] = setting.AppVer
 	c.Data["APIVer"] = setting.APIVer
 	c.Data["AppURL"] = setting.AppURL

+ 0 - 2
routes/install.go

@@ -134,7 +134,6 @@ func Install(c *context.Context) {
 	}
 
 	// Application general settings
-	f.AppName = setting.AppName
 	f.RepoRootPath = setting.RepoRootPath
 
 	// Note(yoginth): it's hard for Windows users change a running user,
@@ -304,7 +303,6 @@ func InstallPost(c *context.Context, f form.Install) {
 	cfg.Section("database").Key("SSL_MODE").SetValue(models.DbCfg.SSLMode)
 	cfg.Section("database").Key("PATH").SetValue(models.DbCfg.Path)
 
-	cfg.Section("").Key("APP_NAME").SetValue(f.AppName)
 	cfg.Section("repository").Key("ROOT").SetValue(f.RepoRootPath)
 	cfg.Section("").Key("RUN_USER").SetValue(f.RunUser)
 	cfg.Section("server").Key("DOMAIN").SetValue(f.Domain)

+ 1 - 1
routes/user/setting.go

@@ -458,7 +458,7 @@ func SettingsTwoFactorEnable(c *context.Context) {
 	}
 	if key == nil {
 		key, err = totp.Generate(totp.GenerateOpts{
-			Issuer:      setting.AppName,
+			Issuer:      "Gitote",
 			AccountName: c.User.Email,
 		})
 		if err != nil {

+ 0 - 5
templates/install.tmpl

@@ -74,11 +74,6 @@
 
 					<!-- General Settings -->
 					<h4 class="ui dividing header">{{.i18n.Tr "install.general_title"}}</h4>
-					<div class="inline required field {{if .Err_AppName}}error{{end}}">
-						<label for="app_name">{{.i18n.Tr "install.app_name"}}</label>
-						<input id="app_name" name="app_name" value="{{.app_name}}" required>
-						<span class="help">{{.i18n.Tr "install.app_name_helper"}}</span>
-					</div>
 					<div class="inline required field {{if .Err_RepoRootPath}}error{{end}}">
 						<label for="repo_root_path">{{.i18n.Tr "install.repo_path"}}</label>
 						<input id="repo_root_path" name="repo_root_path" value="{{.repo_root_path}}" required>