-
+
-
-
+
+
-
+
diff --git a/frontend/src/views/preference/typedef.ts b/frontend/src/views/preference/typedef.ts
index 4c58d43d..666c8b27 100644
--- a/frontend/src/views/preference/typedef.ts
+++ b/frontend/src/views/preference/typedef.ts
@@ -10,9 +10,13 @@ export interface IData {
email: string,
ca_dir: string
},
- nginx_log: {
+ nginx: {
access_log_path: string
error_log_path: string
+ config_dir: string
+ pid_path: string
+ reload_cmd: string
+ restart_cmd: string
},
openai: {
model: string
diff --git a/frontend/version.json b/frontend/version.json
index d0da5934..eef954d1 100644
--- a/frontend/version.json
+++ b/frontend/version.json
@@ -1 +1 @@
-{"version":"2.0.0-beta.3","build_id":11,"total_build":215}
\ No newline at end of file
+{"version":"2.0.0-beta.3","build_id":12,"total_build":216}
\ No newline at end of file
diff --git a/server/api/settings.go b/server/api/settings.go
index e41ffbfc..d0ea60e6 100644
--- a/server/api/settings.go
+++ b/server/api/settings.go
@@ -11,7 +11,6 @@ func GetSettings(c *gin.Context) {
"server": settings.ServerSettings,
"nginx": settings.NginxSettings,
"openai": settings.OpenAISettings,
- "git": settings.GitSettings,
})
}
@@ -26,9 +25,9 @@ func SaveSettings(c *gin.Context) {
return
}
- settings.ServerSettings = &json.Server
- settings.NginxSettings = &json.Nginx
- settings.OpenAISettings = &json.Openai
+ settings.ServerSettings = json.Server
+ settings.NginxSettings = json.Nginx
+ settings.OpenAISettings = json.Openai
settings.ReflectFrom()
diff --git a/server/settings/settings.go b/server/settings/settings.go
index 09434b12..2db24cba 100644
--- a/server/settings/settings.go
+++ b/server/settings/settings.go
@@ -33,8 +33,8 @@ type Server struct {
type Nginx struct {
AccessLogPath string `json:"access_log_path"`
ErrorLogPath string `json:"error_log_path"`
- ConfigDir string `json:"nginx_config_dir"`
- PIDPath string `json:"nginx_pid_path"`
+ ConfigDir string `json:"config_dir"`
+ PIDPath string `json:"pid_path"`
ReloadCmd string `json:"reload_cmd"`
RestartCmd string `json:"restart_cmd"`
}
@@ -46,15 +46,7 @@ type OpenAI struct {
Model string `json:"model"`
}
-type Git struct {
- Url string `json:"url"`
- AuthMethod string `json:"auth_method"`
- Username string `json:"username"`
- Password string `json:"password"`
- PrivateKeyFilePath string `json:"private_key_file_path"`
-}
-
-var ServerSettings = &Server{
+var ServerSettings = Server{
HttpPort: "9000",
RunMode: "debug",
HTTPChallengePort: "9180",
@@ -66,22 +58,19 @@ var ServerSettings = &Server{
GithubProxy: "",
}
-var NginxSettings = &Nginx{
+var NginxSettings = Nginx{
AccessLogPath: "",
ErrorLogPath: "",
}
-var OpenAISettings = &OpenAI{}
-
-var GitSettings = &Git{}
+var OpenAISettings = OpenAI{}
var ConfPath string
var sections = map[string]interface{}{
- "server": ServerSettings,
- "nginx": NginxSettings,
- "openai": OpenAISettings,
- "git": GitSettings,
+ "server": &ServerSettings,
+ "nginx": &NginxSettings,
+ "openai": &OpenAISettings,
}
func init() {
@@ -123,6 +112,7 @@ func mapTo(section string, v interface{}) {
}
func reflectFrom(section string, v interface{}) {
+ log.Print(section, v)
err := Conf.Section(section).ReflectFrom(v)
if err != nil {
log.Fatalf("Cfg.ReflectFrom %s err: %v", section, err)