Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debrand base data and config dir path #17

Merged
merged 1 commit into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading