cloudcmd 19.16.0 → 19.18.0

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 (85) hide show
  1. package/ChangeLog +28 -0
  2. package/HELP.md +5 -2
  3. package/README.md +1 -1
  4. package/bin/cloudcmd.js +1 -1
  5. package/dist/cloudcmd.common.css +1 -1
  6. package/dist/cloudcmd.common.css.map +1 -1
  7. package/dist/cloudcmd.common.js +192 -158
  8. package/dist/cloudcmd.common.js.map +1 -1
  9. package/dist/cloudcmd.js +8 -0
  10. package/dist/cloudcmd.js.map +1 -1
  11. package/dist/index.html +2 -2
  12. package/dist/modules/cloud.js +8 -0
  13. package/dist/modules/cloud.js.map +1 -1
  14. package/dist/modules/command-line.js +8 -0
  15. package/dist/modules/command-line.js.map +1 -1
  16. package/dist/modules/config.js +8 -0
  17. package/dist/modules/config.js.map +1 -1
  18. package/dist/modules/contact.js +8 -0
  19. package/dist/modules/contact.js.map +1 -1
  20. package/dist/modules/edit-file-vim.js +8 -0
  21. package/dist/modules/edit-file-vim.js.map +1 -1
  22. package/dist/modules/edit-file.js +8 -0
  23. package/dist/modules/edit-file.js.map +1 -1
  24. package/dist/modules/edit-names-vim.js +8 -0
  25. package/dist/modules/edit-names-vim.js.map +1 -1
  26. package/dist/modules/edit-names.js +8 -0
  27. package/dist/modules/edit-names.js.map +1 -1
  28. package/dist/modules/edit.js +8 -0
  29. package/dist/modules/edit.js.map +1 -1
  30. package/dist/modules/help.js +8 -0
  31. package/dist/modules/help.js.map +1 -1
  32. package/dist/modules/konsole.js +8 -0
  33. package/dist/modules/konsole.js.map +1 -1
  34. package/dist/modules/markdown.js +8 -0
  35. package/dist/modules/markdown.js.map +1 -1
  36. package/dist/modules/menu.js +8 -0
  37. package/dist/modules/menu.js.map +1 -1
  38. package/dist/modules/operation.js +8 -0
  39. package/dist/modules/operation.js.map +1 -1
  40. package/dist/modules/polyfill.js +8 -0
  41. package/dist/modules/polyfill.js.map +1 -1
  42. package/dist/modules/terminal-run.js +8 -0
  43. package/dist/modules/terminal-run.js.map +1 -1
  44. package/dist/modules/terminal.js +8 -0
  45. package/dist/modules/terminal.js.map +1 -1
  46. package/dist/modules/upload.js +8 -0
  47. package/dist/modules/upload.js.map +1 -1
  48. package/dist/modules/user-menu.js +8 -0
  49. package/dist/modules/user-menu.js.map +1 -1
  50. package/dist/modules/view.js +8 -0
  51. package/dist/modules/view.js.map +1 -1
  52. package/dist/sw.js +1 -1
  53. package/dist-dev/cloudcmd.common.css +5 -3
  54. package/dist-dev/cloudcmd.common.js +26 -15
  55. package/dist-dev/cloudcmd.js +8 -0
  56. package/dist-dev/index.html +1 -2
  57. package/dist-dev/modules/cloud.js +8 -0
  58. package/dist-dev/modules/command-line.js +8 -0
  59. package/dist-dev/modules/config.js +8 -0
  60. package/dist-dev/modules/contact.js +8 -0
  61. package/dist-dev/modules/edit-file-vim.js +8 -0
  62. package/dist-dev/modules/edit-file.js +8 -0
  63. package/dist-dev/modules/edit-names-vim.js +8 -0
  64. package/dist-dev/modules/edit-names.js +8 -0
  65. package/dist-dev/modules/edit.js +8 -0
  66. package/dist-dev/modules/help.js +8 -0
  67. package/dist-dev/modules/konsole.js +8 -0
  68. package/dist-dev/modules/markdown.js +8 -0
  69. package/dist-dev/modules/menu.js +8 -0
  70. package/dist-dev/modules/operation.js +8 -0
  71. package/dist-dev/modules/polyfill.js +8 -0
  72. package/dist-dev/modules/terminal-run.js +8 -0
  73. package/dist-dev/modules/terminal.js +8 -0
  74. package/dist-dev/modules/upload.js +8 -0
  75. package/dist-dev/modules/user-menu.js +8 -0
  76. package/dist-dev/modules/view.js +8 -0
  77. package/dist-dev/sw.js +1 -1
  78. package/man/cloudcmd.1 +1 -1
  79. package/package.json +7 -5
  80. package/server/cloudcmd.js +15 -0
  81. package/server/rest/index.js +1 -1
  82. package/server/server.js +14 -2
  83. package/server/validate.js +2 -2
  84. package/tmpl/config.hbs +2 -1
  85. package/public/manifest.json +0 -11
