hfs 0.57.5 → 0.57.7-beta1

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.
@@ -0,0 +1,179 @@
1
+ {
2
+ "author": "Mantas Veselis - www.helgi.online",
3
+ "version": 1.0,
4
+ "hfs_version": "0.57.5",
5
+ "translate": {
6
+ "Select": "Pasirinkti",
7
+ "n_files": "{n,plural,one{# failas} few{# failai} other{# failų}}",
8
+ "n_folders": "{n,plural,one{# aplankas} few{# aplankai} other{# aplankų}}",
9
+ "filter_count": "{n,plural, one{# filtruota} few{# filtruoti} other{# filtruota}}",
10
+ "select_count": "{n,plural, one{# pasirinkta} few{# pasirinkti} other{# pasirinkta}}",
11
+ "filter_placeholder": "Įveskite, kad filtruotumėte sąrašą žemiau",
12
+ "Select some files": "Pasirinkite failus",
13
+ "zip_checkboxes": "Naudokite žymės langelius, kad pasirinktumėte failus, tada galėsite vėl naudoti Zip",
14
+ "zip_tooltip_selected": "Atsisiųsti pasirinktus elementus kaip vieną zip failą",
15
+ "zip_tooltip_whole": "Atsisiųsti visą sąrašą (nefiltruotą) kaip vieną zip failą. Jei pasirinksite keletą elementų, bus atsisiųsti tik jie.",
16
+ "zip_confirm_search": "Atsisiųsti VISUS šios paieškos rezultatus kaip ZIP archyvą?",
17
+ "zip_confirm_folder": "Atsisiųsti VISĄ aplanką kaip ZIP archyvą?",
18
+ "select_tooltip": "Pasirinkimas taikomas „Zip“ ir „Trinti“ (kai prieinama), bet taip pat galite filtruoti sąrašą",
19
+ "delete_hint": "Norėdami ištrinti, pirmiausia spustelėkite Pasirinkti",
20
+ "delete_confirm": "Ištrinti {n,plural, one{# elementą} few{# elementus} other{# elementų}}?",
21
+ "delete_completed": "Ištrynimas: {n} baigta",
22
+ "delete_failed": ", {n,plural, one{# nepavyko} few{# nepavyko} other{# nepavyko}}",
23
+ "delete_select": "Pasirinkite ką nors, ką norite ištrinti",
24
+ "Delete": "Trinti",
25
+ "Options": "Parinktys",
26
+ "Search": "Paieška",
27
+ "Zip": "Zip",
28
+ "search_msg": "Ieškoti šiame aplanke ir poaplankiuose",
29
+ "Searching": "Ieškoma",
30
+ "Searched": "Ieškota",
31
+ "Clear search": "Išvalyti paiešką",
32
+ "Interrupted": "Nutraukta",
33
+ "stopped_before": "Sustabdyta nieko neradus",
34
+ "empty_list": "Nieko nėra",
35
+ "filter_none": "Nėra atitikmenų šiam filtrui",
36
+ "Admin-panel": "Administratoriaus skydelis",
37
+ "Login": "Prisijungti",
38
+ "Username": "Vartotojo vardas",
39
+ "Password": "Slaptažodis",
40
+ "login_untrusted": "Prisijungimas nutrauktas: serverio tapatybe negalima pasitikėti",
41
+ "login_bad_credentials": "Neteisingi prisijungimo duomenys",
42
+ "login_bad_cookies": "Slapukai neveikia - prisijungti nepavyko",
43
+ "User panel": "Vartotojo skydelis",
44
+ "Change password": "Keisti slaptažodį",
45
+ "enter_pass": "Įveskite naują slaptažodį",
46
+ "enter_pass2": "PAKARTOTINAI įveskite tą patį naują slaptažodį",
47
+ "pass2_mismatch": "Antrasis įvestas slaptažodis nesutapo su pirmuoju. Procedūra nutraukta.",
48
+ "password_changed": "Slaptažodis pakeistas",
49
+ "Logout": "Atsijungti",
50
+ "connection error": "ryšio klaida",
51
+ "Full timestamp:": "Pilnas laiko žymeklis:",
52
+ "Search was interrupted": "Paieška buvo nutraukta",
53
+ "Stop list": "Sustabdyti sąrašą",
54
+ "download_starting": "Jūsų atsisiuntimas turėtų prasidėti",
55
+ "wrong_account": "Paskyra {u} neturi prieigos, bandykite kitą",
56
+ "no_upload_here": "Nėra įkėlimo leidimo dabartiniam aplankui",
57
+ "Create folder": "Sukurti aplanką",
58
+ "Pick files": "Pasirinkti failus",
59
+ "Pick folder": "Pasirinkti aplanką",
60
+ "send_files": "Siųsti {n,plural,one{# failą} few{# failus} other{# failų}}, {size}",
61
+ "Clear": "Išvalyti",
62
+ "failed_upload": "Nepavyko įkelti {name}",
63
+ "file too large": "failas per didelis",
64
+ "Enter folder name": "Įveskite aplanko pavadinimą",
65
+ "Successfully created": "Sėkmingai sukurta",
66
+ "enter_folder": "Įeiti į aplanką",
67
+ "folder_exists": "Aplankas tokiu pačiu pavadinimu jau egzistuoja",
68
+ "Sort by:": "Rūšiuoti pagal: {by}",
69
+ "name": "pavadinimą",
70
+ "extension": "failo tipa",
71
+ "size": "dydį",
72
+ "time": "laiką",
73
+ "Invert order": "Atvirkštine tvarka",
74
+ "Folders first": "Aplankai pirmiausia",
75
+ "Numeric names": "Rūšiavimas pagal skaitinę vertę",
76
+ "theme:": "Tema:",
77
+ "auto": "automatinė",
78
+ "light": "šviesi",
79
+ "dark": "tamsi",
80
+ "parent folder": "pagrindinis aplankas",
81
+ "home": "namai",
82
+ "Continue": "Tęsti",
83
+ "Confirm": "Patvirtinti",
84
+ "Don't": "Ne",
85
+ "Warning": "Įspėjimas",
86
+ "Error": "Klaida",
87
+ "Info": "Informacija",
88
+ "Unauthorized": "Neautorizuota",
89
+ "Forbidden": "Draudžiama",
90
+ "Not found": "Nerasta",
91
+ "Server error": "Serverio klaida",
92
+ "Upload": "Įkelti",
93
+ "upload_concluded": "Įkėlimas baigtas:",
94
+ "upload_finished": "{n} baigta ({size})",
95
+ "upload_errors": "{n} nepavyko",
96
+ "upload_file_rejected": "Kai kurie failai nebuvo priimti",
97
+ "File menu": "Failo meniu",
98
+ "Folder menu": "Aplanko meniu",
99
+ "Name": "Pavadinimas",
100
+ "file_open": "Atidaryti",
101
+ "Download": "Atsisiųsti",
102
+ "Missing permission": "Trūksta leidimo",
103
+ "Reload": "Perkrauti",
104
+ "Get list": "Gauti sąrašą",
105
+ "Skip existing files": "Praleisti esamus failus",
106
+ "Size": "Dydis",
107
+ "Timestamp": "Laiko žymė",
108
+ "Show": "Rodyti",
109
+ "Loading failed": "Nepavyko įkelti",
110
+ "Rename": "Pervadinti",
111
+ "Tiles mode:": "Plytelių režimas:",
112
+ "off": "išjungta",
113
+ "Operation successful": "Operacija sėkminga",
114
+ "Uploader": "Įkėlėjas",
115
+ "Download counter": "Atsisiuntimų skaitiklis",
116
+ "Switch zoom mode": "Perjungti mastelio režimą",
117
+ "Full screen": "Visas ekranas",
118
+ "File Show help": "Failų rodymo pagalba",
119
+ "showHelpMain": "Galite naudoti klaviatūrą kai kuriems veiksmams:",
120
+ "showHelp_←/→": "←/→",
121
+ "showHelp_↑/↓": "↑/↓",
122
+ "showHelp_space": "tarpo mygtukas",
123
+ "showHelp_←/→_body": "Pereiti prie ankstesnio/kito failo",
124
+ "showHelp_↑/↓_body": "Slinkti didelius paveikslėlius",
125
+ "Destination": "Paskirtis",
126
+ "in_queue": "{n} eilėje",
127
+ "enter_comment": "Komentaras {name}",
128
+ "Comment": "Komentaras",
129
+ "upload_dd_hint": "Failus galite įkelti vilkdami ir numesdami į failų sąrašą",
130
+ "Upload not available": "Įkėlimas nepasiekiamas",
131
+ "Cut": "Iškirpti",
132
+ "n_items": "{n,plural, one{# elementas} few{# elementai} other{# elementų}}",
133
+ "move_results": "{good} perkelta{bad,plural, =0{} other{, # nepavyko}}",
134
+ "after_cut": "Jūsų pasirinkimas dabar yra iškarpinėje.\nEikite į paskirties aplanką, kad įklijuotumėte.",
135
+ "Cancel clipboard": "Atšaukti iškarpinę",
136
+ "to_clipboard_source": "Grįžti į šaltinio aplanką",
137
+ "Paste": "Įklijuoti",
138
+ "clipboard_list": "Elementai iškarpinėje:",
139
+ "Close": "Uždaryti",
140
+ "Folder": "Aplankas",
141
+ "Web page": "Tinklalapis",
142
+ "Link": "Nuoroda",
143
+ "Auto-play": "Automatinis paleidimas",
144
+ "autoplay_seconds": "Sekundės laukimo ties paveikslėliais",
145
+ "Select all": "Pasirinkti viską",
146
+ "go_first": "Eiti į pirmą elementą",
147
+ "go_last": "Eiti į paskutinį elementą",
148
+ "Shuffle": "Maišyti",
149
+ "Repeat": "Kartoti",
150
+ "showHelpListShortcut": "Failų sąraše spustelėkite laikydami {key}, kad greitai parodytumėte",
151
+ "Invalid value": "Neteisinga vertė",
152
+ "upload_skipped": "{n} praleista",
153
+ "Overwrite policy": "Perrašymo politika",
154
+ "Rename to avoid overwriting": "Pervadinti, kad išvengtumėte perrašymo",
155
+ "Overwrite existing files": "Perrašyti esamus failus",
156
+ "Menu": "Meniu",
157
+ "clipboard": "Iškarpinė ({content})",
158
+ "to_clipboard_source_tooltip": "Eiti į aplanką, kuriame yra iškarpinės turinys",
159
+ "more_items": "{n} daugiau elemento(-ų)",
160
+ "Show details": "Rodyti detales",
161
+ "upload_conflict": "jau egzistuoja",
162
+ "Logged in": "Prisijungta",
163
+ "Logged out": "Atsijungta",
164
+ "Cancel": "Atšaukti",
165
+ "allow_session_ip_change": "Leisti IP keitimą šios sesijos metu",
166
+ "focus_hint": "Rašydami klaviatūra, ieškote ir fokusuojate sąrašo elementus.",
167
+ "copy_links": "Kopijuoti nuorodas",
168
+ "Calculate": "Skaičiuoti",
169
+ "Creation": "Pagal sukūrimo datą",
170
+ "creation": "datą",
171
+ "required_change_password": "Privalote pasikeisti slaptažodį",
172
+ "Wildcards": "Pakaitos simboliai",
173
+ "Considering resume": "Apsvarstyti atnaujinimą",
174
+ "Yes": "Taip",
175
+ "No": "Ne",
176
+ "esc_again": "Paspauskite ESC du kartus, kad uždarytumėte",
177
+ "insufficient storage": "nepakanka vietos"
178
+ }
179
+ }
package/src/misc.js CHANGED
@@ -46,7 +46,7 @@ function pattern2filter(pattern) {
46
46
  return (s) => !pattern || matcher((0, path_1.basename)(s || ''));
47
47
  }
