Browse Source

Remove traces of embedded TiDB (#4906)

Fix #3357
for-closed-social
techknowlogick 6 years ago
committed by GitHub
parent
commit
f1ad4bb3d5
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 19 deletions
  1. +3
    -4
      options/locale/locale_en-US.ini
  2. +2
    -15
      routers/install.go

+ 3
- 4
options/locale/locale_en-US.ini View File

@ -80,7 +80,7 @@ loading = Loading…
install = Installation
title = Initial Configuration
docker_helper = If you run Gitea inside Docker, please read the <a target="_blank" rel="noopener noreferrer" href="%s">documentation</a> before changing any settings.
requite_db_desc = Gitea requires MySQL, PostgreSQL, MSSQL, SQLite3 or TiDB.
requite_db_desc = Gitea requires MySQL, PostgreSQL, MSSQL, or SQLite3.
db_title = Database Settings
db_type = Database Type
host = Host
@ -90,9 +90,8 @@ db_name = Database Name
db_helper = Note to MySQL users: please use the InnoDB storage engine and the 'utf8_general_ci' character set.
ssl_mode = SSL
path = Path
sqlite_helper = File path for the SQLite3 or TiDB database.<br>Enter an absolute path if you run Gitea as a service.
err_empty_db_path = The SQLite3 or TiDB database path cannot be empty.
err_invalid_tidb_name = The TiDB database name cannot contain the '.' and '-' characters.
sqlite_helper = File path for the SQLite3 database.<br>Enter an absolute path if you run Gitea as a service.
err_empty_db_path = The SQLite3 database path cannot be empty.
no_admin_and_disable_registration = You cannot disable user self-registration without creating an administrator account.
err_empty_admin_password = The administrator password cannot be empty.

+ 2
- 15
routers/install.go View File

@ -8,7 +8,6 @@ import (
"errors"
"os"
"os/exec"
"path"
"path/filepath"
"strings"
@ -45,9 +44,6 @@ func InstallInit(ctx *context.Context) {
if models.EnableSQLite3 {
dbOpts = append(dbOpts, "SQLite3")
}
if models.EnableTiDB {
dbOpts = append(dbOpts, "TiDB")
}
ctx.Data["DbOptions"] = dbOpts
}
@ -72,10 +68,6 @@ func Install(ctx *context.Context) {
if models.EnableSQLite3 {
ctx.Data["CurDbOption"] = "SQLite3"
}
case "tidb":
if models.EnableTiDB {
ctx.Data["CurDbOption"] = "TiDB"
}
}
// Application general settings
@ -151,7 +143,7 @@ func InstallPost(ctx *context.Context, form auth.InstallForm) {
// Pass basic check, now test configuration.
// Test database setting.
dbTypes := map[string]string{"MySQL": "mysql", "PostgreSQL": "postgres", "MSSQL": "mssql", "SQLite3": "sqlite3", "TiDB": "tidb"}
dbTypes := map[string]string{"MySQL": "mysql", "PostgreSQL": "postgres", "MSSQL": "mssql", "SQLite3": "sqlite3"}
models.DbCfg.Type = dbTypes[form.DbType]
models.DbCfg.Host = form.DbHost
models.DbCfg.User = form.DbUser
@ -160,16 +152,11 @@ func InstallPost(ctx *context.Context, form auth.InstallForm) {
models.DbCfg.SSLMode = form.SSLMode
models.DbCfg.Path = form.DbPath
if (models.DbCfg.Type == "sqlite3" || models.DbCfg.Type == "tidb") &&
if (models.DbCfg.Type == "sqlite3") &&
len(models.DbCfg.Path) == 0 {
ctx.Data["Err_DbPath"] = true
ctx.RenderWithErr(ctx.Tr("install.err_empty_db_path"), tplInstall, &form)
return
} else if models.DbCfg.Type == "tidb" &&
strings.ContainsAny(path.Base(models.DbCfg.Path), ".-") {
ctx.Data["Err_DbPath"] = true
ctx.RenderWithErr(ctx.Tr("install.err_invalid_tidb_name"), tplInstall, &form)
return
}
// Set test engine.

Loading…
Cancel
Save