From bbf2337375109632069f231cee353483e2c64b6a Mon Sep 17 00:00:00 2001 From: LRVT <21357789+l4rm4nd@users.noreply.github.com> Date: Tue, 27 May 2025 10:59:58 +0200 Subject: [PATCH] chore: add gzctf --- README.md | 1 + examples/gzctf/README.md | 14 ++++++++ examples/gzctf/appsettings.json | 40 +++++++++++++++++++++ examples/gzctf/docker-compose.yml | 58 +++++++++++++++++++++++++++++++ 4 files changed, 113 insertions(+) create mode 100644 examples/gzctf/README.md create mode 100644 examples/gzctf/appsettings.json create mode 100644 examples/gzctf/docker-compose.yml diff --git a/README.md b/README.md index ef407ad..ccea35f 100644 --- a/README.md +++ b/README.md @@ -447,6 +447,7 @@ Multiplayer game servers, browser games and utilities for managing game servers. - [cs2-dedicated-server](examples/cs2-dedicated-server) - CS2 Dedicated Server Docker Image with an RCON web-based control panel. - [posio](examples/posio) - A multiplayer geography game using Websockets. - [Monkeytype](examples/monkeytype) - The most customizable typing website with a minimalistic design and a ton of features. Test yourself in various modes, track your progress and improve your speed. +- [GZCTF](examples/gzctf) - The GZ::CTF project, an open source CTF platform. ### Metrics & Metric Collection diff --git a/examples/gzctf/README.md b/examples/gzctf/README.md new file mode 100644 index 0000000..9c7d9be --- /dev/null +++ b/examples/gzctf/README.md @@ -0,0 +1,14 @@ +# References + +- https://gzctf.gzti.me/guide/start/quick-start.html +- https://github.com/GZTimeWalker/GZCTF + +# Notes + +You have to pre-supply the `appsettings.json` in the bind mount volume dir. + +```` +sudo mkdir -p /mnt/docker-volumes/gzctf/config +sudo chmod -R 775 /mnt/docker-volumes/gzctf/config +cp appsettings.json /mnt/docker-volumes/gzctf/config/. +```` diff --git a/examples/gzctf/appsettings.json b/examples/gzctf/appsettings.json new file mode 100644 index 0000000..7e8bf08 --- /dev/null +++ b/examples/gzctf/appsettings.json @@ -0,0 +1,40 @@ +{ + "AllowedHosts": "*", + "ConnectionStrings": { + "Database": "Host=db:5432;Database=gzctf;Username=postgres;Password=secure-gzctf-db-password", + "RedisCache": "cache:6379,abortConnect=false" + }, + "EmailConfig": { + "SenderAddress": "", + "SenderName": "", + "UserName": "", + "Password": "", + "Smtp": { + "Host": "localhost", + "Port": 587 + } + }, + "XorKey": "", + "ContainerProvider": { + "Type": "Docker", // or "Kubernetes" + "PortMappingType": "Default", // or "PlatformProxy" + "EnableTrafficCapture": false, + "PublicEntry": "ctf.example.com", // or "xxx.xxx.xxx.xxx" + // optional + "DockerConfig": { + "SwarmMode": false, + "Uri": "unix:///var/run/docker.sock" + } + }, + "CaptchaConfig": { + "Provider": "None", // or "CloudflareTurnstile" or "HashPow" + "SiteKey": "", + "SecretKey": "" + }, + "ForwardedOptions": { + "ForwardedHeaders": 7, + "ForwardLimit": 1, + "TrustedNetworks": ["192.168.12.0/8"] + } +} + diff --git a/examples/gzctf/docker-compose.yml b/examples/gzctf/docker-compose.yml new file mode 100644 index 0000000..94d5562 --- /dev/null +++ b/examples/gzctf/docker-compose.yml @@ -0,0 +1,58 @@ +services: + + gzctf: + image: gztime/gzctf:latest + container_name: gzctf-app + restart: always + environment: + - GZCTF_ADMIN_PASSWORD=My-Secure-Password5 + - LC_ALL=de-DE.UTF-8 + expose: + - 8080 + ports: + - "8888:8080" + volumes: + - ${DOCKER_VOLUME_STORAGE:-/mnt/docker-volumes}/gzctf/data/files:/app/files + - ${DOCKER_VOLUME_STORAGE:-/mnt/docker-volumes}/gzctf/config/appsettings.json:/app/appsettings.json:ro + - /var/run/docker.sock:/var/run/docker.sock + depends_on: + - db + #networks: + # - internal + # - proxy + #labels: + # - traefik.enable=true + # - traefik.docker.network=proxy + # - traefik.http.routers.ctf.rule=Host(`ctf.example.com`) + # - traefik.http.services.ctf.loadbalancer.server.port=8080 + # # Optional part for traefik middlewares + # - traefik.http.routers.ctf.middlewares=authentik@docker + + db: + image: docker.io/library/postgres:16-alpine + container_name: gzctf-db + restart: always + environment: + - POSTGRES_USER=postgres + - POSTGRES_PASSWORD=secure-gzctf-db-password + - POSTGRES_DB=gzctf + volumes: + - ${DOCKER_VOLUME_STORAGE:-/mnt/docker-volumes}/gzctf/data/db:/var/lib/postgresql/data + #networks: + # - internal + + cache: + image: ghcr.io/microsoft/garnet-alpine:latest + container_name: gzctf-cache + expose: + - 6379 + command: ["--bind", "0.0.0.0"] + restart: always + #networks: + # - internal + +#networks: +# internal: +# internal: true +# proxy: +# external: true