48
48
  function isLocalHost(c) {
49
- const ip = typeof c === 'string' ? c : c.socket.remoteAddress; // don't use Context.ip as it is subject to proxied ips, and that's no use for localhost detection
49
+ const ip = typeof c === 'string' ? c : c.ip;
50
50
  return ip && (0, cross_1.isIpLocalHost)(ip);
51
51
  }
52
52
  // this will memory-leak over mask, so be careful with what you use this. Object is 3x faster than _.memoize
package/src/plugins.js CHANGED
@@ -37,7 +37,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
37
37
  return (mod && mod.__esModule) ? mod : { "default": mod };
38
38
  };
39
39
  Object.defineProperty(exports, "__esModule", { value: true });
40
- exports.pluginsConfig = exports.suspendPlugins = exports.enablePlugins = exports.pluginsWatcher = exports.SERVER_CODE_ID = exports.Plugin = exports.pluginsMiddleware = exports.STORAGE_FOLDER = exports.DELETE_ME_SUFFIX = exports.DISABLING_SUFFIX = exports.PATH = void 0;
40
+ exports.PLUGIN_MAIN_FILE = exports.pluginsConfig = exports.suspendPlugins = exports.enablePlugins = exports.pluginsWatcher = exports.SERVER_CODE_ID = exports.Plugin = exports.pluginsMiddleware = exports.STORAGE_FOLDER = exports.DELETE_ME_SUFFIX = exports.DISABLING_SUFFIX = exports.PATH = void 0;
41
41
  exports.isPluginRunning = isPluginRunning;
