Browse Source

nginx->caddy; h5ai->filebrowser; smartdns->adgurd-home; +portainer-ce; etc

main
root 3 years ago
parent
commit
84e98b0925
  1. 1
      .gitignore
  2. 2
      aria2/aria2.run
  3. 54
      caddy/Caddyfile
  4. 12
      caddy/Dockerfile
  5. 0
      caddy/http/aria2/README.md
  6. 0
      caddy/http/aria2/css/bootstrap-responsive.min.css
  7. 0
      caddy/http/aria2/css/bootstrap.min.css
  8. 0
      caddy/http/aria2/css/main.css
  9. 0
      caddy/http/aria2/img/favicon.ico
  10. 0
      caddy/http/aria2/img/glyphicons-halflings-white.png
  11. 0
      caddy/http/aria2/img/glyphicons-halflings.png
  12. 0
      caddy/http/aria2/index.html
  13. 0
      caddy/http/aria2/js/aria2.js
  14. 0
      caddy/http/aria2/js/bootstrap.min.js
  15. 0
      caddy/http/aria2/js/jquery-1.7.2.min.js
  16. 0
      caddy/http/aria2/js/jquery.Storage.js
  17. 0
      caddy/http/aria2/js/jquery.base64.min.js
  18. 0
      caddy/http/aria2/js/jquery.jsonrpc.js
  19. 0
      caddy/http/aria2/js/mustache.js
  20. 0
      caddy/http/aria2/js/peerid.js
  21. 0
      caddy/http/aria2/js/yaaw.js
  22. 0
      caddy/http/aria2/offline.appcache
  23. 0
      caddy/http/speed/.github/ISSUE_TEMPLATE/bug_report.md
  24. 0
      caddy/http/speed/.github/ISSUE_TEMPLATE/feature_request.md
  25. 0
      caddy/http/speed/.gitignore
  26. 0
      caddy/http/speed/.logo/LibreSpeed.ai
  27. 0
      caddy/http/speed/.logo/LibreSpeed.svg
  28. 0
      caddy/http/speed/.logo/icon_huge.png
  29. 0
      caddy/http/speed/.logo/logo2.png
  30. 0
      caddy/http/speed/.logo/logo3.png
  31. 0
      caddy/http/speed/backend/empty.php
  32. 0
      caddy/http/speed/backend/garbage.php
  33. 0
      caddy/http/speed/backend/getIP.php
  34. 0
      caddy/http/speed/backend/getIP_ipInfo_apikey.php
  35. 0
      caddy/http/speed/basic.html
  36. 0
      caddy/http/speed/chart.html
  37. 0
      caddy/http/speed/customSettings.html
  38. 0
      caddy/http/speed/full.html
  39. 0
      caddy/http/speed/gauges.html
  40. 0
      caddy/http/speed/index.html
  41. 0
      caddy/http/speed/pretty.html
  42. 0
      caddy/http/speed/progressBar.html
  43. 0
      caddy/http/speed/speedtest.js
  44. 0
      caddy/http/speed/speedtest_worker.js
  45. 10
      caddy/http/www/lanhost.html
  46. 0
      caddy/http/www/readme.md
  47. 10
      caddy/http/www/sigkill.html
  48. 0
      caddy/http/www/style.css
  49. 0
      caddy/php-fpm/php.ini
  50. 0
      caddy/php-fpm/www.conf
  51. 11
      custom.env.example
  52. 98
      docker-compose.gen
  53. 23
      nginx/Dockerfile
  54. 6
      nginx/nginx.run
  55. 36
      nginx/nginx/conf.d/aria2.conf
  56. 18
      nginx/nginx/conf.d/files.conf
  57. 88
      nginx/nginx/conf.d/jellyfin.conf
  58. 11
      nginx/nginx/conf.d/motd.conf
  59. 18
      nginx/nginx/conf.d/speed.conf
  60. 23
      nginx/nginx/conf.d/www.conf
  61. BIN
      nginx/nginx/h5ai-0.30.0.tar.gz
  62. 41
      nginx/nginx/nginx.conf
  63. 16
      smartdns/Dockerfile
  64. BIN
      smartdns/smartdns-aarch64
  65. BIN
      smartdns/smartdns-x86_64

1
.gitignore

@ -1,2 +1,3 @@
custom.env custom.env
docker-compose.yml docker-compose.yml
docker-compose.*.gen

