First commit

This commit is contained in:
2026-01-10 23:31:29 +01:00
commit dbe5c461b5
61 changed files with 10695 additions and 0 deletions

View File

@@ -0,0 +1,298 @@
---
name: container-infrastructure-ops
description: Maintains, troubleshoots, and optimizes containerized infrastructure using Docker, Docker Compose, Kubernetes, Helm, and CI/CD pipelines. Enables system stability, security, reproducibility, and clear technical execution. Use for deployment operations, container management, networking, storage, secrets management, monitoring, and infrastructure troubleshooting.
---
# Container Infrastructure Operations
Comprehensive skill for managing and maintaining software stacks hosted on containerized infrastructure.
## Core Capabilities
- **Docker & Docker Compose**: Service orchestration, container lifecycle, volume management, networking
- **Kubernetes & Helm**: Cluster operations, deployment manifests, package management, upgrades
- **CI/CD Pipelines**: GitLab CI, GitHub Actions, and runner configuration
- **Networking & Routing**: Reverse proxies (Traefik, nginx), TLS/HTTPS, service discovery
- **Storage & Data**: Volume mounting, backup/restore, database operations, data persistence
- **Security**: Secrets management, access control, network policies, RBAC
- **Monitoring & Logging**: Health checks, log aggregation, observability
- **Troubleshooting**: Container debugging, resource issues, log analysis, dependency resolution
## Operational Workflows
### 1. Service Startup & Deployment
**Docker Compose:**
```bash
# Start all services
docker compose up -d
# Start specific service
docker compose up -d [service_name]
# Build and start
docker compose up --build -d
# With environment file
docker compose --env-file .env up -d
```
**Kubernetes:**
```bash
# Apply manifest
kubectl apply -f deployment.yaml
# Rolling update
kubectl set image deployment/[name] [container]=[image]:[tag]
# Check rollout status
kubectl rollout status deployment/[name]
```
**Helm:**
```bash
# Install release
helm install [release-name] [chart] -f values.yaml
# Upgrade existing release
helm upgrade [release-name] [chart] -f values.yaml
# Rollback to previous version
helm rollback [release-name] [revision]
```
### 2. Service Inspection & Monitoring
**Docker Compose:**
```bash
# View running services
docker compose ps
# View logs (follow)
docker compose logs -f [service_name]
# View logs with time range
docker compose logs --since 10m [service_name]
# Inspect container stats
docker stats [container_id]
```
**Kubernetes:**
```bash
# List resources
kubectl get pods -n [namespace]
kubectl get svc -n [namespace]
# Describe resource (detailed info)
kubectl describe pod [pod_name] -n [namespace]
# View logs
kubectl logs [pod_name] -n [namespace]
kubectl logs -f [pod_name] -n [namespace] # Follow
# Watch resources in real-time
kubectl get pods -w -n [namespace]
```
### 3. Environment & Configuration Management
**Load environment variables:**
```bash
# From .env file
set -a
source .env
set +a
# Apply to specific command
env $(cat .env | xargs) docker compose up -d
```
**Manage secrets:**
```bash
# Docker Compose (from file)
docker secrets create [name] /path/to/secret
# Kubernetes
kubectl create secret generic [name] --from-file=key=/path/to/secret
kubectl create secret docker-registry [name] --docker-server=[url]
```
### 4. Troubleshooting Workflow
**Container health check:**
1. Verify container is running: `docker compose ps` or `kubectl get pods`
2. Check logs: `docker compose logs [service]` or `kubectl logs [pod]`
3. Inspect configuration: Check environment variables, mounted volumes, network connectivity
4. Test connectivity: `docker exec [container] curl [service]` or `kubectl exec [pod] -- curl [service]`
5. Resource analysis: `docker stats` or `kubectl top pods`
**Network troubleshooting:**
```bash
# Docker Compose
docker network ls
docker network inspect [network_name]
# Kubernetes
kubectl get networkpolicies -n [namespace]
kubectl describe networkpolicy [name] -n [namespace]
```
**Volume & storage issues:**
```bash
# Docker Compose
docker volume ls
docker volume inspect [volume_name]
# Kubernetes
kubectl get pv
kubectl get pvc -n [namespace]
kubectl describe pvc [name] -n [namespace]
```
### 5. Backup & Restore Operations
**Docker Compose volumes:**
```bash
# Backup volume
docker run --rm -v [volume]:/data -v $(pwd):/backup busybox tar czf /backup/backup.tar.gz -C /data .
# Restore volume
docker run --rm -v [volume]:/data -v $(pwd):/backup busybox tar xzf /backup/backup.tar.gz -C /data
```
**Database backup within containers:**
```bash
# PostgreSQL
docker compose exec [postgres_service] pg_dump -U [user] [db] > backup.sql
# MySQL/MariaDB
docker compose exec [mysql_service] mysqldump -u [user] -p [db] > backup.sql
```
### 6. Security & Access Control
**Docker security best practices:**
- Use read-only root filesystem: `read_only: true`
- Drop unnecessary capabilities: `cap_drop: [ALL]`
- Run as non-root user: `user: "1000:1000"`
- Use secrets for sensitive data (not environment variables)
**Kubernetes RBAC:**
```bash
# Create service account
kubectl create serviceaccount [name] -n [namespace]
# Bind role to account
kubectl create rolebinding [binding-name] --clusterrole=[role] --serviceaccount=[namespace]:[account]
```
## Debugging Strategies
**Container execution:**
```bash
# Docker Compose
docker compose exec [service] /bin/bash # Interactive shell
docker compose exec [service] ps aux # List processes
docker compose exec [service] env # View environment
# Kubernetes
kubectl exec -it [pod] -- /bin/bash
kubectl exec [pod] -- ps aux
```
**Log analysis:**
- Check application logs: `docker logs` or `kubectl logs`
- Check container startup logs: Look for early exit, missing dependencies, config errors
- Cross-reference with timestamps to correlate events across services
**Resource constraints:**
```bash
# Docker
docker inspect [container] | grep -A 10 Memory
# Kubernetes
kubectl top nodes
kubectl top pods -n [namespace]
```
## Configuration Best Practices
- **Immutable infrastructure**: Rebuild containers rather than modifying running instances
- **Health checks**: Define liveness and readiness probes
- **Resource limits**: Set CPU/memory requests and limits to prevent resource contention
- **Rolling updates**: Use rolling deployment strategies to maintain availability
- **Secrets separation**: Store secrets outside version control (use `.env`, K8s secrets, or secret managers)
- **Logging**: Aggregate logs centrally; avoid storing logs in containers
## Common Error Patterns
| Issue | Symptom | Troubleshooting |
|-------|---------|-----------------|
| Port conflict | `bind: address already in use` | Check existing process: `lsof -i :[port]`; Kill if needed |
| Missing dependency | Service fails to start | Check logs for missing service/network; Verify service startup order |
| Resource exhaustion | Slow/hanging containers | Check CPU/memory usage; Increase limits; Reduce replica count |
| Networking | Services can't communicate | Verify network name; Check firewall rules; Test DNS resolution |
| Volume mount | Permission denied in container | Verify mount path exists; Check file permissions; Confirm user ID |
| Config error | Parse/validation error at startup | Validate YAML syntax; Check environment variable substitution |
## File Structure Reference
**Docker Compose project:**
```
project/
├── docker-compose.yaml # Main orchestration
├── .env # Environment variables (secrets)
├── .env.example # Template (tracked in git)
├── config/ # Configuration files
│ ├── traefik.yml
│ └── app.config
└── data/ # Persistent volumes
├── db/
└── uploads/
```
**Kubernetes project:**
```
k8s/
├── manifests/ # YAML definitions
│ ├── deployment.yaml
│ ├── service.yaml
│ └── configmap.yaml
├── helm/ # Helm charts
│ └── [chart-name]/
├── kustomization.yaml # Kustomize overlays
└── secrets/ # Sealed/encrypted secrets
```
## Context-Specific Workflows
### Working with JMP Server
For jmp-server Docker Compose stack:
```bash
# View all services
docker compose ps
# Start specific service
docker compose up -d gitea # Or: bookstack, traefik, etc.
# View logs for troubleshooting
docker compose logs -f traefik
docker compose logs -f gitea
# Backup database
docker compose exec gitea-db pg_dump -U gitea gitea > gitea-backup.sql
# Restart service cleanly
docker compose restart gitea
```
## Actionable Execution
When troubleshooting or deploying:
1. State the objective clearly
2. Run targeted diagnostic commands
3. Report findings with specific evidence (logs, output, metrics)
4. Execute corrective actions with clear before/after confirmation
5. Document any configuration changes for reproducibility

86
.env.production.example Normal file
View File

@@ -0,0 +1,86 @@
# JMP Server Production Configuration Template
# Copy this to .env and fill in all values before deploying to server
# ===== DOMAIN & NETWORKING =====
DOMAIN=example.com
PUID=1000
PGID=1000
# ===== TRAEFIK =====
# Generate htpasswd hash: openssl passwd -apr1 admin
# Then set it as: TRAEFIK_BASICAUTH_USERS=admin:$apr1$...
TRAEFIK_BASICAUTH_USERS=admin:CHANGE_ME
# ===== GITEA =====
POSTGRES_USER_GITEA=gitea
POSTGRES_PASSWORD_GITEA=CHANGE_ME_STRONG_PASSWORD
POSTGRES_NAME_GITEA=gitea
POSTGRES_HOST_GITEA=gitea-db
GITEA_INSTANCE_URL=https://gitea.example.com
GITEA_RUNNER_REGISTRATION_TOKEN=CHANGE_ME
GITEA_RUNNER_NAME=runner-1
GITEA_RUNNER_LABELS=docker:docker
# ===== BOOKSTACK =====
MYSQL_USER_BOOKSTACK=bookstack
MYSQL_PASSWORD_BOOKSTACK=CHANGE_ME_STRONG_PASSWORD
MYSQL_NAME_BOOKSTACK=bookstack
MYSQL_HOST_BOOKSTACK=bookstack-db
MYSQL_PORT_BOOKSTACK=3306
MYSQL_TZ_BOOKSTACK=UTC
BOOKSTACK_APP_URL=https://bookstack.example.com
BOOKSTACK_APP_KEY=CHANGE_ME_32_CHAR_KEY_________________
# ===== VIKUNJA =====
POSTGRES_USER_VIKUNJA=vikunja
POSTGRES_PASSWORD_VIKUNJA=CHANGE_ME_STRONG_PASSWORD
POSTGRES_NAME_VIKUNJA=vikunja
VIKUNJA_JWT_SECRET=CHANGE_ME_SECURE_JWT_SECRET
# ===== VAULTWARDEN =====
VAULTWARDEN_ADMIN_TOKEN=CHANGE_ME_ADMIN_TOKEN
VAULTWARDEN_SIGNUPS_ALLOWED=false
# ===== OPENCLOUD =====
OC_DOMAIN=cloud.example.com
OC_DOCKER_IMAGE=opencloudeu/opencloud-rolling
OC_DOCKER_TAG=latest
OC_CONTAINER_UID_GID=1000:1000
OC_CONFIG_DIR=./opencloud-compose/config
OC_DATA_DIR=./opencloud-compose/data
INITIAL_ADMIN_PASSWORD=CHANGE_ME_STRONG_PASSWORD
DEMO_USERS=false
CHECK_FOR_UPDATES=true
INSECURE=false
# OpenCloud SMTP (optional)
SMTP_HOST=
SMTP_PORT=587
SMTP_SENDER=
SMTP_USERNAME=
SMTP_PASSWORD=
SMTP_INSECURE=false
SMTP_AUTHENTICATION=PLAIN
SMTP_TRANSPORT_ENCRYPTION=tls
# OpenCloud Sharing Policies
OC_SHARING_PUBLIC_SHARE_MUST_HAVE_PASSWORD=true
OC_SHARING_PUBLIC_WRITEABLE_SHARE_MUST_HAVE_PASSWORD=true
OC_PASSWORD_POLICY_DISABLED=false
OC_PASSWORD_POLICY_MIN_CHARACTERS=8
OC_PASSWORD_POLICY_MIN_LOWERCASE_CHARACTERS=1
OC_PASSWORD_POLICY_MIN_UPPERCASE_CHARACTERS=1
OC_PASSWORD_POLICY_MIN_DIGITS=1
OC_PASSWORD_POLICY_MIN_SPECIAL_CHARACTERS=1
# ===== BACKUP =====
# See backup.env for backup-specific configuration
# ===== LOGGING =====
# Default: json-file (recommended for production)
LOG_DRIVER=json-file
LOG_LEVEL=info
START_ADDITIONAL_SERVICES=

13
.gitignore vendored Normal file
View File

@@ -0,0 +1,13 @@
bookstack/
gitea/
homepage/
logs/
runner-data/
vikunja/
radicale/
backups/
restore-temp/
vaultwarden/
actual-data/
.env

37
AGENTS.md Normal file
View File

@@ -0,0 +1,37 @@
# AGENTS.md - JMP Server Infrastructure
## Project Overview
JMP Server is a Docker Compose-based infrastructure deployment for self-hosted services. It contains a reverse proxy, Git repository hosting, documentation platform, and cloud storage.
## Architecture & Services
- **Traefik**: Reverse proxy and load balancer (v3.6.6), handles routing and HTTPS/TLS
- **Gitea**: Git repository hosting with PostgreSQL backend and CI/CD runner support
- **Bookstack**: Documentation wiki with MariaDB backend
- **Homepage**: Dashboard for service discovery and monitoring
- **OpenCloud**: Nextcloud-based cloud storage with full compose stack included
- **Website**: Frontend web application (in `after` profile)
## Build & Deployment Commands
- Start all services: `./start.sh` or `docker compose up -d`
- Stop all services: `./stop.sh` or `docker compose down`
- Start OpenCloud only: `docker compose -f opencloud-compose/docker-compose.yml up -d`
- View logs: `docker compose logs -f [service_name]`
## Key Configuration Files
- `docker-compose.yaml`: Main service definitions with Docker networking
- `.env`: Environment variables (secrets not tracked)
- `config.yml`: Gitea runner configuration
- `traefik.yml`: Traefik routing and middleware setup
- `opencloud-compose/.env.example`: OpenCloud environment template
## Important Databases
- **Gitea DB**: PostgreSQL (port internal)
- **Bookstack DB**: MariaDB (port internal)
- All databases stored in local volume mounts (`./gitea/db`, `./bookstack/db`, `./opencloud/data`)
## Code Style & Conventions
- Infrastructure-as-Code in YAML
- Docker container configuration via environment variables
- Traefik labels for service discovery and routing rules
- Use `${VARIABLE}` syntax for .env substitution
- Homepage labels for dashboard integration

232
PRODUCTION_DEPLOYMENT.md Normal file
View File

