initial commit
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
data/
|
||||
meta/
|
||||
.env
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
services:
|
||||
garage:
|
||||
image: dxflrs/garage:v2.2.0
|
||||
container_name: garage
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- shared
|
||||
ports:
|
||||
- '3900:3900'
|
||||
- '3901:3901'
|
||||
- '3902:3902'
|
||||
- '3903:3903'
|
||||
volumes:
|
||||
- ./data:/var/lib/garage/data
|
||||
- ./meta:/var/lib/garage/meta
|
||||
- ./garage.toml:/etc/garage.toml:ro
|
||||
environment:
|
||||
GARAGE_RPC_SECRET: ${GARAGE_RPC_SECRET}
|
||||
GARAGE_ADMIN_TOKEN: ${GARAGE_ADMIN_TOKEN}
|
||||
|
||||
garage-webui:
|
||||
image: khairul169/garage-webui
|
||||
container_name: garage-webui
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- shared
|
||||
environment:
|
||||
API_BASE_URL: http://garage:3903
|
||||
S3_ENDPOINT_URL: http://garage:3900
|
||||
S3_REGION: garage
|
||||
AUTH_USER_PASS: ${AUTH_USER_PASS}
|
||||
API_ADMIN_KEY: ${GARAGE_ADMIN_TOKEN}
|
||||
volumes:
|
||||
- ./garage.toml:/etc/garage.toml:ro
|
||||
|
||||
networks:
|
||||
shared:
|
||||
external: true
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
metadata_dir = "/var/lib/garage/meta"
|
||||
data_dir = "/var/lib/garage/data"
|
||||
|
||||
db_engine = "sqlite"
|
||||
replication_factor = 2
|
||||
compression_level = 1
|
||||
|
||||
rpc_bind_addr = "[::]:3901"
|
||||
rpc_public_addr = "garage.timothykim.net:3901"
|
||||
rpc_secret = ""
|
||||
|
||||
[s3_api]
|
||||
s3_region = "garage"
|
||||
api_bind_addr = "[::]:3900"
|
||||
|
||||
[s3_web]
|
||||
bind_addr = "[::]:3902"
|
||||
root_domain = ".web.garage"
|
||||
index = "index.html"
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
data/
|
||||
runner-data/
|
||||
.env
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
name: gitea
|
||||
|
||||
networks:
|
||||
gitea:
|
||||
external: false
|
||||
shared:
|
||||
external: true
|
||||
|
||||
services:
|
||||
server:
|
||||
image: docker.gitea.com/gitea:latest
|
||||
container_name: gitea
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- USER_UID=1000
|
||||
- USER_GID=1000
|
||||
networks:
|
||||
- gitea
|
||||
- shared
|
||||
volumes:
|
||||
- ./data:/data
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
ports:
|
||||
- "222:22"
|
||||
|
||||
runner:
|
||||
image: gitea/act_runner:latest
|
||||
container_name: gitea_runner
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
- server
|
||||
networks:
|
||||
- gitea
|
||||
environment:
|
||||
- GITEA_INSTANCE_URL=https://git.timothykim.net
|
||||
- GITEA_RUNNER_REGISTRATION_TOKEN=${GITEA_RUNNER_REGISTRATION_TOKEN}
|
||||
- CONFIG_FILE=/config.yaml
|
||||
volumes:
|
||||
- ./runner-data:/data
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
- ./runner-config.yaml:/config.yaml:ro
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
log:
|
||||
level: info
|
||||
|
||||
runner:
|
||||
file: .runner
|
||||
capacity: 1
|
||||
env_file: .env
|
||||
timeout: 3h
|
||||
insecure: false
|
||||
|
||||
cache:
|
||||
enabled: true
|
||||
dir: ""
|
||||
|
||||
container:
|
||||
network: "gitea_gitea"
|
||||
extra_hosts:
|
||||
- "git.timothykim.net:host-gateway"
|
||||
privileged: false
|
||||
valid_volumes:
|
||||
- "**"
|
||||
|
||||
host:
|
||||
workdir_parent: ""
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
cache/
|
||||
config/
|
||||
jellyfin-monitor.log
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
services:
|
||||
jellyfin:
|
||||
image: jellyfin/jellyfin
|
||||
container_name: jellyfin
|
||||
network_mode: 'host'
|
||||
volumes:
|
||||
- ./config:/config
|
||||
- ./cache:/cache
|
||||
- /opt/argento/smb/media/Movies:/media/movies
|
||||
- /opt/argento/smb/media/TV:/media/tv
|
||||
- /dev/dri:/dev/dri:rw
|
||||
runtime: nvidia
|
||||
#deploy:
|
||||
# resources:
|
||||
# reservations:
|
||||
# devices:
|
||||
# - driver: nvidia
|
||||
# count: all
|
||||
# capabilities: [gpu]
|
||||
restart: 'unless-stopped'
|
||||
# Optional - alternative address used for autodiscovery
|
||||
environment:
|
||||
- JELLYFIN_PublishedServerUrl=https://jellyfin.timothykim.net
|
||||
- NVIDIA_VISIBLE_DEVICES=all
|
||||
- NVIDIA_DRIVER_CAPABILITIES=compute,video,utility
|
||||
# Optional - may be necessary for docker healthcheck to pass if running in host network mode
|
||||
extra_hosts:
|
||||
- 'host.docker.internal:host-gateway'
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "nvidia-smi > /dev/null 2>&1 || exit 1"]
|
||||
interval: 60s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 30s
|
||||
Executable
+21
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Check GPU status in Jellyfin container
|
||||
output=$(docker exec jellyfin nvidia-smi 2>&1)
|
||||
exit_code=$?
|
||||
|
||||
# Log file location
|
||||
LOG_FILE="/opt/docker/jellyfin/jellyfin-monitor.log"
|
||||
|
||||
# Check if command failed or output contains "error" (case insensitive)
|
||||
if [ $exit_code -ne 0 ] || echo "$output" | grep -iq "error"; then
|
||||
echo "$(date): GPU error detected." | tee -a "$LOG_FILE"
|
||||
echo $output | tee -a "$LOG_FILE"
|
||||
echo "$(date): Restarting Jellyfin..." | tee -a "$LOG_FILE"
|
||||
cd /opt/docker/jellyfin/
|
||||
docker compose restart
|
||||
echo "$(date): Jellyfin restarted successfully" | tee -a "$LOG_FILE"
|
||||
else
|
||||
echo "$(date): GPU status OK"
|
||||
fi
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
daemon/
|
||||
web/
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
services:
|
||||
web:
|
||||
image: githubyumao/mcsmanager-web:latest
|
||||
container_name: mcsmanager-web
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- shared
|
||||
extra_hosts:
|
||||
- "minecraft.thekims.family:host-gateway"
|
||||
volumes:
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
- ./web/data:/opt/mcsmanager/web/data
|
||||
- ./web/logs:/opt/mcsmanager/web/logs
|
||||
|
||||
daemon:
|
||||
image: githubyumao/mcsmanager-daemon:latest
|
||||
container_name: mcsmanager-daemon
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- shared
|
||||
expose:
|
||||
- "24444"
|
||||
ports:
|
||||
- "25500-25600:25500-25600"
|
||||
environment:
|
||||
- MCSM_DOCKER_WORKSPACE_PATH=./daemon/data/InstanceData
|
||||
volumes:
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
- ./daemon/data:/opt/mcsmanager/daemon/data
|
||||
- ./daemon/logs:/opt/mcsmanager/daemon/logs
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
|
||||
networks:
|
||||
shared:
|
||||
external: true
|
||||
@@ -0,0 +1,5 @@
|
||||
app/
|
||||
certs/
|
||||
data/
|
||||
db/
|
||||
.env
|
||||
@@ -0,0 +1,12 @@
|
||||
FROM nextcloud:latest
|
||||
|
||||
# Install smbclient and required dependencies
|
||||
RUN set -x && apt-get update \
|
||||
# PHP Module smbclient
|
||||
&& apt-get install -y smbclient libsmbclient-dev \
|
||||
&& pecl install smbclient \
|
||||
&& docker-php-ext-enable smbclient \
|
||||
# ffmpeg
|
||||
&& apt-get install -y ffmpeg \
|
||||
&& apt-get clean \
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
services:
|
||||
nextcloud:
|
||||
# image: nextcloud:latest
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
container_name: nextcloud
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
- postgres
|
||||
- redis
|
||||
- imaginary
|
||||
volumes:
|
||||
- ./app:/var/www/html
|
||||
- ./data:/var/www/html/data
|
||||
environment:
|
||||
- POSTGRES_DB=nextcloud
|
||||
- POSTGRES_USER=nextcloud
|
||||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
|
||||
- POSTGRES_HOST=postgres
|
||||
- NEXTCLOUD_TRUSTED_DOMAINS=nextcloud.timothykim.net
|
||||
- REDIS_HOST=redis
|
||||
- SMTP_HOST=smtp.fastmail.com
|
||||
- SMTP_SECURE=ssl
|
||||
- SMTP_PORT=465
|
||||
- SMTP_AUTHTYPE=LOGIN
|
||||
- SMTP_NAME=timothykim@fastmail.fm
|
||||
- SMTP_PASSWORD=${SMTP_PASSWORD}
|
||||
- MAIL_FROM_ADDRESS=nextcloud.timothykim.net
|
||||
- MAIL_DOMAIN=fastmail.com
|
||||
- PHP_MEMORY_LIMIT=8G
|
||||
- PHP_UPLOAD_LIMIT=20G
|
||||
- APACHE_BODY_LIMIT=0
|
||||
networks:
|
||||
- nextcloud_net
|
||||
- internal_net
|
||||
- shared
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost/status.php"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 10
|
||||
start_period: 120s
|
||||
|
||||
appapi-harp:
|
||||
image: ghcr.io/nextcloud/nextcloud-appapi-harp:release
|
||||
container_name: appapi-harp
|
||||
hostname: appapi-harp
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
nextcloud:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
- HP_SHARED_KEY=${HP_SHARED_KEY}
|
||||
- NC_INSTANCE_URL=https://nextcloud.timothykim.net
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
- ./certs:/certs
|
||||
networks:
|
||||
- nextcloud_net
|
||||
|
||||
postgres:
|
||||
image: postgres:17-alpine
|
||||
container_name: nextcloud-db
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- ./db:/var/lib/postgresql/data
|
||||
environment:
|
||||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
|
||||
- POSTGRES_USER=nextcloud
|
||||
- POSTGRES_DB=nextcloud
|
||||
networks:
|
||||
- internal_net
|
||||
|
||||
redis:
|
||||
image: redis:alpine
|
||||
container_name: nextcloud-redis
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- internal_net
|
||||
|
||||
|
||||
imaginary:
|
||||
image: nextcloud/aio-imaginary:latest
|
||||
container_name: nextcloud-imaginary
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- PORT=9000
|
||||
networks:
|
||||
- internal_net
|
||||
|
||||
networks:
|
||||
internal_net:
|
||||
nextcloud_net:
|
||||
external: true
|
||||
shared:
|
||||
external: true
|
||||
Executable
+32
@@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
echo "Pulling latest Nextcloud image..."
|
||||
docker pull nextcloud:latest
|
||||
|
||||
echo "Stopping containers..."
|
||||
docker compose down
|
||||
|
||||
echo "Rebuilding Nextcloud container..."
|
||||
docker compose build --no-cache nextcloud
|
||||
|
||||
echo "Starting containers..."
|
||||
docker compose up -d
|
||||
|
||||
echo "Waiting for Nextcloud to be ready..."
|
||||
sleep 10
|
||||
|
||||
echo "Running Nextcloud upgrade..."
|
||||
docker compose exec -u www-data nextcloud php occ upgrade
|
||||
|
||||
echo "Checking status..."
|
||||
docker compose exec -u www-data nextcloud php occ status
|
||||
|
||||
echo "Running checks..."
|
||||
docker compose exec -u www-data nextcloud php occ check
|
||||
|
||||
echo "Adding missing database indices..."
|
||||
docker compose exec -u www-data nextcloud php occ db:add-missing-indices
|
||||
|
||||
echo "Nextcloud update complete!"
|
||||
@@ -0,0 +1,22 @@
|
||||
services:
|
||||
nginx:
|
||||
image: nginx:alpine
|
||||
restart: unless-stopped
|
||||
container_name: nginx
|
||||
networks:
|
||||
- shared
|
||||
extra_hosts:
|
||||
- "host.docker.internal:host-gateway"
|
||||
ports:
|
||||
- '80:80'
|
||||
- '443:443'
|
||||
- '24444:24444' # for mcsmanager-daemon
|
||||
volumes:
|
||||
- ./nginx.conf:/etc/nginx/nginx.conf:ro
|
||||
- ./conf.d:/etc/nginx/conf.d:ro
|
||||
- /etc/letsencrypt:/etc/letsencrypt:ro
|
||||
- ./certbot/www:/var/www/certbot:ro
|
||||
|
||||
networks:
|
||||
shared:
|
||||
name: shared
|
||||
@@ -0,0 +1,20 @@
|
||||
# Drop connections with unknown/missing Host headers
|
||||
server {
|
||||
listen 80 default_server;
|
||||
listen [::]:80 default_server;
|
||||
server_name _;
|
||||
return 444;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443 ssl default_server;
|
||||
listen [::]:443 ssl default_server;
|
||||
http2 on;
|
||||
server_name _;
|
||||
|
||||
ssl_certificate /etc/letsencrypt/live/argento.timothykim.net/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/argento.timothykim.net/privkey.pem;
|
||||
|
||||
return 444;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
# Template for new app confs.
|
||||
# 1. Copy this file: cp _template.conf.example <domain>.conf
|
||||
# 2. Replace DOMAIN with the actual domain
|
||||
# 3. Replace UPSTREAM_NAME and CONTAINER:PORT with the app's container and port
|
||||
# 4. Run issue-cert.sh <domain> if cert doesn't exist yet
|
||||
# 5. Copy to argento, nginx -t && nginx -s reload
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
server_name DOMAIN;
|
||||
|
||||
location /.well-known/acme-challenge/ {
|
||||
root /var/www/certbot;
|
||||
}
|
||||
|
||||
location / {
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443 ssl;
|
||||
listen [::]:443 ssl;
|
||||
http2 on;
|
||||
server_name DOMAIN;
|
||||
|
||||
ssl_certificate /etc/letsencrypt/live/DOMAIN/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/DOMAIN/privkey.pem;
|
||||
|
||||
include /etc/nginx/conf.d/security-headers.inc;
|
||||
|
||||
# Use a variable so nginx starts even if the upstream is down
|
||||
set $upstream_UPSTREAM_NAME http://CONTAINER:PORT;
|
||||
|
||||
location / {
|
||||
proxy_pass $upstream_UPSTREAM_NAME;
|
||||
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;
|
||||
|
||||
# Uncomment if the app uses WebSockets
|
||||
# proxy_http_version 1.1;
|
||||
# proxy_set_header Upgrade $http_upgrade;
|
||||
# proxy_set_header Connection "upgrade";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
# Cockpit runs directly on the host (not Docker), proxied via host.docker.internal.
|
||||
# Cockpit serves its own self-signed TLS on port 9090, so proxy_pass uses https://.
|
||||
# nginx defaults proxy_ssl_verify to off, so the self-signed cert is accepted.
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
server_name argento.timothykim.net;
|
||||
|
||||
location /.well-known/acme-challenge/ {
|
||||
root /var/www/certbot;
|
||||
}
|
||||
|
||||
location / {
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443 ssl;
|
||||
listen [::]:443 ssl;
|
||||
http2 on;
|
||||
server_name argento.timothykim.net;
|
||||
|
||||
ssl_certificate /etc/letsencrypt/live/argento.timothykim.net/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/argento.timothykim.net/privkey.pem;
|
||||
|
||||
# Security headers are inlined (not included) because Cockpit uses iframes
|
||||
# internally and X-Frame-Options: DENY from security-headers.inc breaks it
|
||||
add_header Strict-Transport-Security "max-age=63072000; preload" always;
|
||||
add_header X-Content-Type-Options "nosniff" always;
|
||||
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
|
||||
add_header Permissions-Policy "geolocation=(), microphone=(), camera=()" always;
|
||||
|
||||
location / {
|
||||
proxy_pass https://host.docker.internal:9090;
|
||||
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;
|
||||
|
||||
# Cockpit uses WebSockets for terminal, system monitoring, and all UI interaction
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
server_name garage.timothykim.net;
|
||||
|
||||
location /.well-known/acme-challenge/ {
|
||||
root /var/www/certbot;
|
||||
}
|
||||
|
||||
location / {
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443 ssl;
|
||||
listen [::]:443 ssl;
|
||||
http2 on;
|
||||
server_name garage.timothykim.net;
|
||||
|
||||
ssl_certificate /etc/letsencrypt/live/garage.timothykim.net/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/garage.timothykim.net/privkey.pem;
|
||||
|
||||
include /etc/nginx/conf.d/security-headers.inc;
|
||||
|
||||
set $upstream_garage http://garage-webui:3909;
|
||||
|
||||
location / {
|
||||
proxy_pass $upstream_garage;
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
server_name git.timothykim.net;
|
||||
|
||||
location /.well-known/acme-challenge/ {
|
||||
root /var/www/certbot;
|
||||
}
|
||||
|
||||
location / {
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443 ssl;
|
||||
listen [::]:443 ssl;
|
||||
http2 on;
|
||||
server_name git.timothykim.net;
|
||||
|
||||
ssl_certificate /etc/letsencrypt/live/git.timothykim.net/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/git.timothykim.net/privkey.pem;
|
||||
|
||||
include /etc/nginx/conf.d/security-headers.inc;
|
||||
|
||||
# Git push/LFS operations can be large
|
||||
client_max_body_size 100M;
|
||||
|
||||
set $upstream_gitea http://gitea:3000;
|
||||
|
||||
location / {
|
||||
proxy_pass $upstream_gitea;
|
||||
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;
|
||||
# Gitea API token auth (used by CI runners and git CLI) arrives as
|
||||
# Authorization: Basic/Bearer — pass it through explicitly
|
||||
proxy_set_header Authorization $http_authorization;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
# Jellyfin runs on the host network (not Docker shared network) because it
|
||||
# needs direct access to hardware transcoding devices. Proxied via
|
||||
# host.docker.internal instead of container name.
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
server_name jellyfin.timothykim.net;
|
||||
|
||||
location /.well-known/acme-challenge/ {
|
||||
root /var/www/certbot;
|
||||
}
|
||||
|
||||
location / {
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443 ssl;
|
||||
listen [::]:443 ssl;
|
||||
http2 on;
|
||||
server_name jellyfin.timothykim.net;
|
||||
|
||||
ssl_certificate /etc/letsencrypt/live/jellyfin.timothykim.net/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/jellyfin.timothykim.net/privkey.pem;
|
||||
|
||||
include /etc/nginx/conf.d/security-headers.inc;
|
||||
|
||||
# Poster and metadata image uploads
|
||||
client_max_body_size 20M;
|
||||
|
||||
location / {
|
||||
proxy_pass http://host.docker.internal: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;
|
||||
|
||||
# Disable buffering when the nginx proxy gets very resource heavy upon streaming
|
||||
proxy_buffering off;
|
||||
|
||||
# Jellyfin uses WebSockets for real-time playback state and remote control
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
}
|
||||
|
||||
# Dedicated WebSocket endpoint for SyncPlay and client communication
|
||||
location /socket {
|
||||
proxy_pass http://host.docker.internal: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;
|
||||
|
||||
# sync play compatibility?
|
||||
proxy_set_header X-Forwarded-Protocol $scheme;
|
||||
proxy_set_header X-Forwarded-Host $http_host;
|
||||
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
# HTTP-only: HTTPS causes WebSocket/CORS errors with the MCSManager daemon connection.
|
||||
# No ACME challenge block needed since there's no cert to renew.
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
server_name minecraft.thekims.family;
|
||||
|
||||
location /.well-known/acme-challenge/ {
|
||||
root /var/www/certbot;
|
||||
}
|
||||
|
||||
location / {
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443 ssl;
|
||||
listen [::]:443 ssl;
|
||||
http2 on;
|
||||
server_name minecraft.thekims.family;
|
||||
|
||||
ssl_certificate /etc/letsencrypt/live/minecraft.thekims.family/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/minecraft.thekims.family/privkey.pem;
|
||||
|
||||
include /etc/nginx/conf.d/security-headers.inc;
|
||||
|
||||
set $mcsmanager_web http://mcsmanager-web:23333;
|
||||
|
||||
location / {
|
||||
proxy_pass $mcsmanager_web;
|
||||
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;
|
||||
|
||||
|
||||
# MCSManager uses WebSockets for real-time console/terminal
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
server {
|
||||
listen 24444 ssl;
|
||||
listen [::]:24444 ssl;
|
||||
server_name minecraft.thekims.family;
|
||||
|
||||
ssl_certificate /etc/letsencrypt/live/minecraft.thekims.family/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/minecraft.thekims.family/privkey.pem;
|
||||
|
||||
include /etc/nginx/conf.d/security-headers.inc;
|
||||
|
||||
set $mcsmanager_daemon http://mcsmanager-daemon:24444;
|
||||
|
||||
location / {
|
||||
proxy_pass $mcsmanager_daemon;
|
||||
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;
|
||||
|
||||
# MCSManager uses WebSockets for real-time console/terminal
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
server_name nextcloud.timothykim.net;
|
||||
|
||||
location /.well-known/acme-challenge/ {
|
||||
root /var/www/certbot;
|
||||
}
|
||||
|
||||
location / {
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443 ssl;
|
||||
listen [::]:443 ssl;
|
||||
http2 on;
|
||||
server_name nextcloud.timothykim.net;
|
||||
|
||||
ssl_certificate /etc/letsencrypt/live/nextcloud.timothykim.net/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/nextcloud.timothykim.net/privkey.pem;
|
||||
|
||||
include /etc/nginx/conf.d/security-headers.inc;
|
||||
|
||||
# Nextcloud file uploads can be up to 20G
|
||||
client_max_body_size 20G;
|
||||
# Stream uploads directly to Nextcloud instead of buffering to disk first
|
||||
proxy_request_buffering off;
|
||||
|
||||
set $upstream_nextcloud http://nextcloud:80;
|
||||
|
||||
location / {
|
||||
proxy_pass $upstream_nextcloud;
|
||||
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;
|
||||
}
|
||||
|
||||
# Nextcloud requires these redirects for CalDAV/CardDAV client discovery
|
||||
location /.well-known/carddav {
|
||||
return 301 /remote.php/dav;
|
||||
}
|
||||
|
||||
location /.well-known/caldav {
|
||||
return 301 /remote.php/dav;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
add_header Strict-Transport-Security "max-age=63072000; preload" always;
|
||||
add_header X-Content-Type-Options "nosniff" always;
|
||||
add_header X-Frame-Options "DENY" always;
|
||||
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
|
||||
add_header Permissions-Policy "geolocation=(), microphone=(), camera=()" always;
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
worker_processes auto;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
sendfile on;
|
||||
keepalive_timeout 65;
|
||||
|
||||
access_log /var/log/nginx/access.log;
|
||||
error_log /var/log/nginx/error.log;
|
||||
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384;
|
||||
ssl_prefer_server_ciphers off;
|
||||
ssl_session_cache shared:SSL:10m;
|
||||
ssl_session_timeout 1d;
|
||||
ssl_session_tickets off;
|
||||
resolver 127.0.0.11 valid=30s;
|
||||
resolver_timeout 5s;
|
||||
|
||||
include /etc/nginx/conf.d/*.conf;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user