Skip to content

Commit 4edc4d3

Browse files
committed
Updated examples with Production service + Port 80
1 parent 451d5b9 commit 4edc4d3

File tree

4 files changed

+56
-46
lines changed

4 files changed

+56
-46
lines changed

README.md

Lines changed: 44 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ NGINX Hash Lock sits in front of your application and provides flexible authenti
2121
environment:
2222
BACKEND_HOST: "your-app" # Required: Backend service hostname
2323
BACKEND_PORT: "8080" # Required: Backend service port
24-
LISTEN_PORT: "3000" # Required: Port NGINX listens on
24+
LISTEN_PORT: "80" # Required: Port NGINX listens on (80 recommended for clean subdomains)
2525
```
2626
2727
**Authentication Options:**
@@ -84,14 +84,14 @@ This ensures the Dashboard button automatically includes the authentication hash
8484
```yaml
8585
services:
8686
hashlock:
87-
image: krizcold/nginxhashlock:latest
87+
image: ghcr.io/yundera/nginx-hash-lock:latest
8888
environment:
8989
AUTH_HASH: $AUTH_HASH # CasaOS provides this
9090
BACKEND_HOST: "myapp"
9191
BACKEND_PORT: "8080"
92-
LISTEN_PORT: "3000"
93-
ports:
94-
- "3000:3000"
92+
LISTEN_PORT: "80"
93+
expose:
94+
- 80
9595
depends_on:
9696
- myapp
9797
@@ -101,7 +101,7 @@ services:
101101
x-casaos:
102102
main: hashlock
103103
index: /?hash=$AUTH_HASH # IMPORTANT: Include hash in URL
104-
webui_port: 3000
104+
webui_port: 80
105105
```
106106

107107
**CasaOS Dashboard button:** Automatically opens with authentication hash
@@ -111,16 +111,16 @@ x-casaos:
111111
```yaml
112112
services:
113113
hashlock:
114-
image: krizcold/nginxhashlock:latest
114+
image: ghcr.io/yundera/nginx-hash-lock:latest
115115
environment:
116116
USER: $USER # Set in CasaOS or compose
117117
PASSWORD: $PASSWORD # Set in CasaOS or compose
118118
SESSION_DURATION_HOURS: "168" # 1 week
119119
BACKEND_HOST: "myapp"
120120
BACKEND_PORT: "8080"
121-
LISTEN_PORT: "3000"
122-
ports:
123-
- "3000:3000"
121+
LISTEN_PORT: "80"
122+
expose:
123+
- 80
124124
depends_on:
125125
- myapp
126126
@@ -130,7 +130,7 @@ services:
130130
x-casaos:
131131
main: hashlock
132132
index: / # No hash needed - shows login page
133-
webui_port: 3000
133+
webui_port: 80
134134
```
135135

136136
**CasaOS Dashboard button:** Opens login page → Enter credentials → 1-week session
@@ -140,17 +140,17 @@ x-casaos:
140140
```yaml
141141
services:
142142
hashlock:
143-
image: krizcold/nginxhashlock:latest
143+
image: ghcr.io/yundera/nginx-hash-lock:latest
144144
environment:
145145
AUTH_HASH: $AUTH_HASH # Option 1: CasaOS hash
146146
USER: $USER # Option 2: Password auth
147147
PASSWORD: $PASSWORD
148148
SESSION_DURATION_HOURS: "720" # 30 days
149149
BACKEND_HOST: "myapp"
150150
BACKEND_PORT: "8080"
151-
LISTEN_PORT: "3000"
152-
ports:
153-
- "3000:3000"
151+
LISTEN_PORT: "80"
152+
expose:
153+
- 80
154154
depends_on:
155155
- myapp
156156
@@ -160,7 +160,7 @@ services:
160160
x-casaos:
161161
main: hashlock
162162
index: /?hash=$AUTH_HASH # Dashboard uses hash (quick access)
163-
webui_port: 3000
163+
webui_port: 80
164164
```
165165

166166
**CasaOS Dashboard button:** Opens with hash (quick access)
@@ -169,7 +169,7 @@ x-casaos:
169169
## How It Works
170170

171171
### Hash Authentication Mode
172-
1. **With correct hash**: `http://yourserver:3000/?hash=my-secret-123` → Access granted
172+
1. **With correct hash**: `https://yourapp.example.com/?hash=my-secret-123` → Access granted
173173
2. **Without hash**: Returns 403 Forbidden with custom error page
174174

175175
### Username/Password Mode
@@ -256,7 +256,7 @@ volumes:
256256

