diff --git a/.gitignore b/.gitignore index c160f00..247e1b4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ custom.env docker-compose.yml +docker-compose.*.gen diff --git a/aria2/aria2.run b/aria2/aria2.run index 5caeac8..ee553bd 100755 --- a/aria2/aria2.run +++ b/aria2/aria2.run @@ -6,7 +6,7 @@ umask 002 TEMP_PATH="/etc/aria2/aria2.conf.template" CONF_PATH="/etc/aria2/aria2.conf" SESSION_PATH="/var/aria2/aria2.session" -TRACKERS_URL="https://cdn.jsdelivr.net/gh/ngosang/trackerslist@master/trackers_best_ip.txt" +TRACKERS_URL="https://gitee.com/nhdxxwg233/trackerslist/raw/master/trackers_best_ip.txt" touch "$SESSION_PATH" if ! aria2c -d /tmp ${TRACKERS_URL} >/dev/null 2>&1; then diff --git a/caddy/Caddyfile b/caddy/Caddyfile new file mode 100644 index 0000000..44f71dc --- /dev/null +++ b/caddy/Caddyfile @@ -0,0 +1,54 @@ +{ + auto_https off +} + +http://lanhost.top, http://nas.lanhost.top, http://www.lanhost.top { + root * /srv/http/www + file_server { + index lanhost.html + } +} + +http://nas.sigkill.top { + root * /srv/http/www + file_server { + index sigkill.html + } +} + +http://ad.lanhost.top { + reverse_proxy http://adguard + reverse_proxy /admin http://adguard:3000 +} + +http://admin.lanhost.top { + reverse_proxy http://portainer:9000 +} + +http://aria2.lanhost.top, http://aria2.sigkill.top { + root * /srv/http/aria2 + file_server { + index index.html + } + reverse_proxy /public http://aria2-public:6800 { + rewrite /jsonrpc + } + reverse_proxy /tmp http://aria2-tmp:6800 { + rewrite /jsonrpc + } +} + +http://motd.lanhost.top, http://motd.sigkill.top { + root * /srv/http/motd + file_server / { + index index + } +} + +http://files.lanhost.top { + reverse_proxy http://files +} + +http://media.lanhost.top { + reverse_proxy http://172.16.10.1:8096 +} diff --git a/caddy/Dockerfile b/caddy/Dockerfile new file mode 100644 index 0000000..d304283 --- /dev/null +++ b/caddy/Dockerfile @@ -0,0 +1,12 @@ +ARG CADDY_VERSION=2 +FROM caddy:${CADDY_VERSION}-alpine + +COPY Caddyfile /etc/caddy/ +COPY http/ /srv/http/ + +#COPY php-fpm/www.conf /etc/php81/php-fpm.d/ +#COPY php-fpm/php.ini /etc/php81/ + +VOLUME ["/srv/http"] + +#ENTRYPOINT ["caddy.run"] diff --git a/nginx/nginx/srv/http/aria2/README.md b/caddy/http/aria2/README.md similarity index 100% rename from nginx/nginx/srv/http/aria2/README.md rename to caddy/http/aria2/README.md diff --git a/nginx/nginx/srv/http/aria2/css/bootstrap-responsive.min.css b/caddy/http/aria2/css/bootstrap-responsive.min.css similarity index 100% rename from nginx/nginx/srv/http/aria2/css/bootstrap-responsive.min.css rename to caddy/http/aria2/css/bootstrap-responsive.min.css diff --git a/nginx/nginx/srv/http/aria2/css/bootstrap.min.css b/caddy/http/aria2/css/bootstrap.min.css similarity index 100% rename from nginx/nginx/srv/http/aria2/css/bootstrap.min.css rename to caddy/http/aria2/css/bootstrap.min.css diff --git a/nginx/nginx/srv/http/aria2/css/main.css b/caddy/http/aria2/css/main.css similarity index 100% rename from nginx/nginx/srv/http/aria2/css/main.css rename to caddy/http/aria2/css/main.css diff --git a/nginx/nginx/srv/http/aria2/img/favicon.ico b/caddy/http/aria2/img/favicon.ico similarity index 100% rename from nginx/nginx/srv/http/aria2/img/favicon.ico rename to caddy/http/aria2/img/favicon.ico diff --git a/nginx/nginx/srv/http/aria2/img/glyphicons-halflings-white.png b/caddy/http/aria2/img/glyphicons-halflings-white.png similarity index 100% rename from nginx/nginx/srv/http/aria2/img/glyphicons-halflings-white.png rename to caddy/http/aria2/img/glyphicons-halflings-white.png diff --git a/nginx/nginx/srv/http/aria2/img/glyphicons-halflings.png b/caddy/http/aria2/img/glyphicons-halflings.png similarity index 100% rename from nginx/nginx/srv/http/aria2/img/glyphicons-halflings.png rename to caddy/http/aria2/img/glyphicons-halflings.png diff --git a/nginx/nginx/srv/http/aria2/index.html b/caddy/http/aria2/index.html similarity index 100% rename from nginx/nginx/srv/http/aria2/index.html rename to caddy/http/aria2/index.html diff --git a/nginx/nginx/srv/http/aria2/js/aria2.js b/caddy/http/aria2/js/aria2.js similarity index 100% rename from nginx/nginx/srv/http/aria2/js/aria2.js rename to caddy/http/aria2/js/aria2.js diff --git a/nginx/nginx/srv/http/aria2/js/bootstrap.min.js b/caddy/http/aria2/js/bootstrap.min.js similarity index 100% rename from nginx/nginx/srv/http/aria2/js/bootstrap.min.js rename to caddy/http/aria2/js/bootstrap.min.js diff --git a/nginx/nginx/srv/http/aria2/js/jquery-1.7.2.min.js b/caddy/http/aria2/js/jquery-1.7.2.min.js similarity index 100% rename from nginx/nginx/srv/http/aria2/js/jquery-1.7.2.min.js rename to caddy/http/aria2/js/jquery-1.7.2.min.js diff --git a/nginx/nginx/srv/http/aria2/js/jquery.Storage.js b/caddy/http/aria2/js/jquery.Storage.js similarity index 100% rename from nginx/nginx/srv/http/aria2/js/jquery.Storage.js rename to caddy/http/aria2/js/jquery.Storage.js diff --git a/nginx/nginx/srv/http/aria2/js/jquery.base64.min.js b/caddy/http/aria2/js/jquery.base64.min.js similarity index 100% rename from nginx/nginx/srv/http/aria2/js/jquery.base64.min.js rename to caddy/http/aria2/js/jquery.base64.min.js diff --git a/nginx/nginx/srv/http/aria2/js/jquery.jsonrpc.js b/caddy/http/aria2/js/jquery.jsonrpc.js similarity index 100% rename from nginx/nginx/srv/http/aria2/js/jquery.jsonrpc.js rename to caddy/http/aria2/js/jquery.jsonrpc.js diff --git a/nginx/nginx/srv/http/aria2/js/mustache.js b/caddy/http/aria2/js/mustache.js similarity index 100% rename from nginx/nginx/srv/http/aria2/js/mustache.js rename to caddy/http/aria2/js/mustache.js diff --git a/nginx/nginx/srv/http/aria2/js/peerid.js b/caddy/http/aria2/js/peerid.js similarity index 100% rename from nginx/nginx/srv/http/aria2/js/peerid.js rename to caddy/http/aria2/js/peerid.js diff --git a/nginx/nginx/srv/http/aria2/js/yaaw.js b/caddy/http/aria2/js/yaaw.js similarity index 100% rename from nginx/nginx/srv/http/aria2/js/yaaw.js rename to caddy/http/aria2/js/yaaw.js diff --git a/nginx/nginx/srv/http/aria2/offline.appcache b/caddy/http/aria2/offline.appcache similarity index 100% rename from nginx/nginx/srv/http/aria2/offline.appcache rename to caddy/http/aria2/offline.appcache diff --git a/nginx/nginx/srv/http/speed/.github/ISSUE_TEMPLATE/bug_report.md b/caddy/http/speed/.github/ISSUE_TEMPLATE/bug_report.md similarity index 100% rename from nginx/nginx/srv/http/speed/.github/ISSUE_TEMPLATE/bug_report.md rename to caddy/http/speed/.github/ISSUE_TEMPLATE/bug_report.md diff --git a/nginx/nginx/srv/http/speed/.github/ISSUE_TEMPLATE/feature_request.md b/caddy/http/speed/.github/ISSUE_TEMPLATE/feature_request.md similarity index 100% rename from nginx/nginx/srv/http/speed/.github/ISSUE_TEMPLATE/feature_request.md rename to caddy/http/speed/.github/ISSUE_TEMPLATE/feature_request.md diff --git a/nginx/nginx/srv/http/speed/.gitignore b/caddy/http/speed/.gitignore similarity index 100% rename from nginx/nginx/srv/http/speed/.gitignore rename to caddy/http/speed/.gitignore diff --git a/nginx/nginx/srv/http/speed/.logo/LibreSpeed.ai b/caddy/http/speed/.logo/LibreSpeed.ai similarity index 100% rename from nginx/nginx/srv/http/speed/.logo/LibreSpeed.ai rename to caddy/http/speed/.logo/LibreSpeed.ai diff --git a/nginx/nginx/srv/http/speed/.logo/LibreSpeed.svg b/caddy/http/speed/.logo/LibreSpeed.svg similarity index 100% rename from nginx/nginx/srv/http/speed/.logo/LibreSpeed.svg rename to caddy/http/speed/.logo/LibreSpeed.svg diff --git a/nginx/nginx/srv/http/speed/.logo/icon_huge.png b/caddy/http/speed/.logo/icon_huge.png similarity index 100% rename from nginx/nginx/srv/http/speed/.logo/icon_huge.png rename to caddy/http/speed/.logo/icon_huge.png diff --git a/nginx/nginx/srv/http/speed/.logo/logo2.png b/caddy/http/speed/.logo/logo2.png similarity index 100% rename from nginx/nginx/srv/http/speed/.logo/logo2.png rename to caddy/http/speed/.logo/logo2.png diff --git a/nginx/nginx/srv/http/speed/.logo/logo3.png b/caddy/http/speed/.logo/logo3.png similarity index 100% rename from nginx/nginx/srv/http/speed/.logo/logo3.png rename to caddy/http/speed/.logo/logo3.png diff --git a/nginx/nginx/srv/http/speed/backend/empty.php b/caddy/http/speed/backend/empty.php similarity index 100% rename from nginx/nginx/srv/http/speed/backend/empty.php rename to caddy/http/speed/backend/empty.php diff --git a/nginx/nginx/srv/http/speed/backend/garbage.php b/caddy/http/speed/backend/garbage.php similarity index 100% rename from nginx/nginx/srv/http/speed/backend/garbage.php rename to caddy/http/speed/backend/garbage.php diff --git a/nginx/nginx/srv/http/speed/backend/getIP.php b/caddy/http/speed/backend/getIP.php similarity index 100% rename from nginx/nginx/srv/http/speed/backend/getIP.php rename to caddy/http/speed/backend/getIP.php diff --git a/nginx/nginx/srv/http/speed/backend/getIP_ipInfo_apikey.php b/caddy/http/speed/backend/getIP_ipInfo_apikey.php similarity index 100% rename from nginx/nginx/srv/http/speed/backend/getIP_ipInfo_apikey.php rename to caddy/http/speed/backend/getIP_ipInfo_apikey.php diff --git a/nginx/nginx/srv/http/speed/basic.html b/caddy/http/speed/basic.html similarity index 100% rename from nginx/nginx/srv/http/speed/basic.html rename to caddy/http/speed/basic.html diff --git a/nginx/nginx/srv/http/speed/chart.html b/caddy/http/speed/chart.html similarity index 100% rename from nginx/nginx/srv/http/speed/chart.html rename to caddy/http/speed/chart.html diff --git a/nginx/nginx/srv/http/speed/customSettings.html b/caddy/http/speed/customSettings.html similarity index 100% rename from nginx/nginx/srv/http/speed/customSettings.html rename to caddy/http/speed/customSettings.html diff --git a/nginx/nginx/srv/http/speed/full.html b/caddy/http/speed/full.html similarity index 100% rename from nginx/nginx/srv/http/speed/full.html rename to caddy/http/speed/full.html diff --git a/nginx/nginx/srv/http/speed/gauges.html b/caddy/http/speed/gauges.html similarity index 100% rename from nginx/nginx/srv/http/speed/gauges.html rename to caddy/http/speed/gauges.html diff --git a/nginx/nginx/srv/http/speed/index.html b/caddy/http/speed/index.html similarity index 100% rename from nginx/nginx/srv/http/speed/index.html rename to caddy/http/speed/index.html diff --git a/nginx/nginx/srv/http/speed/pretty.html b/caddy/http/speed/pretty.html similarity index 100% rename from nginx/nginx/srv/http/speed/pretty.html rename to caddy/http/speed/pretty.html diff --git a/nginx/nginx/srv/http/speed/progressBar.html b/caddy/http/speed/progressBar.html similarity index 100% rename from nginx/nginx/srv/http/speed/progressBar.html rename to caddy/http/speed/progressBar.html diff --git a/nginx/nginx/srv/http/speed/speedtest.js b/caddy/http/speed/speedtest.js similarity index 100% rename from nginx/nginx/srv/http/speed/speedtest.js rename to caddy/http/speed/speedtest.js diff --git a/nginx/nginx/srv/http/speed/speedtest_worker.js b/caddy/http/speed/speedtest_worker.js similarity index 100% rename from nginx/nginx/srv/http/speed/speedtest_worker.js rename to caddy/http/speed/speedtest_worker.js diff --git a/nginx/nginx/srv/http/www/lanhost.html b/caddy/http/www/lanhost.html similarity index 83% rename from nginx/nginx/srv/http/www/lanhost.html rename to caddy/http/www/lanhost.html index b71afb4..018c1a4 100644 --- a/nginx/nginx/srv/http/www/lanhost.html +++ b/caddy/http/www/lanhost.html @@ -25,9 +25,9 @@

