Deployment
This guide covers deploying OSGEO-Inject to production.
NixOS Anywhere Deployment
Prerequisites
- Target server accessible via SSH
- Root SSH access configured
- Domain DNS pointing to server
Deployment Steps
- Prepare Configuration
# Edit your target configuration
vim nixos/vm-configuration.nix
- Deploy
nixos-anywhere --flake .#osgeo-inject-vm root@your-server-ip
- Verify
curl https://affiliate.osgeo.org/health
Manual Deployment
1. Build Assets
nix develop
npm ci
npm run build
2. Copy Files
rsync -avz src/ root@server:/var/www/osgeo-inject/
rsync -avz nginx/nginx.conf root@server:/etc/nginx/
Using Let's Encrypt:
certbot certonly --nginx -d affiliate.osgeo.org
4. Start Services
ssh root@server "systemctl restart nginx"
Updating
Update Announcements
./scripts/update-announcement.sh --deploy
Update Static Assets
npm run build
rsync -avz src/ root@server:/var/www/osgeo-inject/
Full System Update
nixos-rebuild switch --flake .#osgeo-inject --target-host root@server
Rollback
NixOS supports instant rollbacks:
ssh root@server "nixos-rebuild switch --rollback"
Monitoring
Health Check
curl -f https://affiliate.osgeo.org/health || alert
Nginx Logs
ssh root@server "tail -f /var/log/nginx/access.log"
System Status
ssh root@server "systemctl status nginx matomo php-fpm"