chore: setup global root .env and auto-start script

This commit is contained in:
datadunia
2026-05-15 23:37:49 +07:00
parent b6239a01cd
commit a6327294e7
2 changed files with 66 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
# ==========================================
# NexusGuard SD-WAN - Global Configuration
# ==========================================
# 1. Database Configuration (PostgreSQL)
DB_HOST=postgres
DB_PORT=5432
DB_USER=nexusguard
DB_PASSWORD=GantiDenganPasswordDatabaseYangKuat123!
DB_NAME=nexusguard
# 2. Redis Configuration
REDIS_ADDR=redis:6379
# 3. Security & Cryptography
# Generate menggunakan: openssl rand -hex 32
JWT_SECRET=GantiDenganKunciRahasiaJWTUntukDashboard256Bit
SERVER_SALT=GantiDenganKunciGaramUntukWireGuard256Bit
# 4. Networking & SD-WAN
NFTABLES_TABLE=nexusguard
IPAM_POOL=10.8.0.0/16
API_PORT=8080
# 5. Dashboard UI (Frontend Build Configuration)
# URL API yang akan diakses oleh web browser client
VITE_API_BASE_URL=http://localhost:8080/api/v1
# 6. General Settings
GIN_MODE=release
LOG_LEVEL=info
+35
View File
@@ -0,0 +1,35 @@
#!/bin/bash
set -e
echo "======================================"
echo " Starting NexusGuard SD-WAN Suite... "
echo "======================================"
# Auto-create .env if it doesn't exist
if [ ! -f .env ]; then
echo "[!] .env file not found."
if [ -f .env.example ]; then
echo "[+] Auto-generating .env from .env.example..."
cp .env.example .env
echo "[!] IMPORTANT: Please review the .env file and change the default passwords!"
else
echo "[-] ERROR: .env.example is missing. Cannot generate .env."
exit 1
fi
else
echo "[+] .env file detected."
fi
# Make sure Docker is available
if ! command -v docker-compose &> /dev/null; then
echo "[-] ERROR: docker-compose is not installed. Please install Docker first."
exit 1
fi
echo "[+] Bringing up Docker containers..."
docker-compose up -d
echo "======================================"
echo " NexusGuard is successfully running! "
echo " API Port : 8080"
echo "======================================"