From 3d479ef9abe446c005cefb5dd00f89d9995a0405 Mon Sep 17 00:00:00 2001 From: Otho Date: Fri, 23 Feb 2024 03:25:03 -0500 Subject: [PATCH] Massive update to make config more generic. --- .gitignore | 10 +- README.md | 69 +++++++ Taskfile.yaml | 109 ++++++++-- apache24/.htaccess | 1 - dns.tf | 76 +++---- hosts.dist | 7 + root_htaccess => htaccess | 193 ++++++++---------- apache24/httpd.conf => httpd.conf.dist | 103 +++------- nginx.conf | 40 ++++ nginx/nginx.conf | 68 ------ sshd_config | 25 +++ {index-theme => theme}/.htaccess | 0 {index-theme => theme}/400.html | 0 {index-theme => theme}/403.html | 0 {index-theme => theme}/404.html | 0 {index-theme => theme}/408.html | 0 {index-theme => theme}/500.html | 0 {index-theme => theme}/502.html | 0 {index-theme => theme}/apaxy.js | 0 {index-theme => theme}/favicon.ico | Bin {index-theme => theme}/footer.html | 4 +- {index-theme => theme}/gallery.js | 0 {index-theme => theme}/header.html | 0 {index-theme => theme}/icons/addressbook.svg | 0 .../icons/application-pdf.svg | 0 .../icons/application-rss+xml.svg | 0 .../icons/application-x-archive.svg | 0 .../icons/application-x-bittorrent.svg | 0 .../icons/application-x-cd-image.svg | 0 .../icons/application-x-ms-dos-executable.svg | 0 .../icons/application-x-php.svg | 0 .../icons/application-x-rar.svg | 0 .../icons/application-x-ruby.svg | 0 .../icons/application-x-tar.svg | 0 .../icons/application-x-zip.svg | 0 .../icons/audio-x-generic.svg | 0 .../icons/audio-x-mp3-playlist.svg | 0 {index-theme => theme}/icons/deb.svg | 0 {index-theme => theme}/icons/empty.svg | 0 .../icons/evolution-calendar.svg | 0 .../icons/folder-documents.svg | 0 {index-theme => theme}/icons/folder-open.svg | 0 {index-theme => theme}/icons/folder.svg | 0 .../icons/font-x-generic.svg | 0 {index-theme => theme}/icons/image-bmp.svg | 0 {index-theme => theme}/icons/image-gif.svg | 0 {index-theme => theme}/icons/image-jpeg.svg | 0 {index-theme => theme}/icons/image-png.svg | 0 {index-theme => theme}/icons/image-tiff.svg | 0 {index-theme => theme}/icons/image-x-eps.svg | 0 .../icons/image-x-generic.svg | 0 {index-theme => theme}/icons/image-x-ico.svg | 0 {index-theme => theme}/icons/image-x-psd.svg | 0 {index-theme => theme}/icons/image-x-xcf.svg | 0 .../icons/multipart-encrypted.svg | 0 .../icons/package-x-generic.svg | 0 {index-theme => theme}/icons/rpm.svg | 0 {index-theme => theme}/icons/text-css.svg | 0 {index-theme => theme}/icons/text-html.svg | 0 {index-theme => theme}/icons/text-plain.svg | 0 .../icons/text-richtext.svg | 0 {index-theme => theme}/icons/text-x-c++.svg | 0 .../icons/text-x-c++hdr.svg | 0 {index-theme => theme}/icons/text-x-c.svg | 0 {index-theme => theme}/icons/text-x-chdr.svg | 0 .../icons/text-x-install.svg | 0 {index-theme => theme}/icons/text-x-java.svg | 0 .../icons/text-x-javascript.svg | 0 .../icons/text-x-makefile.svg | 0 .../icons/text-x-python.svg | 0 .../icons/text-x-readme.svg | 0 .../icons/text-x-script.svg | 0 .../icons/text-x-source.svg | 0 {index-theme => theme}/icons/text-x-sql.svg | 0 {index-theme => theme}/icons/text-x-tex.svg | 0 {index-theme => theme}/icons/text-xml.svg | 0 {index-theme => theme}/icons/user-home.svg | 0 .../icons/video-x-generic.svg | 0 .../icons/x-office-document.svg | 0 .../icons/x-office-drawing.svg | 0 .../icons/x-office-presentation.svg | 0 .../icons/x-office-spreadsheet.svg | 0 {index-theme => theme}/style.css | 0 83 files changed, 392 insertions(+), 313 deletions(-) create mode 100644 README.md delete mode 100644 apache24/.htaccess create mode 100644 hosts.dist rename root_htaccess => htaccess (52%) rename apache24/httpd.conf => httpd.conf.dist (55%) create mode 100644 nginx.conf delete mode 100644 nginx/nginx.conf create mode 100644 sshd_config rename {index-theme => theme}/.htaccess (100%) rename {index-theme => theme}/400.html (100%) rename {index-theme => theme}/403.html (100%) rename {index-theme => theme}/404.html (100%) rename {index-theme => theme}/408.html (100%) rename {index-theme => theme}/500.html (100%) rename {index-theme => theme}/502.html (100%) rename {index-theme => theme}/apaxy.js (100%) rename {index-theme => theme}/favicon.ico (100%) rename {index-theme => theme}/footer.html (75%) rename {index-theme => theme}/gallery.js (100%) rename {index-theme => theme}/header.html (100%) rename {index-theme => theme}/icons/addressbook.svg (100%) rename {index-theme => theme}/icons/application-pdf.svg (100%) rename {index-theme => theme}/icons/application-rss+xml.svg (100%) rename {index-theme => theme}/icons/application-x-archive.svg (100%) rename {index-theme => theme}/icons/application-x-bittorrent.svg (100%) rename {index-theme => theme}/icons/application-x-cd-image.svg (100%) rename {index-theme => theme}/icons/application-x-ms-dos-executable.svg (100%) rename {index-theme => theme}/icons/application-x-php.svg (100%) rename {index-theme => theme}/icons/application-x-rar.svg (100%) rename {index-theme => theme}/icons/application-x-ruby.svg (100%) rename {index-theme => theme}/icons/application-x-tar.svg (100%) rename {index-theme => theme}/icons/application-x-zip.svg (100%) rename {index-theme => theme}/icons/audio-x-generic.svg (100%) rename {index-theme => theme}/icons/audio-x-mp3-playlist.svg (100%) rename {index-theme => theme}/icons/deb.svg (100%) rename {index-theme => theme}/icons/empty.svg (100%) rename {index-theme => theme}/icons/evolution-calendar.svg (100%) rename {index-theme => theme}/icons/folder-documents.svg (100%) rename {index-theme => theme}/icons/folder-open.svg (100%) rename {index-theme => theme}/icons/folder.svg (100%) rename {index-theme => theme}/icons/font-x-generic.svg (100%) rename {index-theme => theme}/icons/image-bmp.svg (100%) rename {index-theme => theme}/icons/image-gif.svg (100%) rename {index-theme => theme}/icons/image-jpeg.svg (100%) rename {index-theme => theme}/icons/image-png.svg (100%) rename {index-theme => theme}/icons/image-tiff.svg (100%) rename {index-theme => theme}/icons/image-x-eps.svg (100%) rename {index-theme => theme}/icons/image-x-generic.svg (100%) rename {index-theme => theme}/icons/image-x-ico.svg (100%) rename {index-theme => theme}/icons/image-x-psd.svg (100%) rename {index-theme => theme}/icons/image-x-xcf.svg (100%) rename {index-theme => theme}/icons/multipart-encrypted.svg (100%) rename {index-theme => theme}/icons/package-x-generic.svg (100%) rename {index-theme => theme}/icons/rpm.svg (100%) rename {index-theme => theme}/icons/text-css.svg (100%) rename {index-theme => theme}/icons/text-html.svg (100%) rename {index-theme => theme}/icons/text-plain.svg (100%) rename {index-theme => theme}/icons/text-richtext.svg (100%) rename {index-theme => theme}/icons/text-x-c++.svg (100%) rename {index-theme => theme}/icons/text-x-c++hdr.svg (100%) rename {index-theme => theme}/icons/text-x-c.svg (100%) rename {index-theme => theme}/icons/text-x-chdr.svg (100%) rename {index-theme => theme}/icons/text-x-install.svg (100%) rename {index-theme => theme}/icons/text-x-java.svg (100%) rename {index-theme => theme}/icons/text-x-javascript.svg (100%) rename {index-theme => theme}/icons/text-x-makefile.svg (100%) rename {index-theme => theme}/icons/text-x-python.svg (100%) rename {index-theme => theme}/icons/text-x-readme.svg (100%) rename {index-theme => theme}/icons/text-x-script.svg (100%) rename {index-theme => theme}/icons/text-x-source.svg (100%) rename {index-theme => theme}/icons/text-x-sql.svg (100%) rename {index-theme => theme}/icons/text-x-tex.svg (100%) rename {index-theme => theme}/icons/text-xml.svg (100%) rename {index-theme => theme}/icons/user-home.svg (100%) rename {index-theme => theme}/icons/video-x-generic.svg (100%) rename {index-theme => theme}/icons/x-office-document.svg (100%) rename {index-theme => theme}/icons/x-office-drawing.svg (100%) rename {index-theme => theme}/icons/x-office-presentation.svg (100%) rename {index-theme => theme}/icons/x-office-spreadsheet.svg (100%) rename {index-theme => theme}/style.css (100%) diff --git a/.gitignore b/.gitignore index 12a24fb..5dbce89 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,14 @@ .data -vhost.d .terraform .env .cache .terraform.lock.hcl +backup/ +.nginx.conf-* +.httpd.conf-* +.haproxy.conf-* +.hosts-* +.apache24-* +hosts +rc.conf +httpd.conf \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..3fa829b --- /dev/null +++ b/README.md @@ -0,0 +1,69 @@ +# Stashbox Webhost + +Simple and secure application to host files directly from a filesystem. +I recommend setting up a ZFS fileserver and backups to complete a secure, +reliable cloud storage system. + +Designed for IPv6 but includes an extra haproxy config to handle +single-stream legacy IP traffic. You will likely need legacy IP +if you are using Plex. + +Configuration includes references to route some traffic to `app.stashbox`, +which is defined as a docker-compose app in the companion repo `stashbox-app`. + +## Components + +#### Taskfile.yml + +- Operations and deployment script library. + +#### System Configs + +Example FreeBSD system configs to support this service. + + `hosts.dist` + + `rc.conf.dist` + + `envvars.dist` + +#### HTTPd + +- Serve filesystem using file index module with custom interface and Letsencrypt. + + `httpd.conf.dist` + + - Configuration to listen on web.stashbox https. + - Domain names must be explicitly set here for Letsencrypt. + + `htaccess` + + - Custom root .htaccess based on apaxy to enhance Apache file index module. + + `theme` + + - Style and pages for the Apache file index based. + +#### Nginx + +- Forward http traffic on plex.stashbox interface to plexmediaserver backend. + +#### HAproxy + +- Listen on legacy IP interface and forward traffic to appropriate system. +- Useful to handle traffic from a port-forwarded legacy route with a single external IP. + +#### DNS Terraform + +- DNS record management using Namecheap provider. + +## References + +full breakdown of the mod_autoindex module: +- http://apache.org/docs/2.4/mod/mod_autoindex.html + +official media types list from IANA +- https://www.iana.org/assignments/media-types/media-types.xhtml + +media types included in apache +- https://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types diff --git a/Taskfile.yaml b/Taskfile.yaml index d8bdebd..798c09f 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -1,20 +1,103 @@ -# https://taskfile.dev - +--- version: '3' +silent: true + vars: - INDEX_ROOT: /data - # This is hardcoded into 2 additional files. - DOC_ROOT: /data/documents/web/stashbox + CONFIG_PATHS: | + /usr/local/etc/haproxy.conf + /usr/local/etc/nginx/nginx.conf + /usr/local/etc/apache24/httpd.conf + SERVICES: "haproxy apache24 nginx plexmediaserver" + SERVICE_PORTS: 80 443 22 32400 + command: 'echo $(whoami)@$(hostname -f)' + +dotenv: + - .env +env: + GITLAB_PROJECT_ID: '{{ .stashbox_project_id }}' + GITLAB_PROJECT_SLUG: stashbox tasks: - update-doc: + default: + - task: services + + run: ssh -qtt othostash.com '{{.command}}' + run-root: ssh -qtt othostash.com 'su -l root -c "{{.command}}"' + + exec: + - task: run + vars: + command: "{{.CLI_ARGS}}" + exec-root: + - task: run-root + vars: + command: "{{.CLI_ARGS}}" + + services-restart: cmds: - - cp root_htaccess {{.INDEX_ROOT}}/.htaccess - - cp -a index-theme {{.DOC_ROOT}} - silent: false - update-conf: + - for: { var: SERVICES } + task: run-root + vars: + command: echo service {{.ITEM}} restart + services: cmds: - - cp /usr/local/etc/apache24/httpd.conf ./.httpd-$(date +%s).conf.backup - - cp httpd.conf /usr/local/etc/apache24/httpd.conf - - /usr/local/etc/rc.d/apache24 reload + - for: { var: SERVICE_PORTS } + task: run + vars: + command: echo "=== PORT {{.ITEM}}"; sockstat -l|grep ":{{.ITEM}}" + + nano: + - task: run + vars: + command: nano {{ .CLI_ARGS }} + nano-root: + - task: run-root + vars: + command: nano {{ .CLI_ARGS }} + + diff: + - task: path-diff + vars: + remote_path: "{{.CLI_ARGS}}" + update: + - task: safe-update + vars: + remote_path: "{{.CLI_ARGS}}" + theme-update: + - task: path-update + vars: + remote_path: "{{.stashbox_webtheme_root}}/" + local_path: "theme/*" + conf-update: + cmds: + - for: { var: CONFIG_PATHS } + task: safe-update + vars: + remote_path: "{{.ITEM}}" + conf-diff: + cmds: + - for: { var: CONFIG_PATHS } + task: path-diff + vars: + remote_path: "{{.ITEM}}" + + plan: source .env; terraform init; terraform plan + migrate-state: terraform init -migrate-state + + # Utilities + path-update: echo scp "{{.local_path}}" "$stashbox_domain:{{.remote_path}}" + path-backup: scp "$stashbox_domain:{{.remote_path}}" "./.$(basename {{.remote_path}})-$(date +%s)" || echo "No file found." + path-diff: + - task: path-backup + vars: + remote_path: "{{.remote_path}}" + - diff "$(ls -c .$(basename {{.remote_path}})-*|head -n1)" "$(basename {{.remote_path}})" || [ "$?" == "1" ] + safe-update: + - task: path-backup + vars: + remote_path: "{{.remote_path}}" + - echo scp "$(basename {{.remote_path}})" "$stashbox_domain:{{.remote_path}}" + - task: path-diff + vars: + remote_path: "{{.remote_path}}" diff --git a/apache24/.htaccess b/apache24/.htaccess deleted file mode 100644 index a7a56f7..0000000 --- a/apache24/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Require all denied \ No newline at end of file diff --git a/dns.tf b/dns.tf index 57cf899..4e279fd 100644 --- a/dns.tf +++ b/dns.tf @@ -10,71 +10,71 @@ terraform { provider "namecheap" {} -variable "subnet" { +variable "stash_domain" { type = string - default = "fd00" + default = "web.stash" } -variable "db_addr" { +variable "web_addr" { type = string - default = "::1" + default = "::db" } variable "feed_addr" { type = string - default = "::2" + default = "::feed" } -variable "db_ipv4_addr" { +variable "app_addr" { type = string - default = "192.168.0.1" + default = "::beef" } -variable "domain" { +variable "ip4_ext" { type = string - default = "library.local" + default = "0.0.0.0" } -variable "feed_subdomain_name" { - type = string - default = "feed" -} - -variable "plex_subdomain_name" { - type = string - default = "plex" -} - -resource "namecheap_domain_records" "othostash" { - domain = var.domain +resource "namecheap_domain_records" "stash" { + domain = var.stash_domain record { - hostname = "@" - address = "${var.subnet}${var.db_addr}" - type = "AAAA" - } - record { - hostname = var.feed_subdomain_name - address = "${var.subnet}${var.feed_addr}" + hostname = "www" + address = var.web_addr type = "AAAA" } record { hostname = "www" - address = var.domain - type = "CNAME" + address = var.ip4_ext + type = "A" } record { - hostname = var.plex_subdomain_name - address = "${var.feed_subdomain_name}.${var.domain}" - type = "CNAME" + hostname = "feed" + address = var.feed_addr + type = "AAAA" + } + record { + hostname = "feed" + address = var.ip4_ext + type = "A" + } + record { + hostname = "app" + address = var.app_addr + type = "AAAA" + } + record { + hostname = "app" + address = var.ip4_ext + type = "A" } record { hostname = "@" - address = var.db_ipv4_addr - type = "A" + address = "www.${var.stash_domain}" + type = "CNAME" } record { - hostname = var.feed_subdomain_name - address = var.db_ipv4_addr - type = "A" + hostname = "plex" + address = "feed.${var.stash_domain}" + type = "CNAME" } } diff --git a/hosts.dist b/hosts.dist new file mode 100644 index 0000000..ba683bb --- /dev/null +++ b/hosts.dist @@ -0,0 +1,7 @@ +# I assign interface hostnames in /etc/hosts to keep track +# since this app goes years without maintenance. +fe80::deed:feed resolver.stashbox +fe80::db web.stashbox +fe80::feed plex.stashbox scp.stashbox +fe80::beef app.stashbox +127.0.0.1 ip4.stashbox diff --git a/root_htaccess b/htaccess similarity index 52% rename from root_htaccess rename to htaccess index 5adbb01..2b9cf3c 100644 --- a/root_htaccess +++ b/htaccess @@ -1,34 +1,3 @@ -# -# apaxy -# Copyright (C) 2021 @adamwhitcroft -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# - -# -# for a full breakdown of the mod_autoindex module: -# http://apache.org/docs/2.4/mod/mod_autoindex.html -# - -# -# official media types list from IANA -# https://www.iana.org/assignments/media-types/media-types.xhtml -# -# media types included in apache -# https://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types -# - # enable indexing Options +Indexes @@ -37,10 +6,10 @@ IndexOptions +Charset=UTF-8 +FancyIndexing +FoldersFirst +HTMLTable +IconsAreLin # favicon & meta viewport IndexHeadInsert "\ - \ + \ " -#IndexIgnore .htaccess /documents/web/stashbox/index-theme/ +#IndexIgnore .htaccess /documents/web/stashbox/theme/ # @@ -48,9 +17,9 @@ IndexHeadInsert "\ # -AddIcon /documents/web/stashbox/index-theme/icons/empty.svg ^^BLANKICON^^ -AddIcon /documents/web/stashbox/index-theme/icons/folder.svg ^^DIRECTORY^^ -AddIcon /documents/web/stashbox/index-theme/icons/user-home.svg .. +AddIcon /documents/web/stashbox/theme/icons/empty.svg ^^BLANKICON^^ +AddIcon /documents/web/stashbox/theme/icons/folder.svg ^^DIRECTORY^^ +AddIcon /documents/web/stashbox/theme/icons/user-home.svg .. # # unused icons (that should be soon removed) @@ -65,36 +34,36 @@ AddIcon /documents/web/stashbox/index-theme/icons/user-home.svg .. # # ext: ai eps ps -AddIconByType (ps,/documents/web/stashbox/index-theme/icons/image-x-eps.svg) application/postscript +AddIconByType (ps,/documents/web/stashbox/theme/icons/image-x-eps.svg) application/postscript # ext: bmp -AddIconByType (bmp,/documents/web/stashbox/index-theme/icons/image-bmp.svg) image/bmp +AddIconByType (bmp,/documents/web/stashbox/theme/icons/image-bmp.svg) image/bmp # ext: gif -AddIconByType (gif,/documents/web/stashbox/index-theme/icons/image-gif.svg) image/gif +AddIconByType (gif,/documents/web/stashbox/theme/icons/image-gif.svg) image/gif # ext: ico -AddIconByType (ico,/documents/web/stashbox/index-theme/icons/image-x-ico.svg) image/x-icon +AddIconByType (ico,/documents/web/stashbox/theme/icons/image-x-ico.svg) image/x-icon # ext: jpg jpeg jpe -AddIconByType (jpg,/documents/web/stashbox/index-theme/icons/image-jpeg.svg) image/jpeg +AddIconByType (jpg,/documents/web/stashbox/theme/icons/image-jpeg.svg) image/jpeg # ext: png -AddIconByType (png,/documents/web/stashbox/index-theme/icons/image-png.svg) image/png +AddIconByType (png,/documents/web/stashbox/theme/icons/image-png.svg) image/png # ext: psd -AddIconByType (psd,/documents/web/stashbox/index-theme/icons/image-x-psd.svg) image/vnd.adobe.photoshop +AddIconByType (psd,/documents/web/stashbox/theme/icons/image-x-psd.svg) image/vnd.adobe.photoshop # ext: svg svgz -AddIconByType (draw,/documents/web/stashbox/index-theme/icons/x-office-drawing.svg) image/svg+xml +AddIconByType (draw,/documents/web/stashbox/theme/icons/x-office-drawing.svg) image/svg+xml # ext: tiff tif -AddIconByType (tiff,/documents/web/stashbox/index-theme/icons/image-tiff.svg) image/tiff +AddIconByType (tiff,/documents/web/stashbox/theme/icons/image-tiff.svg) image/tiff # xcf media type not yet included in apache, fallback to AddIcon # ext: xcf -#AddIconByType (xcf,/documents/web/stashbox/index-theme/icons/image-x-xcf.svg) image/x-xcf -AddIcon /documents/web/stashbox/index-theme/icons/image-x-xcf.svg .xcf +#AddIconByType (xcf,/documents/web/stashbox/theme/icons/image-x-xcf.svg) image/x-xcf +AddIcon /documents/web/stashbox/theme/icons/image-x-xcf.svg .xcf # all other images # ext: bmp cgm g3 gif ief jpeg jpg jpe ktx png btif sgi svg svgz tiff tif psd uvi uvvi uvg uvvg djvu djv sub dwg dxf fbs fpx fst mmr rlc mdi wdp npx wbmp xif webp 3ds ras cmx fh fhc fh4 fh5 fh7 ico sid pcx pic pct pnm pbm pgm ppm rgb tga xbm xpm xwd @@ -102,7 +71,7 @@ AddIcon /documents/web/stashbox/index-theme/icons/image-x-xcf.svg .xcf # ext: otg # ext: odi # ext: oti -AddIconByType (image,/documents/web/stashbox/index-theme/icons/image-x-generic.svg) image/* \ +AddIconByType (image,/documents/web/stashbox/theme/icons/image-x-generic.svg) image/* \ application/vnd.oasis.opendocument.graphics \ application/vnd.oasis.opendocument.graphics-template \ application/vnd.oasis.opendocument.image \ @@ -117,13 +86,13 @@ AddIconByType (image,/documents/web/stashbox/index-theme/icons/image-x-generic.s # ext: m3u # ext: m3u8 # ext: pls -AddIconByType (playlist,/documents/web/stashbox/index-theme/icons/audio-x-mp3-playlist.svg) audio/x-mpegurl \ +AddIconByType (playlist,/documents/web/stashbox/theme/icons/audio-x-mp3-playlist.svg) audio/x-mpegurl \ application/vnd.apple.mpegurl \ application/pls+xml # all audio # ext: adp au snd mid midi kar rmi m4a mp4a mpga mp2 mp2a mp3 m2a m3a oga ogg spx s3m sil uva uvva eol dra dts dtshd lvp pya ecelp4800 ecelp7470 ecelp9600 rip weba aac aif aiff aifc caf flac mka m3u wax wma xm rmp ram ra wav -AddIconByType (audio,/documents/web/stashbox/index-theme/icons/audio-x-generic.svg) audio/* +AddIconByType (audio,/documents/web/stashbox/theme/icons/audio-x-generic.svg) audio/* # @@ -132,11 +101,11 @@ AddIconByType (audio,/documents/web/stashbox/index-theme/icons/audio-x-generic.s # video playlist # ext: mxu m4u -AddIconByType (playlist,/documents/web/stashbox/index-theme/icons/video-x-generic.svg) video/vnd.mpegurl +AddIconByType (playlist,/documents/web/stashbox/theme/icons/video-x-generic.svg) video/vnd.mpegurl # all video # ext: 3g2 3gp h261 h263 h264 jpgv jpm jpgm mj2 mjp2 mp4 mp4v mpg4 mpeg mpg mpe m1v m2v ogv qt mov uvh uvvh uvm uvvm uvp uvvp uvs uvvs uvv uvvv dvb fvt mxu m4u pyv uvu uvvu viv webm f4v fli flv m4v mkv mk3d mks mng asf asx avi vob wmv wm wmx wvx movie smv -AddIconByType (video,/documents/web/stashbox/index-theme/icons/video-x-generic.svg) video/* +AddIconByType (video,/documents/web/stashbox/theme/icons/video-x-generic.svg) video/* # @@ -146,27 +115,27 @@ AddIconByType (video,/documents/web/stashbox/index-theme/icons/video-x-generic.s # ext: html htm # ext: xhtml xht # ext: uri uris urls -AddIconByType (html,/documents/web/stashbox/index-theme/icons/text-html.svg) text/html \ +AddIconByType (html,/documents/web/stashbox/theme/icons/text-html.svg) text/html \ application/xhtml+xml \ text/uri-list # ext: rss # ext: atom -AddIconByType (rss,/documents/web/stashbox/index-theme/icons/application-rss+xml.svg) application/rss+xml \ +AddIconByType (rss,/documents/web/stashbox/theme/icons/application-rss+xml.svg) application/rss+xml \ application/atom+xml # ext: ics ifb # ext: vcs -AddIconByType (vcal,/documents/web/stashbox/index-theme/icons/evolution-calendar.svg) text/calendar \ +AddIconByType (vcal,/documents/web/stashbox/theme/icons/evolution-calendar.svg) text/calendar \ text/x-vcalendar # ext: vcard # ext: vcf -AddIconByType (vcard,/documents/web/stashbox/index-theme/icons/addressbook.svg) text/vcard \ +AddIconByType (vcard,/documents/web/stashbox/theme/icons/addressbook.svg) text/vcard \ text/x-vcard # ext: torrent -AddIconByType (torrent,/documents/web/stashbox/index-theme/icons/application-x-bittorrent.svg) application/x-bittorrent +AddIconByType (torrent,/documents/web/stashbox/theme/icons/application-x-bittorrent.svg) application/x-bittorrent # @@ -182,7 +151,7 @@ AddIconByType (torrent,/documents/web/stashbox/index-theme/icons/application-x-b # ext: csv # ext: xls xlm xla xlc xlt xlw # ext: xlsx -AddIconByType (calc,/documents/web/stashbox/index-theme/icons/x-office-spreadsheet.svg) application/vnd.oasis.opendocument.chart \ +AddIconByType (calc,/documents/web/stashbox/theme/icons/x-office-spreadsheet.svg) application/vnd.oasis.opendocument.chart \ application/vnd.oasis.opendocument.chart-template \ application/vnd.oasis.opendocument.formula \ application/vnd.oasis.opendocument.formula-template \ @@ -198,7 +167,7 @@ AddIconByType (calc,/documents/web/stashbox/index-theme/icons/x-office-spreadshe # ext: oth # ext: doc dot # ext: docx -AddIconByType (doc,/documents/web/stashbox/index-theme/icons/x-office-document.svg) application/vnd.oasis.opendocument.text \ +AddIconByType (doc,/documents/web/stashbox/theme/icons/x-office-document.svg) application/vnd.oasis.opendocument.text \ application/vnd.oasis.opendocument.text-master \ application/vnd.oasis.opendocument.text-template \ application/vnd.oasis.opendocument.text-web \ @@ -210,7 +179,7 @@ AddIconByType (doc,/documents/web/stashbox/index-theme/icons/x-office-document.s # ext: ppt pps pot # ext: pptx # ext: ppsx -AddIconByType (slideshow,/documents/web/stashbox/index-theme/icons/x-office-presentation.svg) application/vnd.oasis.opendocument.presentation \ +AddIconByType (slideshow,/documents/web/stashbox/theme/icons/x-office-presentation.svg) application/vnd.oasis.opendocument.presentation \ application/vnd.oasis.opendocument.presentation-template \ application/vnd.ms-powerpoint \ application/vnd.openxmlformats-officedocument.presentationml.presentation \ @@ -218,18 +187,18 @@ AddIconByType (slideshow,/documents/web/stashbox/index-theme/icons/x-office-pres # ext: mdb # ext: odb -AddIconByType (database,/documents/web/stashbox/index-theme/icons/text-x-sql.svg) application/x-msaccess \ +AddIconByType (database,/documents/web/stashbox/theme/icons/text-x-sql.svg) application/x-msaccess \ application/vnd.oasis.opendocument.database # ext: pdf -AddIconByType (pdf,/documents/web/stashbox/index-theme/icons/application-pdf.svg) application/pdf +AddIconByType (pdf,/documents/web/stashbox/theme/icons/application-pdf.svg) application/pdf # ext: rtf -AddIconByType (rtf,/documents/web/stashbox/index-theme/icons/text-richtext.svg) application/rtf +AddIconByType (rtf,/documents/web/stashbox/theme/icons/text-richtext.svg) application/rtf # ext: latex # ext: tex -AddIconByType (tex,/documents/web/stashbox/index-theme/icons/text-x-tex.svg) application/x-latex \ +AddIconByType (tex,/documents/web/stashbox/theme/icons/text-x-tex.svg) application/x-latex \ application/x-tex @@ -239,65 +208,65 @@ AddIconByType (tex,/documents/web/stashbox/index-theme/icons/text-x-tex.svg) app # h media type not yet included in apache, fallback to AddIcon # ext: h -#AddIconByType (h,/documents/web/stashbox/index-theme/icons/text-x-chdr.svg) text/x-h -AddIcon /documents/web/stashbox/index-theme/icons/text-x-chdr.svg .h +#AddIconByType (h,/documents/web/stashbox/theme/icons/text-x-chdr.svg) text/x-h +AddIcon /documents/web/stashbox/theme/icons/text-x-chdr.svg .h # hpp files do not have a specific media type, fallback to AddIcon # ext: hpp -AddIcon /documents/web/stashbox/index-theme/icons/text-x-c++hdr.svg .hpp +AddIcon /documents/web/stashbox/theme/icons/text-x-c++hdr.svg .hpp # cpp files do not have a specific media type, fallback to AddIcon # ext: cpp -AddIcon /documents/web/stashbox/index-theme/icons/text-x-c++.svg .cpp +AddIcon /documents/web/stashbox/theme/icons/text-x-c++.svg .cpp # ext: c cc cxx cpp h hh dic -AddIconByType (c,/documents/web/stashbox/index-theme/icons/text-x-c.svg) text/x-c +AddIconByType (c,/documents/web/stashbox/theme/icons/text-x-c.svg) text/x-c # ext: java # ext: jar # ext: class -AddIconByType (java,/documents/web/stashbox/index-theme/icons/text-x-java.svg) text/x-java-source \ +AddIconByType (java,/documents/web/stashbox/theme/icons/text-x-java.svg) text/x-java-source \ application/java-archive \ application/java-vm # sass and scss files do not have a specific media type, fallback to AddIcon # ext: sass scss -AddIcon /documents/web/stashbox/index-theme/icons/text-css.svg .sass .scss +AddIcon /documents/web/stashbox/theme/icons/text-css.svg .sass .scss # ext: css -AddIconByType (css,/documents/web/stashbox/index-theme/icons/text-css.svg) text/css +AddIconByType (css,/documents/web/stashbox/theme/icons/text-css.svg) text/css # ext: js # ext: json -AddIconByType (js,/documents/web/stashbox/index-theme/icons/text-x-javascript.svg) application/javascript \ +AddIconByType (js,/documents/web/stashbox/theme/icons/text-x-javascript.svg) application/javascript \ application/json # diff and patch files do not have a specific media type, fallback to AddIcon # ext: diff patch -AddIcon /documents/web/stashbox/index-theme/icons/text-x-source.svg .diff .patch +AddIcon /documents/web/stashbox/theme/icons/text-x-source.svg .diff .patch # makefile files do not have a specific media type, fallback to AddIcon # ext: Makefile -AddIcon /documents/web/stashbox/index-theme/icons/text-x-makefile.svg Makefile +AddIcon /documents/web/stashbox/theme/icons/text-x-makefile.svg Makefile # php files do not have a specific media type, fallback to AddIcon # ext: php phtml -AddIcon /documents/web/stashbox/index-theme/icons/application-x-php.svg .php .phtml +AddIcon /documents/web/stashbox/theme/icons/application-x-php.svg .php .phtml # python files do not have a specific media type, fallback to AddIcon # ext: py -AddIcon /documents/web/stashbox/index-theme/icons/text-x-python.svg .py +AddIcon /documents/web/stashbox/theme/icons/text-x-python.svg .py # ruby files do not have a specific media type, fallback to AddIcon # ext: rb -AddIcon /documents/web/stashbox/index-theme/icons/application-x-ruby.svg .rb +AddIcon /documents/web/stashbox/theme/icons/application-x-ruby.svg .rb # ext: sql -AddIconByType (sql,/documents/web/stashbox/index-theme/icons/text-x-sql.svg) application/x-sql +AddIconByType (sql,/documents/web/stashbox/theme/icons/text-x-sql.svg) application/x-sql # ext: xml xsl # ext: dtd -AddIconByType (xml,/documents/web/stashbox/index-theme/icons/text-xml.svg) application/xml \ +AddIconByType (xml,/documents/web/stashbox/theme/icons/text-xml.svg) application/xml \ application/xml-dtd @@ -307,63 +276,63 @@ AddIconByType (xml,/documents/web/stashbox/index-theme/icons/text-xml.svg) appli # pkg files do not have a specific media type, fallback to AddIcon # ext: pkg -AddIcon /documents/web/stashbox/index-theme/icons/package-x-generic.svg .pkg +AddIcon /documents/web/stashbox/theme/icons/package-x-generic.svg .pkg # ext: bin dms lrf mar so dist distz pkg bpk dump elc deploy -AddIconByType (bin,/documents/web/stashbox/index-theme/icons/multipart-encrypted.svg) application/octet-stream +AddIconByType (bin,/documents/web/stashbox/theme/icons/multipart-encrypted.svg) application/octet-stream # ext: iso -AddIconByType (cd,/documents/web/stashbox/index-theme/icons/application-x-cd-image.svg) application/x-iso9660-image +AddIconByType (cd,/documents/web/stashbox/theme/icons/application-x-cd-image.svg) application/x-iso9660-image # ext: deb udeb -AddIconByType (deb,/documents/web/stashbox/index-theme/icons/deb.svg) application/x-debian-package +AddIconByType (deb,/documents/web/stashbox/theme/icons/deb.svg) application/x-debian-package # msi files do not have a specific media type, fallback to AddIcon # ext: msi -AddIcon /documents/web/stashbox/index-theme/icons/text-x-install.svg .msi +AddIcon /documents/web/stashbox/theme/icons/text-x-install.svg .msi # ext: exe dll com bat msi -AddIconByType (exe,/documents/web/stashbox/index-theme/icons/application-x-ms-dos-executable.svg) application/x-msdownload +AddIconByType (exe,/documents/web/stashbox/theme/icons/application-x-ms-dos-executable.svg) application/x-msdownload # ext: dmg # ext: mpkg # ext: apk -AddIconByType (package,/documents/web/stashbox/index-theme/icons/package-x-generic.svg) application/x-apple-diskimage \ +AddIconByType (package,/documents/web/stashbox/theme/icons/package-x-generic.svg) application/x-apple-diskimage \ application/vnd.apple.installer+xml \ application/vnd.android.package-archive # rpm files do not have a specific media type, fallback to AddIcon # ext: rpm -AddIcon /documents/web/stashbox/index-theme/icons/rpm.svg .rpm +AddIcon /documents/web/stashbox/theme/icons/rpm.svg .rpm # ext: sh -AddIconByType (script,/documents/web/stashbox/index-theme/icons/text-x-script.svg) application/x-sh +AddIconByType (script,/documents/web/stashbox/theme/icons/text-x-script.svg) application/x-sh # ext: ttc otf ttf woff2 woff -AddIconByType (font,/documents/web/stashbox/index-theme/icons/font-x-generic.svg) font/* +AddIconByType (font,/documents/web/stashbox/theme/icons/font-x-generic.svg) font/* # # archives # # ext: gz -AddIconByType (gzip,/documents/web/stashbox/index-theme/icons/application-x-archive.svg) application/x-gzip +AddIconByType (gzip,/documents/web/stashbox/theme/icons/application-x-archive.svg) application/x-gzip # gzip media type does not include .gzip file extension, fallback to AddIcon # ext: gzip -AddIcon /documents/web/stashbox/index-theme/icons/application-x-archive.svg .gzip +AddIcon /documents/web/stashbox/theme/icons/application-x-archive.svg .gzip # ext: rar -AddIconByType (rar,/documents/web/stashbox/index-theme/icons/application-x-rar.svg) application/x-rar-compressed +AddIconByType (rar,/documents/web/stashbox/theme/icons/application-x-rar.svg) application/x-rar-compressed # ext: tar -AddIconByType (tar,/documents/web/stashbox/index-theme/icons/application-x-tar.svg) application/x-tar +AddIconByType (tar,/documents/web/stashbox/theme/icons/application-x-tar.svg) application/x-tar # ext: zip -AddIconByType (zip,/documents/web/stashbox/index-theme/icons/application-x-zip.svg) application/zip +AddIconByType (zip,/documents/web/stashbox/theme/icons/application-x-zip.svg) application/zip # ext: 7z bz bz2 cab -AddIconByType (archive,/documents/web/stashbox/index-theme/icons/application-x-archive.svg) application/x-7z-compressed \ +AddIconByType (archive,/documents/web/stashbox/theme/icons/application-x-archive.svg) application/x-7z-compressed \ application/x-bzip \ application/x-bzip2 \ application/vnd.ms-cab-compressed @@ -374,12 +343,12 @@ AddIconByType (archive,/documents/web/stashbox/index-theme/icons/application-x-a # # ext: cbr cba cbt cbz cb7 -AddIconByType (text,/documents/web/stashbox/index-theme/icons/image-x-generic.svg) application/x-cbr +AddIconByType (text,/documents/web/stashbox/theme/icons/image-x-generic.svg) application/x-cbr # ext: epub # ext: prc mobi # ext: azw -AddIconByType (text,/documents/web/stashbox/index-theme/icons/text-plain.svg) application/epub+zip \ +AddIconByType (text,/documents/web/stashbox/theme/icons/text-plain.svg) application/epub+zip \ application/x-mobipocket-ebook \ application/vnd.amazon.ebook @@ -390,41 +359,41 @@ AddIconByType (text,/documents/web/stashbox/index-theme/icons/text-plain.svg) ap # readme files do not have a specific media type, fallback to AddIcon # ext: README -AddIcon /documents/web/stashbox/index-theme/icons/text-x-readme.svg README +AddIcon /documents/web/stashbox/theme/icons/text-x-readme.svg README # markdown media type not yet included in apache, fallback to AddIcon # ext: markdown md -#AddIconByType (markdown,/documents/web/stashbox/index-theme/icons/text-richtext.svg) text/mardown -AddIcon /documents/web/stashbox/index-theme/icons/text-richtext.svg .markdown .md +#AddIconByType (markdown,/documents/web/stashbox/theme/icons/text-richtext.svg) text/mardown +AddIcon /documents/web/stashbox/theme/icons/text-richtext.svg .markdown .md # this directive has to be at the end of the file because the text/* media type is very generic and should not be interpreted before other more specific directives # ext: appcache ics ifb css csv html htm n3 txt text conf def list log in dsc rtx sgml sgm tsv t tr roff man me ms ttl uri uris urls vcard curl dcurl mcurl scurl sub fly flx gv 3dml spot jad wmls wml s asm c cc cxx cpp h hh dic f for f77 f90 java nfo opml p pas etx sfv uu vcs vcf -AddIconByType (text,/documents/web/stashbox/index-theme/icons/text-plain.svg) text/* +AddIconByType (text,/documents/web/stashbox/theme/icons/text-plain.svg) text/* # # default # -DefaultIcon /documents/web/stashbox/index-theme/icons/empty.svg +DefaultIcon /documents/web/stashbox/theme/icons/empty.svg # # theme files # -HeaderName /documents/web/stashbox/index-theme/header.html -ReadmeName /documents/web/stashbox/index-theme/footer.html -IndexStyleSheet /documents/web/stashbox/index-theme/style.css +HeaderName /documents/web/stashbox/theme/header.html +ReadmeName /documents/web/stashbox/theme/footer.html +IndexStyleSheet /documents/web/stashbox/theme/style.css # # error pages # -ErrorDocument 400 /documents/web/stashbox/index-theme/400.html -ErrorDocument 403 /documents/web/stashbox/index-theme/403.html -ErrorDocument 404 /documents/web/stashbox/index-theme/404.html -ErrorDocument 408 /documents/web/stashbox/index-theme/408.html -ErrorDocument 500 /documents/web/stashbox/index-theme/500.html -ErrorDocument 502 /documents/web/stashbox/index-theme/502.html +ErrorDocument 400 /documents/web/stashbox/theme/400.html +ErrorDocument 403 /documents/web/stashbox/theme/403.html +ErrorDocument 404 /documents/web/stashbox/theme/404.html +ErrorDocument 408 /documents/web/stashbox/theme/408.html +ErrorDocument 500 /documents/web/stashbox/theme/500.html +ErrorDocument 502 /documents/web/stashbox/theme/502.html diff --git a/apache24/httpd.conf b/httpd.conf.dist similarity index 55% rename from apache24/httpd.conf rename to httpd.conf.dist index 5fc8ec8..9ad3257 100644 --- a/apache24/httpd.conf +++ b/httpd.conf.dist @@ -1,9 +1,8 @@ -ServerName ${domain} ServerRoot /usr/local +ServerName stashbox -Listen [${subnet}${db_addr}]:80 -Listen [${subnet}${db_addr}]:443 -Listen ${db_ipv4_int_addr}:443 +Listen web.stashbox:80 +Listen web.stashbox:443 LoadModule mpm_prefork_module libexec/apache24/mod_mpm_prefork.so LoadModule authn_file_module libexec/apache24/mod_authn_file.so @@ -29,47 +28,32 @@ LoadModule status_module libexec/apache24/mod_status.so LoadModule autoindex_module libexec/apache24/mod_autoindex.so LoadModule watchdog_module libexec/apache24/mod_watchdog.so LoadModule md_module libexec/apache24/mod_md.so - - - #LoadModule cgid_module libexec/apache24/mod_cgid.so - - - #LoadModule cgi_module libexec/apache24/mod_cgi.so - LoadModule dir_module libexec/apache24/mod_dir.so LoadModule alias_module libexec/apache24/mod_alias.so IncludeOptional etc/apache24/modules.d/[0-9][0-9][0-9]_*.conf - User www Group www - + +SSLRandomSeed startup builtin +SSLRandomSeed connect builtin + +MDCertificateAgreement accepted +MDContactEmail admin@stashbox +MDomain stashbox www.stashbox AllowOverride none Require all denied -MDCertificateAgreement accepted -MDContactEmail admin@${domain} -MDomain ${domain} www.${domain} - -# -# ServerName "plex.${domain}" -# SSLEngine on -# ProxyPass "/" "http://localhost:32400" -# ProxyPassReverse "/" "http://localhost:32400" -# - - - ServerName "www.${domain}" - ServerName "${domain}" - + + Servername stashbox + ServerAlias www.stashbox SetHandler md-status - DocumentRoot "/data" Options Indexes @@ -79,63 +63,26 @@ MDomain ${domain} www.${domain} AuthUserFile /usr/local/etc/apache24/.badpass Require valid-user - Require all denied - Require all denied - - - DirectoryIndex index.html - - - SSLEngine on - # SSLCertificateFile /usr/local/etc/apache24/fullchain.pem - # SSLCertificateKeyFile /usr/local/etc/apache24/privkey.pem - - ErrorLog "/var/log/httpd-error.log" - LogLevel warn - - - LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined - LogFormat "%h %l %u %t \"%r\" %>s %b" common - - - # You need to enable mod_logio.c to use %I and %O - LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio - - - CustomLog "/var/log/httpd-access.log" common - - - - ScriptAlias /cgi-bin/ "/data/metadata/www/cgi-bin/" - - - - AllowOverride None - Options None + Require all granted - - - RequestHeader unset Proxy early - - - - TypesConfig etc/apache24/mime.types - AddType application/x-compress .Z - AddType application/x-gzip .gz .tgz - - + DirectoryIndex index.html + SSLEngine on + ErrorLog "/var/log/httpd-error.log" + LogLevel warn + LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined + LogFormat "%h %l %u %t \"%r\" %>s %b" common + CustomLog "/var/log/httpd-access.log" common + RequestHeader unset Proxy early + TypesConfig etc/apache24/mime.types + AddType application/x-compress .Z + AddType application/x-gzip .gz .tgz - - SSLRandomSeed startup builtin - SSLRandomSeed connect builtin - - Include etc/apache24/Includes/*.conf diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..4a98eb0 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,40 @@ +worker_processes auto; + +events { + worker_connections 1024; +} + +http { + upstream plexmediaserver { + server localhost:32400; + keepalive 32; + } + + server { + listen plex.stashbox:80; + resolver resolver.stashbox; + server_name plex.*; + gzip on; + gzip_vary on; + gzip_min_length 1000; + gzip_proxied any; + gzip_types text/plain text/css text/xml application/xml text/javascript application/x-javascript image/svg+xml; + gzip_disable "MSIE [1-6]\."; + proxy_set_header Host $host; + proxy_set_header Referer localhost; + proxy_set_header Origin $scheme://localhost:$server_port; + 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 Sec-WebSocket-Extensions $http_sec_websocket_extensions; + proxy_set_header Sec-WebSocket-Key $http_sec_websocket_key; + proxy_set_header Sec-WebSocket-Version $http_sec_websocket_version; + proxy_set_header Accept-Encoding ""; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + proxy_redirect off; + proxy_buffering off; + location / { proxy_pass http://plexmediaserver; } + } +} diff --git a/nginx/nginx.conf b/nginx/nginx.conf deleted file mode 100644 index ad47d0d..0000000 --- a/nginx/nginx.conf +++ /dev/null @@ -1,68 +0,0 @@ - -#user nobody; -worker_processes auto; - -# This default error log path is compiled-in to make sure configuration parsing -# errors are logged somewhere, especially during unattended boot when stderr -# isn't normally logged anywhere. This path will be touched on every nginx -# start regardless of error log location configured here. See -# https://trac.nginx.org/nginx/ticket/147 for more info. -# -#error_log /var/log/nginx/error.log; -# - -#pid logs/nginx.pid; - - -events { - worker_connections 1024; -} - - -http { - - upstream plex_backend { - # server [::1]:32400; # replace 'plex' with the name you gave to your plex container if necessary! - server 127.0.0.1:32400; # replace 'plex' with the name you gave to your plex container if necessary! - keepalive 32; - } - - server { - listen [2603:3015:1003:56cd::dad:feed]:80; - listen 10.1.9.10:80; - resolver [2603:3015:1003:5661::cede]; - server_name plex.othostash.com; - gzip on; - gzip_vary on; - gzip_min_length 1000; - gzip_proxied any; - gzip_types text/plain text/css text/xml application/xml text/javascript application/x-javascript image/svg+xml; - gzip_disable "MSIE [1-6]\."; - - # Forward real ip and host to Plex - proxy_set_header Host $host; - proxy_set_header Referer localhost; - proxy_set_header Origin $scheme://localhost:$server_port; - proxy_set_header X-Real-IP $remote_addr; - #When using ngx_http_realip_module change $proxy_add_x_forwarded_for to '$http_x_forwarded_for,$realip_remote_addr' - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_set_header Sec-WebSocket-Extensions $http_sec_websocket_extensions; - proxy_set_header Sec-WebSocket-Key $http_sec_websocket_key; - proxy_set_header Sec-WebSocket-Version $http_sec_websocket_version; - proxy_set_header Accept-Encoding ""; - - # Websockets - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "Upgrade"; - - # Buffering off send to the client as soon as the data is received from Plex. - proxy_redirect off; - proxy_buffering off; - - location / { - proxy_pass http://plex_backend; - } - } -} diff --git a/sshd_config b/sshd_config new file mode 100644 index 0000000..d9545a2 --- /dev/null +++ b/sshd_config @@ -0,0 +1,25 @@ +# This needs to be separated into two sshd servers. + +Port 22 +Port 22010 +AddressFamily any +ListenAddress localhost:22 +ListenAddress web.stashbox:22 +ListenAddress rsync.stashbox:22010 + +AuthorizedKeysFile .ssh/authorized_keys +Subsystem sftp internal-sftp + +Match Group backup + ChrootDirectory /backup/tenants/%u + ForceCommand internal-sftp + AllowTCPForwarding no + AllowAgentForwarding no + X11Forwarding no + +Match Group collections + ChrootDirectory /data/collections/%u + ForceCommand internal-sftp + AllowTCPForwarding no + AllowAgentForwarding no + X11Forwarding no diff --git a/index-theme/.htaccess b/theme/.htaccess similarity index 100% rename from index-theme/.htaccess rename to theme/.htaccess diff --git a/index-theme/400.html b/theme/400.html similarity index 100% rename from index-theme/400.html rename to theme/400.html diff --git a/index-theme/403.html b/theme/403.html similarity index 100% rename from index-theme/403.html rename to theme/403.html diff --git a/index-theme/404.html b/theme/404.html similarity index 100% rename from index-theme/404.html rename to theme/404.html diff --git a/index-theme/408.html b/theme/408.html similarity index 100% rename from index-theme/408.html rename to theme/408.html diff --git a/index-theme/500.html b/theme/500.html similarity index 100% rename from index-theme/500.html rename to theme/500.html diff --git a/index-theme/502.html b/theme/502.html similarity index 100% rename from index-theme/502.html rename to theme/502.html diff --git a/index-theme/apaxy.js b/theme/apaxy.js similarity index 100% rename from index-theme/apaxy.js rename to theme/apaxy.js diff --git a/index-theme/favicon.ico b/theme/favicon.ico similarity index 100% rename from index-theme/favicon.ico rename to theme/favicon.ico diff --git a/index-theme/footer.html b/theme/footer.html similarity index 75% rename from index-theme/footer.html rename to theme/footer.html index 38a5b41..b5da5c8 100644 --- a/index-theme/footer.html +++ b/theme/footer.html @@ -7,6 +7,6 @@ - + - + diff --git a/index-theme/gallery.js b/theme/gallery.js similarity index 100% rename from index-theme/gallery.js rename to theme/gallery.js diff --git a/index-theme/header.html b/theme/header.html similarity index 100% rename from index-theme/header.html rename to theme/header.html diff --git a/index-theme/icons/addressbook.svg b/theme/icons/addressbook.svg similarity index 100% rename from index-theme/icons/addressbook.svg rename to theme/icons/addressbook.svg diff --git a/index-theme/icons/application-pdf.svg b/theme/icons/application-pdf.svg similarity index 100% rename from index-theme/icons/application-pdf.svg rename to theme/icons/application-pdf.svg diff --git a/index-theme/icons/application-rss+xml.svg b/theme/icons/application-rss+xml.svg similarity index 100% rename from index-theme/icons/application-rss+xml.svg rename to theme/icons/application-rss+xml.svg diff --git a/index-theme/icons/application-x-archive.svg b/theme/icons/application-x-archive.svg similarity index 100% rename from index-theme/icons/application-x-archive.svg rename to theme/icons/application-x-archive.svg diff --git a/index-theme/icons/application-x-bittorrent.svg b/theme/icons/application-x-bittorrent.svg similarity index 100% rename from index-theme/icons/application-x-bittorrent.svg rename to theme/icons/application-x-bittorrent.svg diff --git a/index-theme/icons/application-x-cd-image.svg b/theme/icons/application-x-cd-image.svg similarity index 100% rename from index-theme/icons/application-x-cd-image.svg rename to theme/icons/application-x-cd-image.svg diff --git a/index-theme/icons/application-x-ms-dos-executable.svg b/theme/icons/application-x-ms-dos-executable.svg similarity index 100% rename from index-theme/icons/application-x-ms-dos-executable.svg rename to theme/icons/application-x-ms-dos-executable.svg diff --git a/index-theme/icons/application-x-php.svg b/theme/icons/application-x-php.svg similarity index 100% rename from index-theme/icons/application-x-php.svg rename to theme/icons/application-x-php.svg diff --git a/index-theme/icons/application-x-rar.svg b/theme/icons/application-x-rar.svg similarity index 100% rename from index-theme/icons/application-x-rar.svg rename to theme/icons/application-x-rar.svg diff --git a/index-theme/icons/application-x-ruby.svg b/theme/icons/application-x-ruby.svg similarity index 100% rename from index-theme/icons/application-x-ruby.svg rename to theme/icons/application-x-ruby.svg diff --git a/index-theme/icons/application-x-tar.svg b/theme/icons/application-x-tar.svg similarity index 100% rename from index-theme/icons/application-x-tar.svg rename to theme/icons/application-x-tar.svg diff --git a/index-theme/icons/application-x-zip.svg b/theme/icons/application-x-zip.svg similarity index 100% rename from index-theme/icons/application-x-zip.svg rename to theme/icons/application-x-zip.svg diff --git a/index-theme/icons/audio-x-generic.svg b/theme/icons/audio-x-generic.svg similarity index 100% rename from index-theme/icons/audio-x-generic.svg rename to theme/icons/audio-x-generic.svg diff --git a/index-theme/icons/audio-x-mp3-playlist.svg b/theme/icons/audio-x-mp3-playlist.svg similarity index 100% rename from index-theme/icons/audio-x-mp3-playlist.svg rename to theme/icons/audio-x-mp3-playlist.svg diff --git a/index-theme/icons/deb.svg b/theme/icons/deb.svg similarity index 100% rename from index-theme/icons/deb.svg rename to theme/icons/deb.svg diff --git a/index-theme/icons/empty.svg b/theme/icons/empty.svg similarity index 100% rename from index-theme/icons/empty.svg rename to theme/icons/empty.svg diff --git a/index-theme/icons/evolution-calendar.svg b/theme/icons/evolution-calendar.svg similarity index 100% rename from index-theme/icons/evolution-calendar.svg rename to theme/icons/evolution-calendar.svg diff --git a/index-theme/icons/folder-documents.svg b/theme/icons/folder-documents.svg similarity index 100% rename from index-theme/icons/folder-documents.svg rename to theme/icons/folder-documents.svg diff --git a/index-theme/icons/folder-open.svg b/theme/icons/folder-open.svg similarity index 100% rename from index-theme/icons/folder-open.svg rename to theme/icons/folder-open.svg diff --git a/index-theme/icons/folder.svg b/theme/icons/folder.svg similarity index 100% rename from index-theme/icons/folder.svg rename to theme/icons/folder.svg diff --git a/index-theme/icons/font-x-generic.svg b/theme/icons/font-x-generic.svg similarity index 100% rename from index-theme/icons/font-x-generic.svg rename to theme/icons/font-x-generic.svg diff --git a/index-theme/icons/image-bmp.svg b/theme/icons/image-bmp.svg similarity index 100% rename from index-theme/icons/image-bmp.svg rename to theme/icons/image-bmp.svg diff --git a/index-theme/icons/image-gif.svg b/theme/icons/image-gif.svg similarity index 100% rename from index-theme/icons/image-gif.svg rename to theme/icons/image-gif.svg diff --git a/index-theme/icons/image-jpeg.svg b/theme/icons/image-jpeg.svg similarity index 100% rename from index-theme/icons/image-jpeg.svg rename to theme/icons/image-jpeg.svg diff --git a/index-theme/icons/image-png.svg b/theme/icons/image-png.svg similarity index 100% rename from index-theme/icons/image-png.svg rename to theme/icons/image-png.svg diff --git a/index-theme/icons/image-tiff.svg b/theme/icons/image-tiff.svg similarity index 100% rename from index-theme/icons/image-tiff.svg rename to theme/icons/image-tiff.svg diff --git a/index-theme/icons/image-x-eps.svg b/theme/icons/image-x-eps.svg similarity index 100% rename from index-theme/icons/image-x-eps.svg rename to theme/icons/image-x-eps.svg diff --git a/index-theme/icons/image-x-generic.svg b/theme/icons/image-x-generic.svg similarity index 100% rename from index-theme/icons/image-x-generic.svg rename to theme/icons/image-x-generic.svg diff --git a/index-theme/icons/image-x-ico.svg b/theme/icons/image-x-ico.svg similarity index 100% rename from index-theme/icons/image-x-ico.svg rename to theme/icons/image-x-ico.svg diff --git a/index-theme/icons/image-x-psd.svg b/theme/icons/image-x-psd.svg similarity index 100% rename from index-theme/icons/image-x-psd.svg rename to theme/icons/image-x-psd.svg diff --git a/index-theme/icons/image-x-xcf.svg b/theme/icons/image-x-xcf.svg similarity index 100% rename from index-theme/icons/image-x-xcf.svg rename to theme/icons/image-x-xcf.svg diff --git a/index-theme/icons/multipart-encrypted.svg b/theme/icons/multipart-encrypted.svg similarity index 100% rename from index-theme/icons/multipart-encrypted.svg rename to theme/icons/multipart-encrypted.svg diff --git a/index-theme/icons/package-x-generic.svg b/theme/icons/package-x-generic.svg similarity index 100% rename from index-theme/icons/package-x-generic.svg rename to theme/icons/package-x-generic.svg diff --git a/index-theme/icons/rpm.svg b/theme/icons/rpm.svg similarity index 100% rename from index-theme/icons/rpm.svg rename to theme/icons/rpm.svg diff --git a/index-theme/icons/text-css.svg b/theme/icons/text-css.svg similarity index 100% rename from index-theme/icons/text-css.svg rename to theme/icons/text-css.svg diff --git a/index-theme/icons/text-html.svg b/theme/icons/text-html.svg similarity index 100% rename from index-theme/icons/text-html.svg rename to theme/icons/text-html.svg diff --git a/index-theme/icons/text-plain.svg b/theme/icons/text-plain.svg similarity index 100% rename from index-theme/icons/text-plain.svg rename to theme/icons/text-plain.svg diff --git a/index-theme/icons/text-richtext.svg b/theme/icons/text-richtext.svg similarity index 100% rename from index-theme/icons/text-richtext.svg rename to theme/icons/text-richtext.svg diff --git a/index-theme/icons/text-x-c++.svg b/theme/icons/text-x-c++.svg similarity index 100% rename from index-theme/icons/text-x-c++.svg rename to theme/icons/text-x-c++.svg diff --git a/index-theme/icons/text-x-c++hdr.svg b/theme/icons/text-x-c++hdr.svg similarity index 100% rename from index-theme/icons/text-x-c++hdr.svg rename to theme/icons/text-x-c++hdr.svg diff --git a/index-theme/icons/text-x-c.svg b/theme/icons/text-x-c.svg similarity index 100% rename from index-theme/icons/text-x-c.svg rename to theme/icons/text-x-c.svg diff --git a/index-theme/icons/text-x-chdr.svg b/theme/icons/text-x-chdr.svg similarity index 100% rename from index-theme/icons/text-x-chdr.svg rename to theme/icons/text-x-chdr.svg diff --git a/index-theme/icons/text-x-install.svg b/theme/icons/text-x-install.svg similarity index 100% rename from index-theme/icons/text-x-install.svg rename to theme/icons/text-x-install.svg diff --git a/index-theme/icons/text-x-java.svg b/theme/icons/text-x-java.svg similarity index 100% rename from index-theme/icons/text-x-java.svg rename to theme/icons/text-x-java.svg diff --git a/index-theme/icons/text-x-javascript.svg b/theme/icons/text-x-javascript.svg similarity index 100% rename from index-theme/icons/text-x-javascript.svg rename to theme/icons/text-x-javascript.svg diff --git a/index-theme/icons/text-x-makefile.svg b/theme/icons/text-x-makefile.svg similarity index 100% rename from index-theme/icons/text-x-makefile.svg rename to theme/icons/text-x-makefile.svg diff --git a/index-theme/icons/text-x-python.svg b/theme/icons/text-x-python.svg similarity index 100% rename from index-theme/icons/text-x-python.svg rename to theme/icons/text-x-python.svg diff --git a/index-theme/icons/text-x-readme.svg b/theme/icons/text-x-readme.svg similarity index 100% rename from index-theme/icons/text-x-readme.svg rename to theme/icons/text-x-readme.svg diff --git a/index-theme/icons/text-x-script.svg b/theme/icons/text-x-script.svg similarity index 100% rename from index-theme/icons/text-x-script.svg rename to theme/icons/text-x-script.svg diff --git a/index-theme/icons/text-x-source.svg b/theme/icons/text-x-source.svg similarity index 100% rename from index-theme/icons/text-x-source.svg rename to theme/icons/text-x-source.svg diff --git a/index-theme/icons/text-x-sql.svg b/theme/icons/text-x-sql.svg similarity index 100% rename from index-theme/icons/text-x-sql.svg rename to theme/icons/text-x-sql.svg diff --git a/index-theme/icons/text-x-tex.svg b/theme/icons/text-x-tex.svg similarity index 100% rename from index-theme/icons/text-x-tex.svg rename to theme/icons/text-x-tex.svg diff --git a/index-theme/icons/text-xml.svg b/theme/icons/text-xml.svg similarity index 100% rename from index-theme/icons/text-xml.svg rename to theme/icons/text-xml.svg diff --git a/index-theme/icons/user-home.svg b/theme/icons/user-home.svg similarity index 100% rename from index-theme/icons/user-home.svg rename to theme/icons/user-home.svg diff --git a/index-theme/icons/video-x-generic.svg b/theme/icons/video-x-generic.svg similarity index 100% rename from index-theme/icons/video-x-generic.svg rename to theme/icons/video-x-generic.svg diff --git a/index-theme/icons/x-office-document.svg b/theme/icons/x-office-document.svg similarity index 100% rename from index-theme/icons/x-office-document.svg rename to theme/icons/x-office-document.svg diff --git a/index-theme/icons/x-office-drawing.svg b/theme/icons/x-office-drawing.svg similarity index 100% rename from index-theme/icons/x-office-drawing.svg rename to theme/icons/x-office-drawing.svg diff --git a/index-theme/icons/x-office-presentation.svg b/theme/icons/x-office-presentation.svg similarity index 100% rename from index-theme/icons/x-office-presentation.svg rename to theme/icons/x-office-presentation.svg diff --git a/index-theme/icons/x-office-spreadsheet.svg b/theme/icons/x-office-spreadsheet.svg similarity index 100% rename from index-theme/icons/x-office-spreadsheet.svg rename to theme/icons/x-office-spreadsheet.svg diff --git a/index-theme/style.css b/theme/style.css similarity index 100% rename from index-theme/style.css rename to theme/style.css