Commit Graph

68 Commits

Author SHA1 Message Date
Jesse Chan
8fb9f70c35 client: fully migrate to TypeScript 2020-10-18 06:55:28 -05:00
Jesse Chan
dcfcce3456 api: torrents: simplify contents API by returning an Array of TorrentContent 2020-10-17 13:44:06 +08:00
Jesse Chan
c0ddc55810 server: migrate setSpeedLimits and setTracker to clientGatewayService 2020-10-17 13:44:06 +08:00
Jesse Chan
8f5fd27b88 client: SettingsModal: migrate to TypeScript 2020-10-17 13:44:06 +08:00
Jesse Chan
b2f6fdad21 server: migrate client [get/set]Settings to clientGatewayService 2020-10-17 13:44:06 +08:00
Jesse Chan
95cf01f598 server: migrate torrent details functions to TypeScript 2020-10-17 13:24:14 +08:00
Jesse Chan
e0e68a19df feature: allow to create torrents via Flood 2020-10-14 11:06:52 +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
b53910d8b2 clientSettingsMap: remove unused client settings 2020-10-10 12:51:30 +08:00
Jesse Chan
61e6e79497 shared: types: move API types to api folder 2020-10-10 12:50:26 +08:00
Jesse Chan
f6896413a3 server: move auth APIs to /api/auth
Auth APIs are APIs too. Let's recognize it.
2020-10-10 12:42:27 +08:00
Jesse Chan
7a687fb1be server: migrate setTorrentsTags and setTorrentContentsPriority to clientGatewayService 2020-10-10 12:33:28 +08:00
Jesse Chan
16465f4239 server: migrate method call configs to immutable arrays 2020-10-07 00:36:11 +08:00
Jesse Chan
5e1c09153c feature: allow multi-torrent priority change 2020-10-04 21:28:29 +08:00
Jesse Chan
ff912cb733 API: rename /add to /add-urls
To make things clearer.
2020-10-03 00:24:38 +08:00
Jesse Chan
25c68fbd70 client: migrate Torrent Details Modal to TypeScript 2020-10-01 17:34:00 +08:00
Jesse Chan
53f7f48c95 API: group Torrents APIs to /torrents routes 2020-09-30 12:14:03 +08:00
Jesse Chan
c6f8b9b76d AddTorrentByFile: use base64 instead of Blob to transfer file 2020-09-29 22:46:16 +08:00
Jesse Chan
f5f8952df9 moveTorrents: get sourceBasePath and baseFileName in server
With these two properties, it is hard for third party to utilize API
to move torrents without retrieving torrent details first.

Plus, client-supplied paths and filenames can lead to arbitrary file
system access which is a security issue.

In conclusion, it doesn't make sense to let client to provide these
two properties.
2020-09-29 17:32:13 +08:00
Jesse Chan
912c66d497 server: migrate moveTorrents to clientGatewayService 2020-09-29 13:38:13 +08:00
Jesse Chan
69276b5fa4 server: migrate checkHash to clientGatewayService 2020-09-29 12:40:07 +08:00
Jesse Chan
97ead47fe9 server: migrate startTorrents and stopTorrents to clientGatewayService 2020-09-29 12:04:40 +08:00
Jesse Chan
afcabb905c client: migrate most Modals to TypeScript 2020-09-29 00:29:10 +08:00
Jesse Chan
ab42dae278 docs: improve documentation of delete torrents API 2020-09-28 00:01:37 +08:00
Jesse Chan
43b2d8fbbf server: services: migrate to TypeScript 2020-09-27 22:27:14 +08:00
Jesse Chan
327a491af2 server: servedPath is a URL path not file path
Thus we shall not use path.join(). Or NodeJS will helpfully convert
the paths to Windows format if we are on Windows and as a result,
breaks everything.

Fixes: fee968525, 8f4fb88ac
2020-09-21 17:58:56 +08:00
Jesse Chan
80b8ad2cc5 server: use NCC to bundle server into a single file
This allows us to be dependency-free in production.

Caveats:

  - NCC can't handle WASM. Thus, we have to remove WASM files inside
    argon2-browser before build to force JS.

  - Duplicate geoip databases inside dist/data and dist. We have to
    remove dist/data after build.
2020-09-21 15:24:00 +08:00
Jesse Chan
a5ec810521 server: models: migrate "Users" to TypeScript
And refine types of auth components.
2020-09-19 22:50:12 +08:00
Jesse Chan
30d2b034b3 dependency: migrate from moment to dayjs 2020-09-18 00:23:58 +08:00
Jesse Chan
aaf873d9fa dependencies: bump (major) 2020-09-18 00:04:57 +08:00
Jesse Chan
13480c9bab server: initial support for TypeScript 2020-09-16 20:51:08 +08:00
Jesse Chan
c78e5d88d1 client: partially migrate to TypeScript 2020-09-16 12:36:54 +08:00
Jesse Chan
8c04534102 shared: paths: remove unused variable "fs" 2020-08-26 17:35:20 +08:00
Jesse Chan
68b7b04773 flood: do not use current working path to retrieve assets 2020-08-25 19:34:03 +08:00
Jesse Chan
44b28a7a82 Move static assets to dist/ folder 2020-08-23 17:18:21 +08:00
Jesse Chan
656fd60b24 Enforce client, server isolation 2020-08-23 17:05:01 +08:00
damolp
fc7a74405f torrentListPropMap: use d.hashing= instead of d.is_hash_checking=
d.hashing= allows Flood to show torrents queued for hashing.

Cherry-Pick: Flood-UI/flood#868
Signed-off-by: Jesse Chan <jc@linux.com>
2020-08-05 17:00:13 +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
John Furrow
92404918a0 Introduce Typescript & CSS Modules (#815)
* Adding typescript support

* Begins configuring webpack builds

* Fix lint warnings

* Updates react-router

* Fixes lint configuration

* Adds missing dependency

* Restores disabled performance hints

* Renames connectStores

* Types connectStores

* Uses correct envvars and fixes missing EOF newline

* Formats files

* Defaults props to empty object

* Ignores type definitions in eslint

* Another newline

* Adjusts script invocation

* Ignore jsdoc output

* Undoes the autoformatting of CSS module types

* Improves lint rules

* Finishes webpack config changes

* Updates deps

* Fixes lint errors and attempts to fix SVG icon generator

* Fixes SVG sprite generator

* Adds type for SVG imports

* Explicitly use babelrc in SVG loader

* Formats files

* Refactors prettier formatter, formats CSS module type defs

* Updates style types

* Uses nicer syntax in typed-css-modules-loader

* Removes unnecessary div

* optional property in package.json

* package-lock

* Fixes upstream lint errors

* Removes unused modules
2019-11-22 22:47:09 -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
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
Ben Sampson
03d3943974 Filter out CDATA tag for RSS feeds (#691)
* add cdata regex

* remove cdata via regex

* add trailing comma

* fix no-useless-escape

* switch let to const
2018-09-20 21:46:28 -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
Hussain Khalil
75a1a291ad Fix parsing of torrent details 2017-12-04 19:02:24 -05:00
John Furrow
fc41449385 When moving files, remember start/stopped status 2017-10-22 16:21:59 -07:00
John Furrow
dc6233ed03 The build process is mostly working 2017-10-16 21:51:51 -07:00
Stéphane de Wit
72d23a3026 Get UDP trackers domain name 2017-08-14 15:14:45 +02:00
John Furrow
7f1acd711b Introduce services 2017-05-28 18:24:04 -07:00