hfs 0.52.0-beta6 → 0.52.0-beta8

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.
@@ -1,4 +1,4 @@
1
- import{g as OF,c as UF}from"./index-w_Bu3TcZ.js";function gF(sF,hF){for(var eF=0;eF<hF.length;eF++){const tF=hF[eF];if(typeof tF!="string"&&!Array.isArray(tF)){for(const w in tF)if(w!=="default"&&!(w in sF)){const lF=Object.getOwnPropertyDescriptor(tF,w);lF&&Object.defineProperty(sF,w,lF.get?lF:{enumerable:!0,get:()=>tF[w]})}}}return Object.freeze(Object.defineProperty(sF,Symbol.toStringTag,{value:"Module"}))}var dF={exports:{}};/*
1
+ import{g as OF,c as UF}from"./index-z5aJG4U-.js";function gF(sF,hF){for(var eF=0;eF<hF.length;eF++){const tF=hF[eF];if(typeof tF!="string"&&!Array.isArray(tF)){for(const w in tF)if(w!=="default"&&!(w in sF)){const lF=Object.getOwnPropertyDescriptor(tF,w);lF&&Object.defineProperty(sF,w,lF.get?lF:{enumerable:!0,get:()=>tF[w]})}}}return Object.freeze(Object.defineProperty(sF,Symbol.toStringTag,{value:"Module"}))}var dF={exports:{}};/*
2
2
  * [js-sha512]{@link https://github.com/emn178/js-sha512}
3
3
  *
4
4
  * @version 0.8.0
@@ -4,8 +4,8 @@
4
4
  <meta charset="utf-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=0" />
6
6
  <link href="/fontello.css" rel="stylesheet" />
7
- <script type="module" crossorigin src="/assets/index-w_Bu3TcZ.js"></script>
8
- <link rel="stylesheet" crossorigin href="/assets/index-fqsRmx7w.css">
7
+ <script type="module" crossorigin src="/assets/index-z5aJG4U-.js"></script>
8
+ <link rel="stylesheet" crossorigin href="/assets/index-m18RVJZD.css">
9
9
  </head>
10
10
  <body>
11
11
  <noscript>You need to enable JavaScript to run this app.</noscript>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hfs",
3
- "version": "0.52.0-beta6",
3
+ "version": "0.52.0-beta8",
4
4
  "description": "HTTP File Server",
5
5
  "keywords": [
6
6
  "file server",
package/src/acme.js CHANGED
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.makeCert = exports.acmeMiddleware = void 0;
7
- const cross_1 = require("./cross");
7
+ const misc_1 = require("./misc");
8
8
  const http_1 = require("http");
9
9
  const nat_1 = require("./nat");
10
10
  const listen_1 = require("./listen");
@@ -15,7 +15,7 @@ const promises_1 = __importDefault(require("fs/promises"));
15
15
  const config_1 = require("./config");
16
16
  const events_1 = __importDefault(require("./events"));
17
17
  const selfCheck_1 = require("./selfCheck");
18
- let acmeMiddlewareEnabled = false;
18
+ let acmeOngoing = false;
19
19
  const acmeTokens = {};
20
20
  const acmeListener = (req, res) => {
21
21
  var _a;
@@ -24,23 +24,23 @@ const acmeListener = (req, res) => {
24
24
  return;
25
25
  const token = req.url.slice(BASE.length);
26
26
  console.debug("got http challenge", token);
27
- res.statusCode = cross_1.HTTP_OK;
27
+ res.statusCode = misc_1.HTTP_OK;
28
28
  res.end(acmeTokens[token]);
29
- return true;
29
+ return true; // true = responded
30
30
  };
31
31
  const acmeMiddleware = (ctx, next) => {
32
- if (!acmeMiddlewareEnabled || !Boolean(acmeListener(ctx.req, ctx.res)))
32
+ if (!acmeOngoing || !acmeListener(ctx.req, ctx.res))
33
33
  return next();
34
34
  };
35
35
  exports.acmeMiddleware = acmeMiddleware;
36
36
  const TEMP_MAP = { private: 80, public: { host: '', port: 80 }, description: 'hfs temporary', ttl: 5000 }; // from my tests (zyxel VMG8825), lower values won't make a working mapping
37
- (0, cross_1.repeat)(cross_1.MINUTE, async (stop) => {
37
+ (0, misc_1.repeat)(misc_1.MINUTE, async (stop) => {
38
38
  await nat_1.upnpClient.getGateway(); // without this, the next call will break upnp support
39
39
  const res = await nat_1.upnpClient.getMappings();
40
40
  const leftover = res.find(x => x.description === TEMP_MAP.description); // in case the process is interrupted
41
41
  if (!leftover)
42
- return void (stop()); // we are good
43
- if (acmeMiddlewareEnabled)
42
+ return void stop(); // we are good
43
+ if (acmeOngoing)
44
44
  return; // it doesn't count, as we are in the middle of something. Retry later
45
45
  stop();
46
46
  return nat_1.upnpClient.removeMapping(TEMP_MAP);
@@ -49,13 +49,14 @@ async function generateSSLCert(domain, email, altNames) {
49
49
  // will answer challenge through our koa app (if on port 80) or must we spawn a dedicated server?
50
50
  const nat = await (0, nat_1.getNatInfo)();
51
51
  const { http } = await (0, listen_1.getServerStatus)();
52
- const tempSrv = nat.externalPort === 80 || http.listening && http.port === 80 ? undefined : (0, http_1.createServer)(acmeListener);
52
+ const tempSrv = nat.externalPort === 80 || http.listening && http.port === 80 ? undefined
53
+ : (0, http_1.createServer)((req, res) => acmeListener(req, res) || res.end('HFS')); // also satisfy self-check
53
54
  if (tempSrv)
54
55
  await new Promise(resolve => tempSrv.listen(80, resolve).on('error', (e) => {
55
56
  console.debug("cannot listen on 80", e.code || e);
56
57
  resolve(); // go on anyway
57
58
  }));
58
- acmeMiddlewareEnabled = true;
59
+ acmeOngoing = true;
59
60
  console.debug("acme challenge server ready");
60
61
  let tempMap;
61
62
  try {
@@ -63,12 +64,12 @@ async function generateSSLCert(domain, email, altNames) {
63
64
  let check = await (0, selfCheck_1.selfCheck)(checkUrl); // some check services may not consider the domain, but we already verified that
64
65
  if ((check === null || check === void 0 ? void 0 : check.success) === false && nat.upnp && !nat.mapped80) {
65
66
  console.debug("setting temporary port forward");
66
- tempMap = await (0, cross_1.haveTimeout)(10000, nat_1.upnpClient.createMapping(TEMP_MAP).catch(() => { })).catch(() => { });
67
+ tempMap = await (0, misc_1.haveTimeout)(10000, nat_1.upnpClient.createMapping(TEMP_MAP).catch(() => { })).catch(() => { });
67
68
  check = await (0, selfCheck_1.selfCheck)(checkUrl); // repeat test
68
69
  }
69
70
  //if (!check) throw new ApiError(HTTP_FAILED_DEPENDENCY, "couldn't test port 80")
70
71
  if ((check === null || check === void 0 ? void 0 : check.success) === false)
71
- throw new apiMiddleware_1.ApiError(cross_1.HTTP_FAILED_DEPENDENCY, "port 80 is not working on the specified domain");
72
+ throw new apiMiddleware_1.ApiError(misc_1.HTTP_FAILED_DEPENDENCY, "port 80 is not working on the specified domain");
72
73
  const acmeClient = new acme_client_1.default.Client({
73
74
  accountKey: await acme_client_1.default.crypto.createPrivateKey(),
74
75
  directoryUrl: acme_client_1.default.directory.letsencrypt.production
@@ -92,7 +93,7 @@ async function generateSSLCert(domain, email, altNames) {
92
93
  console.debug("removing temporary port forward");
93
94
  nat_1.upnpClient.removeMapping(TEMP_MAP).catch(() => { }); // clean after ourselves
94
95
  }
95
- acmeMiddlewareEnabled = false;
96
+ acmeOngoing = false;
96
97
  if (tempSrv)
97
98
  await new Promise(res => tempSrv.close(res));
98
99
  console.debug('acme terminated');
@@ -100,7 +101,7 @@ async function generateSSLCert(domain, email, altNames) {
100
101
  }
101
102
  exports.makeCert = (0, debounceAsync_1.debounceAsync)(async (domain, email, altNames) => {
102
103
  if (!domain)
103
- return new apiMiddleware_1.ApiError(cross_1.HTTP_BAD_REQUEST, 'bad params');
104
+ return new apiMiddleware_1.ApiError(misc_1.HTTP_BAD_REQUEST, 'bad params');
104
105
  const res = await generateSSLCert(domain, email, altNames).catch(e => {
105
106
  var _a;
106
107
  throw !((_a = e.message) === null || _a === void 0 ? void 0 : _a.includes('not match this challenge')) ? e // another acme server?
@@ -116,7 +117,7 @@ exports.makeCert = (0, debounceAsync_1.debounceAsync)(async (domain, email, altN
116
117
  const acmeDomain = (0, config_1.defineConfig)('acme_domain', '');
117
118
  const acmeEmail = (0, config_1.defineConfig)('acme_email', '');
118
119
  const acmeRenew = (0, config_1.defineConfig)('acme_renew', false); // handle config changes
119
- events_1.default.once('https ready', () => (0, cross_1.repeat)(cross_1.HOUR, renewCert));
120
+ events_1.default.once('https ready', () => (0, misc_1.repeat)(misc_1.HOUR, renewCert));
120
121
  // checks if the cert is near expiration date, and if so renews it
121
122
  const renewCert = (0, debounceAsync_1.debounceAsync)(async () => {
122
123
  const [domain, ...altNames] = acmeDomain.get().split(',');
@@ -128,8 +129,8 @@ const renewCert = (0, debounceAsync_1.debounceAsync)(async () => {
128
129
  const now = new Date();
129
130
  const validTo = new Date(cert.validTo);
130
131
  // not expiring in a month
131
- if (now > new Date(cert.validFrom) && now < validTo && validTo.getTime() - now.getTime() >= 30 * cross_1.DAY)
132
+ if (now > new Date(cert.validFrom) && now < validTo && validTo.getTime() - now.getTime() >= 30 * misc_1.DAY)
132
133
  return console.log("certificate still good");
133
134
  await (0, exports.makeCert)(domain, acmeEmail.get(), altNames)
134
135
  .catch(e => console.log("error renewing certificate: ", String(e.message || e)));
135
- }, 0, { retain: cross_1.DAY, retainFailure: cross_1.HOUR });
136
+ }, 0, { retain: misc_1.DAY, retainFailure: misc_1.HOUR });
package/src/adminApis.js CHANGED
@@ -64,7 +64,10 @@ exports.adminApis = {
64
64
  };
65
65
  },
66
66
  set_config_text: ({ text }) => config_1.configFile.save(text, { reparse: true }),
67
- update: ({ tag }) => (0, update_1.update)(tag).catch(e => { var _a, _b; return ((_a = e.cause) === null || _a === void 0 ? void 0 : _a.statusCode) ? new apiMiddleware_1.ApiError((_b = e.cause) === null || _b === void 0 ? void 0 : _b.statusCode) : e; }),
67
+ update: ({ tag }) => (0, update_1.update)(tag).catch(e => {
68
+ var _a, _b;
69
+ throw ((_a = e.cause) === null || _a === void 0 ? void 0 : _a.statusCode) ? new apiMiddleware_1.ApiError((_b = e.cause) === null || _b === void 0 ? void 0 : _b.statusCode) : e;
70
+ }),
68
71
  async check_update() {
69
72
  return { options: await (0, update_1.getUpdates)() };
70
73
  },
@@ -147,7 +147,7 @@ const apis = {
147
147
  await (0, plugins_1.stopPlugin)(id);
148
148
  await (0, github_1.downloadPlugin)(found.repo, { branch: online.branch, overwrite: true });
149
149
  if (enabled)
150
- (0, plugins_1.startPlugin)(id).then(); // don't wait, in case it fails to start
150
+ void (0, plugins_1.startPlugin)(id); // don't wait, in case it fails to start
151
151
  return {};
152
152
  },
153
153
  async uninstall_plugin({ id }) {
@@ -51,6 +51,8 @@ function apiMiddleware(apis) {
51
51
  }
52
52
  }
53
53
  catch (e) {
54
+ if (typeof e === 'string') // message meant to be transmitted
55
+ return send(const_1.HTTP_BAD_REQUEST, e);
54
56
  if (typeof e === 'number')
55
57
  e = new ApiError(e);
56
58
  res = e;
package/src/comments.js CHANGED
@@ -8,7 +8,7 @@ const config_1 = require("./config");
8
8
  const path_1 = require("path");
9
9
  const cross_1 = require("./cross");
10
10
  const util_files_1 = require("./util-files");
11
- const promises_1 = require("fs/promises");
11
+ const fs_1 = require("fs");
12
12
  const misc_1 = require("./misc");
13
13
  const lodash_1 = __importDefault(require("lodash"));
14
14
  const iconv_lite_1 = __importDefault(require("iconv-lite"));
@@ -32,29 +32,41 @@ exports.setCommentFor = (0, misc_1.singleWorkerFromBatchWorker)(async (jobs) =>
32
32
  comments.set(file, comment);
33
33
  }
34
34
  // encode comments in descript.ion format
35
- let txt = '';
36
- comments.forEach((c, f) => txt += (f.includes(' ') ? `"${f}"` : f) + ' ' + (c.includes('\n') ? c.replaceAll('\n', '\\n') + MULTILINE_SUFFIX : c) + '\n');
37
- const buffer = iconv_lite_1.default.encode(txt, descriptIonEncoding.get());
38
- await (0, promises_1.writeFile)((0, path_1.join)(folder, exports.DESCRIPT_ION), buffer);
35
+ const ws = (0, fs_1.createWriteStream)((0, path_1.join)(folder, exports.DESCRIPT_ION));
36
+ comments.forEach((comment, filename) => {
37
+ const multiline = comment.includes('\n');
38
+ const line = (filename.includes(' ') ? `"${filename}"` : filename)
39
+ + ' ' + (multiline ? comment.replaceAll('\n', '\\n') : comment);
40
+ ws.write(iconv_lite_1.default.encode(line, descriptIonEncoding.get()));
41
+ if (multiline)
42
+ ws.write(MULTILINE_SUFFIX, 'binary');
43
+ ws.write('\n');
44
+ });
39
45
  }));
40
46
  });
41
47
  function areCommentsEnabled() {
42
48
  return exports.descriptIon.get();
43
49
  }
44
50
  exports.areCommentsEnabled = areCommentsEnabled;
45
- const MULTILINE_SUFFIX = '\x04\xc2';
51
+ const MULTILINE_SUFFIX = Buffer.from([4, 0xC2]);
46
52
  function readDescription(path) {
47
- return (0, util_files_1.parseFile)((0, path_1.join)(path, exports.DESCRIPT_ION), raw =>
48
53
  // decoding could also be done with native TextDecoder.decode, but we need iconv for the encoding anyway
49
- new Map(iconv_lite_1.default.decode(raw, descriptIonEncoding.get()).split('\n').map(line => {
50
- const quoted = line[0] === '"' ? 1 : 0;
51
- const i = quoted ? line.indexOf('"', 2) + 1 : line.indexOf(' ');
52
- const fn = line.slice(quoted, i - quoted);
53
- let comment = line.slice(i + 1);
54
- if (comment.endsWith(MULTILINE_SUFFIX))
55
- comment = comment.slice(0, -2).replaceAll('\\n', '\n');
56
- return [fn, comment];
57
- })));
54
+ return (0, util_files_1.parseFile)((0, path_1.join)(path, exports.DESCRIPT_ION), raw => {
55
+ // for simplicity we "remove" the sequence MULTILINE_SUFFIX before iconv.decode messes it up
56
+ for (let i = 0; i < raw.length; i++)
57
+ if (raw[i] === MULTILINE_SUFFIX[0] && raw[i + 1] === MULTILINE_SUFFIX[1] && [undefined, 13, 10].includes(raw[i + 2]))
58
+ raw[i] = raw[i + 1] = 10;
59
+ const decoded = iconv_lite_1.default.decode(raw, descriptIonEncoding.get());
60
+ const ret = new Map(decoded.split('\n').map(line => {
61
+ const quoted = line[0] === '"' ? 1 : 0;
62
+ const i = quoted ? line.indexOf('"', 2) + 1 : line.indexOf(' ');
63
+ const fn = line.slice(quoted, i - quoted);
64
+ const comment = line.slice(i + 1).replaceAll('\\n', '\n');
65
+ return [fn, comment];
66
+ }));
67
+ ret.delete('');
68
+ return ret;
69
+ });
58
70
  }
59
71
  descriptIonEncoding.sub(() => {
60
72
  for (const k of util_files_1.parseFileCache.keys())
package/src/config.js CHANGED
@@ -180,7 +180,7 @@ const saveDebounced = (0, misc_1.debounceAsync)(async () => {
180
180
  await exports.configFile.save(stringify({ ...state, version: const_1.VERSION }))
181
181
  .catch(err => console.error('Failed at saving config file, please ensure it is writable.', String(err)));
182
182
  });
183
- const saveConfigAsap = () => void (saveDebounced());
183
+ const saveConfigAsap = () => void saveDebounced();
184
184
  exports.saveConfigAsap = saveConfigAsap;
185
185
  function stringify(obj) {
186
186
  return yaml_1.default.stringify(obj, { lineWidth: 1000 });
package/src/const.js CHANGED
@@ -45,7 +45,7 @@ exports.DEV = process.env.DEV || exports.argv.dev ? 'DEV' : '';
45
45
  exports.ORIGINAL_CWD = process.cwd();
46
46
  exports.HFS_STARTED = new Date();
47
47
  const PKG_PATH = (0, path_1.join)(__dirname, '..', 'package.json');
48
- exports.BUILD_TIMESTAMP = "2024-03-24T16:21:00.359Z";
48
+ exports.BUILD_TIMESTAMP = "2024-03-31T10:37:17.876Z";
49
49
  const pkg = JSON.parse(fs.readFileSync(PKG_PATH, 'utf8'));
50
50
  exports.VERSION = pkg.version;
51
51
  exports.RUNNING_BETA = exports.VERSION.includes('-');
@@ -37,8 +37,10 @@ function debounceAsync(callback, wait = 100, options = {}) {
37
37
  const waitFor = Math.min(waitingCap, leading ? wait - (now - started) : wait);
38
38
  if (waitFor > 0)
39
39
  await new Promise(resolve => setTimeout(resolve, waitFor));
40
- if (!whoIsWaiting) // canceled
41
- return void (waitingSince = 0);
40
+ if (!whoIsWaiting) { // canceled
41
+ waitingSince = 0;
42
+ return undefined;
43
+ }
42
44
  if (whoIsWaiting !== args) // another fresher call is waiting
43
45
  return latestDebouncer;
44
46
  return exec();
@@ -98,7 +98,7 @@ exports.frontEndApis = {
98
98
  throw new apiMiddleware_1.ApiError(const_1.HTTP_UNAUTHORIZED);
99
99
  try {
100
100
  await (0, promises_1.rm)(node.source, { recursive: true });
101
- (0, comments_1.setCommentFor)(node.source, '').then();
101
+ void (0, comments_1.setCommentFor)(node.source, '');
102
102
  return {};
103
103
  }
104
104
  catch (e) {
@@ -125,8 +125,8 @@ exports.frontEndApis = {
125
125
  (0, comments_1.getCommentFor)(node.source).then(c => {
126
126
  if (!c)
127
127
  return;
128
- (0, comments_1.setCommentFor)(node.source, '').then();
129
- (0, comments_1.setCommentFor)(destSource, c).then();
128
+ void (0, comments_1.setCommentFor)(node.source, '');
129
+ void (0, comments_1.setCommentFor)(destSource, c);
130
130
  });
131
131
  }
132
132
  return {};
@@ -1,7 +1,7 @@
1
1
  {
2
- "author": "Eidy Estupiñan Varona",
3
- "version": 1.0,
4
- "hfs_version": "0.46.0",
2
+ "author": "Eidy Estupiñan Varona, Arturo Fernández Rivas",
3
+ "version": 1.2,
4
+ "hfs_version": "0.52.0",
5
5
  "translate": {
6
6
  "Select": "Seleccionar",
7
7
  "n_files": "{n,plural,one{# archivo} other {# archivos}}",
@@ -10,9 +10,9 @@
10
10
  "select_count": "{n,plural, one{# seleccionado} other{# seleccionados}}",
11
11
  "filter_placeholder": "Escriba aquí para filtrar la lista a continuación",
12
12
  "Select some files": "Seleccione algunos archivos",
13
- "zip_checkboxes": "Use casillas de verificación para seleccionar los archivos, luego puede usar la opción Zip nuevamente",
13
+ "zip_checkboxes": "Use las casillas de verificación para seleccionar los archivos, luego puede usar la opción Zip nuevamente",
14
14
  "zip_tooltip_selected": "Descargue los elementos seleccionados como un solo archivo zip",
15
- "zip_tooltip_whole": "Descargue la lista completa (sin filtrar) como un solo archivo zip. Si selecciona algunos elementos, solo se descargarán esos.",
15
+ "zip_tooltip_whole": "Descargue la lista completa (sin filtrar) o los archivos seleccionados, como un solo archivo zip.",
16
16
  "zip_confirm_search": "¿Descargar TODOS los resultados de esta búsqueda como archivo ZIP?",
17
17
  "zip_confirm_folder": "¿Descargar toda la carpeta como archivo Zip?",
18
18
  "select_tooltip": "La selección se aplica a \"Zip\" y \"Eliminar\" (cuando esté disponible), pero también puede filtrar la lista",
@@ -25,37 +25,37 @@
25
25
  "Options": "Opciones",
26
26
  "Search": "Buscar",
27
27
  "Zip": "Zip",
28
- "search_msg": "Buscar esta carpeta y subcarpetas",
28
+ "search_msg": "Buscar en esta carpeta y subcarpetas",
29
29
  "Searching": "Buscando",
30
30
  "Searched": "Buscado",
31
31
  "Clear search": "Limpiar búsqueda",
32
32
  "Interrupted": "Interrumpido",
33
33
  "stopped_before": "stopped_before",
34
- "empty_list": "Lista vacia",
34
+ "empty_list": "Lista vacía",
35
35
  "filter_none": "No filtrado",
36
36
  "Admin-panel": "Administración",
37
37
  "Login": "Acceder",
38
38
  "Username": "Usuario",
39
39
  "Password": "Contraseña",
40
- "login_untrusted": "Acceso abortado: la identidad del servidor no es confiable",
40
+ "login_untrusted": "Acceso cancelado: la identidad del servidor no es confiable",
41
41
  "login_bad_credentials": "Credenciales no válidas",
42
42
  "login_bad_cookies": "Las Cookies no funcionan - acceso fallido",
43
43
  "User panel": "Panel de usuario",
44
44
  "Change password": "Cambiar contraseña",
45
45
  "enter_pass": "Nueva contraseña",
46
- "enter_pass2": "Confirmación",
47
- "pass2_mismatch": "Error: Las contraseñas no coinciden. cambio abortado.",
46
+ "enter_pass2": "Confirme contraseña",
47
+ "pass2_mismatch": "Error: Las contraseñas no coinciden.",
48
48
  "password_changed": "Contraseña cambiada",
49
49
  "Logout": "Salir",
50
50
  "connection error": "Error de conexión",
51
51
  "Full timestamp:": "Fecha - Hora completa",
52
52
  "Search was interrupted": "La búsqueda fue interrumpida",
53
53
  "Stop list": "Detener Lista",
54
- "upload_starting": "Su descarga debería iniciar ahora",
55
- "wrong_account": "La cuenta {u} no tiene acceso, prueba otra",
54
+ "upload_starting": "Su descarga debería iniciarse ahora",
55
+ "wrong_account": "La cuenta {u} no tiene acceso.",
56
56
  "no_upload_here": "No tiene permisos para subir a la carpeta actual",
57
57
  "Create folder": "Crear carpeta",
58
- "Pick files": "Seleccioanr archivo",
58
+ "Pick files": "Seleccionar archivo",
59
59
  "Pick folder": "Seleccionar carpeta",
60
60
  "send_files": "Enviar {n,plural,one {# archivo} other{# archivos}}, {size}",
61
61
  "Clear": "Limpiar",
@@ -64,16 +64,16 @@
64
64
  "file too large": "archivo demasiado grande",
65
65
  "Enter folder name": "Nombre de la carpeta",
66
66
  "Successfully created": "Creado satisfactoriamente",
67
- "enter_folder": "Entre la carpeta",
67
+ "enter_folder": "Introduzca carpeta",
68
68
  "folder_exists": "Ya existe una carpeta con ese nombre",
69
69
  "Sort by": "Ordenar por",
70
70
  "name": "nombre",
71
71
  "extension": "extensión",
72
72
  "size": "tamaño",
73
73
  "time": "fecha",
74
- "Invert order": "Invertir orden",
75
- "Folders first": "Carpetas primero",
76
- "Numeric names": "Nombres numéricos",
74
+ "Invert order": "Orden descendente",
75
+ "Folders first": "Mostrar primero las carpetas",
76
+ "Numeric names": "Ordenar números",
77
77
  "theme:": "Tema",
78
78
  "auto": "auto",
79
79
  "light": "Claro",
@@ -85,11 +85,11 @@
85
85
  "Don't": "Cancelar",
86
86
  "Warning": "Alerta",
87
87
  "Error": "Error",
88
- "Info": "Info",
88
+ "Info": "Información",
89
89
  "Unauthorized": "No autorizado",
90
90
  "Forbidden": "Denegado",
91
91
  "Not found": "No encontrado",
92
- "Server error": "Server error",
92
+ "Server error": "Error de servidor",
93
93
  "Upload": "Subir",
94
94
  "upload_concluded": "Subida completada",
95
95
  "upload_finished": "{n} completado ({size})",
@@ -106,13 +106,58 @@
106
106
  "Skip existing files": "Saltar archivos existentes",
107
107
  "Size": "Tamaño",
108
108
  "Timestamp": "Fecha - Hora",
109
- "Show": "Mostrar",
109
+ "Show": "Visualizar",
110
110
  "Loading failed": "Carga fallida",
111
111
  "Rename": "Renombrar",
112
112
  "Tiles mode:": "Cantidad elementos",
113
113
  "off": "Apagado",
114
114
  "Operation successful": "Operación Completada",
115
115
  "Uploader": "Subido por",
116
- "Download counter": "Contador de descargas"
116
+ "Download counter": "Contador de descargas",
117
+ "Switch zoom mode": "Cambiar modo de zoom",
118
+ "Full screen": "Pantalla completa",
119
+ "File Show help": "Ayuda",
120
+ "showHelpMain": "Puede usar el teclado para algunas acciones:",
121
+ "showHelp_←/→": "←/→",
122
+ "showHelp_↑/↓": "↑/↓",
123
+ "showHelp_space": "barra espaciadora",
124
+ "showHelp_←/→_body": "ir al archivo anterior/siguiente",
125
+ "showHelp_↑/↓_body": "scroll miniaturas",
126
+ "showHelp_space_body": "seleccionar",
127
+ "showHelp_D_body": "descargar",
128
+ "showHelp_Z_body": "modos de zoom",
129
+ "showHelp_F_body": "pantalla completa",
130
+ "Destination": "Destino",
131
+ "in_queue": "{n} en cola",
132
+ "enter_comment": "Descripción para {name}",
133
+ "Comment": "Descripción",
134
+ "upload_dd_hint": "Puede cargar archivos arrastrando y soltando en la lista de archivos",
135
+ "Upload not available": "Carga no disponible",
136
+ "Cut": "Cortar",
137
+ "n_items": "{n,plural, one{# elemento} other{# elementos}}",
138
+ "good_bad": "{good} movido, {bad} fallado",
139
+ "after_cut": "Su selección está ahora en el portapapeles.\nVaya a la carpeta de destino para pegar.",
140
+ "Cancel clipboard": "Cancelar portapapeles",
141
+ "to_clipboard_source": "A la carpeta",
142
+ "Paste": "Pegar",
143
+ "clipboard_list": "Elementos en el portapapeles:",
144
+ "Close": "Cerrar",
145
+ "Folder": "Carpeta",
146
+ "Web page": "Página web",
147
+ "Link": "Enlace",
148
+ "Auto-play": "Auto-reproducir",
149
+ "autoplay_seconds": "Segundos entre imágenes",
150
+ "Select all": "Seleccionar todo",
151
+ "go_first": "Ir al principio",
152
+ "go_last": "Ir al final",
153
+ "Shuffle": "Aleatorio",
154
+ "Repeat": "Repetir",
155
+ "showHelpListShortcut": "En la lista de archivos, haga clic manteniendo pulsada {key} para Mostrar rápidamente",
156
+ "Invalid value": "Valor no válido",
157
+ "upload_skipped": "Se salta {n}",
158
+ "Overwrite policy": "Reglas para sobreescribir",
159
+ "Rename to avoid overwriting": "Renombrar para evitar sobrescribir",
160
+ "Overwrite existing files": "Sobrescribir archivos existentes",
161
+ "Menu": "Menú"
117
162
  }
118
163
  }
@@ -129,7 +129,7 @@
129
129
  "showHelp_F_body": "koko näyttö",
130
130
  "Destination": "Kohde",
131
131
  "in_queue": "{n} jonossa",
132
- "enter_comment": "Kirjoita kommentti tälle tiedostolle / hakemistolle",
132
+ "enter_comment": "Kirjoita kommentti kohteelle {name}",
133
133
  "Comment": "Kommentti",
134
134
  "upload_dd_hint": "Voit lähettää tiedostoja raahaamalla niitä tiedostolistauksessa",
135
135
  "Upload not available": "Lähettäminen ei ole mahdollista",
@@ -117,8 +117,8 @@
117
117
  "showHelp_↑/↓_body": "Scorri immagini lunghe",
118
118
  "Destination": "Destinazione",
119
119
  "in_queue": "{n} in coda",
120
- "enter_comment": "Comment for this file",
121
- "Comment": "Comment",
120
+ "enter_comment": "Commento per {name}",
121
+ "Comment": "Commento",
122
122
  "upload_dd_hint": "Puoi uploadare file trascinandoli sulla lista principale",
123
123
  "Upload not available": "Upload non disponibile",
124
124
  "Cut": "Taglia",
package/src/listen.js CHANGED
@@ -62,7 +62,7 @@ const commonServerOptions = { requestTimeout: 0 };
62
62
  const commonServerAssign = { headersTimeout: 30000, timeout: misc_1.MINUTE }; // 'headersTimeout' is not recognized by type lib, and 'timeout' is not effective when passed in parameters
63
63
  const considerHttp = (0, misc_1.debounceAsync)(async () => {
64
64
  await (0, misc_1.waitFor)(() => index_1.app);
65
- stopServer(httpSrv).then();
65
+ void stopServer(httpSrv);
66
66
  httpSrv = Object.assign(http.createServer(commonServerOptions, index_1.app.callback()), { name: 'http' }, commonServerAssign);
67
67
  const port = await startServer(httpSrv, { port: exports.portCfg.get(), host: listenInterface.get() });
68
68
  if (!port)
@@ -105,7 +105,7 @@ function getCertObject() {
105
105
  exports.getCertObject = getCertObject;
106
106
  const considerHttps = (0, misc_1.debounceAsync)(async () => {
107
107
  var _a, _b, _c, _d, _e;
108
- stopServer(httpsSrv).then();
108
+ void stopServer(httpsSrv);
109
109
  nat_1.defaultBaseUrl.proto = 'http';
110
110
  nat_1.defaultBaseUrl.port = (_a = getCurrentPort(httpSrv)) !== null && _a !== void 0 ? _a : 0;
111
111
  let port = exports.httpsPortCfg.get();
package/src/perm.js CHANGED
@@ -96,7 +96,7 @@ exports.accountsConfig.sub(obj => {
96
96
  saveAccountsAsap();
97
97
  (0, misc_1.setHidden)(rec, { username: norm });
98
98
  }
99
- updateAccount(rec, {}).then(); // work fields
99
+ void updateAccount(rec, {}); // work fields
100
100
  });
101
101
  });
102
102
  function normalizeUsername(username) {
package/src/plugins.js CHANGED
@@ -440,7 +440,8 @@ function customApiCall(method, ...params) {
440
440
  return mapPlugins(pl => { var _a, _b; return (_b = (_a = pl.getData().customApi) === null || _a === void 0 ? void 0 : _a[method]) === null || _b === void 0 ? void 0 : _b.call(_a, ...params); });
441
441
  }
442
442
  function getError(id) {
443
- return getPluginInfo(id).error;
443
+ var _a;
444
+ return (_a = getPluginInfo(id)) === null || _a === void 0 ? void 0 : _a.error;
444
445
  }
445
446
  function setError(id, error) {
446
447
  const info = getPluginInfo(id);
package/src/update.js CHANGED
@@ -61,7 +61,7 @@ function localUpdateAvailable() {
61
61
  }
62
62
  exports.localUpdateAvailable = localUpdateAvailable;
63
63
  async function updateSupported() {
64
- return const_1.IS_BINARY && !await util_os_1.RUNNING_AS_SERVICE;
64
+ return const_1.argv.forceupdate || const_1.IS_BINARY && !await util_os_1.RUNNING_AS_SERVICE;
65
65
  }
66
66
  exports.updateSupported = updateSupported;
67
67
  async function update(tagOrUrl = '') {
@@ -119,8 +119,8 @@ async function update(tagOrUrl = '') {
119
119
  setTimeout(() => process.exit()); // give time to return (and caller to complete, eg: rest api to reply)
120
120
  }
121
121
  catch (e) {
122
- console.error((e === null || e === void 0 ? void 0 : e.message) || String(e));
123
122
  plugins_1.pluginsWatcher.unpause();
123
+ throw (e === null || e === void 0 ? void 0 : e.message) || String(e);
124
124
  }
125
125
  }
126
126
  exports.update = update;
@@ -137,6 +137,6 @@ if (const_1.argv.updating) { // we were launched with a temporary name, restore
137
137
  if (const_1.IS_WINDOWS) // this method on Mac works only once, and without console
138
138
  (0, misc_1.onProcessExit)(() => launch(dest, ['--updated'])); // launch+sync here would cause old process to stay open, locking ports
139
139
  else
140
- (0, open_1.default)(dest).then();
140
+ void (0, open_1.default)(dest);
141
141
  process.exit();
142
142
  }
package/src/upload.js CHANGED
@@ -32,6 +32,7 @@ function setUploadMeta(path, ctx) {
32
32
  });
33
33
  }
34
34
  // stay sync because we use this function with formidable()
35
+ const cache = {};
35
36
  function uploadWriter(base, path, ctx) {
36
37
  if ((0, misc_1.dirTraversal)(path))
37
38
  return fail(const_1.HTTP_FOOL);
@@ -43,7 +44,11 @@ function uploadWriter(base, path, ctx) {
43
44
  const reqSize = Number(ctx.headers["content-length"]);
44
45
  if (reqSize)
45
46
  try {
46
- const { free } = (0, util_os_1.getDiskSpaceSync)(dir);
47
+ if (!Object.hasOwn(cache, dir)) {
48
+ cache[dir] = (0, util_os_1.getDiskSpaceSync)(dir);
49
+ setTimeout(() => delete cache[dir], 3000); // invalidate shortly
50
+ }
51
+ const { free } = cache[dir];
47
52
  if (typeof free !== 'number' || isNaN(free))
48
53
  throw '';
49
54
  if (reqSize > free - (min || 0))
package/src/util-os.js CHANGED
@@ -41,7 +41,7 @@ async function getDiskSpaces() {
41
41
  description: x.Description
42
42
  }));
43
43
  }
44
- const { stdout } = await (0, util_1.promisify)(child_process_1.exec)(`df -k`).catch(err => {
44
+ const { stdout } = await (0, util_1.promisify)(child_process_1.exec)(`df -k -l`).catch(err => {
45
45
  throw err.status === 1 ? Error('miss')
46
46
  : err.status === 127 ? Error('unsupported')
47
47
  : err;
@@ -51,7 +51,7 @@ async function getDiskSpaces() {
51
51
  throw Error('unsupported');
52
52
  return (0, misc_1.onlyTruthy)(out.map(one => {
53
53
  const bits = one.split(/\s+/);
54
- const name = bits.shift() || '';
54
+ const name = bits.pop() || bits.shift() || '';
55
55
  const [, used = 0, free = 0] = bits.map(x => Number(x) * 1024);
56
56
  const total = used + free;
57
57
  return total && { free, total, name };
package/src/watchLoad.js CHANGED
@@ -26,11 +26,11 @@ function watchLoad(path, parser, { failedOnFirstAttempt, immediateFirst } = {})
26
26
  try {
27
27
  watcher = (0, fs_1.watch)(path, () => {
28
28
  if (!save.isWorking())
29
- debounced().then();
29
+ void debounced();
30
30
  });
31
31
  debounced().catch(x => x);
32
32
  if (immediateFirst)
33
- debounced.flush().then();
33
+ void debounced.flush();
34
34
  }
35
35
  catch (e) {
36
36
  retry = setTimeout(install, 3000); // manual watching until watch is successful