diff --git a/sso_test_server/authentik/add_key.sh b/sso_test_server/authentik/add_key.sh new file mode 100644 index 0000000..3fa083e --- /dev/null +++ b/sso_test_server/authentik/add_key.sh @@ -0,0 +1,2 @@ +echo "AUTHENTIK_SECRET_KEY=$(openssl rand 60 | base64 -w 0)" >> .env + diff --git a/sso_test_server/authentik/compose.yaml b/sso_test_server/authentik/compose.yaml new file mode 100644 index 0000000..758f2a4 --- /dev/null +++ b/sso_test_server/authentik/compose.yaml @@ -0,0 +1,78 @@ +services: + authentikserver: + image: "ghcr.io/goauthentik/server:2024.6.1" + container_name: authentikserver + hostname: authentikserver + restart: always + + command: server + + volumes: + - authentik_media:/media + - authentik_custom_templates:/templates + - /var/run/docker.sock:/var/run/docker.sock + + ports: + - 9000:9000 + - 9443:9443 + + environment: + AUTHENTIK_REDIS__HOST: authentikredis + AUTHENTIK_POSTGRESQL__HOST: authentikpostgres + AUTHENTIK_POSTGRESQL__USER: authentik + AUTHENTIK_POSTGRESQL__NAME: authentik + AUTHENTIK_POSTGRESQL__PASSWORD: ${ROOT_PASSWORD} + AUTHENTIK_SECRET_KEY: ${AUTHENTIK_SECRET_KEY} + AUTHENTIK_EMAIL__HOST: "overleafsmtpd" + AUTHENTIK_EMAIL__PORT: "25" + AUTHENTIK_EMAIL__USE_TLS: "false" + AUTHENTIK_EMAIL__USE_SSL: "false" + # AUTHENTIK_EMAIL__TIMEOUT: 10 + AUTHENTIK_EMAIL__FROM: "overleaf@neuro.uni-bremen.de" + AUTHENTIK_ERROR_REPORTING__ENABLED: "true" + networks: + - overleaf-network + + authentikworker: + image: "ghcr.io/goauthentik/server:2024.6.1" + container_name: authentikworker + hostname: authentikworker + restart: always + + command: worker + + volumes: + - authentik_media:/media + - authentik_custom_templates:/templates + - authentik_certs:/certs + - /var/run/docker.sock:/var/run/docker.sock + + environment: + AUTHENTIK_REDIS__HOST: authentikredis + AUTHENTIK_POSTGRESQL__HOST: authentikpostgres + AUTHENTIK_POSTGRESQL__USER: authentik + AUTHENTIK_POSTGRESQL__NAME: authentik + AUTHENTIK_POSTGRESQL__PASSWORD: ${ROOT_PASSWORD} + AUTHENTIK_SECRET_KEY: ${AUTHENTIK_SECRET_KEY} + AUTHENTIK_EMAIL__HOST: "overleafsmtpd" + AUTHENTIK_EMAIL__PORT: "25" + AUTHENTIK_EMAIL__USE_TLS: "false" + AUTHENTIK_EMAIL__USE_SSL: "false" + # AUTHENTIK_EMAIL__TIMEOUT: 10 + AUTHENTIK_EMAIL__FROM: "overleaf@neuro.uni-bremen.de" + AUTHENTIK_ERROR_REPORTING__ENABLED: "true" + + networks: + - overleaf-network + + user: root + +volumes: + authentik_media: + authentik_custom_templates: + authentik_certs: + +networks: + overleaf-network: + external: true + diff --git a/sso_test_server/authentik/down.sh b/sso_test_server/authentik/down.sh new file mode 100644 index 0000000..c864209 --- /dev/null +++ b/sso_test_server/authentik/down.sh @@ -0,0 +1,2 @@ +docker compose down + diff --git a/sso_test_server/authentik/logs.sh b/sso_test_server/authentik/logs.sh new file mode 100644 index 0000000..5fd46e9 --- /dev/null +++ b/sso_test_server/authentik/logs.sh @@ -0,0 +1,2 @@ +docker compose logs -f + diff --git a/sso_test_server/authentik/test_email.txt b/sso_test_server/authentik/test_email.txt new file mode 100644 index 0000000..1744adb --- /dev/null +++ b/sso_test_server/authentik/test_email.txt @@ -0,0 +1,3 @@ +docker exec -it authentikworker bash +ak test_email + diff --git a/sso_test_server/authentik/up.sh b/sso_test_server/authentik/up.sh new file mode 100644 index 0000000..a4a5dbb --- /dev/null +++ b/sso_test_server/authentik/up.sh @@ -0,0 +1,2 @@ +docker compose up -d + diff --git a/sso_test_server/authentiknginx/compose.yaml b/sso_test_server/authentiknginx/compose.yaml new file mode 100644 index 0000000..c1043c9 --- /dev/null +++ b/sso_test_server/authentiknginx/compose.yaml @@ -0,0 +1,23 @@ +services: + authentiknginx: + image: nginx:stable-alpine + container_name: authentiknginx + hostname: authentiknginx + restart: always + volumes: + - "/root/overleafnginx/key.pem:/certs/nginx_key.pem:ro" + - "/root/overleafnginx/ca.pem:/certs/nginx_certificate.pem:ro" + - "/root/sso_test_server/authentiknginx/nginx.conf:/etc/nginx/nginx.conf:ro" + ports: + - "0.0.0.0:444:444" + - "0.0.0.0:81:81" + environment: + NGINX_WORKER_PROCESSES: "4" + NGINX_WORKER_CONNECTIONS: "768" + networks: + - overleaf-network + +networks: + overleaf-network: + external: true + diff --git a/sso_test_server/authentiknginx/dont_forget_firewall.sh b/sso_test_server/authentiknginx/dont_forget_firewall.sh new file mode 100644 index 0000000..8ea7add --- /dev/null +++ b/sso_test_server/authentiknginx/dont_forget_firewall.sh @@ -0,0 +1 @@ +ufw allow 444 diff --git a/sso_test_server/authentiknginx/down.sh b/sso_test_server/authentiknginx/down.sh new file mode 100644 index 0000000..c864209 --- /dev/null +++ b/sso_test_server/authentiknginx/down.sh @@ -0,0 +1,2 @@ +docker compose down + diff --git a/sso_test_server/authentiknginx/logs.sh b/sso_test_server/authentiknginx/logs.sh new file mode 100644 index 0000000..5fd46e9 --- /dev/null +++ b/sso_test_server/authentiknginx/logs.sh @@ -0,0 +1,2 @@ +docker compose logs -f + diff --git a/sso_test_server/authentiknginx/nginx.conf b/sso_test_server/authentiknginx/nginx.conf new file mode 100644 index 0000000..f4ee8e6 --- /dev/null +++ b/sso_test_server/authentiknginx/nginx.conf @@ -0,0 +1,33 @@ + events {} + http { + server { + listen 81 default_server; + server_name _; + return 301 https://$host$request_uri; + } + server { + listen 444 ssl; + ssl_certificate /certs/nginx_certificate.pem; + ssl_certificate_key /certs/nginx_key.pem; + ssl_protocols TLSv1 TLSv1.1 TLSv1.2; + ssl_prefer_server_ciphers on; + ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5; + add_header Strict-Transport-Security "max-age=31536000; includeSubdomains;"; + server_tokens off; + client_max_body_size 50M; + server_name overleaf.neuro.uni-bremen.de; + + location / { + proxy_pass https://authentikserver:9443; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_set_header Host $http_host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_read_timeout 3m; + proxy_send_timeout 3m; + } + } + } + diff --git a/sso_test_server/authentiknginx/up.sh b/sso_test_server/authentiknginx/up.sh new file mode 100644 index 0000000..a4a5dbb --- /dev/null +++ b/sso_test_server/authentiknginx/up.sh @@ -0,0 +1,2 @@ +docker compose up -d + diff --git a/sso_test_server/authentikpostgresql/compose.yaml b/sso_test_server/authentikpostgresql/compose.yaml new file mode 100644 index 0000000..c45d24e --- /dev/null +++ b/sso_test_server/authentikpostgresql/compose.yaml @@ -0,0 +1,32 @@ +services: + authentikpostgres: + image: "postgres:12-alpine" + container_name: "authentikpostgres" + hostname: "authentikpostgres" + restart: always + shm_size: 128mb + volumes: + - authentik_database:/var/lib/postgresql/data + ports: + - 6381:5432 + environment: + POSTGRES_PASSWORD: ${ROOT_PASSWORD} + POSTGRES_USER: authentik + POSTGRES_DB: authentik + healthcheck: + test: ["CMD-SHELL", "sh -c 'pg_isready -U authentik -d authentik'"] + interval: 10s + timeout: 3s + retries: 3 + + networks: + - overleaf-network + +volumes: + authentik_database: + + +networks: + overleaf-network: + external: true + diff --git a/sso_test_server/authentikpostgresql/down.sh b/sso_test_server/authentikpostgresql/down.sh new file mode 100644 index 0000000..c864209 --- /dev/null +++ b/sso_test_server/authentikpostgresql/down.sh @@ -0,0 +1,2 @@ +docker compose down + diff --git a/sso_test_server/authentikpostgresql/logs.sh b/sso_test_server/authentikpostgresql/logs.sh new file mode 100644 index 0000000..5fd46e9 --- /dev/null +++ b/sso_test_server/authentikpostgresql/logs.sh @@ -0,0 +1,2 @@ +docker compose logs -f + diff --git a/sso_test_server/authentikpostgresql/up.sh b/sso_test_server/authentikpostgresql/up.sh new file mode 100644 index 0000000..a4a5dbb --- /dev/null +++ b/sso_test_server/authentikpostgresql/up.sh @@ -0,0 +1,2 @@ +docker compose up -d + diff --git a/sso_test_server/authentikredis/compose.yaml b/sso_test_server/authentikredis/compose.yaml new file mode 100644 index 0000000..9bc0e66 --- /dev/null +++ b/sso_test_server/authentikredis/compose.yaml @@ -0,0 +1,27 @@ +# docker network create overleaf-network +services: + authentikredis: + image: "redis:alpine" + container_name: "authentikredis" + hostname: "authentikredis" + restart: always + healthcheck: + test: ["CMD-SHELL", "redis-cli ping | grep PONG"] + start_period: 20s + interval: 30s + retries: 5 + timeout: 3s + volumes: + - authentik_redis:/data + ports: + - 6380:6379 + networks: + - overleaf-network + +volumes: + authentik_redis: + +networks: + overleaf-network: + external: true + diff --git a/sso_test_server/authentikredis/down.sh b/sso_test_server/authentikredis/down.sh new file mode 100644 index 0000000..c864209 --- /dev/null +++ b/sso_test_server/authentikredis/down.sh @@ -0,0 +1,2 @@ +docker compose down + diff --git a/sso_test_server/authentikredis/logs.sh b/sso_test_server/authentikredis/logs.sh new file mode 100644 index 0000000..5fd46e9 --- /dev/null +++ b/sso_test_server/authentikredis/logs.sh @@ -0,0 +1,2 @@ +docker compose logs -f + diff --git a/sso_test_server/authentikredis/up.sh b/sso_test_server/authentikredis/up.sh new file mode 100644 index 0000000..a4a5dbb --- /dev/null +++ b/sso_test_server/authentikredis/up.sh @@ -0,0 +1,2 @@ +docker compose up -d + diff --git a/sso_test_server/nodejsdev/compose.yaml b/sso_test_server/nodejsdev/compose.yaml new file mode 100644 index 0000000..34f720f --- /dev/null +++ b/sso_test_server/nodejsdev/compose.yaml @@ -0,0 +1,26 @@ +services: + nodejsdev: + image: "node:current-alpine" + container_name: nodejsdev + hostname: nodejsdev + restart: always + command: sleep infinity + + ports: + - 3000:3000 + + volumes: + - nodejsdev_data:/data + - "/root/overleafnginx/key.pem:/certs/key.pem:ro" + - "/root/overleafnginx/ca.pem:/certs/certificate.pem:ro" + + networks: + - overleaf-network + +volumes: + nodejsdev_data: + +networks: + overleaf-network: + external: true + diff --git a/sso_test_server/nodejsdev/down.sh b/sso_test_server/nodejsdev/down.sh new file mode 100644 index 0000000..c864209 --- /dev/null +++ b/sso_test_server/nodejsdev/down.sh @@ -0,0 +1,2 @@ +docker compose down + diff --git a/sso_test_server/nodejsdev/logs.sh b/sso_test_server/nodejsdev/logs.sh new file mode 100644 index 0000000..5fd46e9 --- /dev/null +++ b/sso_test_server/nodejsdev/logs.sh @@ -0,0 +1,2 @@ +docker compose logs -f + diff --git a/sso_test_server/nodejsdev/up.sh b/sso_test_server/nodejsdev/up.sh new file mode 100644 index 0000000..a4a5dbb --- /dev/null +++ b/sso_test_server/nodejsdev/up.sh @@ -0,0 +1,2 @@ +docker compose up -d + diff --git a/sso_test_server/overleafsmtpd/compose.yaml b/sso_test_server/overleafsmtpd/compose.yaml new file mode 100644 index 0000000..2e98109 --- /dev/null +++ b/sso_test_server/overleafsmtpd/compose.yaml @@ -0,0 +1,30 @@ +# docker network create overleaf-network +services: + overleafsmtpd: + image: wodby/opensmtpd + container_name: overleafsmtpd + hostname: overleafsmtpd + restart: always + volumes: + - /root/sso_test_server/overleafsmtpd/smtpd_pre.conf:/etc/gotpl/smtpd.conf.tmpl + - overleaf_smtpd:/var/spool/smtpd + - /var/run/docker.sock:/var/run/docker.sock + ports: + - 25:25 + environment: + RELAY_HOST: "XXX" + RELAY_PROTO: "smtps" + RELAY_PORT: "XXX" + RELAY_USER: ${MAIL_USERNAME} + RELAY_PASSWORD: ${MAIL_PASSWORD} + + networks: + - overleaf-network + +volumes: + overleaf_smtpd: + +networks: + overleaf-network: + external: true + diff --git a/sso_test_server/overleafsmtpd/down.sh b/sso_test_server/overleafsmtpd/down.sh new file mode 100644 index 0000000..c864209 --- /dev/null +++ b/sso_test_server/overleafsmtpd/down.sh @@ -0,0 +1,2 @@ +docker compose down + diff --git a/sso_test_server/overleafsmtpd/logs.sh b/sso_test_server/overleafsmtpd/logs.sh new file mode 100644 index 0000000..5fd46e9 --- /dev/null +++ b/sso_test_server/overleafsmtpd/logs.sh @@ -0,0 +1,2 @@ +docker compose logs -f + diff --git a/sso_test_server/overleafsmtpd/smtpd_pre.conf b/sso_test_server/overleafsmtpd/smtpd_pre.conf new file mode 100644 index 0000000..f076a64 --- /dev/null +++ b/sso_test_server/overleafsmtpd/smtpd_pre.conf @@ -0,0 +1,14 @@ +listen on 0.0.0.0 +listen on :: + +table aliases file:/etc/smtpd/aliases + +queue ttl 4d +bounce warn-interval 1h, 6h, 2d + +smtp max-message-size 35M + +table authinfo db:/etc/smtpd/authinfo.db +action default relay host "smtps://user@mailhost.neurotec.uni-bremen.de:465" auth tls no-verify +match from any for any action default + diff --git a/sso_test_server/overleafsmtpd/up.sh b/sso_test_server/overleafsmtpd/up.sh new file mode 100644 index 0000000..a4a5dbb --- /dev/null +++ b/sso_test_server/overleafsmtpd/up.sh @@ -0,0 +1,2 @@ +docker compose up -d +