Compare commits
No commits in common. "2aee702fc6ff9f3e791268fd87f4e4133594a359" and "2937b93dff429de9f5858648458ad39501fa4e99" have entirely different histories.
2aee702fc6
...
2937b93dff
|
@ -28,13 +28,7 @@ func (config *Database) setupMigrator(testdata bool) (*gormigrate.Gormigrate, er
|
||||||
return nil, ErrNothingToMigrate
|
return nil, ErrNothingToMigrate
|
||||||
}
|
}
|
||||||
|
|
||||||
return gormigrate.New(config.DB, &gormigrate.Options{
|
return gormigrate.New(config.DB, gormigrate.DefaultOptions, migrations), nil
|
||||||
TableName: "migrations",
|
|
||||||
IDColumnName: "id",
|
|
||||||
IDColumnSize: 255,
|
|
||||||
UseTransaction: true,
|
|
||||||
ValidateUnknownMigrations: false,
|
|
||||||
}, migrations), nil
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
12
web/main.go
12
web/main.go
|
@ -27,12 +27,12 @@ import (
|
||||||
// A Service stores configuration of a server.
|
// A Service stores configuration of a server.
|
||||||
type Service struct {
|
type Service struct {
|
||||||
// config
|
// config
|
||||||
Listen string `toml:"listen"`
|
Listen string `toml:"listen"`
|
||||||
AccessLog bool `toml:"access_log"`
|
AccessLog bool `toml:"access_log"`
|
||||||
WebrootIndexDisable bool `toml:"webroot_index_disable"`
|
WebrootIndexDisable bool `toml:"webroot_index_disable"`
|
||||||
Webroot string `toml:"webroot"`
|
Webroot string `toml:"webroot"`
|
||||||
WebrootFS http.FileSystem `toml:"-"`
|
WebrootFS http.FileSystem `toml:"-"`
|
||||||
ACME struct {
|
ACME struct {
|
||||||
Enable bool `toml:"enable"`
|
Enable bool `toml:"enable"`
|
||||||
Domains []string `toml:"domains"`
|
Domains []string `toml:"domains"`
|
||||||
Cache string `toml:"cache"`
|
Cache string `toml:"cache"`
|
||||||
|
|
|
@ -22,7 +22,7 @@ func (ws *Service) Bind(r *gin.Engine) {
|
||||||
|
|
||||||
ws.log.Info("bind modules", zap.Int("count", len(ws.modules)))
|
ws.log.Info("bind modules", zap.Int("count", len(ws.modules)))
|
||||||
if ws.Webroot != "" {
|
if ws.Webroot != "" {
|
||||||
ws.WebrootFS = static.LocalFile(ws.Webroot, false)
|
ws.WebrootFS = static.LocalFile(ws.Webroot, false)
|
||||||
}
|
}
|
||||||
r.Use(func(c *gin.Context) {
|
r.Use(func(c *gin.Context) {
|
||||||
if !ws.WebrootIndexDisable {
|
if !ws.WebrootIndexDisable {
|
||||||
|
|
Loading…
Reference in New Issue