Skip to content

Commit c7ad75f

Browse files
committed
* Several updates 2023_01_26. See full commit log.
* bash_aliases updates due to moving my proxmox server from the cloud back into my home - I now have fiber with 10 Gbps :-) * Added --drive-stop-on-upload-limit switch to stop rclone upload when google drive errors out due to quota. * Added crowdsec and traefik-bouncer to basic-services.txt as without them none of the service would be accessible and traefik won't start. * Remove cf-companion. I now just wildcard all CNAMEs to the root domain pointing to my IP. Much simpler this way and its not a big security risk. * Updated README with crowdsec related posts. * Obsoleted cf-companion (see above) and heimdall (replaced with homepage) * Updated traefik to v2.9 * Updated docker and docker-compose versions. * Added crowdsecurity/blocklist-mirror to export all the blocked IPs as a list. * Added whoami container for testing purposes * Exposed some ports to the host now that my server is inside my home network. * Added AdGuard Home sync to sync all my instances of adguard home.
1 parent 3731045 commit c7ad75f

File tree

9 files changed

+205
-97
lines changed

9 files changed

+205
-97
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ This is the updated docker-compose repo of all the media, home, and web server a
55
- [Docker Media Server Ubuntu: Compose for 23 Awesome Apps](https://www.smarthomebeginner.com/docker-media-server-2022/)
66
- [Ultimate Traefik Docker Compose Guide [2022] with LetsEncrypt](https://www.smarthomebeginner.com/traefik-docker-compose-guide-2022/)
77
- [WordPress on Docker with Nginx, Traefik, LE SSL, Security, and Speed](https://www.smarthomebeginner.com/wordpress-on-docker-traefik/)
8-
- [Synology Docker Media Server with Traefik, Docker Compose, and Cloudflare](https://www.smarthomebeginner.com/synology-docker-media-server/)
8+
- [Ultimate Synology NAS Docker Compose Media Server 2022](https://www.smarthomebeginner.com/synology-nas-docker-media-server-2022/)
99

1010
<div style="padding:20px;border: 3px solid red;">
1111
<h3>IMPORTANT</h3>
@@ -42,6 +42,11 @@ Go step-by-step. If you bite too big of a piece, I guarantee you will choke.
4242
- [Google OAuth 2 MFA Protection for Docker](https://www.smarthomebeginner.com/traefik-forward-auth-google-oauth-2022/)
4343
- [Authelia MFA Protection for Docker](https://www.smarthomebeginner.com/docker-authelia-tutorial/)
4444
- [Traefik Docker Security Best Practices](https://www.smarthomebeginner.com/traefik-docker-security-best-practices/)
45+
- [Crowdsec Docker Compose Guide Part 1: Powerful IPS with Firewall Bouncer](https://www.smarthomebeginner.com/crowdsec-docker-compose-1-fw-bouncer/)
46+
- [CrowdSec Docker Part 2: Improved IPS with Cloudflare Bouncer](https://www.smarthomebeginner.com/crowdsec-cloudflare-bouncer/)
47+
- [CrowdSec Docker Part 3: Traefik Bouncer for Additional Security](https://www.smarthomebeginner.com/crowdsec-traefik-bouncer/)
48+
- [CrowdSec Multiserver Docker (Part 4): For Ultimate Protection](https://www.smarthomebeginner.com/crowdsec-multiserver-docker/)
49+
- [Ultimate Docker to Podman Migration Guide: It's NOT difficult](https://www.smarthomebeginner.com/docker-to-podman-migration-guide/)
4550
- [Nextcloud Docker with Traefik Reverse Proxy for Beginners](https://www.smarthomebeginner.com/traefik-docker-nextcloud/)
4651

4752
### Obsolete Posts (for educational purposes):
@@ -51,6 +56,7 @@ The following posts have been updated/replaced by the posts linked above:
5156
- [Docker Media Server with Traefik 2 Reverse Proxy](https://www.smarthomebeginner.com/traefik-2-docker-tutorial/)
5257
- [Docker Media Server without Reverse Proxy ](https://www.smarthomebeginner.com/docker-home-media-server-2018-basic/)
5358
- [Docker Media Server with Traefik 1 Reverse Proxy](https://www.smarthomebeginner.com/traefik-reverse-proxy-tutorial-for-docker/)
59+
- [Synology Docker Media Server with Traefik, Docker Compose, and Cloudflare](https://www.smarthomebeginner.com/synology-docker-media-server/)
5460

5561
## Docker, Docker Compose, and Traefik Versions (updated September, 2022)
5662

appdata/traefik2/rules/cloudserver/middlewares-chains.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ http:
1515
- middlewares-rate-limit
1616
- middlewares-https-redirectscheme
1717
- middlewares-secure-headers
18-
- middlewares-compress
18+
- middlewares-compress
1919

2020
chain-basic-auth:
2121
chain:
2222
middlewares:
23-
- middlewares-traefik-bouncer # leave this out if you are not using CrowdSec
23+
- middlewares-traefik-bouncer # leave this out if you are not using CrowdSec
2424
- middlewares-rate-limit
2525
- middlewares-https-redirectscheme
2626
- middlewares-secure-headers
@@ -30,7 +30,7 @@ http:
3030
chain-oauth:
3131
chain:
3232
middlewares:
33-
- middlewares-traefik-bouncer # leave this out if you are not using CrowdSec
33+
- middlewares-traefik-bouncer # leave this out if you are not using CrowdSec
3434
- middlewares-rate-limit
3535
- middlewares-https-redirectscheme
3636
- middlewares-secure-headers

docker-compose-t2-obsolete.yml

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1994,4 +1994,51 @@ services:
19941994
#- "traefik.http.routers.headscale-rtr.middlewares=chain-no-auth@file"
19951995
## HTTP Services
19961996
- "traefik.http.routers.headscale-rtr.service=headscale-svc"
1997-
- "traefik.http.services.headscale-svc.loadbalancer.server.port=8080"
1997+
- "traefik.http.services.headscale-svc.loadbalancer.server.port=8080"
1998+
1999+
2000+
# Cloudflare-Companion - Automatic CNAME DNS Creation
2001+
cf-companion:
2002+
<<: *common-keys-core # See EXTENSION FIELDS at the top
2003+
container_name: cf-companion
2004+
image: tiredofit/traefik-cloudflare-companion:latest
2005+
networks:
2006+
- socket_proxy
2007+
environment:
2008+
- TIMEZONE=$TZ
2009+
- TRAEFIK_VERSION=2
2010+
- CF_TOKEN__FILE=/run/secrets/cf_token
2011+
- TARGET_DOMAIN=cdoc.$DOMAINNAME_CLOUD_SERVER # Edit this. Either a subdomain or just $DOMAINNAME_CLOUD_SERVER pointing to the IP will work. See: https://github.com/htpcBeginner/docker-traefik/issues/244.
2012+
- DOMAIN1=$DOMAINNAME_CLOUD_SERVER
2013+
- DOMAIN1_ZONE_ID=$CLOUDFLARE_ZONEID # Copy from Cloudflare Overview page
2014+
- DOMAIN1_PROXIED=TRUE
2015+
- DOCKER_HOST=tcp://socket-proxy:2375
2016+
secrets:
2017+
- cf_token
2018+
labels:
2019+
# Add hosts specified in rules here to force cf-companion to create the CNAMEs
2020+
# Since cf-companion creates CNAMEs based on host rules, this a workaround for non-docker/external apps
2021+
- "traefik.http.routers.cf-companion-rtr.rule=Host(Host(`webmin.$DOMAINNAME_CLOUD_SERVER`) || Host(`shell.$DOMAINNAME_CLOUD_SERVER`) || Host(`stcdoc.$DOMAINNAME_CLOUD_SERVER`) || Host(`ag.$DOMAINNAME_CLOUD_SERVER`)"
2022+
2023+
# Heimdall - Application Dashboard
2024+
heimdall:
2025+
<<: *common-keys-core # See EXTENSION FIELDS at the top
2026+
image: lscr.io/linuxserver/heimdall
2027+
container_name: heimdall
2028+
# ports:
2029+
# - "$HEIMDALL_PORT:80" # 80 to 82 already taken by other services
2030+
# - "444:443" # 443 used by Traefik/Nginx Proxy Manager. Disabled because we will put Heimdall behind proxy.
2031+
volumes:
2032+
- $DOCKERDIR/appdata/heimdall:/config
2033+
environment:
2034+
<<: *default-tz-puid-pgid
2035+
labels:
2036+
- "traefik.enable=true"
2037+
## HTTP Routers
2038+
- "traefik.http.routers.heimdall-rtr.entrypoints=https"
2039+
- "traefik.http.routers.heimdall-rtr.rule=Host(`$DOMAINNAME_CLOUD_SERVER`,`www.$DOMAINNAME_CLOUD_SERVER`)"
2040+
## Middlewares
2041+
- "traefik.http.routers.heimdall-rtr.middlewares=chain-oauth@file"
2042+
## HTTP Services
2043+
- "traefik.http.routers.heimdall-rtr.service=heimdall-svc"
2044+
- "traefik.http.services.heimdall-svc.loadbalancer.server.port=80"

docker-compose-t2-synology.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ services:
125125
traefik:
126126
<<: *common-keys-core # See EXTENSION FIELDS at the top
127127
container_name: traefik
128-
image: traefik:2.8
128+
image: traefik:2.9
129129
command: # CLI arguments
130130
- --global.checkNewVersion=true
131131
- --global.sendAnonymousUsage=true

docker-compose-t2-web.yml

Lines changed: 48 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ version: "3.9"
1010
# Digital Ocean: 1 vCPU, 2 GB RAM, and 50 GB NVME
1111
# Use this Referral Link and get $100 Credit: https://m.do.co/c/5ae8e2c8f34b
1212

13-
# Docker: 20.10.17
14-
# Docker Compose: 2.6.0 (v2 https://docs.docker.com/compose/#compose-v2-and-the-new-docker-compose-command)
13+
# Docker: 20.10.21
14+
# Docker Compose: v2.12.2 (docker-compose-plugin for Docker)
1515

1616
########################### NETWORKS
1717
# There is no need to create any networks outside this docker-compose file.
@@ -113,7 +113,7 @@ services:
113113
traefik:
114114
<<: *common-keys-core # See EXTENSION FIELDS at the top
115115
container_name: traefik
116-
image: traefik:2.8
116+
image: traefik:2.9
117117
command: # CLI arguments
118118
- --global.checkNewVersion=true
119119
- --global.sendAnonymousUsage=true
@@ -349,6 +349,8 @@ services:
349349
- "traefik.http.routers.autoindex-rtr.service=autoindex-svc"
350350
- "traefik.http.services.autoindex-svc.loadbalancer.server.port=80"
351351

352+
############################# SECURITY
353+
352354
# CrowdSec - Open-source & collaborative security IPS
353355
crowdsec:
354356
<<: *common-keys-core # See EXTENSION FIELDS at the top
@@ -358,7 +360,7 @@ services:
358360
- "$CROWDSEC_API_PORT:8080"
359361
- "$ZEROTIER_IP_WEBSERVER:$CROWDSEC_PROMETHEUS_EXPORT:6060" # If you don't use ZeroTier remove use just $CROWDSEC_PROMETHEUS_EXPORT:6060
360362
environment:
361-
COLLECTIONS: "crowdsecurity/traefik crowdsecurity/http-cve crowdsecurity/whitelist-good-actors crowdsecurity/iptables crowdsecurity/linux crowdsecurity/nginx crowdsecurity/sshd"
363+
COLLECTIONS: "crowdsecurity/traefik crowdsecurity/http-cve crowdsecurity/whitelist-good-actors crowdsecurity/iptables crowdsecurity/linux crowdsecurity/nginx fulljackz/proxmox"
362364
GID: "${GID-1000}"
363365
CUSTOM_HOSTNAME: dSHB
364366
volumes:
@@ -368,17 +370,16 @@ services:
368370
- $DOCKERDIR/appdata/crowdsec/config:/etc/crowdsec
369371

370372
# CrowdSec Bouncer - Traefik
373+
# sudo docker exec crowdsec cscli bouncer add traefik-bouncer
371374
traefik-bouncer:
372375
<<: *common-keys-core # See EXTENSION FIELDS at the top
373376
image: fbonalair/traefik-crowdsec-bouncer
374377
container_name: traefik-bouncer
375-
#ports:
376-
# - "$TRAEFIK_BOUNCER_PORT:8080"
377378
environment:
378379
GIN_MODE: release # default is debug (more logs)
379380
CROWDSEC_BOUNCER_API_KEY: $CROWDSEC_BOUNCER_TRAEFIK_API_KEY # sudo docker exec crowdsec cscli bouncers add traefik-bouncer
380381
CROWDSEC_AGENT_HOST: crowdsec:8080 # CrowdSec host and port
381-
CROWDSEC_BOUNCER_LOG_LEVEL: 1 # 1 INFO 2 WARN https://pkg.go.dev/github.com/rs/zerolog#readme-leveled-logging
382+
CROWDSEC_BOUNCER_LOG_LEVEL: 2 # https://pkg.go.dev/github.com/rs/zerolog#readme-leveled-logging
382383

383384
# CrowdSec Bouncer - Cloudflare
384385
# sudo docker exec crowdsec cscli bouncer add cloudflare-bouncer
@@ -387,11 +388,27 @@ services:
387388
<<: *common-keys-core # See EXTENSION FIELDS at the top
388389
image: crowdsecurity/cloudflare-bouncer
389390
container_name: cloudflare-bouncer
390-
#ports:
391-
# - "$CLOUDFLARE_BOUNCER_PORT:2112"
392391
volumes:
393392
- $DOCKERDIR/appdata/cloudflare-bouncer/cfg.yaml:/etc/crowdsec/bouncers/crowdsec-cloudflare-bouncer.yaml
394-
- $DOCKERDIR/appdata/cloudflare-bouncer/cf-bouncer:/cf-bouncer
393+
394+
# CrowdSec Blocklist Mirror - For PiHole/AdGuard Use
395+
# sudo docker exec crowdsec cscli bouncer add cloudflare-bouncer
396+
crowdsec-blocklist:
397+
<<: *common-keys-core # See EXTENSION FIELDS at the top
398+
image: crowdsecurity/blocklist-mirror
399+
container_name: crowdsec-blocklist
400+
volumes:
401+
- $DOCKERDIR/appdata/crowdsec-blocklist/cfg.yaml:/etc/crowdsec/bouncers/crowdsec-blocklist-mirror.yaml
402+
labels:
403+
- "traefik.enable=true"
404+
## HTTP Routers
405+
- "traefik.http.routers.crowdsec-blocklist-rtr.entrypoints=https"
406+
- "traefik.http.routers.crowdsec-blocklist-rtr.rule=Host(`blocklist.$DOMAINNAME_SHB`)" # https://domain.com/security/blocklist
407+
## Middlewares
408+
- "traefik.http.routers.crowdsec-blocklist-rtr.middlewares=chain-oauth@file"
409+
## HTTP Services
410+
- "traefik.http.routers.crowdsec-blocklist-rtr.service=crowdsec-blocklist-svc"
411+
- "traefik.http.services.crowdsec-blocklist-svc.loadbalancer.server.port=41412"
395412

396413
############################# DATABASE
397414

@@ -559,6 +576,7 @@ services:
559576
- "traefik.http.routers.vscode-rtr.service=vscode-svc"
560577
- "traefik.http.services.vscode-svc.loadbalancer.server.port=8443"
561578

579+
# WG-EASY - WireGuard Easy
562580
wg-easy:
563581
image: weejewel/wg-easy
564582
container_name: wg-easy
@@ -583,18 +601,17 @@ services:
583601
- WG_HOST=$SERVER_IP
584602
- PASSWORD=$WGEASY_PASSWORD
585603
# Optional:
586-
# - PASSWORD=foobar123
587604
# - WG_PORT=51820
588-
# - WG_DEFAULT_ADDRESS=10.8.0.x
589-
# - WG_DEFAULT_DNS=1.1.1.1
605+
- WG_DEFAULT_ADDRESS=192.168.20.x
606+
- WG_DEFAULT_DNS=1.1.1.1
590607
# - WG_MTU=1420
591-
# - WG_ALLOWED_IPS=192.168.15.0/24, 10.0.1.0/24
608+
- WG_ALLOWED_IPS=0.0.0.0/0, ::/0
592609
# - WG_PRE_UP=echo "Pre Up" > /etc/wireguard/pre-up.txt
593610
# - WG_POST_UP=echo "Post Up" > /etc/wireguard/post-up.txt
594611
# - WG_PRE_DOWN=echo "Pre Down" > /etc/wireguard/pre-down.txt
595612
# - WG_POST_DOWN=echo "Post Down" > /etc/wireguard/post-down.txt
596613

597-
############################# MAINTENANCE
614+
############################# MAINTENANCE AND TESTING
598615

599616
# Docker-GC - Automatic Docker Garbage Collection
600617
# Create docker-gc-exclude file
@@ -616,3 +633,19 @@ services:
616633
CLEAN_UP_VOLUMES: 1
617634
TZ: $TZ
618635
DOCKER_HOST: tcp://socket-proxy:2375
636+
637+
# WhoAmI - For Testing and Troubleshooting
638+
whoami:
639+
<<: *common-keys-core # See EXTENSION FIELDS at the top
640+
image: traefik/whoami
641+
container_name: whoami
642+
labels:
643+
- "traefik.enable=true"
644+
## HTTP Routers
645+
- "traefik.http.routers.whoami-rtr.entrypoints=https"
646+
- "traefik.http.routers.whoami-rtr.rule=Host(`whoami.$DOMAINNAME_SHB`)"
647+
## Middlewares
648+
- "traefik.http.routers.whoami-rtr.middlewares=chain-oauth@file"
649+
## HTTP Services
650+
- "traefik.http.routers.whoami-rtr.service=whoami-svc"
651+
- "traefik.http.services.whoami-svc.loadbalancer.server.port=80"

0 commit comments

Comments
 (0)