Files

-

Files(Protect)

-

Files(Public)

-

Files(Tmp)

+

Files(Protect)

+

Files(Public)

+

Files(Tmp)

Files on smb://NAS64 (protect/public/tmp).

Directories protect/public is on server's hdd.

Directory tmp is in server's memery(6G available).

@@ -35,8 +35,8 @@

Aria2

-

Aria2(Public) --> Files(Public)

-

Aria2(Tmp) --> Files(Tmp)

+

Aria2(Public) --> Files(Public)

+

Aria2(Tmp) --> Files(Tmp)

diff --git a/nginx/nginx/srv/http/www/readme.md b/caddy/http/www/readme.md similarity index 100% rename from nginx/nginx/srv/http/www/readme.md rename to caddy/http/www/readme.md diff --git a/nginx/nginx/srv/http/www/sigkill.html b/caddy/http/www/sigkill.html similarity index 82% rename from nginx/nginx/srv/http/www/sigkill.html rename to caddy/http/www/sigkill.html index dc8eeb0..3025145 100644 --- a/nginx/nginx/srv/http/www/sigkill.html +++ b/caddy/http/www/sigkill.html @@ -25,9 +25,9 @@

Files

-

Files(Protect)

-

Files(Public)

-

Files(Tmp)

+

Files(Protect)

