Skip to content

Commit 1cb900a

Browse files
authored
Merge pull request #100 from mguinness/patch-1
Document remote access setup with reverse proxy
2 parents e03291e + 25afd35 commit 1cb900a

1 file changed

Lines changed: 82 additions & 0 deletions

File tree

README.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,4 +101,86 @@ Legacy variables `POOL_HTTP_IP` and `POOL_HTTP_PORT` are still honored.
101101

102102
For production hardenings consider: enabling HTTPS, adding reverse proxy headers, mounting persistent volumes, and restricting exposed ports. Ensure ownership of the mounted `config.json` permits writes by the container user (UID 1000 in the official image); otherwise configuration changes will be disabled.
103103

104+
## Remote access
105+
As configured in Quick Start above, the dashboard is only suitable to be used on your local network. To secure the website for accessing remotely on the internet you will need to use a [reverse proxy](https://en.wikipedia.org/wiki/Reverse_proxy) that is conigured to use encryption and authentication. There are several reverse proxies available, including [Nginx](https://docs.nginx.com/nginx/admin-guide/web-server/reverse-proxy/) and [Caddy](https://caddyserver.com/docs/quick-starts/reverse-proxy), but for this example [YARP](https://dotnet.github.io/yarp/) will be used.
104106

107+
Let's Encrypt provides free SSL certificates that requires a domain name which can be obtained from [Duck DNS](https://www.duckdns.org/) after signup. [WebAuthn](https://en.wikipedia.org/wiki/WebAuthn) enables strong authentication and is designed to enable passwordless login through hardware keys, biometrics (fingerprint/face), or mobile authenticators. With these in place you can remotely access your dashboard in a secure manner over the internet.
108+
109+
You will need to modify the docker compose file that was previously setup and confirmed running under http://localhost:5150 and add the following additional services (retaining njspc & njspc-dash) and new volume (to existing volumes). You will need to replace values for `DUCKDNS_DOMAIN` & `DUCKDNS_TOKEN` with the appropriate details from your Duck DNS account.
110+
111+
```yaml
112+
services:
113+
ddns:
114+
image: docker.io/maksimstojkovic/duckdns:latest
115+
container_name: ddns
116+
environment:
117+
- DUCKDNS_DOMAIN=example.duckdns.org
118+
- DUCKDNS_TOKEN=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
119+
- DUCKDNS_DELAY=60
120+
restart: unless-stopped
121+
certs:
122+
image: docker.io/maksimstojkovic/letsencrypt:latest
123+
container_name: certs
124+
environment:
125+
- DUCKDNS_DOMAIN=example.duckdns.org
126+
- DUCKDNS_TOKEN=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
127+
- LETSENCRYPT_WILDCARD=true
128+
volumes:
129+
- proxy-config:/etc/letsencrypt
130+
restart: unless-stopped
131+
proxy:
132+
image: docker.io/mguinness/yarpwebauthn:latest
133+
container_name: proxy
134+
ports:
135+
- 8443:8443
136+
volumes:
137+
- proxy-config:/app/config
138+
restart: unless-stopped
139+
140+
volumes:
141+
proxy-config:
142+
```
143+
144+
On the initial run you will need to edit the `customsettings.json` file located in the `proxy-config` volume with the following and replace `example.duckdns.org` with your domain.
145+
146+
```json
147+
{
148+
"Kestrel": {
149+
"Certificates": {
150+
"Default": {
151+
"Path": "config/live/example.duckdns.org/fullchain.pem",
152+
"KeyPath": "config/live/example.duckdns.org/privkey.pem"
153+
}
154+
}
155+
},
156+
"ReverseProxy": {
157+
"Routes": {
158+
"route1": {
159+
"ClusterId": "cluster1",
160+
"AuthorizationPolicy": "default",
161+
"Match": {
162+
"Hosts": [ "njspc.example.duckdns.org" ],
163+
"Path": "{**catch-all}"
164+
}
165+
}
166+
},
167+
"Clusters": {
168+
"cluster1": {
169+
"Destinations": {
170+
"destination1": {
171+
"Address": "http://njspc-dash:5150/"
172+
}
173+
}
174+
}
175+
}
176+
},
177+
"Hosts": {
178+
"njspc.example.duckdns.org": {
179+
}
180+
}
181+
}
182+
```
183+
184+
Once running, the proxy will be available on TCP port 8443. Typically you would configure your home router to setup a [port forward](https://www.noip.com/support/knowledgebase/general-port-forwarding-guide) rule accepting TCP port 443 and forwarding to TCP port 8433 on the machine running the proxy. Then your website should be publicly (and securely) accessible at https://njspc.example.duckdns.org/ (substituting example with the custom domain name that you selected).
185+
186+
You will then need to register your security key as described in https://github.com/mguinness/YarpWebAuthn#usage. If you have any problems or questions, please create an issue at https://github.com/mguinness/YarpWebAuthn for further assistance.

0 commit comments

Comments
 (0)