mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-22 23:23:50 +02:00
add tidb support
This commit is contained in:
1 parent
10de16beb0
commit
aff773f1b9
9 files changed
+44
-12
No files matched your search
@@ -13,7 +13,7 @@ watch_dirs = [
|
||||
watch_exts = [".go"]
|
||||
build_delay = 1500
|
||||
cmds = [
|
||||
["go", "install", "-tags", "sqlite"],# redis memcache cert pam tidb
|
||||
["go", "build", "-tags", "sqlite"],
|
||||
["go", "install", "-tags", "sqlite tidb"],# redis memcache cert pam
|
||||
["go", "build", "-tags", "sqlite tidb"],
|
||||
["./gogs", "web"]
|
||||
]
|
||||
+1
-1
@@ -65,7 +65,7 @@ USER = root
|
||||
PASSWD =
|
||||
; For "postgres" only, either "disable", "require" or "verify-full"
|
||||
SSL_MODE = disable
|
||||
; For "sqlite3" only
|
||||
; For "sqlite3" and "tidb"
|
||||
PATH = data/gogs.db
|
||||
|
||||
[admin]
|
||||
|
||||
@@ -65,7 +65,10 @@ db_helper = Please use INNODB engine with utf8_general_ci charset for MySQL.
|
||||
ssl_mode = SSL Mode
|
||||
path = Path
|
||||
sqlite_helper = The file path of SQLite3 database.
|
||||
err_empty_sqlite_path = SQLite3 database path cannot be empty.
|
||||
err_empty_db_path = SQLite3 or TiDB database path cannot be empty.
|
||||
err_invalid_tidb_name = TiDB database name does not allow characters "." and "-".
|
||||
no_admin_and_disable_registration = You cannot disable registration without creating an admin account.
|
||||
err_empty_admin_password = Admin password cannot be empty.
|
||||
|
||||
general_title = Application General Settings
|
||||
app_name = Application Name
|
||||
@@ -868,7 +871,7 @@ config.db_user = User
|
||||
config.db_ssl_mode = SSL Mode
|
||||
config.db_ssl_mode_helper = (for "postgres" only)
|
||||
config.db_path = Path
|
||||
config.db_path_helper = (for "sqlite3" only)
|
||||
config.db_path_helper = (for "sqlite3" and "tidb")
|
||||
config.service_config = Service Configuration
|
||||
config.register_email_confirm = Require E-mail Confirmation
|
||||
config.disable_register = Disable Registration
|
||||
|
||||
+3
-1
@@ -55,7 +55,7 @@ func regulateTimeZone(t time.Time) time.Time {
|
||||
return t
|
||||
}
|
||||
hour := com.StrTo(zone[2:3]).MustInt()
|
||||
minutes := com.StrTo(zone[3:4]).MustInt()
|
||||
minutes := com.StrTo(zone[3:5]).MustInt()
|
||||
|
||||
if zone[0] == '-' {
|
||||
return t.Add(time.Duration(hour) * time.Hour).Add(time.Duration(minutes) * time.Minute)
|
||||
@@ -104,6 +104,8 @@ func LoadModelsConfig() {
|
||||
setting.UseMySQL = true
|
||||
case "postgres":
|
||||
setting.UsePostgreSQL = true
|
||||
case "tidb":
|
||||
setting.UseTiDB = true
|
||||
}
|
||||
DbCfg.Host = sec.Key("HOST").String()
|
||||
DbCfg.Name = sec.Key("NAME").String()
|
||||
|
||||
@@ -8,9 +8,11 @@ package models
|
||||
|
||||
import (
|
||||
_ "github.com/go-xorm/tidb"
|
||||
"github.com/ngaut/log"
|
||||
_ "github.com/pingcap/tidb"
|
||||
)
|
||||
|
||||
func init() {
|
||||
EnableTidb = true
|
||||
log.SetLevelByString("error")
|
||||
}
|
||||
@@ -4364,7 +4364,7 @@ func confLocaleLocale_deDeIni() (*asset, error) {
|
||||
return a, nil
|
||||
}
|
||||
|
||||
var _confLocaleLocale_enUsIni = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xc4\xbd\xeb\x72\xdc\xc8\x8e\x27\xfe\x9d\x4f\xc1\xee\x09\xff\xdd\x1d\x21\x97\xa3\xbb\xff\x7b\x89\x0e\xdb\xbd\xb2\xd4\xbe\xcc\x58\x96\xc6\x52\x9f\xb3\x67\x1d\x8e\x6a\x56\x91\xaa\xe2\x71\x15\x59\x4d\xb2\x2c\xeb\x4c\x4c\xc4\xbe\xc6\xbe\xde\x3e\xc9\x02\x3f\x00\x79\x23\x4b\xb2\xcf\x99\xd8\xfd\x22\xb1\x32\x91\x37\x24\x12\x09\x20\x91\xc8\x62\xb7\x9b\x97\x55\xbf\xcc\x9f\xe6\xc7\xf9\xae\xa8\x9b\x4d\xd5\xf7\x79\x5f\x6d\xae\x1f\xad\xdb\x7e\xa8\xca\xfc\x65\x3d\xd0\xef\xee\x53\xbd\xac\xb2\x6c\xdd\x6e\x2b\x02\x7d\x45\xff\xb2\xb2\xe8\xd7\x8b\xb6\xe8\x4a\x4a\x38\xb5\xef\xac\xfa\xbc\xdb\xb4\x1d\x03\xfd\x2a\x5f\xd9\xba\xda\xec\xb8\x0c\xfd\xcb\xfa\x7a\xd5\xcc\xeb\x86\x7e\x5e\xd2\x57\xfe\xba\xc9\xfa\x76\x59\x17\x9b\x79\x90\x81\x04\xcb\xff\x39\xff\xb1\x29\xf3\xcb\xa1\xda\xe5\x4f\xfa\x6d\xb1\xd9\x3c\x2b\x7a\x14\x19\xaa\xbc\x58\x2e\xdb\x7d\x33\x3c\x79\x2c\x19\x52\x79\xbb\x1f\xac\xf6\xf3\xfd\x20\x69\xfb\x9d\x25\xfd\xb6\xcb\xba\x6a\x55\xd3\xc0\x3a\x4a\x7a\xa7\x9f\xd9\x4d\xb5\xe8\xeb\x81\x3b\xfd\x67\xf9\xca\x3e\x55\x5d\x5f\xb7\xdc\x9f\x3f\xc9\x57\xb6\x2b\x56\x0c\x70\x41\xff\xb2\xa1\xda\xee\x36\x05\x0a\x5c\xe9\x67\xb6\x29\x9a\xd5\x5e\x60\xde\xe8\x67\xb6\xec\x2a\xca\x9a\x37\xd5\x0d\xa5\x9e\xe0\xc7\x6c\x36\xcb\xf6\x84\xcf\xf9\xae\x6b\xaf\xeb\x4d\x35\x2f\x9a\x72\xbe\x15\x8c\xfd\x46\xe9\xb9\xa6\xe7\x94\x9e\x73\x3a\x86\x50\x95\x84\x9c\x79\xd1\xeb\x38\x68\x5a\x08\x57\x45\x9f\xa1\xaa\xa6\xd8\x5a\x69\xfe\xcc\xaa\x6d\x51\x6f\x78\x02\x1e\xf1\x07\x75\xbc\xef\x6f\x5a\x4c\xd3\x85\x7e\x12\x12\xe6\xc3\xed\xae\x02\x0e\x1e\x5d\xd1\x57\xb6\x2c\x76\xc3\x72\x5d\x70\x3f\xe5\x2b\x23\xa0\x5d\x4b\xc8\x68\xbb\x5b\xc0\xd9\x8f\xac\xed\x56\x45\x53\xff\xad\x18\x04\x41\xe7\xc1\xcf\x6c\x5b\x77\x5d\xcb\xb8\x3d\xc3\x47\x46\x43\x9f\x73\x3d\x94\xf2\x96\xb0\x10\xd4\xc2\x39\xdb\x7a\xd5\x09\x1a\x39\xf3\x0c\xbf\xb8\x16\xce\xbb\x6e\xbb\x8f\x9a\xf1\x82\x3f\x93\xa2\xd4\x09\xcd\x8d\xdb\x2f\x1a\x42\xbc\xe6\x9e\xe1\x47\x04\xd0\x67\x45\xb9\x25\x54\xee\x8a\xa6\x62\x1c\x1d\xf3\x2f\xc2\x0b\xfd\xca\x94\x9e\xe6\x7d\x35\x0c\x75\xb3\x62\x64\x1f\x4b\x52\x7e\xa9\x49\x59\x90\xe7\xd2\x6e\xdb\xbd\x9b\x4e\x4a\xff\x0b\xfd\xcc\x2f\xe4\xa7\xe4\x05\x85\x90\xe9\x4a\xf2\x48\xfa\xf9\x75\x55\x95\x32\x96\x3e\x7f\x41\xdf\xd9\x6e\xbf\xd9\x10\xd6\xfe\xd8\x57\xfd\xc0\x85\x2e\xe8\x37\x8d\x5f\x7e\x67\x75\xdf\xd3\x07\x25\xbf\xc6\x47\x46\x53\xd7\x2c\x31\x98\x13\x7c\x64\xd9\xfb\xbe\x2a\xba\xe5\xfa\x43\x26\xff\xd1\x57\xfe\x60\xda\x3b\x34\xa9\x4c\x48\x4a\x44\xd2\x82\x35\x90\x2d\xdb\x92\x7f\x9c\xd0\x3f\xaa\xba\x6e\xfa\x81\x56\xdb\x87\x4c\x3f\x18\x4c\xbe\x64\x02\x86\x7a\x00\x16\x34\x11\x4b\xb7\xe7\x19\xcc\x5f\xd4\x5d\x3f\x3c\x1a\x6a\x22\xd6\x77\xfb\x26\xe3\xf1\xd1\x4a\x9b\x97\x0b\x63\x40\x2f\x5b\x42\x11\x92\x3b\x1a\xdf\xd9\xed\xe5\xbf\xbe\x39\xca\x2f\x88\x0b\xad\xba\x8a\xbe\x73\xaa\x83\xfe\x51\x99\x9f\x66\x19\x95\xb2\x96\x4e\x8b\xa1\x58\x14\x7d\xe5\xd1\xca\x99\x42\xdd\x2e\x0f\x34\xce\x1c\x0d\xdc\xab\x1f\xa2\xf1\x4e\xad\x10\xaa\x43\xd7\x95\xab\xe3\x2d\x2f\x2e\x4a\x67\x86\x86\xc2\x17\x9b\x8a\xd3\xa9\xaa\xfc\xf5\xdb\xb7\xe7\xa7\xcf\xf3\xaa\x59\xd5\x4d\x95\xdf\xd4\xc3\x3a\xdf\x0f\xd7\xff\x75\xbe\xaa\x9a\xaa\x23\xfe\xb6\xac\x73\x5a\x53\x1d\x51\x42\x4e\x84\x2d\x83\x9b\x65\x7d\xbf\xa1\xb5\x0f\xf4\x5e\x5e\xbe\xc9\xcf\x18\xc5\xbb\x62\x58\xa3\x23\xc3\x3a\xeb\xff\xd8\x30\x8a\x5c\x83\x57\xeb\x2a\x07\x95\x01\xa8\xbd\x36\x7c\xe4\xa5\xf6\x71\x96\x55\x5d\x37\x27\x96\x34\xdc\xce\xb5\xb0\xd6\x97\x42\x4a\x15\x44\x3a\x4d\x3b\xe4\x8b\x2a\x47\x99\x59\x96\x59\x87\x0d\xbb\xc7\xbb\xdd\xa6\x5e\xca\x5a\x7f\x29\x79\x1e\xd1\xbc\x7b\x28\x96\x42\x38\x20\xca\xf2\x02\x74\x11\x6b\xe6\xf5\x90\x47\x0c\x04\xe5\xd7\x15\x31\xc0\xf5\x7e\x25\x6c\x6f\xd3\xee\xcb\x6f\x40\xa9\xd6\x7b\x4f\xa8\xf9\xbb\x96\x3a\x0c\xec\x38\x00\xdf\xc4\x31\x51\x1c\x6f\x58\x5d\xb5\x6d\x89\xaf\x38\x62\xaf\x89\xa0\x6e\x6a\xca\xa4\x91\xf6\xc5\x27\x5a\x6f\x43\x9b\x0f\xeb\xba\xcf\x4b\x22\xb6\x25\x57\x4c\x4b\x63\x4f\x5b\x85\x90\x05\x11\xa8\x90\x86\xa5\xc5\x73\x00\xa8\xed\x9e\xa8\x69\x4d\x95\xf1\x46\xc4\xbb\x26\x55\x39\xd5\x4f\x0c\x89\xea\x01\x7d\x13\xe5\xb6\xc4\x95\x99\x6f\x9e\xe2\x43\x7f\x87\xf5\x53\xaf\x8a\xeb\x6b\xea\x55\x4f\x54\xf1\x2a\x5f\x6e\x5a\x22\xa9\xdf\xde\xbd\xe9\x99\x60\xd6\xf3\x5d\xdb\x61\x8b\xa3\xac\x0b\xfa\x74\x69\x01\xa2\x19\xa2\xd9\x6f\x17\xf4\xeb\x66\x5d\x13\x07\x00\xda\xb9\x04\xef\xe4\x94\x4a\x4d\xec\x7b\x9a\xc2\xa3\x9c\x48\x98\x46\x40\x28\x03\x01\xf0\x18\xca\xba\x2f\x16\x34\xf7\x0c\x7e\x4d\x5b\xd6\xbe\x23\xb2\x5a\x0f\xc3\xce\x5a\x7e\x75\x75\x75\x21\x4d\xbb\xd4\xbb\xda\x2e\x02\xca\xc0\x1c\x6c\x78\xd3\x6d\xf2\xb6\x99\x81\x48\xf6\xdd\x26\xa1\x1f\x1a\xab\xe5\x1c\xc0\x0b\x77\xe1\x31\xff\xb9\xf4\xe8\x01\x9e\x7b\x92\x4c\x6e\x40\x4d\x84\xe3\x0a\x1b\x20\x11\x75\xbb\xe3\x7a\x03\xaa\x3e\xd7\x04\x4f\xca\xd8\x34\x5d\xbe\x6c\x9d\x94\x0b\xb9\x27\x60\xff\x5b\x1a\xb0\xb2\x91\xcb\x33\x42\x03\x78\x09\x52\xaf\xbb\x76\x4b\xa9\x2f\xe8\x9f\x4f\xf0\xdd\x3f\xe3\xfa\x00\x53\x94\x25\xf1\xb7\xfe\x28\x7f\xf7\xe2\x24\xff\x4f\x3f\xfd\xf8\xe3\x2c\x7f\x3d\xf0\x4a\x64\xe2\xfc\x2b\x13\x15\x7d\xca\x1e\xee\x40\x89\x65\x0Line truncated
|
||||
var _confLocaleLocale_enUsIni = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xc4\xbd\xeb\x72\xdc\x48\xae\x27\xfe\x9d\x4f\xc1\xf6\x09\xff\xdd\x8e\x90\xcb\xd1\xdd\xff\xbd\x44\x87\xed\x5e\x59\x6a\x5f\xe6\x58\x96\xc6\x92\x67\x76\xd6\xe1\x60\xb3\x8a\x54\x15\xc7\x55\x64\x35\xc9\x72\x59\x73\xe2\x44\xec\x6b\xec\xeb\xed\x93\x2c\xf0\x03\x90\x17\x92\x25\xd9\x3d\x27\x76\xbf\x48\xac\x4c\xe4\x0d\x89\x44\x02\x48\x24\x32\xdf\x6e\xb3\xa2\xec\x16\xe9\xd3\xf4\x38\xdd\xe6\x55\xbd\x2e\xbb\x2e\xed\xca\xf5\xf5\xa3\x55\xd3\xf5\x65\x91\xbe\xac\x7a\xfa\xdd\x7e\xae\x16\x65\x92\xac\x9a\x4d\x49\xa0\xaf\xe8\x5f\x52\xe4\xdd\x6a\xde\xe4\x6d\x41\x09\xa7\xf6\x9d\x94\x5f\xb6\xeb\xa6\x65\xa0\x5f\xe5\x2b\x59\x95\xeb\x2d\x97\xa1\x7f\x49\x57\x2d\xeb\xac\xaa\xe9\xe7\x25\x7d\xa5\xaf\xeb\xa4\x6b\x16\x55\xbe\xce\x82\x0c\x24\x58\xfe\xcf\xe9\x8f\x75\x91\x5e\xf6\xe5\x36\x7d\xd2\x6d\xf2\xf5\xfa\x59\xde\xa1\x48\x5f\xa6\xf9\x62\xd1\xec\xea\xfe\xc9\x63\xc9\x90\xca\x9b\x5d\x6f\xb5\x9f\xef\x7a\x49\xdb\x6d\x2d\xe9\xfd\x36\x69\xcb\x65\x45\x03\x6b\x29\xe9\x9d\x7e\x26\xfb\x72\xde\x55\x3d\x77\xfa\xaf\xf2\x95\x7c\x2e\xdb\xae\x6a\xb8\x3f\x7f\x91\xaf\x64\x9b\x2f\x19\xe0\x82\xfe\x25\x7d\xb9\xd9\xae\x73\x14\xb8\xd2\xcf\x64\x9d\xd7\xcb\x9d\xc0\xbc\xd1\xcf\x64\xd1\x96\x94\x95\xd5\xe5\x9e\x52\x4f\xf0\x63\x36\x9b\x25\x3b\xc2\x67\xb6\x6d\x9b\xeb\x6a\x5d\x66\x79\x5d\x64\x1b\xc1\xd8\x7b\x4a\x4f\x35\x3d\xa5\xf4\x94\xd3\x31\x84\xb2\x20\xe4\x64\x79\xa7\xe3\xa0\x69\x21\x5c\xe5\x5d\x82\xaa\xea\x7c\x63\xa5\xf9\x33\x29\x37\x79\xb5\xe6\x09\x78\xc4\x1f\xd4\xf1\xae\xdb\x37\x98\xa6\x0b\xfd\x24\x24\x64\xfd\xcd\xb6\x04\x0e\x1e\x5d\xd1\x57\xb2\xc8\xb7\xfd\x62\x95\x73\x3f\xe5\x2b\x21\xa0\x6d\x43\xc8\x68\xda\x1b\xc0\xd9\x8f\xa4\x69\x97\x79\x5d\xfd\x23\xef\x05\x41\xe7\xc1\xcf\x64\x53\xb5\x6d\xc3\xb8\x3d\xc3\x47\x42\x43\xcf\xb8\x1e\x4a\x79\x4b\x58\x08\x6a\xe1\x9c\x4d\xb5\x6c\x05\x8d\x9c\x79\x86\x5f\x5c\x0b\xe7\x5d\x37\xed\x27\xcd\x78\xc1\x9f\x83\xa2\xd4\x09\xcd\x8d\xdb\xcf\x6b\x42\xbc\xe6\x9e\xe1\x47\x04\xd0\x25\x79\xb1\x21\x54\x6e\xf3\xba\x64\x1c\x1d\xf3\x2f\xc2\x0b\xfd\x4a\x94\x9e\xb2\xae\xec\xfb\xaa\x5e\x32\xb2\x8f\x25\x29\xbd\xd4\xa4\x24\xc8\x73\x69\x37\xcd\xce\x4d\x27\xa5\xff\x8d\x7e\xa6\x17\xf2\x53\xf2\x82\x42\xc8\x74\x25\x79\x24\x5d\x76\x5d\x96\x85\x8c\xa5\x4b\x5f\xd0\x77\xb2\xdd\xad\xd7\x84\xb5\xdf\x77\x65\xd7\x73\xa1\x0b\xfa\x4d\xe3\x97\xdf\x49\xd5\x75\xf4\x41\xc9\xaf\xf1\x91\xd0\xd4\xd5\x0b\x0c\xe6\x04\x1f\x49\xf2\xa1\x2b\xf3\x76\xb1\xfa\x98\xc8\x7f\xf4\x95\x3f\x98\xf6\x0e\x4d\x2a\x13\x92\x12\x91\xb4\x60\x0d\x24\x8b\xa6\xe0\x1f\x27\xf4\x8f\xaa\xae\xea\xae\xa7\xd5\xf6\x31\xd1\x0f\x06\x93\x2f\x99\x80\xbe\xea\x81\x05\x4d\xc4\xd2\xed\x78\x06\xd3\x17\x55\xdb\xf5\x8f\xfa\x8a\x88\xf5\xdd\xae\x4e\x78\x7c\xb4\xd2\xb2\x62\x6e\x0c\xe8\x65\x43\x28\x42\x72\x4b\xe3\x3b\xbb\xb9\xfc\xf3\x9b\xa3\xf4\x82\xb8\xd0\xb2\x2d\xe9\x3b\xa5\x3a\xe8\x1f\x95\xf9\x69\x96\x50\x29\x6b\xe9\x34\xef\xf3\x79\xde\x95\x1e\xad\x9c\x29\xd4\xed\xf2\x40\xe3\xcc\xd1\xc0\xbd\xba\x3e\x1a\xef\xd4\x0a\xa1\x3a\x74\x5d\xb9\x3a\xde\xf2\xe2\xa2\x74\x66\x68\x28\x7c\xb1\x2e\x39\x9d\xaa\x4a\x5f\xbf\x7d\x7b\x7e\xfa\x3c\x2d\xeb\x65\x55\x97\xe9\xbe\xea\x57\xe9\xae\xbf\xfe\xaf\xd9\xb2\xac\xcb\x96\xf8\xdb\xa2\x4a\x69\x4d\xb5\x44\x09\x29\x11\xb6\x0c\x6e\x96\x74\xdd\x9a\xd6\x3e\xd0\x7b\x79\xf9\x26\x3d\x63\x14\x6f\xf3\x7e\x85\x8e\xf4\xab\xa4\xfb\x7d\xcd\x28\x72\x0d\x5e\xad\xca\x14\x54\x06\xa0\xe6\xda\xf0\x91\x16\xda\xc7\x59\x52\xb6\x6d\x46\x2c\xa9\xbf\x61\xc4\x6a\x5d\x06\x45\x0d\x5f\x55\xd4\x4b\x83\x96\x6a\x88\x7c\xea\xa6\x4f\xe7\x65\x8a\x72\x52\x45\x55\x7f\xce\xd7\x55\x41\x48\xf6\x88\x88\xcb\x22\xb1\x68\x68\xa6\xb8\x34\x4d\x75\xb3\xc7\x10\xf3\x05\x71\xd4\x2e\xbd\x37\xbb\x07\x16\x76\xef\xd1\xbd\x59\x52\x37\x99\x2c\x3b\x66\x76\x45\xd5\xe5\x73\x62\x7c\xc2\x88\x5b\x63\x23\xb4\x32\xac\x2b\x0a\x91\x46\x10\x8c\x53\x66\xee\xe0\xa9\x34\xcd\x54\x7b\x8a\x4a\x6d\x1f\x08\xc7\x6e\x8b\xdc\xcd\xab\xac\x73\x97\x30\x1a\x73\x62\x13\x65\x54\x75\xbc\xdd\xae\xab\x85\x34\xfd\x52\xf2\x3c\x81\xf1\xae\xa9\x48\x09\xe1\x40\x20\x96\x17\x90\x09\xf5\x9a\xf9\x40\x1a\x31\x4e\x94\x5f\x95\xc4\xf8\x57\xbb\xa5\xb0\xfb\x75\xb3\x2b\xbe\xc3\x0a\xb5\x99\xf3\x0b\x34\x7d\xd7\x50\x87\x41\x15\x0e\xc0\x37\x71\x4c\x2b\x8d\x37\xea\xb6\xdc\x34\x3d\x23\x4e\x8b\x55\x34\x3d\xfb\x8a\x32\x69\xa4\x5d\xfe\x99\xf8\x4c\xdf\xa4\xfd\xaa\xea\x08\xc7\x6d\xb9\xe0\x8a\x89\x25\xec\x68\x8b\x94\xe5\x40\x0b\x53\x96\x84\xa5\xc5\xb4\x07\xa8\xcd\x8e\x56\xd1\x8a\x2a\x63\xc4\xb3\xb4\x40\x55\x4e\xf5\x13\x43\xa2\x7a\xb0\xae\x69\xc5\x36\xb4\x1b\xf1\x44\x9f\xe2\x43\x7f\x87\xf5\x53\xaf\xf2\xeb\x6b\xea\x55\x47\xab\xe1\x55\xba\x58\x37\xb4\x94\xde\xbf\x7b\xd3\xf1\x42\x59\x65\xdb\xa6\xc5\xd6\x4e\x59\x17\xf4\xe9\xd2\x02\x44\x33\x44\xbd\xdb\xcc\xe9\xd7\x7e\x55\x11\xe7\x03\xda\xb9\x04\x4b\x30\x94\x4a\x4d\xec\x3a\x9a\xc2\xa3\x94\x96\x2e\x8d\x80\x50\x06\x02\xe0\x31\x18\xd5\x31\xf8\x35\xd1\xd8\xae\xa5\xe5\xb4\xea\xfb\xad\xb5\xfc\xea\xea\xea\x42\x9a\x76\xa9\xb7\xb5\x9d\x07\x94\x81\x39\x58\xb3\xb0\x51\xa7\x4d\x3d\x03\x91\xec\xda\xf5\x80\x7e\x68\xac\x96\x73\x00\x2f\xdc\x85\xc7\xfc\xe7\xd2\xa3\x07\x78\xee\x48\x22\xdb\x83\x9a\x0Line truncated
|
||||
|
||||
func confLocaleLocale_enUsIniBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
@@ -4379,7 +4379,7 @@ func confLocaleLocale_enUsIni() (*asset, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "conf/locale/locale_en-US.ini", size: 42901, mode: os.FileMode(420), modTime: time.Unix(1442018244, 0)}
|
||||
info := bindataFileInfo{name: "conf/locale/locale_en-US.ini", size: 43155, mode: os.FileMode(420), modTime: time.Unix(1442085252, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
@@ -75,6 +75,7 @@ var (
|
||||
UseSQLite3 bool
|
||||
UseMySQL bool
|
||||
UsePostgreSQL bool
|
||||
UseTiDB bool
|
||||
|
||||
// Webhook settings.
|
||||
Webhook struct {
|
||||
|
||||
+27
-3
@@ -110,7 +110,11 @@ func Install(ctx *middleware.Context) {
|
||||
ctx.Data["CurDbOption"] = "PostgreSQL"
|
||||
case "sqlite3":
|
||||
if models.EnableSQLite3 {
|
||||
ctx.Data["CurDbOption"] = "SQLite3" // Default when enabled.
|
||||
ctx.Data["CurDbOption"] = "SQLite3"
|
||||
}
|
||||
case "tidb":
|
||||
if models.EnableTidb {
|
||||
ctx.Data["CurDbOption"] = "TiDB"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -183,9 +187,15 @@ func InstallPost(ctx *middleware.Context, form auth.InstallForm) {
|
||||
models.DbCfg.SSLMode = form.SSLMode
|
||||
models.DbCfg.Path = form.DbPath
|
||||
|
||||
if models.DbCfg.Type == "sqlite3" && len(models.DbCfg.Path) == 0 {
|
||||
if (models.DbCfg.Type == "sqlite3" || models.DbCfg.Type == "tidb") &&
|
||||
len(models.DbCfg.Path) == 0 {
|
||||
ctx.Data["Err_DbPath"] = true
|
||||
ctx.RenderWithErr(ctx.Tr("install.err_empty_sqlite_path"), INSTALL, &form)
|
||||
ctx.RenderWithErr(ctx.Tr("install.err_empty_db_path"), INSTALL, &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"), INSTALL, &form)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -217,7 +227,21 @@ func InstallPost(ctx *middleware.Context, form auth.InstallForm) {
|
||||
return
|
||||
}
|
||||
|
||||
// Check logic loophole between disable self-registration and no admin account.
|
||||
if form.DisableRegistration && len(form.AdminName) == 0 {
|
||||
ctx.Data["Err_Services"] = true
|
||||
ctx.Data["Err_Admin"] = true
|
||||
ctx.RenderWithErr(ctx.Tr("install.no_admin_and_disable_registration"), INSTALL, form)
|
||||
return
|
||||
}
|
||||
|
||||
// Check admin password.
|
||||
if len(form.AdminName) > 0 && len(form.AdminPasswd) == 0 {
|
||||
ctx.Data["Err_Admin"] = true
|
||||
ctx.Data["Err_AdminPasswd"] = true
|
||||
ctx.RenderWithErr(ctx.Tr("install.err_empty_admin_password"), INSTALL, form)
|
||||
return
|
||||
}
|
||||
if form.AdminPasswd != form.AdminConfirmPasswd {
|
||||
ctx.Data["Err_Admin"] = true
|
||||
ctx.Data["Err_AdminPasswd"] = true
|
||||
|
||||
@@ -152,7 +152,7 @@
|
||||
|
||||
<!-- Server and other services -->
|
||||
<div class="ui accordion optional field">
|
||||
<div class="title">
|
||||
<div class="title {{if .Err_Services}}text red{{end}}">
|
||||
<i class="icon dropdown"></i>
|
||||
{{.i18n.Tr "install.server_service_title"}}
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user