installer: clean up codebase
* introduce helper soft package to work with SoftServe
* move commands to cmd/
diff --git a/core/installer/soft/config.go b/core/installer/soft/config.go
new file mode 100644
index 0000000..b674377
--- /dev/null
+++ b/core/installer/soft/config.go
@@ -0,0 +1,49 @@
+package soft
+
+type Repository struct {
+ Name string `json:"name"`
+ Repository string `json:"repo"`
+ Private bool `json:"private"`
+ Note string `json:"note"`
+}
+
+type User struct {
+ Name string `json:"name"`
+ Admin bool `json:"admin"`
+ PublicKeys []string `json:"public-keys"`
+}
+
+type Config struct {
+ Name string `json:"name"`
+ Host string `json:"host"`
+ Port int `json:"port"`
+ AnonAccess string `json:"anon-access"`
+ AllowKeyless bool `json:"allow-keyless"`
+ Repositories []Repository `json:"repos"`
+ Users []User `json:"users"`
+}
+
+func DefaultConfig(adminKeys []string) Config {
+ return Config{
+ Name: "PCloud",
+ Host: "localhost",
+ Port: 22,
+ AnonAccess: "no-access",
+ AllowKeyless: false,
+ Repositories: []Repository{
+ {
+ Name: "Home",
+ Repository: "config",
+ Private: true,
+ Note: "Configuration for PCloud SoftServe deployment",
+ },
+ },
+ Users: []User{
+ {
+ Name: "Admin",
+ Admin: true,
+ PublicKeys: adminKeys,
+ },
+ },
+ }
+}