Skip to content

Commit e4e9059

Browse files
committed
chore: remove PostgreSQL configuration and related settings from codebase
1 parent 759dd7e commit e4e9059

3 files changed

Lines changed: 11 additions & 42 deletions

File tree

.env.example

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,6 @@
22
JWT_SECRET=your-secret-key-min-32-characters
33
ENCRYPTION_KEY=your-32-character-encryption-key
44

5-
# Server - Optional
6-
APP_ENV=development
7-
DB_CONNECTION=./data/deeploy.db?_pragma=foreign_keys(1)&_pragma=journal_mode(WAL)
8-
PORT=8090
9-
# COOKIE_SECURE defaults to true in production and false in development.
10-
#COOKIE_SECURE=false
11-
BUILD_DIR=/tmp/deeploy-builds
12-
TRAEFIK_CONFIG_DIR=/traefik/dynamic
13-
14-
# Docs (internal)
15-
GITHUB_TOKEN=
16-
RESEND_API_KEY=
17-
RESEND_AUDIENCE_ID=
18-
19-
# TUI (local debug)
20-
# Enable debug logging to debug.log when set.
21-
#DEBUG=1
5+
# Notes:
6+
# - APP_ENV is set by runtime context (production in docker-compose, development in local task).
7+
# - All other server settings use code defaults (SQLite, port, build paths, traefik config path).

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ services:
105105
# SQLite database file
106106
- /opt/deeploy/data:/data
107107
environment:
108+
APP_ENV: production
108109
JWT_SECRET: ${JWT_SECRET}
109110
ENCRYPTION_KEY: ${ENCRYPTION_KEY}
110111
restart: unless-stopped

internal/server/config/config.go

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -10,36 +10,32 @@ import (
1010
type Config struct {
1111
AppEnv string
1212
Port string
13-
DBConnection string // connection string
13+
DBConnection string
1414
JWTSecret string
1515
EncryptionKey string
1616
CookieSecure bool
1717
BuildDir string
18-
TraefikConfigDir string // Directory for Traefik dynamic config files
18+
TraefikConfigDir string
1919
}
2020

2121
func Load() *Config {
2222
godotenv.Load()
2323

2424
appEnv := getEnv("APP_ENV", "development")
2525

26-
// Database config - SQLite only
27-
dbConnection := getEnv("DB_CONNECTION", getDBConnectionDefault())
28-
2926
// Always require secrets (generated by install script)
3027
jwtSecret := requireEnv("JWT_SECRET", "min 32 characters")
3128
encryptionKey := requireEnv("ENCRYPTION_KEY", "exactly 32 characters")
32-
cookieSecure := getEnvBool("COOKIE_SECURE", appEnv == "production")
3329

3430
return &Config{
3531
AppEnv: appEnv,
36-
Port: getEnv("PORT", "8090"),
37-
DBConnection: dbConnection,
32+
Port: "8090",
33+
DBConnection: getDBConnectionDefault(),
3834
JWTSecret: jwtSecret,
3935
EncryptionKey: encryptionKey,
40-
CookieSecure: cookieSecure,
41-
BuildDir: getEnv("BUILD_DIR", "/tmp/deeploy-builds"),
42-
TraefikConfigDir: getEnv("TRAEFIK_CONFIG_DIR", "/traefik/dynamic"),
36+
CookieSecure: appEnv == "production",
37+
BuildDir: "/tmp/deeploy-builds",
38+
TraefikConfigDir: "/traefik/dynamic",
4339
}
4440
}
4541

@@ -59,20 +55,6 @@ func getEnv(key, fallback string) string {
5955
return value
6056
}
6157

62-
func getEnvBool(key string, fallback bool) bool {
63-
value, exists := os.LookupEnv(key)
64-
if !exists || value == "" {
65-
return fallback
66-
}
67-
if value == "1" || value == "true" || value == "TRUE" || value == "True" {
68-
return true
69-
}
70-
if value == "0" || value == "false" || value == "FALSE" || value == "False" {
71-
return false
72-
}
73-
return fallback
74-
}
75-
7658
func requireEnv(key, hint string) string {
7759
value := os.Getenv(key)
7860
if value == "" {

0 commit comments

Comments
 (0)