This simple project uses Traefik as a reverse proxy to a Streamlit application and handles SSL certs with Lets Encrypt.
- AI: OpenwebUI.
Chat: Chat with AI.- Stock Analysis Assistant: AI assistant using GROQ and llama3.
Redlib: Reddit libre.- Blog
- Beyond All Information: analyse your Beyond All Reason games.
- CheatSheets: Collection of cheatsheets.
- Forum: Host your own forum.
- Neural Network Playground: Understand neural network visually.
- Note: Notepad Online.
- pastebin: Pastebin.
- Home server: Build for ARM64 platform
- Docker Compose
- Build for ARM64/x86 platform
git clone https://github.com/furyhawk/cloudy.gitcd cloudygit submodule update --init --recursive- In
compose/traefik/traefik.yml, change[email protected]to your email. - In
compose/traefik/traefik.yml, changeexample.comto your domain. sudo apt-get install build-essential(if not already installed) to use makefile.mkdir ~/st-syncsyncthing folder.mkdir ~/sitepublic site folder.mkdir ./compose/configto store config.cp .env.example ./compose/.env && cp .env ~/config/.envcp ./compose/config/conf.php ~/config/conf.phpcp usersfile.example ./compose/usersfilemake serve
docker swarm init
docker network create -d overlay --attachable traefik-public
make deploy-core
docker service logs core_traefik --details
In swarm/.env, set:
CROWDSEC_LAPI_KEY=<openssl rand -base64 32>
CROWDSEC_BOUNCER_KEY=<openssl rand -base64 32>make deploy-crowdsecmake register-crowdsec-bouncerThis ensures the global HTTPS forwardAuth middleware is active.
make deploy-coredocker service ls | grep crowdsec
docker service logs --since 10m crowdsec_traefik-bouncer
docker service logs --since 10m core_traefik
docker ps --filter label=com.docker.swarm.service.name=crowdsec_crowdsecCrowdSec runs in Swarm detection mode on a manager node and enumerates services, so
socket-proxy must allow the SERVICES section (enabled in swarm/crowdsec.yml);
without it the agent exits with service list err: ... 403 Forbidden. Logs are read
from services that opt in via deploy.labels
(crowdsec.enable=true + crowdsec.labels.type=traefik, see swarm/core.yml), not
from container labels.
# Show parser/scenario metrics
docker exec -it $(docker ps --filter label=com.docker.swarm.service.name=crowdsec_crowdsec -q | head -n1) cscli metrics
# Add a temporary test decision for your client IP and verify HTTPS returns 403
docker exec -it $(docker ps --filter label=com.docker.swarm.service.name=crowdsec_crowdsec -q | head -n1) cscli decisions add --ip <YOUR_TEST_IP>Cleanup test decision when done:
docker exec -it $(docker ps --filter label=com.docker.swarm.service.name=crowdsec_crowdsec -q | head -n1) cscli decisions delete --ip <YOUR_TEST_IP>- Open https://app.crowdsec.net and create/get an enrollment key for this instance.
- In
swarm/.env, set:
CROWDSEC_ENROLL_KEY=<paste_enroll_key_from_console>
CROWDSEC_ENROLL_INSTANCE_NAME=swarm-edge-01
CROWDSEC_ENROLL_TAGS=swarm,traefik,production- Enroll the running instance:
make enroll-crowdsecEnrollment is deliberately not part of the service definition: the image entrypoint
runs cscli console enroll under set -e, so a rejected key (expired, revoked,
already used) kills the container and the service crash-loops. make enroll-crowdsec
runs the same command against the live container, where a failure is reported without
taking the agent down.
- Confirm enrollment:
docker exec -it $(docker ps --filter label=com.docker.swarm.service.name=crowdsec_crowdsec -q | head -n1) cscli console status- Access the web UI at https://app.crowdsec.net (your instance should appear under your organization).
If an older deployment is crash-looping with
cscli console enroll: ... API error: Forbidden, remove CROWDSEC_ENROLL_KEY from
swarm/.env (and from the shell running make) and run make deploy-crowdsec.
make setup-crowdsec syncs two extra files to the host and swarm/crowdsec.yml
bind-mounts them into the crowdsec service:
| Repo file | Host path | Container path |
|---|---|---|
swarm/crowdsec/whitelists.yaml |
/mnt/data/crowdsec/whitelists.yaml |
/etc/crowdsec/parsers/s02-enrich/local-whitelists.yaml |
swarm/crowdsec/profiles.yaml |
/mnt/data/crowdsec/profiles.yaml |
/etc/crowdsec/profiles.yaml |
- Whitelist entries under
ip:/cidr:never produce alerts, so they can never be banned. Defaults are loopback plus RFC1918/ULA ranges. Only list ranges that reach Traefik with their own source IP — if an upstream firewall SNATs internet traffic into one of them, every client is effectively whitelisted. - The local profile bans for
1hinstead of the stock 4h, which limits the cost of a false positive (aggressive crawl, auth retry loop, SPA 404s).
Apply changes with:
make deploy-crowdsec
docker service logs --since 5m crowdsec_crowdsecDecisions created before the change keep their old duration; clear them so the shorter ban applies immediately:
docker exec -it $(docker ps --filter label=com.docker.swarm.service.name=crowdsec_crowdsec -q | head -n1) cscli decisions delete --allConfirm the whitelist loaded:
docker exec -it $(docker ps --filter label=com.docker.swarm.service.name=crowdsec_crowdsec -q | head -n1) cscli parsers list | grep local-whitelistcore_traefik applies crowdsec-bouncer@swarm to the https entrypoint. If the
bouncer is gone, every HTTPS router fails with
dial tcp: lookup tasks.crowdsec_traefik-bouncer ... no such host.
Remove the stack and disable the middleware together:
make remove-crowdsec
# in swarm/.env
TRAEFIK_HTTPS_MIDDLEWARES=
make deploy-coreRe-enable by setting TRAEFIK_HTTPS_MIDDLEWARES=crowdsec-bouncer@swarm in swarm/.env
and redeploying core after the bouncer is registered.
# Declaring the user list
#
# Note: when used in docker-compose.yml all dollar signs in the hash need to be doubled for escaping.
# To create user:password pair, it's possible to use this command:
# echo $(htpasswd -nB user) | sed -e s/\\$/\\$\\$/g
#
# Also note that dollar signs should NOT be doubled when they not evaluated (e.g. Ansible docker_container module).
labels:
- "traefik.http.middlewares.test-auth.basicauth.users=test:$$apr1$$H6uskkkW$$IgXLP6ewTrSuBkTrqE8wj/,test2:$$apr1$$d9hr9HBB$$4HxwgUir3HP4EsggP/QNo0"middleware:
# Enable HTTP Strict Transport Security (HSTS) to force clients to always connect via HTTPS
Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
# Enable cross-site filter (XSS) and tell browser to block detected attacks
X-XSS-Protection "1; mode=block"
# Prevent some browsers from MIME-sniffing a response away from the declared Content-Type
X-Content-Type-Options "nosniff"
# Disable some features
Permissions-Policy "accelerometer=(),ambient-light-sensor=(),autoplay=(),camera=(),encrypted-media=(),focus-without-user-activation=(),geolocation=(),gyroscope=(),magnetometer=(),microphone=(),midi=(),payment=(),picture-in-picture=(),speaker=(),sync-xhr=(),usb=(),vr=()"
# Disable some features (legacy)
Feature-Policy "accelerometer 'none';ambient-light-sensor 'none'; autoplay 'none';camera 'none';encrypted-media 'none';focus-without-user-activation 'none'; geolocation 'none';gyroscope 'none';magnetometer 'none';microphone 'none';midi 'none';payment 'none';picture-in-picture 'none'; speaker 'none';sync-xhr 'none';usb 'none';vr 'none'"
# Referer
Referrer-Policy "no-referrer"
# X-Robots-Tag
X-Robots-Tag "noindex, noarchive, nofollow"