hfs 0.42.3 → 0.44.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 (56) hide show
  1. package/README.md +56 -17
  2. package/admin/assets/index-35f6e3dc.css +1 -0
  3. package/admin/assets/index-ef68a7ab.js +510 -0
  4. package/{frontend/assets/sha512-f6798733.js → admin/assets/sha512-d091720e.js} +1 -1
  5. package/admin/index.html +2 -2
  6. package/frontend/assets/index-a3b0d6ac.js +94 -0
  7. package/frontend/assets/index-fe0f3d77.css +1 -0
  8. package/{admin/assets/sha512-69b26793.js → frontend/assets/sha512-96fd938f.js} +1 -1
  9. package/frontend/fontello.css +9 -3
  10. package/frontend/fontello.woff2 +0 -0
  11. package/frontend/index.html +3 -2
  12. package/package.json +2 -2
  13. package/plugins/antibrute/plugin.js +1 -1
  14. package/plugins/download-counter/plugin.js +14 -5
  15. package/plugins/download-counter/public/main.js +12 -2
  16. package/plugins/vhosting/plugin.js +17 -11
  17. package/src/adminApis.js +4 -4
  18. package/src/api.auth.js +4 -1
  19. package/src/api.file_list.js +22 -10
  20. package/src/api.lang.js +9 -11
  21. package/src/api.vfs.js +43 -29
  22. package/src/apiMiddleware.js +3 -2
  23. package/src/block.js +6 -20
  24. package/src/config.js +6 -2
  25. package/src/const.js +5 -4
  26. package/src/customHtml.js +2 -2
  27. package/src/debounceAsync.js +3 -3
  28. package/src/frontEndApis.js +7 -32
  29. package/src/github.js +26 -8
  30. package/src/index.js +2 -1
  31. package/src/lang.js +67 -0
  32. package/src/langs/embedded.js +13 -0
  33. package/src/langs/hfs-lang-it.json +100 -0
  34. package/src/langs/hfs-lang-ko.json +103 -0
  35. package/src/langs/hfs-lang-ms.json +70 -0
  36. package/src/langs/hfs-lang-ru.json +106 -0
  37. package/src/langs/hfs-lang-sr.json +108 -0
  38. package/src/langs/hfs-lang-zh-tw.json +106 -0
  39. package/src/langs/hfs-lang-zh.json +98 -0
  40. package/src/listen.js +8 -3
  41. package/src/log.js +6 -2
  42. package/src/middlewares.js +24 -18
  43. package/src/misc.js +17 -9
  44. package/src/perm.js +1 -1
  45. package/src/plugins.js +6 -6
  46. package/src/serveFile.js +2 -2
  47. package/src/serveGuiFiles.js +23 -10
  48. package/src/update.js +1 -2
  49. package/src/upload.js +6 -6
  50. package/src/util-http.js +5 -3
  51. package/src/vfs.js +114 -74
  52. package/src/zip.js +4 -4
  53. package/admin/assets/index-08017e15.js +0 -511
  54. package/admin/assets/index-94bbe0be.css +0 -1
  55. package/frontend/assets/index-5f125477.js +0 -94
  56. package/frontend/assets/index-a09cacfd.css +0 -1
package/README.md CHANGED
@@ -61,7 +61,7 @@ If you don't like this behavior, disable it in the Admin-panel or enter this con
61
61
 
62
62
  ### Other systems
63
63
 
64
- If your system is not Windows/Linux/Mac, you can try this alternative version:
64
+ If your system is not Windows/Linux/Mac or you just don't want to run the binaries, you can try this alternative version:
65
65
 