@@ -0,0 +1,232 @@
# Production Deployment Guide
This document outlines the changes made to prepare JMP Server for production deployment on a server.
## Key Changes Summary
### 1. **Removed Direct Port Exposures**
- Removed direct port mappings for:
- `homepage:3001` (was exposing internal port)
- `bookstack:6875` (was exposing internal port)
- `actual_server:5006` (was exposing internal port)
- All services now route exclusively through Traefik reverse proxy
- Only SSH port `2222` (Gitea) exposed directly for Git operations
### 2. **Resource Limits & Reservations**
All containers now have CPU and memory limits:
- **Traefik**: 2 CPU / 512M limit, 0.5 CPU / 256M reserved
- **Gitea**: 2 CPU / 1G limit, 1 CPU / 512M reserved
- **Gitea Runner**: 4 CPU / 2G limit (for CI/CD workloads)
- **Bookstack**: 2 CPU / 512M limit, 1 CPU / 256M reserved
- **Databases**: 2 CPU / 1G limit, 1 CPU / 512M reserved
- **OpenCloud**: 4 CPU / 4G limit, 2 CPU / 2G reserved
Adjust these based on your server's available resources.
### 3. **Health Checks**
All services now include health checks:
- **Databases**: `pg_isready` or `mysqladmin ping` checks
- **Web services**: HTTP endpoint checks
- Service dependencies now use `condition: service_healthy` instead of just `depends_on`
This ensures proper startup ordering and service reliability.
### 4. **Log Rotation**
Configured JSON file logging with rotation:
- Max file size: 50-100MB per log file
- Max files retained: 3-5 files
- Prevents logs from filling disk
### 5. **Traefik Authentication**
- **Before**: Had invalid placeholder `$$apr1$$...`
- **After**: Uses environment variable `${TRAEFIK_BASICAUTH_USERS}`
**Generate credentials:**
```bash
openssl passwd -apr1 admin
# Output: $apr1$r61.qW2G$Lc3uT7c5p...
```
Set in `.env`:
```
TRAEFIK_BASICAUTH_USERS=admin:$apr1$r61.qW2G$Lc3uT7c5p...
```
### 6. **Database Restart Policies**
- **Databases**: Changed to `restart: always` (critical services)
- **Applications**: Keep `restart: unless-stopped` (graceful restart handling)
### 7. **OpenCloud Network Configuration**
Fixed network issues for OpenCloud:
- Explicitly declared `proxy_net` as external in opencloud-compose
- Added network driver specification
- Prevents network conflicts when deploying separately
### 8. **Container Dependencies**
Updated all service dependencies to use health conditions:
```yaml
depends_on:
gitea-db:
condition: service_healthy
```
This ensures services wait for databases to be healthy before starting.
### 9. **Actual Server Configuration**
- Removed direct port exposure `5006:5006`
- Fixed Traefik loadbalancer port (was `5232`, now `5006`)
- Added to `proxy_net` network
- Added health check
## Environment Variables
### Required Changes for Production
Copy `.env.production.example` to `.env` and update:
1. **DOMAIN**: Your actual domain name
2. **TRAEFIK_BASICAUTH_USERS**: Generated htpasswd hash
3. **All database passwords**: Strong, random passwords
4. **API keys & tokens**: Generate new secure values
5. **OpenCloud settings**: Domain and admin password
### Sensitive Variables
These should **never** be committed to git:
- All `*PASSWORD*` variables
- `*TOKEN*` variables
- `*SECRET*` variables
- `APP_KEY` values
Keep `.env` in `.gitignore` and use `.env.production.example` as template.
## Pre-Deployment Checklist
- [ ] Copy `.env.production.example` to `.env`
- [ ] Generate Traefik basicauth credentials with `openssl passwd -apr1`
- [ ] Set all database passwords (random, 16+ characters)
- [ ] Generate API tokens (Gitea runner, Vaultwarden admin, etc.)
- [ ] Configure domain in `.env` (DOMAIN variable)
- [ ] Review resource limits for your server capacity
- [ ] Ensure backup storage path is accessible (`./backups/`)
- [ ] Verify SSL/TLS certificates will work (Let's Encrypt requirements)
## Deployment Steps
1. **Prepare server**:
```bash
mkdir -p ~/jmp-server
cd ~/jmp-server
# Copy all files here
```
2. **Configure environment**:
```bash
cp .env.production.example .env
# Edit .env with your values
```
3. **Start services**:
```bash
./start.sh
# or: docker compose up -d
```
4. **Verify health**:
```bash
docker compose ps
# Check all services are "Up" and health checks pass
docker compose logs -f traefik
# Watch for ACME certificate provisioning
```
5. **Test routing**:
```bash
curl https://traefik.${DOMAIN}/
curl https://gitea.${DOMAIN}/
curl https://bookstack.${DOMAIN}/
```
## Monitoring & Maintenance
### View Service Status
```bash
docker compose ps
docker compose stats
```
### Check Health
```bash
docker compose exec gitea-db pg_isready -h localhost -U ${POSTGRES_USER_GITEA}
docker compose exec bookstack-db mysqladmin ping -h localhost -u root -p${MYSQL_PASSWORD_BOOKSTACK}
```
### View Logs
```bash
# Traefik routing
docker compose logs -f traefik
# Gitea
docker compose logs -f gitea
# Backup status
docker compose logs -f backup
```
### Backup Management
Backups are automated (see `backup.env`). Stored in `./backups/`.
## Security Considerations
1. **Firewall**: Only expose ports 80, 443, and 2222 (SSH) to internet
2. **HTTPS**: Let's Encrypt certificates auto-renewed by Traefik
3. **Database access**: Internal networks prevent direct DB access
4. **Secrets**: Never store passwords in compose files; use `.env` only
5. **Log retention**: Configure log rotation in Docker daemon or use central logging
6. **Backups**: Store backups on separate storage/cloud
## Troubleshooting
### Service won't start
```bash
docker compose logs -f [service_name]
# Check: Missing dependencies, failed health checks, port conflicts
```
### Services can't communicate
```bash
docker network ls
docker network inspect proxy_net
# Verify all services are on correct networks
```
### Traefik routing issues
```bash
docker compose exec traefik traefik api dashboard
# Check router/service configurations
```
### Memory/CPU pressure
```bash
docker compose stats
# Review resource limits in docker-compose.yaml
# Adjust based on actual usage
```
## Resource Recommendations
For a typical small server (4GB RAM, 2 CPU):
- **Gitea + Runner**: 3G RAM, 2.5 CPU
- **OpenCloud**: 2G RAM, 2 CPU
- **Other services**: 1G RAM, 1.5 CPU
- **Total**: ~6G RAM recommended, 6 CPU recommended
Adjust limits down if server is smaller, test under load for your workload.
## Next Steps
1. Configure OpenCloud separately if needed: `docker compose -f opencloud-compose/docker-compose.yml up -d`
2. Set up external backup storage for production data protection
3. Configure monitoring/alerting (optional external monitoring)
4. Document your domain names and admin credentials securely

392
README.md Normal file
View File

@@ -0,0 +1,392 @@
# JMP Server Infrastructure
Docker Compose-based infrastructure deployment for self-hosted services.
## Prerequisites
- Docker and Docker Compose installed
- A domain with DNS records pointing to your server
- Ports 80, 443, and 2222 (SSH for Gitea) open
## Quick Start
1. Create the `.env` file with required variables (see Environment Variables section)
2. Set up ACME storage: `touch acme.json && chmod 600 acme.json`
3. Start services: `./start.sh` or `docker compose up -d`
4. Stop services: `./stop.sh` or `docker compose down`
## Environment Variables
Create a `.env` file in the project root with the following variables:
```bash
# General
DOMAIN=yourdomain.com
PUID=1000
PGID=1000
# Gitea Database
POSTGRES_HOST_GITEA=gitea-db
POSTGRES_NAME_GITEA=gitea
POSTGRES_USER_GITEA=gitea
POSTGRES_PASSWORD_GITEA=<SECURE_PASSWORD>
# Gitea Runner
GITEA_INSTANCE_URL=https://gitea.yourdomain.com
GITEA_RUNNER_REGISTRATION_TOKEN=<TOKEN_FROM_GITEA>
GITEA_RUNNER_NAME=runner-1
GITEA_RUNNER_LABELS=ubuntu-latest:docker://node:16-bullseye
# Bookstack Database
MYSQL_HOST_BOOKSTACK=bookstack-db
MYSQL_PORT_BOOKSTACK=3306
MYSQL_NAME_BOOKSTACK=bookstack
MYSQL_USER_BOOKSTACK=bookstack
MYSQL_PASSWORD_BOOKSTACK=<SECURE_PASSWORD>
MYSQL_TZ_BOOKSTACK=Europe/Rome
# Bookstack App
BOOKSTACK_APP_URL=https://bookstack.yourdomain.com
BOOKSTACK_APP_KEY=<GENERATED_KEY>
# Vikunja
POSTGRES_NAME_VIKUNJA=vikunja
POSTGRES_USER_VIKUNJA=vikunja
POSTGRES_PASSWORD_VIKUNJA=<SECURE_PASSWORD>
VIKUNJA_JWT_SECRET=<RANDOM_SECRET>
```
---
## Traefik
Reverse proxy and load balancer handling routing and HTTPS/TLS via Let's Encrypt.
**URL:** `https://traefik.YOUR_DOMAIN`
### Setup
1. Create the ACME storage file:
```bash
touch acme.json && chmod 600 acme.json
```
2. Update the dashboard Basic Auth in `docker-compose.yaml`:
```bash
# Generate a password hash
echo $(htpasswd -nB admin) | sed -e s/\\$/\\$\\$/g
```
Replace the `traefik.http.middlewares.auth.basicauth.users` label value.
3. Update the ACME email in `traefik.yml` (line 54).
---
## Gitea
Git repository hosting with PostgreSQL backend and CI/CD runner support.
**URL:** `https://gitea.YOUR_DOMAIN`
**SSH:** `ssh://git@YOUR_DOMAIN:2222`
### Setup
1. Set the database environment variables in `.env`
2. Start the services
3. Access the web interface to complete initial setup
4. Create the first admin user
### Admin
User registration is disabled by default.
Use admin user to add new users from web UI
### Gitea Runner
To enable CI/CD:
1. In Gitea, go to **Site Administration → Actions → Runners**
2. Click **Create new Runner** and copy the registration token
3. Set `GITEA_RUNNER_REGISTRATION_TOKEN` in `.env`
4. Restart the runner container
---
## Bookstack
Documentation wiki with MariaDB backend.
**URL:** `https://bookstack.YOUR_DOMAIN`
### Setup
1. Generate an APP_KEY:
```bash
docker run -it --rm --entrypoint /bin/bash lscr.io/linuxserver/bookstack:latest appkey
```
2. Add the key to `BOOKSTACK_APP_KEY` in `.env`
3. Set database environment variables in `.env`
4. Start the services
### First Login
- **Email:** admin@admin.com
- **Password:** password
*Change these immediately after first login.*
### Restore Backup From Different Url
Run a shell in bookstack container. For Example
```
docker exec -it bookstack-container sh
```
Then:
```
php artisan bookstack:update-url https://docs.jmpgames.it https://bookstack.jmpgames.it
php artisan migrate
```
---
## Homepage
Dashboard for service discovery and monitoring.
**URL:** `https://home.YOUR_DOMAIN` (or `http://localhost:3001`)
### Setup
A `homepage/` directory is created after first boot containing configuration files.
To enable Docker container auto-detection, edit `homepage/docker.yaml`:
```yaml
my-docker:
socket: /var/run/docker.sock
```
Services with `homepage.*` labels in `docker-compose.yaml` will appear automatically.
---
## Vikunja
Task management and to-do lists with PostgreSQL backend.
**URL:** `https://vikunja.YOUR_DOMAIN`
### Setup
1. Set the database environment variables in `.env`
2. Generate a random JWT secret:
```bash
openssl rand -base64 32
```
3. Set `VIKUNJA_JWT_SECRET` in `.env`
4. Start the services
5. Register the first user (becomes admin)
### Admin
Web UI user registration is disabled.
To add new user:
```
# Example for Docker
docker exec vikunja /app/vikunja/vikunja user create -u "newuser" -e "user@example.com" -p "your_password"
```
To delete a user:
```
# Example for Docker
docker exec vikunja /app/vikunja/vikunja user list # Get user id
docker exec -it vikunja /app/vikunja/vikunja user delete <id> -n
```
---
## Radicale
CalDAV and CardDAV server for calendars and contacts sync.
**URL:** `https://radicale.YOUR_DOMAIN`
### Setup
1. Create the users file:
```bash
touch radicale/config/users
```
2. Add users with bcrypt passwords:
```bash
htpasswd -Bc /dev/stdout USERNAME
```
3. Append the output to `radicale/config/users`:
```
username:$2y$05$...
```
### Client Configuration
Use the following URL for CalDAV/CardDAV clients:
```
https://radicale.YOUR_DOMAIN/USERNAME/
```
**Supported clients:** Thunderbird, DAVx5 (Android), iOS Calendar/Contacts, Evolution, GNOME Calendar.
---
## OpenCloud
Nextcloud-based cloud storage platform.
**URL:** `https://opencloud.YOUR_DOMAIN`
### Setup
1. Navigate to the OpenCloud compose directory:
```bash
cd opencloud-compose
```
2. Create the environment file:
```bash
cp .env.example .env
```
3. Edit `.env` with required settings:
```bash
INSECURE=true
OC_DOCKER_IMAGE=opencloudeu/opencloud-rolling
OC_DOMAIN=opencloud.yourdomain.com
INITIAL_ADMIN_PASSWORD=<SECURE_PASSWORD>
LOG_PRETTY=true
OC_CONFIG_DIR=./opencloud/config
OC_DATA_DIR=./opencloud/data
```
4. Create data directories:
```bash
mkdir -p opencloud/{config,data}
chown -R 1000:1000 opencloud
```
5. For external proxy setup (using the main Traefik), set:
```bash
COMPOSE_FILE=docker-compose.yml:external-proxy/opencloud.yml
```
6. Start OpenCloud:
```bash
docker compose up -d
```
### References
- [Behind External Proxy](https://github.com/opencloud-eu/opencloud-compose?tab=readme-ov-file#behind-external-proxy)
- [GitHub Discussion](https://github.com/orgs/opencloud-eu/discussions/533)
---
## Website
Frontend web application (requires Gitea registry access).
**URL:** `https://YOUR_DOMAIN`
### Setup
The website service is in the `after` profile and requires the container image to be built and pushed to the Gitea registry first.
Start with:
```bash
docker compose --profile after up -d
```
---
## Backup & Restore
Automated cold backups using [docker-volume-backup](https://github.com/offen/docker-volume-backup).
### How It Works
- **Daily backups** at 3:00 AM (configurable in `backup.env`)
- **Cold backups**: Database containers are stopped during backup to ensure data consistency
- **Retention**: Backups older than 7 days are automatically deleted
- **Storage**: Local backups in `./backups/` (optionally to S3/SSH/WebDAV)
### Backed Up Data
| Service | Data |
|---------|------|
| Gitea | Application data + PostgreSQL database |
| Bookstack | Application data + MariaDB database |
| Vikunja | Files + PostgreSQL database |
| Radicale | CalDAV/CardDAV data |
| Homepage | Dashboard configuration |
### Manual Backup
```bash
./backup.sh
```
### Restore from Backup
```bash
# List available backups
./restore.sh
# Restore specific backup
./restore.sh backup-2025-01-05T03-00-00.tar.gz
```
### Configuration
Edit `backup.env` to configure:
- **Schedule**: `BACKUP_CRON_EXPRESSION` (default: daily at 3 AM)
- **Retention**: `BACKUP_RETENTION_DAYS` (default: 7 days)
- **Encryption**: Uncomment `GPG_PASSPHRASE` for encrypted backups
- **Remote storage**: Configure S3, SSH, or WebDAV for offsite backups
- **Notifications**: Configure Discord, Slack, or email alerts
### Remote Backup (S3 Example)
Add to `backup.env`:
```bash
AWS_S3_BUCKET_NAME=your-bucket
AWS_S3_PATH=jmp-server
AWS_ACCESS_KEY_ID=your-key
AWS_SECRET_ACCESS_KEY=your-secret
AWS_ENDPOINT=s3.amazonaws.com
```
### View Backup Logs
```bash
docker compose logs -f backup
```
---
## Logs
Access logs are stored in `./logs/traefik/` for Fail2Ban integration.
View service logs:
```bash
docker compose logs -f [service_name]
```

100
acme.json Normal file

File diff suppressed because one or more lines are too long

64
backup.env Normal file
View File

@@ -0,0 +1,64 @@
# Backup Configuration for docker-volume-backup
# Documentation: https://offen.github.io/docker-volume-backup/reference/
# --- SCHEDULE ---
# Backup runs daily at 3:00 AM (cron format)
BACKUP_CRON_EXPRESSION=0 3 * * *
# --- BACKUP NAMING ---
# Backup filename pattern (timestamp format)
BACKUP_FILENAME=backup-%Y-%m-%dT%H-%M-%S.tar.gz
# --- RETENTION ---
# Keep backups for 7 days locally
BACKUP_RETENTION_DAYS=7
# --- COMPRESSION ---
# Use gzip compression (options: gz, zst)
BACKUP_COMPRESSION=gz
# --- STOP CONTAINERS ---
# Timeout for stopping containers (in seconds)
BACKUP_STOP_CONTAINER_TIMEOUT=30
# --- LOCAL ARCHIVE ---
# Backups are stored in /archive (mounted from ./backups)
BACKUP_ARCHIVE=/archive
# --- ENCRYPTION (optional) ---
# Uncomment and set a passphrase to enable GPG encryption
# GPG_PASSPHRASE=your-secure-passphrase
# --- S3 REMOTE BACKUP (optional) ---
# Uncomment to enable S3/MinIO backup target
# AWS_S3_BUCKET_NAME=your-bucket-name
# AWS_S3_PATH=jmp-server
# AWS_ACCESS_KEY_ID=your-access-key
# AWS_SECRET_ACCESS_KEY=your-secret-key
# AWS_ENDPOINT=s3.amazonaws.com
# AWS_ENDPOINT_PROTO=https
# --- SSH REMOTE BACKUP (optional) ---
# Uncomment to enable SSH/SFTP backup target
# SSH_HOST_NAME=backup.example.com
# SSH_PORT=22
# SSH_USER=backup
# SSH_REMOTE_PATH=/backups/jmp-server
# SSH_IDENTITY_FILE=/root/.ssh/id_rsa
# --- NOTIFICATIONS (optional) ---
# Email notification on backup failure
# NOTIFICATION_URLS=smtp://user:password@smtp.example.com:587/?from=backup@example.com&to=admin@example.com
# Discord webhook notification
# NOTIFICATION_URLS=discord://token@channel
# Notification level: error, info (default: error)
# NOTIFICATION_LEVEL=error
# --- EXEC LABELS (optional) ---
# Run commands inside containers before/after backup
# Example: dump database before backup
# Use labels on containers:
# docker-volume-backup.exec-pre=/bin/sh -c 'pg_dump -U $POSTGRES_USER $POSTGRES_DB > /backup.sql'
# docker-volume-backup.exec-post=/bin/sh -c 'rm /backup.sql'

32
backup.sh Executable file
View File

@@ -0,0 +1,32 @@
#!/bin/bash
# Manual backup trigger script
# This script triggers an immediate backup outside of the scheduled cron
set -e
set -u
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"
echo "=== JMP Server Backup ==="
echo "Starting manual backup at $(date)"
echo ""
# Validate backup container is running
if ! docker compose ps backup 2>/dev/null | grep -q "backup"; then
echo "Error: backup service is not running. Start services with ./start.sh"
exit 1
fi
# Run one-off backup using the backup container
docker compose exec backup backup || {
echo "Error: Backup execution failed"
exit 1
}
echo ""
echo "Backup completed at $(date)"
echo "Backups stored in: $SCRIPT_DIR/backups/"
echo ""
echo "Recent backups:"
ls -lah "$SCRIPT_DIR/backups/" | grep -E "backup-.*\.tar\.gz" | tail -5 || echo "No backups found"

2
config.yml Normal file
View File

@@ -0,0 +1,2 @@
container:
network: proxy_net

607
docker-compose.yaml Normal file
View File

@@ -0,0 +1,607 @@
networks:
proxy_net:
name: proxy_net
driver: bridge
gitea_backend:
internal: true
bookstack_backend:
internal: true
vikunja_backend:
internal: true
services:
# --- BACKUP ---
backup:
image: offen/docker-volume-backup:v2
container_name: backup
restart: unless-stopped
env_file: ./backup.env
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
# Backup sources (read-only)
- ./gitea/data:/backup/gitea-data:ro
- ./gitea/db:/backup/gitea-db:ro
- ./bookstack/app:/backup/bookstack-app:ro
- ./bookstack/db:/backup/bookstack-db:ro
- ./vikunja/files:/backup/vikunja-files:ro
- ./vikunja/db:/backup/vikunja-db:ro
- ./radicale/data:/backup/radicale-data:ro
- ./vaultwarden/data:/backup/vaultwarden-data:ro
- ./homepage:/backup/homepage:ro
- ./actual-data:/backup/actual:ro
# Local backup archive
- ./backups:/archive
deploy:
resources:
limits:
cpus: '2'
memory: 2G
reservations:
cpus: '1'
memory: 1G
logging:
driver: "json-file"
options:
max-size: "100m"
max-file: "5"
labels:
- "homepage.group=Infrastructure"
- "homepage.name=Backup"
- "homepage.icon=duplicati.png"
- "homepage.description=Volume Backup Service"
traefik:
image: traefik:v3.6.6
container_name: traefik
restart: unless-stopped
command:
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
ports:
- "80:80"
- "443:443"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./traefik.yml:/etc/traefik/traefik.yml
- ./acme.json:/acme.json
- ./logs/traefik:/var/log/traefik # Logs for Fail2Ban
networks:
- proxy_net
deploy:
resources:
limits:
cpus: '2'
memory: 512M
reservations:
cpus: '0.5'
memory: 256M
healthcheck:
test: ["CMD", "traefik", "healthcheck", "--ping"]
interval: 30s
timeout: 10s
retries: 3
start_period: 20s
logging:
driver: "json-file"
options:
max-size: "100m"
max-file: "5"
labels:
- "traefik.enable=true"
- "traefik.http.routers.dashboard.rule=Host(`traefik.${DOMAIN}`)"
- "traefik.http.routers.dashboard.service=api@internal"
- "traefik.http.routers.dashboard.middlewares=auth"
# IMPORTANT: Replace with actual htpasswd hash or set via environment variable
- "traefik.http.middlewares.auth.basicauth.users=${TRAEFIK_BASICAUTH_USERS}"
# Homepage Monitoring
- "homepage.group=Infrastructure"
- "homepage.name=Traefik"
- "homepage.icon=traefik.png"
- "homepage.href=https://traefik.${DOMAIN}"
homepage:
image: ghcr.io/gethomepage/homepage:latest
container_name: homepage
restart: unless-stopped
volumes:
- ./homepage:/app/config
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
HOMEPAGE_ALLOWED_HOSTS: "*"
PUID: ${PUID}
PGID: 988
networks:
- proxy_net
deploy:
resources:
limits:
cpus: '1'
memory: 256M
reservations:
cpus: '0.25'
memory: 128M
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:3000/"]
interval: 30s
timeout: 10s
retries: 3
start_period: 20s
logging:
driver: "json-file"
options:
max-size: "50m"
max-file: "3"
labels:
- "traefik.enable=true"
- "traefik.http.routers.homepage.rule=Host(`homepage.${DOMAIN}`)"
- "traefik.http.routers.homepage.entrypoints=websecure"
- "traefik.http.routers.homepage.tls.certresolver=letsencrypt"
- "traefik.http.services.homepage.loadbalancer.server.port=3000"
- "traefik.docker.network=proxy_net"
# --- GITEA ---
gitea-db:
image: postgres:14-alpine
container_name: gitea-db
restart: always
environment:
POSTGRES_USER: ${POSTGRES_USER_GITEA}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD_GITEA}
POSTGRES_DB: ${POSTGRES_NAME_GITEA}
networks:
- gitea_backend
volumes:
- ./gitea/db:/var/lib/postgresql/data
deploy:
resources:
limits:
cpus: '2'
memory: 1G
reservations:
cpus: '1'
memory: 512M
healthcheck:
test: ["CMD-SHELL", "pg_isready -h localhost -U ${POSTGRES_USER_GITEA}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
logging:
driver: "json-file"
options:
max-size: "50m"
max-file: "3"
labels:
- "docker-volume-backup.stop-during-backup=true"
gitea:
image: gitea/gitea:latest
container_name: gitea
restart: unless-stopped
environment:
- USER_UID=${PUID}
- USER_GID=${PGID}
- GITEA__database__DB_TYPE=postgres
- GITEA__database__HOST=${POSTGRES_HOST_GITEA}
- GITEA__database__NAME=${POSTGRES_NAME_GITEA}
- GITEA__database__USER=${POSTGRES_USER_GITEA}
- GITEA__database__PASSWD=${POSTGRES_PASSWORD_GITEA}
- GITEA__server__DOMAIN=gitea.${DOMAIN}
- GITEA__server__SSH_PORT=2222
- GITEA__server__ROOT_URL=https://gitea.${DOMAIN}/
- GITEA__actions__ENABLED=true
- GITEA__service__DISABLE_REGISTRATION=true
ports:
- "2222:22"
volumes:
- ./gitea/data:/data
networks:
- proxy_net
- gitea_backend
depends_on:
gitea-db:
condition: service_healthy
deploy:
resources:
limits:
cpus: '2'
memory: 1G
reservations:
cpus: '1'
memory: 512M
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
logging:
driver: "json-file"
options:
max-size: "50m"
max-file: "3"
labels:
- "traefik.enable=true"
- "traefik.http.routers.gitea.rule=Host(`gitea.${DOMAIN}`)"
- "traefik.http.routers.gitea.entrypoints=websecure"
- "traefik.http.routers.gitea.tls.certresolver=letsencrypt"
- "traefik.http.services.gitea.loadbalancer.server.port=3000"
- "homepage.group=Dev"
- "homepage.name=Gitea"
- "homepage.icon=gitea.png"
- "homepage.href=https://gitea.${DOMAIN}"
- "docker-volume-backup.stop-during-backup=true"
gitea-runner:
image: gitea/act_runner:latest
container_name: gitea-runner
restart: unless-stopped
environment:
CONFIG_FILE: /config.yml
GITEA_INSTANCE_URL: "${GITEA_INSTANCE_URL}"
GITEA_RUNNER_REGISTRATION_TOKEN: "${GITEA_RUNNER_REGISTRATION_TOKEN}"
GITEA_RUNNER_NAME: "${GITEA_RUNNER_NAME}"
GITEA_RUNNER_LABELS: "${GITEA_RUNNER_LABELS}"
volumes:
- ./runner-data:/data
- ./config.yml:/config.yml
- /var/run/docker.sock:/var/run/docker.sock
networks:
- proxy_net
depends_on:
gitea:
condition: service_healthy
deploy:
resources:
limits:
cpus: '4'
memory: 2G
reservations:
cpus: '2'
memory: 1G
logging:
driver: "json-file"
options:
max-size: "50m"
max-file: "3"
labels:
- "homepage.group=Dev"
- "homepage.icon=gitea.png"
- "homepage.name=Gitea Runner"
- "homepage.description=CI/CD Worker"
# --- BOOKSTACK ---
bookstack-db:
image: lscr.io/linuxserver/mariadb:latest
container_name: bookstack-db
restart: always
environment:
- PUID=${PUID}
- PGID=${PGID}
- TZ=${MYSQL_TZ_BOOKSTACK}
- MYSQL_ROOT_PASSWORD=${MYSQL_PASSWORD_BOOKSTACK}
- MYSQL_DATABASE=${MYSQL_NAME_BOOKSTACK}
- MYSQL_USER=${MYSQL_USER_BOOKSTACK}
- MYSQL_PASSWORD=${MYSQL_PASSWORD_BOOKSTACK}
networks:
- bookstack_backend
volumes:
- ./bookstack/db:/config
deploy:
resources:
limits:
cpus: '2'
memory: 1G
reservations:
cpus: '1'
memory: 512M
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p${MYSQL_PASSWORD_BOOKSTACK}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
logging:
driver: "json-file"
options:
max-size: "50m"
max-file: "3"
labels:
- "docker-volume-backup.stop-during-backup=true"
bookstack:
image: lscr.io/linuxserver/bookstack:latest
container_name: bookstack
restart: unless-stopped
environment:
- PUID=${PUID}
- PGID=${PGID}
- DB_HOST=${MYSQL_HOST_BOOKSTACK}
- DB_PORT=${MYSQL_PORT_BOOKSTACK}
- DB_USERNAME=${MYSQL_USER_BOOKSTACK}
- DB_PASSWORD=${MYSQL_PASSWORD_BOOKSTACK}
- DB_DATABASE=${MYSQL_NAME_BOOKSTACK}
- APP_URL=${BOOKSTACK_APP_URL}
- APP_ASSET_URL=${BOOKSTACK_APP_URL}
- APP_KEY=${BOOKSTACK_APP_KEY}
volumes:
- ./bookstack/app:/config
networks:
- proxy_net
- bookstack_backend
depends_on:
bookstack-db:
condition: service_healthy
deploy:
resources:
limits:
cpus: '2'
memory: 512M
reservations:
cpus: '1'
memory: 256M
# Note: Bookstack uses LS.IO init system with process supervision
# Health check disabled - container runs well under init supervision
logging:
driver: "json-file"
options:
max-size: "50m"
max-file: "3"
labels:
- "traefik.enable=true"
- "traefik.http.routers.bookstack.rule=Host(`bookstack.${DOMAIN}`)"
- "traefik.http.routers.bookstack.entrypoints=websecure"
- "traefik.http.routers.bookstack.tls.certresolver=letsencrypt"
- "traefik.http.services.bookstack.loadbalancer.server.port=80"
- "traefik.docker.network=proxy_net"
- "homepage.group=Dev"
- "homepage.name=Bookstack"
- "homepage.icon=bookstack.png"
- "homepage.href=https://bookstack.${DOMAIN}"
- "docker-volume-backup.stop-during-backup=true"
# --- WEBSITE ---
website:
image: gitea.jmpgames.it/admin/website:latest
container_name: website
profiles: ["after"]
restart: unless-stopped
networks:
- proxy_net
deploy:
resources:
limits:
cpus: '1'
memory: 256M
reservations:
cpus: '0.5'
memory: 128M
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:80/"]
interval: 30s
timeout: 10s
retries: 3
start_period: 20s
logging:
driver: "json-file"
options:
max-size: "50m"
max-file: "3"
labels:
- "traefik.enable=true"
- "traefik.http.routers.website.rule=Host(`${DOMAIN}`) || Host(`www.${DOMAIN}`)"
- "traefik.http.routers.website.entrypoints=websecure"
- "traefik.http.routers.website.tls.certresolver=letsencrypt"
- "traefik.http.services.website.loadbalancer.server.port=80"
- "homepage.group=Public"
- "homepage.name=Website"
- "homepage.href=https://${DOMAIN}"
# --- VIKUNJA ---
vikunja-db:
image: postgres:17-alpine
container_name: vikunja-db
restart: always
environment:
POSTGRES_USER: ${POSTGRES_USER_VIKUNJA}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD_VIKUNJA}
POSTGRES_DB: ${POSTGRES_NAME_VIKUNJA}
networks:
- vikunja_backend
volumes:
- ./vikunja/db:/var/lib/postgresql/data
deploy:
resources:
limits:
cpus: '2'
memory: 1G
reservations:
cpus: '1'
memory: 512M
healthcheck:
test: ["CMD-SHELL", "pg_isready -h localhost -U ${POSTGRES_USER_VIKUNJA}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
logging:
driver: "json-file"
options:
max-size: "50m"
max-file: "3"
labels:
- "docker-volume-backup.stop-during-backup=true"
vikunja:
image: vikunja/vikunja:latest
container_name: vikunja
restart: unless-stopped
user: "${PUID}:${PGID}"
environment:
VIKUNJA_SERVICE_PUBLICURL: https://vikunja.${DOMAIN}/
VIKUNJA_SERVICE_JWTSECRET: ${VIKUNJA_JWT_SECRET}
VIKUNJA_DATABASE_TYPE: postgres
VIKUNJA_DATABASE_HOST: vikunja-db
VIKUNJA_DATABASE_DATABASE: ${POSTGRES_NAME_VIKUNJA}
VIKUNJA_DATABASE_USER: ${POSTGRES_USER_VIKUNJA}
VIKUNJA_DATABASE_PASSWORD: ${POSTGRES_PASSWORD_VIKUNJA}
VIKUNJA_SERVICE_ENABLEREGISTRATION: false
volumes:
- ./vikunja/files:/app/vikunja/files
networks:
- proxy_net
- vikunja_backend
depends_on:
vikunja-db:
condition: service_healthy
deploy:
resources:
limits:
cpus: '2'
memory: 512M
reservations:
cpus: '1'
memory: 256M
# Note: Vikunja image doesn't include shell/curl, relying on process supervision instead
# healthcheck disabled - container runs well without it
logging:
driver: "json-file"
options:
max-size: "50m"
max-file: "3"
labels:
- "traefik.enable=true"
- "traefik.http.routers.vikunja.rule=Host(`vikunja.${DOMAIN}`)"
- "traefik.http.routers.vikunja.entrypoints=websecure"
- "traefik.http.routers.vikunja.tls.certresolver=letsencrypt"
- "traefik.http.services.vikunja.loadbalancer.server.port=3456"
- "traefik.docker.network=proxy_net"
- "homepage.group=Dev"
- "homepage.name=Vikunja"
- "homepage.icon=vikunja.png"
- "homepage.href=https://vikunja.${DOMAIN}"
- "docker-volume-backup.stop-during-backup=true"
# --- VAULTWARDEN ---
vaultwarden:
image: vaultwarden/server:latest
container_name: vaultwarden
restart: unless-stopped
environment:
DOMAIN: https://vault.${DOMAIN}
SIGNUPS_ALLOWED: ${VAULTWARDEN_SIGNUPS_ALLOWED:-false}
ADMIN_TOKEN: ${VAULTWARDEN_ADMIN_TOKEN}
volumes:
- ./vaultwarden/data:/data
networks:
- proxy_net
deploy:
resources:
limits:
cpus: '1'
memory: 512M
reservations:
cpus: '0.5'
memory: 256M
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:80/alive"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
logging:
driver: "json-file"
options:
max-size: "50m"
max-file: "3"
labels:
- "traefik.enable=true"
- "traefik.http.routers.vaultwarden.rule=Host(`vault.${DOMAIN}`)"
- "traefik.http.routers.vaultwarden.entrypoints=websecure"
- "traefik.http.routers.vaultwarden.tls.certresolver=letsencrypt"
- "traefik.http.services.vaultwarden.loadbalancer.server.port=80"
- "homepage.group=Tools"
- "homepage.name=Vaultwarden"
- "homepage.icon=vaultwarden.png"
- "homepage.href=https://vault.${DOMAIN}"
- "docker-volume-backup.stop-during-backup=true"
# --- RADICALE ---
radicale:
image: tomsquest/docker-radicale:latest
container_name: radicale
restart: unless-stopped
volumes:
- ./radicale/data:/data
- ./radicale/config:/config:ro
networks:
- proxy_net
deploy:
resources:
limits:
cpus: '1'
memory: 256M
reservations:
cpus: '0.5'
memory: 128M
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5232/"]
interval: 30s
timeout: 10s
retries: 3
start_period: 20s
logging:
driver: "json-file"
options:
max-size: "50m"
max-file: "3"
labels:
- "traefik.enable=true"
- "traefik.http.routers.radicale.rule=Host(`radicale.${DOMAIN}`)"
- "traefik.http.routers.radicale.entrypoints=websecure"
- "traefik.http.routers.radicale.tls.certresolver=letsencrypt"
- "traefik.http.services.radicale.loadbalancer.server.port=5232"
- "homepage.group=Tools"
- "homepage.name=Radicale"
- "homepage.icon=radicale.png"
- "homepage.href=https://radicale.${DOMAIN}"
- "docker-volume-backup.stop-during-backup=true"
# --- Actual Budget ---
actual_server:
image: docker.io/actualbudget/actual-server:latest
container_name: actual_server
volumes:
- ./actual-data:/data
networks:
- proxy_net
restart: unless-stopped
deploy:
resources:
limits:
cpus: '1'
memory: 512M
reservations:
cpus: '0.5'
memory: 256M
healthcheck:
test: ['CMD-SHELL', 'node src/scripts/health-check.js']
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
logging:
driver: "json-file"
options:
max-size: "50m"
max-file: "3"
labels:
- "traefik.enable=true"
- "traefik.http.routers.actual.rule=Host(`actual.${DOMAIN}`)"
- "traefik.http.routers.actual.entrypoints=websecure"
- "traefik.http.routers.actual.tls.certresolver=letsencrypt"
- "traefik.http.services.actual.loadbalancer.server.port=5006"
- "homepage.group=Tools"
- "homepage.name=Actual"
- "homepage.icon=actual.png"
- "homepage.href=https://actual.${DOMAIN}"
- "docker-volume-backup.stop-during-backup=true"

30
health-check.sh Executable file
View File

@@ -0,0 +1,30 @@
#!/bin/bash
# JMP Server health check script
# Quick status check of all services
set -u
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"
echo "=== JMP Server Health Check ==="
echo ""
echo "Main services status:"
docker compose ps
echo ""
echo "OpenCloud services status:"
docker compose -f opencloud-compose/docker-compose.yml -f opencloud-compose/external-proxy/opencloud-exposed.yml ps 2>/dev/null || echo "OpenCloud not running"
echo ""
echo "Useful commands:"
echo " View all logs: docker compose logs -f"
echo " View service logs: docker compose logs -f [service-name]"
echo " Execute command: docker compose exec [service] [command]"
echo " Restart service: docker compose restart [service]"
echo " View resource usage: docker stats"
echo ""
echo "Services available:"
echo " Main stack: docker compose ps"
echo " OpenCloud: opencloud-compose/docker-compose.yml"

View File

@@ -0,0 +1,336 @@
## Basic Settings ##
# Define the docker compose log driver used.
# Defaults to local
LOG_DRIVER=
# If you're on an internet facing server, comment out following line.
# It skips certificate validation for various parts of OpenCloud and is
# needed when self signed certificates are used.
INSECURE=true
## Features ##
# The following variable is a convenience variable to enable or disable features of this compose project.
# Example: if you want to use traefik and letsencrypt, you can set the variable to
#COMPOSE_FILE=docker-compose.yml:traefik/opencloud.yml
# This enables you to just run `docker compose up -d` and the compose files will be added to the stack.
# As alternative approach you can run `docker compose -f docker-compose.yml -f docker-compose.traefik.yml up -d`
# Default: OpenCloud and Collabora with traefik and letsencypt
# This needs DNS entries for the domain names used in the .env file.
#COMPOSE_FILE=docker-compose.yml:weboffice/collabora.yml:traefik/opencloud.yml:traefik/collabora.yml
# If you want to use the external proxy, you can use the following combination.
# DNS entries and certificates need to be managed by the external environment.
# The domain names need to be entered into the .env file.
#COMPOSE_FILE=docker-compose.yml:weboffice/collabora.yml:external-proxy/opencloud.yml:external-proxy/collabora.yml
# Keycloak Shared User Directory
#COMPOSE_FILE=docker-compose.yml:weboffice/collabora.yml:traefik/opencloud.yml:traefik/collabora.yml:idm/ldap-keycloak.yml:traefik/ldap-keycloak.yml
## Traefik Settings ##
# Note: Traefik is always enabled and can't be disabled.
# Serve Traefik dashboard.
# Defaults to "false".
TRAEFIK_DASHBOARD=
# Domain of Traefik, where you can find the dashboard.
# Defaults to "traefik.opencloud.test"
TRAEFIK_DOMAIN=
# Basic authentication for the traefik dashboard.
# Defaults to user "admin" and password "admin" (written as: "admin:$2y$05$KDHu3xq92SPaO3G8Ybkc7edd51pPLJcG1nWk3lmlrIdANQ/B6r5pq").
# To create user:password pair, it's possible to use this command:
# echo $(htpasswd -nB user) | sed -e s/\\$/\\$\\$/g
TRAEFIK_BASIC_AUTH_USERS=
# Email address for obtaining LetsEncrypt certificates.
# Needs only be changed if this is a public facing server.
TRAEFIK_ACME_MAIL=
# Set to the following for testing to check the certificate process:
# "https://acme-staging-v02.api.letsencrypt.org/directory"
# With staging configured, there will be an SSL error in the browser.
# When certificates are displayed and are emitted by # "Fake LE Intermediate X1",
# the process went well and the envvar can be reset to empty to get valid certificates.
TRAEFIK_ACME_CASERVER=
# Enable the Traefik ACME (Automatic Certificate Management Environment) for automatic SSL certificate management.
TRAEFIK_SERVICES_TLS_CONFIG="tls.certresolver=letsencrypt"
# Enable Traefik to use local certificates.
#TRAEFIK_SERVICES_TLS_CONFIG="tls=true"
# You also need to provide a config file in ./config/traefik/dynamic/certs.yml
# Example:
# cat ./config/traefik/dynamic/certs.yml
# tls:
# certificates:
# - certFile: /certs/opencloud.test.crt
# keyFile: /certs/opencloud.test.key
# stores:
# default:
# defaultCertificate:
# certFile: /certs/opencloud.test.crt
# keyFile: /certs/opencloud.test.key
#
# The certificates need to be copied into ./certs/, the absolute path inside the container is /certs/.
# You can also use TRAEFIK_CERTS_DIR=/path/on/host to set the path to the certificates directory.
# Enable the access log for Traefik by setting the following variable to true.
TRAEFIK_ACCESS_LOG=
# Configure the log level for Traefik.
# Possible values are "TRACE", "DEBUG", "INFO", "WARN", "ERROR", "FATAL" and "PANIC". Default is "ERROR".
TRAEFIK_LOG_LEVEL=
# The default for traefik is to run in privileged mode.
# If you want to run traefik non-privileged, use the following variable and the format [UID]:[GID] to set user and group of your choice.
# Ensure that the user has access to docker.sock and traefik volumes defined in traefik/opencloud.yml
#TRAEFIK_CONTAINER_UID_GID="1000:1000"
# Configure ports for HTTP and HTTPS when necessary, defaults are 80 and 443
# Don't use ports in the range of 8000-9999 and 5232 as those ports are used internally and therefore might create conflicts.
#TRAEFIK_PORT_HTTP=4080
#TRAEFIK_PORT_HTTPS=4443
## OpenCloud Settings ##
# The opencloud container image.
# For production releases: "opencloudeu/opencloud"
# For rolling releases: "opencloudeu/opencloud-rolling"
# Defaults to production if not set otherwise
OC_DOCKER_IMAGE=opencloudeu/opencloud-rolling
# The openCloud container version.
# Defaults to "latest" and points to the latest stable tag.
OC_DOCKER_TAG=
# The default id used in opencloud containers is 1000 for user and group.
# If you want to change the default, use the following variable and the format [UID]:[GID].
# The change affects all containers with access to data volumes.
# Ensure that the user has access to all volumes defined in docker-compose.yml
#OC_CONTAINER_UID_GID="1000:1000"
# Domain of openCloud, where you can find the frontend.
# Defaults to "cloud.opencloud.test"
OC_DOMAIN=
# Demo users should not be created on a production instance,
# because their passwords are public. Defaults to "false".
# If demo users is set to "true", the following user accounts are created automatically:
# alan, mary, margaret, dennis and lynn - the password is 'demo' for all.
DEMO_USERS=
# Admin Password for the OpenCloud admin user.
# NOTE: This is only needed when using the built-in LDAP server (idm).
# If you are using an external LDAP server, the admin password is managed by the LDAP server.
# NOTE: This variable needs to be set before the first start of OpenCloud. Changes to this variable after the first start will be IGNORED.
# If not set, opencloud will not work properly. The container will be restarting.
# After the first initialization, the admin password can only be changed via the OpenCloud User Settings UI or by using the OpenCloud CLI.
# Documentation: https://docs.opencloud.eu/docs/admin/resources/common-issues#-change-admin-password-set-in-env
INITIAL_ADMIN_PASSWORD=
# Whether clients should check for updates.
# Defaults to "true".
CHECK_FOR_UPDATES=
# Define the openCloud loglevel used.
#
LOG_LEVEL=
# Define the kind of logging.
# The default log can be read by machines.
# Set this to true to make the log human readable.
# LOG_PRETTY=true
#
# Define the openCloud storage location. Set the paths for config and data to a local path.
# Ensure that the configuration and data directories are owned by the user and group with ID 1000:1000.
# This matches the default user inside the container and avoids permission issues when accessing files.
# Note that especially the data directory can grow big.
# Leaving it default stores data in docker internal volumes.
# OC_CONFIG_DIR=/your/local/opencloud/config
# OC_DATA_DIR=/your/local/opencloud/data
# OpenCloud Web can load extensions from a local directory.
# The default uses the bind mount to the config/opencloud/apps directory.
# Example: curl -L https://github.com/opencloud-eu/web-extensions/releases/download/unzip-v1.0.2/unzip-1.0.2.zip -o config/opencloud/apps/unzip-1.0.2.zip && unzip config/opencloud/apps/unzip-1.0.2.zip -d config/opencloud/apps && rm config/opencloud/apps/unzip-1.0.2.zip
# NOTE: you need to restart the openCloud container to load the new extensions.
# OC_APPS_DIR=/your/local/opencloud/apps
# Define the ldap-server storage location. Set the paths for config and data to a local path.
# LDAP_CERTS_DIR=
# LDAP_DATA_DIR=
# S3 Storage configuration - optional
# OpenCloud supports S3 storage as primary storage.
# Per default, S3 storage is disabled and the decomposed storage driver is used.
# To enable S3 storage, add `storage/decomposeds3.yml` to the COMPOSE_FILE variable or to
# your startup command (`docker compose -f docker-compose.yml -f storage/decomposeds3.yml up`).
#
# Configure the S3 storage endpoint. Defaults to "http://minio:9000" for testing purposes.
DECOMPOSEDS3_ENDPOINT=
# S3 region. Defaults to "default".
DECOMPOSEDS3_REGION=
# S3 access key. Defaults to "opencloud"
DECOMPOSEDS3_ACCESS_KEY=
# S3 secret. Defaults to "opencloud-secret-key"
DECOMPOSEDS3_SECRET_KEY=
# S3 bucket. Defaults to "opencloud"
DECOMPOSEDS3_BUCKET=
# Define SMTP settings if you would like to send OpenCloud email notifications.
# To actually send notifications, you also need to enable the 'notifications' service
# by adding it to the START_ADDITIONAL_SERVICES variable below.
#
# NOTE: when configuring Inbucket, these settings have no effect, see inbucket.yml for details.
# SMTP host to connect to.
SMTP_HOST=
# Port of the SMTP host to connect to.
SMTP_PORT=
# An eMail address that is used for sending OpenCloud notification eMails
# like "opencloud notifications <noreply@yourdomain.com>".
SMTP_SENDER=
# Username for the SMTP host to connect to.
SMTP_USERNAME=
# Password for the SMTP host to connect to.
SMTP_PASSWORD=
# Authentication method for the SMTP communication.
SMTP_AUTHENTICATION=
# Encryption method for the SMTP communication. Possible values are 'starttls', 'ssltls' and 'none'
SMTP_TRANSPORT_ENCRYPTION=
# Allow insecure connections to the SMTP server. Defaults to false.
SMTP_INSECURE=
# Additional services to be started on opencloud startup
# The following list of services is not started automatically and must be
# manually defined for startup:
# IMPORTANT: Add any services to the startup list comma separated like "notifications,antivirus" etc.
START_ADDITIONAL_SERVICES=""
## Default Enabled Services ##
### Apache Tika Content Analysis Toolkit ###
# Tika (search) is disabled by default due to performance reasons.
# Tika is used to extract metadata and text from various file formats.
# Enable it by adding the following to the COMPOSE_FILE variable:
# search/tika.yml or by using the following command:
# docker compose -f docker-compose.yml -f search/tika.yml up -d
# Set the desired docker image tag or digest.
# Defaults to "apache/tika:latest"
# The slim variant is recommended for most use cases as it provides core text extraction
# functionality with a smaller image size and faster startup time.
# Only use the full variant (apache/tika:latest-full) if you need specialized features
# like advanced OCR or specific image processing capabilities.
TIKA_IMAGE=
### IMPORTANT Note for Online Office Apps ###
# To avoid app interlocking issues, you should select only one app to be active/configured.
# This is due the fact that there is currently no app interlocking for the same file and one
# has to wait for a lock release to open the file with another app.
### Collabora Settings ###
# Domain of Collabora, where you can find the frontend.
# Defaults to "collabora.opencloud.test"
COLLABORA_DOMAIN=
# Domain of the wopiserver which handles Collabora.
# Defaults to "wopiserver.opencloud.test"
WOPISERVER_DOMAIN=
# Admin user for Collabora.
# Defaults to "admin".
# Collabora Admin Panel URL:
# https://{COLLABORA_DOMAIN}/browser/dist/admin/admin.html
COLLABORA_ADMIN_USER=
# Admin password for Collabora.
# Defaults to "admin".
COLLABORA_ADMIN_PASSWORD=
# Set to true to enable SSL handling in Collabora Online, this is only required if you are not using a reverse proxy.
# Default is true if not specified.
COLLABORA_SSL_ENABLE=false
# If you're on an internet-facing server, enable SSL verification for Collabora Online.
# Please comment out the following line:
COLLABORA_SSL_VERIFICATION=false
# Enable home mode in Collabore Online.
# Home users can enable this setting, which in turn disables welcome screen and user feedback popups,
# but also limits concurrent open connections to 20 and concurrent open documents to 10.
# Default is false if not specified.
COLLABORA_HOME_MODE=
### Virusscanner Settings ###
# IMPORTANT: If you enable antivirus, you also MUST configure the START_ADDITIONAL_SERVICES
# envvar in the OpenCloud Settings above by adding 'antivirus' to the list.
# The maximum scan size the virus scanner can handle, needs adjustment in the scanner config as well:
# For ClamAV, set CLAMD_CONF_StreamMaxLength in antivirus/clamav.yml to the same or a higher value.
# Usable common abbreviations: [KB, KiB, MB, MiB, GB, GiB, TB, TiB, PB, PiB, EB, EiB], example: 2GB.
# Defaults to "100MB"
#ANTIVIRUS_MAX_SCAN_SIZE=
# Usable modes: partial, skip.
# Defaults to "partial"
#ANTIVIRUS_MAX_SCAN_SIZE_MODE=
# Image version of the ClamAV container.
# Defaults to "latest"
CLAMAV_DOCKER_TAG=
### Inbucket Settings ###
# Inbucket is a mail catcher tool for testing purposes.
# DO NOT use in Production.
# email server (in this case inbucket acts as mail catcher).
# Domain for Inbucket. Defaults to "mail.opencloud.test".
INBUCKET_DOMAIN=
### Compose Configuration ###
# Path separator for supplemental compose files specified in COMPOSE_FILE.
COMPOSE_PATH_SEPARATOR=:
### Ldap Settings ###
# LDAP is always needed for OpenCloud to store user data as there is no relational database.
# The built-in LDAP server should used for testing purposes or small installations only.
# For production installations, it is recommended to use an external LDAP server.
# We are using OpenLDAP as the default LDAP server because it is proven to be stable and reliable.
# This LDAP configuration is known to work with OpenCloud and provides a blueprint for
# configuring an external LDAP server based on other products like Microsoft Active Directory or other LDAP servers.
#
# Password of LDAP bind user "cn=admin,dc=opencloud,dc=eu". Defaults to "admin"
LDAP_BIND_PASSWORD=
# The LDAP server also creates an openCloud admin user dn: uid=admin,ou=users,dc=opencloud,dc=eu
# The initial password for this user is "admin"
# NOTE: This password can only be set once, if you want to change it later, you have to use the OpenCloud User Settings UI.
# If you changed the password and lost it, you need to execute the following LDAP query to reset it:
# enter the ldap-server container with `docker compose exec ldap-server sh`
# and run the following command to change the password:
# ldappasswd -H ldap://127.0.0.1:1389 -D "cn=admin,dc=opencloud,dc=eu" -W "uid=admin,ou=users,dc=opencloud,dc=eu"
# You will be prompted for the LDAP bind password.
# The output should provide you a new password for the admin user.
### Keycloak Settings ###
# Keycloak is an open-source identity and access management solution.
# We are using Keycloak as the default identity provider on production installations.
# It can be used to federate authentication with other identity providers like
# Microsoft Entra ID, ADFS or other SAML/OIDC providers.
# The use of Keycloak as bridge between OpenCloud and other identity providers creates more control over the
# authentication process, the allowed clients and the session management.
# Keycloak also manages the Role Based Access Control (RBAC) for OpenCloud.
# Keycloak can be used in two different modes:
# 1. Autoprovisioning: New users are automatically created in openCloud when they log in for the first time.
# 2. Shared User Directory: Users are created in Keycloak and can be used in OpenCloud immediately
# because the LDAP server is connected to both Keycloak and OpenCloud.
# Only use one of the two modes at a time.
## Autoprovisioning Mode ##
# Use together with idm/external-idp.yml
# If you want to use a keycloak for local testing, you can use testing/external-keycloak.yml and testing/ldap-manager.yml
# Domain of your Identity Provider.
IDP_DOMAIN=
# IdP Issuer URL, which is used to identify the Identity Provider.
# We need the complete URL, including the protocol (http or https) and the realm.
# Example: "https://keycloak.opencloud.test/realms/openCloud"
IDP_ISSUER_URL=
# Url of the account edit page from your Identity Provider.
IDP_ACCOUNT_URL=
## Shared User Directory Mode ##
# Use together with idm/ldap-keycloak.yml and traefik/ldap-keycloak.yml
# Domain for Keycloak. Defaults to "keycloak.opencloud.test".
KEYCLOAK_DOMAIN=
# Admin user login name. Defaults to "kcadmin".
KEYCLOAK_ADMIN=
# Admin user login password. Defaults to "admin".
KEYCLOAK_ADMIN_PASSWORD=
# Keycloak Database username. Defaults to "keycloak".
KC_DB_USERNAME=
# Keycloak Database password. Defaults to "keycloak".
KC_DB_PASSWORD=
### Radicale Setting ###
# Radicale is a small open-source CalDAV (calendars, to-do lists) and CardDAV (contacts) server.
# When enabled OpenCloud is configured as a reverse proxy for Radicale, providing all authenticated
# OpenCloud users access to a Personal Calendar and Addressbook
# Docker image to use for the Radicale Container
#RADICALE_DOCKER_IMAGE=opencloudeu/radicale
# Docker tag to pull for the Radicale Container
#RADICALE_DOCKER_TAG=latest
# Define the storage location for the Radicale data. Set the path to a local path.
# Ensure that the configuration and data directories are owned by the user and group with ID 1000:1000.
# This matches the default user inside the container and avoids permission issues when accessing files.
# Leaving it default stores data in docker internal volumes.
#RADICALE_DATA_DIR=/your/local/radicale/data

21
opencloud-compose/.gitignore vendored Normal file
View File

@@ -0,0 +1,21 @@
.idea
# exclude the .env file which will be created from env.example
.env
# exclude the apps folder
/config/opencloud/apps/*
!/config/opencloud/apps/.gitkeep
!/config/opencloud/apps/maps
# exclude custom compose files
/custom
# exclude certificates
/certs/*
!/certs/.gitkeep
# exclude the certificates config folder
/config/traefik/dynamic/*
!/config/traefik/dynamic/.gitkeep
opencloud

674
opencloud-compose/LICENSE Normal file
View File

@@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.

504
opencloud-compose/README.md Normal file
View File

@@ -0,0 +1,504 @@
# OpenCloud Compose
This repository provides Docker Compose configurations for deploying OpenCloud in various environments.
> [!IMPORTANT]
> Please use the [official docs](https://docs.opencloud.eu/docs/admin/getting-started/container/docker-compose/docker-compose-base) for a **Production Deployment**.
## Overview
OpenCloud Compose offers a modular approach to deploying OpenCloud with several configuration options:
- **Standard deployment** with Traefik reverse proxy and Let's Encrypt certificates or certificates from files
- **External proxy** support for environments with existing reverse proxies (like Nginx, Caddy, etc.)
- **Collabora Online** integration for document editing
- **Keycloak and LDAP** integration for centralized identity management
- **Full text search** with Apache Tika for content extraction and metadata analysis
- **Monitoring** with metrics endpoints for observability and performance monitoring
- **Radicale** integration for Calendar and Contacts
- **ClamAV** antivirus scanning with ClamAV
## Quick Start Guide
### Prerequisites
- Docker and Docker Compose v2 installed.
- Domain names pointing to your server (for production deployment)
- Basic understanding of Docker Compose concepts
> [!IMPORTANT]
> Please use the docker installation guide from the [Official Documentation](https://docs.docker.com/engine/install/) to ensure using docker compose v2. Official linux distro package repositories might still contain docker compose v1, e.g. Debian 12 "Bookworm". Using docker compose v1 will lead to a broken docker deployment.
### Local Development
1. **Clone the repository**:
```bash
git clone https://github.com/opencloud-eu/opencloud-compose.git
cd opencloud-compose
```
2. **Create environment file**:
```bash
cp .env.example .env
```
> **Note**: The repository includes `.env.example` as a template with default settings and documentation. Your actual `.env` file is excluded from version control (via `.gitignore`) to prevent accidentally committing sensitive information like passwords and domain-specific settings.
3. **Set admin password**:
set `INITIAL_ADMIN_PASSWORD=your_secure_password` environment variable in your `.env` file
4. **Domain**:
optionally, set `OC_DOMAIN=your-domain.com` to overwrite the default `cloud.opencloud.test`
5. **Configure deployment options**:
You can deploy using explicit `-f` flags:
```bash
docker compose -f docker-compose.yml -f traefik/opencloud.yml up -d
```
Or by adding the `COMPOSE_FILE` variable in `.env`:
```
COMPOSE_FILE=docker-compose.yml:traefik/opencloud.yml
```
Then simply run:
```bash
docker compose up -d
```
6. **Add local domains to `/etc/hosts`** (for local development only):
```
127.0.0.1 cloud.opencloud.test
127.0.0.1 traefik.opencloud.test
127.0.0.1 keycloak.opencloud.test
```
7. **Access OpenCloud**:
- URL: https://cloud.opencloud.test
- Username: `admin`
- Password: value of your `INITIAL_ADMIN_PASSWORD`
## Deployment Options
### With Keycloak and LDAP using a Shared User Directory
OpenCloud can be deployed with Keycloak for identity management and LDAP for the shared user directory:
> **DNS Requirements**: This setup requires DNS entries for both the main OpenCloud domain and the Keycloak subdomain. Configure DNS A/AAAA records for your domains (e.g., `cloud.example.com`, `keycloak.example.com`) or use a wildcard DNS entry (`*.example.com`).
Using `-f` flags:
```bash
docker compose -f docker-compose.yml -f idm/ldap-keycloak.yml -f traefik/opencloud.yml -f traefik/ldap-keycloak.yml up -d
```
Or by setting in `.env`:
```
COMPOSE_FILE=docker-compose.yml:idm/ldap-keycloak.yml:traefik/opencloud.yml:traefik/ldap-keycloak.yml
```
> **For local development only**: Add to `/etc/hosts`:
> ```
> 127.0.0.1 keycloak.opencloud.test
> ```
This setup includes:
- Keycloak for authentication and identity management
- Shared LDAP server as a user directory with demo users and groups
- Integration with Keycloak using OpenCloud clients (`web`, `OpenCloudDesktop`, `OpenCloudAndroid`, `OpenCloudIOS`)
### With Collabora Online
Include Collabora for document editing using either method:
> **DNS Requirements**: This setup requires DNS entries for the main OpenCloud domain, Collabora subdomain, and WOPI server subdomain. Configure DNS A/AAAA records for your domains (e.g., `cloud.example.com`, `collabora.example.com`, `wopiserver.example.com`) or use a wildcard DNS entry (`*.example.com`).
Using `-f` flags:
```bash
docker compose -f docker-compose.yml -f weboffice/collabora.yml -f traefik/opencloud.yml -f traefik/collabora.yml up -d
```
Or by setting in `.env`:
```
COMPOSE_FILE=docker-compose.yml:weboffice/collabora.yml:traefik/opencloud.yml:traefik/collabora.yml
```
> **For local development only**: Add to `/etc/hosts`:
> ```
> 127.0.0.1 collabora.opencloud.test
> 127.0.0.1 wopiserver.opencloud.test
> ```
### With Full Text Search
Enable full text search capabilities with Apache Tika using either method:
> **DNS Requirements**: This setup requires DNS entries for the main OpenCloud domain. Configure a DNS A/AAAA record for your domain (e.g., `cloud.example.com`) or use a wildcard DNS entry (`*.example.com`).
Using `-f` flags:
```bash
docker compose -f docker-compose.yml -f search/tika.yml -f traefik/opencloud.yml up -d
```
Or by setting in `.env`:
```
COMPOSE_FILE=docker-compose.yml:search/tika.yml:traefik/opencloud.yml
```
This setup includes:
- Apache Tika for text extraction and metadata analysis from various file formats
- Full text search functionality in the OpenCloud interface
- Support for documents, PDFs, images, and other file types
**Tika Image Variant:**
By default, OpenCloud Compose uses `apache/tika:latest` which provides:
- Smaller image size (~300MB vs ~1.2GB for the full variant)
- Faster container startup and deployment
- Core text extraction functionality for common document formats (PDF, Office docs, text files, etc.)
The base variant is recommended for most use cases. If you need advanced features like specialized OCR processing or specific image format support, you can override the image by setting `TIKA_IMAGE=apache/tika:latest-full` in your `.env` file.
### With Radicale
Enable CalDAV (calendars, to-do lists) and CardDAV (contacts) server.
> **DNS Requirements**: This setup requires DNS entries for the main OpenCloud domain. Configure a DNS A/AAAA record for your domain (e.g., `cloud.example.com`) or use a wildcard DNS entry (`*.example.com`).
Using `-f` flags:
```bash
docker compose -f docker-compose.yml -f radicale/radicale.yml -f traefik/opencloud.yml up -d
```
Or by setting in `.env`:
```
COMPOSE_FILE=docker-compose.yml:radicale/radicale.yml:traefik/opencloud.yml
```
This setup includes:
- Radicale as a CalDAV (calendars, to-do lists) and CardDAV (contacts) server
- Users access to a Personal Calendar and Addressbook
### With Monitoring
Enable monitoring capabilities with metrics endpoints using either method:
> **DNS Requirements**: This setup requires DNS entries for the main OpenCloud domain. Configure a DNS A/AAAA record for your domain (e.g., `cloud.example.com`) or use a wildcard DNS entry (`*.example.com`).
Using `-f` flags:
```bash
docker compose -f docker-compose.yml -f monitoring/monitoring.yml -f traefik/opencloud.yml up -d
```
Or by setting in `.env`:
```
COMPOSE_FILE=docker-compose.yml:monitoring/monitoring.yml:traefik/opencloud.yml
```
This setup includes:
- Metrics endpoints for OpenCloud proxy service (port 9205)
- Metrics endpoints for collaboration service (port 9304)
- Performance monitoring and observability data
- Prometheus-compatible metrics format
Access metrics endpoints:
- OpenCloud metrics: `http://localhost:9205/metrics`
- Collaboration metrics: `http://localhost:9304/metrics`
> **Note**: The monitoring configuration uses an external network `opencloud-net`. You need to create this network manually before starting the services:
> ```bash
> docker network create opencloud-net
> ```
### Behind External Proxy
If you already have a reverse proxy (Nginx, Caddy, etc.), use either method:
> **DNS Requirements**: When using an external proxy, you need to configure your external proxy to handle DNS and SSL termination. Ensure your DNS entries point to your external proxy server, and configure your proxy to forward requests to the exposed OpenCloud ports.
Using `-f` flags:
```bash
docker compose -f docker-compose.yml -f weboffice/collabora.yml -f external-proxy/opencloud.yml -f external-proxy/collabora.yml up -d
```
Or by setting in `.env`:
```
COMPOSE_FILE=docker-compose.yml:weboffice/collabora.yml:external-proxy/opencloud.yml:external-proxy/collabora.yml
```
This exposes the necessary ports:
- OpenCloud: 9200
- Collabora: 9980
- WOPI server: 9300
**Please note:**
If you're using **Nginx Proxy Manager (NPM)**, you **should NOT** activate **"Block Common Exploits"** for the Proxy Host.
Otherwise, the desktop app authentication will return **error 403 Forbidden**.
### ClamAV anti-virus
Enable anti-virus scans for uploaded files.
Using `-f` flags:
```bash
docker compose -f docker-compose.yml -f antivirus/clamav.yml -f traefik/opencloud.yml up -d
```
Or by setting in `.env`:
```
COMPOSE_FILE=docker-compose.yml:antivirus/clamav.yml:traefik/opencloud.yml
```
**Important:** adjust the variable in `.env` to start the antivirus service. Add additional services separated by comma, e.g. `notifications,antivirus`:
```
START_ADDITIONAL_SERVICES="antivirus"
```
## SSL Certificate Support
OpenCloud Compose supports adding SSL certificates for public domains and development environments. This feature enables you to use the "Let's Encrypt ACME challenge" to generate certificates for your public domains as well as using your own certificates.
### Use Let's Encrypt with ACME Challenge
1. **Enable Let's Encrypt**:
- Set `TRAEFIK_LETSENCRYPT_EMAIL` to your email address for the ACME challenge
- Set `TRAEFIK_SERVICES_TLS_CONFIG="tls.certresolver=letsencrypt"` to use Let's Encrypt (default value)
```bash
# In your .env file
TRAEFIK_LETSENCRYPT_EMAIL=devops@your-domain.tld
TRAEFIK_SERVICES_TLS_CONFIG="tls.certresolver=letsencrypt"
```
### Use Certificates from the `certs/` directory
1. **Place your certificates**:
- Copy your certificate files (`.crt`, `.pem`, `.key`) to the `certs/` directory
- The directory structure is flexible - organize as needed for your setup
2. **Configure Traefik dynamic configuration**:
- Place Traefik dynamic configuration files in `config/traefik/dynamic/`
Example `config/traefik/dynamic/certs.yml`:
```yaml
tls:
certificates:
- certFile: /certs/opencloud.test.crt
keyFile: /certs/opencloud.test.key
stores:
- default
- certFile: /certs/wildcard.example.com.crt
keyFile: /certs/wildcard.example.com.key
stores:
- default
```
3. **Configure environment variables**:
- Set `TRAEFIK_SERVICES_TLS_CONFIG="tls=true"` to use your local certificates
```bash
# In your .env file
TRAEFIK_SERVICES_TLS_CONFIG="tls=true"
```
The certificate directory and configuration directories are now available and automatically mounted in the containers:
- `certs/` → `/certs/` (inside the Traefik container)
- `config/traefik/dynamic/` → dynamic configuration loading
> [!TIP]
>
> **Local development or testing with mkcert**
> For local development, you can use `mkcert` to generate self-signed certificates for your local domains. This allows you to test SSL/TLS configurations without needing a public domain or Let's Encrypt. It also brings the advantage that you don't have to accept self-signed certificates in your browser all the time.
> ```bash
> # Install mkcert (if not already installed)
> # macOS: brew install mkcert
> # Linux: apt install mkcert or similar
> # Windows: choco install mkcert or download from GitHub
>
> # Install the local CA
> mkcert -install
>
> # Generate certificates for your local domains
> mkcert -cert-file certs/opencloud.test.crt -key-file certs/opencloud.test.key "*.opencloud.test" opencloud.test
> ```
> [!IMPORTANT]
> The contents of the `certs/` directory and configuration directories are ignored by git to prevent accidentally committing sensitive certificate files.
## Configuration
### Environment Variables
The configuration is managed through environment variables in the `.env` file:
- We provide `.env.example` as a template with documentation for all options
- Your personal `.env` file is ignored by git to keep sensitive information private
- This pattern allows everyone to customize their deployment without affecting the repository
Key variables:
| Variable | Description | Default |
|-------------------------------|-------------------------------------------------------|------------------------------|
| `COMPOSE_FILE` | Colon-separated list of compose files to use | (commented out) |
| `OC_DOMAIN` | OpenCloud domain | cloud.opencloud.test |
| `INITIAL_ADMIN_PASSWORD ` | OpenCloud password for the admin user | (no value) |
| `OC_DOCKER_TAG` | OpenCloud image tag | latest |
| `OC_CONFIG_DIR` | Config directory path | (Docker volume) |
| `OC_DATA_DIR` | Data directory path | (Docker volume) |
| `INSECURE` | Skip certificate validation | true |
| `COLLABORA_DOMAIN` | Collabora domain | collabora.opencloud.test |
| `WOPISERVER_DOMAIN` | WOPI server domain | wopiserver.opencloud.test |
| `TIKA_IMAGE` | Apache Tika image tag | apache/tika:slim |
| `KEYCLOAK_DOMAIN` | Keycloak domain | keycloak.opencloud.test |
| `KEYCLOAK_ADMIN` | Keycloak admin username | kcadmin |
| `KEYCLOAK_ADMIN_PASSWORD` | Keycloak admin password | admin |
| `LDAP_BIND_PASSWORD` | LDAP password for the bind user | admin |
| `KC_DB_USERNAME` | Database user for keycloak | keycloak |
| `KC_DB_PASSWORD` | Database password for keycloak | keycloak |
| `TRAEFIK_LETSENCRYPT_EMAIL` | Email Address for the Let's Encrypt ACME challenge | example@example.org |
| `TRAEFIK_SERVICES_TLS_CONFIG` | Tell traefik and the services which TLS config to use | tls.certresolver=letsencrypt |
| `TRAEFIK_CERTS_DIR` | Directory for custom certificates. | ./certs |
See `.env.example` for all available options and their documentation.
### Admin Password Configuration
The `INITIAL_ADMIN_PASSWORD` environment variable is **required** for OpenCloud to work properly:
- **Only needed when using the built-in LDAP server (idm)**
- **Must be set before the first start of OpenCloud. Changes in the ENV variable after the first startup will be ignored.**
- If not set, OpenCloud will not work properly and the container will keep restarting
- After first initialization, the admin password can only be changed via:
- OpenCloud User Settings UI
- OpenCloud CLI
For external LDAP servers, the admin password is managed by the LDAP server itself.
**Important**: Set this variable in your `.env` file before starting OpenCloud for the first time:
```
INITIAL_ADMIN_PASSWORD=your-secure-password-here
```
For more details, see the [OpenCloud documentation](https://docs.opencloud.eu/docs/admin/resources/common-issues#-change-admin-password-set-in-env).
### Persistent Storage
For production, configure persistent storage:
```
OC_CONFIG_DIR=/path/to/opencloud/config
OC_DATA_DIR=/path/to/opencloud/data
```
Ensure proper permissions:
```bash
mkdir -p /path/to/opencloud/{config,data}
chown -R 1000:1000 /path/to/opencloud
```
### Compose File Structure
This repository uses a modular approach with multiple compose files:
- `docker-compose.yml` - Core OpenCloud service
- `weboffice/` - Web office integrations (Collabora Online)
- `storage/` - Storage backend configurations (decomposeds3)
- `search/` - Search and content analysis services (Apache Tika)
- `monitoring/` - Monitoring and metrics configurations
- `idm/` - Identity management configurations (Keycloak & LDAP)
- `traefik/` - Traefik reverse proxy configurations
- `external-proxy/` - Configuration for external reverse proxies
- `radicale/` - Radicale configuration
- `config/` - Configuration files for OpenCloud, Keycloak, and LDAP
## Advanced Usage
### Understanding the COMPOSE_FILE Variable
The `COMPOSE_FILE` environment variable is a powerful way to manage complex Docker Compose deployments:
- It uses colons (`:`) as separators between files (configurable with `COMPOSE_PATH_SEPARATOR`)
- Files are processed in order, with later files overriding settings from earlier ones
- It allows you to run just `docker compose up -d` without specifying `-f` flags
- Perfect for automation, CI/CD pipelines, and consistent deployments
Example configurations:
Production with Collabora:
```
COMPOSE_FILE=docker-compose.yml:weboffice/collabora.yml:traefik/opencloud.yml:traefik/collabora.yml
```
Production with Keycloak and LDAP:
```
COMPOSE_FILE=docker-compose.yml:idm/ldap-keycloak.yml:traefik/opencloud.yml:traefik/ldap-keycloak.yml
```
Production with both Collabora and Keycloak/LDAP:
```
COMPOSE_FILE=docker-compose.yml:weboffice/collabora.yml:idm/ldap-keycloak.yml:traefik/opencloud.yml:traefik/collabora.yml:traefik/ldap-keycloak.yml
```
Production with monitoring:
```
COMPOSE_FILE=docker-compose.yml:monitoring/monitoring.yml:traefik/opencloud.yml
```
### Automation and GitOps
For automated deployments, using the `COMPOSE_FILE` variable in `.env` is recommended:
```
COMPOSE_FILE=docker-compose.yml:weboffice/collabora.yml:traefik/opencloud.yml:traefik/collabora.yml
```
This allows tools like Ansible or CI/CD pipelines to deploy the stack without modifying the compose files.
### Custom compose file overrides
You can create custom compose files to override specific settings after creating a `custom` directory:
```bash
mkdir -p custom
```
Then create a `docker-compose.override.yml` file in the `custom` directory with your overrides.
This folder is ignored by git, allowing you to customize your deployment without affecting the repository. This can be useful in scenarios like portainer where the git repository is configured as a stack.
You can for example add custom labels to the OpenCloud service:
```yaml
services:
opencloud:
labels:
- "traefik.enable=true"
- "traefik.http.routers.opencloud.rule=Host(`cloud.opencloud.test`)"
- "traefik.http.services.opencloud.loadbalancer.server.port=80"
- "traefik.http.routers.opencloud.tls.certresolver=my-resolver"
```
## Troubleshooting
### Common Issues
- **SSL Certificate Errors**: For local development, accept self-signed certificates by visiting each domain directly in your browser.
- **Port Conflicts**: If you have services already using ports 80/443, use the external proxy configuration.
- **Permission Issues**: Ensure data and config directories have proper permissions (owned by user/group 1000).
### Logs
View logs with:
```bash
docker compose logs -f
```
For specific service logs:
```bash
docker compose logs -f opencloud
```
## Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
## License
This project is licensed under the GNU General Public License v3 (GPLv3).

View File

@@ -0,0 +1,31 @@
---
services:
opencloud:
environment:
POSTPROCESSING_STEPS: "virusscan"
STORAGE_USERS_DATA_GATEWAY_URL: "http://opencloud:9200/data"
ANTIVIRUS_MAX_SCAN_SIZE: ${ANTIVIRUS_MAX_SCAN_SIZE:-100MB}
ANTIVIRUS_INFECTED_FILE_HANDLING: abort
ANTIVIRUS_MAX_SCAN_SIZE_MODE: ${ANTIVIRUS_MAX_SCAN_SIZE_MODE:-partial}
ANTIVIRUS_WORKERS: 1
ANTIVIRUS_CLAMAV_SOCKET: /var/run/clamav/clamd.sock
ANTIVIRUS_SCANNER_TYPE: clamav
volumes:
- clamav-socket:/var/run/clamav
clamav:
image: clamav/clamav:${CLAMAV_DOCKER_TAG:-latest}
environment:
# Accepts a number with optional K, M or G suffix. Must be greater or equal to ANTIVIRUS_MAX_SCAN_SIZE above.
# K = KiB (1024), M = MiB (1024 * 1024), G = GiB (1024 * 1024 * 1024)
CLAMD_CONF_StreamMaxLength: 100M
networks:
opencloud-net:
volumes:
- clamav-socket:/tmp
- clamav-db:/var/lib/clamav
logging:
driver: ${LOG_DRIVER:-local}
restart: always
volumes:
clamav-db:
clamav-socket:

View File

View File

@@ -0,0 +1,63 @@
{
"clientId": "OpenCloudAndroid",
"name": "OpenCloud Android App",
"surrogateAuthRequired": false,
"enabled": true,
"alwaysDisplayInConsole": false,
"clientAuthenticatorType": "client-secret",
"redirectUris": [
"oc://android.opencloud.eu"
],
"webOrigins": [],
"notBefore": 0,
"bearerOnly": false,
"consentRequired": false,
"standardFlowEnabled": true,
"implicitFlowEnabled": false,
"directAccessGrantsEnabled": true,
"serviceAccountsEnabled": false,
"publicClient": true,
"frontchannelLogout": false,
"protocol": "openid-connect",
"attributes": {
"saml.assertion.signature": "false",
"saml.force.post.binding": "false",
"saml.multivalued.roles": "false",
"saml.encrypt": "false",
"post.logout.redirect.uris": "oc://android.opencloud.eu",
"backchannel.logout.revoke.offline.tokens": "false",
"saml.server.signature": "false",
"saml.server.signature.keyinfo.ext": "false",
"exclude.session.state.from.auth.response": "false",
"backchannel.logout.session.required": "true",
"client_credentials.use_refresh_token": "false",
"saml_force_name_id_format": "false",
"saml.client.signature": "false",
"tls.client.certificate.bound.access.tokens": "false",
"saml.authnstatement": "false",
"display.on.consent.screen": "false",
"saml.onetimeuse.condition": "false"
},
"authenticationFlowBindingOverrides": {},
"fullScopeAllowed": true,
"nodeReRegistrationTimeout": -1,
"defaultClientScopes": [
"web-origins",
"profile",
"roles",
"groups",
"basic",
"email"
],
"optionalClientScopes": [
"address",
"phone",
"offline_access",
"microprofile-jwt"
],
"access": {
"view": true,
"configure": true,
"manage": true
}
}

View File

@@ -0,0 +1,64 @@
{
"clientId": "OpenCloudDesktop",
"name": "OpenCloud Desktop Client",
"surrogateAuthRequired": false,
"enabled": true,
"alwaysDisplayInConsole": false,
"clientAuthenticatorType": "client-secret",
"redirectUris": [
"http://127.0.0.1",
"http://localhost"
],
"webOrigins": [],
"notBefore": 0,
"bearerOnly": false,
"consentRequired": false,
"standardFlowEnabled": true,
"implicitFlowEnabled": false,
"directAccessGrantsEnabled": true,
"serviceAccountsEnabled": false,
"publicClient": true,
"frontchannelLogout": false,
"protocol": "openid-connect",
"attributes": {
"saml.assertion.signature": "false",
"saml.force.post.binding": "false",
"saml.multivalued.roles": "false",
"saml.encrypt": "false",
"post.logout.redirect.uris": "+",
"backchannel.logout.revoke.offline.tokens": "false",
"saml.server.signature": "false",
"saml.server.signature.keyinfo.ext": "false",
"exclude.session.state.from.auth.response": "false",
"backchannel.logout.session.required": "true",
"client_credentials.use_refresh_token": "false",
"saml_force_name_id_format": "false",
"saml.client.signature": "false",
"tls.client.certificate.bound.access.tokens": "false",
"saml.authnstatement": "false",
"display.on.consent.screen": "false",
"saml.onetimeuse.condition": "false"
},
"authenticationFlowBindingOverrides": {},
"fullScopeAllowed": true,
"nodeReRegistrationTimeout": -1,
"defaultClientScopes": [
"web-origins",
"profile",
"roles",
"groups",
"basic",
"email"
],
"optionalClientScopes": [
"address",
"phone",
"offline_access",
"microprofile-jwt"
],
"access": {
"view": true,
"configure": true,
"manage": true
}
}

View File

@@ -0,0 +1,63 @@
{
"clientId": "OpenCloudIOS",
"name": "OpenCloud iOS App",
"surrogateAuthRequired": false,
"enabled": true,
"alwaysDisplayInConsole": false,
"clientAuthenticatorType": "client-secret",
"redirectUris": [
"oc://ios.opencloud.eu"
],
"webOrigins": [],
"notBefore": 0,
"bearerOnly": false,
"consentRequired": false,
"standardFlowEnabled": true,
"implicitFlowEnabled": false,
"directAccessGrantsEnabled": true,
"serviceAccountsEnabled": false,
"publicClient": true,
"frontchannelLogout": false,
"protocol": "openid-connect",
"attributes": {
"saml.assertion.signature": "false",
"saml.force.post.binding": "false",
"saml.multivalued.roles": "false",
"saml.encrypt": "false",
"post.logout.redirect.uris": "oc://ios.opencloud.eu",
"backchannel.logout.revoke.offline.tokens": "false",
"saml.server.signature": "false",
"saml.server.signature.keyinfo.ext": "false",
"exclude.session.state.from.auth.response": "false",
"backchannel.logout.session.required": "true",
"client_credentials.use_refresh_token": "false",
"saml_force_name_id_format": "false",
"saml.client.signature": "false",
"tls.client.certificate.bound.access.tokens": "false",
"saml.authnstatement": "false",
"display.on.consent.screen": "false",
"saml.onetimeuse.condition": "false"
},
"authenticationFlowBindingOverrides": {},
"fullScopeAllowed": true,
"nodeReRegistrationTimeout": -1,
"defaultClientScopes": [
"web-origins",
"profile",
"roles",
"groups",
"basic",
"email"
],
"optionalClientScopes": [
"address",
"phone",
"offline_access",
"microprofile-jwt"
],
"access": {
"view": true,
"configure": true,
"manage": true
}
}

View File

@@ -0,0 +1,66 @@
{
"clientId": "Cyberduck",
"name": "Cyberduck",
"description": "File transfer utility client",
"surrogateAuthRequired": false,
"enabled": true,
"alwaysDisplayInConsole": false,
"clientAuthenticatorType": "client-secret",
"redirectUris": [
"x-cyberduck-action:oauth",
"x-mountainduck-action:oauth"
],
"webOrigins": [],
"notBefore": 0,
"bearerOnly": false,
"consentRequired": false,
"standardFlowEnabled": true,
"implicitFlowEnabled": false,
"directAccessGrantsEnabled": true,
"serviceAccountsEnabled": false,
"publicClient": true,
"frontchannelLogout": false,
"protocol": "openid-connect",
"attributes": {
"saml.assertion.signature": "false",
"saml.force.post.binding": "false",
"saml.multivalued.roles": "false",
"saml.encrypt": "false",
"oauth2.device.authorization.grant.enabled": "false",
"backchannel.logout.revoke.offline.tokens": "false",
"saml.server.signature": "false",
"saml.server.signature.keyinfo.ext": "false",
"exclude.session.state.from.auth.response": "false",
"oidc.ciba.grant.enabled": "false",
"backchannel.logout.session.required": "true",
"client_credentials.use_refresh_token": "false",
"saml_force_name_id_format": "false",
"saml.client.signature": "false",
"tls.client.certificate.bound.access.tokens": "false",
"saml.authnstatement": "false",
"display.on.consent.screen": "false",
"saml.onetimeuse.condition": "false"
},
"authenticationFlowBindingOverrides": {},
"fullScopeAllowed": true,
"nodeReRegistrationTimeout": -1,
"defaultClientScopes": [
"web-origins",
"profile",
"roles",
"groups",
"basic",
"email"
],
"optionalClientScopes": [
"address",
"phone",
"offline_access",
"microprofile-jwt"
],
"access": {
"view": true,
"configure": true,
"manage": true
}
}

View File

@@ -0,0 +1,74 @@
{
"clientId": "web",
"name": "OpenCloud Web App",
"description": "",
"rootUrl": "{{OC_URL}}",
"adminUrl": "{{OC_URL}}",
"baseUrl": "",
"surrogateAuthRequired": false,
"enabled": true,
"alwaysDisplayInConsole": false,
"clientAuthenticatorType": "client-secret",
"redirectUris": [
"{{OC_URL}}/",
"{{OC_URL}}/oidc-callback.html",
"{{OC_URL}}/oidc-silent-redirect.html"
],
"webOrigins": [
"{{OC_URL}}"
],
"notBefore": 0,
"bearerOnly": false,
"consentRequired": false,
"standardFlowEnabled": true,
"implicitFlowEnabled": false,
"directAccessGrantsEnabled": true,
"serviceAccountsEnabled": false,
"publicClient": true,
"frontchannelLogout": false,
"protocol": "openid-connect",
"attributes": {
"saml.assertion.signature": "false",
"saml.force.post.binding": "false",
"saml.multivalued.roles": "false",
"saml.encrypt": "false",
"post.logout.redirect.uris": "+",
"oauth2.device.authorization.grant.enabled": "false",
"backchannel.logout.revoke.offline.tokens": "false",
"saml.server.signature": "false",
"saml.server.signature.keyinfo.ext": "false",
"exclude.session.state.from.auth.response": "false",
"oidc.ciba.grant.enabled": "false",
"backchannel.logout.url": "{{OC_URL}}/backchannel_logout",
"backchannel.logout.session.required": "true",
"client_credentials.use_refresh_token": "false",
"saml_force_name_id_format": "false",
"saml.client.signature": "false",
"tls.client.certificate.bound.access.tokens": "false",
"saml.authnstatement": "false",
"display.on.consent.screen": "false",
"saml.onetimeuse.condition": "false"
},
"authenticationFlowBindingOverrides": {},
"fullScopeAllowed": true,
"nodeReRegistrationTimeout": -1,
"defaultClientScopes": [
"web-origins",
"profile",
"roles",
"groups",
"basic",
"email"
],
"optionalClientScopes": [
"address",
"phone",
"offline_access",
"microprofile-jwt"
],
"access": {
"view": true,
"configure": true,
"manage": true
}
}

View File

@@ -0,0 +1,8 @@
#!/bin/bash
printenv
# replace openCloud domain and LDAP password in keycloak realm import
mkdir /opt/keycloak/data/import
sed -e "s/cloud.opencloud.test/${OC_DOMAIN}/g" -e "s/ldap-admin-password/${LDAP_ADMIN_PASSWORD:-admin}/g" /opt/keycloak/data/import-dist/openCloud-realm.json > /opt/keycloak/data/import/openCloud-realm.json
# run original docker-entrypoint
/opt/keycloak/bin/kc.sh "$@"

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,9 @@
#!/bin/bash
echo "Running custom LDAP entrypoint script..."
if [ ! -f /opt/bitnami/openldap/share/openldap.key ]
then
openssl req -x509 -newkey rsa:4096 -keyout /opt/bitnami/openldap/share/openldap.key -out /opt/bitnami/openldap/share/openldap.crt -sha256 -days 365 -batch -nodes
fi
# run original docker-entrypoint
/opt/bitnami/scripts/openldap/entrypoint.sh "$@"

View File

@@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -eu
# apply acls
echo -n "Applying acls... "
slapmodify -F /opt/bitnami/openldap/etc/slapd.d -b cn=config -l /opt/bitnami/openldap/etc/schema/50_acls.ldif
if [ $? -eq 0 ]; then
echo "done."
else
echo "failed."
fi

View File

@@ -0,0 +1,24 @@
dn: dc=opencloud,dc=eu
objectClass: organization
objectClass: dcObject
dc: opencloud
o: openCloud
dn: ou=users,dc=opencloud,dc=eu
objectClass: organizationalUnit
ou: users
dn: cn=admin,dc=opencloud,dc=eu
objectClass: inetOrgPerson
objectClass: person
cn: admin
sn: admin
uid: ldapadmin
dn: ou=groups,dc=opencloud,dc=eu
objectClass: organizationalUnit
ou: groups
dn: ou=custom,ou=groups,dc=opencloud,dc=eu
objectClass: organizationalUnit
ou: custom

View File

@@ -0,0 +1,20 @@
dn: uid=admin,ou=users,dc=opencloud,dc=eu
objectClass: inetOrgPerson
objectClass: organizationalPerson
objectClass: person
objectClass: top
uid: admin
givenName: Admin
sn: Admin
cn: admin
displayName: Admin
description: An admin for this OpenCloud instance.
mail: admin@example.org
userPassword:: e1NTSEF9UWhmaFB3dERydTUydURoWFFObDRMbzVIckI3TkI5Nmo==
dn: cn=administrators,ou=groups,dc=opencloud,dc=eu
objectClass: groupOfNames
objectClass: top
cn: administrators
description: OpenCloud Administrators
member: uid=admin,ou=users,dc=opencloud,dc=eu

View File

@@ -0,0 +1,70 @@
# Start dn with uid (user identifier / login), not cn (Firstname + Surname)
dn: uid=alan,ou=users,dc=opencloud,dc=eu
objectClass: inetOrgPerson
objectClass: organizationalPerson
objectClass: person
objectClass: top
uid: alan
givenName: Alan
sn: Turing
cn: alan
displayName: Alan Turing
description: An English mathematician, computer scientist, logician, cryptanalyst, philosopher and theoretical biologist. He was highly influential in the development of theoretical computer science, providing a formalisation of the concepts of algorithm and computation with the Turing machine.
mail: alan@example.org
userPassword:: e1NTSEF9Y2ZMdVlqMTBDUFpLWE44VC9mQ0FzYnFHQmtyZExJeGg=
dn: uid=lynn,ou=users,dc=opencloud,dc=eu
objectClass: inetOrgPerson
objectClass: organizationalPerson
objectClass: person
objectClass: top
uid: lynn
givenName: Lynn
sn: Conway
cn: lynn
displayName: Lynn Conway
description: An American computer scientist, electrical engineer, and transgender activist.
mail: lynn@example.org
userPassword:: e1NTSEF9Y2ZMdVlqMTBDUFpLWE44VC9mQ0FzYnFHQmtyZExJeGg=
dn: uid=mary,ou=users,dc=opencloud,dc=eu
objectClass: inetOrgPerson
objectClass: organizationalPerson
objectClass: person
objectClass: top
uid: mary
givenName: Mary
sn: Kenneth Keller
cn: mary
displayName: Mary Kenneth Keller
description: Mary Kenneth Keller of the Sisters of Charity of the Blessed Virgin Mary was a pioneer in computer science.
mail: mary@example.org
userPassword:: e1NTSEF9Y2ZMdVlqMTBDUFpLWE44VC9mQ0FzYnFHQmtyZExJeGg=
dn: uid=margaret,ou=users,dc=opencloud,dc=eu
objectClass: inetOrgPerson
objectClass: organizationalPerson
objectClass: person
objectClass: top
uid: margaret
givenName: Margaret
sn: Hamilton
cn: margaret
displayName: Margaret Hamilton
description: A director of the Software Engineering Division of the MIT Instrumentation Laboratory, which developed on-board flight software for NASA's Apollo program.
mail: margaret@example.org
userPassword:: e1NTSEF9Y2ZMdVlqMTBDUFpLWE44VC9mQ0FzYnFHQmtyZExJeGg=
dn: uid=dennis,ou=users,dc=opencloud,dc=eu
objectClass: inetOrgPerson
objectClass: organizationalPerson
objectClass: person
objectClass: top
uid: dennis
givenName: Dennis
sn: Ritchie
cn: dennis
displayName: Dennis Ritchie
description: American computer scientist. He created the C programming language and the Unix operating system and B language with long-time colleague Ken Thompson.
mail: dennis@example.org
userPassword:: e1NTSEF9Y2ZMdVlqMTBDUFpLWE44VC9mQ0FzYnFHQmtyZExJeGg=

View File

@@ -0,0 +1,70 @@
dn: cn=users,ou=groups,dc=opencloud,dc=eu
objectClass: groupOfNames
objectClass: top
cn: users
description: Users
member: uid=alan,ou=users,dc=opencloud,dc=eu
member: uid=mary,ou=users,dc=opencloud,dc=eu
member: uid=margaret,ou=users,dc=opencloud,dc=eu
member: uid=dennis,ou=users,dc=opencloud,dc=eu
member: uid=lynn,ou=users,dc=opencloud,dc=eu
member: uid=admin,ou=users,dc=opencloud,dc=eu
dn: cn=chess-lovers,ou=groups,dc=opencloud,dc=eu
objectClass: groupOfNames
objectClass: top
cn: chess-lovers
description: Chess lovers
member: uid=alan,ou=users,dc=opencloud,dc=eu
dn: cn=machine-lovers,ou=groups,dc=opencloud,dc=eu
objectClass: groupOfNames
objectClass: top
cn: machine-lovers
description: Machine Lovers
member: uid=alan,ou=users,dc=opencloud,dc=eu
dn: cn=bible-readers,ou=groups,dc=opencloud,dc=eu
objectClass: groupOfNames
objectClass: top
cn: bible-readers
description: Bible readers
member: uid=mary,ou=users,dc=opencloud,dc=eu
dn: cn=apollos,ou=groups,dc=opencloud,dc=eu
objectClass: groupOfNames
objectClass: top
cn: apollos
description: Contributors to the Apollo mission
member: uid=margaret,ou=users,dc=opencloud,dc=eu
dn: cn=unix-lovers,ou=groups,dc=opencloud,dc=eu
objectClass: groupOfNames
objectClass: top
cn: unix-lovers
description: Unix lovers
member: uid=dennis,ou=users,dc=opencloud,dc=eu
dn: cn=basic-haters,ou=groups,dc=opencloud,dc=eu
objectClass: groupOfNames
objectClass: top
cn: basic-haters
description: Haters of the Basic programming language
member: uid=dennis,ou=users,dc=opencloud,dc=eu
dn: cn=vlsi-lovers,ou=groups,dc=opencloud,dc=eu
objectClass: groupOfNames
objectClass: top
cn: vlsi-lovers
description: Lovers of VLSI microchip design
member: uid=lynn,ou=users,dc=opencloud,dc=eu
dn: cn=programmers,ou=groups,dc=opencloud,dc=eu
objectClass: groupOfNames
objectClass: top
cn: programmers
description: Computer Programmers
member: uid=alan,ou=users,dc=opencloud,dc=eu
member: uid=margaret,ou=users,dc=opencloud,dc=eu
member: uid=dennis,ou=users,dc=opencloud,dc=eu
member: uid=lynn,ou=users,dc=opencloud,dc=eu

View File

@@ -0,0 +1,9 @@
# OpenCloud ldap acl file which gets applied during the first db initialisation
dn: olcDatabase={2}mdb,cn=config
changetype: modify
replace: olcAccess
olcAccess: {0}to dn.subtree="dc=opencloud,dc=eu" attrs=entry,uid,objectClass,entryUUID
by * read
olcAccess: {1}to attrs=userPassword
by self write
by * auth

View File

@@ -0,0 +1,39 @@
# This LDIF files describes the OpenCloud schema
dn: cn=opencloud,cn=schema,cn=config
objectClass: olcSchemaConfig
cn: opencloud
olcObjectIdentifier: openCloudOid 1.3.6.1.4.1.63016
# We'll use openCloudOid:1 subarc for LDAP related stuff
# openCloudOid:1.1 for AttributeTypes and openCloudOid:1.2 for ObjectClasses
olcAttributeTypes: ( openCloudOid:1.1.1 NAME 'openCloudUUID'
DESC 'A non-reassignable and persistent account ID)'
EQUALITY uuidMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.1.16.1 SINGLE-VALUE )
olcAttributeTypes: ( openCloudOid:1.1.2 NAME 'openCloudExternalIdentity'
DESC 'A triple separated by "$" representing the objectIdentity resource type of the Graph API ( signInType $ issuer $ issuerAssignedId )'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
olcAttributeTypes: ( openCloudOid:1.1.3 NAME 'openCloudUserEnabled'
DESC 'A boolean value indicating if the user is enabled'
EQUALITY booleanMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE)
olcAttributeTypes: ( openCloudOid:1.1.4 NAME 'openCloudUserType'
DESC 'User type (e.g. Member or Guest)'
EQUALITY caseIgnoreMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )
olcAttributeTypes: ( openCloudOid:1.1.5 NAME 'openCloudLastSignInTimestamp'
DESC 'The timestamp of the last sign-in'
EQUALITY generalizedTimeMatch
ORDERING generalizedTimeOrderingMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE )
olcObjectClasses: ( openCloudOid:1.2.1 NAME 'openCloudObject'
DESC 'OpenCloud base objectclass'
AUXILIARY
MAY ( openCloudUUID ) )
olcObjectClasses: ( openCloudOid:1.2.2 NAME 'openCloudUser'
DESC 'OpenCloud User objectclass'
SUP openCloudObject
AUXILIARY
MAY ( openCloudExternalIdentity $ openCloudUserEnabled $ openCloudUserType $ openCloudLastSignInTimestamp) )

View File

@@ -0,0 +1,80 @@
set -e
printenv
# Function to add arguments to the command
add_arg() {
TRAEFIK_CMD="$TRAEFIK_CMD $1"
}
# Initialize the base command
TRAEFIK_CMD="traefik"
# Base Traefik arguments (from your existing configuration)
add_arg "--log.level=${TRAEFIK_LOG_LEVEL:-ERROR}"
# enable dashboard
add_arg "--api.dashboard=true"
# define entrypoints
add_arg "--entryPoints.http.address=:${TRAEFIK_PORT_HTTP:-80}"
add_arg "--entryPoints.http.http.redirections.entryPoint.to=https"
add_arg "--entryPoints.http.http.redirections.entryPoint.scheme=https"
add_arg "--entryPoints.https.address=:${TRAEFIK_PORT_HTTPS:-443}"
# change default timeouts for long-running requests
# this is needed for webdav clients that do not support the TUS protocol
add_arg "--entryPoints.https.transport.respondingTimeouts.readTimeout=12h"
add_arg "--entryPoints.https.transport.respondingTimeouts.writeTimeout=12h"
add_arg "--entryPoints.https.transport.respondingTimeouts.idleTimeout=3m"
# allow encoded characters
# required for WOPI/Collabora
add_arg "--entryPoints.https.http.encodedCharacters.allowEncodedSlash=true"
add_arg "--entryPoints.https.http.encodedCharacters.allowEncodedQuestionMark=true"
add_arg "--entryPoints.https.http.encodedCharacters.allowEncodedPercent=true"
# required for file operations with supported encoded characters
add_arg "--entryPoints.https.http.encodedCharacters.allowEncodedSemicolon=true"
add_arg "--entryPoints.https.http.encodedCharacters.allowEncodedHash=true"
# docker provider (get configuration from container labels)
add_arg "--providers.docker.endpoint=unix:///var/run/docker.sock"
add_arg "--providers.docker.exposedByDefault=false"
# access log
add_arg "--accessLog=${TRAEFIK_ACCESS_LOG:-false}"
add_arg "--accessLog.format=json"
add_arg "--accessLog.fields.headers.names.X-Request-Id=keep"
# Add Let's Encrypt configuration if enabled
if [ "${TRAEFIK_SERVICES_TLS_CONFIG}" = "tls.certresolver=letsencrypt" ]; then
echo "Configuring Traefik with Let's Encrypt..."
add_arg "--certificatesResolvers.letsencrypt.acme.email=${TRAEFIK_ACME_MAIL:-example@example.org}"
add_arg "--certificatesResolvers.letsencrypt.acme.storage=/certs/acme.json"
add_arg "--certificatesResolvers.letsencrypt.acme.httpChallenge.entryPoint=http"
add_arg "--certificatesResolvers.letsencrypt.acme.caserver=${TRAEFIK_ACME_CASERVER:-https://acme-v02.api.letsencrypt.org/directory}"
fi
# Add local certificate configuration if enabled
if [ "${TRAEFIK_SERVICES_TLS_CONFIG}" = "tls=true" ]; then
echo "Configuring Traefik with local certificates..."
add_arg "--providers.file.directory=/etc/traefik/dynamic"
add_arg "--providers.file.watch=true"
fi
# Warning if neither certificate method is enabled
if [ "${TRAEFIK_SERVICES_TLS_CONFIG}" != "tls=true" ] && [ "${TRAEFIK_SERVICES_TLS_CONFIG}" != "tls.certresolver=letsencrypt" ]; then
echo "WARNING: Neither Let's Encrypt nor local certificates are enabled."
echo "HTTPS will not work properly without certificate configuration."
fi
# Add any custom arguments from environment variable
if [ -n "${TRAEFIK_CUSTOM_ARGS}" ]; then
echo "Adding custom Traefik arguments: ${TRAEFIK_CUSTOM_ARGS}"
TRAEFIK_CMD="$TRAEFIK_CMD $TRAEFIK_CUSTOM_ARGS"
fi
# Add any additional arguments passed to the script
for arg in "$@"; do
add_arg "$arg"
done
# Print the final command for debugging
echo "Starting Traefik with command:"
echo "$TRAEFIK_CMD"
# Execute Traefik
exec $TRAEFIK_CMD

View File

@@ -0,0 +1,96 @@
---
services:
opencloud:
image: ${OC_DOCKER_IMAGE:-opencloudeu/opencloud-rolling}:${OC_DOCKER_TAG:-latest}
# changelog: https://github.com/opencloud-eu/opencloud/tree/main/changelog
# release notes: https://docs.opencloud.eu/opencloud_release_notes.html
user: ${OC_CONTAINER_UID_GID:-1000:1000}
networks:
opencloud-net:
proxy_net:
extra_hosts:
- "${OC_DOMAIN:-cloud.opencloud.test}:host-gateway"
entrypoint:
- /bin/sh
# run opencloud init to initialize a configuration file with random secrets
# it will fail on subsequent runs, because the config file already exists
# therefore we ignore the error and then start the opencloud server
command: ["-c", "opencloud init || true; opencloud server"]
environment:
# enable services that are not started automatically
OC_ADD_RUN_SERVICES: ${START_ADDITIONAL_SERVICES}
OC_URL: https://${OC_DOMAIN:-cloud.opencloud.test}${TRAEFIK_PORT_HTTPS:+:}${TRAEFIK_PORT_HTTPS:-}
OC_LOG_LEVEL: ${LOG_LEVEL:-info}
OC_LOG_COLOR: "true"
OC_LOG_PRETTY: "true"
# do not use SSL between the reverse proxy and OpenCloud
PROXY_TLS: "false"
# INSECURE: needed if OpenCloud / reverse proxy is using self generated certificates
OC_INSECURE: "${INSECURE:-false}"
# basic auth (not recommended, but needed for eg. WebDav clients that do not support OpenID Connect)
PROXY_ENABLE_BASIC_AUTH: "${PROXY_ENABLE_BASIC_AUTH:-false}"
# demo users
IDM_CREATE_DEMO_USERS: "${DEMO_USERS:-false}"
# admin password
IDM_ADMIN_PASSWORD: "${INITIAL_ADMIN_PASSWORD}"
# email server (if configured)
NOTIFICATIONS_SMTP_HOST: "${SMTP_HOST}"
NOTIFICATIONS_SMTP_PORT: "${SMTP_PORT}"
NOTIFICATIONS_SMTP_SENDER: "${SMTP_SENDER:-OpenCloud Notifications <notifications@cloud.opencloud.test>}"
NOTIFICATIONS_SMTP_USERNAME: "${SMTP_USERNAME}"
NOTIFICATIONS_SMTP_PASSWORD: "${SMTP_PASSWORD}"
NOTIFICATIONS_SMTP_INSECURE: "${SMTP_INSECURE:-false}"
NOTIFICATIONS_SMTP_AUTHENTICATION: "${SMTP_AUTHENTICATION}"
NOTIFICATIONS_SMTP_ENCRYPTION: "${SMTP_TRANSPORT_ENCRYPTION:-none}"
FRONTEND_ARCHIVER_MAX_SIZE: "10000000000"
FRONTEND_CHECK_FOR_UPDATES: "${CHECK_FOR_UPDATES:-true}"
# control the password enforcement and policy for public shares
OC_SHARING_PUBLIC_SHARE_MUST_HAVE_PASSWORD: "${OC_SHARING_PUBLIC_SHARE_MUST_HAVE_PASSWORD:-true}"
OC_SHARING_PUBLIC_WRITEABLE_SHARE_MUST_HAVE_PASSWORD: "${OC_SHARING_PUBLIC_WRITEABLE_SHARE_MUST_HAVE_PASSWORD:-false}"
OC_PASSWORD_POLICY_DISABLED: "${OC_PASSWORD_POLICY_DISABLED:-false}"
OC_PASSWORD_POLICY_MIN_CHARACTERS: "${OC_PASSWORD_POLICY_MIN_CHARACTERS:-8}"
OC_PASSWORD_POLICY_MIN_LOWERCASE_CHARACTERS: "${OC_PASSWORD_POLICY_MIN_LOWERCASE_CHARACTERS:-1}"
OC_PASSWORD_POLICY_MIN_UPPERCASE_CHARACTERS: "${OC_PASSWORD_POLICY_MIN_UPPERCASE_CHARACTERS:-1}"
OC_PASSWORD_POLICY_MIN_DIGITS: "${OC_PASSWORD_POLICY_MIN_DIGITS:-1}"
OC_PASSWORD_POLICY_MIN_SPECIAL_CHARACTERS: "${OC_PASSWORD_POLICY_MIN_SPECIAL_CHARACTERS:-1}"
volumes:
# configure the .env file to use own paths instead of docker internal volumes
- ${OC_CONFIG_DIR:-opencloud-config}:/etc/opencloud
- ${OC_DATA_DIR:-opencloud-data}:/var/lib/opencloud
deploy:
resources:
limits:
cpus: '4'
memory: 4G
reservations:
cpus: '2'
memory: 2G
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9200/"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
logging:
driver: ${LOG_DRIVER:-json-file}
options:
max-size: "100m"
max-file: "5"
restart: always
labels:
- "traefik.enable=true"
- "traefik.http.routers.opencloud.rule=Host(`${OC_DOMAIN:-cloud.opencloud.test}`)"
- "traefik.http.routers.opencloud.entrypoints=websecure"
- "traefik.http.routers.opencloud.tls.certresolver=letsencrypt"
- "traefik.http.services.opencloud.loadbalancer.server.port=9200"
- "homepage.group=Dev"
- "homepage.name=OpenCloud"
- "homepage.icon=owncloud.png"
- "homepage.href=https://${OC_DOMAIN:-cloud.opencloud.test}"
networks:
opencloud-net:
driver: bridge
proxy_net:
name: proxy_net
external: true

View File

@@ -0,0 +1,11 @@
---
# only expose the ports when you know what you are doing!
services:
collaboration:
ports:
# expose the wopi server on all interfaces
- "0.0.0.0:9300:9300"
collabora:
ports:
# expose the collabora server on all interfaces
- "0.0.0.0:9980:9980"

View File

@@ -0,0 +1,10 @@
---
services:
collaboration:
ports:
# expose the wopi server on localhost
- "127.0.0.1:9300:9300"
collabora:
ports:
# expose the collabora server on localhost
- "127.0.0.1:9980:9980"

View File

@@ -0,0 +1,8 @@
---
# only expose the ports when you know what you re doing!
services:
keycloak:
ports:
# expose the keycloak server on all interfaces
- "0.0.0.0:9000:9000"
- "0.0.0.0:8080:8080"

View File

@@ -0,0 +1,7 @@
services:
keycloak:
ports:
# expose the keycloak server on localhost
- "127.0.0.1:9000:9000"
- "127.0.0.1:8080:8080"

View File

@@ -0,0 +1,10 @@
---
# only expose the ports when you know what you are doing!
services:
opencloud:
environment:
# bind to all interfaces
PROXY_HTTP_ADDR: "0.0.0.0:9200"
ports:
# expose the opencloud server on all interfaces
- "0.0.0.0:9200:9200"

View File

@@ -0,0 +1,9 @@
---
services:
opencloud:
environment:
# bind to all interfaces
PROXY_HTTP_ADDR: "0.0.0.0:9200"
ports:
# expose the opencloud server on localhost
- "127.0.0.1:9200:9200"

View File

@@ -0,0 +1,36 @@
---
services:
opencloud:
environment:
# enable opaque access tokens
PROXY_OIDC_ACCESS_TOKEN_VERIFY_METHOD: "none"
PROXY_OIDC_SKIP_VERIFICATION: "false"
# Enable authelia usernames as username in OpenCloud (instead of an id)
# PROXY_USER_OIDC_CLAIM: "preferred_username"
# PROXY_AUTOPROVISION_CLAIM_USERNAME: "preferred_username"
PROXY_ROLE_ASSIGNMENT_OIDC_CLAIM: "groups"
WEB_OIDC_SCOPE: "openid profile email groups"
# The desktop client currently doesn't work when oidc assignment driver is used : https://github.com/opencloud-eu/desktop/issues/217
# That's why you only can use it to bootstrap your admin user currently (if you want to use the desktop client).
#
# 1. *Before* first startup: Switch to `PROXY_ROLE_ASSIGNMENT_DRIVER: "oidc"`
# 2. Start opencloud container to generate initial config: `docker compose up -d`
# 3. Map the `opencloud-admin` group from authelia to the `admin` role from OpenCloud in opencloud-config/opencloud.yaml :
#
# proxy:
# role_assignment:
# oidc_role_mapper:
# role_claim: groups
# role_mapping:
# - role_name: admin
# claim_value: opencloud-admin
#
# 4. Restart opencloud container: `docker compose restart opencloud`
# 5. Login with your admin user (the one with the `opencloud-admin` group)
# 6. Switch back to `PROXY_ROLE_ASSIGNMENT_DRIVER: "default"``
# 7. Recreate opencloud container: `docker compose up -d opencloud`
PROXY_ROLE_ASSIGNMENT_DRIVER: "default"
GRAPH_ASSIGN_DEFAULT_USER_ROLE: "true"

View File

@@ -0,0 +1,72 @@
---
services:
opencloud:
environment:
# Ldap IDP specific configuration
OC_LDAP_URI: ldaps://ldap-server:1636
OC_LDAP_INSECURE: "true"
OC_LDAP_BIND_DN: "cn=admin,dc=opencloud,dc=eu"
OC_LDAP_BIND_PASSWORD: ${LDAP_BIND_PASSWORD:-admin}
OC_LDAP_GROUP_BASE_DN: "ou=groups,dc=opencloud,dc=eu"
OC_LDAP_USER_BASE_DN: "ou=users,dc=opencloud,dc=eu"
OC_LDAP_USER_FILTER: "(objectclass=inetOrgPerson)"
GRAPH_LDAP_SERVER_UUID: "false"
GRAPH_LDAP_REFINT_ENABLED: "true" # osixia has refint enabled.
FRONTEND_READONLY_USER_ATTRIBUTES: "user.onPremisesSamAccountName,user.displayName,user.mail,user.passwordProfile,user.accountEnabled,user.appRoleAssignments"
PROXY_OIDC_REWRITE_WELLKNOWN: "true"
WEB_OIDC_CLIENT_ID: ${OC_OIDC_CLIENT_ID:-web}
PROXY_ROLE_ASSIGNMENT_DRIVER: "oidc"
OC_OIDC_ISSUER: ${IDP_ISSUER_URL:-https://keycloak.opencloud.test/realms/openCloud}
# This specifies to start all services except idm and idp. These are replaced by external services.
OC_EXCLUDE_RUN_SERVICES: idm,idp
# IdP specific configuration for auto-provisioning
OC_LDAP_SERVER_WRITE_ENABLED: "true"
PROXY_AUTOPROVISION_ACCOUNTS: "true"
# Use the `sub` claim from the IdP for the user ID
# Most IdPs use the internal user ID as the `sub` claim
PROXY_USER_OIDC_CLAIM: "sub"
# Use the `sub` claim as identifier during autoprovisioning
# That mitigates problems when a user is renamed in the IdP
PROXY_AUTOPROVISION_CLAIM_USERNAME: "sub"
PROXY_USER_CS3_CLAIM: "username"
# This is the default value, we need to set it here because we overwrite the values
OC_LDAP_USER_SCHEMA_ID: "opencloudUUID"
# This is the default value, we need to set it here because we overwrite the values
OC_LDAP_GROUP_SCHEMA_ID: "opencloudUUID"
# This is the default value, we need to set it here because we overwrite the values
OC_LDAP_DISABLE_USER_MECHANISM: "attribute"
OC_ADMIN_USER_ID: ""
SETTINGS_SETUP_DEFAULT_ASSIGNMENTS: "false"
GRAPH_ASSIGN_DEFAULT_USER_ROLE: "false"
GRAPH_USERNAME_MATCH: "none"
# We need to set the IDP_DOMAIN to allow the CSP rules to be set correctly
IDP_DOMAIN: ${IDP_DOMAIN:-keycloak.opencloud.test}
# The openCloud users need to be able to edit their account in the externa IdP
WEB_OPTION_ACCOUNT_EDIT_LINK_HREF: ${IDP_ACCOUNT_URL}
ldap-server:
image: bitnamilegacy/openldap:2.6
networks:
opencloud-net:
entrypoint: [ "/bin/sh", "/opt/bitnami/scripts/openldap/docker-entrypoint-override.sh", "/opt/bitnami/scripts/openldap/run.sh" ]
environment:
BITNAMI_DEBUG: true
LDAP_TLS_VERIFY_CLIENT: never
LDAP_ENABLE_TLS: "yes"
LDAP_TLS_CA_FILE: /opt/bitnami/openldap/share/openldap.crt
LDAP_TLS_CERT_FILE: /opt/bitnami/openldap/share/openldap.crt
LDAP_TLS_KEY_FILE: /opt/bitnami/openldap/share/openldap.key
LDAP_ROOT: "dc=opencloud,dc=eu"
LDAP_ADMIN_PASSWORD: ${LDAP_BIND_PASSWORD:-admin}
volumes:
# Only use the base ldif file to create the base structure
- ./config/ldap/ldif/10_base.ldif:/ldifs/10_base.ldif
# Use the custom schema from opencloud because we are in full control of the ldap server
- ./config/ldap/schemas/10_opencloud_schema.ldif:/schemas/10_opencloud_schema.ldif
- ./config/ldap/docker-entrypoint-override.sh:/opt/bitnami/scripts/openldap/docker-entrypoint-override.sh
- ${LDAP_CERTS_DIR:-ldap-certs}:/opt/bitnami/openldap/share
- ${LDAP_DATA_DIR:-ldap-data}:/bitnami/openldap
restart: always
volumes:
ldap-certs:
ldap-data:

View File

@@ -0,0 +1,112 @@
---
services:
opencloud:
environment:
# Ldap IDP specific configuration
OC_LDAP_URI: ldaps://ldap-server:1636
OC_LDAP_INSECURE: "true"
OC_LDAP_BIND_DN: "cn=admin,dc=opencloud,dc=eu"
OC_LDAP_BIND_PASSWORD: ${LDAP_BIND_PASSWORD:-admin}
OC_LDAP_GROUP_BASE_DN: "ou=groups,dc=opencloud,dc=eu"
OC_LDAP_GROUP_SCHEMA_ID: "entryUUID"
OC_LDAP_USER_BASE_DN: "ou=users,dc=opencloud,dc=eu"
OC_LDAP_USER_FILTER: "(objectclass=inetOrgPerson)"
OC_LDAP_USER_SCHEMA_ID: "entryUUID"
OC_LDAP_DISABLE_USER_MECHANISM: "none"
GRAPH_LDAP_SERVER_UUID: "true"
GRAPH_LDAP_GROUP_CREATE_BASE_DN: "ou=custom,ou=groups,dc=opencloud,dc=eu"
GRAPH_LDAP_REFINT_ENABLED: "true" # osixia has refint enabled.
FRONTEND_READONLY_USER_ATTRIBUTES: "user.onPremisesSamAccountName,user.displayName,user.mail,user.passwordProfile,user.accountEnabled,user.appRoleAssignments"
OC_LDAP_SERVER_WRITE_ENABLED: "false" # the ldap is managed by Keycloak, so it is not writable by OpenCloud
# This specifies to start all services except idm and idp. These are replaced by external services.
OC_EXCLUDE_RUN_SERVICES: idm,idp
# Keycloak IDP specific configuration
PROXY_AUTOPROVISION_ACCOUNTS: "false"
PROXY_ROLE_ASSIGNMENT_DRIVER: "oidc"
OC_OIDC_ISSUER: https://${KEYCLOAK_DOMAIN:-keycloak.opencloud.test}/realms/openCloud
PROXY_OIDC_REWRITE_WELLKNOWN: "true"
WEB_OIDC_CLIENT_ID: ${OC_OIDC_CLIENT_ID:-web}
PROXY_USER_OIDC_CLAIM: "uuid"
PROXY_USER_CS3_CLAIM: "userid"
WEB_OPTION_ACCOUNT_EDIT_LINK_HREF: "https://${KEYCLOAK_DOMAIN:-keycloak.opencloud.test}/realms/openCloud/account"
# admin and demo accounts must be created in Keycloak
OC_ADMIN_USER_ID: ""
SETTINGS_SETUP_DEFAULT_ASSIGNMENTS: "false"
GRAPH_ASSIGN_DEFAULT_USER_ROLE: "false"
GRAPH_USERNAME_MATCH: "none"
# This is needed to set the correct CSP rules for OpenCloud
IDP_DOMAIN: ${KEYCLOAK_DOMAIN:-keycloak.opencloud.test}
ldap-server:
image: bitnamilegacy/openldap:2.6
networks:
opencloud-net:
entrypoint: [ "/bin/sh", "/opt/bitnami/scripts/openldap/docker-entrypoint-override.sh", "/opt/bitnami/scripts/openldap/run.sh" ]
environment:
BITNAMI_DEBUG: true
LDAP_TLS_VERIFY_CLIENT: never
LDAP_ENABLE_TLS: "yes"
LDAP_TLS_CA_FILE: /opt/bitnami/openldap/share/openldap.crt
LDAP_TLS_CERT_FILE: /opt/bitnami/openldap/share/openldap.crt
LDAP_TLS_KEY_FILE: /opt/bitnami/openldap/share/openldap.key
LDAP_ROOT: "dc=opencloud,dc=eu"
LDAP_ADMIN_PASSWORD: ${LDAP_BIND_PASSWORD:-admin}
volumes:
- ./config/ldap/ldif/10_base.ldif:/ldifs/10_base.ldif
- ./config/ldap/ldif/20_admin.ldif:/ldifs/20_admin.ldif
- ./config/ldap/ldif/50_acls.ldif:/opt/bitnami/openldap/etc/schema/50_acls.ldif
- ./config/ldap/init-ldap-acls.sh:/docker-entrypoint-initdb.d/init-ldap-acls.sh
- ./config/ldap/docker-entrypoint-override.sh:/opt/bitnami/scripts/openldap/docker-entrypoint-override.sh
- ldap-certs:/opt/bitnami/openldap/share
- ldap-data:/bitnami/openldap
logging:
driver: ${LOG_DRIVER:-local}
restart: always
postgres:
image: postgres:17-alpine
networks:
opencloud-net:
volumes:
- keycloak_postgres_data:/var/lib/postgresql/data
environment:
POSTGRES_DB: keycloak
POSTGRES_USER: ${KC_DB_USERNAME:-keycloak}
POSTGRES_PASSWORD: ${KC_DB_PASSWORD:-keycloak}
logging:
driver: ${LOG_DRIVER:-local}
restart: always
keycloak:
image: quay.io/keycloak/keycloak:26.3.3
networks:
opencloud-net:
command: [ "start", "--spi-connections-http-client-default-disable-trust-manager=${INSECURE:-false}", "--import-realm" ]
entrypoint: [ "/bin/sh", "/opt/keycloak/bin/docker-entrypoint-override.sh" ]
volumes:
- "./config/keycloak/docker-entrypoint-override.sh:/opt/keycloak/bin/docker-entrypoint-override.sh"
- "./config/keycloak/opencloud-realm.dist.json:/opt/keycloak/data/import-dist/openCloud-realm.json"
- "./config/keycloak/themes/opencloud:/opt/keycloak/themes/opencloud"
environment:
LDAP_ADMIN_PASSWORD: ${LDAP_BIND_PASSWORD:-admin}
OC_DOMAIN: ${OC_DOMAIN:-cloud.opencloud.test}
KC_HOSTNAME: ${KEYCLOAK_DOMAIN:-keycloak.opencloud.test}
KC_DB: postgres
KC_DB_URL: "jdbc:postgresql://postgres:5432/keycloak"
KC_DB_USERNAME: ${KC_DB_USERNAME:-keycloak}
KC_DB_PASSWORD: ${KC_DB_PASSWORD:-keycloak}
KC_FEATURES: impersonation
KC_PROXY_HEADERS: xforwarded
KC_HTTP_ENABLED: true
KEYCLOAK_ADMIN: ${KEYCLOAK_ADMIN:-kcadmin}
KEYCLOAK_ADMIN_PASSWORD: ${KEYCLOAK_ADMIN_PASSWORD:-admin}
depends_on:
- postgres
logging:
driver: ${LOG_DRIVER:-local}
restart: always
volumes:
keycloak_postgres_data:
ldap-certs:
ldap-data:

View File

@@ -0,0 +1,7 @@
---
services:
collaboration:
environment:
# metrics
COLLABORATION_DEBUG_ADDR: 0.0.0.0:9304

View File

@@ -0,0 +1,13 @@
---
services:
opencloud:
environment:
# metrics
# if OpenCloud runs as a single process, all <debug>/metrics endpoints
# will expose the same metrics, so it's sufficient to query one endpoint
PROXY_DEBUG_ADDR: 0.0.0.0:9205
networks:
opencloud-net:
external: true

View File

@@ -0,0 +1,20 @@
---
services:
tika:
image: ${TIKA_IMAGE:-apache/tika:latest}
# Using the base variant for smaller image size and faster startup
# The base variant includes core functionality for text extraction
# Full variant is only needed for specialized OCR/image processing
# release notes: https://tika.apache.org
networks:
opencloud-net:
restart: always
logging:
driver: ${LOG_DRIVER:-local}
opencloud:
environment:
# fulltext search
SEARCH_EXTRACTOR_TYPE: tika
SEARCH_EXTRACTOR_TIKA_TIKA_URL: http://tika:9998
FRONTEND_FULL_TEXT_SEARCH_ENABLED: "true"

View File

@@ -0,0 +1,15 @@
---
services:
opencloud:
environment:
# activate decomposeds3 storage driver
STORAGE_USERS_DRIVER: decomposeds3
# keep system data on opencloud storage since this are only small files atm
STORAGE_SYSTEM_DRIVER: decomposed
# decomposeds3 specific settings
STORAGE_USERS_DECOMPOSEDS3_ENDPOINT: ${DECOMPOSEDS3_ENDPOINT:-http://minio:9000}
STORAGE_USERS_DECOMPOSEDS3_REGION: ${DECOMPOSEDS3_REGION:-default}
STORAGE_USERS_DECOMPOSEDS3_ACCESS_KEY: ${DECOMPOSEDS3_ACCESS_KEY:-opencloud}
STORAGE_USERS_DECOMPOSEDS3_SECRET_KEY: ${DECOMPOSEDS3_SECRET_KEY:-opencloud-secret-key}
STORAGE_USERS_DECOMPOSEDS3_BUCKET: ${DECOMPOSEDS3_BUCKET:-opencloud-bucket}
STORAGE_USERS_EVENTS_NUM_CONSUMERS: ${DECOMPOSEDS3_EVENTS_NUM_CONSUMERS:-5}

View File

@@ -0,0 +1,46 @@
---
services:
postgres:
image: postgres:17-alpine
networks:
opencloud-net:
volumes:
- keycloak_postgres_data:/var/lib/postgresql/data
environment:
POSTGRES_DB: keycloak
POSTGRES_USER: ${KC_DB_USERNAME:-keycloak}
POSTGRES_PASSWORD: ${KC_DB_PASSWORD:-keycloak}
logging:
driver: ${LOG_DRIVER:-local}
restart: always
keycloak:
image: quay.io/keycloak/keycloak:26.3.3
networks:
opencloud-net:
command: [ "start", "--spi-connections-http-client-default-disable-trust-manager=${INSECURE:-false}", "--import-realm" ]
entrypoint: [ "/bin/sh", "/opt/keycloak/bin/docker-entrypoint-override.sh" ]
volumes:
- "./config/keycloak/docker-entrypoint-override.sh:/opt/keycloak/bin/docker-entrypoint-override.sh"
- "./config/keycloak/opencloud-realm-autoprovisioning.dist.json:/opt/keycloak/data/import-dist/openCloud-realm.json"
- "./config/keycloak/themes/opencloud:/opt/keycloak/themes/opencloud"
environment:
OC_DOMAIN: ${OC_DOMAIN:-cloud.opencloud.test}
KC_HOSTNAME: ${KEYCLOAK_DOMAIN:-keycloak.opencloud.test}
KC_DB: postgres
KC_DB_URL: "jdbc:postgresql://postgres:5432/keycloak"
KC_DB_USERNAME: ${KC_DB_USERNAME:-keycloak}
KC_DB_PASSWORD: ${KC_DB_PASSWORD:-keycloak}
KC_FEATURES: impersonation
KC_PROXY_HEADERS: xforwarded
KC_HTTP_ENABLED: true
KEYCLOAK_ADMIN: ${KEYCLOAK_ADMIN:-kcadmin}
KEYCLOAK_ADMIN_PASSWORD: ${KEYCLOAK_ADMIN_PASSWORD:-admin}
depends_on:
- postgres
logging:
driver: ${LOG_DRIVER:-local}
restart: always
volumes:
keycloak_postgres_data:

View File

@@ -0,0 +1,24 @@
---
# This file can be used to be added to the opencloud_full example
# to browse the LDAP server with a web interface.
# This is not a production ready setup.
services:
ldap-manager:
image: phpldapadmin/phpldapadmin:latest
networks:
opencloud-net:
environment:
LDAP_HOST: ldap-server
LDAP_PORT: 1389
LDAP_LOGIN_OBJECTCLASS: "inetOrgPerson"
APP_URL: "https://${LDAP_MANAGER_DOMAIN:-ldap.opencloud.test}"
labels:
- "traefik.enable=true"
- "traefik.http.routers.ldap-manager.entrypoints=https"
- "traefik.http.routers.ldap-manager.rule=Host(`${LDAP_MANAGER_DOMAIN:-ldap.opencloud.test}`)"
- "traefik.http.routers.ldap-manager.${TRAEFIK_SERVICES_TLS_CONFIG}"
- "traefik.http.routers.ldap-manager.service=ldap-manager"
- "traefik.http.services.ldap-manager.loadbalancer.server.port=8080"
logging:
driver: ${LOG_DRIVER:-local}
restart: always

View File

@@ -0,0 +1,24 @@
---
services:
traefik:
networks:
opencloud-net:
aliases:
- ${COLLABORA_DOMAIN:-collabora.opencloud.test}
- ${WOPISERVER_DOMAIN:-wopiserver.opencloud.test}
collaboration:
labels:
- "traefik.enable=true"
- "traefik.http.routers.collaboration.entrypoints=https"
- "traefik.http.routers.collaboration.rule=Host(`${WOPISERVER_DOMAIN:-wopiserver.opencloud.test}`)"
- "traefik.http.routers.collaboration.${TRAEFIK_SERVICES_TLS_CONFIG}"
- "traefik.http.routers.collaboration.service=collaboration"
- "traefik.http.services.collaboration.loadbalancer.server.port=9300"
collabora:
labels:
- "traefik.enable=true"
- "traefik.http.routers.collabora.entrypoints=https"
- "traefik.http.routers.collabora.rule=Host(`${COLLABORA_DOMAIN:-collabora.opencloud.test}`)"
- "traefik.http.routers.collabora.${TRAEFIK_SERVICES_TLS_CONFIG}"
- "traefik.http.routers.collabora.service=collabora"
- "traefik.http.services.collabora.loadbalancer.server.port=9980"

View File

@@ -0,0 +1,15 @@
---
services:
traefik:
networks:
opencloud-net:
aliases:
- ${KEYCLOAK_DOMAIN:-keycloak.opencloud.test}
keycloak:
labels:
- "traefik.enable=true"
- "traefik.http.routers.keycloak.entrypoints=https"
- "traefik.http.routers.keycloak.rule=Host(`${KEYCLOAK_DOMAIN:-keycloak.opencloud.test}`)"
- "traefik.http.routers.keycloak.${TRAEFIK_SERVICES_TLS_CONFIG}"
- "traefik.http.routers.keycloak.service=keycloak"
- "traefik.http.services.keycloak.loadbalancer.server.port=8080"

View File

@@ -0,0 +1,47 @@
---
services:
opencloud:
labels:
- "traefik.enable=true"
- "traefik.http.routers.opencloud.entrypoints=https"
- "traefik.http.routers.opencloud.rule=Host(`${OC_DOMAIN:-cloud.opencloud.test}`)"
- "traefik.http.routers.opencloud.service=opencloud"
- "traefik.http.services.opencloud.loadbalancer.server.port=9200"
- "traefik.http.routers.opencloud.${TRAEFIK_SERVICES_TLS_CONFIG}"
traefik:
image: traefik:v3.6.4
# release notes: https://github.com/traefik/traefik/releases
user: ${TRAEFIK_CONTAINER_UID_GID:-0:0}
networks:
opencloud-net:
aliases:
- ${OC_DOMAIN:-cloud.opencloud.test}
entrypoint: [ "/bin/sh", "/opt/traefik/bin/docker-entrypoint-override.sh"]
environment:
- "TRAEFIK_SERVICES_TLS_CONFIG=${TRAEFIK_SERVICES_TLS_CONFIG:-tls.certresolver=letsencrypt}"
- "TRAEFIK_ACME_MAIL=${TRAEFIK_ACME_MAIL:-example@example.org}"
- "TRAEFIK_ACME_CASERVER=${TRAEFIK_ACME_CASERVER:-https://acme-v02.api.letsencrypt.org/directory}"
- "TRAEFIK_LOG_LEVEL=${TRAEFIK_LOG_LEVEL:-ERROR}"
- "TRAEFIK_ACCESS_LOG=${TRAEFIK_ACCESS_LOG:-false}"
- "TRAEFIK_PORT_HTTP=${TRAEFIK_PORT_HTTP:-80}"
- "TRAEFIK_PORT_HTTPS=${TRAEFIK_PORT_HTTPS:-443}"
ports:
- "${TRAEFIK_PORT_HTTP:-80}:${TRAEFIK_PORT_HTTP:-80}"
- "${TRAEFIK_PORT_HTTPS:-443}:${TRAEFIK_PORT_HTTPS:-443}"
volumes:
- "${DOCKER_SOCKET_PATH:-/var/run/docker.sock}:/var/run/docker.sock:ro"
- "./config/traefik/docker-entrypoint-override.sh:/opt/traefik/bin/docker-entrypoint-override.sh"
- "${TRAEFIK_CERTS_DIR:-./certs}:/certs"
- "./config/traefik/dynamic:/etc/traefik/dynamic"
labels:
- "traefik.enable=${TRAEFIK_DASHBOARD:-false}"
# defaults to admin:admin
- "traefik.http.middlewares.traefik-auth.basicauth.users=${TRAEFIK_BASIC_AUTH_USERS:-admin:$$apr1$$4vqie50r$$YQAmQdtmz5n9rEALhxJ4l.}"
- "traefik.http.routers.traefik.entrypoints=https"
- "traefik.http.routers.traefik.rule=Host(`${TRAEFIK_DOMAIN:-traefik.opencloud.test}`)"
- "traefik.http.routers.traefik.middlewares=traefik-auth"
- "traefik.http.routers.traefik.${TRAEFIK_SERVICES_TLS_CONFIG}"
- "traefik.http.routers.traefik.service=api@internal"
logging:
driver: ${LOG_DRIVER:-local}
restart: always

View File

@@ -0,0 +1,84 @@
---
services:
opencloud:
environment:
# this is needed for setting the correct CSP header
COLLABORA_DOMAIN: ${COLLABORA_DOMAIN:-collabora.opencloud.test}
TRAEFIK_PORT_HTTPS: ${TRAEFIK_PORT_HTTPS:+:}${TRAEFIK_PORT_HTTPS:-}
# expose nats and the reva gateway for the collaboration service
NATS_NATS_HOST: 0.0.0.0
GATEWAY_GRPC_ADDR: 0.0.0.0:9142
# make collabora the secure view app
FRONTEND_APP_HANDLER_SECURE_VIEW_APP_ADDR: eu.opencloud.api.collaboration
GRAPH_AVAILABLE_ROLES: "b1e2218d-eef8-4d4c-b82d-0f1a1b48f3b5,a8d5fe5e-96e3-418d-825b-534dbdf22b99,fb6c3e19-e378-47e5-b277-9732f9de6e21,58c63c02-1d89-4572-916a-870abc5a1b7d,2d00ce52-1fc2-4dbc-8b95-a73b73395f5a,1c996275-f1c9-4e71-abdf-a42f6495e960,312c0871-5ef7-4b3a-85b6-0e4074c64049,aa97fe03-7980-45ac-9e50-b325749fd7e6"
collaboration:
image: ${OC_DOCKER_IMAGE:-opencloudeu/opencloud-rolling}:${OC_DOCKER_TAG:-latest}
user: ${OC_CONTAINER_UID_GID:-1000:1000}
networks:
opencloud-net:
depends_on:
opencloud:
condition: service_started
collabora:
condition: service_healthy
entrypoint:
- /bin/sh
command: [ "-c", "opencloud collaboration server" ]
environment:
COLLABORATION_GRPC_ADDR: 0.0.0.0:9301
COLLABORATION_HTTP_ADDR: 0.0.0.0:9300
MICRO_REGISTRY: "nats-js-kv"
MICRO_REGISTRY_ADDRESS: "opencloud:9233"
COLLABORATION_WOPI_SRC: https://${WOPISERVER_DOMAIN:-wopiserver.opencloud.test}${TRAEFIK_PORT_HTTPS:+:}${TRAEFIK_PORT_HTTPS:-}
COLLABORATION_APP_NAME: "CollaboraOnline"
COLLABORATION_APP_PRODUCT: "Collabora"
COLLABORATION_APP_ADDR: https://${COLLABORA_DOMAIN:-collabora.opencloud.test}${TRAEFIK_PORT_HTTPS:+:}${TRAEFIK_PORT_HTTPS:-}
COLLABORATION_APP_ICON: https://${COLLABORA_DOMAIN:-collabora.opencloud.test}${TRAEFIK_PORT_HTTPS:+:}${TRAEFIK_PORT_HTTPS:-}/favicon.ico
COLLABORATION_APP_INSECURE: "${INSECURE:-true}"
COLLABORATION_CS3API_DATAGATEWAY_INSECURE: "${INSECURE:-true}"
COLLABORATION_LOG_LEVEL: ${LOG_LEVEL:-info}
OC_URL: https://${OC_DOMAIN:-cloud.opencloud.test}${TRAEFIK_PORT_HTTPS:+:}${TRAEFIK_PORT_HTTPS:-}
volumes:
# configure the .env file to use own paths instead of docker internal volumes
- ${OC_CONFIG_DIR:-opencloud-config}:/etc/opencloud
logging:
driver: ${LOG_DRIVER:-local}
restart: always
collabora:
image: collabora/code:25.04.7.1.1
# release notes: https://www.collaboraonline.com/release-notes/
networks:
opencloud-net:
environment:
aliasgroup1: https://${WOPISERVER_DOMAIN:-wopiserver.opencloud.test}${TRAEFIK_PORT_HTTPS:+:}${TRAEFIK_PORT_HTTPS:-}
DONT_GEN_SSL_CERT: "YES"
extra_params: |
--o:ssl.enable=${COLLABORA_SSL_ENABLE:-true} \
--o:ssl.ssl_verification=${COLLABORA_SSL_VERIFICATION:-true} \
--o:ssl.termination=true \
--o:welcome.enable=false \
--o:net.frame_ancestors=${OC_DOMAIN:-cloud.opencloud.test}${TRAEFIK_PORT_HTTPS:+:}${TRAEFIK_PORT_HTTPS:-} \
--o:net.lok_allow.host[14]=${OC_DOMAIN:-cloud.opencloud.test}${TRAEFIK_PORT_HTTPS:+:}${TRAEFIK_PORT_HTTPS:-} \
--o:home_mode.enable=${COLLABORA_HOME_MODE:-false}
username: ${COLLABORA_ADMIN_USER:-admin}
password: ${COLLABORA_ADMIN_PASSWORD:-admin}
cap_add:
- MKNOD
volumes:
# Mount local TrueType fonts so the container can use system fonts
# (e.g. Microsoft fonts like Arial, Calibri, Cambria by installing the `ttf-mscorefonts-installer` package).
- /usr/share/fonts/truetype:/usr/share/fonts/truetype/more:ro
- /usr/share/fonts/truetype:/opt/cool/systemplate/usr/share/fonts/truetype/more:ro
logging:
driver: ${LOG_DRIVER:-local}
restart: always
entrypoint: [ '/bin/bash', '-c' ]
command: [ 'coolconfig generate-proof-key && /start-collabora-online.sh' ]
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:9980/hosting/discovery" ]
interval: 15s
timeout: 10s
retries: 5

114
restore.sh Executable file
View File

@@ -0,0 +1,114 @@
#!/bin/bash
# Restore script for JMP Server backups
# Usage: ./restore.sh [backup-file.tar.gz]
set -e
set -u
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"
BACKUP_DIR="$SCRIPT_DIR/backups"
RESTORE_DIR="$SCRIPT_DIR/restore-temp"
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
echo -e "${YELLOW}=== JMP Server Restore ===${NC}"
echo ""
# List available backups if no argument provided
if [ -z "${1:-}" ]; then
echo "Available backups:"
echo ""
ls -lht "$BACKUP_DIR"/*.tar.gz 2>/dev/null | head -10 || echo "No backups found in $BACKUP_DIR"
echo ""
echo -e "${YELLOW}Usage:${NC} $0 <backup-file.tar.gz>"
echo -e "${YELLOW}Example:${NC} $0 backup-2025-01-05T03-00-00.tar.gz"
exit 1
fi
BACKUP_FILE="$1"
# Check if backup file exists (support both full path and filename only)
if [ -f "$BACKUP_FILE" ]; then
BACKUP_PATH="$BACKUP_FILE"
elif [ -f "$BACKUP_DIR/$BACKUP_FILE" ]; then
BACKUP_PATH="$BACKUP_DIR/$BACKUP_FILE"
else
echo -e "${RED}Error: Backup file not found: $BACKUP_FILE${NC}"
exit 1
fi
# Validate backup file integrity
echo "Validating backup file integrity..."
if ! tar -tzf "$BACKUP_PATH" >/dev/null 2>&1; then
echo -e "${RED}Error: Backup file is corrupted or not a valid tar.gz archive${NC}"
exit 1
fi
echo "✓ Backup file is valid"
echo ""
echo -e "${YELLOW}WARNING: This will restore data from backup and overwrite current data!${NC}"
echo "Backup file: $BACKUP_PATH"
echo "Backup size: $(du -h "$BACKUP_PATH" | cut -f1)"
echo ""
read -p "Are you sure you want to continue? (yes/no): " CONFIRM
if [ "$CONFIRM" != "yes" ]; then
echo "Restore cancelled."
exit 0
fi
echo ""
echo "Step 1: Stopping all services..."
docker compose down
echo ""
echo "Step 2: Creating restore directory..."
rm -rf "$RESTORE_DIR"
mkdir -p "$RESTORE_DIR"
echo ""
echo "Step 3: Extracting backup..."
tar -xzf "$BACKUP_PATH" -C "$RESTORE_DIR"
echo ""
echo "Step 4: Restoring data..."
# Restore each backup source
restore_dir() {
local src="$1"
local dest="$2"
if [ -d "$RESTORE_DIR/$src" ]; then
echo " Restoring $src -> $dest"
rm -rf "$dest"
cp -a "$RESTORE_DIR/$src" "$dest"
else
echo " Skipping $src (not in backup)"
fi
}
restore_dir "gitea-data" "./gitea/data"
restore_dir "gitea-db" "./gitea/db"
restore_dir "bookstack-app" "./bookstack/app"
restore_dir "bookstack-db" "./bookstack/db"
restore_dir "vikunja-files" "./vikunja/files"
restore_dir "vikunja-db" "./vikunja/db"
restore_dir "radicale-data" "./radicale/data"
restore_dir "homepage" "./homepage"
echo ""
echo "Step 5: Cleaning up..."
rm -rf "$RESTORE_DIR"
echo ""
echo "Step 6: Starting services..."
docker compose up -d
echo ""
echo -e "${GREEN}Restore completed successfully!${NC}"
echo "Services are starting up. Check status with: docker compose ps"

32
start.sh Executable file
View File

@@ -0,0 +1,32 @@
#!/bin/bash
# JMP Server startup script
# Starts all Docker Compose services including main stack and OpenCloud
set -e
set -u
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"
# Validate prerequisites
command -v docker >/dev/null 2>&1 || { echo "Error: docker is not installed"; exit 1; }
# command -v docker-compose >/dev/null 2>&1 || { echo "Error: docker-compose is not installed"; exit 1; }
echo "=== Starting JMP Server ==="
echo ""
echo "Starting main services..."
docker compose up -d
echo "✓ Main services started"
echo ""
echo "Setting up OpenCloud..."
mkdir -p opencloud-compose/opencloud/{config,data} || { echo "Error: Failed to create OpenCloud directories"; exit 1; }
chown -R 1000:1000 opencloud-compose/opencloud || { echo "Error: Failed to set OpenCloud permissions"; exit 1; }
docker compose -f opencloud-compose/docker-compose.yml -f opencloud-compose/external-proxy/opencloud-exposed.yml -f opencloud-compose/storage/decomposeds3.yml up -d
echo "✓ OpenCloud started"
echo ""
echo "=== Startup Complete ==="
echo "Check service status with: docker compose ps"
echo "View logs with: docker compose logs -f [service-name]"

31
stop.sh Executable file
View File

@@ -0,0 +1,31 @@
#!/bin/bash
# JMP Server shutdown script
# Stops all Docker Compose services including main stack and OpenCloud
set -e
set -u
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"
echo "=== Stopping JMP Server ==="
echo ""
echo "Stopping main services..."
docker compose down || {
echo "Warning: Main services stop encountered issues"
exit 1
}
echo "✓ Main services stopped"
echo ""
echo "Stopping OpenCloud..."
docker compose -f opencloud-compose/docker-compose.yml -f opencloud-compose/external-proxy/opencloud-exposed.yml -f opencloud-compose/storage/decomposeds3.yml down || {
echo "Warning: OpenCloud services stop encountered issues"
exit 1
}
echo "✓ OpenCloud stopped"
echo ""
echo "=== Shutdown Complete ==="
echo "To start services: ./start.sh"

71
traefik.yml Normal file
View File

@@ -0,0 +1,71 @@
global:
checkNewVersion: true
sendAnonymousUsage: false
# 1. EntryPoints Definition
# We define the ports Traefik listens on.
# HTTP (80) automatically redirects to HTTPS (443).
# SMTP (25) is passthrough for Mailman.
entryPoints:
web:
address: ":80"
http:
redirections:
entryPoint:
to: websecure
scheme: https
permanent: true
websecure:
address: ":443"
http:
tls:
certResolver: letsencrypt
# 2. Providers
# Traefik watches the Docker socket to discover services.
providers:
docker:
endpoint: "unix:///var/run/docker.sock"
exposedByDefault: false # Containers are ignored unless they have "traefik.enable=true"
network: proxy_net # Must match the network name in docker-compose.yml
# # Optional: Watch a directory for dynamic config files (good for custom TLS certs or middlewares)
# file:
# directory: /etc/traefik/dynamic
# watch: true
# 3. API & Dashboard
# The dashboard is enabled but "insecure" mode is OFF.
# Access is protected by the Basic Auth middleware defined in docker-compose.yml.
api:
dashboard: true
insecure: false
debug: false
# Health check ping endpoint
ping:
entryPoint: web
# 4. Certificate Resolver (Let's Encrypt)
# Uses the HTTP Challenge, which requires Port 80 to be open.
certificatesResolvers:
letsencrypt:
acme:
email: info@jmpgames.it
storage: /acme.json # This file is persisted via Docker volume
httpChallenge:
entryPoint: web
# 5. Logging
# Access logs are written to a file that Fail2Ban on the host will monitor.
accessLog:
filePath: "/var/log/traefik/access.log"
bufferingSize: 100 # Buffer lines slightly to reduce I/O, but keep low for Fail2Ban responsiveness
filters:
statusCodes:
- "400-499"
- "500-599"
log:
level: INFO

315
website.patch Normal file

File diff suppressed because one or more lines are too long