diff --git a/.env b/.env index 83ff584..0384b8d 100644 --- a/.env +++ b/.env @@ -1,17 +1,18 @@ -# TODO: add a warning to keep secure, add to .gitignore +# Configuration via environment variables +# Add this file to .gitignore when using secret data -# Address strings -SERVER_ADDR = 0.0.0.0:8080 -POSTGRES_URL = postgres://postgres:mypsw@postgres:5432/microservices +# Docker Compose environment +POSTGRES_PASSWORD = demopsw + +# Connection strings +POSTGRES_URL = postgres://postgres:demopsw@postgres:5432/microservices RABBIT_URL = amqp://guest:guest@rabbitmq:5672 +SERVER_ADDR = 0.0.0.0:8080 -# RabbitMQ names +# RabbitMQ variables EXCHANGE = main_exchange QUEUE_BACK = backend_queue QUEUE_DB = db_queue KEY_FRONT = frontend_key KEY_BACK = backend_key KEY_DB = db_key - -# Docker Compose environment -POSTGRES_PASSWORD = mypsw diff --git a/config/config.go b/config/config.go index 63d3067..04a3d90 100644 --- a/config/config.go +++ b/config/config.go @@ -17,7 +17,7 @@ type Config struct { func New() *Config { return &Config{ ServerAddr: getEnv("SERVER_ADDR", "localhost:8080"), - PostgresURL: getEnv("POSTGRES_URL", "postgres://postgres:mypsw@localhost:5432/microservices"), + PostgresURL: getEnv("POSTGRES_URL", "postgres://postgres:demopsw@localhost:5432/microservices"), RabbitURL: getEnv("RABBIT_URL", "amqp://guest:guest@localhost:5672"), Exchange: getEnv("EXCHANGE", "main_exchange"), QueueBack: getEnv("QUEUE_BACK", "backend_queue"),