diff --git a/api-gateway/README.md b/api-gateway/README.md index 9324ff1..e281b23 100644 --- a/api-gateway/README.md +++ b/api-gateway/README.md @@ -1,7 +1,7 @@ -mkdir -p api-gateway/nginx/certs \ -touch api-gateway/nginx/certs/key.pem \ -touch api-gateway/nginx/certs/cert.pem \ -openssl req -x509 -nodes -days 365 -newkey rsa:2048 \ +sudo mkdir -p api-gateway/nginx/certs \ +sudo touch api-gateway/nginx/certs/key.pem \ +sudo touch api-gateway/nginx/certs/cert.pem \ +sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 \ -keyout api-gateway/nginx/certs/key.pem \ -out api-gateway/nginx/certs/cert.pem \ -subj "/C=/ST=/L=/O=/OU=/CN=" \ No newline at end of file diff --git a/api-gateway/nginx/nginx.conf b/api-gateway/nginx/nginx.conf index 790fa08..0c8b9cf 100644 --- a/api-gateway/nginx/nginx.conf +++ b/api-gateway/nginx/nginx.conf @@ -9,7 +9,7 @@ http { resolver 127.0.0.11 valid=30s; server { - listen 443 ssl; + listen 26200 ssl; server_name localhost; ssl_certificate /etc/nginx/certs/cert.pem; diff --git a/docker-compose.yaml b/docker-compose.yaml index a1f8177..c2327da 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -74,7 +74,7 @@ services: api-gateway: image: nginx:latest ports: - - "443:443" + - "26200:26200" volumes: - ./api-gateway/nginx/nginx.conf:/etc/nginx/nginx.conf:ro - ./api-gateway/nginx/certs:/etc/nginx/certs:ro diff --git a/task-service/internal/config/config.go b/task-service/internal/config/config.go index d23f411..8df0cf2 100644 --- a/task-service/internal/config/config.go +++ b/task-service/internal/config/config.go @@ -2,7 +2,6 @@ package config import ( "fmt" - "os" "github.com/go-playground/validator/v10" "github.com/ilyakaznacheev/cleanenv" @@ -58,17 +57,6 @@ type Config struct { func New() (*Config, error) { var cfg Config - configPath := os.Getenv("CONFIG_PATH") - if configPath == "" { - configPath = "./config/.env" // Значение по умолчанию - } - - if _, err := os.Stat(configPath); err == nil { - if err := cleanenv.ReadConfig(configPath, &cfg); err != nil { - return nil, fmt.Errorf("failed to read config from file %s: %w", configPath, err) - } - } - if err := cleanenv.ReadEnv(&cfg); err != nil { return nil, fmt.Errorf("failed to read config from env: %w", err) } diff --git a/task-service/pkg/db/postgres/postgres.go b/task-service/pkg/db/postgres/postgres.go index a22a4d0..573b2eb 100644 --- a/task-service/pkg/db/postgres/postgres.go +++ b/task-service/pkg/db/postgres/postgres.go @@ -20,6 +20,7 @@ type DB struct { func NewPostgres(cfg config.PostgresConfig, logger *zap.SugaredLogger) (*DB, error) { dsn := fmt.Sprintf("host=%s port=%s user=%s password=%s dbname=%s sslmode=%s", cfg.Host, cfg.Port, cfg.User, cfg.Password, cfg.DBName, cfg.SSLMode) + logger.Infof("host=%s port=%s user=%s password=%s dbname=%s sslmode=%s", cfg.Host, cfg.Port, cfg.User, cfg.Password, cfg.DBName, cfg.SSLMode) config, err := pgxpool.ParseConfig(dsn) if err != nil {