37 Commits

Author SHA1 Message Date
Trim21
2a0d29c1f5 style: add new rule for imports (#785) 2024-08-13 22:31:39 +00:00
Trim21
e52cfc9170 refactor(server): migrate to fastify (#707) 2023-12-11 19:08:43 +00:00
Jesse Chan
efdd620192 dependencies: bump (major)
TODO: drop the "const argv = argvObj as Record<string, any>;" hack

Refs: yargs/yargs#2175
2022-05-07 16:41:10 -07:00
Jesse Chan
af8de75e05 server: remove unused history snapshots and make it in-mem only 2021-10-31 23:21:20 -07:00
Jesse Chan
2b6ca5ff66 API: ditch inefficient "TRANSFER_SUMMARY_DIFF_CHANGE", always full update
TRANSFER_SUMMARY_DIFF_CHANGE is almost always full update:

```
[
{"op":"replace","path":"/downTotal","value":851320719382},
{"op":"replace","path":"/downRate","value":6139},
{"op":"replace","path":"/upTotal","value":1826972572184},
{"op":"replace","path":"/upRate","value":5480521}
]
```

which is generally less efficient than full object (TRANSFER_SUMMARY_FULL_UPDATE):

```
{
"upRate":5430724,
"upTotal":1827320521117,
"downRate":6062,
"downTotal":851321106383
}
```
2021-05-22 21:31:32 +08:00
Jesse Chan
aacca10475 server: simplify service manager, fixes dangling ref 2021-05-09 10:23:28 +08:00
Jesse Chan
6f7bca075c server: consolidate services null checks to middleware 2021-02-21 23:39:55 +08:00
Jesse Chan
37a94912f4 server: HistoryEra: replace NeDB callbacks with promises 2020-12-09 21:52:32 +08:00
Jesse Chan
1a878d5423 flood: rearrange, remove misc files and reformat 2020-11-15 23:03:47 +08:00
Jesse Chan
ca32dcb490 server: clientActivityStream: ensure graceful transfer history fallback 2020-11-03 01:31:14 +08:00
Jesse Chan
00029514f7 ClientConnectionInterruption: allow retrying with current settings 2020-11-03 01:31:09 +08:00
Jesse Chan
abf9554e31 server: clientGatewayService: keep refreshing connection status when error occurred 2020-11-02 22:42:29 +08:00
Jesse Chan
9e03d2a385 shared: schema: split enums from schemas
Otherwise zod will be included in client dependency graph and
increase the bundle size by 10kB unnecessarily.
2020-10-28 12:34:52 +08:00
Jesse Chan
0e57e36663 client: migrate from Flux to MobX 2020-10-25 06:06:53 -05:00
Jesse Chan
8d2959edfc API: activity-stream: migrate all diff actions to JSON Patch 2020-10-20 20:31:08 +08:00
Jesse Chan
1f76f320c5 server: clientGatewayService: define interface 2020-10-17 13:44:06 +08:00
Jesse Chan
a9180d7cfc server: move DiskUsage class out of services
It is not user-dependent. Thus not a service.
2020-10-17 13:44:06 +08:00
Jesse Chan
cf08d68c92 auth, Users: initial preparation for multi client support
BREAKING CHANGE
2020-10-14 10:58:52 +08:00
Jesse Chan
8c69786c2e server: services: replace null checks with optional chaining 2020-10-06 19:52:32 +08:00
Jesse Chan
8452d51b79 server: torrentService: stop polling when there is no listener
Bug: #45, Flood-UI/flood#405
2020-10-04 18:22:37 +08:00
Jesse Chan
c6f8b9b76d AddTorrentByFile: use base64 instead of Blob to transfer file 2020-09-29 22:46:16 +08:00
Jesse Chan
43b2d8fbbf server: services: migrate to TypeScript 2020-09-27 22:27:14 +08:00
Jesse Chan
cdbe980ac7 server: handle some unhandled promise rejections
Unhandled Promise rejections are strictly prohibited and will
lead to NodeJS process termination in the future Node release.

This change also fixes some logics.
2020-09-20 01:08:02 +08:00
Jesse Chan
501900858c server: use import/export syntax 2020-09-17 02:36:24 +08:00
Jesse Chan
91517d91c3 server: prohibit Cross-Origin Resource Sharing
Flood instances should not be accessible to other sites.

This change prevents malicious sites from using resources of
a Flood instance and hijacking the browser to submit malicious
requests to Flood.
2020-08-27 20:24:47 +08:00
Jesse Chan
4ea381049a Update dependencies (non-breaking)
This change uses the best-effort approach to update dependencies.
Changelogs of each dependency have been manually reviewed and all
dependency that doesn't *actually* have BREAKING changes or have
minimal changes are bumped to their latest versions.

In most cases, the maintainers of those dependencies don't actually
understand semvar and inappropriately bumped major version for trivial,
non-breaking changes. In other cases, the minimum supported Node version
is upgraded, which is indeed breaking but that's not a concern for this
project as a recent Node version is always expected. Or, the dependency
does have certain breaking changes but those changes are not relevant to
functions used by this project.

Also bumped versions of dependencies if only minimal changes are required:

* autoprefixer: transform from "browsers" property to browserslist
* prettier: reformated sources after update

Signed-off-by: Jesse Chan <jc@linux.com>
2020-08-04 03:16:44 +08:00
Johannes Wikner
86008d5ffb Feat/diskuse (#808)
* Show disk usage in sidebar (#308)

* Clean up

* Fix linting, DiskUsageService as singleton

* node 8

* missing scope

* prettier

* Tooltip prefer top position

* tweaky

* Configure diskUsageSerivce.watchMountPoints option

  - filters mountpoints to include in the sidebar
  - omitting this field gives all mounted filesystems

* use connectStores

* activity stream unsubscribe from events on res 'close' event

* remove nbsp; use css

* prettier format

* Return empty array on win32 and darwin platforms

* Use 1K blocks, add (untested) macos support

* prettier

* config.template typo

* rename var fs -> mountpoint

* Filter wrong output, use df -l in macos

  - macos df return map -hosts and map auto_home in the first column
  which breaks splitting in awk. They are anyway not real

* Changed my mind about filter. just -l

* Apply jfurrow's patch

* Remove unnecessary defaultProp

* Use FormattedMessage

* Fix formatting
2019-08-31 10:42:00 -07:00
John Furrow
912f61abfb Fixes retry logic for rtorrent instance connection failures (#804)
* Restarts torrent polling when client reconnects

* Fixes backoff calculation
2019-05-25 22:42:53 -07:00
John Furrow
dbedc6c7a5 Improves eslint rules (#785)
* Switch to airbnb's eslint

* Applies automatic fixes

* Clean up dependencies

* New lint rules

* Apply auto fixes

* Prettier

* Update prettier position in eslint config

* Aligns prettier and eslint

* Use partial configs for client and server directories

* Finalizes eslint config (for now)

* Applies all elsint fixes

* Removes duplciated config

* Fixes build & local dev

* Fix CI build
2019-05-02 22:21:47 -07:00
zawapete
f6490b7e76 User management: disable Authentication tab content for non admin users (#718)
* User management: first commit

* User management: remove wrong setState

* User management: remove debug log

* lint

* format

* cr fixes

* refactor from services to middleware

* remove userService.js
2018-09-29 01:34:40 -07:00
John Furrow
4346c0d6b5 Applies eslint rules (#702) 2018-09-02 21:19:43 -07:00
John Furrow
6dec5cddac Implements Prettier (#701)
* Adds and configures prettier

* Creates format script

* Runs prettier

* Adds npm scripts and checks for formatting in CI
2018-09-02 20:43:35 -07:00
John Furrow
f492ad348a Multi rtorrent instances support (#638)
* Multi rtorrent instances support (#549)

* Handling multiple rtorrent instances

* performance issue addressing

* fix wrong conflict resolution

* performances

* purge services instance every 10 mins

* last fixes

* avoid duplicated reducers

* Adjusts UI of rtorrent connection form fields (#639)

* Multi rtorrent instance cleanup (#676)

* Cleans up multi-user logic.

* Rename clientRequestService to clientGatewayService

* [multi-user] Adds prompt to fix rtorrent connection failure (#681)

* Adds ability to update user

* Add connection test endpoints and client actions

* Listen to client connectivity change events

* Separates scgiUtil from clientRequestManager

* Adds BaseService

* Services extend BaseService

* Listen for connetion change events in client

* Reorganizes app structure

* Adds prompt to correct per-user client interruption

* Fixes linting errors

* Removes debugging stuff

* Fixes Size rendering

* Fixes moveTorrents

* Adds migration step for legacy database entries (#686)

* Use FormattedMessage

* Updates documentation

* Fixes migration script for new installs

* Updates dependencies

* Moves string to i18n

* Updates deps
2018-09-02 00:15:21 -07:00
John Furrow
8447ffa5b7 Ensure req.body is defined 2017-11-29 19:56:42 -08:00
John Furrow
a399da7e40 Fix erroneous stringified boolean value interpretation 2017-11-28 22:13:15 -08:00
John Furrow
6714f8e2a7 Set X-Accel-Buffering header for event-stream connections 2017-07-05 22:46:14 -07:00
John Furrow
7f1acd711b Introduce services 2017-05-28 18:24:04 -07:00