257257
services:
258258
authproxy:
259-
image: krizcold/nginxhashlock:latest
259+
image: ghcr.io/yundera/nginx-hash-lock:latest
260260
volumes:
261261
- dynamic_paths:/tmp/dynamic_paths
262262
environment:
@@ -274,12 +274,12 @@ services:
274274
services:
275275
# Authentication proxy with dynamic allowlisting
276276
streamauth:
277-
image: krizcold/nginxhashlock:latest
277+
image: ghcr.io/yundera/nginx-hash-lock:latest
278278
environment:
279279
AUTH_HASH: $AUTH_HASH
280280
BACKEND_HOST: "streamer"
281281
BACKEND_PORT: "8080"
282-
LISTEN_PORT: "3000"
282+
LISTEN_PORT: "80"
283283
# Enable dynamic allowlisting for media files
284284
DYNAMIC_PATHS_FILE: "/tmp/dynamic_paths/allowed.txt"
285285
DYNAMIC_PATHS_TTL: "600" # 10 minutes for video streaming
@@ -288,8 +288,8 @@ services:
288288
ALLOWED_PATHS: "api/status,health"
289289
volumes:
290290
- media_allowlist:/tmp/dynamic_paths
291-
ports:
292-
- "3000:3000"
291+
expose:
292+
- 80
293293

294294
# Media server (e.g., Stremio, Jellyfin, Plex)
295295
streamer:
@@ -393,12 +393,14 @@ Quick access via URL hash parameter - Dashboard button includes hash automatical
393393
```yaml
394394
services:
395395
yunderaterminal:
396-
image: krizcold/nginxhashlock:latest
396+
image: ghcr.io/yundera/nginx-hash-lock:latest
397397
environment:
398398
AUTH_HASH: $AUTH_HASH # CasaOS provides this
399399
BACKEND_HOST: "ttyd"
400400
BACKEND_PORT: "7681"
401-
LISTEN_PORT: "3000"
401+
LISTEN_PORT: "80"
402+
expose:
403+
- 80
402404
depends_on:
403405
- ttyd
404406
@@ -409,7 +411,7 @@ services:
409411
x-casaos:
410412
main: yunderaterminal
411413
index: /?hash=$AUTH_HASH # IMPORTANT: Pass hash to URL
412-
webui_port: 3000
414+
webui_port: 80
413415
```
414416

415417
**CasaOS Dashboard:** Automatically opens with hash → Instant access
@@ -420,14 +422,16 @@ Session-based login with username/password:
420422
```yaml
421423
services:
422424
yunderaterminalpass:
423-
image: krizcold/nginxhashlock:latest
425+
image: ghcr.io/yundera/nginx-hash-lock:latest
424426
environment:
425427
USER: $USER # Set in CasaOS
426428
PASSWORD: $PASSWORD # Set in CasaOS
427429
SESSION_DURATION_HOURS: "720" # 30 days
428430
BACKEND_HOST: "ttydpass"
429431
BACKEND_PORT: "7681"
430-
LISTEN_PORT: "3000"
432+
LISTEN_PORT: "80"
433+
expose:
434+
- 80
431435
depends_on:
432436
- ttydpass
433437
@@ -438,7 +442,7 @@ services:
438442
x-casaos:
439443
main: yunderaterminalpass
440444
index: / # No hash - show login page
441-
webui_port: 3000
445+
webui_port: 80
442446
```
443447

444448
**CasaOS Dashboard:** Opens login page → Enter credentials → 30-day session
@@ -449,15 +453,17 @@ Accept BOTH hash OR password for maximum flexibility:
449453
```yaml
450454
services:
451455
yunderaterminalboth:
452-
image: krizcold/nginxhashlock:latest
456+
image: ghcr.io/yundera/nginx-hash-lock:latest
453457
environment:
454458
AUTH_HASH: $AUTH_HASH # Option 1: CasaOS hash (Dashboard)
455459
USER: $USER # Option 2: Login page
456460
PASSWORD: $PASSWORD
457461
SESSION_DURATION_HOURS: "168" # 1 week
458462
BACKEND_HOST: "ttydboth"
459463
BACKEND_PORT: "7681"
460-
LISTEN_PORT: "3000"
464+
LISTEN_PORT: "80"
465+
expose:
466+
- 80
461467
depends_on:
462468
- ttydboth
463469
@@ -468,7 +474,7 @@ services:
468474
x-casaos:
469475
main: yunderaterminalboth
470476
index: /?hash=$AUTH_HASH # Dashboard uses hash for quick access
471-
webui_port: 3000
477+
webui_port: 80
472478
```
473479

