├── .editorconfig ├── .github ├── ISSUE_TEMPLATE.md └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── CHANGELOG.md ├── LICENSE.md ├── Makefile ├── README.md ├── bootstrap ├── README.md ├── bootstrap.sh ├── lib │ ├── config.sh │ └── options.sh └── scripts │ ├── apply_defaults │ ├── configure_users │ ├── finalize_setup │ └── install_packages ├── buildall.sh ├── circle.yml ├── create-user.sh ├── docker-compose.yml ├── docker ├── base │ ├── alpine │ │ ├── .dockerignore │ │ ├── Dockerfile │ │ ├── Makefile │ │ └── rootfs │ │ │ └── etc │ │ │ ├── cont-finish.d │ │ │ └── .gitkeep │ │ │ ├── cont-init.d │ │ │ └── 10-adduser │ │ │ ├── fix-attrs.d │ │ │ └── .gitkeep │ │ │ └── services.d │ │ │ └── .gitkeep │ └── ubuntu │ │ ├── Dockerfile │ │ ├── Makefile │ │ ├── files │ │ ├── build.manifest │ │ ├── contents.manifest │ │ ├── extra.tar.lz │ │ └── rootfs.tar │ │ └── root │ │ └── etc │ │ └── cont-init.d │ │ └── 10-adduser ├── cardigann │ ├── Dockerfile │ ├── Makefile │ └── rootfs │ │ └── etc │ │ ├── cont-init.d │ │ └── 30-config │ │ └── services.d │ │ └── cardigann │ │ └── run ├── deluge │ ├── .dockerignore │ ├── Dockerfile │ ├── Makefile │ └── rootfs │ │ └── etc │ │ ├── cont-init.d │ │ └── 30-config │ │ └── services.d │ │ ├── deluge-web │ │ └── run │ │ └── deluged │ │ └── run ├── flood │ └── Dockerfile ├── frontend │ ├── .dockerignore │ ├── Dockerfile │ ├── Makefile │ └── rootfs │ │ └── etc │ │ ├── cont-init.d │ │ └── 20-init │ │ ├── nginx │ │ ├── cfgs │ │ │ ├── cache │ │ │ │ ├── extension.conf │ │ │ │ └── static.conf │ │ │ ├── misc │ │ │ │ ├── acme.conf │ │ │ │ └── no-robots.conf │ │ │ ├── proxy │ │ │ │ ├── headers.conf │ │ │ │ └── params.conf │ │ │ ├── proxy_common.conf │ │ │ ├── security │ │ │ │ ├── deny-locations.conf │ │ │ │ ├── headers.conf │ │ │ │ └── ssl-headers.conf │ │ │ ├── ssl │ │ │ │ └── ssl.conf │ │ │ └── upstream │ │ │ │ ├── deluge.conf │ │ │ │ ├── plex.conf │ │ │ │ ├── plexpy.conf │ │ │ │ ├── rutorrent.conf │ │ │ │ ├── sickrage.conf │ │ │ │ └── sonarr.conf │ │ ├── fastcgi.conf │ │ ├── fastcgi_params │ │ ├── mime.types │ │ ├── nginx.conf │ │ ├── proxy.conf │ │ ├── scgi_params │ │ ├── uwsgi_params │ │ ├── vhost.d │ │ │ ├── deluge.tmpl │ │ │ ├── plex.tmpl │ │ │ ├── plexpy.tmpl │ │ │ ├── rutorrent.tmpl │ │ │ ├── sickrage.tmpl │ │ │ ├── site-ssl.tmpl │ │ │ ├── site.conf │ │ │ └── sonarr.tmpl │ │ └── win-utf │ │ └── services.d │ │ └── nginx │ │ └── run ├── plexpy │ ├── .dockerignore │ ├── Dockerfile │ ├── Makefile │ └── rootfs │ │ └── etc │ │ ├── cont-init.d │ │ └── 30-setup │ │ └── services.d │ │ └── plexpy │ │ └── run ├── resilio-sync │ ├── Dockerfile │ ├── Makefile │ ├── rootfs │ │ └── etc │ │ │ ├── cont-init.d │ │ │ └── 30-config │ │ │ └── services.d │ │ │ └── resilio │ │ │ └── run │ └── sync.conf ├── rutorrent │ ├── .dockerignore │ ├── Dockerfile │ ├── Makefile │ └── rootfs │ │ ├── defaults │ │ ├── autodl.cfg │ │ ├── autodl2.cfg │ │ ├── conf.php │ │ ├── rtorrent.rc │ │ └── rutorrent-conf │ │ │ └── config.php │ │ └── etc │ │ ├── cont-init.d │ │ ├── 20-config │ │ ├── 30-getautodl │ │ └── 40-setconf │ │ ├── php7 │ │ └── php-fpm.d │ │ │ └── rutorrent.conf │ │ └── services.d │ │ ├── cron │ │ └── run │ │ ├── fpm │ │ └── run │ │ ├── irssi │ │ └── run │ │ └── rutorrent │ │ └── run ├── sickrage │ ├── Dockerfile │ ├── Makefile │ └── rootfs │ │ └── etc │ │ ├── cont-init.d │ │ └── 30-setup │ │ └── services.d │ │ └── sickrage │ │ └── run └── sonarr │ ├── Dockerfile │ ├── Makefile │ └── rootfs │ └── etc │ ├── cont-init.d │ └── 30-setup │ └── services.d │ └── sonarr │ └── run ├── docs ├── advanced.md ├── assets │ ├── alpinelinux-logo.svg │ ├── deluge-dirs-after.png │ ├── deluge-dirs-before.png │ ├── sonarr-rtorrent-drone.png │ └── sonarr-rtorrent.png ├── commands.md ├── deluge.md ├── frontend.md ├── overview.md ├── plex.md ├── plexpy.md ├── resilio.md ├── rtorrent.md └── sonarr.md ├── env_example ├── setup-docker.sh └── srv └── nginx ├── cfgs ├── cache │ ├── extension.conf │ └── static.conf ├── misc │ ├── acme.conf │ └── no-robots.conf ├── proxy │ ├── headers.conf │ └── params.conf ├── proxy_common.conf ├── security │ ├── deny-locations.conf │ ├── headers.conf │ └── ssl-headers.conf ├── ssl │ └── ssl.conf └── upstream │ ├── deluge.conf │ ├── plex.conf │ ├── plexpy.conf │ ├── rutorrent.conf │ ├── sickrage.conf │ └── sonarr.conf ├── fastcgi.conf ├── fastcgi_params ├── mime.types ├── nginx.conf ├── scgi_params ├── uwsgi_params ├── vhost.d ├── deluge.tmpl ├── plex.tmpl ├── plexpy.tmpl ├── rutorrent.tmpl ├── sickrage.tmpl ├── site-ssl.tmpl ├── site.conf └── sonarr.tmpl └── win-utf /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | end_of_line = lf 5 | insert_final_newline = true 6 | charset = utf-8 7 | indent_size = 4 8 | indent_style = space 9 | trim_trailing_whitespace = true 10 | continuation_indent_size = 8 11 | 12 | [*.md] 13 | end_of_line = lf 14 | insert_final_newline = true 15 | charset = utf-8 16 | indent_size = 4 17 | indent_style = space 18 | trim_trailing_whitespace = false 19 | continuation_indent_size = 8 20 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## Expected Behavior 2 | 3 | 4 | ## Actual Behavior 5 | 6 | 7 | ## Steps to Recreate 8 | 9 | 10 | 0. 11 | 12 | ## Environment 13 | 14 | 15 | ## Screenshots/Screencasts 16 | 17 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## Overview 2 | 3 | 4 | ## Details 5 | 6 | 7 | ## Notes 8 | 9 | 10 | ## Screenshots/Screencasts 11 | 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .env 2 | docs/acd.md 3 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | ## [January 29, 2017] 4 | 5 | - Removed nginx from rTorrent / ruTorrent container. 6 | - ruTorrent is cloned from Github and created on the host at first run. 7 | - ruTorrent is now accessible within `srv/public/rutorrent/` 8 | - Create data only container for the srv directory. 9 | - Provide scripts to setup a fresh OS. 10 | 11 | ## [January 27, 2017] 12 | - Added Sonarr 13 | - Remove Filebot 14 | 15 | ## [January 18, 2017] 16 | - Fixes reverse proxying for services 17 | - AddSSL and subdomains 18 | 19 | ## [January 17, 2017] 20 | - Setup script for Docker and Docker-Compose for Ubuntu Xenial release. 21 | - SickRage container 22 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2017 Steven Truesdell. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | SHELL := /bin/bash 2 | 3 | RUTORRENT_IMAGE = swerpbox/rutorrent 4 | SONARR_IMAGE = swerpbox/sonarr 5 | DELUGE_IMAGE = swerpbox/deluge 6 | PLEXPY_IMAGE = swerpbox/plexpy 7 | FRONTEND_IMAGE = swerpbox/frontend 8 | RESILIO_IMAGE = swerpbox/resilio-sync 9 | UBUNTU_IMAGE = swerpbox/ubuntu-base 10 | ALPINE_IMAGE = swerpbox/alpine-base 11 | PLEX_IMAGE = plexinc/pms-docker 12 | 13 | NETWORK_NAME=swerpbox 14 | NETWORK_CREATE_CMD=docker network create $(NETWORK_NAME) 15 | 16 | _configure_network: ## creates the swerpbox network 17 | @docker network inspect $(NETWORK_NAME) >/dev/null 2>&1 || $(NETWORK_CREATE_CMD) 18 | 19 | _remove_network: ## removes the swerpbox network 20 | docker network rm $(NETWORK_NAME) 21 | 22 | build-alpine: ## builds the alpine base image from scratch 23 | cd docker/base/alpine; make build 24 | pull-alpine: ## pulls alpine base image from docker hub 25 | docker build -t $(ALPINE_IMAGE) --pull=true --no-cache=true sb-alpine-base 26 | 27 | build-ubuntu: ## builds the ubuntu base image from scratch 28 | cd docker/base/ubuntu; make build 29 | pull-ubuntu: ## pulls ubuntu base image from docker hub 30 | docker build -t $(UBUNTU_IMAGE) --pull=true --no-cache=true sb-ubuntu-base 31 | 32 | build-rutorrent: ## builds the rutorrent image from scratch 33 | cd docker/rutorrent; make build 34 | pull-rutorrent: ## pulls rutorrent image from docker hub 35 | docker build -t $(RUTORRENT_IMAGE) --pull=true --no-cache=true sb-rutorrent 36 | 37 | build-deluge: ## builds the deluge image from scratch 38 | cd docker/deluge; make build 39 | pull-deluge: ## pulls deluge image from docker hub 40 | docker build -t $(DELUGE_IMAGE) --pull=true --no-cache=true sb-deluge 41 | 42 | build-frontend: ## builds the frontend image from scratch 43 | cd docker/frontend; make build 44 | pull-frontend: ## pulls frontend image from docker hub 45 | docker build -t $(FRONTEND_IMAGE) --pull=true --no-cache=true sb-frontend 46 | 47 | build-plexpy: ## builds the plexpy image from scratch 48 | cd docker/plexpy; make build 49 | pull-plexpy: ## pulls plexpy image from docker hub 50 | docker build -t $(PLEXPY_IMAGE) --pull=true --no-cache=true sb-plexpy 51 | 52 | build-sonarr: ## builds the sonarr image from scratch 53 | cd docker/sonarr; make build 54 | pull-sonarr: ## pulls sonarr image from docker hub 55 | docker build -t $(SONARR_IMAGE) --pull=true --no-cache=true sb-sonarr 56 | 57 | build-resilio: ## builds the resilio-sync image from scratch 58 | cd docker/resilio-sync; make build 59 | pull-resilio: ## pulls resilio-sync image from docker hub 60 | docker build -t $(RESILIO_IMAGE) --pull=true --no-cache=true sb-resilio 61 | 62 | start: ## run all containers in docker-compose.yml 63 | docker-compose up -d 64 | 65 | down: ## stop all running containers and remove network 66 | docker-compose down 67 | 68 | stop: ## stop all running containers 69 | docker-compose stop 70 | 71 | status: ## display information for running containers 72 | docker-compose ps 73 | 74 | rebuild: 75 | docker-compose down 76 | docker-compose build --no-cache 77 | docker-compose up -d 78 | 79 | # helpers 80 | help: ## print list of tasks and descriptions 81 | @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' 82 | 83 | .DEFAULT_GOAL := help 84 | 85 | .PHONY: all 86 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # What is SwerpBox? 2 | 3 | > SwerpBox, a seedbox and media center combined with the power of 🐳 Docker. 4 | 5 | 6 | Table of Contents 7 | ================= 8 | 9 | * [Prerequisites](#prerequisites) 10 | * [Getting Started](#getting-started) 11 | * [Fresh](#fresh-os-install) 12 | * [Existing](#existing-system) 13 | * [Overview](docs/overview.md) 14 | * [Commands](docs/commands.md) 15 | * [Advanced Configuration](docs/advanced.md) 16 | * [Containers](#containers) 17 | * [Frontend](docs/frontend.md) 18 | * [rTorrent / ruTorrent](docs/rtorrent.md) 19 | * [Deluge](docs/deluge.md) 20 | * [Plex](docs/plex.md) 21 | * [PlexPy](docs/plexpy.md) 22 | * [Resilio Sync](docs/resilio.md) 23 | * [Sonarr](docs/sonarr.md) 24 | * [Credits](#credit) 25 | 26 | 27 | Detailed documentation for containers is located within the docs folder. Clicking the link above will take you there. 28 | 29 | 30 | Prerequisites 31 | ============== 32 | 33 | To run this application you need Docker Engine 1.10.0+ and Docker Compose with a version 1.6.0 or later. 34 | 35 | If you don't have Docker installed and are running Ubuntu or Debian, you may use the setup script, `setup-docker.sh`. It will install Docker and Docker Compose for you. 36 | 37 | `bash setup-docker.sh` 38 | 39 | 40 | Getting Started 41 | ============== 42 | 43 | Fresh OS Install 44 | --------- 45 | 46 | SSH into your fresh server as the root user. Clone this repository with `git clone https://github.com/strues/swerpbox.git`. 47 | 48 | Edit the config.sh file in the `bootstrap/lib` directory and adjust the settings as you see fit, namely the following variables: 49 | 50 | - SERVER_IP 51 | - SERVER_HOSTNAME 52 | - USER_LOGIN 53 | - USER_PASS 54 | 55 | **Note:** for the minimum amount of potential problems, I recommend leaving the USER_LOGIN as swerp. 56 | 57 | Run `./bootstrap/bootstrap.sh` and let it do its thing. 58 | 59 | The script will create a mostly complete `.env` file for you in the home directory of the user defined by the `USER_LOGIN` variable. All of the SwerpBox files will be placed in the home directory as well. 60 | 61 | 62 | See the [README](bootstrap/README.md) for detailed instructions. 63 | 64 | Existing System 65 | --------- 66 | 67 | Clone this repository or upload the contents of the repository to your web server. Where you place the SwerpBox files is where all the fun happens. I recommend working out of your home directory. 68 | 69 | Example: `/home//swerpbox` 70 | 71 | Create a copy of the environment variables file with `cp env_example .env` and fill in the information to match with your environment. 72 | 73 | The variables PGID, PUID, PLEX_UID, and PLEX_GUID must be set to the ids of the user running SwerpBox. If you aren't sure what the values of your user account are, you can find them by typing `id $(whoami)` on your server. 74 | 75 | The output will look like this: 76 | 77 | ``` 78 | uid=1000(swerp) gid=1000(swerp) groups=1000(swerp) 79 | ``` 80 | 81 | It is crucial to set PGID and PUID variables to the values matching the user running SwerpBox. 82 | 83 | **Note:** The file `buildall.sh` is meant for CI services. To start everything just run, `make start or docker-compose up -d` 84 | 85 | The `create-user.sh` script will create a user and group named swerp, set the GID and UID, and create the `.env` file for you. 86 | 87 | Running `make help` lists all commands available to you. 88 | 89 | 90 | Containers 91 | ============== 92 | 93 | Base Images 94 | ------- 95 | 96 | #### Alpine 97 | 98 | [![](https://images.microbadger.com/badges/image/swerpbox/alpine-base.svg)](https://microbadger.com/images/swerpbox/alpine-base "SwerpBox Alpine") [![](https://images.microbadger.com/badges/version/swerpbox/alpine-base.svg)](https://microbadger.com/images/swerpbox/alpine-base "SwerpBox Alpine") 99 | 100 | #### Ubuntu 101 | 102 | [![](https://images.microbadger.com/badges/image/swerpbox/ubuntu-base.svg)](https://microbadger.com/images/swerpbox/ubuntu-base "SwerpBox Ubuntu") [![](https://images.microbadger.com/badges/version/swerpbox/ubuntu-base.svg)](https://microbadger.com/images/swerpbox/ubuntu-base "SwerpBox Ubuntu") 103 | 104 | 105 | Frontend 106 | ---------- 107 | 108 | [![](https://images.microbadger.com/badges/image/swerpbox/frontend.svg)](https://microbadger.com/images/swerpbox/frontend "SwerpBox Frontend") [![](https://images.microbadger.com/badges/version/swerpbox/frontend.svg)](https://microbadger.com/images/swerpbox/frontend "SwerpBox Frontend") 109 | 110 | > Nginx 1.11.9 compiled from source with Brotli compression and HTTP/2 support. 111 | 112 | The nginx default host configuration is setup for you. Located in `srv/nginx/vhost.d/site.conf`. See the advanced configuration below for specifics on 113 | how to setup reverse proxies for enabled services. 114 | 115 | 116 | **Available variables:** 117 | 118 | - `TZ`: Your timezone. Default: **America/Denver** 119 | - `PUID`: User UID. Default: **1000** 120 | - `PGID`: User group id. Default: **1000** 121 | 122 | **Volumes:** 123 | 124 | - `./srv/nginx:/etc/nginx`: Nginx configuration. 125 | - `./srv/public:/var/www/public`: Web root for the frontend. 126 | 127 | 128 | rTorrent/ruTorrent 129 | ---------- 130 | 131 | [![](https://images.microbadger.com/badges/image/swerpbox/rutorrent.svg)](https://microbadger.com/images/swerpbox/rutorrent "SwerpBox ruTorrent") [![](https://images.microbadger.com/badges/version/swerpbox/rutorrent.svg)](https://microbadger.com/images/swerpbox/rutorrent "SwerpBox ruTorrent") 132 | 133 | 134 | > ruTorrent and rTorrent with Autodl-Irssi running on Alpine Linux. Compiled with Media Info. 135 | 136 | Includes PHP7. 137 | 138 | RuTorrent is accessible via http://YOUR.IP.ADDR.ESS/rutorrent/ 139 | 140 | **Available variables:** 141 | 142 | - `TZ`: Your timezone. Default: **America/Denver** 143 | - `PUID`: User UID. Default: **1000** 144 | - `PGID`: User group id. Default: **1000** 145 | 146 | **Volumes:** 147 | 148 | - `./data:/data`: Location of saved files. 149 | - `./logs:/logs`: Logs for php and rTorrent. 150 | - `./srv/public:/var/www/public/rutorrent`: ruTorrent created in this container with autodl-irssi. Actually served from frontend. 151 | - `./config:/config`: Configs for php, rTorrent, irssi, and autodl. 152 | 153 | 154 | Deluge 155 | ---------- 156 | 157 | [![](https://images.microbadger.com/badges/image/swerpbox/deluge.svg)](https://microbadger.com/images/swerpbox/deluge "SwerpBox Deluge") [![](https://images.microbadger.com/badges/version/swerpbox/deluge.svg)](https://microbadger.com/images/swerpbox/deluge "SwerpBox Deluge") 158 | 159 | > This container runs the Deluge BitTorrent daemon and the web ui. To learn more, visit the [Deluge website](http://deluge-torrent.org). 160 | 161 | Deluge is accessible via http://YOUR.IP.ADDR.ESS/deluge 162 | 163 | **Available variables:** 164 | 165 | - `TZ`: Your timezone. Default: **America/Denver** 166 | - `PUID`: User UID. Default: **1000** 167 | - `PGID`: User group id. Default: **1000** 168 | 169 | Please checkout the Deluge docs section located [here](docs/deluge.md) for initial configuration instructions. 170 | 171 | 172 | Plex 173 | ---------- 174 | 175 | Uses the official Plex Docker image. Checkout the readme [here](https://github.com/plexinc/pms-docker) 176 | 177 | Plex is accessible via http://YOUR.IP.ADDR.ESS:3400/web 178 | 179 | The default library location is `./media` 180 | 181 | **Available variables:** 182 | 183 | - `TZ`: Your timezone. Default: **America/Denver** 184 | - `PLEX_CLAIM`: Plex claim token. Get it from: **https://plex.tv/claim** 185 | - `ADVERTISE_IP`: Server IP address for Plex. Default: **http://127.0.0.1:32400** 186 | - `PLEX_UID`: User UID. Default: **1000** 187 | - `PLEX_GID`: User group id. Default: **1000** 188 | - `CHANGE_CONFIG_DIR_OWNERSHIP`: Change directory ownership. Default: **false** 189 | 190 | 191 | Sonarr 192 | ---------- 193 | 194 | > The Sonarr container runs on Ubuntu 16.04 via Mono 195 | 196 | Sonarr is accessible via http://YOUR.IP.ADDR.ESS:8989 197 | 198 | **Available variables:** 199 | 200 | - `TZ`: Your timezone. Default: **America/Denver** 201 | - `PUID`: User UID. Default: **1000** 202 | - `PGID`: User group id. Default: **1000** 203 | 204 | **Volumes:** 205 | 206 | - `./config/sonarr:/config`: Where the config files are stored. 207 | - `./data:/data`: Entire directory of all files. Used to mount the complete folder. 208 | - `./data/downloading:/downloads`: Where downloading torrents are located 209 | - `./media/TV Shows:/tv`: Location of media directory, where Plex reads from. Sonarr hardlinks complete files here. 210 | 211 | 212 | SickRage 213 | ---------- 214 | 215 | > Dropped in favor of Sonarr, but still included incase you prefer it. 216 | 217 | SickRage is accessible via http://YOUR.IP.ADDR.ESS:8081 218 | 219 | Available variables: 220 | 221 | - `TZ`: Your timezone. Default: **America/Denver** 222 | - `PUID`: User UID. Default: **1000** 223 | - `PGID`: User group id. Default: **1000** 224 | 225 | 226 | Resilio-Sync 227 | ---------- 228 | 229 | > Sync uses peer-to-peer technology to provide fast, private file sharing for teams and individuals. By skipping the cloud, transfers can be significantly faster because files take the shortest path between devices. Sync does not store your information on servers in the cloud, avoiding cloud privacy concerns. 230 | 231 | 232 | Web interface visible at http://YOUR.IP.ADDR.ESS:8888 233 | 234 | Directories mounted for sync in /data/ 235 | 236 | Available variables: 237 | 238 | - `TZ`: Your timezone. Default: **America/Denver** 239 | - `PUID`: User UID. Default: **1000** 240 | - `PGID`: User group id. Default: **1000** 241 | 242 | 243 | Credit 244 | ========== 245 | 246 | I give credit where it's due and would like to give a shoutout to [LinuxServer.io](https://github.com/linuxserver). Parts of 247 | their Dockerfiles were borrowed and modified for this seedbox setup. 248 | -------------------------------------------------------------------------------- /bootstrap/README.md: -------------------------------------------------------------------------------- 1 | # SwerpBox Bootstrap 2 | 3 | The SwerpBox Bootstrap contains a set of shell scripts for installing and configuring a **fresh** Ubuntu (server) operating 4 | system. 5 | 6 | ## Table of Contents 7 | 8 | - [Requirements](#requirements) 9 | - [Setup](#setup) 10 | - [Usage](#usage) 11 | 12 | Requirements 13 | ======== 14 | 15 | 0. [Ubuntu](http://www.ubuntu.com) - 16.x 16 | 17 | Setup 18 | ======= 19 | Edit the config.sh file in the `lib` directory and adjust the settings as you see fit, namely the following variables: 20 | 21 | - SERVER_IP 22 | - SERVER_HOSTNAME 23 | - USER_LOGIN 24 | - USER_PASS 25 | 26 | Usage 27 | ============ 28 | 29 | 0. `ssh` to your server or VM. 30 | 0. Switch to the root user. 31 | 0. Create the a /root/.ssh/authorized_keys file with your public key. 32 | 0. `chmod -R 600 /root/.ssh`. 33 | 0. Run the `/swerpbox/bootstrap/bootstrap.sh` script. 34 | 35 | After the scripts run, you will have created a user for SwerpBox to run as. Installed Docker and 36 | Docker Compose. Configured the server's locales, hostname, and timezone. Ready to use SwerpBox! 37 | -------------------------------------------------------------------------------- /bootstrap/bootstrap.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env bash 2 | 3 | # DESCRIPTION 4 | # Executes the command line interface. 5 | 6 | # SETTINGS 7 | source lib/config.sh 8 | 9 | # FUNCTIONS 10 | source lib/options.sh 11 | 12 | # EXECUTION 13 | while true; do 14 | if [[ $# == 0 ]]; then 15 | printf "\nUsage: run OPTION\n" 16 | printf "\nUbuntu Options:\n" 17 | printf " d: Configure default settings.\n" 18 | printf " p: Install system packages.\n" 19 | printf " u: Configure users.\n" 20 | printf " f: Finalize setup.\n" 21 | printf " r: Reboot server.\n" 22 | printf " i: Perform complete install (i.e. configure default settings, install packages, configure users, finalize, and reboot.\n" 23 | printf " q: Quit/Exit.\n\n" 24 | read -p "Enter selection: " response 25 | printf "\n" 26 | process_option $response 27 | else 28 | process_option $1 29 | fi 30 | 31 | break 32 | done 33 | -------------------------------------------------------------------------------- /bootstrap/lib/config.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env bash 2 | 3 | # DESCRIPTION 4 | # Defines global settings. 5 | 6 | # SETTINGS 7 | # General 8 | set -o nounset # Exit, with error message, when attempting to use an undefined variable. 9 | set -o errexit # Abort script at first error, when a command exits with non-zero status. 10 | set -o pipefail # Returns exit status of the last command in the pipe that returned a non-zero return value. 11 | IFS=$'\n\t' # Defines how Bash splits words and iterates arrays. This defines newlines and tabs as delimiters. 12 | 13 | # Globals 14 | export SERVER_IP=127.0.1.1 # Placeholder for server IP. 15 | export SERVER_HOSTNAME=home.example.com # Placeholder for server domain. 16 | export USER_PASS=password # The master user password. 17 | export INSTALL_COMMAND="apt-get -q -y" 18 | -------------------------------------------------------------------------------- /bootstrap/lib/options.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env bash 2 | 3 | # DESCRIPTION 4 | # Defines command line prompt options. 5 | 6 | # Process option selection. 7 | # Parameters: 8 | # $1 = The option to process. 9 | process_option() { 10 | case $1 in 11 | 'd') 12 | scripts/apply_defaults;; 13 | 'p') 14 | scripts/install_packages;; 15 | 'u') 16 | scripts/configure_users;; 17 | 'f') 18 | scripts/finalize_setup;; 19 | 'r') 20 | shutdown -r now;; 21 | 'i') 22 | scripts/apply_defaults 23 | scripts/install_packages 24 | scripts/configure_users 25 | scripts/finalize_setup 26 | shutdown -r now;; 27 | 'q');; 28 | *) 29 | printf "ERROR: Invalid option.\n";; 30 | esac 31 | } 32 | export -f process_option 33 | -------------------------------------------------------------------------------- /bootstrap/scripts/apply_defaults: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env bash 2 | 3 | # DESCRIPTION 4 | # Configures server defaults. 5 | 6 | # EXECUTION 7 | function _hostname() { 8 | printf "Setting hostname...\n" 9 | printf "$SERVER_HOSTNAME\n" > /etc/hostname 10 | hostname -F /etc/hostname 11 | } 12 | 13 | function _hosts() { 14 | printf "Updating hosts...\n" 15 | printf "$SERVER_IP $SERVER_HOSTNAME $SERVER_HOSTNAME\n" >> /etc/hosts 16 | hostname -f 17 | } 18 | 19 | function _time() { 20 | printf "Setting UTC timezone...\n" 21 | ln -sf /usr/share/zoneinfo/UTC /etc/localtime 22 | } 23 | 24 | function _locale() { 25 | echo 'LANGUAGE="en_US.UTF-8"' >> /etc/default/locale 26 | echo 'LC_ALL="en_US.UTF-8"' >> /etc/default/locale 27 | echo "en_US.UTF-8 UTF-8" > /etc/locale.gen 28 | if [[ -e /usr/sbin/locale-gen ]]; then locale-gen >> /dev/null 2>&1 29 | else 30 | apt-get install locales -y >> /dev/null 2>&1 31 | locale-gen >> /dev/null 2>&1 32 | export LANG="en_US.UTF-8" 33 | export LC_ALL="en_US.UTF-8" 34 | export LANGUAGE="en_US.UTF-8" 35 | fi 36 | } 37 | 38 | _hostname 39 | _hosts 40 | _time 41 | _locale 42 | -------------------------------------------------------------------------------- /bootstrap/scripts/configure_users: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env bash 2 | 3 | # DESCRIPTION 4 | # Configures default user(s). 5 | SWERP_DIR=$( cd /home/$USER_LOGIN && pwd ) 6 | ENV_FILE="${SWERP_DIR}/.env" 7 | 8 | # EXECUTION 9 | # Create user account. 10 | function _createUser() { 11 | echo "Creating user: $USER_LOGIN" 12 | useradd -u 1000 -m -s /bin/bash $USER_LOGIN 13 | usermod -p $(printf $USER_PASS | openssl passwd -1 -stdin) $USER_LOGIN 14 | } 15 | 16 | function _addGroup() { 17 | echo "Adding $USER_LOGIN to Docker group..." 18 | usermod -a -G docker $USER_LOGIN 19 | usermod -a -G admin $USER_LOGIN 20 | } 21 | 22 | function _setupHome() { 23 | # Initialize SSH authorized keys for user account. 24 | mkdir /home/$USER_LOGIN/.ssh 25 | touch /home/$USER_LOGIN/.ssh/authorized_keys 26 | chmod -R 700 /home/$USER_LOGIN/.ssh 27 | chmod 644 /home/$USER_LOGIN/.ssh/authorized_keys 28 | } 29 | 30 | function _getSwerpbox() { 31 | echo "Downloading files..." 32 | git clone https://github.com/strues/swerpbox.git /home/$USER_LOGIN/temp 33 | echo "Moving files..." 34 | cp -r /home/$USER_LOGIN/temp/ /home/$USER_LOGIN/ 35 | rm -rf /home/$USER_LOGIN/temp 36 | echo "Done" 37 | } 38 | 39 | function _makeEnv() { 40 | SWERP_UID=$(id -u $USER_LOGIN) 41 | SWERP_GID=$(id -g $USER_LOGIN) 42 | 43 | if [[ ! -f ${ENV_FILE} ]]; then 44 | touch "${ENV_FILE}" 45 | else 46 | echo '' > "${ENV_FILE}" 47 | fi 48 | echo "Creating your .env file..." 49 | echo "" 50 | echo "" 51 | echo "PUID=${SWERP_UID}" >> .env 52 | echo "PGID=${SWERP_GID}" >> .env 53 | echo "PLEX_UID=${SWERP_UID}" >> .env 54 | echo "PLEX_GID=${SWERP_GID}" >> .env 55 | echo "USERNAME=swerp" >> .env 56 | echo "PASSWORD=swerp" >> .env 57 | echo "TZ=America/Denver" >> .env 58 | echo "PLEX_CLAIM=" >> .env 59 | echo "ADVERTISE_IP=" >> .env 60 | echo "CHANGE_CONFIG_DIR_OWNERSHIP=false" >> .env 61 | 62 | echo "Done creating .env file. Please fill in the blank entries." 63 | } 64 | 65 | _createUser 66 | _addGroup 67 | _setupHome 68 | _getSwerpbox 69 | _makeEnv 70 | -------------------------------------------------------------------------------- /bootstrap/scripts/finalize_setup: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env bash 2 | 3 | # DESCRIPTION 4 | # Configures final server settings (or those which must be set last). 5 | 6 | # EXECUTION 7 | printf "Setting the message of the day...\n" 8 | printf "Welcome to SwerpBox!\n" > /etc/motd.tail 9 | printf '' > /etc/update-motd.d/00-header 10 | printf '' > /etc/update-motd.d/10-help-text 11 | -------------------------------------------------------------------------------- /bootstrap/scripts/install_packages: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env bash 2 | 3 | # DESCRIPTION 4 | # Installs default packages. 5 | 6 | # EXECUTION 7 | # Initialization 8 | function _installPackages() { 9 | $INSTALL_COMMAND update 10 | $INSTALL_COMMAND upgrade 11 | 12 | # Build Tools 13 | $INSTALL_COMMAND install build-essential # Essential for compiling source (includes GCC compiler, etc). 14 | $INSTALL_COMMAND install libreadline6 libreadline6-dev # CLI. 15 | $INSTALL_COMMAND install zlib1g zlib1g-dev # Compression. 16 | $INSTALL_COMMAND install libssl-dev # SSL. 17 | $INSTALL_COMMAND install libpcre3 libpcre3-dev # Regular Expressions. 18 | $INSTALL_COMMAND install libyaml-dev # YAML. 19 | $INSTALL_COMMAND install libxml2-dev # XML. 20 | $INSTALL_COMMAND install libxslt-dev # XSLT. 21 | 22 | # Package Management 23 | $INSTALL_COMMAND install python-software-properties # Provides the "add-apt-repository" command. 24 | 25 | # Git 26 | $INSTALL_COMMAND install git-core 27 | } 28 | 29 | function _installDocker() { 30 | echo "Installing Docker..." 31 | curl -sSL https://get.docker.com/ | sh 32 | } 33 | 34 | 35 | function _installCompose() { 36 | echo "Installing Docker Compose..." 37 | curl -L "https://github.com/docker/compose/releases/download/1.9.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose 38 | chmod +x /usr/local/bin/docker-compose 39 | docker-compose --version 40 | } 41 | 42 | _installPackages 43 | _installDocker 44 | _installCompose 45 | -------------------------------------------------------------------------------- /buildall.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | cd ${0%/*} 4 | 5 | usage() { 6 | echo "./buildall.sh [-n] [-q]" 7 | echo " -n Do not use cache when building docker images" 8 | echo " -q Quiet mode" 9 | exit 1 10 | } 11 | 12 | ARGS= 13 | 14 | while getopts ":nq" opt; do 15 | case $opt in 16 | n) ARGS="$ARGS --no-cache" ;; 17 | q) ARGS="$ARGS --quiet" ;; 18 | \?) usage ;; 19 | esac 20 | done 21 | 22 | docker pull swerpbox/rutorrent & 23 | docker build -t swerpbox/frontend $ARGS docker/frontend & 24 | docker build -t swerpbox/deluge $ARGS docker/deluge & 25 | wait 26 | -------------------------------------------------------------------------------- /circle.yml: -------------------------------------------------------------------------------- 1 | machine: 2 | pre: 3 | - curl -sSL https://s3.amazonaws.com/circle-downloads/install-circleci-docker.sh | bash -s -- 1.10.0 4 | 5 | services: 6 | - docker 7 | 8 | dependencies: 9 | override: 10 | - docker version 11 | 12 | test: 13 | override: 14 | - bash ./buildall.sh 15 | - docker images 16 | - docker history swerpbox/rutorrent 17 | - docker history swerpbox/frontend 18 | - docker history swerpbox/deluge 19 | # 20 | # deployment: 21 | # hub: 22 | # branch: master 23 | # commands: 24 | # - docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS 25 | # - docker push swerpbox/frontend 26 | # - docker push swerpbox/deluge 27 | # - docker push swerpbox/filebot 28 | -------------------------------------------------------------------------------- /create-user.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | SWERP_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) 4 | ENV_FILE="${SWERP_DIR}/.env" 5 | 6 | function _permissions() { 7 | if [[ $EUID != 0 ]]; then 8 | echo "Please re-run this script as root." 9 | echo 'Exiting...' 10 | exit 1 11 | fi 12 | echo "Looks like you're the root user. Moving on..." 13 | echo 14 | } 15 | 16 | function _createUser() { 17 | SWERP_USER=$(grep swerp /etc/passwd) 18 | 19 | if [[ -z ${SWERP_USER} ]]; then 20 | echo "Creating user: swerp" 21 | useradd -u 1000 -U -m swerp 22 | echo "Adding user to Docker group..." 23 | usermod -a -G docker swerp 24 | fi 25 | 26 | SWERP_UID=$(id -u swerp) 27 | SWERP_GID=$(id -g swerp) 28 | 29 | if [[ ! -f ${ENV_FILE} ]]; then 30 | touch "${ENV_FILE}" 31 | else 32 | echo '' > "${ENV_FILE}" 33 | fi 34 | echo "Creating your .env file..." 35 | echo "" 36 | echo "" 37 | echo "PUID=${SWERP_UID}" >> .env 38 | echo "PGID=${SWERP_GID}" >> .env 39 | echo "PLEX_UID=${SWERP_UID}" >> .env 40 | echo "PLEX_GID=${SWERP_GID}" >> .env 41 | echo "USERNAME=swerp" >> .env 42 | echo "PASSWORD=swerp" >> .env 43 | echo "TZ=America/Denver" >> .env 44 | echo "PLEX_CLAIM=" >> .env 45 | echo "ADVERTISE_IP=" >> .env 46 | echo "CHANGE_CONFIG_DIR_OWNERSHIP=false" >> .env 47 | 48 | echo "Done creating .env file. Please fill in the blank entries." 49 | } 50 | 51 | _permissions 52 | _createUser 53 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | 3 | networks: 4 | swerpbox: 5 | driver: bridge 6 | 7 | services: 8 | frontend: 9 | image: swerpbox/frontend:1.1.1 10 | # build: ./docker/frontend 11 | container_name: sb-frontend 12 | restart: always 13 | ports: 14 | - "80:80/tcp" 15 | - "443:443/tcp" 16 | env_file: .env 17 | volumes: 18 | - "/etc/localtime:/etc/localtime:ro" 19 | - "/dev/rtc:/dev/rtc:ro" 20 | - "./config:/config" 21 | - "./run/:/run" 22 | volumes_from: 23 | - logs_data 24 | - server_data 25 | networks: 26 | - swerpbox 27 | 28 | rutorrent: 29 | image: swerpbox/rutorrent:1.1.1 30 | # build: ./docker/rutorrent 31 | container_name: sb-rutorrent 32 | restart: always 33 | ports: 34 | - "49123:49123/tcp" 35 | - "49123:49123/udp" 36 | - "6881:6881/udp" 37 | - "5000:5000/tcp" 38 | - "41812:41812" 39 | env_file: .env 40 | depends_on: 41 | - frontend 42 | volumes: 43 | - "/etc/localtime:/etc/localtime:ro" 44 | - "/dev/rtc:/dev/rtc:ro" 45 | - "./config:/config" 46 | - "./data:/data" 47 | - "./media:/media" 48 | - "./run/:/run/:rw" 49 | volumes_from: 50 | - logs_data 51 | - server_data 52 | networks: 53 | - swerpbox 54 | 55 | deluge: 56 | image: swerpbox/deluge:1.1.1 57 | # build: ./docker/deluge 58 | container_name: sb-deluge 59 | restart: always 60 | ports: 61 | - "58946:58946/tcp" 62 | - "58946:58946/udp" 63 | - "58846:58846/tcp" 64 | - "8112:8112/tcp" 65 | env_file: .env 66 | depends_on: 67 | - frontend 68 | volumes: 69 | - "/etc/localtime:/etc/localtime:ro" 70 | - "/dev/rtc:/dev/rtc:ro" 71 | - "./config/deluge:/config" 72 | - "./data:/data" 73 | - "./media:/media" 74 | volumes_from: 75 | - logs_data 76 | networks: 77 | - swerpbox 78 | 79 | plex: 80 | image: plexinc/pms-docker 81 | container_name: sb-plex 82 | restart: unless-stopped 83 | ports: 84 | - "32400:32400/tcp" 85 | - "3005:3005/tcp" 86 | - "8324:8324/tcp" 87 | - "32469:32469/tcp" 88 | - "1900:1900/udp" 89 | - "32410:32410/udp" 90 | - "32412:32412/udp" 91 | - "32413:32413/udp" 92 | - "32414:32414/udp" 93 | env_file: .env 94 | hostname: swerpbox 95 | networks: 96 | - swerpbox 97 | volumes: 98 | - "/etc/localtime:/etc/localtime:ro" 99 | - "/dev/rtc:/dev/rtc:ro" 100 | - "./config/plex:/config" 101 | - "./config/plex/tmp:/transcode" 102 | - "./media:/data" 103 | 104 | plexpy: 105 | image: swerpbox/plexpy:1.1.1 106 | # build: ./docker/plexpy 107 | container_name: sb-plexpy 108 | restart: always 109 | ports: 110 | - "8181:8181" 111 | env_file: .env 112 | volumes: 113 | - "/etc/localtime:/etc/localtime:ro" 114 | - "./config/plex/Library/Application\ Support/Plex\ Media\ Server/Logs/:/logs" 115 | - "./config/plexpy:/config" 116 | networks: 117 | - swerpbox 118 | depends_on: 119 | - plex 120 | links: 121 | - plex 122 | 123 | resilio: 124 | image: swerpbox/resilio-sync:1.1.1 125 | #build: ./docker/resilio-sync 126 | container_name: sb-resilio 127 | ports: 128 | - "8888:8888" 129 | - "55555:55555" 130 | env_file: .env 131 | networks: 132 | - swerpbox 133 | volumes: 134 | - "./config/resilio:/config" 135 | - "./data:/data" 136 | volumes_from: 137 | - logs_data 138 | 139 | sonarr: 140 | image: swerpbox/sonarr:1.1.2 141 | # build: ./docker/sonarr 142 | container_name: sb-sonarr 143 | ports: 144 | - "8989:8989/tcp" 145 | env_file: .env 146 | networks: 147 | - swerpbox 148 | depends_on: 149 | - frontend 150 | volumes: 151 | - "/etc/localtime:/etc/localtime:ro" 152 | - "/dev/rtc:/dev/rtc:ro" 153 | - "./config/sonarr:/config" 154 | - "./data:/data" 155 | - "./data/downloading:/downloads" 156 | - "./media/TV Shows:/tv" 157 | volumes_from: 158 | - logs_data 159 | 160 | cardigann: 161 | image: swerpbox/cardigann:1.0.0 162 | # build: ./docker/cardigann 163 | container_name: sb-cardigann 164 | ports: 165 | - "5060:5060/tcp" 166 | env_file: .env 167 | networks: 168 | - swerpbox 169 | links: 170 | - frontend 171 | volumes: 172 | - "./config/cardigann:/config" 173 | - "./data:/data" 174 | volumes_from: 175 | - logs_data 176 | 177 | logs_data: 178 | image: tianon/true 179 | volumes: 180 | - "./logs:/logs" 181 | 182 | server_data: 183 | image: tianon/true 184 | volumes: 185 | - "./srv/nginx:/etc/nginx:ro" 186 | - "./srv/public:/var/www/public" 187 | -------------------------------------------------------------------------------- /docker/base/alpine/.dockerignore: -------------------------------------------------------------------------------- 1 | .git 2 | .gitignore 3 | README.md 4 | -------------------------------------------------------------------------------- /docker/base/alpine/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:3.5 2 | 3 | 4 | ARG OVERLAY_VERSION="v1.19.1.1" 5 | LABEL org.label-schema.vendor="SwerpBox: Alpine Base" \ 6 | org.label-schema.build-date="2017-02-02T00:12:00+00:00" \ 7 | org.label-schema.name="Alpine 3.5 base image for Swerpbox" \ 8 | org.label-schema.vcs-type="git" \ 9 | org.label-schema.vcs-url="https://github.com/strues/swerpbox" \ 10 | maintainer="Steven Truesdell " 11 | 12 | # environment variables 13 | ENV HOME="/root" \ 14 | TERM="xterm" 15 | 16 | RUN \ 17 | apk update && \ 18 | apk add --no-cache --virtual=build-deps curl tar && \ 19 | apk add --no-cache bash ca-certificates coreutils shadow tzdata && \ 20 | 21 | curl -o /tmp/s6-overlay.tar.gz -L \ 22 | "https://github.com/just-containers/s6-overlay/releases/download/${OVERLAY_VERSION}/s6-overlay-amd64.tar.gz" && \ 23 | tar xfz /tmp/s6-overlay.tar.gz -C / && \ 24 | 25 | groupmod -g 1000 users && \ 26 | useradd -u 911 -U -d /config -s /bin/false swerp && \ 27 | usermod -G users swerp && \ 28 | 29 | mkdir -p \ 30 | /app \ 31 | /config \ 32 | /data \ 33 | /media \ 34 | /logs \ 35 | /defaults && \ 36 | 37 | apk del --purge build-deps && \ 38 | rm -rf /tmp/* /var/cache/apk/* 39 | 40 | COPY rootfs/ / 41 | 42 | ENTRYPOINT ["/init"] 43 | -------------------------------------------------------------------------------- /docker/base/alpine/Makefile: -------------------------------------------------------------------------------- 1 | IMAGE = swerpbox/alpine-base 2 | TAG = latest 3 | 4 | clean: 5 | docker rmi $(IMAGE):$(TAG) $(CLEAN_OPTIONS) || true 6 | 7 | build: 8 | docker build -t $(IMAGE):$(TAG) $(BUILD_OPTIONS) . 9 | 10 | pull: 11 | docker pull $(IMAGE):$(TAG) $(PULL_OPTIONS) 12 | 13 | push: 14 | docker push $(IMAGE):$(TAG) 15 | -------------------------------------------------------------------------------- /docker/base/alpine/rootfs/etc/cont-finish.d/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strues/swerpbox/6362c115cbf997e11e9f14a8d3bcee3312c6e920/docker/base/alpine/rootfs/etc/cont-finish.d/.gitkeep -------------------------------------------------------------------------------- /docker/base/alpine/rootfs/etc/cont-init.d/10-adduser: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bash 2 | 3 | PUID=${PUID:-911} 4 | PGID=${PGID:-911} 5 | 6 | groupmod -o -g "$PGID" swerp 7 | usermod -o -u "$PUID" swerp 8 | 9 | echo " 10 | ------------------------------------- 11 | ____ ___ 12 | / __/ _____ _______ / _ )___ __ __ 13 | _\ \| |/|/ / -_) __/ _ \/ _ / _ \\ \ / 14 | /___/|__,__/\__/_/ / .__/____/\___/_\_\ 15 | /_/ 16 | ------------------------------------- 17 | ------------------------------------- 18 | GID/UID 19 | ------------------------------------- 20 | User uid: $(id -u swerp) 21 | User gid: $(id -g swerp) 22 | ------------------------------------- 23 | " 24 | chown swerp:swerp /app 25 | chown swerp:swerp /config 26 | chown swerp:swerp /defaults 27 | chown swerp:swerp /data 28 | chown swerp:swerp /media 29 | chown swerp:swerp /web 30 | -------------------------------------------------------------------------------- /docker/base/alpine/rootfs/etc/fix-attrs.d/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strues/swerpbox/6362c115cbf997e11e9f14a8d3bcee3312c6e920/docker/base/alpine/rootfs/etc/fix-attrs.d/.gitkeep -------------------------------------------------------------------------------- /docker/base/alpine/rootfs/etc/services.d/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strues/swerpbox/6362c115cbf997e11e9f14a8d3bcee3312c6e920/docker/base/alpine/rootfs/etc/services.d/.gitkeep -------------------------------------------------------------------------------- /docker/base/ubuntu/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM scratch 2 | LABEL org.label-schema.vendor="SwerpBox" \ 3 | org.label-schema.build-date="2017-01-29T00:10:00+00:00" \ 4 | org.label-schema.name="minimal base images with Ubuntu" \ 5 | org.label-schema.vcs-type="git" \ 6 | org.label-schema.vcs-url="https://github.com/strues/swerpbox" \ 7 | maintainer="Steven Truesdell " 8 | 9 | ADD files/rootfs.tar / 10 | 11 | ADD https://github.com/just-containers/s6-overlay/releases/download/v1.19.1.1/s6-overlay-amd64.tar.gz /tmp/ 12 | RUN \ 13 | tar xzf /tmp/s6-overlay-amd64.tar.gz -C / && \ 14 | useradd -u 911 -U -d /config -s /bin/false swerp && \ 15 | usermod -G users swerp && \ 16 | 17 | mkdir -p \ 18 | /app \ 19 | /config \ 20 | /data \ 21 | /media \ 22 | /defaults 23 | 24 | COPY root / 25 | 26 | ENTRYPOINT ["/init"] 27 | -------------------------------------------------------------------------------- /docker/base/ubuntu/Makefile: -------------------------------------------------------------------------------- 1 | IMAGE = swerpbox/ubuntu-base 2 | TAG = latest 3 | 4 | clean: 5 | docker rmi $(IMAGE):$(TAG) $(CLEAN_OPTIONS) || true 6 | 7 | build: 8 | docker build -t $(IMAGE):$(TAG) $(BUILD_OPTIONS) . 9 | 10 | pull: 11 | docker pull $(IMAGE):$(TAG) $(PULL_OPTIONS) 12 | 13 | push: 14 | docker push $(IMAGE):$(TAG) 15 | -------------------------------------------------------------------------------- /docker/base/ubuntu/files/build.manifest: -------------------------------------------------------------------------------- 1 | adduser 3.113+nmu3ubuntu4 2 | apt 1.3.3-3bn 3 | apt-transport-https 1.3.3-3bn 4 | base-files 9.4ubuntu4.3 5 | bash 4.3-14ubuntu1.1 6 | bzip2 1.0.6-8 7 | ca-certificates 20161224 8 | coreutils 8.25-2ubuntu2 9 | curl 7.52.1-2dyn 10 | dash 0.5.8-2.1ubuntu2 11 | debconf 1.5.58ubuntu1 12 | debianutils 4.7 13 | diffutils 1:3.3-3 14 | dpkg 1.18.18 15 | findutils 4.6.0+git+20160126-2 16 | gcc-6-base 6.3.0-5bn 17 | gnupg-agent 2.1.14-9bn 18 | gnupg2 2.1.14-9bn 19 | gpgv2 2.1.14-9bn 20 | grep 2.25-1~16.04.1 21 | gzip 1.6-4ubuntu1 22 | hostname 3.16ubuntu2 23 | init-system-helpers 1.29ubuntu3 24 | jq 1.5+dfsg-17bn 25 | libacl1 2.2.52-3 26 | libapt-pkg5.0 1.3.3-3bn 27 | libassuan0 2.4.3-1 28 | libattr1 1:2.4.47-2 29 | libaudit-common 1:2.4.5-1ubuntu2 30 | libaudit1 1:2.4.5-1ubuntu2 31 | libbz2-1.0 1.0.6-8 32 | libc-bin 2.24-1bn0 33 | libc6 2.24-1bn0 34 | libcap2 1:2.25-1 35 | libcap2-bin 1:2.25-1 36 | libcurl3 7.99.9-1alias 37 | libcurl3-boringssl 7.52.1-2 38 | libgcc1 1:6.3.0-5bn 39 | libgcrypt20 1.7.3-4bn 40 | libgpg-error0 1.24-1 41 | liblz4-1 0.0~r131-2ubuntu2 42 | liblzma5 5.2.2-1.2.8bn 43 | libminizip1 1.1-8 44 | libncursesw5 6.0+20160213-1ubuntu1 45 | libnpth0 1.2-3 46 | libonig2 5.9.6-1 47 | libpam-modules 1.1.8-3.2ubuntu2 48 | libpam-modules-bin 1.1.8-3.2ubuntu2 49 | libpam0g 1.1.8-3.2ubuntu2 50 | libpcre3 2:8.38-3.1 51 | libreadline6 6.3-8ubuntu2 52 | libseccomp2 2.2.3-3ubuntu3 53 | libselinux1 2.4-3build2 54 | libsemanage-common 2.3-1build3 55 | libsemanage1 2.3-1build3 56 | libsepol1 2.4-2 57 | libsqlite3-0 3.11.0-1ubuntu1 58 | libstdc++6 6.3.0-5bn 59 | libtinfo5 6.0+20160213-1ubuntu1 60 | libustr-1.0-1 1.0.4-5 61 | locales 2.24-1bn0 62 | lsb-base 9.20160110ubuntu0.2 63 | mawk 1.3.3-17ubuntu2 64 | minizip 1.1-8 65 | multiarch-support 2.24-1bn0 66 | ncurses-base 6.0+20160213-1ubuntu1 67 | passwd 1:4.2-3.1ubuntu5 68 | perl-base 5.24.1-1bn 69 | pinentry-curses 0.9.7-3 70 | plzip 1.5-2bn 71 | psmisc 22.21-2.1build1 72 | readline-common 6.3-8ubuntu2 73 | runit 2.1.2-3ubuntu1 74 | sed 4.2.2-7 75 | sensible-utils 0.0.9 76 | signify-linux 1.106 77 | sysvinit-utils 2.88dsf-59.3ubuntu2 78 | tar 1.29b-1bn0 79 | tzdata 2016j-0ubuntu0.16.04 80 | ubuntu-keyring 2012.05.19 81 | xz-utils 5.2.2-1.2.8bn 82 | zlib1g 1:1.2.8.sse4-2 83 | -------------------------------------------------------------------------------- /docker/base/ubuntu/files/extra.tar.lz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strues/swerpbox/6362c115cbf997e11e9f14a8d3bcee3312c6e920/docker/base/ubuntu/files/extra.tar.lz -------------------------------------------------------------------------------- /docker/base/ubuntu/files/rootfs.tar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strues/swerpbox/6362c115cbf997e11e9f14a8d3bcee3312c6e920/docker/base/ubuntu/files/rootfs.tar -------------------------------------------------------------------------------- /docker/base/ubuntu/root/etc/cont-init.d/10-adduser: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bash 2 | 3 | PUID=${PUID:-911} 4 | PGID=${PGID:-911} 5 | 6 | groupmod -o -g "$PGID" swerp 7 | usermod -o -u "$PUID" swerp 8 | 9 | echo " 10 | ------------------------------------- 11 | ____ ___ 12 | / __/ _____ _______ / _ )___ __ __ 13 | _\ \| |/|/ / -_) __/ _ \/ _ / _ \\ \ / 14 | /___/|__,__/\__/_/ / .__/____/\___/_\_\ 15 | /_/ 16 | ------------------------------------- 17 | ------------------------------------- 18 | GID/UID 19 | ------------------------------------- 20 | User uid: $(id -u swerp) 21 | User gid: $(id -g swerp) 22 | ------------------------------------- 23 | " 24 | chown swerp:swerp /config 25 | chown swerp:swerp /data 26 | chown swerp:swerp /media 27 | chown swerp:swerp /app 28 | chown swerp:swerp /defaults 29 | -------------------------------------------------------------------------------- /docker/cardigann/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM swerpbox/alpine-base 2 | 3 | ARG GOPATH=/tmp/golang 4 | ARG CARDIGANN_DIR=$GOPATH/src/github.com/cardigann/cardigann 5 | 6 | ENV CONFIG_DIR=/config \ 7 | TERM=xterm 8 | 9 | LABEL org.label-schema.vendor="SwerpBox: Cardigann" \ 10 | org.label-schema.build-date="2017-01-29T00:12:00+00:00" \ 11 | org.label-schema.name="Cardigann running on Alpine 3.5" \ 12 | org.label-schema.vcs-type="git" \ 13 | org.label-schema.vcs-url="https://github.com/strues/swerpbox" \ 14 | maintainer="Steven Truesdell " 15 | 16 | # install build packages 17 | RUN \ 18 | apk update && \ 19 | apk add --no-cache --virtual=build-deps g++ gcc git make && \ 20 | apk add --no-cache --virtual=build-deps2 --repository http://nl.alpinelinux.org/alpine/edge/community go && \ 21 | apk add --no-cache ca-certificates && \ 22 | 23 | git clone https://github.com/cardigann/cardigann.git "${CARDIGANN_DIR}" && \ 24 | git -C $CARDIGANN_DIR checkout $(git -C $CARDIGANN_DIR describe --tags --candidates=1 --abbrev=0) && \ 25 | make --debug --directory=$CARDIGANN_DIR install && \ 26 | install -Dm755 $GOPATH/bin/cardigann /usr/bin/cardigann && \ 27 | 28 | apk del --purge build-deps build-deps2 && \ 29 | rm -rf /tmp/* 30 | 31 | COPY rootfs/ / 32 | 33 | EXPOSE 5060 34 | VOLUME ["/config"] 35 | -------------------------------------------------------------------------------- /docker/cardigann/Makefile: -------------------------------------------------------------------------------- 1 | IMAGE = swerpbox/cardigann 2 | TAG = latest 3 | 4 | clean: 5 | docker rmi $(IMAGE):$(TAG) $(CLEAN_OPTIONS) || true 6 | 7 | build: 8 | docker build -t $(IMAGE):$(TAG) $(BUILD_OPTIONS) . 9 | 10 | pull: 11 | docker pull $(IMAGE):$(TAG) $(PULL_OPTIONS) 12 | 13 | push: 14 | docker push $(IMAGE):$(TAG) 15 | -------------------------------------------------------------------------------- /docker/cardigann/rootfs/etc/cont-init.d/30-config: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bash 2 | 3 | mkdir -p /config/definitions 4 | 5 | # permissions 6 | chown -R swerp:swerp /config 7 | -------------------------------------------------------------------------------- /docker/cardigann/rootfs/etc/services.d/cardigann/run: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bash 2 | 3 | exec s6-setuidgid swerp cardigann server 4 | -------------------------------------------------------------------------------- /docker/deluge/.dockerignore: -------------------------------------------------------------------------------- 1 | .git 2 | .gitignore 3 | .github 4 | .gitattributes 5 | README.md 6 | -------------------------------------------------------------------------------- /docker/deluge/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM swerpbox/alpine-base 2 | 3 | # environment variables 4 | ENV PYTHON_EGG_CACHE="/config/plugins/.python-eggs" 5 | 6 | LABEL org.label-schema.vendor="SwerpBox: Deluge" \ 7 | org.label-schema.build-date="2017-01-27T00:12:00+00:00" \ 8 | org.label-schema.name="Deluge and Deluge-WebUI running on Alpine 3.5" \ 9 | org.label-schema.vcs-type="git" \ 10 | org.label-schema.vcs-url="https://github.com/strues/swerpbox" \ 11 | maintainer="Steven Truesdell " 12 | 13 | # install runtime packages 14 | RUN \ 15 | echo "@testing http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories && \ 16 | apk update && \ 17 | apk add --no-cache ca-certificates p7zip unrar unzip && \ 18 | 19 | apk add --no-cache deluge@testing py2-pip && \ 20 | 21 | # install pip packages 22 | 23 | pip install service_identity && \ 24 | mkdir -p /config/plugins /logs/deluge && \ 25 | 26 | # cleanup 27 | apk del --purge py2-pip && \ 28 | rm -rf /root/.cache && \ 29 | rm -rf /var/cache/apk/* 30 | 31 | # add local files 32 | COPY rootfs/ / 33 | 34 | # ports and volumes 35 | EXPOSE 8112 58846 58946 58946/udp 36 | VOLUME ["/config", "/data", "/logs"] 37 | -------------------------------------------------------------------------------- /docker/deluge/Makefile: -------------------------------------------------------------------------------- 1 | IMAGE = swerpbox/deluge 2 | TAG = latest 3 | 4 | clean: 5 | docker rmi $(IMAGE):$(TAG) $(CLEAN_OPTIONS) || true 6 | 7 | build: 8 | docker build -t $(IMAGE):$(TAG) $(BUILD_OPTIONS) . 9 | 10 | pull: 11 | docker pull $(IMAGE):$(TAG) $(PULL_OPTIONS) 12 | 13 | push: 14 | docker push $(IMAGE):$(TAG) 15 | -------------------------------------------------------------------------------- /docker/deluge/rootfs/etc/cont-init.d/30-config: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bash 2 | 3 | # permissions 4 | chown -R swerp:swerp /config 5 | chown -R swerp:swerp /data 6 | chown -R swerp:swerp /logs 7 | -------------------------------------------------------------------------------- /docker/deluge/rootfs/etc/services.d/deluge-web/run: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bash 2 | 3 | umask 002 4 | 5 | exec s6-setuidgid swerp /usr/bin/deluge-web -c /config --loglevel=info 6 | -------------------------------------------------------------------------------- /docker/deluge/rootfs/etc/services.d/deluged/run: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bash 2 | 3 | umask 002 4 | 5 | exec s6-setuidgid swerp /usr/bin/deluged -c /config -d --loglevel=info -l /logs/deluge/deluged.log 6 | -------------------------------------------------------------------------------- /docker/flood/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM swerpbox/alpine-base 2 | MAINTAINER Steven Truesdell 3 | 4 | LABEL org.label-schema.vendor="SwerpBox: Flood" \ 5 | org.label-schema.build-date="2017-02-11T00:12:00+00:00" \ 6 | org.label-schema.name="Container for Flood running on Alpine 3.5" \ 7 | org.label-schema.vcs-type="git" \ 8 | org.label-schema.vcs-url="https://github.com/strues/swerpbox" 9 | 10 | ENV VERSION=v7.5.0 NPM_VERSION=4 11 | ENV CONFIG_FLAGS="--fully-static --without-npm" DEL_PKGS="libstdc++" RM_DIRS=/usr/include 12 | 13 | RUN apk add --no-cache --virtual=build-deps \ 14 | curl make gcc g++ python linux-headers git binutils-gold gnupg libstdc++ && \ 15 | gpg --keyserver ha.pool.sks-keyservers.net --recv-keys \ 16 | 9554F04D7259F04124DE6B476D5A82AC7E37093B \ 17 | 94AE36675C464D64BAFA68DD7434390BDBE9B9C5 \ 18 | 0034A06D9D9B0064CE8ADF6BF1747F4AD2306D93 \ 19 | FD3A5288F042B6850C66B31F09FE44734EB7990E \ 20 | 71DCFD284A79C3B38668286BC97EC7A07EDE3FC1 \ 21 | DD8F2338BAE7501E3DD5AC78C273792F7D83545D \ 22 | C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 \ 23 | B9AE9905FFD7803F25714661B63B535A4C206CA9 && \ 24 | curl -sSLO https://nodejs.org/dist/${VERSION}/node-${VERSION}.tar.xz && \ 25 | curl -sSL https://nodejs.org/dist/${VERSION}/SHASUMS256.txt.asc | gpg --batch --decrypt | \ 26 | grep " node-${VERSION}.tar.xz\$" | sha256sum -c | grep . && \ 27 | tar -xf node-${VERSION}.tar.xz && \ 28 | cd node-${VERSION} && \ 29 | ./configure --prefix=/usr ${CONFIG_FLAGS} && \ 30 | make -j$(getconf _NPROCESSORS_ONLN) && \ 31 | make install && \ 32 | cd / && \ 33 | if [ -x /usr/bin/npm ]; then \ 34 | npm install -g npm@${NPM_VERSION} && \ 35 | find /usr/lib/node_modules/npm -name test -o -name .bin -type d | xargs rm -rf; \ 36 | fi && \ 37 | git clone https://github.com/jfurrow/flood.git /app && \ 38 | cd /app && npm install --production && \ 39 | apk del build-deps ${DEL_PKGS} && \ 40 | rm -rf ${RM_DIRS} /node-${VERSION}* /usr/share/man /tmp/* /var/cache/apk/* \ 41 | /root/.npm /root/.node-gyp /root/.gnupg /usr/lib/node_modules/npm/man \ 42 | /usr/lib/node_modules/npm/doc /usr/lib/node_modules/npm/html /usr/lib/node_modules/npm/scripts 43 | -------------------------------------------------------------------------------- /docker/frontend/.dockerignore: -------------------------------------------------------------------------------- 1 | .git 2 | .gitignore 3 | README.md 4 | -------------------------------------------------------------------------------- /docker/frontend/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM swerpbox/alpine-base 2 | 3 | ARG NGINX_VERSION=1.11.9 4 | 5 | ARG BROTLI_COMMIT=1b364aeb42a0919e7c08646aa4f2f50e28d69fa5 6 | ARG NGX_BROTLI_COMMIT=12529813a9f8475718370a19007c7905601a62ad 7 | 8 | LABEL org.label-schema.vendor="SwerpBox: Frontend" \ 9 | org.label-schema.build-date="2017-01-27T00:12:00+00:00" \ 10 | org.label-schema.name="Frontend (nginx) running on Alpine 3.5" \ 11 | org.label-schema.vcs-type="git" \ 12 | org.label-schema.vcs-url="https://github.com/strues/swerpbox" \ 13 | maintainer="Steven Truesdell " 14 | 15 | RUN GPG_KEYS=B0F4253373F8F6F510D42178520A9993A1C052F8 \ 16 | && CONFIG="\ 17 | --prefix=/etc/nginx \ 18 | --sbin-path=/usr/sbin/nginx \ 19 | --modules-path=/usr/lib/nginx/modules \ 20 | --conf-path=/etc/nginx/nginx.conf \ 21 | --error-log-path=/logs/frontend/nginx-error.log \ 22 | --http-log-path=/logs/frontend/nginx-access.log \ 23 | --pid-path=/run/nginx.pid \ 24 | --lock-path=/var/run/nginx.lock \ 25 | --http-client-body-temp-path=/var/cache/nginx/client_temp \ 26 | --http-proxy-temp-path=/var/cache/nginx/proxy_temp \ 27 | --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp \ 28 | --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp \ 29 | --http-scgi-temp-path=/var/cache/nginx/scgi_temp \ 30 | --user=swerp \ 31 | --group=swerp \ 32 | --with-http_ssl_module \ 33 | --with-http_realip_module \ 34 | --with-http_addition_module \ 35 | --with-http_sub_module \ 36 | --with-http_dav_module \ 37 | --with-http_flv_module \ 38 | --with-http_mp4_module \ 39 | --with-http_gunzip_module \ 40 | --with-http_gzip_static_module \ 41 | --with-http_random_index_module \ 42 | --with-http_secure_link_module \ 43 | --with-http_stub_status_module \ 44 | --with-http_auth_request_module \ 45 | --with-http_xslt_module=dynamic \ 46 | --with-http_image_filter_module=dynamic \ 47 | --with-http_geoip_module=dynamic \ 48 | --with-http_perl_module=dynamic \ 49 | --with-threads \ 50 | --with-stream \ 51 | --with-stream_ssl_module \ 52 | --with-http_slice_module \ 53 | --with-file-aio \ 54 | --with-http_v2_module \ 55 | --with-ipv6 \ 56 | --add-module=/usr/src/ngx_brotli \ 57 | --with-cc-opt=-Wno-error \ 58 | " \ 59 | 60 | && apk add --no-cache --virtual .build-deps \ 61 | gcc \ 62 | libc-dev \ 63 | make \ 64 | openssl-dev \ 65 | pcre-dev \ 66 | zlib-dev \ 67 | linux-headers \ 68 | curl \ 69 | gnupg \ 70 | libxslt-dev \ 71 | gd-dev \ 72 | geoip-dev \ 73 | perl-dev \ 74 | && apk add --no-cache --virtual .brotli-build-deps \ 75 | autoconf \ 76 | libtool \ 77 | automake \ 78 | git \ 79 | g++ \ 80 | cmake \ 81 | && mkdir -p /usr/src \ 82 | && mkdir -p /logs/frontend \ 83 | && cd /usr/src \ 84 | && git clone https://github.com/google/brotli.git \ 85 | && cd brotli \ 86 | && git checkout -b $BROTLI_COMMIT $BROTLI_COMMIT \ 87 | && cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=/usr/lib -DBUILD_SHARED_LIBS=ON \ 88 | && make -j$(getconf _NPROCESSORS_ONLN) \ 89 | && make install \ 90 | && cd .. \ 91 | && rm -rf brotli \ 92 | && git clone https://github.com/google/ngx_brotli.git \ 93 | && cd ngx_brotli \ 94 | && git checkout -b $NGX_BROTLI_COMMIT $NGX_BROTLI_COMMIT \ 95 | && cd .. \ 96 | && curl -fSL http://nginx.org/download/nginx-$NGINX_VERSION.tar.gz -o nginx.tar.gz \ 97 | && curl -fSL http://nginx.org/download/nginx-$NGINX_VERSION.tar.gz.asc -o nginx.tar.gz.asc \ 98 | && export GNUPGHOME="$(mktemp -d)" \ 99 | && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEYS" \ 100 | && gpg --batch --verify nginx.tar.gz.asc nginx.tar.gz \ 101 | && rm -r "$GNUPGHOME" nginx.tar.gz.asc \ 102 | && mkdir -p /usr/src \ 103 | && tar -zxC /usr/src -f nginx.tar.gz \ 104 | && rm nginx.tar.gz \ 105 | && cd /usr/src/nginx-$NGINX_VERSION \ 106 | && ./configure $CONFIG --with-debug \ 107 | && make -j$(getconf _NPROCESSORS_ONLN) \ 108 | && mv objs/nginx objs/nginx-debug \ 109 | && mv objs/ngx_http_xslt_filter_module.so objs/ngx_http_xslt_filter_module-debug.so \ 110 | && mv objs/ngx_http_image_filter_module.so objs/ngx_http_image_filter_module-debug.so \ 111 | && mv objs/ngx_http_geoip_module.so objs/ngx_http_geoip_module-debug.so \ 112 | && mv objs/ngx_http_perl_module.so objs/ngx_http_perl_module-debug.so \ 113 | && ./configure $CONFIG \ 114 | && make -j$(getconf _NPROCESSORS_ONLN) \ 115 | && make install \ 116 | && rm -rf /etc/nginx/html/ \ 117 | && rm -rf /etc/nginx/conf.d/* \ 118 | && mkdir /etc/nginx/vhost.d/ \ 119 | && mkdir -p /var/www/public \ 120 | && install -m755 objs/nginx-debug /usr/sbin/nginx-debug \ 121 | && install -m755 objs/ngx_http_xslt_filter_module-debug.so /usr/lib/nginx/modules/ngx_http_xslt_filter_module-debug.so \ 122 | && install -m755 objs/ngx_http_image_filter_module-debug.so /usr/lib/nginx/modules/ngx_http_image_filter_module-debug.so \ 123 | && install -m755 objs/ngx_http_geoip_module-debug.so /usr/lib/nginx/modules/ngx_http_geoip_module-debug.so \ 124 | && install -m755 objs/ngx_http_perl_module-debug.so /usr/lib/nginx/modules/ngx_http_perl_module-debug.so \ 125 | && ln -s ../../usr/lib/nginx/modules /etc/nginx/modules \ 126 | && strip /usr/sbin/nginx* \ 127 | && strip /usr/lib/nginx/modules/*.so \ 128 | && rm -rf /usr/src/nginx-$NGINX_VERSION \ 129 | && rm -rf /usr/src/ngx_brotli \ 130 | \ 131 | # Bring in gettext so we can get `envsubst`, then throw 132 | # the rest away. To do this, we need to install `gettext` 133 | # then move `envsubst` out of the way so `gettext` can 134 | # be deleted completely, then move `envsubst` back. 135 | && apk add --no-cache --virtual .gettext gettext \ 136 | && mv /usr/bin/envsubst /tmp/ \ 137 | \ 138 | && runDeps="$( \ 139 | scanelf --needed --nobanner /usr/sbin/nginx /usr/lib/nginx/modules/*.so /tmp/envsubst \ 140 | | awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \ 141 | | sort -u \ 142 | | xargs -r apk info --installed \ 143 | | sort -u \ 144 | )" \ 145 | && apk add --no-cache --virtual .nginx-rundeps $runDeps \ 146 | && apk del .build-deps \ 147 | && apk del .brotli-build-deps \ 148 | && apk del .gettext \ 149 | && mv /tmp/envsubst /usr/local/bin/ \ 150 | \ 151 | # forward request and error logs to docker log collector 152 | && ln -sf /dev/stdout /logs/frontend/nginx-access.log \ 153 | && ln -sf /dev/stderr /logs/frontend/nginx-error.log \ 154 | && chmod -R 0777 /logs/frontend && \ 155 | mkdir -p /var/cache/nginx/client_temp && chmod 0777 /var/cache/nginx/client_temp 156 | 157 | RUN apk add --no-cache apache2-utils 158 | 159 | EXPOSE 80 443 160 | 161 | COPY rootfs/ / 162 | 163 | VOLUME ["/config", "/data", "/logs"] 164 | -------------------------------------------------------------------------------- /docker/frontend/Makefile: -------------------------------------------------------------------------------- 1 | IMAGE = swerpbox/frontend 2 | TAG = latest 3 | 4 | clean: 5 | docker rmi $(IMAGE):$(TAG) $(CLEAN_OPTIONS) || true 6 | 7 | build: 8 | docker build -t $(IMAGE):$(TAG) $(BUILD_OPTIONS) . 9 | 10 | pull: 11 | docker pull $(IMAGE):$(TAG) $(PULL_OPTIONS) 12 | 13 | push: 14 | docker push $(IMAGE):$(TAG) 15 | -------------------------------------------------------------------------------- /docker/frontend/rootfs/etc/cont-init.d/20-init: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bash 2 | 3 | mkdir -p /logs/frontend 4 | 5 | chown -R swerp:swerp \ 6 | /etc/nginx \ 7 | /etc/nginx/vhost.d \ 8 | /var/www/public \ 9 | /logs/frontend 10 | 11 | chmod -R g+w /var/www/public /logs/frontend 12 | 13 | htpasswd -cb /etc/nginx/.htpasswd $USERNAME $PASSWORD 14 | -------------------------------------------------------------------------------- /docker/frontend/rootfs/etc/nginx/cfgs/cache/extension.conf: -------------------------------------------------------------------------------- 1 | 2 | location ~* ^.+\.(jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ { 3 | expires 30d; 4 | add_header Vary Accept-Encoding; 5 | access_log off; 6 | if_modified_since before; 7 | } 8 | -------------------------------------------------------------------------------- /docker/frontend/rootfs/etc/nginx/cfgs/cache/static.conf: -------------------------------------------------------------------------------- 1 | location ~ ^/static/ { 2 | expires 30d; 3 | add_header Vary Accept-Encoding; 4 | access_log off; 5 | if_modified_since before; 6 | } 7 | -------------------------------------------------------------------------------- /docker/frontend/rootfs/etc/nginx/cfgs/misc/acme.conf: -------------------------------------------------------------------------------- 1 | location /.well-known/acme-challenge/ { 2 | root /data/acme/challenges; 3 | access_log off; 4 | try_files $uri =404; 5 | break; 6 | } 7 | -------------------------------------------------------------------------------- /docker/frontend/rootfs/etc/nginx/cfgs/misc/no-robots.conf: -------------------------------------------------------------------------------- 1 | location /robots.txt { 2 | add_header Content-Type text/plain; 3 | return 200 "User-agent: *\nDisallow: /\n"; 4 | } 5 | -------------------------------------------------------------------------------- /docker/frontend/rootfs/etc/nginx/cfgs/proxy/headers.conf: -------------------------------------------------------------------------------- 1 | proxy_set_header Host $http_host; 2 | proxy_set_header X-Real-IP $remote_addr; 3 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 4 | proxy_set_header X-Forwarded-Proto $scheme; 5 | proxy_set_header Proxy ""; # block Proxy header to prevent httpoxy.org 6 | -------------------------------------------------------------------------------- /docker/frontend/rootfs/etc/nginx/cfgs/proxy/params.conf: -------------------------------------------------------------------------------- 1 | proxy_connect_timeout 59s; 2 | proxy_send_timeout 600; 3 | proxy_read_timeout 600; 4 | proxy_buffer_size 64k; 5 | proxy_buffers 16 32k; 6 | proxy_pass_header Set-Cookie; 7 | proxy_hide_header Vary; 8 | 9 | proxy_busy_buffers_size 64k; 10 | proxy_temp_file_write_size 64k; 11 | 12 | proxy_ignore_headers Cache-Control Expires; 13 | 14 | proxy_redirect default; 15 | port_in_redirect off; 16 | -------------------------------------------------------------------------------- /docker/frontend/rootfs/etc/nginx/cfgs/proxy_common.conf: -------------------------------------------------------------------------------- 1 | proxy_connect_timeout 59s; 2 | proxy_send_timeout 600; 3 | proxy_read_timeout 600; 4 | proxy_buffer_size 64k; 5 | proxy_buffers 16 32k; 6 | proxy_pass_header Set-Cookie; 7 | proxy_hide_header Vary; 8 | 9 | proxy_busy_buffers_size 64k; 10 | proxy_temp_file_write_size 64k; 11 | 12 | proxy_set_header Accept-Encoding ''; 13 | proxy_ignore_headers Cache-Control Expires; 14 | proxy_set_header Referer $http_referer; 15 | proxy_set_header Host $host; 16 | proxy_set_header Cookie $http_cookie; 17 | proxy_set_header X-Real-IP $remote_addr; 18 | proxy_set_header X-Forwarded-Host $host; 19 | proxy_set_header X-Forwarded-Server $host; 20 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 21 | 22 | proxy_set_header X-Forwarded-Port '443'; 23 | proxy_set_header X-Forwarded-Ssl on; 24 | proxy_set_header X-Forwarded-Proto https; 25 | proxy_set_header Authorization ''; 26 | 27 | proxy_redirect default; 28 | port_in_redirect off; 29 | -------------------------------------------------------------------------------- /docker/frontend/rootfs/etc/nginx/cfgs/security/deny-locations.conf: -------------------------------------------------------------------------------- 1 | # deny access to .htaccess files, if Apache's document root 2 | # concurs with nginx's one 3 | location ~ (/.ht|/.git/) { 4 | deny all; 5 | } 6 | -------------------------------------------------------------------------------- /docker/frontend/rootfs/etc/nginx/cfgs/security/headers.conf: -------------------------------------------------------------------------------- 1 | #headers that should served over http (will be sent over https too) 2 | 3 | add_header X-Content-Type-Options "nosniff"; 4 | add_header X-Frame-Options "SAMEORIGIN"; 5 | add_header X-XSS-Protection "1; mode=block"; 6 | 7 | add_header Referrer-Policy "no-referrer, strict-origin-when-cross-origin"; 8 | -------------------------------------------------------------------------------- /docker/frontend/rootfs/etc/nginx/cfgs/security/ssl-headers.conf: -------------------------------------------------------------------------------- 1 | 2 | #headers that only should be served over https (includes headers that would be served over http) 3 | 4 | add_header Content-Security-Policy "upgrade-insecure-requests; block-all-mixed-content; reflected-xss block; report-uri https://vsund.report-uri.io/r/default/csp/enforce;"; 5 | add_header X-Content-Security-Policy "upgrade-insecure-requests; block-all-mixed-content; reflected-xss block; report-uri https://vsund.report-uri.io/r/default/csp/enforce;"; 6 | 7 | include /etc/nginx/cfgs/security/headers.conf; 8 | -------------------------------------------------------------------------------- /docker/frontend/rootfs/etc/nginx/cfgs/ssl/ssl.conf: -------------------------------------------------------------------------------- 1 | ssl_protocols TLSv1.2; 2 | ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256'; 3 | ssl_prefer_server_ciphers on; 4 | # Size of buffer: 1400 bytes = 1 MTU 5 | 6 | ssl_buffer_size 1400; 7 | ssl_ecdh_curve secp384r1; 8 | ssl_session_tickets on; 9 | ssl_session_timeout 24h; 10 | ssl_session_cache shared:SSL:10m; 11 | # SSL Stapling 12 | ssl_stapling on; 13 | ssl_stapling_verify on; 14 | -------------------------------------------------------------------------------- /docker/frontend/rootfs/etc/nginx/cfgs/upstream/deluge.conf: -------------------------------------------------------------------------------- 1 | upstream deluge { 2 | server sb-deluge:8112; 3 | } 4 | -------------------------------------------------------------------------------- /docker/frontend/rootfs/etc/nginx/cfgs/upstream/plex.conf: -------------------------------------------------------------------------------- 1 | upstream plex { 2 | server sb-plex:32400; 3 | } 4 | -------------------------------------------------------------------------------- /docker/frontend/rootfs/etc/nginx/cfgs/upstream/plexpy.conf: -------------------------------------------------------------------------------- 1 | 2 | upstream plexpy { 3 | server sb-plexpy:8181; 4 | } 5 | -------------------------------------------------------------------------------- /docker/frontend/rootfs/etc/nginx/cfgs/upstream/rutorrent.conf: -------------------------------------------------------------------------------- 1 | 2 | upstream backend_rutorrent { 3 | server unix:/run/php/php-fpm-rutorrent.sock; 4 | } 5 | upstream backend_rtorrent { 6 | server unix:/run/php/.rtorrent.sock; 7 | } 8 | -------------------------------------------------------------------------------- /docker/frontend/rootfs/etc/nginx/cfgs/upstream/sickrage.conf: -------------------------------------------------------------------------------- 1 | 2 | upstream sickrage { 3 | server sb-sickrage:8081; 4 | } 5 | -------------------------------------------------------------------------------- /docker/frontend/rootfs/etc/nginx/cfgs/upstream/sonarr.conf: -------------------------------------------------------------------------------- 1 | upstream sonarr { 2 | server sb-sonarr:8989; 3 | } 4 | -------------------------------------------------------------------------------- /docker/frontend/rootfs/etc/nginx/fastcgi.conf: -------------------------------------------------------------------------------- 1 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 2 | fastcgi_param QUERY_STRING $query_string; 3 | fastcgi_param REQUEST_METHOD $request_method; 4 | fastcgi_param CONTENT_TYPE $content_type; 5 | fastcgi_param CONTENT_LENGTH $content_length; 6 | 7 | fastcgi_param SCRIPT_NAME $fastcgi_script_name; 8 | fastcgi_param REQUEST_URI $request_uri; 9 | fastcgi_param DOCUMENT_URI $document_uri; 10 | fastcgi_param DOCUMENT_ROOT $document_root; 11 | fastcgi_param SERVER_PROTOCOL $server_protocol; 12 | fastcgi_param REQUEST_SCHEME $scheme; 13 | fastcgi_param HTTPS $https if_not_empty; 14 | 15 | fastcgi_param GATEWAY_INTERFACE CGI/1.1; 16 | fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; 17 | 18 | fastcgi_param REMOTE_ADDR $remote_addr; 19 | fastcgi_param REMOTE_PORT $remote_port; 20 | fastcgi_param SERVER_ADDR $server_addr; 21 | fastcgi_param SERVER_PORT $server_port; 22 | fastcgi_param SERVER_NAME $server_name; 23 | 24 | # PHP only, required if PHP was built with --enable-force-cgi-redirect 25 | fastcgi_param REDIRECT_STATUS 200; 26 | -------------------------------------------------------------------------------- /docker/frontend/rootfs/etc/nginx/fastcgi_params: -------------------------------------------------------------------------------- 1 | fastcgi_param CONTENT_LENGTH $content_length; 2 | fastcgi_param CONTENT_TYPE $content_type; 3 | fastcgi_param DOCUMENT_ROOT $document_root; 4 | fastcgi_param DOCUMENT_URI $document_uri; 5 | fastcgi_param GATEWAY_INTERFACE CGI/1.1; 6 | fastcgi_param HTTPS $https if_not_empty; 7 | fastcgi_param PATH_INFO $fastcgi_path_info; 8 | fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; 9 | fastcgi_param QUERY_STRING $query_string; 10 | fastcgi_param REMOTE_ADDR $remote_addr; 11 | fastcgi_param REMOTE_PORT $remote_port; 12 | fastcgi_param REQUEST_BODY $request_body; 13 | fastcgi_param REQUEST_BODY_FILE $request_body_file; 14 | fastcgi_param REQUEST_METHOD $request_method; 15 | fastcgi_param REQUEST_PATH $uri; 16 | fastcgi_param REQUEST_URI $request_uri; 17 | fastcgi_param SCHEME $scheme; 18 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 19 | fastcgi_param SCRIPT_NAME $fastcgi_script_name; 20 | fastcgi_param SERVER_ADDR $server_addr; 21 | fastcgi_param SERVER_NAME $server_name; 22 | fastcgi_param SERVER_PORT $server_port; 23 | fastcgi_param SERVER_PROTOCOL $server_protocol; 24 | fastcgi_param SERVER_SOFTWARE nginx; 25 | fastcgi_param SSL_CLIENT_VERIFY $ssl_client_verify if_not_empty; 26 | fastcgi_param SSL_SESSION_ID $ssl_session_id if_not_empty; 27 | -------------------------------------------------------------------------------- /docker/frontend/rootfs/etc/nginx/mime.types: -------------------------------------------------------------------------------- 1 | types { 2 | text/html html htm shtml; 3 | text/css css; 4 | text/xml xml; 5 | image/gif gif; 6 | image/jpeg jpeg jpg; 7 | application/javascript js; 8 | application/atom+xml atom; 9 | application/rss+xml rss; 10 | 11 | text/mathml mml; 12 | text/plain txt; 13 | text/vnd.sun.j2me.app-descriptor jad; 14 | text/vnd.wap.wml wml; 15 | text/x-component htc; 16 | 17 | image/png png; 18 | image/tiff tif tiff; 19 | image/vnd.wap.wbmp wbmp; 20 | image/x-icon ico; 21 | image/x-jng jng; 22 | image/x-ms-bmp bmp; 23 | image/svg+xml svg svgz; 24 | image/webp webp; 25 | 26 | application/font-woff woff; 27 | application/java-archive jar war ear; 28 | application/json json; 29 | application/mac-binhex40 hqx; 30 | application/msword doc; 31 | application/pdf pdf; 32 | application/postscript ps eps ai; 33 | application/rtf rtf; 34 | application/vnd.apple.mpegurl m3u8; 35 | application/vnd.ms-excel xls; 36 | application/vnd.ms-fontobject eot; 37 | application/vnd.ms-powerpoint ppt; 38 | application/vnd.wap.wmlc wmlc; 39 | application/vnd.google-earth.kml+xml kml; 40 | application/vnd.google-earth.kmz kmz; 41 | application/x-7z-compressed 7z; 42 | application/x-cocoa cco; 43 | application/x-java-archive-diff jardiff; 44 | application/x-java-jnlp-file jnlp; 45 | application/x-makeself run; 46 | application/x-perl pl pm; 47 | application/x-pilot prc pdb; 48 | application/x-rar-compressed rar; 49 | application/x-redhat-package-manager rpm; 50 | application/x-sea sea; 51 | application/x-shockwave-flash swf; 52 | application/x-stuffit sit; 53 | application/x-tcl tcl tk; 54 | application/x-x509-ca-cert der pem crt; 55 | application/x-xpinstall xpi; 56 | application/xhtml+xml xhtml; 57 | application/xspf+xml xspf; 58 | application/zip zip; 59 | 60 | application/octet-stream bin exe dll; 61 | application/octet-stream deb; 62 | application/octet-stream dmg; 63 | application/octet-stream iso img; 64 | application/octet-stream msi msp msm; 65 | 66 | application/vnd.openxmlformats-officedocument.wordprocessingml.document docx; 67 | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx; 68 | application/vnd.openxmlformats-officedocument.presentationml.presentation pptx; 69 | 70 | audio/midi mid midi kar; 71 | audio/mpeg mp3; 72 | audio/ogg ogg; 73 | audio/x-m4a m4a; 74 | audio/x-realaudio ra; 75 | 76 | video/3gpp 3gpp 3gp; 77 | video/mp2t ts; 78 | video/mp4 mp4; 79 | video/mpeg mpeg mpg; 80 | video/quicktime mov; 81 | video/webm webm; 82 | video/x-flv flv; 83 | video/x-m4v m4v; 84 | video/x-mng mng; 85 | video/x-ms-asf asx asf; 86 | video/x-ms-wmv wmv; 87 | video/x-msvideo avi; 88 | } 89 | -------------------------------------------------------------------------------- /docker/frontend/rootfs/etc/nginx/nginx.conf: -------------------------------------------------------------------------------- 1 | worker_processes auto; 2 | pid /run/nginx.pid; 3 | daemon off; 4 | 5 | events { 6 | worker_connections 4096; 7 | use epoll; 8 | multi_accept on; 9 | } 10 | 11 | http { 12 | include /etc/nginx/mime.types; 13 | default_type application/octet-stream; 14 | 15 | 16 | log_format main '$remote_addr - $remote_user [$time_local] "$request" ' 17 | '$status $body_bytes_sent "$http_referer" ' 18 | '"$http_user_agent" "$http_x_forwarded_for"'; 19 | 20 | access_log /logs/frontend/nginx-access.log main; 21 | error_log /logs/frontend/nginx-error.log error; 22 | 23 | server_tokens off; 24 | sendfile on; 25 | tcp_nopush on; 26 | tcp_nodelay on; 27 | keepalive_timeout 15; 28 | types_hash_max_size 2048; 29 | client_max_body_size 5M; 30 | open_file_cache max=100; 31 | 32 | ssl_protocols TLSv1 TLSv1.1 TLSv1.2; 33 | ssl_ciphers 'ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS'; 34 | 35 | auth_basic "Restricted"; 36 | auth_basic_user_file .htpasswd; 37 | resolver 127.0.0.11; 38 | 39 | aio threads; 40 | 41 | limit_conn_zone $binary_remote_addr zone=limit_per_ip:10m; 42 | limit_conn limit_per_ip 40; 43 | 44 | limit_req_zone $binary_remote_addr zone=allips:10m rate=400r/s; 45 | limit_req zone=allips burst=400 nodelay; 46 | 47 | include /etc/nginx/vhost.d/*.conf; 48 | } 49 | -------------------------------------------------------------------------------- /docker/frontend/rootfs/etc/nginx/proxy.conf: -------------------------------------------------------------------------------- 1 | proxy_connect_timeout 59s; 2 | proxy_send_timeout 600; 3 | proxy_read_timeout 600; 4 | proxy_buffer_size 64k; 5 | proxy_buffers 16 32k; 6 | proxy_pass_header Set-Cookie; 7 | proxy_hide_header Vary; 8 | 9 | proxy_busy_buffers_size 64k; 10 | proxy_temp_file_write_size 64k; 11 | 12 | proxy_set_header Accept-Encoding ''; 13 | proxy_ignore_headers Cache-Control Expires; 14 | proxy_set_header Referer $http_referer; 15 | proxy_set_header Host $host; 16 | proxy_set_header Cookie $http_cookie; 17 | proxy_set_header X-Real-IP $remote_addr; 18 | proxy_set_header X-Forwarded-Host $host; 19 | proxy_set_header X-Forwarded-Server $host; 20 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 21 | 22 | proxy_set_header X-Forwarded-Port '443'; 23 | proxy_set_header X-Forwarded-Ssl on; 24 | proxy_set_header X-Forwarded-Proto https; 25 | proxy_set_header Authorization ''; 26 | 27 | proxy_redirect default; 28 | port_in_redirect off; 29 | -------------------------------------------------------------------------------- /docker/frontend/rootfs/etc/nginx/scgi_params: -------------------------------------------------------------------------------- 1 | scgi_param REQUEST_METHOD $request_method; 2 | scgi_param REQUEST_URI $request_uri; 3 | scgi_param QUERY_STRING $query_string; 4 | scgi_param CONTENT_TYPE $content_type; 5 | 6 | scgi_param DOCUMENT_URI $document_uri; 7 | scgi_param DOCUMENT_ROOT $document_root; 8 | scgi_param SCGI 1; 9 | scgi_param SERVER_PROTOCOL $server_protocol; 10 | scgi_param REQUEST_SCHEME $scheme; 11 | scgi_param HTTPS $https if_not_empty; 12 | 13 | scgi_param REMOTE_ADDR $remote_addr; 14 | scgi_param REMOTE_PORT $remote_port; 15 | scgi_param SERVER_PORT $server_port; 16 | scgi_param SERVER_NAME $server_name; 17 | -------------------------------------------------------------------------------- /docker/frontend/rootfs/etc/nginx/uwsgi_params: -------------------------------------------------------------------------------- 1 | uwsgi_param QUERY_STRING $query_string; 2 | uwsgi_param REQUEST_METHOD $request_method; 3 | uwsgi_param CONTENT_TYPE $content_type; 4 | uwsgi_param CONTENT_LENGTH $content_length; 5 | 6 | uwsgi_param REQUEST_URI $request_uri; 7 | uwsgi_param PATH_INFO $document_uri; 8 | uwsgi_param DOCUMENT_ROOT $document_root; 9 | uwsgi_param SERVER_PROTOCOL $server_protocol; 10 | uwsgi_param REQUEST_SCHEME $scheme; 11 | uwsgi_param HTTPS $https if_not_empty; 12 | 13 | uwsgi_param REMOTE_ADDR $remote_addr; 14 | uwsgi_param REMOTE_PORT $remote_port; 15 | uwsgi_param SERVER_PORT $server_port; 16 | uwsgi_param SERVER_NAME $server_name; 17 | -------------------------------------------------------------------------------- /docker/frontend/rootfs/etc/nginx/vhost.d/deluge.tmpl: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80; 3 | listen [::]:80; 4 | server_name deluge.YOURDOMAIN.TLD; 5 | 6 | return 301 https://deluge.YOURDOMAIN.TLD$request_uri; 7 | } 8 | 9 | server { 10 | listen 443 ssl http2; 11 | listen [::]:443 ssl http2; 12 | server_name deluge.YOURDOMAIN.TLD; 13 | 14 | 15 | ## SSL 16 | ## ------------------ 17 | ssl_certificate /etc/nginx/certs/archive/LETSENCRYPTDOMAIN1/fullchain1.pem; 18 | ssl_certificate_key /etc/nginx/certs/archive/LETSENCRYPTDOMAIN1/privkey1.pem; 19 | ssl_dhparam /etc/nginx/certs/dhparam.pem; 20 | 21 | include /etc/nginx/cfgs/ssl/ssl.conf; 22 | 23 | ssl_session_ticket_key /etc/nginx/certs/ticket.key; 24 | ssl_trusted_certificate /etc/nginx/certs/archive/LETSENCRYPTDOMAIN1/fullchain1.pem; 25 | 26 | include /etc/nginx/cfgs/security/ssl-headers.conf; 27 | 28 | ## Brotli 29 | ## ------------------ 30 | brotli on; 31 | brotli_static on; 32 | brotli_min_length 1000; 33 | brotli_buffers 32 8k; 34 | brotli_comp_level 5; 35 | brotli_types *; 36 | 37 | location / { 38 | 39 | proxy_pass http://deluge/; 40 | proxy_set_header X-Deluge-Base "/"; 41 | add_header X-Frame-Options SAMEORIGIN; 42 | include /etc/nginx/cfgs/proxy/headers.conf; 43 | include /etc/nginx/cfgs/proxy/params.conf; 44 | } 45 | 46 | } 47 | include /etc/nginx/cfgs/upstream/deluge.conf; 48 | -------------------------------------------------------------------------------- /docker/frontend/rootfs/etc/nginx/vhost.d/plex.tmpl: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80; 3 | listen [::]:80; 4 | server_name plex.YOURDOMAIN.TLD; 5 | 6 | return 301 https://plex.YOURDOMAIN.TLD$request_uri; 7 | } 8 | 9 | server { 10 | listen 443 ssl http2; 11 | listen [::]:443 ssl http2; 12 | server_name plex.YOURDOMAIN.TLD; 13 | 14 | 15 | ## SSL 16 | ## ------------------ 17 | ssl_certificate /etc/nginx/certs/archive/LETSENCRYPTDOMAIN1/fullchain1.pem; 18 | ssl_certificate_key /etc/nginx/certs/archive/LETSENCRYPTDOMAIN1/privkey1.pem; 19 | ssl_dhparam /etc/nginx/certs/dhparam.pem; 20 | 21 | include /etc/nginx/cfgs/ssl/ssl.conf; 22 | 23 | ssl_session_ticket_key /etc/nginx/certs/ticket.key; 24 | ssl_trusted_certificate /etc/nginx/certs/archive/LETSENCRYPTDOMAIN1/fullchain1.pem; 25 | 26 | include /etc/nginx/cfgs/security/ssl-headers.conf; 27 | 28 | ## Brotli 29 | ## ------------------ 30 | brotli on; 31 | brotli_static on; 32 | brotli_min_length 1000; 33 | brotli_buffers 32 8k; 34 | brotli_comp_level 5; 35 | brotli_types *; 36 | 37 | location / { 38 | 39 | proxy_pass http://plex/; 40 | 41 | include /etc/nginx/cfgs/proxy/headers.conf; 42 | include /etc/nginx/cfgs/proxy/params.conf; 43 | } 44 | 45 | } 46 | include /etc/nginx/cfgs/upstream/plex.conf; 47 | -------------------------------------------------------------------------------- /docker/frontend/rootfs/etc/nginx/vhost.d/plexpy.tmpl: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80; 3 | listen [::]:80; 4 | server_name plexpy.YOURDOMAIN.TLD; 5 | 6 | return 301 https://plexpy.YOURDOMAIN.TLD$request_uri; 7 | } 8 | 9 | server { 10 | listen 443 ssl http2; 11 | listen [::]:443 ssl http2; 12 | server_name plexpy.YOURDOMAIN.TLD; 13 | 14 | 15 | ## SSL 16 | ## ------------------ 17 | ssl_certificate /etc/nginx/certs/archive/LETSENCRYPTDOMAIN1/fullchain1.pem; 18 | ssl_certificate_key /etc/nginx/certs/archive/LETSENCRYPTDOMAIN1/privkey1.pem; 19 | ssl_dhparam /etc/nginx/certs/dhparam.pem; 20 | 21 | include /etc/nginx/cfgs/ssl/ssl.conf; 22 | 23 | ssl_session_ticket_key /etc/nginx/certs/ticket.key; 24 | ssl_trusted_certificate /etc/nginx/certs/archive/LETSENCRYPTDOMAIN1/fullchain1.pem; 25 | 26 | include /etc/nginx/cfgs/security/ssl-headers.conf; 27 | 28 | ## Brotli 29 | ## ------------------ 30 | brotli on; 31 | brotli_static on; 32 | brotli_min_length 1000; 33 | brotli_buffers 32 8k; 34 | brotli_comp_level 5; 35 | brotli_types *; 36 | 37 | location / { 38 | 39 | proxy_pass http://plexpy/; 40 | 41 | include /etc/nginx/cfgs/proxy/headers.conf; 42 | include /etc/nginx/cfgs/proxy/params.conf; 43 | } 44 | 45 | } 46 | include /etc/nginx/cfgs/upstream/plexpy.conf; 47 | -------------------------------------------------------------------------------- /docker/frontend/rootfs/etc/nginx/vhost.d/rutorrent.tmpl: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80; 3 | listen [::]:80; 4 | server_name rutorrent.YOURDOMAIN.TLD; 5 | 6 | return 301 https://rutorrent.YOURDOMAIN.TLD$request_uri; 7 | } 8 | 9 | server { 10 | listen 443 ssl http2; 11 | listen [::]:443 ssl http2; 12 | server_name rutorrent.YOURDOMAIN.TLD; 13 | 14 | 15 | ## SSL 16 | ## ------------------ 17 | ssl_certificate /etc/nginx/certs/archive/LETSENCRYPTDOMAIN1/fullchain1.pem; 18 | ssl_certificate_key /etc/nginx/certs/archive/LETSENCRYPTDOMAIN1/privkey1.pem; 19 | ssl_dhparam /etc/nginx/certs/dhparam.pem; 20 | 21 | include /etc/nginx/cfgs/ssl/ssl.conf; 22 | 23 | ssl_session_ticket_key /etc/nginx/certs/ticket.key; 24 | ssl_trusted_certificate /etc/nginx/certs/archive/LETSENCRYPTDOMAIN1/fullchain1.pem; 25 | 26 | include /etc/nginx/cfgs/security/ssl-headers.conf; 27 | 28 | ## Brotli 29 | ## ------------------ 30 | brotli on; 31 | brotli_static on; 32 | brotli_min_length 1000; 33 | brotli_buffers 32 8k; 34 | brotli_comp_level 5; 35 | brotli_types *; 36 | 37 | location / { 38 | 39 | proxy_pass http://rutorrent/; 40 | 41 | include /etc/nginx/cfgs/proxy/headers.conf; 42 | include /etc/nginx/cfgs/proxy/params.conf; 43 | } 44 | 45 | } 46 | include /etc/nginx/cfgs/upstream/rutorrent.conf; 47 | -------------------------------------------------------------------------------- /docker/frontend/rootfs/etc/nginx/vhost.d/sickrage.tmpl: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80; 3 | listen [::]:80; 4 | server_name sickrage.YOURDOMAIN.TLD; 5 | 6 | return 301 https://sickrage.YOURDOMAIN.TLD$request_uri; 7 | } 8 | 9 | server { 10 | listen 443 ssl http2; 11 | listen [::]:443 ssl http2; 12 | server_name sickrage.YOURDOMAIN.TLD; 13 | 14 | 15 | ## SSL 16 | ## ------------------ 17 | ssl_certificate /etc/nginx/certs/archive/LETSENCRYPTDOMAIN1/fullchain1.pem; 18 | ssl_certificate_key /etc/nginx/certs/archive/LETSENCRYPTDOMAIN1/privkey1.pem; 19 | ssl_dhparam /etc/nginx/certs/dhparam.pem; 20 | 21 | include /etc/nginx/cfgs/ssl/ssl.conf; 22 | 23 | ssl_session_ticket_key /etc/nginx/certs/ticket.key; 24 | ssl_trusted_certificate /etc/nginx/certs/archive/LETSENCRYPTDOMAIN1/fullchain1.pem; 25 | 26 | include /etc/nginx/cfgs/security/ssl-headers.conf; 27 | 28 | ## Brotli 29 | ## ------------------ 30 | brotli on; 31 | brotli_static on; 32 | brotli_min_length 1000; 33 | brotli_buffers 32 8k; 34 | brotli_comp_level 5; 35 | brotli_types *; 36 | 37 | location / { 38 | 39 | proxy_pass http://sickrage/; 40 | 41 | include /etc/nginx/cfgs/proxy/headers.conf; 42 | include /etc/nginx/cfgs/proxy/params.conf; 43 | } 44 | 45 | } 46 | include /etc/nginx/cfgs/upstream/sickrage.conf; 47 | -------------------------------------------------------------------------------- /docker/frontend/rootfs/etc/nginx/vhost.d/site-ssl.tmpl: -------------------------------------------------------------------------------- 1 | 2 | server { 3 | listen 80; 4 | listen [::]:80; 5 | server_name www.YOURDOMAIN.TLD YOURDOMAIN.TLD; 6 | 7 | return 301 https://YOURDOMAIN.TLD$request_uri; 8 | } 9 | 10 | server { 11 | listen 443 ssl http2; 12 | listen [::]:443 ssl http2; 13 | # listen on the wrong host 14 | server_name www.YOURDOMAIN.TLD; 15 | 16 | ssl_certificate /etc/nginx/certs/archive/LETSENCRYPTDOMAIN1/fullchain1.pem; 17 | ssl_certificate_key /etc/nginx/certs/archive/LETSENCRYPTDOMAIN1/privkey1.pem; 18 | ssl_dhparam /etc/nginx/certs/dhparam.pem; 19 | 20 | # and redirect to the non-www host (declared below) 21 | return 301 https://YOURDOMAIN.TLD$request_uri; 22 | } 23 | 24 | server { 25 | listen 443 ssl http2; 26 | listen [::]:443 ssl http2; 27 | server_name YOURDOMAIN.TLD; 28 | root /var/www/public; 29 | 30 | ## SSL 31 | ## ------------------ 32 | ssl_certificate /etc/nginx/certs/archive/LETSENCRYPTDOMAIN1/fullchain1.pem; 33 | ssl_certificate_key /etc/nginx/certs/archive/LETSENCRYPTDOMAIN1/privkey1.pem; 34 | ssl_dhparam /etc/nginx/certs/dhparam.pem; 35 | 36 | include /etc/nginx/cfgs/ssl/ssl.conf; 37 | 38 | ssl_session_ticket_key /etc/nginx/certs/ticket.key; 39 | ssl_trusted_certificate /etc/nginx/certs/archive/LETSENCRYPTDOMAIN1/fullchain1.pem; 40 | 41 | include /etc/nginx/cfgs/security/ssl-headers.conf; 42 | 43 | ## Brotli 44 | ## ------------------ 45 | brotli on; 46 | brotli_static on; 47 | brotli_min_length 1000; 48 | brotli_buffers 32 8k; 49 | brotli_comp_level 5; 50 | brotli_types *; 51 | 52 | location / { 53 | try_files $uri =404; 54 | expires max; 55 | add_header Pragma public; 56 | add_header Cache-Control "public, must-revalidate, proxy-revalidate"; 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /docker/frontend/rootfs/etc/nginx/vhost.d/site.conf: -------------------------------------------------------------------------------- 1 | 2 | server { 3 | listen 80; 4 | listen [::]:80; 5 | 6 | server_name _ default_server; 7 | 8 | location / { 9 | try_files $uri $uri/ =404; 10 | } 11 | location /rutorrent { 12 | try_files $uri $uri/ =404; 13 | access_log /logs/frontend/rutorrent.access.log; 14 | error_log /logs/frontend/rutorrent.error.log; 15 | 16 | location ~ .php$ { 17 | fastcgi_split_path_info ^(.+\.php)(.*)$; 18 | fastcgi_pass backend_rutorrent; 19 | fastcgi_index index.php; 20 | fastcgi_intercept_errors on; 21 | fastcgi_ignore_client_abort off; 22 | fastcgi_connect_timeout 60; 23 | fastcgi_send_timeout 180; 24 | fastcgi_read_timeout 180; 25 | fastcgi_buffer_size 128k; 26 | fastcgi_buffers 4 256k; 27 | fastcgi_busy_buffers_size 256k; 28 | fastcgi_temp_file_write_size 256k; 29 | 30 | include /etc/nginx/fastcgi_params; 31 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 32 | } 33 | } 34 | 35 | location /RPC2 { 36 | access_log /logs/frontend/rutorrent.rpc2.access.log; 37 | error_log /logs/frontend/rutorrent.rpc2.error.log; 38 | include /etc/nginx/scgi_params; 39 | scgi_pass backend_rtorrent; 40 | } 41 | 42 | 43 | location /deluge { 44 | proxy_pass http://deluge/; 45 | proxy_set_header X-Deluge-Base "/deluge/"; 46 | 47 | include /etc/nginx/cfgs/proxy/headers.conf; 48 | include /etc/nginx/cfgs/proxy/params.conf; 49 | } 50 | # location /sonarr { 51 | # proxy_pass http://sonarr/; 52 | # 53 | # include /etc/nginx/cfgs/proxy/headers.conf; 54 | # include /etc/nginx/cfgs/proxy/params.conf; 55 | # } 56 | # location /plexpy { 57 | # proxy_pass http://plexpy/; 58 | # 59 | # include /etc/nginx/cfgs/proxy/headers.conf; 60 | # include /etc/nginx/cfgs/proxy/params.conf; 61 | # } 62 | # location /plex { 63 | # proxy_pass http://plex/; 64 | # 65 | # include /etc/nginx/cfgs/proxy/headers.conf; 66 | # include /etc/nginx/cfgs/proxy/params.conf; 67 | # } 68 | # location /sickrage { 69 | # proxy_pass http://sickrage/; 70 | # add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; always"; 71 | # add_header X-Content-Type-Options nosniff; 72 | # proxy_set_header Host sickrage; 73 | # proxy_redirect default; 74 | # include /etc/nginx/cfgs/proxy_common.conf; 75 | # } 76 | } 77 | 78 | include /etc/nginx/cfgs/upstream/rutorrent.conf; 79 | include /etc/nginx/cfgs/upstream/deluge.conf; 80 | # include /etc/nginx/cfgs/upstream/sickrage.conf; 81 | # include /etc/nginx/cfgs/upstream/sonarr.conf; 82 | # include /etc/nginx/cfgs/upstream/plex.conf; 83 | # include /etc/nginx/cfgs/upstream/plexpy.conf; 84 | -------------------------------------------------------------------------------- /docker/frontend/rootfs/etc/nginx/vhost.d/sonarr.tmpl: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80; 3 | listen [::]:80; 4 | server_name sonarr.YOURDOMAIN.TLD; 5 | 6 | return 301 https://sonarr.YOURDOMAIN.TLD$request_uri; 7 | } 8 | 9 | server { 10 | listen 443 ssl http2; 11 | listen [::]:443 ssl http2; 12 | server_name sonarr.YOURDOMAIN.TLD; 13 | 14 | 15 | ## SSL 16 | ## ------------------ 17 | ssl_certificate /etc/nginx/certs/archive/LETSENCRYPTDOMAIN1/fullchain1.pem; 18 | ssl_certificate_key /etc/nginx/certs/archive/LETSENCRYPTDOMAIN1/privkey1.pem; 19 | ssl_dhparam /etc/nginx/certs/dhparam.pem; 20 | 21 | include /etc/nginx/cfgs/ssl/ssl.conf; 22 | 23 | ssl_session_ticket_key /etc/nginx/certs/ticket.key; 24 | ssl_trusted_certificate /etc/nginx/certs/archive/LETSENCRYPTDOMAIN1/fullchain1.pem; 25 | 26 | include /etc/nginx/cfgs/security/ssl-headers.conf; 27 | 28 | ## Brotli 29 | ## ------------------ 30 | brotli on; 31 | brotli_static on; 32 | brotli_min_length 1000; 33 | brotli_buffers 32 8k; 34 | brotli_comp_level 5; 35 | brotli_types *; 36 | 37 | location / { 38 | 39 | proxy_pass http://sonarr/; 40 | 41 | include /etc/nginx/cfgs/proxy/headers.conf; 42 | include /etc/nginx/cfgs/proxy/params.conf; 43 | } 44 | 45 | } 46 | include /etc/nginx/cfgs/upstream/sonarr.conf; 47 | -------------------------------------------------------------------------------- /docker/frontend/rootfs/etc/nginx/win-utf: -------------------------------------------------------------------------------- 1 | # This map is not a full windows-1251 <> utf8 map: it does not 2 | # contain Serbian and Macedonian letters. If you need a full map, 3 | # use contrib/unicode2nginx/win-utf map instead. 4 | 5 | charset_map windows-1251 utf-8 { 6 | 7 | 82 E2809A ; # single low-9 quotation mark 8 | 9 | 84 E2809E ; # double low-9 quotation mark 10 | 85 E280A6 ; # ellipsis 11 | 86 E280A0 ; # dagger 12 | 87 E280A1 ; # double dagger 13 | 88 E282AC ; # euro 14 | 89 E280B0 ; # per mille 15 | 16 | 91 E28098 ; # left single quotation mark 17 | 92 E28099 ; # right single quotation mark 18 | 93 E2809C ; # left double quotation mark 19 | 94 E2809D ; # right double quotation mark 20 | 95 E280A2 ; # bullet 21 | 96 E28093 ; # en dash 22 | 97 E28094 ; # em dash 23 | 24 | 99 E284A2 ; # trade mark sign 25 | 26 | A0 C2A0 ; #   27 | A1 D18E ; # capital Byelorussian short U 28 | A2 D19E ; # small Byelorussian short u 29 | 30 | A4 C2A4 ; # currency sign 31 | A5 D290 ; # capital Ukrainian soft G 32 | A6 C2A6 ; # borken bar 33 | A7 C2A7 ; # section sign 34 | A8 D081 ; # capital YO 35 | A9 C2A9 ; # (C) 36 | AA D084 ; # capital Ukrainian YE 37 | AB C2AB ; # left-pointing double angle quotation mark 38 | AC C2AC ; # not sign 39 | AD C2AD ; # soft hypen 40 | AE C2AE ; # (R) 41 | AF D087 ; # capital Ukrainian YI 42 | 43 | B0 C2B0 ; # ° 44 | B1 C2B1 ; # plus-minus sign 45 | B2 D086 ; # capital Ukrainian I 46 | B3 D196 ; # small Ukrainian i 47 | B4 D291 ; # small Ukrainian soft g 48 | B5 C2B5 ; # micro sign 49 | B6 C2B6 ; # pilcrow sign 50 | B7 C2B7 ; # · 51 | B8 D191 ; # small yo 52 | B9 E28496 ; # numero sign 53 | BA D194 ; # small Ukrainian ye 54 | BB C2BB ; # right-pointing double angle quotation mark 55 | 56 | BF D197 ; # small Ukrainian yi 57 | 58 | C0 D090 ; # capital A 59 | C1 D091 ; # capital B 60 | C2 D092 ; # capital V 61 | C3 D093 ; # capital G 62 | C4 D094 ; # capital D 63 | C5 D095 ; # capital YE 64 | C6 D096 ; # capital ZH 65 | C7 D097 ; # capital Z 66 | C8 D098 ; # capital I 67 | C9 D099 ; # capital J 68 | CA D09A ; # capital K 69 | CB D09B ; # capital L 70 | CC D09C ; # capital M 71 | CD D09D ; # capital N 72 | CE D09E ; # capital O 73 | CF D09F ; # capital P 74 | 75 | D0 D0A0 ; # capital R 76 | D1 D0A1 ; # capital S 77 | D2 D0A2 ; # capital T 78 | D3 D0A3 ; # capital U 79 | D4 D0A4 ; # capital F 80 | D5 D0A5 ; # capital KH 81 | D6 D0A6 ; # capital TS 82 | D7 D0A7 ; # capital CH 83 | D8 D0A8 ; # capital SH 84 | D9 D0A9 ; # capital SHCH 85 | DA D0AA ; # capital hard sign 86 | DB D0AB ; # capital Y 87 | DC D0AC ; # capital soft sign 88 | DD D0AD ; # capital E 89 | DE D0AE ; # capital YU 90 | DF D0AF ; # capital YA 91 | 92 | E0 D0B0 ; # small a 93 | E1 D0B1 ; # small b 94 | E2 D0B2 ; # small v 95 | E3 D0B3 ; # small g 96 | E4 D0B4 ; # small d 97 | E5 D0B5 ; # small ye 98 | E6 D0B6 ; # small zh 99 | E7 D0B7 ; # small z 100 | E8 D0B8 ; # small i 101 | E9 D0B9 ; # small j 102 | EA D0BA ; # small k 103 | EB D0BB ; # small l 104 | EC D0BC ; # small m 105 | ED D0BD ; # small n 106 | EE D0BE ; # small o 107 | EF D0BF ; # small p 108 | 109 | F0 D180 ; # small r 110 | F1 D181 ; # small s 111 | F2 D182 ; # small t 112 | F3 D183 ; # small u 113 | F4 D184 ; # small f 114 | F5 D185 ; # small kh 115 | F6 D186 ; # small ts 116 | F7 D187 ; # small ch 117 | F8 D188 ; # small sh 118 | F9 D189 ; # small shch 119 | FA D18A ; # small hard sign 120 | FB D18B ; # small y 121 | FC D18C ; # small soft sign 122 | FD D18D ; # small e 123 | FE D18E ; # small yu 124 | FF D18F ; # small ya 125 | } 126 | -------------------------------------------------------------------------------- /docker/frontend/rootfs/etc/services.d/nginx/run: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bash 2 | 3 | exec /usr/sbin/nginx -c /etc/nginx/nginx.conf 4 | -------------------------------------------------------------------------------- /docker/plexpy/.dockerignore: -------------------------------------------------------------------------------- 1 | .git 2 | .gitignore 3 | README.md 4 | -------------------------------------------------------------------------------- /docker/plexpy/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM swerpbox/alpine-base 2 | 3 | LABEL org.label-schema.vendor="SwerpBox: PlexPy" \ 4 | org.label-schema.build-date="2017-01-27T00:12:00+00:00" \ 5 | org.label-schema.name="PlexPy running on Alpine 3.5" \ 6 | org.label-schema.vcs-type="git" \ 7 | org.label-schema.vcs-url="https://github.com/strues/swerpbox" \ 8 | maintainer="Steven Truesdell " 9 | RUN \ 10 | apk --update add --no-cache curl freetype git lcms2 libjpeg-turbo libwebp \ 11 | openjpeg p7zip py-lxml python py2-pip tar tiff unrar unzip wget xz zlib && \ 12 | 13 | apk add --no-cache --repository http://nl.alpinelinux.org/alpine/edge/community vnstat && \ 14 | 15 | # install build packages 16 | apk add --no-cache --virtual=build-deps \ 17 | autoconf \ 18 | automake \ 19 | freetype-dev \ 20 | g++ \ 21 | gcc \ 22 | jpeg-dev \ 23 | lcms2-dev \ 24 | libffi-dev \ 25 | libpng-dev \ 26 | libwebp-dev \ 27 | linux-headers \ 28 | make \ 29 | openjpeg-dev \ 30 | openssl-dev \ 31 | python-dev \ 32 | tiff-dev \ 33 | zlib-dev && \ 34 | 35 | # add pip packages 36 | pip install --no-cache-dir -U pip && \ 37 | LIBRARY_PATH=/lib:/usr/lib \ 38 | 39 | pip install --no-cache-dir -U \ 40 | cheetah \ 41 | configparser \ 42 | ndg-httpsclient \ 43 | notify \ 44 | paramiko \ 45 | pillow \ 46 | psutil \ 47 | pyopenssl \ 48 | requests \ 49 | setuptools \ 50 | urllib3 \ 51 | virtualenv && \ 52 | 53 | # clean up 54 | apk del --purge build-deps && \ 55 | rm -rf /root/.cache /tmp/* 56 | 57 | COPY rootfs/ / 58 | 59 | # ports and volumes 60 | VOLUME ["/config", "/logs"] 61 | EXPOSE 8181 62 | -------------------------------------------------------------------------------- /docker/plexpy/Makefile: -------------------------------------------------------------------------------- 1 | IMAGE = swerpbox/plexpy 2 | TAG = latest 3 | 4 | clean: 5 | docker rmi $(IMAGE):$(TAG) $(CLEAN_OPTIONS) || true 6 | 7 | build: 8 | docker build -t $(IMAGE):$(TAG) $(BUILD_OPTIONS) . 9 | 10 | pull: 11 | docker pull $(IMAGE):$(TAG) $(PULL_OPTIONS) 12 | 13 | push: 14 | docker push $(IMAGE):$(TAG) 15 | -------------------------------------------------------------------------------- /docker/plexpy/rootfs/etc/cont-init.d/30-setup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bash 2 | 3 | # install plexpy 4 | [[ ! -d "/opt/plexpy/.git" ]] && \ 5 | git clone --branch "master" https://github.com/JonnyWong16/plexpy.git /opt/plexpy 6 | 7 | # permissions 8 | chown -R swerp:swerp /opt/plexpy 9 | -------------------------------------------------------------------------------- /docker/plexpy/rootfs/etc/services.d/plexpy/run: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bash 2 | 3 | exec s6-setuidgid swerp python /opt/plexpy/PlexPy.py --datadir /config 4 | -------------------------------------------------------------------------------- /docker/resilio-sync/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM swerpbox/alpine-base 2 | 3 | LABEL org.label-schema.vendor="SwerpBox: Resilio-Sync" \ 4 | org.label-schema.build-date="2017-01-27T00:12:00+00:00" \ 5 | org.label-schema.name="Resilio-Sync running on Alpine 3.5" \ 6 | org.label-schema.vcs-type="git" \ 7 | org.label-schema.vcs-url="https://github.com/strues/swerpbox" \ 8 | maintainer="Steven Truesdell " 9 | 10 | ARG RESILIO_LOC="https://download-cdn.resilio.com/stable/linux-x64/resilio-sync_x64.tar.gz" 11 | 12 | RUN \ 13 | apk --update upgrade && \ 14 | apk add curl tar ca-certificates libc6-compat && \ 15 | mkdir -p /lib64 /defaults && \ 16 | ln /lib/ld-linux-x86-64.so.2 /lib64/ld-linux-x86-64.so.2 && \ 17 | 18 | curl -o /tmp/sync.tar.gz -L ${RESILIO_LOC} && \ 19 | tar xf /tmp/sync.tar.gz -C /usr/bin && \ 20 | rm -rf /tmp/* 21 | 22 | VOLUME ["/config", "/data", "/media"] 23 | 24 | COPY /rootfs / 25 | COPY sync.conf /defaults 26 | 27 | EXPOSE 8888 55555 28 | -------------------------------------------------------------------------------- /docker/resilio-sync/Makefile: -------------------------------------------------------------------------------- 1 | IMAGE = swerpbox/resilio-sync 2 | TAG = latest 3 | 4 | clean: 5 | docker rmi $(IMAGE):$(TAG) $(CLEAN_OPTIONS) || true 6 | 7 | build: 8 | docker build -t $(IMAGE):$(TAG) $(BUILD_OPTIONS) . 9 | 10 | pull: 11 | docker pull $(IMAGE):$(TAG) $(PULL_OPTIONS) 12 | 13 | push: 14 | docker push $(IMAGE):$(TAG) 15 | -------------------------------------------------------------------------------- /docker/resilio-sync/rootfs/etc/cont-init.d/30-config: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bash 2 | 3 | [[ ! -e /config/sync.conf ]] && \ 4 | cp /defaults/sync.conf /config/sync.conf 5 | 6 | chown -R swerp:swerp /config 7 | chown swerp:swerp /data 8 | -------------------------------------------------------------------------------- /docker/resilio-sync/rootfs/etc/services.d/resilio/run: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bash 2 | 3 | exec s6-setuidgid swerp rslsync --nodaemon --config /config/sync.conf 4 | -------------------------------------------------------------------------------- /docker/resilio-sync/sync.conf: -------------------------------------------------------------------------------- 1 | { 2 | "listening_port" : 55555, 3 | "storage_path" : "/config", 4 | "vendor" : "docker", 5 | "display_new_version": false, 6 | "directory_root_policy" : "belowroot", 7 | "directory_root" : "/data/", 8 | 9 | "webui" : { 10 | "listen" : "0.0.0.0:8888", 11 | "allow_empty_password" : false, 12 | "dir_whitelist" : ["/data/folders", "/data/mounted_folders"] 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /docker/rutorrent/.dockerignore: -------------------------------------------------------------------------------- 1 | .git 2 | .gitignore 3 | README.md 4 | -------------------------------------------------------------------------------- /docker/rutorrent/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM swerpbox/alpine-base 2 | 3 | LABEL org.label-schema.vendor="SwerpBox: rTorrent/ruTorrent" \ 4 | org.label-schema.build-date="2017-02-12T00:12:00+00:00" \ 5 | org.label-schema.name="rTorrent and ruTorrent running on Alpine 3.5" \ 6 | org.label-schema.vcs-type="git" \ 7 | org.label-schema.vcs-url="https://github.com/strues/swerpbox" \ 8 | maintainer="Steven Truesdell " 9 | 10 | ARG BUILD_CORES 11 | ARG MEDIAINF_VER="0.7.90" 12 | ARG RTORRENT_VER="0.9.6" 13 | ARG LIBTORRENT_VER="0.13.6" 14 | ARG RUTORRENT_ADDR="https://github.com/Novik/ruTorrent/archive/master.tar.gz" 15 | # install runtime packages 16 | RUN \ 17 | apk add --no-cache \ 18 | ca-certificates \ 19 | curl \ 20 | fcgi \ 21 | ffmpeg \ 22 | geoip \ 23 | gzip \ 24 | dtach \ 25 | tar \ 26 | unrar \ 27 | unzip \ 28 | wget \ 29 | irssi \ 30 | irssi-perl \ 31 | libressl-dev \ 32 | zlib \ 33 | zlib-dev \ 34 | libxml2-dev \ 35 | perl-archive-zip \ 36 | perl-net-ssleay \ 37 | perl-digest-sha1 \ 38 | git \ 39 | zip && \ 40 | # php packages 41 | apk add --no-cache --repository http://nl.alpinelinux.org/alpine/edge/community \ 42 | php7 \ 43 | php7-cgi \ 44 | php7-fpm \ 45 | php7-json \ 46 | php7-mbstring \ 47 | php7-sockets \ 48 | php7-opcache \ 49 | php7-mcrypt \ 50 | php7-xmlrpc \ 51 | php7-pear && \ 52 | 53 | # install build packages 54 | apk add --no-cache --virtual=build-deps \ 55 | autoconf \ 56 | automake \ 57 | build-base \ 58 | subversion \ 59 | cppunit-dev \ 60 | curl-dev \ 61 | perl-dev \ 62 | file \ 63 | g++ \ 64 | gcc \ 65 | libtool \ 66 | make \ 67 | ncurses-dev && \ 68 | 69 | cd /tmp && \ 70 | git clone https://github.com/esmil/mktorrent && \ 71 | svn checkout http://svn.code.sf.net/p/xmlrpc-c/code/stable xmlrpc-c && \ 72 | git clone -b ${LIBTORRENT_VER} https://github.com/rakshasa/libtorrent.git && \ 73 | git clone -b ${RTORRENT_VER} https://github.com/rakshasa/rtorrent.git && \ 74 | cd /tmp/mktorrent && \ 75 | make -j ${BUILD_CORES-$(grep -c "processor" /proc/cpuinfo)} && \ 76 | make install && \ 77 | # install webui 78 | mkdir -p /var/www/public/rutorrent /defaults/rutorrent-conf && \ 79 | # install autodl-irssi perl modules 80 | perl -MCPAN -e 'my $c = "CPAN::HandleConfig"; $c->load(doit => 1, autoconfig => 1); $c->edit(prerequisites_policy => "follow"); $c->edit(build_requires_install_policy => "yes"); $c->commit' && \ 81 | curl -L http://cpanmin.us | perl - App::cpanminus && \ 82 | cpanm HTML::Entities XML::LibXML JSON JSON::XS && \ 83 | 84 | # compile mediainfo packages 85 | curl -o \ 86 | /tmp/libmediainfo.tar.gz -L \ 87 | "http://mediaarea.net/download/binary/libmediainfo0/${MEDIAINF_VER}/MediaInfo_DLL_${MEDIAINF_VER}_GNU_FromSource.tar.gz" && \ 88 | curl -o \ 89 | /tmp/mediainfo.tar.gz -L \ 90 | "http://mediaarea.net/download/binary/mediainfo/${MEDIAINF_VER}/MediaInfo_CLI_${MEDIAINF_VER}_GNU_FromSource.tar.gz" && \ 91 | 92 | mkdir -p /tmp/libmediainfo /tmp/mediainfo && \ 93 | 94 | tar xf /tmp/libmediainfo.tar.gz -C \ 95 | /tmp/libmediainfo --strip-components=1 && \ 96 | 97 | tar xf /tmp/mediainfo.tar.gz -C \ 98 | /tmp/mediainfo --strip-components=1 && \ 99 | 100 | cd /tmp/libmediainfo && ./SO_Compile.sh && \ 101 | 102 | cd /tmp/libmediainfo/ZenLib/Project/GNU/Library && \ 103 | make -j $(getconf _NPROCESSORS_ONLN) && \ 104 | make install && \ 105 | 106 | cd /tmp/libmediainfo/MediaInfoLib/Project/GNU/Library && \ 107 | make -j $(getconf _NPROCESSORS_ONLN) && \ 108 | make install && \ 109 | 110 | cd /tmp/mediainfo && ./CLI_Compile.sh && \ 111 | cd /tmp/mediainfo/MediaInfo/Project/GNU/CLI && \ 112 | make -j $(getconf _NPROCESSORS_ONLN) && \ 113 | make install && \ 114 | cd /tmp/xmlrpc-c && \ 115 | ./configure && \ 116 | make -j ${NB_CORES} && \ 117 | make install && \ 118 | cd /tmp/libtorrent && \ 119 | ./autogen.sh && \ 120 | ./configure && \ 121 | make -j ${BUILD_CORES-$(grep -c "processor" /proc/cpuinfo)} && \ 122 | make install && \ 123 | cd /tmp/rtorrent && \ 124 | ./autogen.sh && \ 125 | ./configure --with-xmlrpc-c && \ 126 | make -j ${BUILD_CORES-$(grep -c "processor" /proc/cpuinfo)} && \ 127 | make install && \ 128 | # cleanup 129 | apk del --purge build-deps && rm -rf /tmp/* 130 | 131 | # add local files 132 | COPY rootfs/ / 133 | 134 | # ports and volumes 135 | 136 | EXPOSE 49123 5000 137 | VOLUME ["/config", "/data", "/logs"] 138 | -------------------------------------------------------------------------------- /docker/rutorrent/Makefile: -------------------------------------------------------------------------------- 1 | IMAGE = swerpbox/rutorrent 2 | TAG = latest 3 | 4 | clean: 5 | docker rmi $(IMAGE):$(TAG) $(CLEAN_OPTIONS) || true 6 | 7 | build: 8 | docker build -t $(IMAGE):$(TAG) $(BUILD_OPTIONS) . 9 | 10 | pull: 11 | docker pull $(IMAGE):$(TAG) $(PULL_OPTIONS) 12 | 13 | push: 14 | docker push $(IMAGE):$(TAG) 15 | -------------------------------------------------------------------------------- /docker/rutorrent/rootfs/defaults/autodl.cfg: -------------------------------------------------------------------------------- 1 | [options] 2 | gui-server-port = 41812 3 | gui-server-password = password 4 | -------------------------------------------------------------------------------- /docker/rutorrent/rootfs/defaults/autodl2.cfg: -------------------------------------------------------------------------------- 1 | [options] 2 | rt-address = /run/php/.rtorrent.sock 3 | -------------------------------------------------------------------------------- /docker/rutorrent/rootfs/defaults/conf.php: -------------------------------------------------------------------------------- 1 | 7 | -------------------------------------------------------------------------------- /docker/rutorrent/rootfs/defaults/rtorrent.rc: -------------------------------------------------------------------------------- 1 | encoding_list = UTF-8 2 | system.umask.set = 002 3 | system.file.max_size.set = -1 4 | 5 | ## RPC connection 6 | execute.nothrow = rm,/run/php/.rtorrent.sock 7 | network.scgi.open_local = /run/php/.rtorrent.sock 8 | schedule = socket_chmod,0,0,"execute=chmod,0660,/run/php/.rtorrent.sock" 9 | schedule = socket_chgrp,0,0,"execute=chgrp,swerp,/run/php/.rtorrent.sock" 10 | 11 | # Instance layout (base paths) 12 | method.insert = cfg.basedir, private|const|string, (cat,"/data/") 13 | method.insert = cfg.watch, private|const|string, (cat,(cfg.basedir),"rtwatch/") 14 | method.insert = cfg.download, private|const|string, (cat,(cfg.basedir),"downloading/") 15 | method.insert = cfg.complete, private|const|string, (cat,(cfg.basedir),"complete") 16 | method.insert = cfg.logs, private|const|string, (cat,"/logs/rtorrent/") 17 | method.insert = cfg.logfile, private|const|string, (cat,(cfg.logs),"rtorrent-",(system.time),".log") 18 | 19 | # Tracker-less torrent and UDP tracker support 20 | # (conservative settings for 'private' trackers, change for 'public') 21 | dht.mode.set = disable 22 | protocol.pex.set = no 23 | trackers.use_udp.set = no 24 | trackers.numwant.set = 100 25 | 26 | # Peer settings 27 | # Maximum and minimum number of peers to connect to per torrent while downloading (applies to the 'slowup' throttle group). (min_peers, max_peers) 28 | throttle.min_peers.normal.set = 99 29 | throttle.max_peers.normal.set = 100 30 | throttle.min_peers.seed.set = -1 31 | throttle.max_peers.seed.set = -1 32 | 33 | # Maximum number of simultanious uploads per torrent. (upload slots!) (applies to the 'slowup' throttle group). (max_uploads) 34 | throttle.max_uploads.set = 15 35 | 36 | 37 | # Maximum number of simultaneous downloads and uploads slots (global slots!) (max_downloads_global, max_uploads_global) 38 | throttle.max_downloads.global.set = 300 39 | throttle.max_uploads.global.set = 300 40 | 41 | # Listening port for incoming peer traffic (fixed; you can also randomize it) 42 | network.port_range.set = 49123-49123 43 | network.port_random.set = no 44 | 45 | # Limits for file handle resources, this is optimized for 46 | # an `ulimit` of 1024 (a common default). You MUST leave 47 | # a ceiling of handles reserved for rTorrent's internal needs! 48 | network.http.max_open.set = 250 49 | network.max_open_files.set = 65000 50 | network.max_open_sockets.set = 600 51 | network.http.dns_cache_timeout.set = 25 52 | encryption = allow_incoming,try_outgoing,enable_retry 53 | 54 | # default for network.xmlrpc.size_limit : 524288 (xmlrpc_size_limit) 55 | network.xmlrpc.size_limit.set = 4M 56 | 57 | # Memory resource usage (increase if you have a large number of items loaded, 58 | # and/or the available resources to spend) 59 | pieces.memory.max.set = 8000M 60 | system.file_allocate.set = yes 61 | pieces.preload.type.set = 2 62 | pieces.preload.min_size.set = 262144 63 | pieces.preload.min_rate.set = 5120 64 | 65 | # Downloading directory default 66 | directory.default.set = (cat,(cfg.basedir),"downloading") 67 | 68 | # Session 69 | session = /config/rtorrent/rtorrent_sess 70 | 71 | 72 | download_rate = 0 73 | upload_rate = 0 74 | 75 | bind = 0.0.0.0 76 | 77 | check_hash = no 78 | use_udp_trackers = yes 79 | 80 | print = (cat,"directory.default ",(directory.default)) 81 | print = (cat,"Complete folfer ",(cfg.complete)) 82 | print = (cat,"Logging to ",(cfg.logfile)) 83 | log.open_file = "log", (cfg.logfile) 84 | log.add_output = "info", "log" 85 | 86 | # Watch a directory for new torrents, and stop those that have been deleted. 87 | schedule = watch_directory_0,5,5,"load.start=/data/rtwatch/*.torrent" 88 | #schedule = watch_directory_1,5,5,"load.start=/data/rtwatch/tvshows/*.torrent,d.set_custom1=tvshows,d.set_directory=/data/complete/tvshows" 89 | #schedule = watch_directory_2,5,5,"load.start=/data/rtwatch/movies/*.torrent,d.set_custom1=movies,set_directory=/data/complete/movies" 90 | #schedule = watch_directory_3,5,5,"load.start=/data/rtwatch/music/*.torrent,d.set_custom1=music,set_directory=/data/complete/music" 91 | #schedule = tied_directory,6,5,start_tied= 92 | schedule = untied_directory,5,5,stop_untied= 93 | 94 | # Close torrents when diskspace is low. 95 | schedule = low_diskspace,5,60,close_low_diskspace=100M 96 | 97 | # Add new method to get finished dir, and move files based on labels 98 | # system.method.insert = d.get_finished_dir,simple,"cat=/data/complete/,$d.get_custom1=" 99 | # system.method.set_key = event.download.finished,move_complete,"d.set_directory=$d.get_finished_dir=;execute=mkdir,-p,$d.get_finished_dir=;execute=mv,-u,$d.get_base_path=,$d.get_finished_dir=" 100 | 101 | 102 | execute = {sh,-c,/usr/bin/php7 /var/www/public/rutorrent/php/initplugins.php swerp &} 103 | -------------------------------------------------------------------------------- /docker/rutorrent/rootfs/defaults/rutorrent-conf/config.php: -------------------------------------------------------------------------------- 1 | '/usr/bin/php7', 32 | "curl" => '/usr/bin/curl', 33 | "gzip" => '/usr/bin/gzip', 34 | "id" => '/usr/bin/id', 35 | "stat" => '/bin/stat', 36 | ); 37 | 38 | $localhosts = array( 39 | "127.0.0.1", 40 | "localhost", 41 | ); 42 | $profilePath = '/var/www/public/rutorrent/profiles'; 43 | $profileMask = 0777; 44 | // $tempDirectory = '/config/rutorrent/profiles/tmp/'; 45 | $canUseXSendFile = true; 46 | 47 | $locale = "UTF8"; 48 | -------------------------------------------------------------------------------- /docker/rutorrent/rootfs/etc/cont-init.d/20-config: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bash 2 | 3 | # make folders 4 | mkdir -p \ 5 | /config{/php,/rtorrent/rtorrent_sess} \ 6 | /data{/complete,/downloading,/rtwatch} \ 7 | /data/rtwatch{/tvshows,/movies,/music} \ 8 | /run/php \ 9 | /logs/rtorrent 10 | 11 | 12 | [[ ! -d /var/www/public/rutorrent ]] && (git clone https://github.com/Novik/ruTorrent.git /var/www/public/rutorrent && \ 13 | chown -R swerp:swerp /var/www/public/rutorrent && chmod -R 775 /var/www/public/rutorrent/) 14 | 15 | [[ ! -e /config/rtorrent/rtorrent.rc ]] && \ 16 | cp /defaults/rtorrent.rc /config/rtorrent/rtorrent.rc 17 | 18 | if [ ! -e "/config/php/php.ini" ]; then 19 | cp /etc/php7/php.ini /config/php/php.ini 20 | sed -i -e 's/\(register_argc_argv .*=\).*/\1 On/g' /config/php/php.ini 21 | fi 22 | 23 | cp /config/php/php.ini /etc/php7/php.ini 24 | rm -rf /var/www/public/rutorrent/conf/config.php && cp /defaults/rutorrent-conf/config.php /var/www/public/rutorrent/conf/config.php 25 | # delete lock file if exists 26 | [[ -e /config/rtorrent/rtorrent_sess/rtorrent.lock ]] && \ 27 | rm /config/rtorrent/rtorrent_sess/rtorrent.lock 28 | 29 | # permissions 30 | chown -R swerp:swerp \ 31 | /data \ 32 | /data{/complete,/downloading,/rtwatch} 33 | 34 | chown -R swerp:swerp \ 35 | /config \ 36 | /run \ 37 | /logs 38 | -------------------------------------------------------------------------------- /docker/rutorrent/rootfs/etc/cont-init.d/30-getautodl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bash 2 | 3 | # create .autodl config dir and link 4 | [[ ! -d /config/.autodl ]] && (mkdir /config/.autodl && chown -R swerp:swerp /config/.autodl) 5 | 6 | [[ ! -d /home/swerp ]] && (mkdir /home/swerp && chown -R swerp:swerp /home/swerp) 7 | 8 | # get rutorrent plugin 9 | [[ ! -d /var/www/public/rutorrent/plugins/autodl-rutorrent/.git ]] && \ 10 | (git clone https://github.com/autodl-community/autodl-rutorrent.git /var/www/public/rutorrent/plugins/autodl-irssi && \ 11 | chown -R swerp:swerp /var/www/public/rutorrent/plugins/autodl-irssi/) 12 | 13 | # get autodl script for irssi 14 | [[ ! -d /config/.irssi/scripts/.git ]] && (mkdir -p /config/.irssi/scripts && \ 15 | git clone https://github.com/autodl-community/autodl-irssi.git /config/.irssi/scripts && \ 16 | mkdir /config/.irssi/scripts/autorun && \ 17 | ln -s /config/.irssi/scripts/autodl-irssi.pl /config/.irssi/scripts/autorun/autodl-irssi.pl && \ 18 | chown -R swerp:swerp /config/.irssi ) 19 | 20 | # get updated trackers for irssi-autodl 21 | wget --quiet -O /tmp/trackers.zip https://github.com/autodl-community/autodl-trackers/archive/master.zip && \ 22 | cd /config/.irssi/scripts/AutodlIrssi/trackers && \ 23 | unzip -q -o -j /tmp/trackers.zip && \ 24 | rm /tmp/trackers.zip 25 | 26 | # update rutorrent plugin 27 | cd /var/www/public/rutorrent/plugins/autodl-irssi/ || exit 28 | git pull 29 | chown -R swerp:swerp /var/www/public/rutorrent/plugins/autodl-irssi && \ 30 | mkdir -p /var/www/public/rutorrent/profiles/torrents && chown -R swerp:swerp /var/www/public/rutorrent/profiles/torrents 31 | 32 | # make sure perl is in irssi startup 33 | echo "load perl" > /config/.irssi/startup 34 | 35 | # symlink autodl/irssi folders to root 36 | ln -s /config/.autodl /root/.autodl 37 | ln -s /config/.irssi /root/.irssi 38 | chown -R swerp:swerp /root/.autodl 39 | chown -R swerp:swerp /root/.irssi 40 | 41 | # update autodl script for irssi 42 | cd /config/.irssi/scripts || exit 43 | git pull 44 | chown -R swerp:swerp /config/.irssi 45 | -------------------------------------------------------------------------------- /docker/rutorrent/rootfs/etc/cont-init.d/40-setconf: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bash 2 | 3 | # make folders 4 | mkdir -p /config/tmp /detach_sess 5 | 6 | [[ ! -L /home/swerp/.autodl ]] && ln -s /config/.autodl /home/swerp/.autodl 7 | 8 | [[ ! -L /config/.irssi/scripts/autorun/autodl-irssi.pl ]] && \ 9 | ln -s /config/.irssi/scripts/autodl-irssi.pl /config/.irssi/scripts/autorun/autodl-irssi.pl 10 | 11 | [[ ! -f /config/.autodl/autodl.cfg ]] && cp /defaults/autodl.cfg /config/.autodl/autodl.cfg 12 | 13 | [[ ! -f /config/.autodl/autodl2.cfg ]] && cp /defaults/autodl2.cfg /config/.autodl/autodl2.cfg 14 | 15 | [[ ! -f /var/www/public/rutorrent/plugins/autodl-irssi/conf.php ]] && \ 16 | cp /defaults/conf.php /var/www/public/rutorrent/plugins/autodl-irssi/conf.php 17 | 18 | # set perms 19 | chown swerp:swerp -R /config /detach_sess 20 | chown swerp:swerp -R /var/www/public/rutorrent/ 21 | chown swerp:swerp -R /data 22 | -------------------------------------------------------------------------------- /docker/rutorrent/rootfs/etc/php7/php-fpm.d/rutorrent.conf: -------------------------------------------------------------------------------- 1 | [rutorrent] 2 | user = swerp 3 | group = swerp 4 | listen = /run/php/php-fpm-rutorrent.sock 5 | listen.owner = swerp 6 | listen.group = swerp 7 | listen.mode = 0660 8 | pm = dynamic 9 | pm.max_children = 20 10 | pm.start_servers = 2 11 | pm.min_spare_servers = 2 12 | pm.max_spare_servers = 4 13 | catch_workers_output = yes 14 | chdir = /var/www/public/rutorrent 15 | -------------------------------------------------------------------------------- /docker/rutorrent/rootfs/etc/services.d/cron/run: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bash 2 | 3 | /usr/sbin/crond -f -S -l 0 -c /etc/crontabs 4 | -------------------------------------------------------------------------------- /docker/rutorrent/rootfs/etc/services.d/fpm/run: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bash 2 | /usr/sbin/php-fpm7 -F -y /etc/php7/php-fpm.d/rutorrent.conf 3 | 4 | -------------------------------------------------------------------------------- /docker/rutorrent/rootfs/etc/services.d/irssi/run: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bash 2 | 3 | if [ -f "/detach_sess/.irssi" ]; then 4 | rm -f /detach_sess/.irssi || true 5 | sleep 1s 6 | fi 7 | 8 | HOME=/config;dtach -n /detach_sess/.irssi s6-setuidgid swerp /usr/bin/irssi --home=/config/.irssi 1>/dev/null 9 | 10 | sleep 1s 11 | -------------------------------------------------------------------------------- /docker/rutorrent/rootfs/etc/services.d/rutorrent/run: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bash 2 | 3 | if [ -f "/detach_sess/.rtorrent" ]; then 4 | rm -f /detach_sess/.rtorrent || true 5 | sleep 1s 6 | fi 7 | 8 | dtach -n /detach_sess/.rtorrent s6-setuidgid swerp /usr/bin/rtorrent -n -o import=/config/rtorrent/rtorrent.rc 9 | 10 | until [ -e "/config/rtorrent/rtorrent_sess/rtorrent.lock" ]; 11 | do 12 | sleep 1s 13 | done 14 | 15 | rtorrent_pid=$(< /config/rtorrent/rtorrent_sess/rtorrent.lock | cut -d '+' -f 2) 16 | tail -n 1 -f /logs/rtorrent/rtorrent.log "$rtorrent_pid" 17 | -------------------------------------------------------------------------------- /docker/sickrage/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM swerpbox/alpine-base 2 | 3 | LABEL org.label-schema.vendor="SwerpBox: SickRage" \ 4 | org.label-schema.build-date="2017-01-27T00:12:00+00:00" \ 5 | org.label-schema.name="SickRage running on Alpine 3.5" \ 6 | org.label-schema.vcs-type="git" \ 7 | org.label-schema.vcs-url="https://github.com/strues/swerpbox" \ 8 | maintainer="Steven Truesdell " 9 | 10 | ARG SICK_REPO="https://github.com/SickRage/SickRage.git" 11 | ENV TERM="xterm" 12 | 13 | RUN \ 14 | apk -U upgrade && \ 15 | apk add --no-cache --virtual=build-deps make gcc g++ python-dev py2-pip libressl-dev libffi-dev && \ 16 | 17 | apk add --no-cache --virtual=run-deps ca-certificates unrar git python py-libxml2 py-lxml && \ 18 | 19 | pip --no-cache-dir install pyopenssl cheetah requirements && \ 20 | git clone --depth 2 ${SICK_REPO} /app/sickrage && \ 21 | 22 | # cleanup 23 | apk del --no-cache --purge build-deps && \ 24 | 25 | rm -rf /tmp/* /var/cache/apk/* /var/tmp/* 26 | 27 | # s6 scripts 28 | COPY rootfs/ / 29 | 30 | # ports and volumes 31 | VOLUME ["/config", "/logs", "/data", "/media"] 32 | EXPOSE 8081 33 | -------------------------------------------------------------------------------- /docker/sickrage/Makefile: -------------------------------------------------------------------------------- 1 | IMAGE = swerpbox/sickrage 2 | TAG = latest 3 | 4 | clean: 5 | docker rmi $(IMAGE):$(TAG) $(CLEAN_OPTIONS) || true 6 | 7 | build: 8 | docker build -t $(IMAGE):$(TAG) $(BUILD_OPTIONS) . 9 | 10 | pull: 11 | docker pull $(IMAGE):$(TAG) $(PULL_OPTIONS) 12 | 13 | push: 14 | docker push $(IMAGE):$(TAG) 15 | -------------------------------------------------------------------------------- /docker/sickrage/rootfs/etc/cont-init.d/30-setup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bash 2 | 3 | if [[ -d /app/sickrage/.git ]];then 4 | echo "Correcting permissions and updating Sickrage" 5 | cd /app/sickrage && git pull 6 | mkdir -p /logs/sickrage 7 | chown -R swerp:swerp /app /logs/sickrage 8 | fi 9 | -------------------------------------------------------------------------------- /docker/sickrage/rootfs/etc/services.d/sickrage/run: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bash 2 | 3 | umask 002 4 | 5 | exec s6-setuidgid swerp python /app/sickrage/SickBeard.py --datadir /config 6 | -------------------------------------------------------------------------------- /docker/sonarr/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM swerpbox/ubuntu-base 2 | 3 | LABEL org.label-schema.vendor="SwerpBox: Sonarr" \ 4 | org.label-schema.build-date="2017-03-15T00:10:00+00:00" \ 5 | org.label-schema.name="Sonarr running on Ubuntu" \ 6 | org.label-schema.vcs-type="git" \ 7 | org.label-schema.vcs-url="https://github.com/strues/swerpbox" \ 8 | maintainer="Steven Truesdell " 9 | 10 | ARG DEBIAN_FRONTEND="noninteractive" 11 | ENV XDG_CONFIG_HOME="/config/xdg" 12 | 13 | RUN \ 14 | apt-get update && apt-get install -y dirmngr && \ 15 | apt-key adv --keyserver keyserver.ubuntu.com --recv-keys FDA5DFFC && \ 16 | echo "deb http://apt.sonarr.tv/ develop main" > \ 17 | /etc/apt/sources.list.d/sonarr.list && \ 18 | 19 | # install packages 20 | apt-get update && \ 21 | apt-get install -y libcurl3 nzbdrone && \ 22 | 23 | # cleanup 24 | apt-get clean && \ 25 | rm -rf /tmp/* /var/lib/apt/lists/* /var/tmp/* 26 | 27 | # add local files 28 | COPY rootfs/ / 29 | 30 | # ports and volumes 31 | EXPOSE 8989 32 | VOLUME /config /downloads /tv /data 33 | -------------------------------------------------------------------------------- /docker/sonarr/Makefile: -------------------------------------------------------------------------------- 1 | IMAGE = swerpbox/sonarr 2 | TAG = latest 3 | 4 | clean: 5 | docker rmi $(IMAGE):$(TAG) $(CLEAN_OPTIONS) || true 6 | 7 | build: 8 | docker build -t $(IMAGE):$(TAG) . 9 | 10 | pull: 11 | docker pull $(IMAGE):$(TAG) $(PULL_OPTIONS) 12 | 13 | push: 14 | docker push $(IMAGE):$(TAG) 15 | -------------------------------------------------------------------------------- /docker/sonarr/rootfs/etc/cont-init.d/30-setup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bash 2 | 3 | # cleanup pid if it exists 4 | [[ -e /config/nzbdrone.pid ]] && rm -rf /config/nzbdrone.pid 5 | 6 | # permissions 7 | chown -R swerp:swerp /opt/NzbDrone 8 | -------------------------------------------------------------------------------- /docker/sonarr/rootfs/etc/services.d/sonarr/run: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bash 2 | 3 | umask 022 4 | 5 | cd /opt/NzbDrone || exit 6 | 7 | exec s6-setuidgid swerp mono --debug NzbDrone.exe -nobrowser -data=/config 8 | -------------------------------------------------------------------------------- /docs/advanced.md: -------------------------------------------------------------------------------- 1 | # Advanced 2 | 3 | 4 | > Want to run your SwerpBox with valid SSL certificates and reverse proxying to subdomains? Yeah... me too. 5 | 6 | Here's how we can make it happen: 7 | 8 | **Step 1** 9 | Go to where your DNS is hosted. Usually this is your domain registrar (where you bought it from). Create CNAME records 10 | for the services, which you want to run from subdomains (rutorrent, plex, deluge, sickrage, etc...) 11 | 12 | **Step 2** 13 | After the DNS propogates we need to generate the LetsEncrypt certificates. Make sure the DNS has fully propogated or else 14 | the validation will fail. 15 | 16 | On your webserver, go to the root of your SwerpBox. In this case the root is `/home/swerp/swerpbox`. 17 | 18 | Run the following command to generate certificates: 19 | 20 | ``` 21 | docker run --rm \ 22 | -p 80:80 \ 23 | -p 443:443 \ 24 | --name letsencrypt \ 25 | -v /home/swerp/swerpbox/srv/nginx/certs:/etc/letsencrypt \ 26 | -e "LETSENCRYPT_EMAIL=email@email.com" \ 27 | -e "LETSENCRYPT_DOMAIN1=yourdomain.com" \ 28 | -e "LETSENCRYPT_DOMAIN2=www.yourdomain.com" \ 29 | -e "LETSENCRYPT_DOMAIN3=rutorrent.yourdomain.com" \ 30 | -e "LETSENCRYPT_DOMAIN4=deluge.yourdomain.com" \ 31 | -e "LETSENCRYPT_DOMAIN5=plex.yourdomain.com" \ 32 | -e "LETSENCRYPT_DOMAIN6=plexpy.yourdomain.com" \ 33 | -e "LETSENCRYPT_DOMAIN7=sickrage.yourdomain.com" \ 34 | blacklabelops/letsencrypt install 35 | ``` 36 | 37 | Replace the `-e "LETSENCRYPT_EMAIL="email@email.com"` with your email address and all the **yourdomain.com** with your actual 38 | domain name. 39 | 40 | The certificates save to `/home/swerp/swerpbox/srv/nginx/certs` and are mounted inside the frontend container 41 | under `/etc/nginx/certs/archive/LETSENCRYPT_DOMAIN1/*.pem`. 42 | 43 | **Step 3** 44 | 45 | In the directory `srv/nginx/vhost.d` you'll want to modify the example configurations for each subdomain. 46 | 47 | If SickRage is running, stop it. Go to `config/sickrage` and edit `config.ini`. Find the line that says 48 | `handle_reverse_proxy` and change the 0 to a 1. Now start SickRage again. 49 | -------------------------------------------------------------------------------- /docs/assets/alpinelinux-logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | image/svg+xml -------------------------------------------------------------------------------- /docs/assets/deluge-dirs-after.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strues/swerpbox/6362c115cbf997e11e9f14a8d3bcee3312c6e920/docs/assets/deluge-dirs-after.png -------------------------------------------------------------------------------- /docs/assets/deluge-dirs-before.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strues/swerpbox/6362c115cbf997e11e9f14a8d3bcee3312c6e920/docs/assets/deluge-dirs-before.png -------------------------------------------------------------------------------- /docs/assets/sonarr-rtorrent-drone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strues/swerpbox/6362c115cbf997e11e9f14a8d3bcee3312c6e920/docs/assets/sonarr-rtorrent-drone.png -------------------------------------------------------------------------------- /docs/assets/sonarr-rtorrent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strues/swerpbox/6362c115cbf997e11e9f14a8d3bcee3312c6e920/docs/assets/sonarr-rtorrent.png -------------------------------------------------------------------------------- /docs/commands.md: -------------------------------------------------------------------------------- 1 | # Commands 2 | 3 | 4 | Display all containers running in a more readable format: 5 | 6 | ```bash 7 | clear && docker ps --format "table {{.ID}}\t{{.Names}}\t{{.Status}}\t{{.Image}}\t{{.Ports}}" && echo "" 8 | ``` 9 | 10 | Display all available commands: 11 | `make help` 12 | 13 | Bash is included in all containers for debugging purposes. You can enter a container and access its shell with the following: 14 | `docker exec -it /bin/bash` or `docker exec -it /bin/bash` 15 | -------------------------------------------------------------------------------- /docs/deluge.md: -------------------------------------------------------------------------------- 1 | # Deluge 2 | 3 | [![](https://images.microbadger.com/badges/image/swerpbox/deluge.svg)](https://microbadger.com/images/swerpbox/deluge "SwerpBox Deluge") [![](https://images.microbadger.com/badges/version/swerpbox/deluge.svg)](https://microbadger.com/images/swerpbox/deluge "SwerpBox Deluge") 4 | 5 | > This container runs the Deluge BitTorrent daemon and the web ui. To learn more, visit the [Deluge website](http://deluge-torrent.org). 6 | 7 | General Information 8 | ============= 9 | 10 | Deluge is accessible via: 11 | - http://YOUR.IP.ADDR.ESS/deluge 12 | - http://YOUR.IP.ADDR.ESS:8112 13 | 14 | 15 | Available variables: 16 | -------- 17 | 18 | - `TZ`: Your timezone. Default: **America/Denver** 19 | - `PUID`: User UID. Default: **1000** 20 | - `PGID`: User group id. Default: **1000** 21 | 22 | 23 | Configuring the directories 24 | ============ 25 | 26 | After starting Deluge for the first time, you must configure the directories for torrents. 27 | 28 | ![Before](assets/deluge-dirs-before.png) 29 | 30 | Make the following changes to the directories 31 | 32 | ![Before](assets/deluge-dirs-after.png) 33 | 34 | 35 | Adding ltConfig 36 | ======= 37 | 38 | Download the egg from [Github](https://github.com/ratanakvlun/deluge-ltconfig/releases/download/v0.2.5.0/ltConfig-0.2.5.0-py2.7.egg). 39 | 40 | In the Deluge Web UI go to preferences --> plugins and click add. Select the ltconfig.egg file you just downloaded. 41 | -------------------------------------------------------------------------------- /docs/frontend.md: -------------------------------------------------------------------------------- 1 | # Frontend 2 | 3 | 4 | [![](https://images.microbadger.com/badges/image/swerpbox/frontend.svg)](https://microbadger.com/images/swerpbox/frontend "SwerpBox Frontend") [![](https://images.microbadger.com/badges/version/swerpbox/frontend.svg)](https://microbadger.com/images/swerpbox/frontend "SwerpBox Frontend") 5 | 6 | > Nginx 1.11.8 compiled from source with Brotli compression and HTTP/2 support. 7 | 8 | The nginx default host configuration is setup for you. Located in `srv/nginx/vhost.d/site.conf`. See the advanced configuration below for specifics on 9 | how to setup reverse proxies for enabled services. 10 | 11 | **Available variables:** 12 | 13 | - `TZ`: Your timezone. Default: **America/Denver** 14 | - `PUID`: User UID. Default: **1000** 15 | - `PGID`: User group id. Default: **1000** 16 | 17 | **Volumes:** 18 | 19 | - `./srv/nginx:/etc/nginx`: Nginx configuration. 20 | - `./srv/public:/var/www/public`: Web root for the frontend. 21 | -------------------------------------------------------------------------------- /docs/overview.md: -------------------------------------------------------------------------------- 1 | # Overview 2 | 3 | > SwerpBox, a seedbox and media center combined with the power of 🐳 Docker. 4 | 5 | ## Prerequisites 6 | 7 | To run this application you need Docker Engine 1.10.0+ and Docker Compose with a version 1.6.0 or later. 8 | 9 | If you don't have Docker installed and are running Ubuntu or Debian, you may use the setup script, `setup-docker.sh`. It will install Docker and Docker Compose for you. 10 | 11 | `bash setup-docker.sh` 12 | 13 | 14 | ## Get Started 15 | 16 | Clone this repository or upload the contents of the repository to your web server. Where you place the SwerpBox files is where all the fun happens. I recommend working out of your home directory. 17 | 18 | Example: `/home//swerpbox` 19 | 20 | Create a copy of the environment variables file with `cp env_example .env` and fill in the information to match with your environment. 21 | 22 | The variables PGID, PUID, PLEX_UID, and PLEX_GUID must be set to the ids of the user running SwerpBox. If you aren't sure what the values of your user account are, you can find them by typing `id $(whoami)` on your server. 23 | 24 | The output will look like this: 25 | 26 | ``` 27 | uid=1000(swerp) gid=1000(swerp) groups=1000(swerp) 28 | ``` 29 | 30 | It is crucial to set PGID and PUID variables to the values matching the user running SwerpBox. 31 | 32 | **Note:** The file `buildall.sh` is meant for CI services. To start everything just run, `make start or docker-compose up -d` 33 | 34 | The `init.sh` script will create a user and group named swerp, set the GID and UID, and create the `.env` file for you. 35 | 36 | Running `make help` lists all commands available to you. 37 | 38 | 39 | ### Directory Structure 40 | 41 | ```bash 42 | docker/ 43 | ├── base 44 | ├── deluge 45 | ├── filebot 46 | ├── frontend 47 | ├── plexpy 48 | ├── rutorrent 49 | └── sonarr 50 | data/ 51 | ├── complete 52 | ├── downloading 53 | ├── dwatch 54 | └── rtwatch 55 | media/ 56 | ├── Movies 57 | └── TV Shows 58 | srv/ 59 | ├── nginx 60 | └── public 61 | config/ 62 | ├── deluge 63 | ├── frontend 64 | ├── php 65 | ├── plex 66 | ├── plexpy 67 | ├── resilio 68 | ├── rtorrent 69 | ├── rutorrent 70 | ├── rutorrent-nginx 71 | ├── sickrage 72 | ├── sonarr 73 | └── tmp 74 | logs/ 75 | ├── deluge 76 | ├── filebot 77 | ├── frontend 78 | ├── rtorrent 79 | ├── rutorrent 80 | └── rutorrent-nginx 81 | docker-compose.yml 82 | ``` 83 | -------------------------------------------------------------------------------- /docs/plex.md: -------------------------------------------------------------------------------- 1 | # Plex 2 | 3 | Uses the official Plex Docker image. Checkout the readme [here](https://github.com/plexinc/pms-docker) 4 | 5 | Plex is accessible via http://YOUR.IP.ADDR.ESS:3400/web 6 | 7 | The default library location is `./media` 8 | 9 | **Available variables:** 10 | 11 | - `TZ`: Your timezone. Default: **America/Denver** 12 | - `PLEX_CLAIM`: Plex claim token. Get it from: **https://plex.tv/claim** 13 | - `ADVERTISE_IP`: Server IP address for Plex. Default: **http://127.0.0.1:32400** 14 | - `PLEX_UID`: User UID. Default: **1000** 15 | - `PLEX_GID`: User group id. Default: **1000** 16 | - `CHANGE_CONFIG_DIR_OWNERSHIP`: Change directory ownership. Default: **false** 17 | -------------------------------------------------------------------------------- /docs/plexpy.md: -------------------------------------------------------------------------------- 1 | # PlexPy 2 | -------------------------------------------------------------------------------- /docs/resilio.md: -------------------------------------------------------------------------------- 1 | # Resilio Sync 2 | 3 | > Sync uses peer-to-peer technology to provide fast, private file sharing for teams and individuals. By skipping the cloud, transfers can be significantly faster because files take the shortest path between devices. Sync does not store your information on servers in the cloud, avoiding cloud privacy concerns. 4 | 5 | 6 | Web interface visible at http://YOUR.IP.ADDR.ESS:8888 7 | 8 | Directories mounted for sync in /data/ 9 | 10 | Available variables: 11 | 12 | - `TZ`: Your timezone. Default: **America/Denver** 13 | - `PUID`: User UID. Default: **1000** 14 | - `PGID`: User group id. Default: **1000** 15 | -------------------------------------------------------------------------------- /docs/rtorrent.md: -------------------------------------------------------------------------------- 1 | # rTorrent / ruTorrent 2 | 3 | [![](https://images.microbadger.com/badges/image/swerpbox/rutorrent.svg)](https://microbadger.com/images/swerpbox/rutorrent "SwerpBox ruTorrent") [![](https://images.microbadger.com/badges/version/swerpbox/rutorrent.svg)](https://microbadger.com/images/swerpbox/rutorrent "SwerpBox ruTorrent") 4 | 5 | 6 | > ruTorrent and rTorrent with Autodl-Irssi running on Alpine Linux. Compiled with Media Info 7 | 8 | Includes PHP7 and Nginx 1.10.5. 9 | 10 | RuTorrent is accessible via http://YOUR.IP.ADDR.ESS/rutorrent/ 11 | 12 | **Available variables:** 13 | 14 | - `TZ`: Your timezone. Default: **America/Denver** 15 | - `PUID`: User UID. Default: **1000** 16 | - `PGID`: User group id. Default: **1000** 17 | 18 | **Volumes:** 19 | 20 | - `./data:/data`: Location of saved files. 21 | - `./logs:/logs`: Logs for rutorrent-nginx, php and rTorrent. 22 | - `./config:/config`: Configs for php, rutorrent-nginx, rTorrent, irssi, and autodl. 23 | -------------------------------------------------------------------------------- /docs/sonarr.md: -------------------------------------------------------------------------------- 1 | # Sonarr 2 | 3 | 4 | > The Sonarr container runs on Ubuntu 16.04 via Mono 5 | 6 | Sonarr is accessible via http://YOUR.IP.ADDR.ESS:8989 7 | 8 | **Available variables:** 9 | 10 | - `TZ`: Your timezone. Default: **America/Denver** 11 | - `PUID`: User UID. Default: **1000** 12 | - `PGID`: User group id. Default: **1000** 13 | 14 | **Volumes:** 15 | 16 | - `./config/sonarr:/config`: Where the config files are stored. 17 | - `./data:/data`: Entire directory of all files. Used to mount the complete folder. 18 | - `./data/downloading:/downloads`: Where downloading torrents are located 19 | - `./media/TV Shows:/tv`: Location of media directory, where Plex reads from. Sonarr hardlinks complete files here. 20 | 21 | Setting up Sonarr to automatically use rTorrent to download files and automatically 22 | hardlink them to the organized media folder is easy. 23 | 24 | 1.Visit the Sonarr web interface. 25 | 2.Go to `Download Client` and click add. 26 | 3.Choose rTorrent and enter the settings shown in the screenshot. 27 | 28 | ![sonarr-rtorrent](assets/sonarr-rtorrent.png) 29 | 30 | 4.On the `Download Client` page, toward the bottom is the Drone configuration. Point the drone to watch `/data/complete`. 31 | 32 | ![sonarr-rtorrent](assets/sonarr-rtorrent-drone.png) 33 | -------------------------------------------------------------------------------- /env_example: -------------------------------------------------------------------------------- 1 | PGID=1000 2 | PUID=1000 3 | USERNAME=swerp 4 | PASSWORD=swerp 5 | TZ=America/Denver 6 | PLEX_CLAIM=Go to https://www.plex.tv/claim for the code 7 | ADVERTISE_IP=ServerIP 8 | PLEX_UID=1000 9 | PLEX_GID=1000 10 | CHANGE_CONFIG_DIR_OWNERSHIP=false 11 | -------------------------------------------------------------------------------- /setup-docker.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | function _init() { 4 | DISTRO=$(lsb_release -is) 5 | RELEASE=$(lsb_release -rs) 6 | CODENAME=$(lsb_release -cs) 7 | 8 | echo "SwerpBox Server Bootstrap" 9 | echo 10 | echo 11 | echo "Checking distribution ..." 12 | if [ ! -x /usr/bin/lsb_release ]; then 13 | echo "Detected $DISTRO, as your OS. Unfortunately it is not supported." 14 | echo "Exiting..." 15 | exit 1 16 | fi 17 | echo "$(lsb_release -a)" 18 | echo 19 | } 20 | 21 | function _permissions() { 22 | if [[ $EUID != 0 ]]; then 23 | echo "Please re-run this script as root." 24 | echo 'Exiting...' 25 | exit 1 26 | fi 27 | echo "Looks like you're the root user. Moving on..." 28 | echo 29 | } 30 | 31 | function _updates() { 32 | if [[ $DISTRO == Ubuntu ]]; then 33 | echo "Package updates started..." 34 | apt-get update && apt-get -qqy upgrade 35 | else 36 | echo "Detected $DISTRO, as your OS. Unfortunately it is not supported. Yet." 37 | echo "Exiting..." 38 | exit 1 39 | fi 40 | if [[ $DISTRO == Debian ]]; then 41 | echo "Package updates started..." 42 | apt-get update && apt-get -qqy upgrade 43 | else 44 | echo "Detected $DISTRO, as your OS. Unfortunately it is not supported. Yet." 45 | echo "Exiting..." 46 | exit 1 47 | fi 48 | } 49 | 50 | 51 | function _installLinux() { 52 | echo "Installing packages..." 53 | apt-get install -qqy apt-transport-https ca-certificates 54 | 55 | apt-key adv \ 56 | --keyserver hkp://ha.pool.sks-keyservers.net:80 \ 57 | --recv-keys 58118E89F3A912897C070ADBF76221572C52609D 58 | 59 | apt-get install linux-image-extra-$(uname -r) linux-image-extra-virtual 60 | } 61 | 62 | 63 | function _installDocker() { 64 | echo "Installing Docker..." 65 | curl -sSL https://get.docker.com/ | sh 66 | } 67 | 68 | 69 | function _installCompose() { 70 | echo "Installing Docker Compose..." 71 | curl -L "https://github.com/docker/compose/releases/download/1.9.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose 72 | chmod +x /usr/local/bin/docker-compose 73 | docker-compose --version 74 | } 75 | 76 | function _done() { 77 | echo "All set up" 78 | exit 0 79 | } 80 | 81 | _init 82 | _permissions 83 | _updates 84 | _installLinux 85 | _installDocker 86 | _installCompose 87 | _done 88 | -------------------------------------------------------------------------------- /srv/nginx/cfgs/cache/extension.conf: -------------------------------------------------------------------------------- 1 | 2 | location ~* ^.+\.(jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ { 3 | expires 30d; 4 | add_header Vary Accept-Encoding; 5 | access_log off; 6 | if_modified_since before; 7 | } 8 | -------------------------------------------------------------------------------- /srv/nginx/cfgs/cache/static.conf: -------------------------------------------------------------------------------- 1 | location ~ ^/static/ { 2 | expires 30d; 3 | add_header Vary Accept-Encoding; 4 | access_log off; 5 | if_modified_since before; 6 | } 7 | -------------------------------------------------------------------------------- /srv/nginx/cfgs/misc/acme.conf: -------------------------------------------------------------------------------- 1 | location /.well-known/acme-challenge/ { 2 | root /data/acme/challenges; 3 | access_log off; 4 | try_files $uri =404; 5 | break; 6 | } 7 | -------------------------------------------------------------------------------- /srv/nginx/cfgs/misc/no-robots.conf: -------------------------------------------------------------------------------- 1 | location /robots.txt { 2 | add_header Content-Type text/plain; 3 | return 200 "User-agent: *\nDisallow: /\n"; 4 | } 5 | -------------------------------------------------------------------------------- /srv/nginx/cfgs/proxy/headers.conf: -------------------------------------------------------------------------------- 1 | proxy_set_header Host $http_host; 2 | proxy_set_header X-Real-IP $remote_addr; 3 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 4 | proxy_set_header X-Forwarded-Proto $scheme; 5 | proxy_set_header Proxy ""; # block Proxy header to prevent httpoxy.org 6 | -------------------------------------------------------------------------------- /srv/nginx/cfgs/proxy/params.conf: -------------------------------------------------------------------------------- 1 | proxy_connect_timeout 59s; 2 | proxy_send_timeout 600; 3 | proxy_read_timeout 600; 4 | proxy_buffer_size 64k; 5 | proxy_buffers 16 32k; 6 | proxy_pass_header Set-Cookie; 7 | proxy_hide_header Vary; 8 | 9 | proxy_busy_buffers_size 64k; 10 | proxy_temp_file_write_size 64k; 11 | 12 | proxy_ignore_headers Cache-Control Expires; 13 | 14 | proxy_redirect default; 15 | port_in_redirect off; 16 | -------------------------------------------------------------------------------- /srv/nginx/cfgs/proxy_common.conf: -------------------------------------------------------------------------------- 1 | proxy_connect_timeout 59s; 2 | proxy_send_timeout 600; 3 | proxy_read_timeout 600; 4 | proxy_buffer_size 64k; 5 | proxy_buffers 16 32k; 6 | proxy_pass_header Set-Cookie; 7 | proxy_hide_header Vary; 8 | 9 | proxy_busy_buffers_size 64k; 10 | proxy_temp_file_write_size 64k; 11 | 12 | proxy_set_header Accept-Encoding ''; 13 | proxy_ignore_headers Cache-Control Expires; 14 | proxy_set_header Referer $http_referer; 15 | proxy_set_header Host $host; 16 | proxy_set_header Cookie $http_cookie; 17 | proxy_set_header X-Real-IP $remote_addr; 18 | proxy_set_header X-Forwarded-Host $host; 19 | proxy_set_header X-Forwarded-Server $host; 20 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 21 | 22 | proxy_set_header X-Forwarded-Port '443'; 23 | proxy_set_header X-Forwarded-Ssl on; 24 | proxy_set_header X-Forwarded-Proto https; 25 | proxy_set_header Authorization ''; 26 | 27 | proxy_redirect default; 28 | port_in_redirect off; 29 | -------------------------------------------------------------------------------- /srv/nginx/cfgs/security/deny-locations.conf: -------------------------------------------------------------------------------- 1 | # deny access to .htaccess files, if Apache's document root 2 | # concurs with nginx's one 3 | location ~ (/.ht|/.git/) { 4 | deny all; 5 | } 6 | -------------------------------------------------------------------------------- /srv/nginx/cfgs/security/headers.conf: -------------------------------------------------------------------------------- 1 | #headers that should served over http (will be sent over https too) 2 | 3 | add_header X-Content-Type-Options "nosniff"; 4 | add_header X-Frame-Options "SAMEORIGIN"; 5 | add_header X-XSS-Protection "1; mode=block"; 6 | 7 | add_header Referrer-Policy "no-referrer, strict-origin-when-cross-origin"; 8 | -------------------------------------------------------------------------------- /srv/nginx/cfgs/security/ssl-headers.conf: -------------------------------------------------------------------------------- 1 | 2 | #headers that only should be served over https (includes headers that would be served over http) 3 | 4 | add_header Content-Security-Policy "upgrade-insecure-requests; block-all-mixed-content; reflected-xss block; report-uri https://vsund.report-uri.io/r/default/csp/enforce;"; 5 | add_header X-Content-Security-Policy "upgrade-insecure-requests; block-all-mixed-content; reflected-xss block; report-uri https://vsund.report-uri.io/r/default/csp/enforce;"; 6 | 7 | include /etc/nginx/cfgs/security/headers.conf; 8 | -------------------------------------------------------------------------------- /srv/nginx/cfgs/ssl/ssl.conf: -------------------------------------------------------------------------------- 1 | ssl_protocols TLSv1.2; 2 | ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256'; 3 | ssl_prefer_server_ciphers on; 4 | # Size of buffer: 1400 bytes = 1 MTU 5 | 6 | ssl_buffer_size 1400; 7 | ssl_ecdh_curve secp384r1; 8 | ssl_session_tickets on; 9 | ssl_session_timeout 24h; 10 | ssl_session_cache shared:SSL:10m; 11 | # SSL Stapling 12 | ssl_stapling on; 13 | ssl_stapling_verify on; 14 | -------------------------------------------------------------------------------- /srv/nginx/cfgs/upstream/deluge.conf: -------------------------------------------------------------------------------- 1 | upstream deluge { 2 | server sb-deluge:8112; 3 | } 4 | -------------------------------------------------------------------------------- /srv/nginx/cfgs/upstream/plex.conf: -------------------------------------------------------------------------------- 1 | upstream plex { 2 | server sb-plex:32400; 3 | } 4 | -------------------------------------------------------------------------------- /srv/nginx/cfgs/upstream/plexpy.conf: -------------------------------------------------------------------------------- 1 | 2 | upstream plexpy { 3 | server sb-plexpy:8181; 4 | } 5 | -------------------------------------------------------------------------------- /srv/nginx/cfgs/upstream/rutorrent.conf: -------------------------------------------------------------------------------- 1 | 2 | upstream backend_rutorrent { 3 | server unix:/run/php/php-fpm-rutorrent.sock; 4 | } 5 | upstream backend_rtorrent { 6 | server unix:/run/php/.rtorrent.sock; 7 | } 8 | -------------------------------------------------------------------------------- /srv/nginx/cfgs/upstream/sickrage.conf: -------------------------------------------------------------------------------- 1 | 2 | upstream sickrage { 3 | server sb-sickrage:8081; 4 | } 5 | -------------------------------------------------------------------------------- /srv/nginx/cfgs/upstream/sonarr.conf: -------------------------------------------------------------------------------- 1 | upstream sonarr { 2 | server sb-sonarr:8989; 3 | } 4 | -------------------------------------------------------------------------------- /srv/nginx/fastcgi.conf: -------------------------------------------------------------------------------- 1 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 2 | fastcgi_param QUERY_STRING $query_string; 3 | fastcgi_param REQUEST_METHOD $request_method; 4 | fastcgi_param CONTENT_TYPE $content_type; 5 | fastcgi_param CONTENT_LENGTH $content_length; 6 | 7 | fastcgi_param SCRIPT_NAME $fastcgi_script_name; 8 | fastcgi_param REQUEST_URI $request_uri; 9 | fastcgi_param DOCUMENT_URI $document_uri; 10 | fastcgi_param DOCUMENT_ROOT $document_root; 11 | fastcgi_param SERVER_PROTOCOL $server_protocol; 12 | fastcgi_param REQUEST_SCHEME $scheme; 13 | fastcgi_param HTTPS $https if_not_empty; 14 | 15 | fastcgi_param GATEWAY_INTERFACE CGI/1.1; 16 | fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; 17 | 18 | fastcgi_param REMOTE_ADDR $remote_addr; 19 | fastcgi_param REMOTE_PORT $remote_port; 20 | fastcgi_param SERVER_ADDR $server_addr; 21 | fastcgi_param SERVER_PORT $server_port; 22 | fastcgi_param SERVER_NAME $server_name; 23 | 24 | # PHP only, required if PHP was built with --enable-force-cgi-redirect 25 | fastcgi_param REDIRECT_STATUS 200; 26 | -------------------------------------------------------------------------------- /srv/nginx/fastcgi_params: -------------------------------------------------------------------------------- 1 | fastcgi_param CONTENT_LENGTH $content_length; 2 | fastcgi_param CONTENT_TYPE $content_type; 3 | fastcgi_param DOCUMENT_ROOT $document_root; 4 | fastcgi_param DOCUMENT_URI $document_uri; 5 | fastcgi_param GATEWAY_INTERFACE CGI/1.1; 6 | fastcgi_param HTTPS $https if_not_empty; 7 | fastcgi_param PATH_INFO $fastcgi_path_info; 8 | fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; 9 | fastcgi_param QUERY_STRING $query_string; 10 | fastcgi_param REMOTE_ADDR $remote_addr; 11 | fastcgi_param REMOTE_PORT $remote_port; 12 | fastcgi_param REQUEST_BODY $request_body; 13 | fastcgi_param REQUEST_BODY_FILE $request_body_file; 14 | fastcgi_param REQUEST_METHOD $request_method; 15 | fastcgi_param REQUEST_PATH $uri; 16 | fastcgi_param REQUEST_URI $request_uri; 17 | fastcgi_param SCHEME $scheme; 18 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 19 | fastcgi_param SCRIPT_NAME $fastcgi_script_name; 20 | fastcgi_param SERVER_ADDR $server_addr; 21 | fastcgi_param SERVER_NAME $server_name; 22 | fastcgi_param SERVER_PORT $server_port; 23 | fastcgi_param SERVER_PROTOCOL $server_protocol; 24 | fastcgi_param SERVER_SOFTWARE nginx; 25 | fastcgi_param SSL_CLIENT_VERIFY $ssl_client_verify if_not_empty; 26 | fastcgi_param SSL_SESSION_ID $ssl_session_id if_not_empty; 27 | -------------------------------------------------------------------------------- /srv/nginx/mime.types: -------------------------------------------------------------------------------- 1 | types { 2 | text/html html htm shtml; 3 | text/css css; 4 | text/xml xml; 5 | image/gif gif; 6 | image/jpeg jpeg jpg; 7 | application/javascript js; 8 | application/atom+xml atom; 9 | application/rss+xml rss; 10 | 11 | text/mathml mml; 12 | text/plain txt; 13 | text/vnd.sun.j2me.app-descriptor jad; 14 | text/vnd.wap.wml wml; 15 | text/x-component htc; 16 | 17 | image/png png; 18 | image/tiff tif tiff; 19 | image/vnd.wap.wbmp wbmp; 20 | image/x-icon ico; 21 | image/x-jng jng; 22 | image/x-ms-bmp bmp; 23 | image/svg+xml svg svgz; 24 | image/webp webp; 25 | 26 | application/font-woff woff; 27 | application/java-archive jar war ear; 28 | application/json json; 29 | application/mac-binhex40 hqx; 30 | application/msword doc; 31 | application/pdf pdf; 32 | application/postscript ps eps ai; 33 | application/rtf rtf; 34 | application/vnd.apple.mpegurl m3u8; 35 | application/vnd.ms-excel xls; 36 | application/vnd.ms-fontobject eot; 37 | application/vnd.ms-powerpoint ppt; 38 | application/vnd.wap.wmlc wmlc; 39 | application/vnd.google-earth.kml+xml kml; 40 | application/vnd.google-earth.kmz kmz; 41 | application/x-7z-compressed 7z; 42 | application/x-cocoa cco; 43 | application/x-java-archive-diff jardiff; 44 | application/x-java-jnlp-file jnlp; 45 | application/x-makeself run; 46 | application/x-perl pl pm; 47 | application/x-pilot prc pdb; 48 | application/x-rar-compressed rar; 49 | application/x-redhat-package-manager rpm; 50 | application/x-sea sea; 51 | application/x-shockwave-flash swf; 52 | application/x-stuffit sit; 53 | application/x-tcl tcl tk; 54 | application/x-x509-ca-cert der pem crt; 55 | application/x-xpinstall xpi; 56 | application/xhtml+xml xhtml; 57 | application/xspf+xml xspf; 58 | application/zip zip; 59 | 60 | application/octet-stream bin exe dll; 61 | application/octet-stream deb; 62 | application/octet-stream dmg; 63 | application/octet-stream iso img; 64 | application/octet-stream msi msp msm; 65 | 66 | application/vnd.openxmlformats-officedocument.wordprocessingml.document docx; 67 | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx; 68 | application/vnd.openxmlformats-officedocument.presentationml.presentation pptx; 69 | 70 | audio/midi mid midi kar; 71 | audio/mpeg mp3; 72 | audio/ogg ogg; 73 | audio/x-m4a m4a; 74 | audio/x-realaudio ra; 75 | 76 | video/3gpp 3gpp 3gp; 77 | video/mp2t ts; 78 | video/mp4 mp4; 79 | video/mpeg mpeg mpg; 80 | video/quicktime mov; 81 | video/webm webm; 82 | video/x-flv flv; 83 | video/x-m4v m4v; 84 | video/x-mng mng; 85 | video/x-ms-asf asx asf; 86 | video/x-ms-wmv wmv; 87 | video/x-msvideo avi; 88 | } 89 | -------------------------------------------------------------------------------- /srv/nginx/nginx.conf: -------------------------------------------------------------------------------- 1 | worker_processes auto; 2 | pid /run/nginx.pid; 3 | daemon off; 4 | 5 | events { 6 | worker_connections 4096; 7 | use epoll; 8 | multi_accept on; 9 | } 10 | 11 | http { 12 | include /etc/nginx/mime.types; 13 | default_type application/octet-stream; 14 | 15 | 16 | log_format main '$remote_addr - $remote_user [$time_local] "$request" ' 17 | '$status $body_bytes_sent "$http_referer" ' 18 | '"$http_user_agent" "$http_x_forwarded_for"'; 19 | 20 | access_log /logs/frontend/nginx-access.log main; 21 | error_log /logs/frontend/nginx-error.log error; 22 | 23 | server_tokens off; 24 | sendfile on; 25 | tcp_nopush on; 26 | tcp_nodelay on; 27 | keepalive_timeout 15; 28 | types_hash_max_size 2048; 29 | client_max_body_size 5M; 30 | open_file_cache max=100; 31 | 32 | ssl_protocols TLSv1 TLSv1.1 TLSv1.2; 33 | ssl_ciphers 'ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS'; 34 | 35 | auth_basic "Restricted"; 36 | auth_basic_user_file .htpasswd; 37 | resolver 127.0.0.11; 38 | 39 | aio threads; 40 | 41 | limit_conn_zone $binary_remote_addr zone=limit_per_ip:10m; 42 | limit_conn limit_per_ip 40; 43 | 44 | limit_req_zone $binary_remote_addr zone=allips:10m rate=400r/s; 45 | limit_req zone=allips burst=400 nodelay; 46 | 47 | include /etc/nginx/vhost.d/*.conf; 48 | } 49 | -------------------------------------------------------------------------------- /srv/nginx/scgi_params: -------------------------------------------------------------------------------- 1 | scgi_param REQUEST_METHOD $request_method; 2 | scgi_param REQUEST_URI $request_uri; 3 | scgi_param QUERY_STRING $query_string; 4 | scgi_param CONTENT_TYPE $content_type; 5 | 6 | scgi_param DOCUMENT_URI $document_uri; 7 | scgi_param DOCUMENT_ROOT $document_root; 8 | scgi_param SCGI 1; 9 | scgi_param SERVER_PROTOCOL $server_protocol; 10 | scgi_param REQUEST_SCHEME $scheme; 11 | scgi_param HTTPS $https if_not_empty; 12 | 13 | scgi_param REMOTE_ADDR $remote_addr; 14 | scgi_param REMOTE_PORT $remote_port; 15 | scgi_param SERVER_PORT $server_port; 16 | scgi_param SERVER_NAME $server_name; 17 | -------------------------------------------------------------------------------- /srv/nginx/uwsgi_params: -------------------------------------------------------------------------------- 1 | uwsgi_param QUERY_STRING $query_string; 2 | uwsgi_param REQUEST_METHOD $request_method; 3 | uwsgi_param CONTENT_TYPE $content_type; 4 | uwsgi_param CONTENT_LENGTH $content_length; 5 | 6 | uwsgi_param REQUEST_URI $request_uri; 7 | uwsgi_param PATH_INFO $document_uri; 8 | uwsgi_param DOCUMENT_ROOT $document_root; 9 | uwsgi_param SERVER_PROTOCOL $server_protocol; 10 | uwsgi_param REQUEST_SCHEME $scheme; 11 | uwsgi_param HTTPS $https if_not_empty; 12 | 13 | uwsgi_param REMOTE_ADDR $remote_addr; 14 | uwsgi_param REMOTE_PORT $remote_port; 15 | uwsgi_param SERVER_PORT $server_port; 16 | uwsgi_param SERVER_NAME $server_name; 17 | -------------------------------------------------------------------------------- /srv/nginx/vhost.d/deluge.tmpl: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80; 3 | listen [::]:80; 4 | server_name deluge.YOURDOMAIN.TLD; 5 | 6 | return 301 https://deluge.YOURDOMAIN.TLD$request_uri; 7 | } 8 | 9 | server { 10 | listen 443 ssl http2; 11 | listen [::]:443 ssl http2; 12 | server_name deluge.YOURDOMAIN.TLD; 13 | 14 | 15 | ## SSL 16 | ## ------------------ 17 | ssl_certificate /etc/nginx/certs/archive/LETSENCRYPTDOMAIN1/fullchain1.pem; 18 | ssl_certificate_key /etc/nginx/certs/archive/LETSENCRYPTDOMAIN1/privkey1.pem; 19 | ssl_dhparam /etc/nginx/certs/dhparam.pem; 20 | 21 | include /etc/nginx/cfgs/ssl/ssl.conf; 22 | 23 | ssl_session_ticket_key /etc/nginx/certs/ticket.key; 24 | ssl_trusted_certificate /etc/nginx/certs/archive/LETSENCRYPTDOMAIN1/fullchain1.pem; 25 | 26 | include /etc/nginx/cfgs/security/ssl-headers.conf; 27 | 28 | ## Brotli 29 | ## ------------------ 30 | brotli on; 31 | brotli_static on; 32 | brotli_min_length 1000; 33 | brotli_buffers 32 8k; 34 | brotli_comp_level 5; 35 | brotli_types *; 36 | 37 | location / { 38 | 39 | proxy_pass http://deluge/; 40 | proxy_set_header X-Deluge-Base "/"; 41 | add_header X-Frame-Options SAMEORIGIN; 42 | include /etc/nginx/cfgs/proxy/headers.conf; 43 | include /etc/nginx/cfgs/proxy/params.conf; 44 | } 45 | 46 | } 47 | include /etc/nginx/cfgs/upstream/deluge.conf; 48 | -------------------------------------------------------------------------------- /srv/nginx/vhost.d/plex.tmpl: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80; 3 | listen [::]:80; 4 | server_name plex.YOURDOMAIN.TLD; 5 | 6 | return 301 https://plex.YOURDOMAIN.TLD$request_uri; 7 | } 8 | 9 | server { 10 | listen 443 ssl http2; 11 | listen [::]:443 ssl http2; 12 | server_name plex.YOURDOMAIN.TLD; 13 | 14 | 15 | ## SSL 16 | ## ------------------ 17 | ssl_certificate /etc/nginx/certs/archive/LETSENCRYPTDOMAIN1/fullchain1.pem; 18 | ssl_certificate_key /etc/nginx/certs/archive/LETSENCRYPTDOMAIN1/privkey1.pem; 19 | ssl_dhparam /etc/nginx/certs/dhparam.pem; 20 | 21 | include /etc/nginx/cfgs/ssl/ssl.conf; 22 | 23 | ssl_session_ticket_key /etc/nginx/certs/ticket.key; 24 | ssl_trusted_certificate /etc/nginx/certs/archive/LETSENCRYPTDOMAIN1/fullchain1.pem; 25 | 26 | include /etc/nginx/cfgs/security/ssl-headers.conf; 27 | 28 | ## Brotli 29 | ## ------------------ 30 | brotli on; 31 | brotli_static on; 32 | brotli_min_length 1000; 33 | brotli_buffers 32 8k; 34 | brotli_comp_level 5; 35 | brotli_types *; 36 | 37 | location / { 38 | 39 | proxy_pass http://plex/; 40 | 41 | include /etc/nginx/cfgs/proxy/headers.conf; 42 | include /etc/nginx/cfgs/proxy/params.conf; 43 | } 44 | 45 | } 46 | include /etc/nginx/cfgs/upstream/plex.conf; 47 | -------------------------------------------------------------------------------- /srv/nginx/vhost.d/plexpy.tmpl: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80; 3 | listen [::]:80; 4 | server_name plexpy.YOURDOMAIN.TLD; 5 | 6 | return 301 https://plexpy.YOURDOMAIN.TLD$request_uri; 7 | } 8 | 9 | server { 10 | listen 443 ssl http2; 11 | listen [::]:443 ssl http2; 12 | server_name plexpy.YOURDOMAIN.TLD; 13 | 14 | 15 | ## SSL 16 | ## ------------------ 17 | ssl_certificate /etc/nginx/certs/archive/LETSENCRYPTDOMAIN1/fullchain1.pem; 18 | ssl_certificate_key /etc/nginx/certs/archive/LETSENCRYPTDOMAIN1/privkey1.pem; 19 | ssl_dhparam /etc/nginx/certs/dhparam.pem; 20 | 21 | include /etc/nginx/cfgs/ssl/ssl.conf; 22 | 23 | ssl_session_ticket_key /etc/nginx/certs/ticket.key; 24 | ssl_trusted_certificate /etc/nginx/certs/archive/LETSENCRYPTDOMAIN1/fullchain1.pem; 25 | 26 | include /etc/nginx/cfgs/security/ssl-headers.conf; 27 | 28 | ## Brotli 29 | ## ------------------ 30 | brotli on; 31 | brotli_static on; 32 | brotli_min_length 1000; 33 | brotli_buffers 32 8k; 34 | brotli_comp_level 5; 35 | brotli_types *; 36 | 37 | location / { 38 | 39 | proxy_pass http://plexpy/; 40 | 41 | include /etc/nginx/cfgs/proxy/headers.conf; 42 | include /etc/nginx/cfgs/proxy/params.conf; 43 | } 44 | 45 | } 46 | include /etc/nginx/cfgs/upstream/plexpy.conf; 47 | -------------------------------------------------------------------------------- /srv/nginx/vhost.d/rutorrent.tmpl: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80; 3 | listen [::]:80; 4 | server_name rutorrent.YOURDOMAIN.TLD; 5 | 6 | return 301 https://rutorrent.YOURDOMAIN.TLD$request_uri; 7 | } 8 | 9 | server { 10 | listen 443 ssl http2; 11 | listen [::]:443 ssl http2; 12 | server_name rutorrent.YOURDOMAIN.TLD; 13 | 14 | 15 | ## SSL 16 | ## ------------------ 17 | ssl_certificate /etc/nginx/certs/archive/LETSENCRYPTDOMAIN1/fullchain1.pem; 18 | ssl_certificate_key /etc/nginx/certs/archive/LETSENCRYPTDOMAIN1/privkey1.pem; 19 | ssl_dhparam /etc/nginx/certs/dhparam.pem; 20 | 21 | include /etc/nginx/cfgs/ssl/ssl.conf; 22 | 23 | ssl_session_ticket_key /etc/nginx/certs/ticket.key; 24 | ssl_trusted_certificate /etc/nginx/certs/archive/LETSENCRYPTDOMAIN1/fullchain1.pem; 25 | 26 | include /etc/nginx/cfgs/security/ssl-headers.conf; 27 | 28 | ## Brotli 29 | ## ------------------ 30 | brotli on; 31 | brotli_static on; 32 | brotli_min_length 1000; 33 | brotli_buffers 32 8k; 34 | brotli_comp_level 5; 35 | brotli_types *; 36 | 37 | location / { 38 | 39 | proxy_pass http://rutorrent/; 40 | 41 | include /etc/nginx/cfgs/proxy/headers.conf; 42 | include /etc/nginx/cfgs/proxy/params.conf; 43 | } 44 | 45 | } 46 | include /etc/nginx/cfgs/upstream/rutorrent.conf; 47 | -------------------------------------------------------------------------------- /srv/nginx/vhost.d/sickrage.tmpl: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80; 3 | listen [::]:80; 4 | server_name sickrage.YOURDOMAIN.TLD; 5 | 6 | return 301 https://sickrage.YOURDOMAIN.TLD$request_uri; 7 | } 8 | 9 | server { 10 | listen 443 ssl http2; 11 | listen [::]:443 ssl http2; 12 | server_name sickrage.YOURDOMAIN.TLD; 13 | 14 | 15 | ## SSL 16 | ## ------------------ 17 | ssl_certificate /etc/nginx/certs/archive/LETSENCRYPTDOMAIN1/fullchain1.pem; 18 | ssl_certificate_key /etc/nginx/certs/archive/LETSENCRYPTDOMAIN1/privkey1.pem; 19 | ssl_dhparam /etc/nginx/certs/dhparam.pem; 20 | 21 | include /etc/nginx/cfgs/ssl/ssl.conf; 22 | 23 | ssl_session_ticket_key /etc/nginx/certs/ticket.key; 24 | ssl_trusted_certificate /etc/nginx/certs/archive/LETSENCRYPTDOMAIN1/fullchain1.pem; 25 | 26 | include /etc/nginx/cfgs/security/ssl-headers.conf; 27 | 28 | ## Brotli 29 | ## ------------------ 30 | brotli on; 31 | brotli_static on; 32 | brotli_min_length 1000; 33 | brotli_buffers 32 8k; 34 | brotli_comp_level 5; 35 | brotli_types *; 36 | 37 | location / { 38 | 39 | proxy_pass http://sickrage/; 40 | 41 | include /etc/nginx/cfgs/proxy/headers.conf; 42 | include /etc/nginx/cfgs/proxy/params.conf; 43 | } 44 | 45 | } 46 | include /etc/nginx/cfgs/upstream/sickrage.conf; 47 | -------------------------------------------------------------------------------- /srv/nginx/vhost.d/site-ssl.tmpl: -------------------------------------------------------------------------------- 1 | 2 | server { 3 | listen 80; 4 | listen [::]:80; 5 | server_name www.YOURDOMAIN.TLD YOURDOMAIN.TLD; 6 | 7 | return 301 https://YOURDOMAIN.TLD$request_uri; 8 | } 9 | 10 | server { 11 | listen 443 ssl http2; 12 | listen [::]:443 ssl http2; 13 | # listen on the wrong host 14 | server_name www.YOURDOMAIN.TLD; 15 | 16 | ssl_certificate /etc/nginx/certs/archive/LETSENCRYPTDOMAIN1/fullchain1.pem; 17 | ssl_certificate_key /etc/nginx/certs/archive/LETSENCRYPTDOMAIN1/privkey1.pem; 18 | ssl_dhparam /etc/nginx/certs/dhparam.pem; 19 | 20 | # and redirect to the non-www host (declared below) 21 | return 301 https://YOURDOMAIN.TLD$request_uri; 22 | } 23 | 24 | server { 25 | listen 443 ssl http2; 26 | listen [::]:443 ssl http2; 27 | server_name YOURDOMAIN.TLD; 28 | root /var/www/public; 29 | 30 | ## SSL 31 | ## ------------------ 32 | ssl_certificate /etc/nginx/certs/archive/LETSENCRYPTDOMAIN1/fullchain1.pem; 33 | ssl_certificate_key /etc/nginx/certs/archive/LETSENCRYPTDOMAIN1/privkey1.pem; 34 | ssl_dhparam /etc/nginx/certs/dhparam.pem; 35 | 36 | include /etc/nginx/cfgs/ssl/ssl.conf; 37 | 38 | ssl_session_ticket_key /etc/nginx/certs/ticket.key; 39 | ssl_trusted_certificate /etc/nginx/certs/archive/LETSENCRYPTDOMAIN1/fullchain1.pem; 40 | 41 | include /etc/nginx/cfgs/security/ssl-headers.conf; 42 | 43 | ## Brotli 44 | ## ------------------ 45 | brotli on; 46 | brotli_static on; 47 | brotli_min_length 1000; 48 | brotli_buffers 32 8k; 49 | brotli_comp_level 5; 50 | brotli_types *; 51 | 52 | location / { 53 | try_files $uri =404; 54 | expires max; 55 | add_header Pragma public; 56 | add_header Cache-Control "public, must-revalidate, proxy-revalidate"; 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /srv/nginx/vhost.d/site.conf: -------------------------------------------------------------------------------- 1 | 2 | server { 3 | listen 80; 4 | listen [::]:80; 5 | 6 | server_name _ default_server; 7 | 8 | location / { 9 | try_files $uri $uri/ =404; 10 | } 11 | location /rutorrent { 12 | try_files $uri $uri/ =404; 13 | access_log /logs/frontend/rutorrent.access.log; 14 | error_log /logs/frontend/rutorrent.error.log; 15 | 16 | location ~ .php$ { 17 | fastcgi_split_path_info ^(.+\.php)(.*)$; 18 | fastcgi_pass backend_rutorrent; 19 | fastcgi_index index.php; 20 | fastcgi_intercept_errors on; 21 | fastcgi_ignore_client_abort off; 22 | fastcgi_connect_timeout 60; 23 | fastcgi_send_timeout 180; 24 | fastcgi_read_timeout 180; 25 | fastcgi_buffer_size 128k; 26 | fastcgi_buffers 4 256k; 27 | fastcgi_busy_buffers_size 256k; 28 | fastcgi_temp_file_write_size 256k; 29 | 30 | include /etc/nginx/fastcgi_params; 31 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 32 | } 33 | } 34 | 35 | location /RPC2 { 36 | access_log /logs/frontend/rutorrent.rpc2.access.log; 37 | error_log /logs/frontend/rutorrent.rpc2.error.log; 38 | include /etc/nginx/scgi_params; 39 | scgi_pass backend_rtorrent; 40 | } 41 | 42 | 43 | location /deluge { 44 | proxy_pass http://deluge/; 45 | proxy_set_header X-Deluge-Base "/deluge/"; 46 | 47 | include /etc/nginx/cfgs/proxy/headers.conf; 48 | include /etc/nginx/cfgs/proxy/params.conf; 49 | } 50 | # location /sonarr { 51 | # proxy_pass http://sonarr/; 52 | # 53 | # include /etc/nginx/cfgs/proxy/headers.conf; 54 | # include /etc/nginx/cfgs/proxy/params.conf; 55 | # } 56 | # location /plexpy { 57 | # proxy_pass http://plexpy/; 58 | # 59 | # include /etc/nginx/cfgs/proxy/headers.conf; 60 | # include /etc/nginx/cfgs/proxy/params.conf; 61 | # } 62 | # location /plex { 63 | # proxy_pass http://plex/; 64 | # 65 | # include /etc/nginx/cfgs/proxy/headers.conf; 66 | # include /etc/nginx/cfgs/proxy/params.conf; 67 | # } 68 | # location /sickrage { 69 | # proxy_pass http://sickrage/; 70 | # add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; always"; 71 | # add_header X-Content-Type-Options nosniff; 72 | # proxy_set_header Host sickrage; 73 | # proxy_redirect default; 74 | # include /etc/nginx/cfgs/proxy_common.conf; 75 | # } 76 | } 77 | 78 | include /etc/nginx/cfgs/upstream/rutorrent.conf; 79 | include /etc/nginx/cfgs/upstream/deluge.conf; 80 | # include /etc/nginx/cfgs/upstream/sickrage.conf; 81 | # include /etc/nginx/cfgs/upstream/sonarr.conf; 82 | # include /etc/nginx/cfgs/upstream/plex.conf; 83 | # include /etc/nginx/cfgs/upstream/plexpy.conf; 84 | -------------------------------------------------------------------------------- /srv/nginx/vhost.d/sonarr.tmpl: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80; 3 | listen [::]:80; 4 | server_name sonarr.YOURDOMAIN.TLD; 5 | 6 | return 301 https://sonarr.YOURDOMAIN.TLD$request_uri; 7 | } 8 | 9 | server { 10 | listen 443 ssl http2; 11 | listen [::]:443 ssl http2; 12 | server_name sonarr.YOURDOMAIN.TLD; 13 | 14 | 15 | ## SSL 16 | ## ------------------ 17 | ssl_certificate /etc/nginx/certs/archive/LETSENCRYPTDOMAIN1/fullchain1.pem; 18 | ssl_certificate_key /etc/nginx/certs/archive/LETSENCRYPTDOMAIN1/privkey1.pem; 19 | ssl_dhparam /etc/nginx/certs/dhparam.pem; 20 | 21 | include /etc/nginx/cfgs/ssl/ssl.conf; 22 | 23 | ssl_session_ticket_key /etc/nginx/certs/ticket.key; 24 | ssl_trusted_certificate /etc/nginx/certs/archive/LETSENCRYPTDOMAIN1/fullchain1.pem; 25 | 26 | include /etc/nginx/cfgs/security/ssl-headers.conf; 27 | 28 | ## Brotli 29 | ## ------------------ 30 | brotli on; 31 | brotli_static on; 32 | brotli_min_length 1000; 33 | brotli_buffers 32 8k; 34 | brotli_comp_level 5; 35 | brotli_types *; 36 | 37 | location / { 38 | 39 | proxy_pass http://sonarr/; 40 | 41 | include /etc/nginx/cfgs/proxy/headers.conf; 42 | include /etc/nginx/cfgs/proxy/params.conf; 43 | } 44 | 45 | } 46 | include /etc/nginx/cfgs/upstream/sonarr.conf; 47 | -------------------------------------------------------------------------------- /srv/nginx/win-utf: -------------------------------------------------------------------------------- 1 | # This map is not a full windows-1251 <> utf8 map: it does not 2 | # contain Serbian and Macedonian letters. If you need a full map, 3 | # use contrib/unicode2nginx/win-utf map instead. 4 | 5 | charset_map windows-1251 utf-8 { 6 | 7 | 82 E2809A ; # single low-9 quotation mark 8 | 9 | 84 E2809E ; # double low-9 quotation mark 10 | 85 E280A6 ; # ellipsis 11 | 86 E280A0 ; # dagger 12 | 87 E280A1 ; # double dagger 13 | 88 E282AC ; # euro 14 | 89 E280B0 ; # per mille 15 | 16 | 91 E28098 ; # left single quotation mark 17 | 92 E28099 ; # right single quotation mark 18 | 93 E2809C ; # left double quotation mark 19 | 94 E2809D ; # right double quotation mark 20 | 95 E280A2 ; # bullet 21 | 96 E28093 ; # en dash 22 | 97 E28094 ; # em dash 23 | 24 | 99 E284A2 ; # trade mark sign 25 | 26 | A0 C2A0 ; #   27 | A1 D18E ; # capital Byelorussian short U 28 | A2 D19E ; # small Byelorussian short u 29 | 30 | A4 C2A4 ; # currency sign 31 | A5 D290 ; # capital Ukrainian soft G 32 | A6 C2A6 ; # borken bar 33 | A7 C2A7 ; # section sign 34 | A8 D081 ; # capital YO 35 | A9 C2A9 ; # (C) 36 | AA D084 ; # capital Ukrainian YE 37 | AB C2AB ; # left-pointing double angle quotation mark 38 | AC C2AC ; # not sign 39 | AD C2AD ; # soft hypen 40 | AE C2AE ; # (R) 41 | AF D087 ; # capital Ukrainian YI 42 | 43 | B0 C2B0 ; # ° 44 | B1 C2B1 ; # plus-minus sign 45 | B2 D086 ; # capital Ukrainian I 46 | B3 D196 ; # small Ukrainian i 47 | B4 D291 ; # small Ukrainian soft g 48 | B5 C2B5 ; # micro sign 49 | B6 C2B6 ; # pilcrow sign 50 | B7 C2B7 ; # · 51 | B8 D191 ; # small yo 52 | B9 E28496 ; # numero sign 53 | BA D194 ; # small Ukrainian ye 54 | BB C2BB ; # right-pointing double angle quotation mark 55 | 56 | BF D197 ; # small Ukrainian yi 57 | 58 | C0 D090 ; # capital A 59 | C1 D091 ; # capital B 60 | C2 D092 ; # capital V 61 | C3 D093 ; # capital G 62 | C4 D094 ; # capital D 63 | C5 D095 ; # capital YE 64 | C6 D096 ; # capital ZH 65 | C7 D097 ; # capital Z 66 | C8 D098 ; # capital I 67 | C9 D099 ; # capital J 68 | CA D09A ; # capital K 69 | CB D09B ; # capital L 70 | CC D09C ; # capital M 71 | CD D09D ; # capital N 72 | CE D09E ; # capital O 73 | CF D09F ; # capital P 74 | 75 | D0 D0A0 ; # capital R 76 | D1 D0A1 ; # capital S 77 | D2 D0A2 ; # capital T 78 | D3 D0A3 ; # capital U 79 | D4 D0A4 ; # capital F 80 | D5 D0A5 ; # capital KH 81 | D6 D0A6 ; # capital TS 82 | D7 D0A7 ; # capital CH 83 | D8 D0A8 ; # capital SH 84 | D9 D0A9 ; # capital SHCH 85 | DA D0AA ; # capital hard sign 86 | DB D0AB ; # capital Y 87 | DC D0AC ; # capital soft sign 88 | DD D0AD ; # capital E 89 | DE D0AE ; # capital YU 90 | DF D0AF ; # capital YA 91 | 92 | E0 D0B0 ; # small a 93 | E1 D0B1 ; # small b 94 | E2 D0B2 ; # small v 95 | E3 D0B3 ; # small g 96 | E4 D0B4 ; # small d 97 | E5 D0B5 ; # small ye 98 | E6 D0B6 ; # small zh 99 | E7 D0B7 ; # small z 100 | E8 D0B8 ; # small i 101 | E9 D0B9 ; # small j 102 | EA D0BA ; # small k 103 | EB D0BB ; # small l 104 | EC D0BC ; # small m 105 | ED D0BD ; # small n 106 | EE D0BE ; # small o 107 | EF D0BF ; # small p 108 | 109 | F0 D180 ; # small r 110 | F1 D181 ; # small s 111 | F2 D182 ; # small t 112 | F3 D183 ; # small u 113 | F4 D184 ; # small f 114 | F5 D185 ; # small kh 115 | F6 D186 ; # small ts 116 | F7 D187 ; # small ch 117 | F8 D188 ; # small sh 118 | F9 D189 ; # small shch 119 | FA D18A ; # small hard sign 120 | FB D18B ; # small y 121 | FC D18C ; # small soft sign 122 | FD D18D ; # small e 123 | FE D18E ; # small yu 124 | FF D18F ; # small ya 125 | } 126 | --------------------------------------------------------------------------------