Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions api-gateway/README.md
Original file line number Diff line number Diff line change
@@ -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="
2 changes: 1 addition & 1 deletion api-gateway/nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 0 additions & 12 deletions task-service/internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package config

import (
"fmt"
"os"

"github.com/go-playground/validator/v10"
"github.com/ilyakaznacheev/cleanenv"
Expand Down Expand Up @@ -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)
}
Expand Down
1 change: 1 addition & 0 deletions task-service/pkg/db/postgres/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Loading