hfs 0.52.0-beta8 → 0.52.0-beta9

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-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:{}};/*
1
+ import{g as OF,c as UF}from"./index-VGPvrfXn.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-z5aJG4U-.js"></script>
8
- <link rel="stylesheet" crossorigin href="/assets/index-m18RVJZD.css">
7
+ <script type="module" crossorigin src="/assets/index-VGPvrfXn.js"></script>
8
+ <link rel="stylesheet" crossorigin href="/assets/index-UuOYZhm8.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-beta8",
3
+ "version": "0.52.0-beta9",
4
4
  "description": "HTTP File Server",
5
5
  "keywords": [
6
6
  "file server",
@@ -69,7 +69,7 @@
69
69
  ]
70
70
  },
71
71
  "dependencies": {
72
- "@koa/router": "^10.1.1",
72
+ "@koa/router": "^12.0.1",
73
73
  "@node-rs/crc32": "^1.6.0",
74
74
  "acme-client": "^5.2.0",
75
75
  "basic-auth": "^2.0.1",
@@ -87,7 +87,7 @@
87
87
  "limiter": "^2.1.0",
88
88
  "lodash": "^4.17.21",
89
89
  "minimist": "^1.2.6",
90
- "nat-upnp-ts": "github:rejetto/nat-upnp-ts",
90
+ "nat-upnp-rejetto": "^2.0.2",
91
91
  "open": "^8.4.0",
92
92
  "qr-creator": "^1.0.0",
93
93
  "picomatch": "^3.0.1",
package/src/const.js CHANGED
@@ -37,7 +37,7 @@ const os_1 = require("os");
37
37
  const fs_1 = require("fs");
38
38
  const path_1 = require("path");
39
39
  __exportStar(require("./cross-const"), exports);
40
- exports.API_VERSION = 8.71;
40
+ exports.API_VERSION = 8.72;
41
41
  exports.COMPATIBLE_API_VERSION = 1; // while changes in the api are not breaking, this number stays the same, otherwise it is made equal to API_VERSION
42
42
  exports.HFS_REPO = 'rejetto/hfs';
43
43
  exports.argv = (0, minimist_1.default)(process.argv.slice(2));
@@ -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-31T10:37:17.876Z";
48
+ exports.BUILD_TIMESTAMP = "2024-04-03T09:13:22.887Z";
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('-');
@@ -138,7 +138,7 @@
138
138
  "good_bad": "{good} movido, {bad} fallado",
139
139
  "after_cut": "Su selección está ahora en el portapapeles.\nVaya a la carpeta de destino para pegar.",
140
140
  "Cancel clipboard": "Cancelar portapapeles",
141
- "to_clipboard_source": "A la carpeta",
141
+ "to_clipboard_source": "Volver a la carpeta de origen",
142
142
  "Paste": "Pegar",
143
143
  "clipboard_list": "Elementos en el portapapeles:",
144
144
  "Close": "Cerrar",
@@ -138,7 +138,7 @@
138
138
  "good_bad": "{good} siirretty, {bad} epäonnistui",
139
139
  "after_cut": "Valintasi on nyt leikepöydällä.\nMene kohdekansioon liittääksesi.",
140
140
  "Cancel clipboard": "Sulje leikepöytä",
141
- "to_clipboard_source": "Takaisin lähdekansioon",
141
+ "to_clipboard_source": "Palaa lähdekansioon",
142
142
  "Paste": "Liitä",
143
143
  "clipboard_list": "Kohteet leikepöydällä:",
144
144
  "Close": "Sulje",
@@ -126,7 +126,7 @@
126
126
  "good_bad": "{good} spostati, {bad} falliti",
127
127
  "after_cut": "Hai messo negli appunti, ora spostati fino alla destinazione e premi \"Incolla\".",
128
128
  "Cancel clipboard": "Annulla appunti",
129
- "to_clipboard_source": "Torna all'origine'",
129
+ "to_clipboard_source": "Torna alla cartella d'origine",
130
130
  "Paste": "Incolla",
131
131
  "clipboard_list": "Elementi negli appunti",
132
132
  "Close": "Chiudi",
@@ -120,7 +120,7 @@
120
120
  "good_bad": "{good} verplaatst, {bad} mislukt",
121
121
  "after_cut": "Uw selectie is nu naar het klembord gekopieerd.\nGa naar de bestemmings map om te plakken.",
122
122
  "Cancel clipboard": "Cancel clipboard",
123
- "to_clipboard_source": "Naar map",
123
+ "to_clipboard_source": "Ga terug naar de bronmap",
124
124
  "Paste": "Plakken",
125
125
  "clipboard_list": "Items in het klembord:",
126
126
  "Close": "Sluit",
@@ -138,7 +138,7 @@
138
138
  "good_bad": "{good} {good,plural, one{перемещён} other{перемещено}}, {bad} неуспешно",
139
139
  "after_cut": "Выбранное скопировано в буфер обмена.\nПерейдите в папку назначения для вставки.",
140
140
  "Cancel clipboard": "Отменить буфер обмена",
141
- "to_clipboard_source": "В папку",
141
+ "to_clipboard_source": "Вернуться в исходную папку",
142
142
  "Paste": "Вставить",
143
143
  "clipboard_list": "Элементы в буфере обмена:",
144
144
  "Close": "Закрыть",
@@ -137,7 +137,7 @@
137
137
  "good_bad": "{good} đã di chuyển, {bad} thất bại",
138
138
  "after_cut": "Cái đã chọn đã lưu trong clipboard.\nTới folder khác để dán.",
139
139
  "Cancel clipboard": "Bỏ clipboard",
140
- "to_clipboard_source": "Tới folder",
140
+ "to_clipboard_source": "Quay lại thư mục nguồn",
141
141
  "Paste": "Dán",
142
142
  "clipboard_list": "Clipboard:",
143
143
  "Close": "Đóng",
@@ -19,7 +19,7 @@
19
19
  "delete_hint": "请先单击“选择”某个项目,才能执行删除.",
20
20
  "delete_confirm": "确认删除 {n} 项?",
21
21
  "delete_completed": "删除: {n} 成功!",
22
- "delete_failed": "删除失败, {n,plural, one{# failed} other{# failed}}",
22
+ "delete_failed": "删除失败, {n,plural, other{# 个失败}}",
23
23
  "delete_select": "选择要删除的内容",
24
24
  "Delete": "删除",
25
25
  "Options": "选项",
@@ -57,7 +57,7 @@
57
57
  "Create folder": "创建文件夹",
58
58
  "Pick files": "选择文件",
59
59
  "Pick folder": "选择文件夹",
60
- "send_files": "开始上传 {n,plural,one{# file} other{# files}}, {size}",
60
+ "send_files": "开始上传 {n,plural,other{# 个文件}}, {size}",
61
61
  "Clear": "清空",
62
62
  "failed_upload": "无法上传 {name}",
63
63
  "confirm_resume": "是否重命名?",
@@ -134,11 +134,11 @@
134
134
  "upload_dd_hint": "您可以将文件拖放到文件列表中进行上传",
135
135
  "Upload not available": "上传不可用",
136
136
  "Cut": "剪切",
137
- "n_items": "{n,plural, one{# item} other{# items}}",
137
+ "n_items": "{n,plural, other{# 个项目}}",
138
138
  "good_bad": "{good}个已移动, {bad}个失败",
139
139
  "after_cut": "您的选择已成功添加到剪贴板,\n请前往目标文件夹粘贴。",
140
140
  "Cancel clipboard": "取消剪贴板",
141
- "to_clipboard_source": "至文件夹",
141
+ "to_clipboard_source": "返回源文件夹",
142
142
  "Paste": "粘贴",
143
143
  "clipboard_list": "剪贴板文件:"
144
144
  }
package/src/listen.js CHANGED
@@ -104,7 +104,7 @@ function getCertObject() {
104
104
  }
105
105
  exports.getCertObject = getCertObject;
106
106
  const considerHttps = (0, misc_1.debounceAsync)(async () => {
107
- var _a, _b, _c, _d, _e;
107
+ var _a, _b, _c, _d, _e, _f;
108
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;
@@ -117,7 +117,7 @@ const considerHttps = (0, misc_1.debounceAsync)(async () => {
117
117
  if (cert) {
118
118
  const cn = (_b = cert.subject) === null || _b === void 0 ? void 0 : _b.CN;
119
119
  if (cn)
120
- console.log("certificate loaded for", cn);
120
+ console.log("certificate loaded for", ((_c = cert.altNames) === null || _c === void 0 ? void 0 : _c.join(' + ')) || cn);
121
121
  const now = new Date();
122
122
  const from = new Date(cert.validFrom);
123
123
  const to = new Date(cert.validTo);
@@ -135,10 +135,10 @@ const considerHttps = (0, misc_1.debounceAsync)(async () => {
135
135
  }
136
136
  }
137
137
  const namesForOutput = { cert: 'certificate', private_key: 'private key' };
138
- const missing = (_c = httpsNeeds.find(x => !x.get())) === null || _c === void 0 ? void 0 : _c.key();
138
+ const missing = (_d = httpsNeeds.find(x => !x.get())) === null || _d === void 0 ? void 0 : _d.key();
139
139
  if (missing)
140
140
  return httpsSrv.error = "missing " + namesForOutput[missing];
141
- const cantRead = (_d = httpsNeeds.find(x => !httpsOptions[x.key()])) === null || _d === void 0 ? void 0 : _d.key();
141
+ const cantRead = (_e = httpsNeeds.find(x => !httpsOptions[x.key()])) === null || _e === void 0 ? void 0 : _e.key();
142
142
  if (cantRead)
143
143
  return httpsSrv.error = "cannot read " + namesForOutput[cantRead];
144
144
  }
@@ -155,7 +155,7 @@ const considerHttps = (0, misc_1.debounceAsync)(async () => {
155
155
  printUrls(httpsSrv.name);
156
156
  events_1.default.emit('https ready');
157
157
  nat_1.defaultBaseUrl.proto = 'https';
158
- nat_1.defaultBaseUrl.port = (_e = getCurrentPort(httpsSrv)) !== null && _e !== void 0 ? _e : 0;
158
+ nat_1.defaultBaseUrl.port = (_f = getCurrentPort(httpsSrv)) !== null && _f !== void 0 ? _f : 0;
159
159
  });
160
160
  exports.cert = (0, config_1.defineConfig)('cert', '');
161
161
  exports.privateKey = (0, config_1.defineConfig)('private_key', '');
package/src/nat.js CHANGED
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.getNatInfo = exports.getPublicIps = exports.upnpClient = exports.defaultBaseUrl = void 0;
7
7
  const valtio_1 = require("valtio");
8
- const nat_upnp_ts_1 = require("nat-upnp-ts");
8
+ const nat_upnp_rejetto_1 = require("nat-upnp-rejetto");
9
9
  const debounceAsync_1 = require("./debounceAsync");
10
10
  const cross_1 = require("./cross");
11
11
  const github_1 = require("./github");
@@ -27,7 +27,7 @@ exports.defaultBaseUrl = (0, valtio_1.proxy)({
27
27
  return `${this.proto}://${this.publicIps[0] || this.externalIp || this.localIp}${!this.port || this.port === defPort ? '' : ':' + this.port}`;
28
28
  }
29
29
  });
30
- exports.upnpClient = new nat_upnp_ts_1.Client({ timeout: 4000 });
30
+ exports.upnpClient = new nat_upnp_rejetto_1.Client({ timeout: 4000 });
31
31
  const originalMethod = exports.upnpClient.getGateway;
32
32
  // other client methods call getGateway too, so this will ensure they reuse this same result
33
33
  exports.upnpClient.getGateway = (0, debounceAsync_1.debounceAsync)(() => originalMethod.apply(exports.upnpClient), 0, { retain: cross_1.HOUR, retainFailure: 30000 });