hfs 0.43.0 → 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 (46) hide show
  1. package/README.md +50 -9
  2. package/admin/assets/index-35f6e3dc.css +1 -0
  3. package/admin/assets/index-ef68a7ab.js +510 -0
  4. package/{frontend/assets/sha512-8ebf6e2a.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-55ff2fa3.js → frontend/assets/sha512-96fd938f.js} +1 -1
  9. package/frontend/index.html +3 -2
  10. package/package.json +2 -2
  11. package/plugins/download-counter/plugin.js +5 -3
  12. package/plugins/download-counter/public/main.js +2 -2
  13. package/plugins/vhosting/plugin.js +17 -11
  14. package/src/adminApis.js +1 -1
  15. package/src/api.auth.js +4 -1
  16. package/src/api.file_list.js +7 -8
  17. package/src/api.lang.js +2 -1
  18. package/src/api.vfs.js +41 -28
  19. package/src/apiMiddleware.js +3 -2
  20. package/src/const.js +4 -3
  21. package/src/customHtml.js +1 -1
  22. package/src/debounceAsync.js +3 -3
  23. package/src/frontEndApis.js +6 -6
  24. package/src/github.js +26 -8
  25. package/src/index.js +2 -1
  26. package/src/lang.js +9 -19
  27. package/src/langs/embedded.js +13 -0
  28. package/src/langs/hfs-lang-ms.json +70 -0
  29. package/src/langs/hfs-lang-ru.json +22 -22
  30. package/src/langs/hfs-lang-zh-tw.json +106 -0
  31. package/src/listen.js +1 -1
  32. package/src/log.js +6 -2
  33. package/src/middlewares.js +14 -18
  34. package/src/misc.js +7 -3
  35. package/src/plugins.js +6 -6
  36. package/src/serveFile.js +1 -1
  37. package/src/serveGuiFiles.js +2 -2
  38. package/src/update.js +1 -2
  39. package/src/upload.js +6 -6
  40. package/src/util-http.js +5 -3
  41. package/src/vfs.js +100 -52
  42. package/src/zip.js +4 -4
  43. package/admin/assets/index-5cd667a5.js +0 -511
  44. package/admin/assets/index-8ff39373.css +0 -1
  45. package/frontend/assets/index-27488fde.js +0 -94
  46. package/frontend/assets/index-54a5c76f.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,14 +72,38 @@ 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
 
@@ -139,6 +163,21 @@ an *env* called `HFS_CONFIG`. Any relative path provided is relative to the *cwd
139
163
 
140
164
  [Check details about config file format](https://github.com/rejetto/hfs/blob/main/config.md).
141
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
+
142
181
  ## Reverse proxy
143
182
 
144
183
  HFS can work behind a reverse proxy. Configuration depends on what software you use, but this is an example using nginx
@@ -167,6 +206,8 @@ This is enough, but you may want to configure generated links accordingly:
167
206
 
168
207
  - Appending `#LOGIN` to address will bring up the login dialog
169
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
170
211
 
171
212
  ## Contribute
172
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}