Initial commit
This commit is contained in:
commit
b48cf28c04
6 changed files with 304 additions and 0 deletions
8
README.md
Normal file
8
README.md
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
### Checklist
|
||||||
|
|
||||||
|
1. Replace IP addressses in `docker-compose.yml`
|
||||||
|
3. In `nginx`:
|
||||||
|
- `openssl dhparam -out dhparam.pem 3072` (takes up to a few minutes, you can do the two below steps in the meantime)
|
||||||
|
- `openssl req -new -x509 -days 365 -noenc -out snakeoil.pem -keyout snakeoil.key` (keep pressing Enter)
|
||||||
|
- Replace hostname in `conf.d/invidious.conf`
|
||||||
|
4. `docker compose up -d` and [issue a certificate](https://git.m724.eu/Minecon724/dream-setup/src/branch/master/CERTIFICATE.md)
|
29
botPolicy.json
Normal file
29
botPolicy.json
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
{
|
||||||
|
"bots": [
|
||||||
|
{
|
||||||
|
"name": "well-known",
|
||||||
|
"path_regex": "^/.well-known/.*$",
|
||||||
|
"action": "ALLOW"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "favicon",
|
||||||
|
"path_regex": "^/favicon.ico$",
|
||||||
|
"action": "ALLOW"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "robots-txt",
|
||||||
|
"path_regex": "^/robots.txt$",
|
||||||
|
"action": "ALLOW"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "stats",
|
||||||
|
"path_regex": "^/api/v1/stats$",
|
||||||
|
"action": "ALLOW"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "generic-browser",
|
||||||
|
"path_regex": ".*",
|
||||||
|
"action": "CHALLENGE"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
37
docker-compose.yml
Normal file
37
docker-compose.yml
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
services:
|
||||||
|
nginx:
|
||||||
|
image: nginx:alpine-slim # https://hub.docker.com/_/nginx
|
||||||
|
restart: always
|
||||||
|
volumes:
|
||||||
|
- ./nginx:/etc/nginx
|
||||||
|
- ./html:/var/www/html:ro
|
||||||
|
- ssl-certs:/etc/ssl:ro
|
||||||
|
ports:
|
||||||
|
- "198.51.100.1:80:80"
|
||||||
|
- "[2001:db8::1]:80:80"
|
||||||
|
- "198.51.100.1:443:443"
|
||||||
|
- "[2001:db8::1]:443:443"
|
||||||
|
- "198.51.100.1:443:443/udp"
|
||||||
|
- "[2001:db8::1]:443:443/udp"
|
||||||
|
|
||||||
|
acme:
|
||||||
|
image: neilpang/acme.sh:latest # https://github.com/acmesh-official/acme.sh/wiki/Run-acme.sh-in-docker
|
||||||
|
restart: always
|
||||||
|
volumes:
|
||||||
|
- acme-data:/acme.sh
|
||||||
|
- ssl-certs:/etc/ssl
|
||||||
|
- ./html:/var/www/html
|
||||||
|
command: daemon
|
||||||
|
|
||||||
|
anubis:
|
||||||
|
image: ghcr.io/minecon724/anubis:main
|
||||||
|
environment:
|
||||||
|
DIFFICULTY: "1"
|
||||||
|
TARGET: "http://192.168.81.2:3000"
|
||||||
|
POLICY_FNAME: "/data/cfg/botPolicy.json"
|
||||||
|
volumes:
|
||||||
|
- ./botPolicy.json:/data/cfg/botPolicy.json:ro
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
ssl-certs:
|
||||||
|
acme-data:
|
52
nginx/conf.d/invidious.conf
Normal file
52
nginx/conf.d/invidious.conf
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
server {
|
||||||
|
listen 443 ssl;
|
||||||
|
listen 443 quic;
|
||||||
|
|
||||||
|
listen [::]:443 ssl;
|
||||||
|
listen [::]:443 quic;
|
||||||
|
|
||||||
|
server_name id.example.com;
|
||||||
|
|
||||||
|
ssl_certificate_key /etc/ssl/id.example.com/key.pem;
|
||||||
|
ssl_certificate /etc/ssl/id.example.com/fullchain.pem;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
proxy_pass http://anubis:8923; # TODO make that socket
|
||||||
|
proxy_http_version 1.1; # to keep alive
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header Connection ""; # to keep alive
|
||||||
|
proxy_set_header X-Real-IP "127.0.0.1"; # docker rootless doesn't have that anyway
|
||||||
|
}
|
||||||
|
|
||||||
|
location /latest_version {
|
||||||
|
return 403;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /api/manifest/dash/id/ {
|
||||||
|
return 403;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /videoplayback {
|
||||||
|
return 403;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /api/v1/videos {
|
||||||
|
default_type text/plain;
|
||||||
|
return 403 "This endpoint has been disabled due to potent abuse";
|
||||||
|
}
|
||||||
|
|
||||||
|
location /rphealth {
|
||||||
|
default_type text/plain;
|
||||||
|
return 200 "Proxy alive";
|
||||||
|
}
|
||||||
|
|
||||||
|
location /about {
|
||||||
|
root /var/www/html/invidious;
|
||||||
|
index index.html;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /.well-known/acme-challenge {
|
||||||
|
root /var/www/html/invidious;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
94
nginx/mime.types
Normal file
94
nginx/mime.types
Normal file
|
@ -0,0 +1,94 @@
|
||||||
|
types {
|
||||||
|
text/html html htm shtml;
|
||||||
|
text/css css;
|
||||||
|
text/xml xml;
|
||||||
|
image/gif gif;
|
||||||
|
image/jpeg jpeg jpg;
|
||||||
|
application/javascript js;
|
||||||
|
application/atom+xml atom;
|
||||||
|
application/rss+xml rss;
|
||||||
|
|
||||||
|
text/mathml mml;
|
||||||
|
text/plain txt;
|
||||||
|
text/vnd.sun.j2me.app-descriptor jad;
|
||||||
|
text/vnd.wap.wml wml;
|
||||||
|
text/x-component htc;
|
||||||
|
|
||||||
|
image/avif avif;
|
||||||
|
image/png png;
|
||||||
|
image/svg+xml svg svgz;
|
||||||
|
image/tiff tif tiff;
|
||||||
|
image/vnd.wap.wbmp wbmp;
|
||||||
|
image/webp webp;
|
||||||
|
image/x-icon ico;
|
||||||
|
image/x-jng jng;
|
||||||
|
image/x-ms-bmp bmp;
|
||||||
|
|
||||||
|
font/woff woff;
|
||||||
|
font/woff2 woff2;
|
||||||
|
|
||||||
|
application/java-archive jar war ear;
|
||||||
|
application/json json;
|
||||||
|
application/mac-binhex40 hqx;
|
||||||
|
application/msword doc;
|
||||||
|
application/pdf pdf;
|
||||||
|
application/postscript ps eps ai;
|
||||||
|
application/rtf rtf;
|
||||||
|
application/vnd.apple.mpegurl m3u8;
|
||||||
|
application/vnd.google-earth.kml+xml kml;
|
||||||
|
application/vnd.google-earth.kmz kmz;
|
||||||
|
application/vnd.ms-excel xls;
|
||||||
|
application/vnd.ms-fontobject eot;
|
||||||
|
application/vnd.ms-powerpoint ppt;
|
||||||
|
application/vnd.oasis.opendocument.graphics odg;
|
||||||
|
application/vnd.oasis.opendocument.presentation odp;
|
||||||
|
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
|
||||||
|
xlsx;
|
||||||
|
application/vnd.openxmlformats-officedocument.wordprocessingml.document
|
||||||
|
docx;
|
||||||
|
application/vnd.wap.wmlc wmlc;
|
||||||
|
application/wasm wasm;
|
||||||
|
application/x-7z-compressed 7z;
|
||||||
|
application/x-cocoa cco;
|
||||||
|
application/x-java-archive-diff jardiff;
|
||||||
|
application/x-java-jnlp-file jnlp;
|
||||||
|
application/x-makeself run;
|
||||||
|
application/x-perl pl pm;
|
||||||
|
application/x-pilot prc pdb;
|
||||||
|
application/x-rar-compressed rar;
|
||||||
|
application/x-redhat-package-manager rpm;
|
||||||
|
application/x-sea sea;
|
||||||
|
application/x-shockwave-flash swf;
|
||||||
|
application/x-stuffit sit;
|
||||||
|
application/x-tcl tcl tk;
|
||||||
|
application/x-x509-ca-cert der pem crt;
|
||||||
|
application/x-xpinstall xpi;
|
||||||
|
application/xhtml+xml xhtml;
|
||||||
|
application/xspf+xml xspf;
|
||||||
|
application/zip zip;
|
||||||
|
|
||||||
|
application/octet-stream bin exe dll;
|
||||||
|
application/octet-stream deb;
|
||||||
|
application/octet-stream dmg;
|
||||||
|
application/octet-stream iso img;
|
||||||
|
application/octet-stream msi msp msm;
|
||||||
|
|
||||||
|
audio/midi mid midi kar;
|
||||||
|
audio/mpeg mp3;
|
||||||
|
audio/ogg ogg;
|
||||||
|
audio/x-m4a m4a;
|
||||||
|
audio/x-realaudio ra;
|
||||||
|
|
||||||
|
video/3gpp 3gpp 3gp;
|
||||||
|
video/mp2t ts;
|
||||||
|
video/mp4 mp4;
|
||||||
|
video/mpeg mpeg mpg;
|
||||||
|
video/quicktime mov;
|
||||||
|
video/webm webm;
|
||||||
|
video/x-flv flv;
|
||||||
|
video/x-m4v m4v;
|
||||||
|
video/x-mng mng;
|
||||||
|
video/x-ms-asf asx asf;
|
||||||
|
video/x-ms-wmv wmv;
|
||||||
|
video/x-msvideo avi;
|
||||||
|
}
|
84
nginx/nginx.conf
Normal file
84
nginx/nginx.conf
Normal file
|
@ -0,0 +1,84 @@
|
||||||
|
user nginx;
|
||||||
|
worker_processes auto;
|
||||||
|
|
||||||
|
error_log /var/log/nginx/error.log notice;
|
||||||
|
pid /var/run/nginx.pid;
|
||||||
|
|
||||||
|
events {
|
||||||
|
worker_connections 1024;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
http {
|
||||||
|
include /etc/nginx/mime.types;
|
||||||
|
default_type application/octet-stream;
|
||||||
|
|
||||||
|
log_format main '$remote_user [$time_local] "$request" '
|
||||||
|
'$status $body_bytes_sent bytes "$http_referer" '
|
||||||
|
'"$http_x_forwarded_for" "$http_user_agent"';
|
||||||
|
|
||||||
|
access_log /dev/null main;
|
||||||
|
# access_log /var/log/nginx/access.log main;
|
||||||
|
|
||||||
|
server_tokens off;
|
||||||
|
|
||||||
|
sendfile on;
|
||||||
|
tcp_nopush on;
|
||||||
|
|
||||||
|
quic_retry on;
|
||||||
|
ssl_early_data on;
|
||||||
|
quic_gso on;
|
||||||
|
|
||||||
|
keepalive_timeout 65;
|
||||||
|
|
||||||
|
gzip on;
|
||||||
|
gzip_types *;
|
||||||
|
gzip_min_length 1000;
|
||||||
|
gzip_proxied any;
|
||||||
|
|
||||||
|
# modern configuration
|
||||||
|
ssl_protocols TLSv1.3;
|
||||||
|
ssl_ecdh_curve X25519:prime256v1:secp384r1;
|
||||||
|
ssl_prefer_server_ciphers off;
|
||||||
|
|
||||||
|
# Make sure to generate it first
|
||||||
|
ssl_dhparam dhparam.pem;
|
||||||
|
|
||||||
|
# OCSP stapling
|
||||||
|
ssl_stapling on;
|
||||||
|
ssl_stapling_verify on;
|
||||||
|
|
||||||
|
# replace with the IP address of your resolver;
|
||||||
|
# async 'resolver' is important for proper operation of OCSP stapling
|
||||||
|
#resolver [2001:4860:4860::8888] [2001:4860:4860::8844];
|
||||||
|
resolver 8.8.8.8 8.8.4.4;
|
||||||
|
|
||||||
|
http2 on;
|
||||||
|
add_header Alt-Svc 'h3=":443"; ma=86400' always;
|
||||||
|
|
||||||
|
# HTTPS redirect
|
||||||
|
server {
|
||||||
|
listen 80 default_server;
|
||||||
|
listen [::]:80 default_server;
|
||||||
|
|
||||||
|
return 301 https://$host$request_uri;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# default HTTPS server
|
||||||
|
server {
|
||||||
|
listen 443 ssl default_server;
|
||||||
|
listen 443 quic reuseport default_server;
|
||||||
|
listen [::]:443 ssl default_server;
|
||||||
|
listen [::]:443 quic reuseport default_server;
|
||||||
|
|
||||||
|
server_name _;
|
||||||
|
|
||||||
|
# Make sure to generate first
|
||||||
|
ssl_certificate snakeoil.pem;
|
||||||
|
ssl_certificate_key snakeoil.key;
|
||||||
|
}
|
||||||
|
|
||||||
|
include /etc/nginx/conf.d/*.conf;
|
||||||
|
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue