From 46a581ce798fc74b6e1ad7e62aa0f22f666a6993 Mon Sep 17 00:00:00 2001 From: Matthias Borremans Date: Wed, 26 May 2021 13:56:09 +0200 Subject: [PATCH] Changing docs with reverse proxy --- docs/docs/community-guide/swag.md | 87 +++++++++++++++++++ .../developers-guide/starting-dev-server.md | 8 +- docs/mkdocs.yml | 1 + 3 files changed, 93 insertions(+), 3 deletions(-) create mode 100644 docs/docs/community-guide/swag.md diff --git a/docs/docs/community-guide/swag.md b/docs/docs/community-guide/swag.md new file mode 100644 index 000000000..68e1944da --- /dev/null +++ b/docs/docs/community-guide/swag.md @@ -0,0 +1,87 @@ +# Using SWAG as Reverse Proxy + +To make the setup of a Reverse Proxy much easier, Linuxserver.io developed [SWAG](https://github.com/linuxserver/docker-swag) +SWAG - Secure Web Application Gateway (formerly known as letsencrypt, no relation to Let's Encryptâ„¢) sets up an Nginx web server and reverse proxy with PHP support and a built-in certbot client that automates free SSL server certificate generation and renewal processes (Let's Encrypt and ZeroSSL). It also contains fail2ban for intrusion prevention. + +## Step 1: Get a domain + +The first step is to grab a dynamic DNS if you don't have your own subdomain already. You can get this from for example [DuckDNS](https://www.duckdns.org). + +## Step 2: Set-up SWAG + +Then you will need to set up SWAG, the variables of the docker-compose are explained on the Github page of [SWAG](https://github.com/linuxserver/docker-swag). +This is an example of how to set it up using duckdns and docker-compose. + +!!! example "docker-compose.yml" +```yaml +version: "2.1" +services: +swag: +image: ghcr.io/linuxserver/swag +container_name: swag +cap_add: +- NET_ADMIN +environment: +- PUID=1000 +- PGID=1000 +- TZ=Europe/Brussels +- URL= +- SUBDOMAINS=wildcard +- VALIDATION=duckdns +- CERTPROVIDER= #optional +- DNSPLUGIN= #optional +- DUCKDNSTOKEN= +- EMAIL= #optional +- ONLY_SUBDOMAINS=false #optional +- EXTRA_DOMAINS= #optional +- STAGING=false #optional +volumes: +- /etc/config/swag:/config +ports: +- 443:443 +restart: unless-stopped + +``` + +Don't forget to change the mydomain.duckns into your personal domain and the duckdnstoken into your token and remove the brackets. + +## Step 3: Change the config files + +Navigate to the config folder of SWAG and head to proxy-confs. If you used the example above, you should navigate to: /etc/config/swag/nginx/proxy-confs/. +There are a lot of preconfigured files to use for different apps such as radarr,sonarr,overseerr,... + +To use the bundled configuration file, simply rename mealie.subdomain.conf.sample in the proxy-confs folder to mealie.subdomain.conf. +Alternatively, you can create a new file mealie.subdomain.conf in proxy-confs with the following configuration: + +!!! example "mealie.subdomain.conf" +```yaml + server { + listen 443 ssl http2; + listen [::]:443 ssl http2; + + server_name mealie.*; + + include /config/nginx/ssl.conf; + + client_max_body_size 0; + + location / { + include /config/nginx/proxy.conf; + include /config/nginx/resolver.conf; + set $upstream_app mealie; + set $upstream_port 80; + set $upstream_proto http; + proxy_pass $upstream_proto://$upstream_app:$upstream_port; + } + + } +``` + +## Step 4: Port-forward port 443 + +Since SWAG allows you to set up a secure connection, you will need to open port 443 on your router for encrypted traffic. This is way more secure than port 80 for http. + +## Step 5: Restart SWAG + +When you change anything in the config of Nginx, you will need to restart the container using docker restart swag. +If everything went well, you can now access mealie on the subdomain you configured: mealie.mydomain.duckdns.org diff --git a/docs/docs/contributors/developers-guide/starting-dev-server.md b/docs/docs/contributors/developers-guide/starting-dev-server.md index 42583e50b..29172cc32 100644 --- a/docs/docs/contributors/developers-guide/starting-dev-server.md +++ b/docs/docs/contributors/developers-guide/starting-dev-server.md @@ -21,13 +21,15 @@ Prerequisites Once the prerequisites are installed you can cd into the project base directory and run `make setup` to install the python and node dependencies. Once that is complete you can run `make backend` and `make vue` to start the backend and frontend servers. ## Make File Reference -`make setup` installs python and node dependencies +`make help` Get an overview of the make commands + +`make setup` Installs python and node dependencies `make backend` Starts the backend server on port `9000` -`make vue` Starts the frontend server on port `8080` +`make frontend` Starts the frontend server on port `8080` -`make mdocs` Starts the documentation server on port `8000` +`make docs` Starts the documentation server on port `8000` `make docker-dev` Builds docker-compose.dev.yml diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index b47bcc4f0..3ae3c9ef0 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -68,6 +68,7 @@ nav: - Getting Started: "api-usage/getting-started.md" - Home Assistant: "api-usage/home-assistant.md" - Bulk Url Import: "api-usage/bulk-url-import.md" + - Community Guide: "community-guide/swag.md" - API Reference: "api/redoc.md" - Contributors Guide: - Non-Code: "contributors/non-coders.md"