More server updates, dns and nas

This commit is contained in:
2023-06-01 08:35:44 -04:00
parent a63d414667
commit ca5b9bae45
3 changed files with 46 additions and 1 deletions

40
docs/server/dns.md Normal file
View File

@@ -0,0 +1,40 @@
# External Connections
## Router Configuration
In order to receive traffic from outside the network, you need to enable port forwarding from your router settings. To do this, you set up rules for TCP ports 80 and 443 to forward to your server's local IP. It is recommended to assign a static local IP to your server.
## Nginx Proxy Manager
After the router has been configured to forward traffic to the server, you can then use Nginx to forward traffic to the correct container based on the url accessed. To do this you will need to run Nginx Proxy Manager on its own `nginx` network. Other containers that you want exposed to the internet will then need to be added to this network so they can be exposed.
### Creating Proxy Hosts
Proxy Hosts are the endpoints that will connect your containers to the outside world. Enter your domain name, and then select the protocol that the image uses locally (this will depend on the image). Then use the hostname that you configure in the container's network settings. Check "Cache Assets", "Block Common Exploits", and "Websockets Support". Under the SSL tab, create a new certificate for the process and check "Force SSL", "HTTP/2 Support", and "HSTS Enabled".
## Adding containers to Nginx network
In order to the route from Nginx to the container, you will need to add the container to the correct network. In the network settings, select the `nginx` network and set the hostname to something you will use to connect from Nginx, usually just the name of the process.
## DDNS
DDNS, or Dynamic DNS, is required to link the router's IP to the domain registry. Since a home network IP can change, this needs to be updated regularly so the domain can link back to the correct home network. I use Google DDNS and followed [this guide](https://cloud-jake.medium.com/google-domains-dynamic-dns-with-google-domains-1dd0ea45c219) to set up my local server. Below is my configuration of ddclient.
```bash
# Configuration file for ddclient generated by debconf
#
# /etc/ddclient.conf
daemon=300
ssl=yes
protocol=dyndns2
use=web
server=domains.google.com
login='<login>'
password='<password>'
ddns.dietrick.dev
```
## DNS
To setup new subdomains and route them to the correct applications, you then just need to create a CNAME entry pointing to your DDNS endpoint, in my case `ddns.dietrick.dev`. This should automatically route you to the home network, through Nginx, and to the correct application.

View File

@@ -1,5 +1,9 @@
# NAS Setup
## Creating Mountable Volume
After creating a new shared folder in the NAS configuration, you then need to enable NFS for that folder. Click `Edit` and go to `NFS Permissions`. Add a new rule for client `*` with read/write permissions, and check "Enable asynchronous" and "Access to subfolders".
## Mounting to Linux
```bash

View File

@@ -3,7 +3,8 @@
"text": "Server Basics",
"items": [
{"text": "Introduction", "link": "/server/"},
{"text": "NAS", "link": "/server/nas"}
{"text": "NAS", "link": "/server/nas"},
{"text": "External Connection", "link": "/server/dns"}
]
}
]