hfs 3.3.0-rc8 → 3.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -7
- package/admin/assets/{AccountsPage-DQRe_C6C.js → AccountsPage-Cvi9DSc1.js} +1 -1
- package/admin/assets/{ArrayField-vuFXnbl0.js → ArrayField-ChS9pNra.js} +1 -1
- package/admin/assets/{ConfigFilePage-C8Ptafyz.js → ConfigFilePage-6jCYVkbr.js} +1 -1
- package/admin/assets/{CustomHtmlPage-ixjEFOSj.js → CustomHtmlPage-DaEXsEcQ.js} +1 -1
- package/admin/assets/{DataTable-CIY80zu-.js → DataTable-Cf5S5yWr.js} +1 -1
- package/admin/assets/{DateTimeField-DS0GD_Km.js → DateTimeField--mTsSB1l.js} +1 -1
- package/admin/assets/{EventManager-CgaKYrmd.js → EventManager-BJWba-fL.js} +1 -1
- package/admin/assets/{FileField-BM5hiNL9.js → FileField-B0WhrAuk.js} +3 -3
- package/admin/assets/{InternetPage-B2zIzmNu.js → InternetPage-BICQDG_K.js} +1 -1
- package/admin/assets/{LangPage-CX9ANWrl.js → LangPage-D42UPSxC.js} +1 -1
- package/admin/assets/{LogsPage-CGXaChDs.js → LogsPage-DQTrf5GE.js} +1 -1
- package/admin/assets/{MenuButton-713XH2Rb.js → MenuButton-DDfB3119.js} +1 -1
- package/admin/assets/{MonitorPage-DbwLo7in.js → MonitorPage-CH06c8aW.js} +1 -1
- package/admin/assets/{OptionsPage-BTAS5Bs4.js → OptionsPage-BvXLA_R0.js} +1 -1
- package/admin/assets/{PluginsPage-CmAmw0TY.js → PluginsPage-CyaVJZkM.js} +1 -1
- package/admin/assets/{Tabs-C_HqOZ81.js → Tabs-CGfV3BK0.js} +1 -1
- package/admin/assets/{TextEditor-Cwc9np9p.js → TextEditor-Df9LSzm6.js} +1 -1
- package/admin/assets/{VfsPathField-BF2KjLLq.js → VfsPathField-6Kyy5vuQ.js} +1 -1
- package/admin/assets/{agentIcons-NVIBNyll.js → agentIcons-DwT9U-lh.js} +1 -1
- package/admin/assets/{baseUrl-CcZGsszU.js → baseUrl-D7S0KsqZ.js} +1 -1
- package/admin/assets/{icons-Bs1_FA3W.js → icons-DWkdo8hc.js} +1 -1
- package/admin/assets/{index-BTUyewGO.js → index-BDdPG215.js} +2 -2
- package/admin/assets/{routing-yGZRCrnR.js → routing-CxxvyWME.js} +1 -1
- package/admin/index.html +1 -1
- package/npm-shrinkwrap.json +2 -2
- package/package.json +3 -3
- package/src/config.js +1 -1
- package/src/perm.js +7 -2
- package/src/webdav.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hfs",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.1",
|
|
4
4
|
"description": "HTTP File Server",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"file server",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"license": "GPL-3.0",
|
|
11
11
|
"author": "Massimo Melina <a@rejetto.com>",
|
|
12
12
|
"scripts": {
|
|
13
|
-
"watch-server": "cross-env DEV=1 nodemon --ignore tests/ --watch src -e ts,tsx --exec tsx src",
|
|
13
|
+
"watch-server": "cross-env DEV=1 nodemon --ignore tests/ --watch src -e ts,tsx,json --exec tsx src",
|
|
14
14
|
"watch-server-proxied": "cross-env FRONTEND_PROXY=3005 ADMIN_PROXY=3006 npm run watch-server",
|
|
15
15
|
"watch-server-full": "npm run start --workspace=frontend & npm run start --workspace=admin & cross-env FRONTEND_PROXY=3005 ADMIN_PROXY=3006 npm run watch-server",
|
|
16
16
|
"start-frontend": "npm run start --workspace=frontend",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"build-admin": "npm run build --workspace=admin",
|
|
22
22
|
"prepare-test": "mkdir -p tests/work tests/tmp && cp tests/config.yaml tests/work/config.yaml && cp tests/alfa.txt tests/tmp/alfa.txt",
|
|
23
23
|
"server-for-test": "npm run prepare-test && node dist/src --cwd tests/work --config tests/work/config.yaml --debug",
|
|
24
|
-
"server-for-test-dev": "npm run prepare-test && cross-env DEV=1 FRONTEND_PROXY=3005 ADMIN_PROXY=3006 nodemon --ignore tests/ --watch src -e ts,tsx --exec tsx src -- --cwd tests/work --config tests",
|
|
24
|
+
"server-for-test-dev": "npm run prepare-test && cross-env DEV=1 FRONTEND_PROXY=3005 ADMIN_PROXY=3006 nodemon --ignore tests/ --watch src -e ts,tsx,json --exec tsx src -- --cwd tests/work --config tests",
|
|
25
25
|
"test": "sh -c 'npm run port-is-free >/dev/null && { echo \"no server\"; exit 1; }; node --import tsx --test \"$@\" tests/test.ts' --",
|
|
26
26
|
"test-with-server": "sh -c 'npm run port-is-free && tsc && rm -rf tests/work tests/tmp && npm run prepare-test && (node dist/src --cwd tests/work --config tests/work/config.yaml & echo $! > .server_pid) && sleep 2 && node --import tsx --test \"$@\" tests/test.ts; _exit=$?; if [ -f ./.server_pid ]; then SERVER_PID=$(cat ./.server_pid); kill \"$SERVER_PID\" 2>/dev/null || true; rm -f ./.server_pid; fi; exit $_exit' --",
|
|
27
27
|
"port-is-free": "node -e \"const port=process.argv[1]||8081;process.exit(await fetch('http://localhost:'+port).then(() => console.log('BUSY')||1, () => 0))\" --",
|
package/src/config.js
CHANGED
|
@@ -139,7 +139,7 @@ async function setConfig(newCfg, save) {
|
|
|
139
139
|
const version = lodash_1.default.isString(newCfg.version) ? new Version(newCfg.version) : undefined;
|
|
140
140
|
const considerEnvs = !process.env['HFS_ENV_BOOTSTRAP'] || !started && lodash_1.default.isEmpty(newCfg);
|
|
141
141
|
// first time we consider also CLI args
|
|
142
|
-
const argCfg = !started && lodash_1.default.pickBy((0, cross_1.newObj)(configProps, (_x, k) => (0, cross_1.tryJson)(k in argv_1.argv ? argv_1.argv[k] : considerEnvs ? process.env['HFS_' + k.toUpperCase().replaceAll('-', '_')] :
|
|
142
|
+
const argCfg = !started && lodash_1.default.pickBy((0, cross_1.newObj)(configProps, (_x, k) => (0, cross_1.tryJson)(k in argv_1.argv ? argv_1.argv[k] : considerEnvs ? process.env['HFS_' + k.toUpperCase().replaceAll('-', '_')] : undefined, lodash_1.default.identity)), x => x !== undefined);
|
|
143
143
|
if (!lodash_1.default.isEmpty(argCfg)) {
|
|
144
144
|
(0, exports.saveConfigAsap)(); // don't set `save` argument, as it would interfere below, at check `save===false`
|
|
145
145
|
Object.assign(newCfg, argCfg);
|
package/src/perm.js
CHANGED
|
@@ -65,8 +65,13 @@ createAdminConfig.sub(v => {
|
|
|
65
65
|
if (!v)
|
|
66
66
|
return;
|
|
67
67
|
createAdminConfig.set('');
|
|
68
|
-
//
|
|
69
|
-
|
|
68
|
+
// creating admin inside this subscriber can lose the account when setConfig later applies accounts or its default
|
|
69
|
+
// configReady waits for the full async startup; a timer alone cannot guarantee that defaults have been applied
|
|
70
|
+
// the timer keeps creation deferred on reloads, when configReady is already resolved, but does not await async reloads
|
|
71
|
+
setTimeout(async () => {
|
|
72
|
+
await config_1.configReady;
|
|
73
|
+
await createAdmin(v);
|
|
74
|
+
});
|
|
70
75
|
});
|
|
71
76
|
async function createAdmin(password, username = 'admin') {
|
|
72
77
|
const acc = await addAccount(username, { admin: true, password }, true);
|
package/src/webdav.js
CHANGED
|
@@ -36,7 +36,7 @@ const WEBDAV_HINT_HEADERS = ['depth', 'destination', 'overwrite', 'translate', '
|
|
|
36
36
|
const KNOWN_UA = /webdav|miniredir|davclnt|microsoft office|ms-office/i;
|
|
37
37
|
const LOCK_DEFAULT_SECONDS = 3600;
|
|
38
38
|
const LOCK_MAX_SECONDS = cross_1.DAY / 1000;
|
|
39
|
-
const xmlParser = new fast_xml_parser_1.XMLParser({ ignoreAttributes: false, removeNSPrefix: true, trimValues: true });
|
|
39
|
+
const xmlParser = new fast_xml_parser_1.XMLParser({ ignoreAttributes: false, removeNSPrefix: true, trimValues: true, parseTagValue: false }); // don't parse values, to preserve leading zeros so Windows file attributes are recognized as hexadecimal
|
|
40
40
|
const PROPPATCH_PROTECTED_LIVE_PROPS = new Set([
|
|
41
41
|
'creationdate', 'displayname', 'getcontentlanguage', 'getcontentlength', 'getcontenttype',
|
|
42
42
|
'getetag', 'getlastmodified', 'lockdiscovery', 'resourcetype', 'supportedlock',
|