Compare commits
49 Commits
4da9792b0f
...
v0.14.1
Author | SHA1 | Date | |
---|---|---|---|
e03fd78ea9 | |||
370ef205a9 | |||
d328ddb749 | |||
5dc5590da9 | |||
364112a0a4 | |||
a38523e933 | |||
200672dae2 | |||
3d3aad88c8 | |||
e4e43d1a83 | |||
737a9ec314 | |||
1ebe0380ee | |||
d62d71b5d1 | |||
b36e0ea503 | |||
bc4d8fa37e | |||
d2b21e7405 | |||
e3c192359f | |||
46532e4c85 | |||
c722135a56 | |||
887fa863bc | |||
74d71cfb6a | |||
ca7e7cddd3 | |||
94431a2aa9 | |||
5b1f20c5bc | |||
d0c566f8df | |||
5e586aa49a | |||
66b2743d3d | |||
3723b2b5e6 | |||
ce788bfd50 | |||
230a6278cc | |||
42d6e0c198 | |||
e1af2979af | |||
f6dedc6f10 | |||
cdf0a49550 | |||
c3c0650210 | |||
d077f700d8 | |||
ec752b1c66 | |||
46aef4f12f | |||
1b29e328cf | |||
e50cb819f3 | |||
c32e38ca10 | |||
d7c8c7a43a | |||
1cd3edc90c | |||
0e768c9f61 | |||
1fcd775cc5 | |||
203a1ed147 | |||
ef1914ee5c | |||
084b101e31 | |||
b2db128aa9 | |||
081e880fb6 |
@ -14,11 +14,11 @@ import (
|
|||||||
type Config struct {
|
type Config struct {
|
||||||
AESKeyFile string
|
AESKeyFile string
|
||||||
ArticleDir string
|
ArticleDir string
|
||||||
AtomFile string
|
|
||||||
ConfigFile string
|
ConfigFile string
|
||||||
DBName string
|
DBName string
|
||||||
Description string
|
Description string
|
||||||
Domain string
|
Domain string
|
||||||
|
AtomFile string
|
||||||
FirebaseKey string
|
FirebaseKey string
|
||||||
GOBKeyFile string
|
GOBKeyFile string
|
||||||
Link string
|
Link string
|
||||||
@ -52,7 +52,7 @@ func newConfig() *Config {
|
|||||||
PDFDir: "/var/www/cpolis/pdfs",
|
PDFDir: "/var/www/cpolis/pdfs",
|
||||||
PicsDir: "/var/www/cpolis/pics",
|
PicsDir: "/var/www/cpolis/pics",
|
||||||
Port: ":8080",
|
Port: ":8080",
|
||||||
Version: "v0.15.0",
|
Version: "v0.14.1",
|
||||||
WebDir: "/var/www/cpolis/web",
|
WebDir: "/var/www/cpolis/web",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -171,14 +171,6 @@ func (c *Config) setupConfig(cliConfig *Config) error {
|
|||||||
return fmt.Errorf("error setting up directory: %v", err)
|
return fmt.Errorf("error setting up directory: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if cliConfig.AtomFile != defaultConfig.AtomFile {
|
|
||||||
c.AtomFile = cliConfig.AtomFile
|
|
||||||
}
|
|
||||||
c.AtomFile, err = mkFile(c.AtomFile, 0644, 0744)
|
|
||||||
if err != nil {
|
|
||||||
return fmt.Errorf("error setting up file: %v", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
if cliConfig.DBName != defaultConfig.DBName {
|
if cliConfig.DBName != defaultConfig.DBName {
|
||||||
c.DBName = cliConfig.DBName
|
c.DBName = cliConfig.DBName
|
||||||
}
|
}
|
||||||
@ -190,11 +182,19 @@ func (c *Config) setupConfig(cliConfig *Config) error {
|
|||||||
if cliConfig.Domain != defaultConfig.Domain {
|
if cliConfig.Domain != defaultConfig.Domain {
|
||||||
c.Domain = cliConfig.Domain
|
c.Domain = cliConfig.Domain
|
||||||
}
|
}
|
||||||
domainStrings := strings.Split(c.Domain, ":")
|
domainStrings := strings.Split(c.Domain, "/")
|
||||||
if domainStrings[0] != "http" && domainStrings[0] != "https" {
|
if domainStrings[0] != "http:" && domainStrings[0] != "https:" {
|
||||||
c.Domain = "https://" + c.Domain
|
c.Domain = "https://" + c.Domain
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if cliConfig.AtomFile != defaultConfig.AtomFile {
|
||||||
|
c.AtomFile = cliConfig.AtomFile
|
||||||
|
}
|
||||||
|
c.AtomFile, err = mkFile(c.AtomFile, 0644, 0744)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("error setting up file: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
if cliConfig.FirebaseKey != defaultConfig.FirebaseKey {
|
if cliConfig.FirebaseKey != defaultConfig.FirebaseKey {
|
||||||
c.FirebaseKey = cliConfig.FirebaseKey
|
c.FirebaseKey = cliConfig.FirebaseKey
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user