mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 02:15:48 +02:00
fix: update demo database and app.ini; enhance: migration
This commit is contained in:
parent
f8e17dc7e4
commit
925e61abf4
8 changed files with 85 additions and 15 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -13,3 +13,5 @@ resources/development/nginx
|
||||||
app/.env
|
app/.env
|
||||||
app/.status_hash
|
app/.status_hash
|
||||||
casdoor.pub
|
casdoor.pub
|
||||||
|
.idea/deployment.xml
|
||||||
|
.idea/webServers.xml
|
||||||
|
|
|
@ -289,6 +289,9 @@ install_config() {
|
||||||
mkdir -p "$DataPath"
|
mkdir -p "$DataPath"
|
||||||
if [[ ! -f "$DataPath/app.ini" ]]; then
|
if [[ ! -f "$DataPath/app.ini" ]]; then
|
||||||
cat > "$DataPath/app.ini" << EOF
|
cat > "$DataPath/app.ini" << EOF
|
||||||
|
[app]
|
||||||
|
PageSize = 10
|
||||||
|
|
||||||
[server]
|
[server]
|
||||||
HOST = 0.0.0.0
|
HOST = 0.0.0.0
|
||||||
PORT = 9000
|
PORT = 9000
|
||||||
|
|
|
@ -1,19 +1,77 @@
|
||||||
[server]
|
[app]
|
||||||
HttpPort = 9000
|
PageSize = 10
|
||||||
RunMode = release
|
|
||||||
JwtSecret = 6EEB622E-5C73-4082-AF76-7BAC337772F2
|
JwtSecret = 6EEB622E-5C73-4082-AF76-7BAC337772F2
|
||||||
Email = test@jackyu.cn
|
|
||||||
HTTPChallengePort = 9180
|
[server]
|
||||||
StartCmd = bash
|
Host =
|
||||||
NodeSecret = 57D079F2-CA8B-412A-B5C0-FDA291C13391
|
Port = 9000
|
||||||
Demo = true
|
RunMode = release
|
||||||
|
|
||||||
|
[database]
|
||||||
|
Name = database
|
||||||
|
|
||||||
|
[auth]
|
||||||
|
IPWhiteList =
|
||||||
|
BanThresholdMinutes = 10
|
||||||
|
MaxAttempts = 10
|
||||||
|
|
||||||
|
[casdoor]
|
||||||
|
Endpoint =
|
||||||
|
ClientId =
|
||||||
|
ClientSecret =
|
||||||
|
CertificatePath =
|
||||||
|
Organization =
|
||||||
|
Application =
|
||||||
|
RedirectUri =
|
||||||
|
|
||||||
|
[cert]
|
||||||
|
Email = test@jackyu.cn
|
||||||
|
CADir = https://acme-staging-v02.api.letsencrypt.org/directory
|
||||||
|
RenewalInterval = 0
|
||||||
|
RecursiveNameservers =
|
||||||
|
HTTPChallengePort = 9180
|
||||||
|
|
||||||
|
[cluster]
|
||||||
|
Node =
|
||||||
|
|
||||||
|
[crypto]
|
||||||
|
Secret = 4a82fe17c5aab629007462b303c367d2863b7db28b95c8f869f2f815672d41d8
|
||||||
|
|
||||||
|
[http]
|
||||||
|
GithubProxy =
|
||||||
|
InsecureSkipVerify = false
|
||||||
|
|
||||||
|
[logrotate]
|
||||||
|
Enabled = false
|
||||||
|
CMD = logrotate /etc/logrotate.d/nginx
|
||||||
|
Interval = 0
|
||||||
|
|
||||||
[nginx]
|
[nginx]
|
||||||
AccessLogPath =
|
AccessLogPath =
|
||||||
ErrorLogPath =
|
ErrorLogPath =
|
||||||
|
LogDirWhiteList = /var/log/nginx
|
||||||
|
ConfigDir =
|
||||||
|
PIDPath =
|
||||||
|
TestConfigCmd =
|
||||||
|
ReloadCmd =
|
||||||
|
RestartCmd =
|
||||||
|
|
||||||
|
[node]
|
||||||
|
Name =
|
||||||
|
Secret = 57D079F2-CA8B-412A-B5C0-FDA291C13391
|
||||||
|
SkipInstallation = false
|
||||||
|
Demo = true
|
||||||
|
|
||||||
[openai]
|
[openai]
|
||||||
Model = gpt-3.5-turbo
|
|
||||||
BaseUrl =
|
BaseUrl =
|
||||||
Proxy =
|
|
||||||
Token =
|
Token =
|
||||||
|
Proxy =
|
||||||
|
Model = gpt-3.5-turbo
|
||||||
|
|
||||||
|
[terminal]
|
||||||
|
StartCmd = bash
|
||||||
|
|
||||||
|
[webauthn]
|
||||||
|
RPDisplayName =
|
||||||
|
RPID =
|
||||||
|
RPOrigins =
|
||||||
|
|
Binary file not shown.
|
@ -4,7 +4,9 @@ type Database struct {
|
||||||
Name string
|
Name string
|
||||||
}
|
}
|
||||||
|
|
||||||
var DatabaseSettings = &Database{}
|
var DatabaseSettings = &Database{
|
||||||
|
Name: "database",
|
||||||
|
}
|
||||||
|
|
||||||
func (d *Database) GetName() string {
|
func (d *Database) GetName() string {
|
||||||
return d.Name
|
return d.Name
|
||||||
|
|
|
@ -74,6 +74,10 @@ func (v1 *serverV1) migrateToV2() (v2 *settingsV2) {
|
||||||
v2.Http.InsecureSkipVerify = v1.InsecureSkipVerify
|
v2.Http.InsecureSkipVerify = v1.InsecureSkipVerify
|
||||||
v2.Node.Name = v1.Name
|
v2.Node.Name = v1.Name
|
||||||
|
|
||||||
|
if v1.Database == "" {
|
||||||
|
v2.DataBase.Name = "database"
|
||||||
|
}
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,7 @@ StartCmd = bash
|
||||||
Database = database
|
Database = database
|
||||||
CADir = /test
|
CADir = /test
|
||||||
GithubProxy = https://mirror.ghproxy.com/
|
GithubProxy = https://mirror.ghproxy.com/
|
||||||
Secret = newSecret
|
Secret = newSecret
|
||||||
Demo = false
|
Demo = false
|
||||||
PageSize = 20
|
PageSize = 20
|
||||||
HttpHost = 0.0.0.0
|
HttpHost = 0.0.0.0
|
||||||
|
|
|
@ -43,6 +43,7 @@ func init() {
|
||||||
t := time.Unix(cast.ToInt64(buildTime), 0)
|
t := time.Unix(cast.ToInt64(buildTime), 0)
|
||||||
LastModified = strings.ReplaceAll(t.Format(time.RFC1123), "UTC", "GMT")
|
LastModified = strings.ReplaceAll(t.Format(time.RFC1123), "UTC", "GMT")
|
||||||
|
|
||||||
|
sections.Set("database", DatabaseSettings)
|
||||||
sections.Set("auth", AuthSettings)
|
sections.Set("auth", AuthSettings)
|
||||||
sections.Set("casdoor", CasdoorSettings)
|
sections.Set("casdoor", CasdoorSettings)
|
||||||
sections.Set("cert", CertSettings)
|
sections.Set("cert", CertSettings)
|
||||||
|
@ -86,7 +87,7 @@ func Init() {
|
||||||
func Save() (err error) {
|
func Save() (err error) {
|
||||||
// fix unable to save empty slice
|
// fix unable to save empty slice
|
||||||
if len(CertSettings.RecursiveNameservers) == 0 {
|
if len(CertSettings.RecursiveNameservers) == 0 {
|
||||||
settings.Conf.Section("server").Key("RecursiveNameservers").SetValue("")
|
settings.Conf.Section("cert").Key("RecursiveNameservers").SetValue("")
|
||||||
}
|
}
|
||||||
|
|
||||||
err = settings.Save()
|
err = settings.Save()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue