Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove traces of embedded TiDB #4906

Merged
merged 3 commits into from
Sep 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions options/locale/locale_en-US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.

Expand Down
17 changes: 2 additions & 15 deletions routers/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"errors"
"os"
"os/exec"
"path"
"path/filepath"
"strings"

Expand Down Expand Up @@ -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
}

Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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.
Expand Down