From f8c5c2f43a73cfe48278cb36262591c80eceef60 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Thu, 21 Aug 2025 15:24:38 +0300 Subject: [PATCH] Updated --- Dockerfile | 2 +- install/Caddyfile | 1 - install/docker/Caddyfile | 49 +++++++++++++++++++++++++++ install/{ => docker}/supervisord.conf | 0 4 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 install/docker/Caddyfile rename install/{ => docker}/supervisord.conf (100%) diff --git a/Dockerfile b/Dockerfile index ac9b47074..555196297 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,7 +30,7 @@ RUN echo "*/10 * * * * php /app/cron.php >> /proc/1/fd/1 2>&1" > /etc/cron.d/app && crontab /etc/cron.d/app-cron COPY install/Caddyfile /etc/caddy/Caddyfile -COPY install/supervisord.conf /etc/supervisor/conf.d/supervisord.conf +COPY install/docker/supervisord.conf /etc/supervisor/conf.d/supervisord.conf EXPOSE 80 # EXPOSE 80 443 diff --git a/install/Caddyfile b/install/Caddyfile index 3de942165..38e73afa6 100644 --- a/install/Caddyfile +++ b/install/Caddyfile @@ -1,5 +1,4 @@ # Example Caddy configuration for TorrentPier -# Used by default for Docker {$TP_HOST} { # Set your host manually if you are not using Docker root * /app # Set your web root manually if you are not using Docker diff --git a/install/docker/Caddyfile b/install/docker/Caddyfile new file mode 100644 index 000000000..d8a640001 --- /dev/null +++ b/install/docker/Caddyfile @@ -0,0 +1,49 @@ +# Caddy configuration for TorrentPier (Docker) + +{ + auto_https {$SSL_ENABLED:off} + admin off +} + +{$TP_HOST}{$TP_PORT:80} { + root * /app + encode gzip zstd + + php { + root /app + } + + try_files {path} {path}/ /index.php?{query} + file_server + + @blocked { + path /install/* /internal_data/* /library/* /config/* + path /.ht* /.en* /.git* /.docker* + path *.sql *.tpl *.db *.inc *.log *.md + path /docker-compose.yml /Dockerfile /.env* + } + respond @blocked 404 + + redir /sitemap.xml /sitemap/sitemap.xml 301 + + @static { + path *.html *.css *.js *.json *.xml *.txt *.ico + path *.png *.jpg *.jpeg *.gif *.svg *.webp + path *.woff *.woff2 *.ttf *.eot + } + header @static { + Content-Type "{mime}; charset=utf-8" + Cache-Control "public, max-age=31536000" + } + + header { + X-Frame-Options "SAMEORIGIN" + X-Content-Type-Options "nosniff" + Referrer-Policy "strict-origin-when-cross-origin" + } +} + +# HTTPS redirect (only if SSL is enabled) +# http://{$TP_HOST} { +# redir https://{$TP_HOST}{uri} permanent +# } diff --git a/install/supervisord.conf b/install/docker/supervisord.conf similarity index 100% rename from install/supervisord.conf rename to install/docker/supervisord.conf