hfs 0.52.0-beta4 → 0.52.0-beta6

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.
Files changed (47) hide show
  1. package/README.md +2 -3
  2. package/admin/assets/index-4CQRk-yB.css +1 -0
  3. package/admin/assets/index-sqjqhfQh.js +810 -0
  4. package/admin/assets/{sha512-3tDoWWX4.js → sha512-t1dU12Dj.js} +1 -1
  5. package/admin/index.html +2 -2
  6. package/frontend/assets/index-fqsRmx7w.css +1 -0
  7. package/frontend/assets/index-w_Bu3TcZ.js +101 -0
  8. package/frontend/assets/{sha512-I2H28VIm.js → sha512-U8GKU-vd.js} +1 -1
  9. package/frontend/index.html +2 -3
  10. package/package.json +3 -3
  11. package/src/acme.js +29 -12
  12. package/src/adminApis.js +3 -3
  13. package/src/api.get_file_list.js +2 -1
  14. package/src/api.monitor.js +3 -1
  15. package/src/api.net.js +3 -1
  16. package/src/api.vfs.js +6 -1
  17. package/src/apiMiddleware.js +1 -1
  18. package/src/block.js +1 -1
  19. package/src/connections.js +3 -1
  20. package/src/const.js +2 -2
  21. package/src/cross.js +16 -4
  22. package/src/geo.js +1 -1
  23. package/src/index.js +1 -1
  24. package/src/langs/hfs-lang-fi.json +37 -5
  25. package/src/langs/hfs-lang-it.json +6 -2
  26. package/src/langs/hfs-lang-nl.json +20 -3
  27. package/src/langs/hfs-lang-ru.json +21 -3
  28. package/src/langs/hfs-lang-vi.json +68 -22
  29. package/src/langs/hfs-lang-zh.json +13 -5
  30. package/src/listen.js +4 -3
  31. package/src/log.js +11 -2
  32. package/src/middlewares.js +2 -2
  33. package/src/misc.js +2 -1
  34. package/src/roots.js +1 -1
  35. package/src/selfCheck.js +4 -5
  36. package/src/serveGuiAndSharedFiles.js +6 -6
  37. package/src/serveGuiFiles.js +56 -43
  38. package/src/update.js +5 -4
  39. package/src/upload.js +5 -4
  40. package/src/util-files.js +1 -1
  41. package/src/util-os.js +53 -15
  42. package/src/vfs.js +9 -5
  43. package/admin/assets/index-gtPWo_px.js +0 -809
  44. package/admin/assets/index-oSvCg3xb.css +0 -1
  45. package/frontend/assets/index-Kys6yJtN.css +0 -1
  46. package/frontend/assets/index-SY22o0dA.js +0 -101
  47. package/plugins/download-counter/storage/counters.yaml +0 -663
package/src/vfs.js CHANGED
@@ -47,10 +47,13 @@ function inheritFromParent(parent, child) {
47
47
  return child;
48
48
  }
49
49
  function isSameFilenameAs(name) {
50
- const lc = name.toLowerCase();
51
- return (other) => lc === (typeof other === 'string' ? other : getNodeName(other)).toLowerCase();
50
+ const normalized = normalizeFilename(name);
51
+ return (other) => normalized === normalizeFilename(typeof other === 'string' ? other : getNodeName(other));
52
52
  }
53
53
  exports.isSameFilenameAs = isSameFilenameAs;
54
+ function normalizeFilename(x) {
55
+ return const_1.IS_WINDOWS || const_1.IS_MAC ? x.toLocaleLowerCase() : x;
56
+ }
54
57
  async function applyParentToChild(child, parent, name) {
55
58
  var _a, _b;
56
59
  const ret = {
@@ -216,7 +219,7 @@ async function* walkNode(parent, { ctx, depth = Infinity, prefixPath = '', requi
216
219
  continue;
217
220
  const nodeName = getNodeName(child);
218
221
  const name = prefixPath + nodeName;
219
- took === null || took === void 0 ? void 0 : took.add(name);
222
+ took === null || took === void 0 ? void 0 : took.add(normalizeFilename(name));
220
223
  const item = { ...child, name };
221
224
  if (!canSee(item))
222
225
  continue;
@@ -249,7 +252,7 @@ async function* walkNode(parent, { ctx, depth = Infinity, prefixPath = '', requi
249
252
  if (ctx === null || ctx === void 0 ? void 0 : ctx.req.aborted)
250
253
  return;
251
254
  const name = prefixPath + (((_a = parent.rename) === null || _a === void 0 ? void 0 : _a[path]) || path);
252
- if (took === null || took === void 0 ? void 0 : took.has(name))
255
+ if (took === null || took === void 0 ? void 0 : took.has(normalizeFilename(name)))
253
256
  continue;
254
257
  if (depth) {
255
258
  const dir = (0, path_1.dirname)(name);
@@ -288,8 +291,9 @@ function masksCouldGivePermission(masks, perm) {
288
291
  }
289
292
  exports.masksCouldGivePermission = masksCouldGivePermission;
290
293
  function parentMaskApplier(parent) {
291
- const matchers = (0, misc_1.onlyTruthy)(Object.entries(parent.masks || {}).map(([k, { maskOnly, ...mods }]) => {
294
+ const matchers = (0, misc_1.onlyTruthy)(lodash_1.default.map(parent.masks, (v, k) => {
292
295
  k = k.startsWith('**/') ? k.slice(3) : !k.includes('/') ? k : ''; // ** globstar matches also zero subfolders, so this mask must be applied here too
296
+ const { maskOnly, ...mods } = v || {};
293
297
  // k is stored into the object for debugging purposes
294
298
  return k && { k, mods, matcher: (0, misc_1.makeMatcher)(k), mustBeFolder: maskOnly && (maskOnly === 'folders') };
295
299
  }));