|
| 1 | +# OpenID Federation Server Deployment |
| 2 | + |
| 3 | +This repository contains scripts and configuration files for deploying the OpenID Federation Server and Admin Server using Docker. |
| 4 | + |
| 5 | +## Repository Contents |
| 6 | + |
| 7 | +### Deployment Scripts (Local Use Only) |
| 8 | +``` |
| 9 | +├── build.sh # Build script for local development |
| 10 | +├── push.sh # Script to push images to registry |
| 11 | +└── setup-env.sh # Environment setup script |
| 12 | +``` |
| 13 | + |
| 14 | +### Deployment Files (To Be Deployed) |
| 15 | +``` |
| 16 | +├── docker-compose.yaml |
| 17 | +└── config/ |
| 18 | + ├── federation-server/ |
| 19 | + │ └── application.properties |
| 20 | + └── admin-server/ |
| 21 | + └── application.properties |
| 22 | +``` |
| 23 | + |
| 24 | +## Prerequisites |
| 25 | + |
| 26 | +- Docker and Docker Compose (version 3.9 or higher) |
| 27 | +- Access to a Docker Container Registry |
| 28 | +- Traefik as reverse proxy (configured with HTTPS and acme resolver) |
| 29 | + |
| 30 | +## Environment Variables |
| 31 | + |
| 32 | +Before running the deployment, ensure the following environment variables are properly configured: |
| 33 | + |
| 34 | +### Database Configuration |
| 35 | +- `DATASOURCE_USER` - PostgreSQL user for the main database |
| 36 | +- `DATASOURCE_PASSWORD` - PostgreSQL password for the main database |
| 37 | +- `DATASOURCE_DB` - Main database name |
| 38 | + |
| 39 | +### Local KMS Configuration |
| 40 | +- `LOCAL_KMS_DATASOURCE_USER` - PostgreSQL user for the KMS database |
| 41 | +- `LOCAL_KMS_DATASOURCE_PASSWORD` - PostgreSQL password for the KMS database |
| 42 | +- `LOCAL_KMS_DATASOURCE_DB` - KMS database name |
| 43 | + |
| 44 | +### Application Configuration |
| 45 | +- `APP_KEY` - Application key for encryption |
| 46 | +- `KMS_PROVIDER` - Key Management Service provider configuration |
| 47 | +- `ROOT_IDENTIFIER` - Root identifier for the federation |
| 48 | +- `FEDERATION_HOSTS` - Host rules for the federation server |
| 49 | +- `FEDERATION_ADMIN_HOSTS` - Host rules for the admin server |
| 50 | +- `ADMIN_IP_WHITELIST` - Comma-separated list of IP ranges allowed to access the admin server |
| 51 | + |
| 52 | +## Deployment Steps |
| 53 | + |
| 54 | +1. Create required directories for persistent storage: |
| 55 | +```bash |
| 56 | +sudo mkdir -p /mnt/openid-federation/volumes/{postgres,local-kms} |
| 57 | +``` |
| 58 | + |
| 59 | +2. Copy deployment files to target system: |
| 60 | +```bash |
| 61 | +docker-compose.yaml |
| 62 | +config/ |
| 63 | +``` |
| 64 | + |
| 65 | +3. Start the services using Docker Compose: |
| 66 | +```bash |
| 67 | +docker-compose up -d |
| 68 | +``` |
| 69 | + |
| 70 | +## Service Architecture |
| 71 | + |
| 72 | +The deployment consists of the following services: |
| 73 | + |
| 74 | +- **db**: Main PostgreSQL database |
| 75 | +- **local-kms-db**: PostgreSQL database for the Key Management Service |
| 76 | +- **federation-server**: Main federation server service |
| 77 | +- **admin-server**: Administrative interface for the federation server |
| 78 | + |
| 79 | +### Networking |
| 80 | + |
| 81 | +The deployment uses two Docker networks: |
| 82 | +- `frontend`: For external communication (must be created manually) |
| 83 | +- `backend`: For internal service communication (automatically created) |
| 84 | + |
| 85 | +### Security |
| 86 | + |
| 87 | +- The admin server is protected by IP whitelisting through Traefik middleware |
| 88 | +- All services use TLS encryption through Traefik's ACME resolver |
| 89 | +- Database credentials are managed through environment variables |
| 90 | +- Persistent data is stored in volume mounts |
| 91 | + |
| 92 | +## Maintenance |
| 93 | + |
| 94 | +### Updating Services |
| 95 | + |
| 96 | +To update to the latest version of the services: |
| 97 | + |
| 98 | +```bash |
| 99 | +docker-compose pull |
| 100 | +docker-compose up -d |
| 101 | +``` |
| 102 | + |
| 103 | +### Logs |
| 104 | + |
| 105 | +To view service logs: |
| 106 | +```bash |
| 107 | +docker-compose logs -f [service-name] |
| 108 | +``` |
| 109 | + |
| 110 | +## Troubleshooting |
| 111 | + |
| 112 | +1. If database services fail to start, check: |
| 113 | + - Volume permissions |
| 114 | + - Available disk space |
| 115 | + - PostgreSQL port conflicts |
| 116 | + |
| 117 | +2. If servers fail to start, verify: |
| 118 | + - Database connectivity |
| 119 | + - Environment variable configuration |
| 120 | + - Network connectivity |
| 121 | + |
| 122 | +3. For admin server access issues: |
| 123 | + - Verify IP whitelist configuration |
| 124 | + - Check Traefik logs for middleware issues |
| 125 | + |
| 126 | +## Support |
| 127 | + |
| 128 | +For additional support or questions, please contact the Sphereon support team. |
0 commit comments