# Nginx Proxy Manager - GitOps Deployment

This directory contains the GitOps deployment configuration for Nginx Proxy Manager on the Calypso server.

## 🚀 Quick Start

```bash
# Deploy NPM
./deploy.sh

# Check status
./deploy.sh status

# View logs
./deploy.sh logs
```

## 🌐 Access URLs

- **Admin UI**: http://192.168.0.250:81
- **HTTP Proxy**: http://192.168.0.250:8880 (external port 80)
- **HTTPS Proxy**: https://192.168.0.250:8443 (external port 443)

## 🔧 Configuration

### Port Mapping
- `8880:80` - HTTP proxy (router forwards 80→8880)
- `8443:443` - HTTPS proxy (router forwards 443→8443)
- `81:81` - Admin interface

### Data Storage
- **Config**: `/volume1/docker/nginx-proxy-manager/data`
- **SSL Certs**: `/volume1/docker/nginx-proxy-manager/letsencrypt`

## 🛠️ Deployment Commands

```bash
# Full deployment
./deploy.sh deploy

# Management
./deploy.sh restart     # Restart service
./deploy.sh stop        # Stop service
./deploy.sh update      # Update images and redeploy
./deploy.sh status      # Check service status
./deploy.sh logs        # View service logs
./deploy.sh cleanup     # Clean up existing containers
```

## 🔐 Initial Setup

1. **First Login**:
   - URL: http://192.168.0.250:81
   - Email: `admin@example.com`
   - Password: "REDACTED_PASSWORD"

2. **Change Default Credentials**:
   - Update email and password immediately
   - Enable 2FA if desired

3. **Configure Proxy Hosts**:
   - Add your domains (*.vish.gg, *.thevish.io)
   - Configure SSL certificates
   - Set up forwarding rules

## 🌍 Router Configuration

Ensure your router forwards these ports:
- **Port 80** → **8880** (HTTP)
- **Port 443** → **8443** (HTTPS)

## 🔄 Migration Notes

This deployment uses alternate ports (8880/8443) to avoid conflicts with Synology's built-in nginx service. Once migration is complete and Synology nginx is disabled, you can change the ports to standard 80/443.

## 🚨 Troubleshooting

### Service Won't Start
```bash
# Clean up and redeploy
./deploy.sh cleanup
./deploy.sh deploy
```

### Can't Access Admin UI
```bash
# Check service status
./deploy.sh status

# Check logs
./deploy.sh logs
```

### SSL Certificate Issues
1. Ensure domains point to your external IP (YOUR_WAN_IP)
2. Check router port forwarding
3. Verify Cloudflare DNS settings

## 📊 Status

**Status**: ✅ **ACTIVE DEPLOYMENT** (GitOps)
- **Version**: Latest (jc21/nginx-proxy-manager)
- **Deployed**: 2026-02-16
- **External Access**: ✅ Configured via router forwarding