Skip to content

Commit

Permalink
Merge pull request #17 from opencloud-eu/debranding-base-config-dir-path
Browse files Browse the repository at this point in the history
Debrand base data and config dir path
  • Loading branch information
micbar authored Jan 15, 2025
2 parents 55fb8ac + 4a45d7f commit d07cc2f
Show file tree
Hide file tree
Showing 10 changed files with 952 additions and 13 deletions.
4 changes: 2 additions & 2 deletions docs/helpers/configenvextractor.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ func generateIntermediateCode(templatePath string, intermediateCodePath string,

func runIntermediateCode(intermediateCodePath string) {
fmt.Println("Running intermediate go code for " + intermediateCodePath)
defaultConfigPath := "/etc/ocis"
defaultDataPath := "/var/lib/ocis"
defaultConfigPath := "/etc/opencloud"
defaultDataPath := "/var/lib/opencloud"
os.Setenv("OC_BASE_DATA_PATH", defaultDataPath)
os.Setenv("OC_CONFIG_DIR", defaultConfigPath)
out, err := exec.Command("go", "run", intermediateCodePath).CombinedOutput()
Expand Down
2 changes: 1 addition & 1 deletion opencloud/pkg/init/functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func writeConfig(configPath, ocisAdminServicePassword, targetBackupConfig string
// writePatch writes the diff to a file
func writePatch(configPath string, yamlOutput []byte) error {
fmt.Println("running in diff mode")
tmpFile := path.Join(configPath, "ocis.yaml.tmp")
tmpFile := path.Join(configPath, "opencloud.yaml.tmp")
err := os.WriteFile(tmpFile, yamlOutput, 0600)
if err != nil {
return err
Expand Down
5 changes: 3 additions & 2 deletions opencloud/pkg/init/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ import (
"path"

"github.com/gofrs/uuid"
"github.com/opencloud-eu/opencloud/pkg/generators"
"gopkg.in/yaml.v2"

"github.com/opencloud-eu/opencloud/pkg/generators"
)

const (
configFilename = "ocis.yaml"
configFilename = "opencloud.yaml"
passwordLength = 32
)

Expand Down
10 changes: 4 additions & 6 deletions pkg/config/defaults/paths.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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:
Expand All @@ -45,7 +43,7 @@ var (
// switch between modes
BaseConfigPathType = "homedir" // or "path"
// default config path
BaseConfigPathValue = "/etc/ocis"
BaseConfigPathValue = "/etc/opencloud"
)

func BaseConfigPath() string {
Expand All @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions pkg/config/parser/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit d07cc2f

Please sign in to comment.