66
66
  1. [install node.js](https://nodejs.org)
67
67
  2. execute at command line `npx hfs@latest`
@@ -72,27 +72,48 @@ Configuration and other files will be stored in `%HOME%/.vfs`
72
72
 
73
73
  ### Service
74
74
 
75
- If you want to run HFS as a service
76
- - if you installed with `npm` on Windows
77
- - service installation
78
- - run `npx qckwinsvc2 install name="HFS" description="HFS" path="%APPDATA%\npm\node_modules\hfs\src\index.js" args="--cwd %HOMEPATH%\.hfs" now`
79
- - service update
80
- - run `npx qckwinsvc2 uninstall name="HFS"`
81
- - run `npm -g update hfs`
82
- - run the service installation again
75
+ If you want to run HFS at boot (as a service), we suggest the following methods
76
+
77
+ #### On Linux
78
+ 1. [install node.js](https://nodejs.org)
79
+ 2. create a file `/etc/systemd/system/hfs.service` with this content
80
+ ```
81
+ [Unit]
82
+ Description=HFS
83
+ After=network.target
84
+
85
+ [Service]
86
+ Type=simple
87
+ Restart=always
88
+ ExecStart=/usr/bin/npx -y hfs@latest
89
+
90
+ [Install]
91
+ WantedBy=multi-user.target
92
+ ```
93
+ 3. run `sudo systemctl daemon-reload && sudo systemctl enable hfs && sudo systemctl start hfs && sudo systemctl status hfs`
94
+
95
+ NB: update will be attempted at each restart
96
+
97
+ #### On Windows
98
+
99
+ 1. [install node.js](https://nodejs.org)
100
+ 2. run `npm -g i hfs`
101
+ 3. run `npx qckwinsvc2 install name="HFS" description="HFS" path="%APPDATA%\npm\node_modules\hfs\src\index.js" args="--cwd %HOMEPATH%\.hfs" now`
102
+
103
+ To update
104
+ - run `npx qckwinsvc2 uninstall name="HFS"`
105
+ - run `npm -g update hfs`
106
+ - run `npx qckwinsvc2 install name="HFS" description="HFS" path="%APPDATA%\npm\node_modules\hfs\src\index.js" args="--cwd %HOMEPATH%\.hfs" now`
83
107
 
84
108
  ## Internationalization
85
109
 
86
110
  It is possible to show the Front-end in other languages.
87
- In the Languages section of the Admin-panel you'll be able to install lang files.
88
- You can find some of these files at https://github.com/rejetto/hfs/tree/main/langs
89
- Files are named `hfs-lang-CODE.json`, where `CODE` is the ISO code for your language (e.g. pt-br for Brazilian).
90
- To download a file: open it, right-click on the "Raw" button, Save.
111
+ Translation for some languages is already provided. If you find an error, consider reporting it
112
+ or [editing the source file](https://github.com/rejetto/hfs/tree/main/src/langs).
91
113
 
92
- If your language is missing, please consider [translating yourself](#translate-to-your-language).
114
+ In the Languages section of the Admin-panel you can install additional language files.
93
115
 
94
- Translation is applied automatically based on the configuration of the visitor's browser.
95
- [Check the language configuration of your browser](https://gtranslate.io/detect-browser-language).
116
+ If your language is missing, please consider [translating yourself](https://github.com/rejetto/hfs/wiki/Translation).
96
117
 
97
118
  ## Plug-ins
98
119
 
@@ -142,6 +163,21 @@ an *env* called `HFS_CONFIG`. Any relative path provided is relative to the *cwd
142
163
 
143
164
  [Check details about config file format](https://github.com/rejetto/hfs/blob/main/config.md).
144
165
 
166
+ ## Security
167
+
168
+ While this project focuses on ease of use, we care about security.
169
+ - HTTPS support
170
+ - Passwords are not saved, and user password is safe even logging in without https thanks to [SRP](https://en.wikipedia.org/wiki/Secure_Remote_Password_protocol)
171
+ - Automated tests ran on every release, including libraries audit
172
+ - No default admin password
173
+
174
+ Some actions you can take for improved security:
175
+ - use https, better if using a proper certificate, even free with [Letsencrypt](https://letsencrypt.org/).
176
+ - have a domain (ddns is ok too), start vhosting plugin, configure your domain, enable "Block requests that are not using any of the domains above"
177
+ - install/start rejetto/antidos plugin. Tweak configuration if necessary.
178
+ - start antibrute plugin (it's started by default)
179
+ - disable "unprotected admin on localhost"
180
+
145
181
  ## Reverse proxy
146
182
 
147
183
  HFS can work behind a reverse proxy. Configuration depends on what software you use, but this is an example using nginx
@@ -168,7 +204,10 @@ This is enough, but you may want to configure generated links accordingly:
168
204
 
169
205
  ## Hidden features
170
206
 
171
- - Going to address `#LOGIN` will bring up the login dialog
207
+ - Appending `#LOGIN` to address will bring up the login dialog
208
+ - Appending ?lang=CODE to address will force a specific language
209
+ - env `SESSION_DURATION` can be set to any number of seconds. Default is 1 day.
210
+ - right/ctrl/command click on toggle-all checkbox will invert each checkbox state
172
211
 
173
212
  ## Contribute
174
213
 
@@ -0,0 +1 @@
1
+ :root{height:100dvh}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;height:100vh;background:#000}#root{min-height:100%;display:flex}code{font-family:source-code-pro,Menlo,Monaco,Consolas,Courier New,monospace}.MuiTreeItem-content{box-sizing:border-box}ol,ul{margin-top:.2em}