refactor!: change base data and config dir path
BREAKING CHANGE: `.ocis` dir isn't valid anymore, use init again.
This commit is contained in:
@@ -6,13 +6,11 @@ import (
|
||||
"path"
|
||||
)
|
||||
|
||||
const ()
|
||||
|
||||
var (
|
||||
// switch between modes
|
||||
BaseDataPathType = "homedir" // or "path"
|
||||
// default data path
|
||||
BaseDataPathValue = "/var/lib/ocis"
|
||||
BaseDataPathValue = "/var/lib/opencloud"
|
||||
)
|
||||
|
||||
func BaseDataPath() string {
|
||||
@@ -32,7 +30,7 @@ func BaseDataPath() string {
|
||||
// fallback to BaseDatapathValue for users without home
|
||||
return BaseDataPathValue
|
||||
}
|
||||
return path.Join(dir, ".ocis")
|
||||
return path.Join(dir, ".opencloud")
|
||||
case "path":
|
||||
return BaseDataPathValue
|
||||
default:
|
||||
@@ -45,7 +43,7 @@ var (
|
||||
// switch between modes
|
||||
BaseConfigPathType = "homedir" // or "path"
|
||||
// default config path
|
||||
BaseConfigPathValue = "/etc/ocis"
|
||||
BaseConfigPathValue = "/etc/opencloud"
|
||||
)
|
||||
|
||||
func BaseConfigPath() string {
|
||||
@@ -65,7 +63,7 @@ func BaseConfigPath() string {
|
||||
// fallback to BaseConfigPathValue for users without home
|
||||
return BaseConfigPathValue
|
||||
}
|
||||
return path.Join(dir, ".ocis", "config")
|
||||
return path.Join(dir, ".opencloud", "config")
|
||||
case "path":
|
||||
return BaseConfigPathValue
|
||||
default:
|
||||
|
||||
@@ -9,11 +9,11 @@ import (
|
||||
"github.com/opencloud-eu/opencloud/pkg/structs"
|
||||
)
|
||||
|
||||
// ParseConfig loads the ocis configuration and
|
||||
// ParseConfig loads the opencloud configuration and
|
||||
// copies applicable parts into the commons part, from
|
||||
// where the services can copy it into their own config
|
||||
func ParseConfig(cfg *config.Config, skipValidate bool) error {
|
||||
err := config.BindSourcesToStructs("ocis", cfg)
|
||||
err := config.BindSourcesToStructs("opencloud", cfg)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user