Commit 1c2ad3c
authored
feat: configurable document root for UFS-backed HTTP serving (#24)
Add httpd.docroot Lua config option (e.g. docroot="/www") that
prefixes all UFS file paths in HTTP requests. This allows mounting
a dedicated UFS disk on a subdirectory via UFSD parmlib and pointing
HTTPD at it.
- httpd.h: add docroot[128] field to HTTPD struct
- httpconf.c: read httpd.docroot from Lua config, default empty
- httpopen.c: prepend docroot to UFS paths in http_open (skipped
for /DD: paths which bypass UFS)
Example config:
httpd.docroot = "/www"
With UFSD parmlib:
MOUNT DSN(HTTPD.WEBROOT) PATH(/www) MODE(RO)
URL /index.html resolves to UFS path /www/index.html.1 parent 4e07411 commit 1c2ad3c
3 files changed
Lines changed: 32 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
153 | | - | |
| 153 | + | |
| 154 | + | |
154 | 155 | | |
155 | 156 | | |
156 | 157 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
547 | 547 | | |
548 | 548 | | |
549 | 549 | | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
550 | 568 | | |
551 | 569 | | |
552 | 570 | | |
| |||
1094 | 1112 | | |
1095 | 1113 | | |
1096 | 1114 | | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
1097 | 1118 | | |
1098 | 1119 | | |
1099 | 1120 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
102 | | - | |
103 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
104 | 110 | | |
105 | | - | |
106 | 111 | | |
107 | 112 | | |
108 | 113 | | |
| |||
0 commit comments