hfs 0.53.0-beta8.93 → 0.53.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.
- package/package.json +1 -1
- package/src/commands.js +4 -5
- package/src/const.js +1 -1
- package/src/ddns.js +1 -1
- package/src/langs/hfs-lang-ru.json +12 -9
- package/src/serveGuiAndSharedFiles.js +1 -1
- package/src/update.js +3 -3
package/package.json
CHANGED
package/src/commands.js
CHANGED
|
@@ -38,10 +38,9 @@ function parseCommandLine(line) {
|
|
|
38
38
|
if (cmd.cb.length > params.length)
|
|
39
39
|
return console.error("insufficient parameters, expected: " + cmd.params);
|
|
40
40
|
Promise.resolve(cmd.cb(...params)).then(() => console.log("+++ command executed"), (err) => {
|
|
41
|
-
if (typeof err
|
|
42
|
-
console.error("command failed:", err);
|
|
43
|
-
else
|
|
41
|
+
if (typeof err !== 'string' && !(err === null || err === void 0 ? void 0 : err.message))
|
|
44
42
|
throw err;
|
|
43
|
+
console.error("command failed:", err.message || err);
|
|
45
44
|
});
|
|
46
45
|
}
|
|
47
46
|
const commands = {
|
|
@@ -99,12 +98,12 @@ const commands = {
|
|
|
99
98
|
},
|
|
100
99
|
update: {
|
|
101
100
|
params: '[<version>=latest]',
|
|
102
|
-
cb: update_1.update
|
|
101
|
+
cb: update_1.update,
|
|
103
102
|
},
|
|
104
103
|
'check-update': {
|
|
105
104
|
params: '',
|
|
106
105
|
async cb() {
|
|
107
|
-
const update =
|
|
106
|
+
const update = (await (0, update_1.getUpdates)(true))[0];
|
|
108
107
|
if (!update)
|
|
109
108
|
throw "you already have the latest version: " + const_1.VERSION;
|
|
110
109
|
console.log("new version available", update.name);
|
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-06-
|
|
48
|
+
exports.BUILD_TIMESTAMP = "2024-06-07T10:19:15.753Z";
|
|
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('-');
|
package/src/ddns.js
CHANGED
|
@@ -21,7 +21,7 @@ let stopFetching;
|
|
|
21
21
|
let lastIps;
|
|
22
22
|
events_1.default.onListeners(EVENT, cbs => {
|
|
23
23
|
stopFetching === null || stopFetching === void 0 ? void 0 : stopFetching();
|
|
24
|
-
if (!(cbs === null || cbs === void 0 ? void 0 : cbs.size
|
|
24
|
+
if (!(cbs === null || cbs === void 0 ? void 0 : cbs.size))
|
|
25
25
|
return;
|
|
26
26
|
stopFetching = (0, cross_1.repeat)(cross_1.HOUR, async () => {
|
|
27
27
|
const IPs = await (0, nat_1.getPublicIps)();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"author": "Mefistofell, SanokKule",
|
|
3
|
-
"version": 2.
|
|
4
|
-
"hfs_version": "0.
|
|
3
|
+
"version": 2.6,
|
|
4
|
+
"hfs_version": "0.53.0",
|
|
5
5
|
"translate": {
|
|
6
6
|
"Select": "Выбор",
|
|
7
7
|
"n_files": "{n,plural, one{# файл} few{# файла} many{# файлов}}",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"Full timestamp:": "Дата и время: ",
|
|
52
52
|
"Search was interrupted": "Поиск прерван",
|
|
53
53
|
"Stop list": "Остановить",
|
|
54
|
-
"
|
|
54
|
+
"upload_starting": "Загрузка началась",
|
|
55
55
|
"wrong_account": "Пользователь {u} не имеет доступа к этой папке",
|
|
56
56
|
"no_upload_here": "Нет доступа к загрузке файлов в эту папку",
|
|
57
57
|
"Create folder": "Создать папку",
|
|
@@ -129,7 +129,7 @@
|
|
|
129
129
|
"showHelp_F_body": "полноэкранный режим",
|
|
130
130
|
"Destination": "Назначение",
|
|
131
131
|
"in_queue": "{n} в очереди",
|
|
132
|
-
"enter_comment": "Комментарий для
|
|
132
|
+
"enter_comment": "Комментарий для {name}",
|
|
133
133
|
"Comment": "Комментировать",
|
|
134
134
|
"upload_dd_hint": "Вы можете загрузить файлы перетащив их в список файлов",
|
|
135
135
|
"Upload not available": "Загрузка недоступна",
|
|
@@ -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": "Закрыть",
|
|
@@ -159,9 +159,12 @@
|
|
|
159
159
|
"Rename to avoid overwriting": "Переименовать для избежания перезаписи",
|
|
160
160
|
"Overwrite existing files": "Перезаписать существующие файлы",
|
|
161
161
|
"Menu": "Меню",
|
|
162
|
-
"
|
|
163
|
-
"
|
|
164
|
-
"
|
|
165
|
-
"
|
|
162
|
+
"clipboard": "Буфер обмена ({content})",
|
|
163
|
+
"to_clipboard_source_tooltip": "Перейти в папку где находится содержимое из буфера обмена",
|
|
164
|
+
"more_items": "Ещё {rest} элементов",
|
|
165
|
+
"Show details": "Показать детали",
|
|
166
|
+
"upload_conflict": "уже существует",
|
|
167
|
+
"Logged in": "Вход выполнен",
|
|
168
|
+
"Logged out": "Выход выполнен"
|
|
166
169
|
}
|
|
167
170
|
}
|
|
@@ -109,7 +109,7 @@ const serveGuiAndSharedFiles = async (ctx, next) => {
|
|
|
109
109
|
: !(0, vfs_1.statusCodeForMissingPerm)(node, 'can_read', ctx) ? (0, serveFile_1.serveFileNode)(ctx, node) // all good
|
|
110
110
|
: ctx.status !== cross_const_1.HTTP_UNAUTHORIZED ? null // all errors don't need extra handling, except unauthorized
|
|
111
111
|
: path.endsWith('/') ? (ctx.state.serveApp = true) && serveFrontendFiles(ctx, next) // since this is no dir, final / means we are dealing with default file, for which we still provide fancy login
|
|
112
|
-
: (ctx.set('WWW-Authenticate', 'Basic'), (0, errorPages_1.sendErrorPage)(ctx)); // this is necessary to support standard urls with credentials
|
|
112
|
+
: (ctx.set('WWW-Authenticate', 'Basic'), (0, errorPages_1.sendErrorPage)(ctx)); // this is necessary to support standard urls with credentials
|
|
113
113
|
if (!path.endsWith('/'))
|
|
114
114
|
return ctx.redirect(ctx.state.revProxyPath + ctx.originalUrl.replace(/(\?|$)/, '/$1')); // keep query-string, if any
|
|
115
115
|
if ((0, vfs_1.statusCodeForMissingPerm)(node, 'can_list', ctx)) {
|
package/src/update.js
CHANGED
|
@@ -18,14 +18,14 @@ const config_1 = require("./config");
|
|
|
18
18
|
const util_os_1 = require("./util-os");
|
|
19
19
|
const first_1 = require("./first");
|
|
20
20
|
const updateToBeta = (0, config_1.defineConfig)('update_to_beta', false);
|
|
21
|
-
async function getUpdates() {
|
|
21
|
+
async function getUpdates(strict = false) {
|
|
22
22
|
const stable = await (0, github_1.getRepoInfo)(const_1.HFS_REPO + '/releases/latest');
|
|
23
23
|
const verStable = ver(stable);
|
|
24
24
|
const ret = await getBetas();
|
|
25
25
|
stable.isNewer = config_1.currentVersion.olderThan(stable.tag_name);
|
|
26
26
|
if (stable.isNewer || const_1.RUNNING_BETA)
|
|
27
27
|
ret.push(stable);
|
|
28
|
-
return ret;
|
|
28
|
+
return ret.filter(x => !strict || x.isNewer);
|
|
29
29
|
function ver(x) {
|
|
30
30
|
return (0, config_1.versionToScalar)(x.name);
|
|
31
31
|
}
|
|
@@ -73,7 +73,7 @@ async function update(tagOrUrl = '') {
|
|
|
73
73
|
if (!updateSource) {
|
|
74
74
|
if (/^\d/.test(tagOrUrl)) // work even if the tag is passed without the initial 'v' (useful for console commands)
|
|
75
75
|
tagOrUrl = 'v' + tagOrUrl;
|
|
76
|
-
const update = !tagOrUrl ? (await getUpdates())[0]
|
|
76
|
+
const update = !tagOrUrl ? (await getUpdates(true))[0]
|
|
77
77
|
: await (0, github_1.getRepoInfo)(const_1.HFS_REPO + '/releases/tags/' + tagOrUrl).catch(e => {
|
|
78
78
|
if (e.message === '404')
|
|
79
79
|
console.error("version not found");
|