@@ -112,6 +112,14 @@
112
112
  /******/ };
113
113
  /******/ })();
114
114
  /******/
115
+ /******/ /* webpack/runtime/set anonymous default export name */
116
+ /******/ (() => {
117
+ /******/ // set .name for anonymous default exports per ES spec
118
+ /******/ __webpack_require__.dn = (x) => {
119
+ /******/ (Object.getOwnPropertyDescriptor(x, "name") || {}).writable || Object.defineProperty(x, "name", { value: "default", configurable: true });
120
+ /******/ };
121
+ /******/ })();
122
+ /******/
115
123
  /******/ /* webpack/runtime/jsonp chunk loading */
116
124
  /******/ (() => {
117
125
  /******/ // no baseURI
package/dist-dev/sw.js CHANGED
@@ -37,7 +37,7 @@ eval("{// shim for using process in browser\nvar process = module.exports = {};\
37
37
  (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
38
38
 
39
39
  "use strict";
40
- eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var node_process__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! node:process */ \"./node_modules/process/browser.js\");\n/* harmony import */ var try_to_catch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\n/* harmony import */ var currify__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\n\n\n\nconst isDev = \"development\" === 'development';\nconst isGet = a => a.method === 'GET';\nconst isBasic = a => a.type === 'basic';\nconst wait = currify__WEBPACK_IMPORTED_MODULE_2__((f, e) => e.waitUntil(f()));\nconst respondWith = currify__WEBPACK_IMPORTED_MODULE_2__((f, e) => {\n const {\n request\n } = e;\n const {\n url\n } = request;\n const pathname = getPathName(url);\n if (url.endsWith('/') || /\\^\\/fs/.test(pathname)) return;\n if (!isGet(request)) return;\n if (!isBasic(request)) return;\n if (pathname.startsWith('/api')) return;\n if (/^socket.io/.test(pathname)) return;\n e.respondWith(f(e));\n});\nconst getPathName = url => new URL(url).pathname;\nconst date = \"Sun May 03 2026 16:02:09 GMT+0300 (Eastern European Summer Time)\";\nconst NAME = `cloudcmd: ${date}`;\nconst createRequest = a => new Request(a, {\n credentials: 'same-origin'\n});\nconst getRequest = (a, request) => {\n if (a !== '/') return request;\n return createRequest('/');\n};\nglobalThis.addEventListener('install', wait(onInstall));\nglobalThis.addEventListener('fetch', respondWith(onFetch));\nglobalThis.addEventListener('activate', wait(onActivate));\nasync function onActivate() {\n console.info(`cloudcmd: sw: activate: ${NAME}`);\n await globalThis.clients.claim();\n const keys = await caches.keys();\n const deleteCache = caches.delete.bind(caches);\n await Promise.all(keys.map(deleteCache));\n}\nasync function onInstall() {\n console.info(`cloudcmd: sw: install: ${NAME}`);\n await globalThis.skipWaiting();\n}\nasync function onFetch(event) {\n const {\n request\n } = event;\n const {\n url\n } = request;\n const pathname = getPathName(url);\n const newRequest = getRequest(pathname, event.request);\n const cache = await caches.open(NAME);\n const response = await cache.match(request);\n if (!isDev && response) return response;\n const [e, resp] = await (0,try_to_catch__WEBPACK_IMPORTED_MODULE_1__.tryToCatch)(fetch, newRequest, {\n credentials: 'same-origin'\n });\n if (e) return new Response(e.message);\n await addToCache(request, resp.clone());\n return resp;\n}\nasync function addToCache(request, response) {\n const cache = await caches.open(NAME);\n return cache.put(request, response);\n}\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/client/sw/sw.js\n}");
40
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var node_process__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! node:process */ \"./node_modules/process/browser.js\");\n/* harmony import */ var try_to_catch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\n/* harmony import */ var currify__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\n\n\n\nconst isDev = \"development\" === 'development';\nconst isGet = a => a.method === 'GET';\nconst isBasic = a => a.type === 'basic';\nconst wait = currify__WEBPACK_IMPORTED_MODULE_2__((f, e) => e.waitUntil(f()));\nconst respondWith = currify__WEBPACK_IMPORTED_MODULE_2__((f, e) => {\n const {\n request\n } = e;\n const {\n url\n } = request;\n const pathname = getPathName(url);\n if (url.endsWith('/') || /\\^\\/fs/.test(pathname)) return;\n if (!isGet(request)) return;\n if (!isBasic(request)) return;\n if (pathname.startsWith('/api')) return;\n if (/^socket.io/.test(pathname)) return;\n e.respondWith(f(e));\n});\nconst getPathName = url => new URL(url).pathname;\nconst date = \"Tue May 26 2026 00:21:38 GMT+0300 (Eastern European Summer Time)\";\nconst NAME = `cloudcmd: ${date}`;\nconst createRequest = a => new Request(a, {\n credentials: 'same-origin'\n});\nconst getRequest = (a, request) => {\n if (a !== '/') return request;\n return createRequest('/');\n};\nglobalThis.addEventListener('install', wait(onInstall));\nglobalThis.addEventListener('fetch', respondWith(onFetch));\nglobalThis.addEventListener('activate', wait(onActivate));\nasync function onActivate() {\n console.info(`cloudcmd: sw: activate: ${NAME}`);\n await globalThis.clients.claim();\n const keys = await caches.keys();\n const deleteCache = caches.delete.bind(caches);\n await Promise.all(keys.map(deleteCache));\n}\nasync function onInstall() {\n console.info(`cloudcmd: sw: install: ${NAME}`);\n await globalThis.skipWaiting();\n}\nasync function onFetch(event) {\n const {\n request\n } = event;\n const {\n url\n } = request;\n const pathname = getPathName(url);\n const newRequest = getRequest(pathname, event.request);\n const cache = await caches.open(NAME);\n const response = await cache.match(request);\n if (!isDev && response) return response;\n const [e, resp] = await (0,try_to_catch__WEBPACK_IMPORTED_MODULE_1__.tryToCatch)(fetch, newRequest, {\n credentials: 'same-origin'\n });\n if (e) return new Response(e.message);\n await addToCache(request, resp.clone());\n return resp;\n}\nasync function addToCache(request, response) {\n const cache = await caches.open(NAME);\n return cache.put(request, response);\n}\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/client/sw/sw.js\n}");
41
41
 
42
42
  /***/ },
43
43
 
package/man/cloudcmd.1 CHANGED
@@ -33,7 +33,7 @@ programs in browser from any computer, mobile or tablet device.
33
33
  --show-config show config values
34
34
  --show-dot-files show dot files
35
35
  --show-file-name show file name in view and edit modes
36
- --editor set editor: "dword", "edward" or "deepword"
36
+ --editor set editor: "dword", "edward", "deepword" or "qword"
37
37
  --menu set menu: "supermenu" or "aleman"
38
38
  --packer set packer: "tar" or "zip"
39
39
  --root set root directory
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloudcmd",
3
- "version": "19.16.0",
3
+ "version": "19.18.0",
4
4
  "type": "module",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "File manager for the web with console and editor",
@@ -105,6 +105,7 @@
105
105
  "es6-promisify": "^7.0.0",
106
106
  "execon": "^1.2.0",
107
107
  "express": "^5.1.0",
108
+ "express-rate-limit": "^8.5.2",
108
109
  "files-io": "^4.0.0",
109
110
  "find-up": "^8.0.0",
110
111
  "for-each-key": "^2.0.0",
@@ -130,6 +131,7 @@
130
131
  "ponse": "^8.0.0",
131
132
  "pullout": "^5.0.0",
132
133
  "putout": "^42.0.5",
134
+ "qword": "^1.0.0",
133
135
  "redzip": "^4.6.1",
134
136
  "rendy": "^5.0.0",
135
137
  "restafary": "^13.0.1",
@@ -159,22 +161,21 @@
159
161
  "@cloudcmd/stub": "^5.0.0",
160
162
  "@iocmd/wait": "^2.1.0",
161
163
  "@putout/eslint-flat": "^4.0.0",
164
+ "@supertape/loader-css": "^1.0.0",
162
165
  "@types/node-fetch": "^2.6.11",
163
166
  "auto-globals": "^4.0.0",
164
167
  "babel-loader": "^10.0.0",
165
168
  "babel-plugin-macros": "^3.0.0",
166
- "c8": "^11.0.0",
167
169
  "cheerio": "^1.0.0-rc.5",
168
170
  "clean-css-loader": "^4.2.1",
169
171
  "codegen.macro": "^4.0.0",
170
172
  "css-loader": "^7.1.2",
171
173
  "css-minimizer-webpack-plugin": "^8.0.0",
172
174
  "css-modules-require-hook": "^4.2.3",
173
- "cssnano-preset-default": "^7.0.10",
175
+ "cssnano-preset-default": "^8.0.1",
174
176
  "domtokenlist-shim": "^1.2.0",
175
177
  "emitify": "^4.0.1",
176
178
  "eslint": "^10.0.0",
177
- "eslint-plugin-n": "^17.0.0-4",
178
179
  "eslint-plugin-putout": "^31.0.0",
179
180
  "globals": "^17.0.0",
180
181
  "gritty": "^10.2.0",
@@ -207,8 +208,9 @@
207
208
  "serve-once": "^3.0.1",
208
209
  "smalltalk": "^5.0.0",
209
210
  "style-loader": "^4.0.0",
211
+ "superc8": "^12.6.0",
210
212
  "supermenu": "^5.0.0",
211
- "supertape": "^12.0.0",
213
+ "supertape": "^13.0.0",
212
214
  "tar-stream": "^3.0.0",
213
215
  "unionfs": "^4.0.0",
214
216
  "url-loader": "^4.0.0",
@@ -12,6 +12,7 @@ import {konsole} from 'console-io';
12
12
  import {edward} from 'edward';
13
13
  import {dword} from 'dword';
14
14
  import {deepword} from 'deepword';
15
+ import {qword} from 'qword';
15
16
  import nomine from 'nomine';
16
17
  import {fileop} from '@cloudcmd/fileop';
17
18
  import * as cloudfunc from '#common/cloudfunc';
@@ -152,6 +153,12 @@ function listen({prefixSocket, socket, config}) {
152
153
  prefixSocket: `${prefixSocket}/dword`,
153
154
  });
