Skip to content

Commit f1ad4bb

Browse files
Remove traces of embedded TiDB (#4906)
Fix #3357
1 parent 8ee9922 commit f1ad4bb

File tree

2 files changed

+5
-19
lines changed

2 files changed

+5
-19
lines changed

options/locale/locale_en-US.ini

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ loading = Loading…
8080
install = Installation
8181
title = Initial Configuration
8282
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.
83-
requite_db_desc = Gitea requires MySQL, PostgreSQL, MSSQL, SQLite3 or TiDB.
83+
requite_db_desc = Gitea requires MySQL, PostgreSQL, MSSQL, or SQLite3.
8484
db_title = Database Settings
8585
db_type = Database Type
8686
host = Host
@@ -90,9 +90,8 @@ db_name = Database Name
9090
db_helper = Note to MySQL users: please use the InnoDB storage engine and the 'utf8_general_ci' character set.
9191
ssl_mode = SSL
9292
path = Path
93-
sqlite_helper = File path for the SQLite3 or TiDB database.<br>Enter an absolute path if you run Gitea as a service.
94-
err_empty_db_path = The SQLite3 or TiDB database path cannot be empty.
95-
err_invalid_tidb_name = The TiDB database name cannot contain the '.' and '-' characters.
93+
sqlite_helper = File path for the SQLite3 database.<br>Enter an absolute path if you run Gitea as a service.
94+
err_empty_db_path = The SQLite3 database path cannot be empty.
9695
no_admin_and_disable_registration = You cannot disable user self-registration without creating an administrator account.
9796
err_empty_admin_password = The administrator password cannot be empty.
9897

routers/install.go

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"errors"
99
"os"
1010
"os/exec"
11-
"path"
1211
"path/filepath"
1312
"strings"
1413

@@ -45,9 +44,6 @@ func InstallInit(ctx *context.Context) {
4544
if models.EnableSQLite3 {
4645
dbOpts = append(dbOpts, "SQLite3")
4746
}
48-
if models.EnableTiDB {
49-
dbOpts = append(dbOpts, "TiDB")
50-
}
5147
ctx.Data["DbOptions"] = dbOpts
5248
}
5349

@@ -72,10 +68,6 @@ func Install(ctx *context.Context) {
7268
if models.EnableSQLite3 {
7369
ctx.Data["CurDbOption"] = "SQLite3"
7470
}
75-
case "tidb":
76-
if models.EnableTiDB {
77-
ctx.Data["CurDbOption"] = "TiDB"
78-
}
7971
}
8072

8173
// Application general settings
@@ -151,7 +143,7 @@ func InstallPost(ctx *context.Context, form auth.InstallForm) {
151143

152144
// Pass basic check, now test configuration.
153145
// Test database setting.
154-
dbTypes := map[string]string{"MySQL": "mysql", "PostgreSQL": "postgres", "MSSQL": "mssql", "SQLite3": "sqlite3", "TiDB": "tidb"}
146+
dbTypes := map[string]string{"MySQL": "mysql", "PostgreSQL": "postgres", "MSSQL": "mssql", "SQLite3": "sqlite3"}
155147
models.DbCfg.Type = dbTypes[form.DbType]
156148
models.DbCfg.Host = form.DbHost
157149
models.DbCfg.User = form.DbUser
@@ -160,16 +152,11 @@ func InstallPost(ctx *context.Context, form auth.InstallForm) {
160152
models.DbCfg.SSLMode = form.SSLMode
161153
models.DbCfg.Path = form.DbPath
162154

163-
if (models.DbCfg.Type == "sqlite3" || models.DbCfg.Type == "tidb") &&
155+
if (models.DbCfg.Type == "sqlite3") &&
164156
len(models.DbCfg.Path) == 0 {
165157
ctx.Data["Err_DbPath"] = true
166158
ctx.RenderWithErr(ctx.Tr("install.err_empty_db_path"), tplInstall, &form)
167159
return
168-
} else if models.DbCfg.Type == "tidb" &&
169-
strings.ContainsAny(path.Base(models.DbCfg.Path), ".-") {
170-
ctx.Data["Err_DbPath"] = true
171-
ctx.RenderWithErr(ctx.Tr("install.err_invalid_tidb_name"), tplInstall, &form)
172-
return
173160
}
174161

175162
// Set test engine.

0 commit comments

Comments
 (0)