+

Files(Public)

+

Files(Tmp)

Files on smb://NAS64 (protect/public/tmp).

Directories protect/public is on server's hdd.

Directory tmp is in server's memery(6G available).

@@ -35,8 +35,8 @@ diff --git a/nginx/nginx/srv/http/www/style.css b/caddy/http/www/style.css similarity index 100% rename from nginx/nginx/srv/http/www/style.css rename to caddy/http/www/style.css diff --git a/nginx/php-fpm/php.ini b/caddy/php-fpm/php.ini similarity index 100% rename from nginx/php-fpm/php.ini rename to caddy/php-fpm/php.ini diff --git a/nginx/php-fpm/www.conf b/caddy/php-fpm/www.conf similarity index 100% rename from nginx/php-fpm/www.conf rename to caddy/php-fpm/www.conf diff --git a/custom.env.example b/custom.env.example index 321047f..e230bf9 100644 --- a/custom.env.example +++ b/custom.env.example @@ -9,11 +9,15 @@ TZ=Asia/Shanghai VOLUME_PATH=/mnt/volume # docker build args -ARGS_APK_MIRROR='mirrors.aliyun.com' +ARGS_ARCH=x86_64 # x86_64/aarch64 +ARGS_ADGUARD_VERSION=latest +ARGS_APK_MIRROR=mirrors.aliyun.com ARGS_ALPINE_VERSION=3.16 -ARGS_PYTHON_VERSION=3.8 -ARGS_NGINX_VERSION=1.22 +ARGS_CADDY_VERSION=2 +ARGS_FILEBROWSER_VERSION=v2 ARGS_JELLYFIN_VERSION=10.7.7 +ARGS_PORTAINER_VERSION=2.19.1 +ARGS_PYTHON_VERSION=3.8 # proxy service PROXY_SOCKS_PORT=1234 @@ -37,7 +41,6 @@ SPEED_TITLE=LibreSpeed SPEED_PASSWD=12345678 # media - jellyfin - MEDIA_PATH=/mnt/jellyfin/media MEDIA_GNAME_EXTRA=("share-public") # MEDIA_GNAME_EXTRA=() if none MEDIA_PUBLISHED_URL=media.example.com # Nullable diff --git a/docker-compose.gen b/docker-compose.gen index bf90063..ba8c34c 100755 --- a/docker-compose.gen +++ b/docker-compose.gen @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/usr/bin/env bash set -e @@ -15,6 +15,7 @@ gid_of() { # network BRIDGE_SUBNET='172.16.10.0/24' DNS_IP='172.16.10.53' +DNS_NAME=adguard # samba/wsdd service SMB_GID_PRIVATE=$(stat -c '%g' "${SMB_PATH_PRIVATE}") @@ -22,26 +23,43 @@ SMB_GID_PROTECT=$(stat -c '%g' "${SMB_PATH_PROTECT}") SMB_GID_PUBLIC=$(stat -c '%g' "${SMB_PATH_PUBLIC}") SMB_UID_GUEST=$(stat -c '%u' "${SMB_PATH_PUBLIC}") +SMB_UGID_GUEST=$(stat -c '%u:%g' "${SMB_PATH_PUBLIC}") SMB_UID_ADMIN=$(id -u ${SMB_UNAME_ADMIN}) # media(jellyfin) service MEDIA_UGID=$(stat -c '%u:%g' "${MEDIA_PATH}") +MEDIA_GID_VIDEO=$(gid_of video) DEV_DRI_RENDER='/dev/dri/renderD128' if [ -c "${DEV_DRI_RENDER}" ]; then MEDIA_GID_RENDER=$(stat -c '%g' "${DEV_DRI_RENDER}") fi +if [ "${MEDIA_GID_VIDEO}" = "${MEDIA_GID_RENDER}" ]; then + unset MEDIA_GID_RENDER +fi cat <<-EOF >docker-compose.yml version: '3' services: - smartdns: - image: "lanhost.top/smartdns" - build: - context: ./smartdns - args: - - ALPINE_VERSION=${ARGS_ALPINE_VERSION} - - APK_MIRROR=${ARGS_APK_MIRROR} +# smartdns: +# image: "lanhost.top/smartdns" +# build: +# context: ./smartdns +# args: +# - ALPINE_VERSION=${ARGS_ALPINE_VERSION} +# - APK_MIRROR=${ARGS_APK_MIRROR} +# networks: +# localnet: +# ipv4_address: ${DNS_IP} +# ports: +# - 53:53/udp +# - 53:53/tcp +# volumes: +# - smartdns_cache:/smartdns +# restart: unless-stopped + + adguard: + image: "adguard/adguardhome:${ARGS_ADGUARD_VERSION}" networks: localnet: ipv4_address: ${DNS_IP} @@ -49,7 +67,7 @@ services: - 53:53/udp - 53:53/tcp volumes: - - smartdns_cache:/smartdns + - adguard_data:/opt/adguardhome restart: unless-stopped proxy: @@ -73,7 +91,7 @@ services: # - 20080:20080 # - 20086:20086 depends_on: - - smartdns + - ${DNS_NAME} restart: unless-stopped samba: @@ -118,28 +136,40 @@ services: network_mode: host restart: unless-stopped - nginx: - image: "lanhost.top/nginx" + caddy: + image: "lanhost.top/caddy" build: - context: ./nginx + context: ./caddy args: - - NGINX_VERSION=${ARGS_NGINX_VERSION} - - APK_MIRROR=${ARGS_APK_MIRROR} - environment: - - TITLE:${SPEED_TITLE} - - PASSWORD:${SPEED_PASSWD} + - CADDY_VERSION=${ARGS_CADDY_VERSION} +# - APK_MIRROR=${ARGS_APK_MIRROR} +# environment: +# - TITLE:${SPEED_TITLE} +# - PASSWORD:${SPEED_PASSWD} networks: - localnet ports: - 80:80 volumes: - - ${VOLUME_PATH}/nginx/www:/srv/http/www + - http_data:/srv/http/motd:rw - motd_data:/srv/http/motd:ro - /srv/share/protect:/srv/http/files/protect:ro - /srv/share/public:/srv/http/files/public:ro - /srv/share/tmp:/srv/http/files/tmp:ro restart: unless-stopped + files: + image: "filebrowser/filebrowser:${ARGS_FILEBROWSER_VERSION}" + user: ${SMB_UGID_GUEST} + networks: + - localnet + volumes: + - /srv/share/protect:/srv/protect:ro + - /srv/share/public:/srv/public + - /srv/share/tmp:/srv/tmp + - /srv/share/tmp/.filebrowser.db:/database.db + restart: unless-stopped + jellyfin: image: "lanhost.top/jellyfin" build: @@ -159,7 +189,7 @@ services: done)$( \ if [ -n "${MEDIA_PUBLISHED_URL}" ]; then echo - echo " environment:" + echo ' environment:' echo " - JELLYFIN_PublishedServerUrl=${MEDIA_PUBLISHED_URL}" fi) network_mode: host @@ -169,17 +199,17 @@ services: - ${VOLUME_PATH}/jellyfin/config:/config - ${VOLUME_PATH}/jellyfin/cache:/cache - ${VOLUME_PATH}/jellyfin/fonts:/fonts - - ${MEDIA_PATH}:/media - devices:$( \ + - ${MEDIA_PATH}:/media$( \ if [ -c "${DEV_DRI_RENDER}" ]; then echo + echo ' devices:' echo ' - /dev/dri:/dev/dri' fi)$( \ - ls /dev/video* >/dev/null 2>&1 && echo && for dev in /dev/video*; do + ls /dev/video* >/dev/null 2>&1 && echo && echo ' devices:' && for dev in /dev/video*; do echo " - $dev:$dev" done) depends_on: - - smartdns + - ${DNS_NAME} restart: unless-stopped motd: @@ -198,7 +228,7 @@ services: volumes: - motd_data:/mnt/motd depends_on: - - smartdns + - ${DNS_NAME} restart: unless-stopped $(for CONF in ${ARIA2_CONFS[@]}; do @@ -219,11 +249,22 @@ $(for CONF in ${ARIA2_CONFS[@]}; do volumes: - ${SRV_PATH}:/mnt/downloads depends_on: - - smartdns + - ${DNS_NAME} + - proxy restart: unless-stopped EOF_ARIA2 done) + portainer: + image: "portainer/portainer-ce:${ARGS_PORTAINER_VERSION}" + networks: + - localnet + volumes: + - /var/run/docker.sock:/var/run/docker.sock + - portainer_data:/data + restart: unless-stopped + + networks: localnet: driver: bridge @@ -234,6 +275,9 @@ networks: - subnet: "${BRIDGE_SUBNET}" volumes: - smartdns_cache: +# smartdns_cache: motd_data: + adguard_data: + http_data: + portainer_data: EOF diff --git a/nginx/Dockerfile b/nginx/Dockerfile deleted file mode 100644 index 374dfca..0000000 --- a/nginx/Dockerfile +++ /dev/null @@ -1,23 +0,0 @@ -ARG NGINX_VERSION=stable -FROM nginx:${NGINX_VERSION}-alpine - -ARG APK_MIRROR=dl-cdn.alpinelinux.org - -COPY nginx.run /usr/bin/ -COPY nginx/nginx.conf /etc/nginx/ -COPY nginx/conf.d/ /etc/nginx/conf.d/ -COPY nginx/srv/ /srv/ -ADD nginx/h5ai-0.30.0.tar.gz /srv/http/files/ - -RUN sed -i "s/dl-cdn.alpinelinux.org/${APK_MIRROR}/g" /etc/apk/repositories && \ - apk add --no-cache php81-fpm php81-session php81-ctype php81-pdo php81-openssl && \ - find /srv/http/files/_h5ai -type d -exec chmod a+x {} + && \ - chmod -R a+rw /srv/http/files/_h5ai && \ - chown -R nginx:nginx /srv/http - -COPY php-fpm/www.conf /etc/php81/php-fpm.d/ -COPY php-fpm/php.ini /etc/php81/ - -VOLUME ["/etc/nginx", "/srv/http"] - -ENTRYPOINT ["nginx.run"] diff --git a/nginx/nginx.run b/nginx/nginx.run deleted file mode 100755 index 3622fa6..0000000 --- a/nginx/nginx.run +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -set -e - -php-fpm81 -exec nginx -g 'daemon off;' diff --git a/nginx/nginx/conf.d/aria2.conf b/nginx/nginx/conf.d/aria2.conf deleted file mode 100644 index ad3a6aa..0000000 --- a/nginx/nginx/conf.d/aria2.conf +++ /dev/null @@ -1,36 +0,0 @@ -server { - listen 80; - listen [::]:80; - server_name aria2.lanhost.top aria2.sigkill.top; - - location / { - root /srv/http/aria2; - index index.html; - } - - location /public { - proxy_pass http://aria2-public:6800/jsonrpc; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header Host $host; - - # WebSocket - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - } - - location /tmp { - proxy_pass http://aria2-tmp:6800/jsonrpc; - proxy_redirect off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header Host $host; - - # WebSocket - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - } -} diff --git a/nginx/nginx/conf.d/files.conf b/nginx/nginx/conf.d/files.conf deleted file mode 100644 index d9e5164..0000000 --- a/nginx/nginx/conf.d/files.conf +++ /dev/null @@ -1,18 +0,0 @@ -server { - listen 80; - listen [::]:80; - server_name files.lanhost.top files.sigkill.top; - - root /srv/http/files; - - location / { - index /_h5ai/public/index.php; - } - - location ~ \.php$ { - fastcgi_pass unix:/var/run/php-fpm81.sock; - fastcgi_index index.php; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - include fastcgi_params; - } -} diff --git a/nginx/nginx/conf.d/jellyfin.conf b/nginx/nginx/conf.d/jellyfin.conf deleted file mode 100644 index a9e7d06..0000000 --- a/nginx/nginx/conf.d/jellyfin.conf +++ /dev/null @@ -1,88 +0,0 @@ -server { - listen 80; - listen [::]:80; - # server_name media.sigkill.top; - - # Uncomment to redirect HTTP to HTTPS - # return 301 https://$host$request_uri; -#} - -#server { - # listen 443 ssl http2; - # listen [::]:443 ssl http2; - server_name media.lanhost.top media.sigkill.top; - - ## The default `client_max_body_size` is 1M, this might not be enough for some posters, etc. - client_max_body_size 20M; - - # use a variable to store the upstream proxy - # in this example we are using a hostname which is resolved via DNS - # (if you aren't using DNS remove the resolver line and change the variable to point to an IP address e.g `set $jellyfin 127.0.0.1`) - set $jellyfin 172.16.10.1; - #resolver 127.0.0.1 valid=30; - - #ssl_certificate /etc/letsencrypt/live/DOMAIN_NAME/fullchain.pem; - #ssl_certificate_key /etc/letsencrypt/live/DOMAIN_NAME/privkey.pem; - #include /etc/letsencrypt/options-ssl-nginx.conf; - #ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; - #add_header Strict-Transport-Security "max-age=31536000" always; - #ssl_trusted_certificate /etc/letsencrypt/live/DOMAIN_NAME/chain.pem; - #ssl_stapling on; - #ssl_stapling_verify on; - - # Security / XSS Mitigation Headers - add_header X-Frame-Options "SAMEORIGIN"; - add_header X-XSS-Protection "1; mode=block"; - add_header X-Content-Type-Options "nosniff"; - - # Content Security Policy - # See: https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP - # Enforces https content and restricts JS/CSS to origin - # External Javascript (such as cast_sender.js for Chromecast) must be whitelisted. - #add_header Content-Security-Policy "default-src https: data: blob: http://image.tmdb.org; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' https://www.gstatic.com/cv/js/sender/v1/cast_sender.js https://www.gstatic.com/eureka/clank/95/cast_sender.js https://www.gstatic.com/eureka/clank/96/cast_sender.js https://www.gstatic.com/eureka/clank/97/cast_sender.js https://www.youtube.com blob:; worker-src 'self' blob:; connect-src 'self'; object-src 'none'; frame-ancestors 'self'"; - - location = / { - return 302 http://$host/web/; - #return 302 https://$host/web/; - } - - location / { - # Proxy main Jellyfin traffic - proxy_pass http://$jellyfin:8096; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_set_header X-Forwarded-Protocol $scheme; - proxy_set_header X-Forwarded-Host $http_host; - - # Disable buffering when the nginx proxy gets very resource heavy upon streaming - proxy_buffering off; - } - - # location block for /web - This is purely for aesthetics so /web/#!/ works instead of having to go to /web/index.html/#!/ - location = /web/ { - # Proxy main Jellyfin traffic - proxy_pass http://$jellyfin:8096/web/index.html; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_set_header X-Forwarded-Protocol $scheme; - proxy_set_header X-Forwarded-Host $http_host; - } - - location /socket { - # Proxy Jellyfin Websockets traffic - proxy_pass http://$jellyfin:8096; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_set_header X-Forwarded-Protocol $scheme; - proxy_set_header X-Forwarded-Host $http_host; - } -} diff --git a/nginx/nginx/conf.d/motd.conf b/nginx/nginx/conf.d/motd.conf deleted file mode 100644 index 48ccc06..0000000 --- a/nginx/nginx/conf.d/motd.conf +++ /dev/null @@ -1,11 +0,0 @@ -server { - listen 80; - listen [::]:80; - server_name motd.lanhost.top motd.sigkill.top; - - root /srv/http/motd; - - location / { - index index; - } -} diff --git a/nginx/nginx/conf.d/speed.conf b/nginx/nginx/conf.d/speed.conf deleted file mode 100644 index 6140730..0000000 --- a/nginx/nginx/conf.d/speed.conf +++ /dev/null @@ -1,18 +0,0 @@ -server { - listen 80; - listen [::]:80; - server_name speed.lanhost.top; - - root /srv/http/speed; - - location / { - index index.html; - } - - location ~ \.php$ { - fastcgi_pass unix:/var/run/php-fpm81.sock; - fastcgi_index index.php; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - include fastcgi_params; - } -} diff --git a/nginx/nginx/conf.d/www.conf b/nginx/nginx/conf.d/www.conf deleted file mode 100644 index ec28e0e..0000000 --- a/nginx/nginx/conf.d/www.conf +++ /dev/null @@ -1,23 +0,0 @@ -server { - listen 80; - listen [::]:80; - server_name lanhost.top nas.lanhost.top; - - root /srv/http/www; - - location / { - index lanhost.html; - } -} - -server { - listen 80; - listen [::]:80; - server_name nas.sigkill.top; - - root /srv/http/www; - - location / { - index sigkill.html; - } -} diff --git a/nginx/nginx/h5ai-0.30.0.tar.gz b/nginx/nginx/h5ai-0.30.0.tar.gz deleted file mode 100644 index 6e5e2a4..0000000 Binary files a/nginx/nginx/h5ai-0.30.0.tar.gz and /dev/null differ diff --git a/nginx/nginx/nginx.conf b/nginx/nginx/nginx.conf deleted file mode 100644 index 712ae5a..0000000 --- a/nginx/nginx/nginx.conf +++ /dev/null @@ -1,41 +0,0 @@ - -user nginx; -worker_processes auto; - -error_log /var/log/nginx/error.log error; -pid /var/run/nginx.pid; - -events { - worker_connections 64; -} - - -http { - include /etc/nginx/mime.types; - default_type application/octet-stream; - - #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' - # '$status $body_bytes_sent "$http_referer" ' - # '"$http_user_agent" "$http_x_forwarded_for"'; - - #access_log /var/log/nginx/access.log main; - access_log off; - - sendfile on; - #tcp_nopush on; - client_max_body_size 25m; - - keepalive_timeout 65; - - #gzip on; - - server { - listen 80; - listen [::]:80; - server_name _; - - return 301 http://nas.sigkill.top; - } - - include /etc/nginx/conf.d/*.conf; -} diff --git a/smartdns/Dockerfile b/smartdns/Dockerfile index 53c9d6f..442fd28 100644 --- a/smartdns/Dockerfile +++ b/smartdns/Dockerfile @@ -1,17 +1,11 @@ ARG ALPINE_VERSION=latest -FROM alpine:${ALPINE_VERSION} AS builder - -ARG APK_MIRROR=dl-cdn.alpinelinux.org - -RUN sed -i "s/dl-cdn.alpinelinux.org/${APK_MIRROR}/g" /etc/apk/repositories && \ - apk add --no-cache --no-progress curl && \ - cd / && \ - wget --tries=3 -O smartdns $(curl -s https://api.github.com/repos/pymumu/smartdns/releases/latest | grep browser_download_url | egrep -o 'http.://.+/smartdns-x86_64' | head -n1) - FROM alpine:${ALPINE_VERSION} -COPY --from=builder /smartdns /usr/local/bin/ -RUN chmod +x /usr/local/bin/smartdns +ARG ARCH=x86_64 + +COPY smartdns-${ARCH} /usr/local/bin/ +RUN mv /usr/local/bin/smartdns-${ARCH} /usr/local/bin/smartdns && \ + chmod +x /usr/local/bin/smartdns COPY smartdns.conf /etc/smartdns/ diff --git a/smartdns/smartdns-aarch64 b/smartdns/smartdns-aarch64 new file mode 100644 index 0000000..9ebe400 Binary files /dev/null and b/smartdns/smartdns-aarch64 differ diff --git a/smartdns/smartdns-x86_64 b/smartdns/smartdns-x86_64 new file mode 100644 index 0000000..0763b4a Binary files /dev/null and b/smartdns/smartdns-x86_64 differ