2
aria2/aria2.run

@ -6,7 +6,7 @@ umask 002
TEMP_PATH="/etc/aria2/aria2.conf.template" TEMP_PATH="/etc/aria2/aria2.conf.template"
CONF_PATH="/etc/aria2/aria2.conf" CONF_PATH="/etc/aria2/aria2.conf"
SESSION_PATH="/var/aria2/aria2.session" 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" touch "$SESSION_PATH"
if ! aria2c -d /tmp ${TRACKERS_URL} >/dev/null 2>&1; then if ! aria2c -d /tmp ${TRACKERS_URL} >/dev/null 2>&1; then

54
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
}

12
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"]

0
nginx/nginx/srv/http/aria2/README.md → caddy/http/aria2/README.md

0
nginx/nginx/srv/http/aria2/css/bootstrap-responsive.min.css → caddy/http/aria2/css/bootstrap-responsive.min.css

0
nginx/nginx/srv/http/aria2/css/bootstrap.min.css → caddy/http/aria2/css/bootstrap.min.css

0
nginx/nginx/srv/http/aria2/css/main.css → caddy/http/aria2/css/main.css

0
nginx/nginx/srv/http/aria2/img/favicon.ico → caddy/http/aria2/img/favicon.ico

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

0
nginx/nginx/srv/http/aria2/img/glyphicons-halflings-white.png → caddy/http/aria2/img/glyphicons-halflings-white.png

Before

Width:  |  Height:  |  Size: 8.6 KiB

After

Width:  |  Height:  |  Size: 8.6 KiB

0
nginx/nginx/srv/http/aria2/img/glyphicons-halflings.png → caddy/http/aria2/img/glyphicons-halflings.png

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

0
nginx/nginx/srv/http/aria2/index.html → caddy/http/aria2/index.html

0
nginx/nginx/srv/http/aria2/js/aria2.js → caddy/http/aria2/js/aria2.js

0
nginx/nginx/srv/http/aria2/js/bootstrap.min.js → caddy/http/aria2/js/bootstrap.min.js

0
nginx/nginx/srv/http/aria2/js/jquery-1.7.2.min.js → caddy/http/aria2/js/jquery-1.7.2.min.js

0
nginx/nginx/srv/http/aria2/js/jquery.Storage.js → caddy/http/aria2/js/jquery.Storage.js

0
nginx/nginx/srv/http/aria2/js/jquery.base64.min.js → caddy/http/aria2/js/jquery.base64.min.js

0
nginx/nginx/srv/http/aria2/js/jquery.jsonrpc.js → caddy/http/aria2/js/jquery.jsonrpc.js

0
nginx/nginx/srv/http/aria2/js/mustache.js → caddy/http/aria2/js/mustache.js

0
nginx/nginx/srv/http/aria2/js/peerid.js → caddy/http/aria2/js/peerid.js

0
nginx/nginx/srv/http/aria2/js/yaaw.js → caddy/http/aria2/js/yaaw.js

0
nginx/nginx/srv/http/aria2/offline.appcache → caddy/http/aria2/offline.appcache

0
nginx/nginx/srv/http/speed/.github/ISSUE_TEMPLATE/bug_report.md → caddy/http/speed/.github/ISSUE_TEMPLATE/bug_report.md

0
nginx/nginx/srv/http/speed/.github/ISSUE_TEMPLATE/feature_request.md → caddy/http/speed/.github/ISSUE_TEMPLATE/feature_request.md

0
nginx/nginx/srv/http/speed/.gitignore → caddy/http/speed/.gitignore

0
nginx/nginx/srv/http/speed/.logo/LibreSpeed.ai → caddy/http/speed/.logo/LibreSpeed.ai

0
nginx/nginx/srv/http/speed/.logo/LibreSpeed.svg → caddy/http/speed/.logo/LibreSpeed.svg

Before

Width:  |  Height:  |  Size: 247 KiB

After

Width:  |  Height:  |  Size: 247 KiB

0
nginx/nginx/srv/http/speed/.logo/icon_huge.png → caddy/http/speed/.logo/icon_huge.png

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 60 KiB

0
nginx/nginx/srv/http/speed/.logo/logo2.png → caddy/http/speed/.logo/logo2.png

Before

Width:  |  Height:  |  Size: 108 KiB

