diff --git a/.envrc b/.envrc index cb5e78d..03de5e9 100644 --- a/.envrc +++ b/.envrc @@ -8,7 +8,7 @@ export POLYCULECONNECT_SERVER_PORT="5000" # POLYCULECONNECT_SERVER_SOCK_PATH = "" export POLYCULECONNECT_STORAGE_TYPE="sqlite" -export POLYCULECONNECT_STORAGE_FILEPATH="./build/polyculeconnect.db" +export POLYCULECONNECT_STORAGE_PATH="./build/polyculeconnect.db" # POLYCULECONNECT_STORAGE_HOST = "127.0.0.1" # POLYCULECONNECT_STORAGE_PORT = "5432" # POLYCULECONNECT_STORAGE_DB = "polyculeconnect" diff --git a/polyculeconnect/cmd/db/connect.go b/polyculeconnect/cmd/db/connect.go index bdacdbe..a5cd153 100644 --- a/polyculeconnect/cmd/db/connect.go +++ b/polyculeconnect/cmd/db/connect.go @@ -24,7 +24,7 @@ var connectCmd = &cobra.Command{ }, } -func connectSQLite(conf *config.StorageConfig) error { +func connectSQLite(conf config.StorageConfig) error { path, err := exec.LookPath("sqlite3") if err != nil { if errors.Is(err, exec.ErrNotFound) { diff --git a/polyculeconnect/config/config.go b/polyculeconnect/config/config.go index 803f23e..42c35a4 100644 --- a/polyculeconnect/config/config.go +++ b/polyculeconnect/config/config.go @@ -129,7 +129,7 @@ type AppConfig struct { Port int `envconfig:"SERVER_PORT"` SockPath string `envconfig:"SERVER_SOCK"` StorageType string `envconfig:"STORAGE_TYPE"` - StorageConfig *StorageConfig + StorageConfig StorageConfig Issuer string StaticDir string } @@ -142,7 +142,7 @@ func defaultConfig() AppConfig { Port: defaultServerPort, SockPath: defaultServerSocket, StorageType: string(defaultStorageType), - StorageConfig: &StorageConfig{ + StorageConfig: StorageConfig{ File: defaultStorageFile, Host: defaultStorageHost, Port: defaultServerPort, @@ -212,11 +212,12 @@ func New(filepath string) (*AppConfig, error) { if err := envconfig.Process(envConfigPrefix, &conf); err != nil { return nil, err } - if err := envconfig.Process(envConfigPrefix, conf.StorageConfig); err != nil { + if err := envconfig.Process(envConfigPrefix, &conf.StorageConfig); err != nil { return nil, err } if err := envconfig.Process(envConfigPrefix, &conf.StorageConfig.SSL); err != nil { return nil, err } + return &conf, nil } diff --git a/polyculeconnect/polyculeconnect b/polyculeconnect/polyculeconnect deleted file mode 100755 index b1baa48..0000000 Binary files a/polyculeconnect/polyculeconnect and /dev/null differ diff --git a/polyculeconnect/polyculeconnect.db b/polyculeconnect/polyculeconnect.db deleted file mode 100644 index 41e982e..0000000 Binary files a/polyculeconnect/polyculeconnect.db and /dev/null differ