42
42
  exports.isPluginEnabled = isPluginEnabled;
43
43
  exports.enablePlugin = enablePlugin;
@@ -418,6 +418,7 @@ exports.enablePlugins = (0, config_1.defineConfig)('enable_plugins', ['antibrute
418
418
  exports.enablePlugins.sub(rescanAsap);
419
419
  exports.suspendPlugins = (0, config_1.defineConfig)(misc_1.CFG.suspend_plugins, false);
420
420
  exports.pluginsConfig = (0, config_1.defineConfig)('plugins_config', {});
421
+ exports.PLUGIN_MAIN_FILE = 'plugin.js';
421
422
  const pluginWatchers = new Map();
422
423
  async function rescan() {
423
424
  console.debug('scanning plugins');
@@ -431,7 +432,7 @@ async function rescan() {
431
432
  const id = path.split('/').slice(-1)[0];
432
433
  met.push(id);
433
434
  if (!pluginWatchers.has(id))
434
- pluginWatchers.set(id, watchPlugin(id, (0, path_1.join)(path, 'plugin.js')));
435
+ pluginWatchers.set(id, watchPlugin(id, (0, path_1.join)(path, exports.PLUGIN_MAIN_FILE)));
435
436
  }
436
437
  for (const [id, cancelWatcher] of pluginWatchers.entries())
437
438
  if (!met.includes(id)) {
@@ -665,15 +666,15 @@ function deleteModule(id) {
665
666
  function parsePluginSource(id, source) {
666
667
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
667
668
  const pl = { id };
668
- pl.description = (0, misc_1.tryJson)((_a = /exports.description *= *(".*")/.exec(source)) === null || _a === void 0 ? void 0 : _a[1]);
669
- pl.repo = (0, misc_1.tryJson)((_b = /exports.repo *= *(.*);? *$/m.exec(source)) === null || _b === void 0 ? void 0 : _b[1]);
670
- pl.version = (_d = Number((_c = /exports.version *= *(\d*\.?\d+)/.exec(source)) === null || _c === void 0 ? void 0 : _c[1])) !== null && _d !== void 0 ? _d : undefined;
671
- pl.apiRequired = (_f = (0, misc_1.tryJson)((_e = /exports.apiRequired *= *([ \d.,[\]]+)/.exec(source)) === null || _e === void 0 ? void 0 : _e[1])) !== null && _f !== void 0 ? _f : undefined;
672
- pl.isTheme = (_h = (0, misc_1.tryJson)((_g = /exports.isTheme *= *(true|false|"light"|"dark")/.exec(source)) === null || _g === void 0 ? void 0 : _g[1])) !== null && _h !== void 0 ? _h : (id.endsWith('-theme') || undefined);
673
- pl.preview = (_k = (0, misc_1.tryJson)((_j = /exports.preview *= *(.+)/.exec(source)) === null || _j === void 0 ? void 0 : _j[1])) !== null && _k !== void 0 ? _k : undefined;
674
- pl.depend = (_m = (0, misc_1.tryJson)((_l = /exports.depend *= *(\[[\s\S]*?])/m.exec(source)) === null || _l === void 0 ? void 0 : _l[1])) === null || _m === void 0 ? void 0 : _m.filter((x) => typeof x.repo === 'string' && x.version === undefined || typeof x.version === 'number'
669
+ pl.description = (0, misc_1.tryJson)((_a = /exports.description\s*=\s*(".*")/.exec(source)) === null || _a === void 0 ? void 0 : _a[1]);
670
+ pl.repo = (0, misc_1.tryJson)((_b = /exports.repo\s*=\s*(\S*)/.exec(source)) === null || _b === void 0 ? void 0 : _b[1]);
671
+ pl.version = (_d = Number((_c = /exports.version\s*=\s*(\d*\.?\d+)/.exec(source)) === null || _c === void 0 ? void 0 : _c[1])) !== null && _d !== void 0 ? _d : undefined;
672
+ pl.apiRequired = (_f = (0, misc_1.tryJson)((_e = /exports.apiRequired\s*=\s*([ \d.,[\]]+)/.exec(source)) === null || _e === void 0 ? void 0 : _e[1])) !== null && _f !== void 0 ? _f : undefined;
673
+ pl.isTheme = (_h = (0, misc_1.tryJson)((_g = /exports.isTheme\s*=\s*(true|false|"light"|"dark")/.exec(source)) === null || _g === void 0 ? void 0 : _g[1])) !== null && _h !== void 0 ? _h : (id.endsWith('-theme') || undefined);
674
+ pl.preview = (_k = (0, misc_1.tryJson)((_j = /exports.preview\s*=\s*(.+)/.exec(source)) === null || _j === void 0 ? void 0 : _j[1])) !== null && _k !== void 0 ? _k : undefined;
675
+ pl.depend = (_m = (0, misc_1.tryJson)((_l = /exports.depend\s*=\s*(\[[\s\S]*?])/m.exec(source)) === null || _l === void 0 ? void 0 : _l[1])) === null || _m === void 0 ? void 0 : _m.filter((x) => typeof x.repo === 'string' && x.version === undefined || typeof x.version === 'number'
675
676
  || console.warn("plugin dependency discarded", x));
676
- pl.changelog = (0, misc_1.tryJson)((_o = /exports.changelog *= *(\[[\s\S]*?])/m.exec(source)) === null || _o === void 0 ? void 0 : _o[1]);
677
+ pl.changelog = (0, misc_1.tryJson)((_o = /exports.changelog\s*=\s*(\[[\s\S]*?])/m.exec(source)) === null || _o === void 0 ? void 0 : _o[1]);
677
678
  if (Array.isArray(pl.apiRequired) && (pl.apiRequired.length !== 2 || !pl.apiRequired.every(lodash_1.default.isFinite))) // validate [from,to] form
678
679
  pl.apiRequired = undefined;
679
680
  calculateBadApi(pl);
package/src/serveFile.js CHANGED
@@ -38,7 +38,7 @@ function forceDownload(ctx, name) {
38
38
  function disposition(ctx, name, forceDownload = false) {
39
39
  // ctx.attachment is not working well on Windows. Eg: for file "èÖ.txt" it is producing `Content-Disposition: attachment; filename="??.txt"`. Koa uses module content-disposition, that actually produces a better result anyway: ``
40
40
  ctx.set('Content-Disposition', (forceDownload ? 'attachment; ' : '')
41
- + `filename="${toAsciiEquivalent(name)}"; filename*=UTF-8''${encodeURI(name).replace(/#/g, '%23')}`);
41
+ + `filename="${toAsciiEquivalent(name)}"; filename*=UTF-8''${encodeURIComponent(name)}`);
42
42
  }
43
43
  async function serveFileNode(ctx, node) {
44
44
  var _a, _b;
@@ -43,8 +43,7 @@ const serveGuiAndSharedFiles = async (ctx, next) => {
43
43
  if (path.length === cross_const_1.ADMIN_URI.length - 1 && cross_const_1.ADMIN_URI.startsWith(path))
44
44
  return ctx.redirect(ctx.state.revProxyPath + cross_const_1.ADMIN_URI);
45
45
  if (path.startsWith(cross_const_1.ADMIN_URI))
46
- return (0, adminApis_1.allowAdmin)(ctx) ? serveAdminPrefixed(ctx, next)
47
- : (0, errorPages_1.sendErrorPage)(ctx, cross_const_1.HTTP_FORBIDDEN);
46
+ return (0, adminApis_1.preventAdminAccess)(ctx) ? (0, errorPages_1.sendErrorPage)(ctx, cross_const_1.HTTP_FORBIDDEN) : serveAdminPrefixed(ctx, next);
48
47
  if (path.startsWith(cross_const_1.ICONS_URI)) {
49
48
  const a = path.substring(cross_const_1.ICONS_URI.length).split('/');
50
49
  const iconName = a.at(-1);