diff --git a/.env.example b/.env.example index 9cc80d9..d7d60cc 100644 --- a/.env.example +++ b/.env.example @@ -16,7 +16,7 @@ BASE_PATH=/ NODE_ENV=production # Database Path (usually doesn't need to change) -MAXMIND_DB_PATH=/usr/share/GeoIP +MAXMIND_DB_PATH=/usr/share/maxmind # Rate Limiting Configuration FRONTEND_RATE_WINDOW_MS=60000 # 1 minute window diff --git a/.env.production b/.env.production new file mode 100644 index 0000000..17588cc --- /dev/null +++ b/.env.production @@ -0,0 +1,2 @@ +# Database Path (usually doesn't need to change) +MAXMIND_DB_PATH=/usr/share/maxmind diff --git a/Dockerfile b/Dockerfile index 9005721..f1f71cf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -79,8 +79,8 @@ COPY --from=builder /app/ReleaseNotes.json ./ COPY --from=builder /app/Overview.json ./ # Create directory for GeoIP databases -RUN mkdir -p /usr/share/GeoIP && \ - chown -R bitip:nodejs /usr/share/GeoIP +RUN mkdir -p /usr/share/maxmind && \ + chown -R bitip:nodejs /usr/share/maxmind # Change ownership of app directory RUN chown -R bitip:nodejs /app @@ -92,7 +92,7 @@ USER bitip EXPOSE 5172 # Health check -HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ +HEALTHCHECK --interval=60s --timeout=3s --start-period=20s --retries=3 \ CMD node -e "require('http').get('http://localhost:5172/api/health', (res) => { process.exit(res.statusCode === 200 ? 0 : 1) }).on('error', () => { process.exit(1) })" # Start the application diff --git a/README.md b/README.md index 1972a87..9d94697 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ NODE_ENV=development # Database Path - Point to your MaxMind databases location MAXMIND_DB_PATH=D:\tools\maxmind-dbs # Windows -# MAXMIND_DB_PATH=/usr/share/GeoIP # Linux/Mac +# MAXMIND_DB_PATH=/usr/share/maxmind # Linux/Mac # Rate Limiting Configuration FRONTEND_RATE_WINDOW_MS=60000 @@ -327,7 +327,7 @@ npm run install:all # Install all dependencies (root + backend + frontend) | `PORT` | `5172` | Server port | | `BASE_PATH` | `/` | Application base path | | `NODE_ENV` | `development` | Environment mode (development/production) | -| `MAXMIND_DB_PATH` | `/usr/share/GeoIP` | MaxMind database directory | +| `MAXMIND_DB_PATH` | `/usr/share/maxmind` | MaxMind database directory | | `FRONTEND_API_KEY` | `frontend-default-key` | Frontend API key | | `EXTERNAL_API_KEYS` | `external-default-key` | External API keys (comma-separated) | | `FRONTEND_RATE_WINDOW_MS` | `60000` | Frontend rate limit window (milliseconds) | diff --git a/docker-compose.yml b/docker-compose.yml index fbcd965..61764d9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,7 +11,7 @@ services: - GEOIPUPDATE_EDITION_IDS=GeoLite2-City,GeoLite2-Country - GEOIPUPDATE_FREQUENCY=168 # Update weekly (in hours) volumes: - - geoip_data:/usr/share/GeoIP + - geoip_data:/usr/share/maxmind networks: - bitip-network @@ -28,7 +28,7 @@ services: - NODE_ENV=production # MaxMind Database Path - - MAXMIND_DB_PATH=/usr/share/GeoIP + - MAXMIND_DB_PATH=/usr/share/maxmind # API Keys (Change these in production!) - FRONTEND_API_KEY=your-frontend-api-key-here @@ -48,7 +48,7 @@ services: - SEQ_URL=${SEQ_URL} - SEQ_API_KEY=${SEQ_API_KEY} volumes: - - geoip_data:/usr/share/GeoIP:ro + - geoip_data:/usr/share/maxmind:ro depends_on: - geoipupdate networks: diff --git a/docs/CONFIGURATION.md b/docs/CONFIGURATION.md index f6ffae6..c69db96 100644 --- a/docs/CONFIGURATION.md +++ b/docs/CONFIGURATION.md @@ -133,8 +133,8 @@ MAXMIND_DB_PATH=D:\\tools\\maxmind-dbs - **Format**: Absolute path (OS-specific) - **Required**: Yes - **Windows Example**: `D:\\tools\\maxmind-dbs` (note double backslashes) -- **Linux Example**: `/usr/share/GeoIP` -- **Docker Example**: `/usr/share/GeoIP` (mounted volume) +- **Linux Example**: `/usr/share/maxmind` +- **Docker Example**: `/usr/share/maxmind` (mounted volume) - **Expected Files**: - `GeoLite2-City.mmdb` - City-level geolocation database - Provided by separate GeoIP update service or manual download @@ -348,7 +348,7 @@ FRONTEND_ALLOWED_ORIGINS=https://your-domain.com,https://www.your-domain.com PORT=5172 BASE_PATH=/ NODE_ENV=production -MAXMIND_DB_PATH=/usr/share/GeoIP +MAXMIND_DB_PATH=/usr/share/maxmind FRONTEND_RATE_WINDOW_MS=60000 FRONTEND_RATE_MAX=30 EXTERNAL_RATE_WINDOW_MS=60000 diff --git a/src/backend/services/config.ts b/src/backend/services/config.ts index 5e9089f..7110bb6 100644 --- a/src/backend/services/config.ts +++ b/src/backend/services/config.ts @@ -13,7 +13,7 @@ dotenvConfig({ path: path.join(__dirname, '../../../.env') }); export const config: Config = { port: parseInt(process.env.PORT || '5172', 10), basePath: process.env.BASE_PATH || '/', - maxmindDbPath: process.env.MAXMIND_DB_PATH || '/usr/share/GeoIP', + maxmindDbPath: process.env.MAXMIND_DB_PATH || '/usr/share/maxmind', seqUrl: process.env.SEQ_URL, seqApiKey: process.env.SEQ_API_KEY, apiKeys: {