After

Width:  |  Height:  |  Size: 108 KiB

0
nginx/nginx/srv/http/speed/.logo/logo3.png → caddy/http/speed/.logo/logo3.png

Before

Width:  |  Height:  |  Size: 108 KiB

After

Width:  |  Height:  |  Size: 108 KiB

0
nginx/nginx/srv/http/speed/backend/empty.php → caddy/http/speed/backend/empty.php

0
nginx/nginx/srv/http/speed/backend/garbage.php → caddy/http/speed/backend/garbage.php

0
nginx/nginx/srv/http/speed/backend/getIP.php → caddy/http/speed/backend/getIP.php

0
nginx/nginx/srv/http/speed/backend/getIP_ipInfo_apikey.php → caddy/http/speed/backend/getIP_ipInfo_apikey.php

0
nginx/nginx/srv/http/speed/basic.html → caddy/http/speed/basic.html

0
nginx/nginx/srv/http/speed/chart.html → caddy/http/speed/chart.html

0
nginx/nginx/srv/http/speed/customSettings.html → caddy/http/speed/customSettings.html

0
nginx/nginx/srv/http/speed/full.html → caddy/http/speed/full.html

0
nginx/nginx/srv/http/speed/gauges.html → caddy/http/speed/gauges.html

0
nginx/nginx/srv/http/speed/index.html → caddy/http/speed/index.html

0
nginx/nginx/srv/http/speed/pretty.html → caddy/http/speed/pretty.html

0
nginx/nginx/srv/http/speed/progressBar.html → caddy/http/speed/progressBar.html

0
nginx/nginx/srv/http/speed/speedtest.js → caddy/http/speed/speedtest.js

0
nginx/nginx/srv/http/speed/speedtest_worker.js → caddy/http/speed/speedtest_worker.js

10
nginx/nginx/srv/http/www/lanhost.html → caddy/http/www/lanhost.html

@ -25,9 +25,9 @@
<div class="drop-shadow curls"> <div class="drop-shadow curls">
<h1><a href="http://files.lanhost.top">Files</a></h1> <h1><a href="http://files.lanhost.top">Files</a></h1>
<p><a href="http://files.lanhost.top/protect">Files(Protect)</a></p> <p><a href="http://files.lanhost.top/files/protect">Files(Protect)</a></p>
<p><a href="http://files.lanhost.top/public">Files(Public)</a></p> <p><a href="http://files.lanhost.top/files/public">Files(Public)</a></p>
<p><a href="http://files.lanhost.top/tmp">Files(Tmp)</a></p> <p><a href="http://files.lanhost.top/files/tmp">Files(Tmp)</a></p>
<p>Files on smb://NAS64 (protect/public/tmp).</p> <p>Files on smb://NAS64 (protect/public/tmp).</p>
<p>Directories protect/public is on server's hdd.</p> <p>Directories protect/public is on server's hdd.</p>
<p>Directory tmp is in server's memery(6G available).</p> <p>Directory tmp is in server's memery(6G available).</p>
@ -35,8 +35,8 @@
<div class="drop-shadow round rotated"> <div class="drop-shadow round rotated">
<h1>Aria2</h1> <h1>Aria2</h1>
<p><a href="http://aria2.lanhost.top/#path=ws://aria2.lanhost.top/public">Aria2(Public)</a> --&gt; <a href="http://files.lanhost.top/public/Downloads">Files(Public)</a></p> <p><a href="http://aria2.lanhost.top/#path=ws://aria2.lanhost.top/public">Aria2(Public)</a> --&gt; <a href="http://files.lanhost.top/files/public/Downloads">Files(Public)</a></p>
<p><a href="http://aria2.lanhost.top/#path=ws://aria2.lanhost.top/tmp">Aria2(Tmp)</a> --&gt; <a href="http://files.lanhost.top/tmp">Files(Tmp)</a></p> <p><a href="http://aria2.lanhost.top/#path=ws://aria2.lanhost.top/tmp">Aria2(Tmp)</a> --&gt; <a href="http://files.lanhost.top/files/tmp">Files(Tmp)</a></p>
</div> </div>
<div class="drop-shadow round"> <div class="drop-shadow round">

0
nginx/nginx/srv/http/www/readme.md → caddy/http/www/readme.md

