From b2ae170ea0fdbe8b45be21726a3a58c04c2ded9b Mon Sep 17 00:00:00 2001 From: mr-forust Date: Tue, 18 Nov 2025 14:45:30 +0100 Subject: [PATCH] refactor: Sepparate traefik middlewares --- traefik/dynamic/dynamic.yml | 90 +-------------------------------- traefik/dynamic/middlewares.yml | 88 ++++++++++++++++++++++++++++++++ 2 files changed, 89 insertions(+), 89 deletions(-) create mode 100644 traefik/dynamic/middlewares.yml diff --git a/traefik/dynamic/dynamic.yml b/traefik/dynamic/dynamic.yml index 018fdb0..c050219 100644 --- a/traefik/dynamic/dynamic.yml +++ b/traefik/dynamic/dynamic.yml @@ -136,92 +136,4 @@ http: serversTransports: insecureTransport: - insecureSkipVerify: true - - middlewares: - # HTTPS Redirect - redirect-https: - redirectScheme: - scheme: https - permanent: true - - # Metube Basic Auth - metube-auth: - basicAuth: - users: - - "admin:$2y$05$3Q6gyLFW3NFNp4C6elnyfupntqB6VNB/tcIAeo8NEzvaqPxOjN0iC" - # - "jeepik:$2y$05$tIKrmhd7SYOe6yImRRAfpen7hpVdF8PnSbgBTCDZ.GI0Djx.Le2bq" - realm: "MeTube Access" - - # Basic Auth Traefik Dashboard - auth: - basicAuth: - users: - - "admin:$$apr1$$57E60OUM$$JoYwmLr/uZKaTy6U4IQd9." - # - "jeepik:$2y$05$Q8QqJwSjpycVYONyk4id/.rDFApW9oL8tycRMlGttNySsDv71Rnsu" - # - "vv:" - realm: "Traefik Dashboard" - - # Basic Auth Dockmon - dockmon-auth: - basicAuth: - users: - - "admin:$$apr1$$.bCpmIHl$$dxPEKdw5aZLAwo8wUz52b1" - realm: "Dockmon Access" - - # Cloudflare IP Whitelist - cloudflare-ipwhitelist: - ipWhiteList: - sourceRange: - - "173.245.48.0/20" - - "103.21.244.0/22" - - "103.22.200.0/22" - - "103.31.4.0/22" - - "141.101.64.0/18" - - "108.162.192.0/18" - - "190.93.240.0/20" - - "188.114.96.0/20" - - "197.234.240.0/22" - - "198.41.128.0/17" - - "162.158.0.0/15" - - "104.16.0.0/13" - - "104.24.0.0/14" - - "172.64.0.0/13" - - "131.0.72.0/22" - - # Security Headers - security-headers: - headers: - browserXssFilter: true - contentTypeNosniff: true - forceSTSHeader: true - stsIncludeSubdomains: true - stsPreload: true - stsSeconds: 31536000 - customFrameOptionsValue: "SAMEORIGIN" - customResponseHeaders: - X-Content-Type-Options: "nosniff" - Referrer-Policy: "strict-origin-when-cross-origin" - - # Nextcloud specific headers - nextcloud-secure-headers: - headers: - hostsProxyHeaders: - - "X-Forwarded-Host" - - "X-Forwarded-Proto" - referrerPolicy: "same-origin" - customFrameOptionsValue: "SAMEORIGIN" - - # Rate limiting - rate-limit: - rateLimit: - average: 100 - burst: 50 - period: 1m - - # Nextcloud chain - nextcloud-chain: - chain: - middlewares: - - nextcloud-secure-headers - - security-headers \ No newline at end of file + insecureSkipVerify: true \ No newline at end of file diff --git a/traefik/dynamic/middlewares.yml b/traefik/dynamic/middlewares.yml new file mode 100644 index 0000000..7ab61ff --- /dev/null +++ b/traefik/dynamic/middlewares.yml @@ -0,0 +1,88 @@ +http: + middlewares: + # HTTPS Redirect + redirect-https: + redirectScheme: + scheme: https + permanent: true + + # Metube Basic Auth + metube-auth: + basicAuth: + users: + - "admin:$2y$05$3Q6gyLFW3NFNp4C6elnyfupntqB6VNB/tcIAeo8NEzvaqPxOjN0iC" + # - "jeepik:$2y$05$tIKrmhd7SYOe6yImRRAfpen7hpVdF8PnSbgBTCDZ.GI0Djx.Le2bq" + realm: "MeTube Access" + + # Basic Auth Traefik Dashboard + auth: + basicAuth: + users: + - "admin:$$apr1$$57E60OUM$$JoYwmLr/uZKaTy6U4IQd9." + # - "jeepik:$2y$05$Q8QqJwSjpycVYONyk4id/.rDFApW9oL8tycRMlGttNySsDv71Rnsu" + # - "vv:" + realm: "Traefik Dashboard" + + # Basic Auth Dockmon + dockmon-auth: + basicAuth: + users: + - "admin:$$apr1$$.bCpmIHl$$dxPEKdw5aZLAwo8wUz52b1" + realm: "Dockmon Access" + + # Cloudflare IP Whitelist + cloudflare-ipwhitelist: + ipWhiteList: + sourceRange: + - "173.245.48.0/20" + - "103.21.244.0/22" + - "103.22.200.0/22" + - "103.31.4.0/22" + - "141.101.64.0/18" + - "108.162.192.0/18" + - "190.93.240.0/20" + - "188.114.96.0/20" + - "197.234.240.0/22" + - "198.41.128.0/17" + - "162.158.0.0/15" + - "104.16.0.0/13" + - "104.24.0.0/14" + - "172.64.0.0/13" + - "131.0.72.0/22" + + # Security Headers + security-headers: + headers: + browserXssFilter: true + contentTypeNosniff: true + forceSTSHeader: true + stsIncludeSubdomains: true + stsPreload: true + stsSeconds: 31536000 + customFrameOptionsValue: "SAMEORIGIN" + customResponseHeaders: + X-Content-Type-Options: "nosniff" + Referrer-Policy: "strict-origin-when-cross-origin" + + # Nextcloud specific headers + nextcloud-secure-headers: + headers: + hostsProxyHeaders: + - "X-Forwarded-Host" + - "X-Forwarded-Proto" + referrerPolicy: "same-origin" + customFrameOptionsValue: "SAMEORIGIN" + + # Rate limiting + rate-limit: + rateLimit: + average: 100 + burst: 50 + period: 1m + + # Nextcloud chain + nextcloud-chain: + chain: + middlewares: + - nextcloud-secure-headers + - security-headers \ No newline at end of file