154
155
 
156
+ qword.listen(socket, {
157
+ root,
158
+ auth,
159
+ prefixSocket: `${prefixSocket}/qword`,
160
+ });
161
+
155
162
  deepword.listen(socket, {
156
163
  root,
157
164
  auth,
@@ -215,6 +222,14 @@ function cloudcmdMiddle({modules, config}) {
215
222
  dropbox,
216
223
  dropboxToken,
217
224
  }),
225
+ qword({
226
+ root,
227
+ online,
228
+ diff,
229
+ zip,
230
+ dropbox,
231
+ dropboxToken,
232
+ }),
218
233
  deepword({
219
234
  root,
220
235
  online,
@@ -72,7 +72,7 @@ function rest({fs, config, moveFiles}, request, response) {
72
72
  return ponse.sendError(error, params);
73
73
 
74
74
  if (error)
75
- return ponse.sendError(error.stack, params);
75
+ return ponse.sendError(error, params);
76
76
 
77
77
  ponse.send(data, params);
78
78
  });
package/server/server.js CHANGED
@@ -1,18 +1,22 @@
1
1
  import http from 'node:http';
2
2
  import {promisify} from 'node:util';
3
3
  import process from 'node:process';
4
+ import {rateLimit} from 'express-rate-limit';
4
5
  import currify from 'currify';
5
6
  import squad from 'squad';
6
7
  import {tryToCatch} from 'try-to-catch';
7
8
  import opn from 'open';
8
9
  import express from 'express';
9
10
  import {Server} from 'socket.io';
10
- import tryRequire from 'tryrequire';
11
11
  import wraptile from 'wraptile';
12
12
  import compression from 'compression';
13
+ import tryRequire from 'tryrequire';
13
14
  import {cloudcmd} from '#server/cloudcmd';
14
15
  import exit from './exit.js';
15
16
 
17
+ const RATE_LIMIT = 1000;
18
+ const RATE_WINDOW = 15 * 60 * 1000;
19
+
16
20
  const bind = (f, self) => f.bind(self);
17
21
 
18
22
  const two = currify((f, a, b) => f(a, b));
@@ -25,6 +29,7 @@ const shutdown = wraptile(async (promises) => {
25
29
  const promisifySelf = squad(promisify, bind);
26
30
 
27
31
  const exitPort = two(exit, 'cloudcmd --port: %s');
32
+
28
33
  const logger = tryRequire('morgan');
29
34
 
30
35
  export default async (options, config) => {
@@ -46,8 +51,13 @@ export default async (options, config) => {
46
51
  path: `${prefix}/socket.io`,
47
52
  });
48
53
 
49
- app.use(compression());
54
+ const limiter = rateLimit({
55
+ windowMs: RATE_WINDOW,
56
+ limit: RATE_LIMIT,
57
+ });
50
58
 
59
+ app.use(compression());
60
+ app.use(limiter);
51
61
  app.use(prefix, cloudcmd({
52
62
  config: options,
53
63
  socket: socketServer,
@@ -65,7 +75,9 @@ export default async (options, config) => {
65
75
  await listen(port, ip);
66
76
 
67
77
  const close = shutdown([closeServer, closeSocket]);
78
+
68
79
  process.on('SIGINT', close);
80
+ process.on('SIUSR1', close);
69
81
 
70
82
  const host = config('ip') || 'localhost';
71
83
  const port0 = port || server.address().port;
@@ -28,10 +28,10 @@ export const root = (dir, config, overrides = {}) => {
28
28
  };
29
29
 
30
30
  export const editor = (name, {exit = _exit} = {}) => {
31
- const reg = /^(dword|edward|deepword)$/;
31
+ const reg = /^(dword|edward|deepword|qword)$/;
32
32
 
33
33
  if (!reg.test(name))
34
- exit('cloudcmd --editor: could be "dword", "edward" or "deepword" only');
34
+ exit(`cloudcmd --editor: could be "dword", "edward", "deepword" or "qword" only, received: "${name}"`);
35
35
  };
36
36
 
37
37
  export const menu = (name, {exit = _exit} = {}) => {
package/tmpl/config.hbs CHANGED
@@ -57,11 +57,12 @@
57
57
  <option {{ name-size-selected }}>name-size</option>
58
58
  </select>
59
59
  </li>
60
- <li title="Editor: Edward(Ace-based), Dword(Codemirror-based), Deepword(Monaco-based)">
60
+ <li title="Editor: Edward(Ace-based), Dword(Codemirror-based), Deepword(Monaco-based), Qword(Codemirror6-based)">
61
61
  <select data-name="js-editor" class="form-control full-width" title="Editor">
62
62
  <option {{ edward-selected }}>edward</option>
63
63
  <option {{ dword-selected }}>dword</option>
64
64
  <option {{ deepword-selected }}>deepword</option>
65
+ <option {{ qword-selected }}>qword</option>
65
66
  </select>
66
67
  </li>
67
68
  <li title="Navigate and edit files using hotkeys of legendary editor">
@@ -1,11 +0,0 @@
1
- {
2
- "short_name": "CloudCMD",
3
- "name": "Cloud Commander",
4
- "display": "standalone",
5
- "start_url": "..",
6
- "icons": [{
7
- "src": "../img/favicon/favicon-256.png",
8
- "type": "image/png",
9
- "sizes": "256x256"
10
- }]
11
- }