474480
**CasaOS Dashboard:** Opens with hash → Instant access
@@ -599,9 +605,13 @@ The dynamic allowlist feature is particularly useful for:
599605
- Download managers with web interfaces
600606
- Any app where backend services need temporary resource access
601607
602-
## Quick note to update source code:
608+
## Building & Publishing
603609
610+
The Docker image is automatically built and published to GitHub Container Registry via GitHub Actions on every push to `main`.
611+
612+
**Image location:** `ghcr.io/yundera/nginx-hash-lock:latest`
613+
614+
For manual builds (development only):
604615
```bash
605-
docker build -t krizcold/nginxhashlock:latest .
606-
docker push krizcold/nginxhashlock:latest
616+
docker build -t ghcr.io/yundera/nginx-hash-lock:dev .
607617
```

safe-terminal-app-nginxhashboth.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ name: yunderaterminalboth
22

33
services:
44
yunderaterminalboth:
5-
image: krizcold/nginxhashlock:latest
5+
image: ghcr.io/yundera/nginx-hash-lock:latest
66
container_name: yunderaterminalboth
77
restart: unless-stopped
88
expose:
9-
- "3000"
9+
- 80
1010
user: "root"
1111
environment:
1212
# Both authentication methods enabled - accept either!
@@ -16,7 +16,7 @@ services:
1616
SESSION_DURATION_HOURS: "168" # 1 week
1717
BACKEND_HOST: "ttydboth"
1818
BACKEND_PORT: "7681"
19-
LISTEN_PORT: "3000"
19+
LISTEN_PORT: "80"
2020
# ALLOWED_EXTENSIONS: "js,css,png,ico,svg"
2121
# ↑ Uncomment to allow static assets without auth
2222
# ALLOWED_PATHS: "api/health"
@@ -70,4 +70,4 @@ x-casaos:
7070
is_uncontrolled: false
7171
# Can use hash directly or go to login page
7272
index: /?hash=$AUTH_HASH
73-
webui_port: 3000
73+
webui_port: 80

safe-terminal-app-nginxhashlock.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@ name: yunderaterminal
22

33
services:
44
yunderaterminal:
5-
image: krizcold/nginxhashlock:latest
5+
image: ghcr.io/yundera/nginx-hash-lock:latest
66
container_name: yunderaterminal
77
restart: unless-stopped
88
expose:
9-
- "3000"
9+
- 80
1010
user: "root"
1111
environment:
1212
AUTH_HASH: $AUTH_HASH
1313
BACKEND_HOST: "ttyd"
1414
BACKEND_PORT: "7681"
15-
LISTEN_PORT: "3000"
15+
LISTEN_PORT: "80"
1616
# ALLOWED_EXTENSIONS: "js,css,png,ico,svg"
1717
# ↑ Uncomment to allow static assets without auth
1818
# ↑ Not needed for terminal - ttyd serves self-contained HTML
@@ -67,4 +67,4 @@ x-casaos:
6767
store_app_id: yunderaterminal
6868
is_uncontrolled: false
6969
index: /?hash=$AUTH_HASH
70-
webui_port: 3000
70+
webui_port: 80

safe-terminal-app-nginxhashpass.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@ name: yunderaterminalpass
22

33
services:
44
yunderaterminalpass:
5-
image: krizcold/nginxhashlock:latest
5+
image: ghcr.io/yundera/nginx-hash-lock:latest
66
container_name: yunderaterminalpass
77
restart: unless-stopped
88
expose:
9-
- "3000"
9+
- 80
1010
user: "root"
1111
environment:
1212
USER: $USER
1313
PASSWORD: $PASSWORD
1414
SESSION_DURATION_HOURS: "720" # 30 days (default)
1515
BACKEND_HOST: "ttydpass"
1616
BACKEND_PORT: "7681"
17-
LISTEN_PORT: "3000"
17+
LISTEN_PORT: "80"
1818
# ALLOWED_EXTENSIONS: "js,css,png,ico,svg"
1919
# ↑ Uncomment to allow static assets without auth
2020
# ↑ Not needed for terminal - ttyd serves self-contained HTML
@@ -70,4 +70,4 @@ x-casaos:
7070
is_uncontrolled: false
7171
# nginxhashlock will show login page - no hash needed
7272
index: /
73-
webui_port: 3000
73+
webui_port: 80

0 commit comments

Comments
 (0)