10
nginx/nginx/srv/http/www/sigkill.html → caddy/http/www/sigkill.html

@ -25,9 +25,9 @@
<div class="drop-shadow curls"> <div class="drop-shadow curls">
<h1><a href="http://files.sigkill.top">Files</a></h1> <h1><a href="http://files.sigkill.top">Files</a></h1>
<p><a href="http://files.lanhost.top/protect">Files(Protect)</a></p> <p><a href="http://files.lanhost.top/files/protect">Files(Protect)</a></p>
<p><a href="http://files.lanhost.top/public">Files(Public)</a></p> <p><a href="http://files.lanhost.top/files/public">Files(Public)</a></p>
<p><a href="http://files.lanhost.top/tmp">Files(Tmp)</a></p> <p><a href="http://files.lanhost.top/files/tmp">Files(Tmp)</a></p>
<p>Files on smb://NAS64 (protect/public/tmp).</p> <p>Files on smb://NAS64 (protect/public/tmp).</p>
<p>Directories protect/public is on server's hdd.</p> <p>Directories protect/public is on server's hdd.</p>
<p>Directory tmp is in server's memery(6G available).</p> <p>Directory tmp is in server's memery(6G available).</p>
@ -35,8 +35,8 @@
<div class="drop-shadow round rotated"> <div class="drop-shadow round rotated">
<h1>Aria2</h1> <h1>Aria2</h1>
<p><a href="http://aria2.sigkill.top/#path=ws://aria2.sigkill.top/public">Aria2(Public)</a> --&gt; <a href="http://files.sigkill.top/public/Downloads">Files(Public)</a></p> <p><a href="http://aria2.sigkill.top/#path=ws://aria2.sigkill.top/public">Aria2(Public)</a> --&gt; <a href="http://files.sigkill.top/files/public/Downloads">Files(Public)</a></p>
<p><a href="http://aria2.sigkill.top/#path=ws://aria2.sigkill.top/tmp">Aria2(Tmp)</a> --&gt; <a href="http://files.sigkill.top/tmp">Files(Tmp)</a></p> <p><a href="http://aria2.sigkill.top/#path=ws://aria2.sigkill.top/tmp">Aria2(Tmp)</a> --&gt; <a href="http://files.sigkill.top/files/tmp">Files(Tmp)</a></p>
</div> </div>
</body> </body>
</html> </html>

0
nginx/nginx/srv/http/www/style.css → caddy/http/www/style.css

0
nginx/php-fpm/php.ini → caddy/php-fpm/php.ini

0
nginx/php-fpm/www.conf → caddy/php-fpm/www.conf

11
custom.env.example

@ -9,11 +9,15 @@ TZ=Asia/Shanghai
VOLUME_PATH=/mnt/volume VOLUME_PATH=/mnt/volume
# docker build args # 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_ALPINE_VERSION=3.16
ARGS_PYTHON_VERSION=3.8 ARGS_CADDY_VERSION=2
ARGS_NGINX_VERSION=1.22 ARGS_FILEBROWSER_VERSION=v2
ARGS_JELLYFIN_VERSION=10.7.7 ARGS_JELLYFIN_VERSION=10.7.7
ARGS_PORTAINER_VERSION=2.19.1
ARGS_PYTHON_VERSION=3.8
# proxy service # proxy service
PROXY_SOCKS_PORT=1234 PROXY_SOCKS_PORT=1234
@ -37,7 +41,6 @@ SPEED_TITLE=LibreSpeed
SPEED_PASSWD=12345678 SPEED_PASSWD=12345678
# media - jellyfin # media - jellyfin
MEDIA_PATH=/mnt/jellyfin/media MEDIA_PATH=/mnt/jellyfin/media
MEDIA_GNAME_EXTRA=("share-public") # MEDIA_GNAME_EXTRA=() if none MEDIA_GNAME_EXTRA=("share-public") # MEDIA_GNAME_EXTRA=() if none
MEDIA_PUBLISHED_URL=media.example.com # Nullable MEDIA_PUBLISHED_URL=media.example.com # Nullable

98
docker-compose.gen

@ -1,4 +1,4 @@
#!/usr/bin/bash #!/usr/bin/env bash
set -e set -e
@ -15,6 +15,7 @@ gid_of() {
# network # network
BRIDGE_SUBNET='172.16.10.0/24' BRIDGE_SUBNET='172.16.10.0/24'
DNS_IP='172.16.10.53' DNS_IP='172.16.10.53'
DNS_NAME=adguard
# samba/wsdd service # samba/wsdd service
SMB_GID_PRIVATE=$(stat -c '%g' "${SMB_PATH_PRIVATE}") 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_GID_PUBLIC=$(stat -c '%g' "${SMB_PATH_PUBLIC}")
SMB_UID_GUEST=$(stat -c '%u' "${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}) SMB_UID_ADMIN=$(id -u ${SMB_UNAME_ADMIN})
# media(jellyfin) service # media(jellyfin) service
MEDIA_UGID=$(stat -c '%u:%g' "${MEDIA_PATH}") MEDIA_UGID=$(stat -c '%u:%g' "${MEDIA_PATH}")
MEDIA_GID_VIDEO=$(gid_of video)
DEV_DRI_RENDER='/dev/dri/renderD128' DEV_DRI_RENDER='/dev/dri/renderD128'
if [ -c "${DEV_DRI_RENDER}" ]; then if [ -c "${DEV_DRI_RENDER}" ]; then
MEDIA_GID_RENDER=$(stat -c '%g' "${DEV_DRI_RENDER}") MEDIA_GID_RENDER=$(stat -c '%g' "${DEV_DRI_RENDER}")
fi fi
if [ "${MEDIA_GID_VIDEO}" = "${MEDIA_GID_RENDER}" ]; then
unset MEDIA_GID_RENDER
fi
cat <<-EOF >docker-compose.yml cat <<-EOF >docker-compose.yml
version: '3' version: '3'
services: services:
smartdns: # smartdns:
image: "lanhost.top/smartdns" # image: "lanhost.top/smartdns"
build: # build:
context: ./smartdns # context: ./smartdns
args: # args:
- ALPINE_VERSION=${ARGS_ALPINE_VERSION} # - ALPINE_VERSION=${ARGS_ALPINE_VERSION}
- APK_MIRROR=${ARGS_APK_MIRROR} # - 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: networks:
localnet: localnet:
ipv4_address: ${DNS_IP} ipv4_address: ${DNS_IP}
@ -49,7 +67,7 @@ services:
- 53:53/udp - 53:53/udp
- 53:53/tcp - 53:53/tcp
volumes: volumes:
- smartdns_cache:/smartdns - adguard_data:/opt/adguardhome
restart: unless-stopped restart: unless-stopped
proxy: proxy:
@ -73,7 +91,7 @@ services:
# - 20080:20080 # - 20080:20080
# - 20086:20086 # - 20086:20086
depends_on: depends_on:
- smartdns - ${DNS_NAME}
restart: unless-stopped restart: unless-stopped
samba: samba:
@ -118,28 +136,40 @@ services:
network_mode: host network_mode: host
restart: unless-stopped restart: unless-stopped
nginx: caddy:
image: "lanhost.top/nginx" image: "lanhost.top/caddy"
build: build:
context: ./nginx context: ./caddy
args: args:
- NGINX_VERSION=${ARGS_NGINX_VERSION} - CADDY_VERSION=${ARGS_CADDY_VERSION}
- APK_MIRROR=${ARGS_APK_MIRROR} # - APK_MIRROR=${ARGS_APK_MIRROR}
environment: # environment:
- TITLE:${SPEED_TITLE} # - TITLE:${SPEED_TITLE}
- PASSWORD:${SPEED_PASSWD} # - PASSWORD:${SPEED_PASSWD}
networks: networks:
- localnet - localnet
ports: ports:
- 80:80 - 80:80
volumes: volumes:
- ${VOLUME_PATH}/nginx/www:/srv/http/www - http_data:/srv/http/motd:rw
- motd_data:/srv/http/motd:ro - motd_data:/srv/http/motd:ro
- /srv/share/protect:/srv/http/files/protect:ro - /srv/share/protect:/srv/http/files/protect:ro
- /srv/share/public:/srv/http/files/public:ro - /srv/share/public:/srv/http/files/public:ro
- /srv/share/tmp:/srv/http/files/tmp:ro - /srv/share/tmp:/srv/http/files/tmp:ro
restart: unless-stopped 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: jellyfin:
image: "lanhost.top/jellyfin" image: "lanhost.top/jellyfin"
build: build:
@ -159,7 +189,7 @@ services:
done)$( \ done)$( \
if [ -n "${MEDIA_PUBLISHED_URL}" ]; then if [ -n "${MEDIA_PUBLISHED_URL}" ]; then
echo echo
echo " environment:" echo ' environment:'
echo " - JELLYFIN_PublishedServerUrl=${MEDIA_PUBLISHED_URL}" echo " - JELLYFIN_PublishedServerUrl=${MEDIA_PUBLISHED_URL}"
fi) fi)
network_mode: host network_mode: host
@ -169,17 +199,17 @@ services:
- ${VOLUME_PATH}/jellyfin/config:/config - ${VOLUME_PATH}/jellyfin/config:/config
- ${VOLUME_PATH}/jellyfin/cache:/cache - ${VOLUME_PATH}/jellyfin/cache:/cache
- ${VOLUME_PATH}/jellyfin/fonts:/fonts - ${VOLUME_PATH}/jellyfin/fonts:/fonts
- ${MEDIA_PATH}:/media - ${MEDIA_PATH}:/media$( \
devices:$( \
if [ -c "${DEV_DRI_RENDER}" ]; then if [ -c "${DEV_DRI_RENDER}" ]; then
echo echo
echo ' devices:'
echo ' - /dev/dri:/dev/dri' echo ' - /dev/dri:/dev/dri'
fi)$( \ 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" echo " - $dev:$dev"
done) done)
depends_on: depends_on:
- smartdns - ${DNS_NAME}
restart: unless-stopped restart: unless-stopped
motd: motd:
@ -198,7 +228,7 @@ services:
volumes: volumes:
- motd_data:/mnt/motd - motd_data:/mnt/motd
depends_on: depends_on:
- smartdns - ${DNS_NAME}
restart: unless-stopped restart: unless-stopped
$(for CONF in ${ARIA2_CONFS[@]}; do $(for CONF in ${ARIA2_CONFS[@]}; do
@ -219,11 +249,22 @@ $(for CONF in ${ARIA2_CONFS[@]}; do
volumes: volumes:
- ${SRV_PATH}:/mnt/downloads - ${SRV_PATH}:/mnt/downloads
depends_on: depends_on:
- smartdns - ${DNS_NAME}
- proxy
restart: unless-stopped restart: unless-stopped
EOF_ARIA2 EOF_ARIA2
done) 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: networks:
localnet: localnet:
driver: bridge driver: bridge
@ -234,6 +275,9 @@ networks:
- subnet: "${BRIDGE_SUBNET}" - subnet: "${BRIDGE_SUBNET}"
volumes: volumes:
smartdns_cache: # smartdns_cache:
motd_data: motd_data:
adguard_data:
http_data:
portainer_data:
EOF EOF

23
nginx/Dockerfile

@ -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"]

6
nginx/nginx.run

@ -1,6 +0,0 @@
#!/bin/sh
set -e
php-fpm81
exec nginx -g 'daemon off;'

36
nginx/nginx/conf.d/aria2.conf

@ -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";
}
}

18
nginx/nginx/conf.d/files.conf

@ -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;
}
}

88
nginx/nginx/conf.d/jellyfin.conf

@ -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;
}
}

11
nginx/nginx/conf.d/motd.conf

@ -1,11 +0,0 @@
server {
listen 80;
listen [::]:80;
server_name motd.lanhost.top motd.sigkill.top;
root /srv/http/motd;
location / {
index index;
}
}

18
nginx/nginx/conf.d/speed.conf

@ -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;
}
}

23
nginx/nginx/conf.d/www.conf

@ -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;
}
}

BIN
nginx/nginx/h5ai-0.30.0.tar.gz

Binary file not shown.

41
nginx/nginx/nginx.conf

@ -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;
}

16
smartdns/Dockerfile

@ -1,17 +1,11 @@
ARG ALPINE_VERSION=latest 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} FROM alpine:${ALPINE_VERSION}
COPY --from=builder /smartdns /usr/local/bin/ ARG ARCH=x86_64
RUN chmod +x /usr/local/bin/smartdns
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/ COPY smartdns.conf /etc/smartdns/

BIN
smartdns/smartdns-aarch64

Binary file not shown.

BIN
smartdns/smartdns-x86_64

Binary file not shown.
Loading…
Cancel
Save