mirror of
https://github.com/XShengTech/MEGREZ.git
synced 2026-05-03 13:02:38 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cfbd7d24db |
@@ -12,3 +12,4 @@ redis:
|
|||||||
port: 6379
|
port: 6379
|
||||||
system:
|
system:
|
||||||
verify: false
|
verify: false
|
||||||
|
mount_dir: /path/to/mount
|
||||||
|
|||||||
@@ -41,8 +41,9 @@ type logStruct struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type systemStruct struct {
|
type systemStruct struct {
|
||||||
Salt string `yaml:"salt,omitempty"`
|
Salt string `yaml:"salt,omitempty"`
|
||||||
Verify bool `yaml:"verify,omitempty"`
|
Verify bool `yaml:"verify,omitempty"`
|
||||||
|
MountDir string `yaml:"mount_dir,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
var config = configStruct{
|
var config = configStruct{
|
||||||
|
|||||||
@@ -53,6 +53,10 @@ func GetSystemVerify() bool {
|
|||||||
return config.GetSystemVerify()
|
return config.GetSystemVerify()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func GetSystemMountDir() string {
|
||||||
|
return config.GetSystemMountDir()
|
||||||
|
}
|
||||||
|
|
||||||
func Save() error {
|
func Save() error {
|
||||||
return config.Save()
|
return config.Save()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,6 +40,10 @@ func (c *configStruct) GetSystemVerify() bool {
|
|||||||
return c.System.Verify
|
return c.System.Verify
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *configStruct) GetSystemMountDir() string {
|
||||||
|
return c.System.MountDir
|
||||||
|
}
|
||||||
|
|
||||||
func (c *configStruct) Save() error {
|
func (c *configStruct) Save() error {
|
||||||
return c.save()
|
return c.save()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"megrez/libs/crypto"
|
"megrez/libs/crypto"
|
||||||
"megrez/libs/request"
|
"megrez/libs/request"
|
||||||
|
"megrez/services/config"
|
||||||
"strconv"
|
"strconv"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -56,13 +57,16 @@ func createInstance(ip string, port int, apikey string,
|
|||||||
Src: volumeName,
|
Src: volumeName,
|
||||||
Dest: "/root/megrez-tmp",
|
Dest: "/root/megrez-tmp",
|
||||||
},
|
},
|
||||||
{
|
|
||||||
Src: "/data/pub",
|
|
||||||
Dest: "/root/megrez-pub",
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if config.GetSystemMountDir() != "" {
|
||||||
|
data.Binds = append(data.Binds, bindStruct{
|
||||||
|
Src: config.GetSystemMountDir(),
|
||||||
|
Dest: "/root/megrez",
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
reqBytes, err := json.Marshal(data)
|
reqBytes, err := json.Marshal(data)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
l.Error("marshal request data error: %v", err)
|
l.Error("marshal request data error: %v", err)
|
||||||
|
|||||||
Reference in New Issue
Block a user