refactor: .env as single config, remove nexusguard.conf.example, update docker-compose
This commit is contained in:
+1
-1
Submodule apps/server-core updated: 127ba7ed99...c68047456e
+2
-11
@@ -38,20 +38,11 @@ services:
|
|||||||
context: ./apps/server-core
|
context: ./apps/server-core
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
network_mode: host
|
network_mode: host
|
||||||
|
env_file:
|
||||||
|
- .env
|
||||||
environment:
|
environment:
|
||||||
- DB_HOST=127.0.0.1
|
- DB_HOST=127.0.0.1
|
||||||
- DB_PORT=5432
|
|
||||||
- DB_USER=nexusguard
|
|
||||||
- DB_PASSWORD=${DB_PASSWORD:-nexusguard}
|
|
||||||
- DB_NAME=nexusguard
|
|
||||||
- REDIS_ADDR=127.0.0.1:6379
|
- REDIS_ADDR=127.0.0.1:6379
|
||||||
- JWT_SECRET=${JWT_SECRET:-changeme}
|
|
||||||
- SERVER_SALT=${SERVER_SALT:-changeme}
|
|
||||||
- NFTABLES_TABLE=nexusguard
|
|
||||||
- IPAM_POOL=10.172.0.0/16
|
|
||||||
- GIN_MODE=release
|
|
||||||
volumes:
|
|
||||||
- ./nexusguard.conf:/etc/nexusguard/nexusguard.conf:ro
|
|
||||||
depends_on:
|
depends_on:
|
||||||
postgres:
|
postgres:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
|||||||
@@ -1,25 +0,0 @@
|
|||||||
# NexusGuard Server Configuration
|
|
||||||
# This file is optional. Environment variables take precedence.
|
|
||||||
# Format: export KEY=VALUE
|
|
||||||
|
|
||||||
# Database
|
|
||||||
# export DB_HOST=127.0.0.1
|
|
||||||
# export DB_PORT=5432
|
|
||||||
# export DB_USER=nexusguard
|
|
||||||
# export DB_PASSWORD=nexusguard
|
|
||||||
# export DB_NAME=nexusguard
|
|
||||||
|
|
||||||
# Redis
|
|
||||||
# export REDIS_ADDR=127.0.0.1:6379
|
|
||||||
|
|
||||||
# Security
|
|
||||||
# export JWT_SECRET=changeme
|
|
||||||
# export SERVER_SALT=changeme
|
|
||||||
|
|
||||||
# WireGuard
|
|
||||||
# export NFTABLES_TABLE=nexusguard
|
|
||||||
# export IPAM_POOL=10.172.0.0/16
|
|
||||||
|
|
||||||
# Logging
|
|
||||||
# export LOG_LEVEL=info
|
|
||||||
# export GIN_MODE=release
|
|
||||||
@@ -28,16 +28,7 @@ else
|
|||||||
echo "[+] .env file already exists. Skipping environment generation."
|
echo "[+] .env file already exists. Skipping environment generation."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# 2. Config file generation
|
|
||||||
if [ ! -f nexusguard.conf ]; then
|
|
||||||
if [ -f nexusguard.conf.example ]; then
|
|
||||||
echo "[+] Auto-generating nexusguard.conf from nexusguard.conf.example..."
|
|
||||||
cp nexusguard.conf.example nexusguard.conf
|
|
||||||
echo "[+] Config file created. All settings are commented out (env vars take precedence)."
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo "[+] nexusguard.conf already exists. Skipping config generation."
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Make sure Docker Compose v2 is available
|
# Make sure Docker Compose v2 is available
|
||||||
if ! docker compose version &> /dev/null; then
|
if ! docker compose version &> /dev/null; then
|
||||||
|
|||||||
Reference in New Issue
Block a user