feat/epic-48-replace-dex #20

Merged
faercol merged 20 commits from feat/epic-48-replace-dex into main 2024-10-27 15:16:40 +00:00
5 changed files with 6 additions and 5 deletions
Showing only changes of commit 67ce0aec79 - Show all commits

2
.envrc
View file

@ -8,7 +8,7 @@ export POLYCULECONNECT_SERVER_PORT="5000"
# POLYCULECONNECT_SERVER_SOCK_PATH = "" # POLYCULECONNECT_SERVER_SOCK_PATH = ""
export POLYCULECONNECT_STORAGE_TYPE="sqlite" 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_HOST = "127.0.0.1"
# POLYCULECONNECT_STORAGE_PORT = "5432" # POLYCULECONNECT_STORAGE_PORT = "5432"
# POLYCULECONNECT_STORAGE_DB = "polyculeconnect" # POLYCULECONNECT_STORAGE_DB = "polyculeconnect"

View file

@ -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") path, err := exec.LookPath("sqlite3")
if err != nil { if err != nil {
if errors.Is(err, exec.ErrNotFound) { if errors.Is(err, exec.ErrNotFound) {

View file

@ -129,7 +129,7 @@ type AppConfig struct {
Port int `envconfig:"SERVER_PORT"` Port int `envconfig:"SERVER_PORT"`
SockPath string `envconfig:"SERVER_SOCK"` SockPath string `envconfig:"SERVER_SOCK"`
StorageType string `envconfig:"STORAGE_TYPE"` StorageType string `envconfig:"STORAGE_TYPE"`
StorageConfig *StorageConfig StorageConfig StorageConfig
Issuer string Issuer string
StaticDir string StaticDir string
} }
@ -142,7 +142,7 @@ func defaultConfig() AppConfig {
Port: defaultServerPort, Port: defaultServerPort,
SockPath: defaultServerSocket, SockPath: defaultServerSocket,
StorageType: string(defaultStorageType), StorageType: string(defaultStorageType),
StorageConfig: &StorageConfig{ StorageConfig: StorageConfig{
File: defaultStorageFile, File: defaultStorageFile,
Host: defaultStorageHost, Host: defaultStorageHost,
Port: defaultServerPort, Port: defaultServerPort,
@ -212,11 +212,12 @@ func New(filepath string) (*AppConfig, error) {
if err := envconfig.Process(envConfigPrefix, &conf); err != nil { if err := envconfig.Process(envConfigPrefix, &conf); err != nil {
return nil, err return nil, err
} }
if err := envconfig.Process(envConfigPrefix, conf.StorageConfig); err != nil { if err := envconfig.Process(envConfigPrefix, &conf.StorageConfig); err != nil {
return nil, err return nil, err
} }
if err := envconfig.Process(envConfigPrefix, &conf.StorageConfig.SSL); err != nil { if err := envconfig.Process(envConfigPrefix, &conf.StorageConfig.SSL); err != nil {
return nil, err return nil, err
} }
return &conf, nil return &conf, nil
} }

Binary file not shown.

Binary file not shown.