Commit Graph

14245 Commits

Author SHA1 Message Date
Charles Kerr 8805d7c67b
refactor: remove tr_webGetTaskResponseCode() (#2628)
It's not really needed anymore, and removing it is aligned with the
goal of simplifying the tr_web and tr_webseed codebase.
2022-02-14 16:39:52 -06:00
Charles Kerr 0adc6b95de
fix: crash when evdns_base_new() fails (#2627)
Fixes #1437 by checking for nullptr before calling evdns_base_free().
2022-02-14 15:42:30 -06:00
Charles Kerr f87d737e0f
feat: newly-added seeds skip the full verify step (#2626)
* feat: newly-added seeds skip the full verify step

This has been a much-requested feature but has also been contentious
because I want to ensure that Transmission never transmits unverified
data. See the GH pull request for context on how this works.
2022-02-14 13:17:51 -06:00
Charles Kerr f78727a4c1
fix: define UTF_CPP_CPLUSPLUS for #include utf8.h (#2625)
Fixes #2256. This ensures that utfcpp's c++17 code is enabled.
2022-02-14 11:54:32 -06:00
Charles Kerr 0a27346efb
use metainfo folder instead of appdata (#2624)
* use metainfo folder instead of appdata

Co-authored-by: David Heidelberg <david@ixit.cz>
2022-02-14 09:41:19 -06:00
Charles Kerr d772824553
fix: sonarcloud code smells (#2623)
* fix: make variable a pointer-to-const

* fix: use init-statement to reduce variable scope

* fix: implicit conversion from long to int

* fix: refactor to not nest more than 3 if|for|do|while|switch statements

* fix: make tr_session::setSocketTos() const

* fix: use array.prototype.some instead of a for loop

* refactor: use nullptr instead of NULL

* fix: oops
2022-02-13 23:44:38 -06:00
Charles Kerr 94c7208d82
feat: use new envvar TR_CURL_PROXY_SSL_NO_VERIFY (#2622)
Co-authored-by: Andrey Pavlenko <andrey.a.pavlenko@gmail.com>
2022-02-13 22:24:15 -06:00
Charles Kerr 9f9b6cdaa2
feat: run script when done seeding (#2621)
* feat: add seeding-done script to core and rpc

* feat: add seeding-done script to gtk client

* feat: add seeding-done script to qt client

* feat: add seeding-done script to transmission-remote

* refactor: make Qt and GTK client text match

* test: update tests

Co-authored-by: Timothy Nibeaudeau <timothy.nibeaudeau@gmail.com>
2022-02-13 22:07:12 -06:00
Charles Kerr a822a46e47
refactor: add fetch options object to tr_webRun() (#2620)
* refactor: add fetch options object to tr_webRun()

Fold `tr_webRun()`, `tr_webRunWithCookies()`, and `tr_webRunWebseed()`
into a single API that takes an options argument that callers can
customize to their needs.

Also does a surface cleanup pass to the tr_webseed and tr_web internal
structures, e.g. making fields const where possible, not using raw
pointers, and making some fields private.

This revision is still full of code smells. Refactoring the entire
system is overwhelming, so instead I'm doing it in incremental steps.
2022-02-13 20:09:56 -06:00
Jelle van der Waa 18b8e98e3f
Add ProtectSystem and PrivateTmp to systemd service (#1452)
ProtectSystem mounts /boot, /efi and /usr as read only, basically
disallowing the daemon from ever writing there. PrivateTmp sets up a
file system namespace for /tmp and /var/tmp/ basically hiding it from
other processes.

Co-authored-by: Charles Kerr <charles@charleskerr.com>
2022-02-13 14:06:55 -06:00
Charles Kerr 31cbb3b708
feat: expose downloaded byte count to done script (#2619)
Fixes #1082. The use case is a torrent-done script that needs to know
if a torrent is done because it finished downloading or if it's done
because it's a newly-added seed.
2022-02-13 11:04:34 -06:00
Charles Kerr 9f050587d7
allow decimal values in seedRatioLimit input (#2618)
Co-authored-by: Jeff Fredrickson <jeff.fredrickson@gmail.com>
2022-02-13 09:58:59 -06:00
Charles Kerr 83db648b3c
Add support for torrent-get calls with the key percentComplete (#2615)
Co-authored-by: Michael Hadam <michael@hadam.us>
2022-02-13 01:27:47 -06:00
Charles Kerr 96178b1a9f
feat: add support for adding torrents by raw hash values (#2608)
* Add support for adding torrents by raw hash values

Co-authored-by: vjunk <vjunk@mail.ru>
2022-02-12 22:16:55 -06:00
Charles Kerr dfe79af34c
refactor: tr_webseed simplification (#2613)
* refactor: remove effective-url caching in webseeds

The upcoming CURLSH refactor is a more effective way of doing this and
the current appoach makes tr_web harder to refactor, so remove it.

* refactor: webseed rate limiting

The current code that limits the number of parallel fetches is overly
complicated and is also interwoven into the tr_webseed class. Extract
it into a new private helper class "ConnectionLimiter" with a simpler
public API for tr_webseed to use.
2022-02-12 16:52:40 -06:00
Charles Kerr cddd400f7e
test: fix race condition in rename-test (#2612) 2022-02-12 13:51:43 -06:00
Charles Kerr 2410ad2fa6
feat: support webseeds in transmission-create (#2611) 2022-02-12 12:50:47 -06:00
Charles Kerr e14c7f38e5
feat: use libpsl (#2575)
Use libpsl to calculate public and private parts of URL hosts.
2022-02-12 11:30:27 -06:00
Charles Kerr 708fc1531e
feat: web client style (#2609)
* fix(web): border-radius added to mainwin-toolbar icons

* fix(web): --color-fg-on-popup added for font visibility when dark mode

* chore(web): add .gitattributes

Since transmission-app.js is a generated file,
should be treated as a binary to avoid conflict.

* chore: rebuild transmission-app.js

Co-authored-by: trainto <trainto@gmail.com>
2022-02-11 18:32:20 -06:00
Charles Kerr eeccc3788f
docs: move rpc-spec document from txt to markdown (#2606) 2022-02-11 10:48:21 -06:00
dependabot[bot] 63fafada16
build(deps-dev): bump node-sass from 6.0.1 to 7.0.0 in /web (#2604)
Bumps [node-sass](https://github.com/sass/node-sass) from 6.0.1 to 7.0.0.
- [Release notes](https://github.com/sass/node-sass/releases)
- [Changelog](https://github.com/sass/node-sass/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sass/node-sass/compare/v6.0.1...v7.0.0)

---
updated-dependencies:
- dependency-name: node-sass
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2022-02-11 03:19:00 -06:00
Charles Kerr a87be3762f
fix: rename 'corrupt' label for understandability (#2605)
Fixes #154. The current 'corrupt' label can confuse users to think that
there is corrupt data on the disk. The phrasing has been changed:

- Downloaded: 1.91 GB
- Corrupt DL: 22.02 MB

+ Downloaded: 1.91 GB (+22.02 MB discarded after failed checksum)
2022-02-11 01:15:10 -06:00
Charles Kerr 6383e2ff5f
feat: support dscp classes in socket iptos (#2594)
* refactor: Replace ToS with DSCP

IP TOS was superseded by DSCP in RFC 2474.

Co-authored-by: dgcampea <dgcampea@outlook.com>
2022-02-10 15:35:28 -06:00
Charles Kerr ec6a92d761
fix: make remove-torrent dialogs modal in GTK client (#2602)
Followup to #2443
2022-02-10 14:31:11 -06:00
Charles Kerr 376e8b3782
feat: add 'ok' shortcut in web client open dialog (#2601) 2022-02-10 12:06:44 -06:00
Viacheslav Chimishuk 8149ff0a35
Fix Labels section in transmission-remote output. (#2597) 2022-02-10 10:24:13 -06:00
Viacheslav Chimishuk 0973cfd96d
Add labels support into web client. (#2596) 2022-02-10 09:25:11 -06:00
Charles Kerr 663fba71c2
fix: deprecated sass division warning (#2595)
Fix "deprecation Warning: Using / for division outside of calc() is
deprecated and will be removed in Dart Sass 2.0.0."
2022-02-09 23:38:55 -06:00
Charles Kerr b5247662d9 Revert "Add labels support into web client. (#1406)"
This reverts commit ab02edfde2.
2022-02-09 22:17:09 -06:00
Viacheslav Chimishuk ab02edfde2
Add labels support into web client. (#1406)
* Add labels support into web client.
2022-02-09 22:12:34 -06:00
Charles Kerr 7bdb6f777b
refactor: remove callback from tr_torrentVerify() public API (#2592) 2022-02-09 12:02:59 -06:00
Charles Kerr afc41abbd3 fixup! [Web] Magnet link, Main window toolbar accessibility, ARM build fix, Dependencies update (#2586)
chore: code-style
2022-02-09 10:30:18 -06:00
FluxState b11cf4ca00
[Web] Magnet link, Main window toolbar accessibility, ARM build fix, Dependencies update (#2586)
Add magnet link to web client's torrent inspector
2022-02-09 10:28:48 -06:00
Charles Kerr f105c6ac81
fix: make DNS queries lowercase (#2591)
Fixes #461.
2022-02-08 21:30:45 -06:00
Charles Kerr 318d60b72d
refactor: fix sonarcloud "use enum class" code smells (#2590)
* refactor: prefer constexpr over enum for GUI_PAD values

* refactor: prefer constexpr over enum for PrefsDialog values

* refactor: prefer constexpr over enum for StatsDialog values

* refactor: use enum class for GtrUnicode types

* refactor: prefer constexpr over enum for BT peer msg codes

* refactor: use enum class for TrMakemetaResult

* refactor: prefer constexpr over enum for BT metadata message types

* refactor: use enum class for AwaitingBt

* refactor: use enum class for EncryptionPreference

* refactor: use enum class for TrFormat in rpcimpl

* refactor: prefer constexpr over enum for QApp intervals

* refactor: prefer constexpr over enum for tr_resume bitfields

* refactor: prefer constexpr over enum for Qt/TrFileModel bitfields

* refactor: remove obsolete TODO comment in announce-list
2022-02-08 20:25:19 -06:00
Charles Kerr a92af9193e
fixup! add labels to torrent-add rpc method (#2539) (#2589)
fix potential memory leak reported by coverity
2022-02-08 19:04:29 -06:00
Charles Kerr 2bf25fbdf5
refactor: fix a pair of win32 msvc warnings in libtransmission (#2588) 2022-02-08 12:50:09 -06:00
Charles Kerr ba14ffa74c
refactor: sonarcloud "use if init" statements (#2587) 2022-02-07 23:44:31 -06:00
Charles Kerr 8afbfecadb
refactor: re-enable some clang-tidy checks in qt/ (#2585)
* chore: re-enable readability-static-accessed-through-instance test in qt

* chore: re-enable clang-diagnostic-nonportable-system-include-path check in qt/

* chore: re-enable clang-diagnostic-undefined-reinterpret-cast test in qt/

* chore: re-enable cert-err58-cpp check in qt/

* chore: re-enable clang-diagnostic-switch-enum check in qt/

* chore: re-enable modernize-return-braced-init-list check in qt/

* chore: re-enable cppcoreguidelines-pro-type-static-cast-downcast check in qt/

* chore: re-enable cppcoreguidelines-pro-type-cstyle-cast check in qt/

* refactor: re-enable cppcoreguidelines-init-variables check in qt/

* chore: re-enable cppcoreguidelines-pro-type-vararg check in qt/

* chore: remove explicit disable of clang-diagnostic-old-style-cast check in qt/

* chore: re-enable bugprone-implicit-widening-of-multiplication-result check in qt/
2022-02-07 21:56:04 -06:00
Charles Kerr ebb2ab6aee
chore: update license spdx abbreviations (#2582)
Use SPDX license list 3.0 terminology: replace deprecated identifiers
GPL-2.0" and "GPL-3.0" with "GPL-3.0-only" and "GPL-3.0-only".
2022-02-07 10:25:02 -06:00
Mark Deepwell 71fd56000d
Fix webpack start dev server (#2579)
- Use webpack instead of webpack-dev-server (which is no longer
  maintained)
- The webpack -d option requires as string (which is missing) and
  is specified in the config file, therefore use devtool option
  from webpack.config.js
2022-02-07 06:54:33 -06:00
Charles Kerr ecef0feb0c
refactor: clang-tidy in libtransmission (#2578)
* chore: enable cppcoreguidelines-slicing warning

* chore: enable readability-named-parameter warning

* chore: enable bugprone-reserved-identifier check

* chore: enable bugprone-not-null-terminated-result check

* chore: enable bugprone-sizeof-expression check

* chore: enable bugprone-incorrect-roundings check

* chore: enable misc-misplaced-const check

* chore: enable bugprone-suspicious-include check

* chore: enable bugprone-signed-char-misuse check

* chore: enable modernize-raw-string-literal check

* chore: enable readability-static-accessed-through-instance check

* chore: enable readability-implicit-bool-conversion check

* fixup! Merge branch 'main' into refactor/clang-tidy
2022-02-06 22:28:36 -06:00
Viacheslav Chimishuk f9d068d7a0
Fix broken Cancel and Rename buttons on RenameDialog. (#2577)
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2022-02-06 19:51:27 -06:00
bkuhls a8818148e2
fix cross build (#2576)
Remove redundant include, ${UTP_INCLUDE_DIRS} is included already to fix
cross build error with buildroot:

x86_64-linux-g++: ERROR: unsafe header/library path used in cross-compilation: '-isystem' '/libutp'
2022-02-06 01:17:03 -06:00
Craig Andrews 56dab2bd18
daemon: deny memory wx in transmission-daemon.service (#2573)
Attempts to create memory mappings that are writable and executable at the same time, or to change existing memory mappings to become executable, or mapping shared memory segments as executable are prohibited.

There's no reason transmission should be doing that. If it does, it's because of malicious code exploiting a vulnerability.

See: https://www.freedesktop.org/software/systemd/man/systemd.exec.html#MemoryDenyWriteExecute=
2022-02-04 22:08:51 -06:00
Charles Kerr 4455673bed
fix: some use-init-statement sonarcloud warnings (#2566) 2022-02-03 07:02:11 -06:00
LaserEyess 5565255d85
add labels to torrent-add rpc method (#2539)
This commit adds labels to the torrent-add method, allowing RPC users to
specify labels when adding a torrent. Labels metadata is commonly known
when adding torrents, so this removes the need to send another
torrent-set call to add labels.

Additionally, transmission-remote is updated to handle labels in
torrent-add.

Co-authored-by: LaserEyess <LaserEyess@users.noreply.github.com>
2022-02-03 00:02:30 -06:00
Charles Kerr e908193027
fix: some use-init-statement sonarcloud warnings (#2563) 2022-02-01 19:09:11 -06:00
Charles Kerr 878405f862
Revert "fix: sonarcloud (#2558)" (#2562)
This reverts commit 8b9483f7fb.
2022-02-01 11:30:51 -06:00
Charles Kerr 329c4d80e1
fix: edge case file leak if error while making torrent (#2560)
found by Coverity
2022-02-01 01:11:13 -06:00