Browse Source

models: remove TiDB embedded driver support

Users should all start tidb-server process and connect to it as if
it is a MySQL server with MySQL drivers.
pull/3855/merge
Unknwon 8 years ago
parent
commit
6622b7b49a
No known key found for this signature in database
GPG Key ID: FB9F411CDD69BEC1
  1. 13
      conf/app.ini
  2. 2
      gogs.go
  3. 9
      models/models.go
  4. 18
      models/models_tidb.go
  5. 4
      modules/bindata/bindata.go
  6. 10
      routers/install.go
  7. 2
      templates/.VERSION

13
conf/app.ini

@ -59,11 +59,11 @@ EXPLORE_PAGING_NUM = 20
ISSUE_PAGING_NUM = 10 ISSUE_PAGING_NUM = 10
; Number of maximum commits showed in one activity feed ; Number of maximum commits showed in one activity feed
FEED_MAX_COMMIT_NUM = 5 FEED_MAX_COMMIT_NUM = 5
; Value of `theme-color` meta tag, used by Android >= 5.0 ; Value of "theme-color" meta tag, used by Android >= 5.0
; An invalid color like "none" or "disable" will have the default style ; An invalid color like "none" or "disable" will have the default style
; More info: https://developers.google.com/web/updates/2014/11/Support-for-theme-color-in-Chrome-39-for-Android ; More info: https://developers.google.com/web/updates/2014/11/Support-for-theme-color-in-Chrome-39-for-Android
THEME_COLOR_META_TAG = `#ff5343` THEME_COLOR_META_TAG = `#ff5343`
; Max size of files to be displayed (defaults is 8MiB) ; Max size in bytes of files to be displayed (default is 8MB)
MAX_DISPLAY_FILE_SIZE = 8388608 MAX_DISPLAY_FILE_SIZE = 8388608
[ui.admin] [ui.admin]
@ -106,12 +106,12 @@ LOCAL_ROOT_URL = %(PROTOCOL)s://%(HTTP_ADDR)s:%(HTTP_PORT)s/
DISABLE_SSH = false DISABLE_SSH = false
; Whether use builtin SSH server or not. ; Whether use builtin SSH server or not.
START_SSH_SERVER = false START_SSH_SERVER = false
; Domain name to be exposed in clone URL ; Domain name to be exposed in SSH clone URL
SSH_DOMAIN = %(DOMAIN)s SSH_DOMAIN = %(DOMAIN)s
; Port number to be exposed in SSH clone URL
SSH_PORT = 22
; Network interface builtin SSH server listens on ; Network interface builtin SSH server listens on
SSH_LISTEN_HOST = 0.0.0.0 SSH_LISTEN_HOST = 0.0.0.0
; Port number to be exposed in clone URL
SSH_PORT = 22
; Port number builtin SSH server listens on ; Port number builtin SSH server listens on
SSH_LISTEN_PORT = %(SSH_PORT)s SSH_LISTEN_PORT = %(SSH_PORT)s
; Root path of SSH directory, default is '~/.ssh', but you have to use '/home/git/.ssh'. ; Root path of SSH directory, default is '~/.ssh', but you have to use '/home/git/.ssh'.
@ -157,7 +157,7 @@ RSA = 2048
DSA = 1024 DSA = 1024
[database] [database]
; Either "mysql", "postgres" or "sqlite3", it's your choice ; Either "mysql", "postgres" or "sqlite3", you can connect to TiDB with MySQL protocol
DB_TYPE = mysql DB_TYPE = mysql
HOST = 127.0.0.1:3306 HOST = 127.0.0.1:3306
NAME = gogs NAME = gogs
@ -268,6 +268,7 @@ GC_INTERVAL_TIME = 86400
SESSION_LIFE_TIME = 86400 SESSION_LIFE_TIME = 86400
[picture] [picture]
; Path to store user uploaded avatars
AVATAR_UPLOAD_PATH = data/avatars AVATAR_UPLOAD_PATH = data/avatars
; Chinese users can choose "duoshuo" ; Chinese users can choose "duoshuo"
; or a custom avatar source, like: http://cn.gravatar.com/avatar/ ; or a custom avatar source, like: http://cn.gravatar.com/avatar/

2
gogs.go

@ -16,7 +16,7 @@ import (
"github.com/gogits/gogs/modules/setting" "github.com/gogits/gogs/modules/setting"
) )
const APP_VER = "0.9.135.0208" const APP_VER = "0.9.135.0209"
func init() { func init() {
setting.AppVer = APP_VER setting.AppVer = APP_VER

9
models/models.go

@ -55,7 +55,6 @@ var (
} }
EnableSQLite3 bool EnableSQLite3 bool
EnableTiDB bool
) )
func init() { func init() {
@ -146,14 +145,6 @@ func getEngine() (*xorm.Engine, error) {
return nil, fmt.Errorf("Fail to create directories: %v", err) return nil, fmt.Errorf("Fail to create directories: %v", err)
} }
connStr = "file:" + DbCfg.Path + "?cache=shared&mode=rwc" connStr = "file:" + DbCfg.Path + "?cache=shared&mode=rwc"
case "tidb":
if !EnableTiDB {
return nil, errors.New("This binary version does not build support for TiDB.")
}
if err := os.MkdirAll(path.Dir(DbCfg.Path), os.ModePerm); err != nil {
return nil, fmt.Errorf("Fail to create directories: %v", err)
}
connStr = "goleveldb://" + DbCfg.Path
default: default:
return nil, fmt.Errorf("Unknown database type: %s", DbCfg.Type) return nil, fmt.Errorf("Unknown database type: %s", DbCfg.Type)
} }

18
models/models_tidb.go

@ -1,18 +0,0 @@
// +build tidb go1.4.2
// Copyright 2015 The Gogs Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package models
import (
_ "github.com/go-xorm/tidb"
"github.com/ngaut/log"
_ "github.com/pingcap/tidb"
)
func init() {
EnableTiDB = true
log.SetLevelByString("error")
}

4
modules/bindata/bindata.go

File diff suppressed because one or more lines are too long

10
routers/install.go

@ -81,9 +81,6 @@ func GlobalInit() {
if models.EnableSQLite3 { if models.EnableSQLite3 {
log.Info("SQLite3 Supported") log.Info("SQLite3 Supported")
} }
if models.EnableTiDB {
log.Info("TiDB Supported")
}
if setting.SupportMiniWinService { if setting.SupportMiniWinService {
log.Info("Builtin Windows Service Supported") log.Info("Builtin Windows Service Supported")
} }
@ -108,9 +105,6 @@ func InstallInit(ctx *context.Context) {
if models.EnableSQLite3 { if models.EnableSQLite3 {
dbOpts = append(dbOpts, "SQLite3") dbOpts = append(dbOpts, "SQLite3")
} }
if models.EnableTiDB {
dbOpts = append(dbOpts, "TiDB")
}
ctx.Data["DbOptions"] = dbOpts ctx.Data["DbOptions"] = dbOpts
} }
@ -131,10 +125,6 @@ func Install(ctx *context.Context) {
if models.EnableSQLite3 { if models.EnableSQLite3 {
ctx.Data["CurDbOption"] = "SQLite3" ctx.Data["CurDbOption"] = "SQLite3"
} }
case "tidb":
if models.EnableTiDB {
ctx.Data["CurDbOption"] = "TiDB"
}
} }
// Application general settings // Application general settings

2
templates/.VERSION

@ -1 +1 @@
0.9.135.0208 0.9.135.0209
Loading…
Cancel
Save