diff --git a/gateway/caddy/Caddyfile b/gateway/caddy/Caddyfile index e77a5a5..34d39e8 100644 --- a/gateway/caddy/Caddyfile +++ b/gateway/caddy/Caddyfile @@ -6,10 +6,14 @@ } (secure) { - header { - Cache-Control "no-cache, no-store, must-revalidate" + @static-files { + file + path *.ico *.css *.js *.gif *.webp *.avif *.jpg *.jpeg *.png *.svg *.woff *.woff2 } + header @static-files Cache-Control "max-age=5184000" + header / Cache-Control "no-cache, no-store, must-revalidate" + forward_auth authelia:9091 { uri /api/authz/forward-auth copy_headers Remote-User Remote-Groups Remote-Name Remote-Email @@ -36,6 +40,101 @@ www.64815139.xyz { redir https://www.{host}{uri} } +search.64815139.xyz { + log { + output discard + } + + import secure * + + @api { + path /config + path /healthz + path /stats/errors + path /stats/checker + } + + @static { + path /static/* + } + + @notstatic { + not path /static/* + } + + @imageproxy { + path /image_proxy + } + + @notimageproxy { + not path /image_proxy + } + + header { + # 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" + + # Remove Server header + -Server + } + + header @api { + Access-Control-Allow-Methods "GET, OPTIONS" + Access-Control-Allow-Origin "*" + } + + # Cache + header @static { + # Cache + Cache-Control "public, max-age=31536000" + defer + } + + header @notstatic { + # No Cache + Cache-Control "no-cache, no-store" + Pragma "no-cache" + } + + # CSP (see http://content-security-policy.com/ ) + header @imageproxy { + Content-Security-Policy "default-src 'none'; img-src 'self' data:" + } + + header @notimageproxy { + Content-Security-Policy "upgrade-insecure-requests; default-src 'none'; script-src 'self'; style-src 'self' 'unsafe-inline'; form-action 'self' https://github.com/searxng/searxng/issues/new; font-src 'self'; frame-ancestors 'self'; base-uri 'self'; connect-src 'self' https://overpass-api.de; img-src 'self' data: https://*.tile.openstreetmap.org; frame-src https://www.youtube-nocookie.com https://player.vimeo.com https://www.dailymotion.com https://www.deezer.com https://www.mixcloud.com https://w.soundcloud.com https://embed.spotify.com" + } + + + handle { + encode zstd gzip + + reverse_proxy 192.168.0.221:8080 { + header_up X-Forwarded-Port {http.request.port} + header_up X-Forwarded-Proto {http.request.scheme} + header_up X-Real-IP {remote_host} + } + } +} + gitea.64815139.xyz { rewrite /user/login /user/oauth2/Authelia reverse_proxy 192.168.0.221:3000 diff --git a/gateway/cloudflare-ddns/config.json b/gateway/cloudflare-ddns/config.json index 8eedfbf..3197e49 100644 --- a/gateway/cloudflare-ddns/config.json +++ b/gateway/cloudflare-ddns/config.json @@ -18,6 +18,10 @@ "name": "auth", "proxied": false }, + { + "name": "search", + "proxied": false + }, { "name": "gitea", "proxied": false diff --git a/gateway/dashboard/icons/gitea.svg b/gateway/dashboard/assets/icons/gitea.svg similarity index 100% rename from gateway/dashboard/icons/gitea.svg rename to gateway/dashboard/assets/icons/gitea.svg diff --git a/gateway/dashboard/icons/immich.svg b/gateway/dashboard/assets/icons/immich.svg similarity index 100% rename from gateway/dashboard/icons/immich.svg rename to gateway/dashboard/assets/icons/immich.svg diff --git a/gateway/dashboard/assets/icons/searxng.svg b/gateway/dashboard/assets/icons/searxng.svg new file mode 100644 index 0000000..b94fe37 --- /dev/null +++ b/gateway/dashboard/assets/icons/searxng.svg @@ -0,0 +1,56 @@ + + diff --git a/gateway/dashboard/assets/wallpapers/blobs.jpg b/gateway/dashboard/assets/wallpapers/blobs.jpg new file mode 100644 index 0000000..caa0ae3 Binary files /dev/null and b/gateway/dashboard/assets/wallpapers/blobs.jpg differ diff --git a/gateway/dashboard/index.html b/gateway/dashboard/index.html index ddc1316..01fbb65 100644 --- a/gateway/dashboard/index.html +++ b/gateway/dashboard/index.html @@ -11,10 +11,18 @@