* feat: use `Type=notify-reload` in daemon service
* build: keep systemd names consistent
---------
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* fix: operator== should return bool in tr_strbuf
Fixes build error with C++20/C++23
error: return type 'auto' of selected 'operator==' function for rewritten '!=' comparison is not 'bool'
Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com>
* fix: explicitly specify Blocklist::size() return type as size_t
Fixes building with C++20/C++23
error: no matching function for call to 'size'
function 'size' with deduced return type cannot be used before it is defined
Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com>
* fix: wrap runtime format strings with fmt::runtime in library, daemon and cli
fmt::format_string ctor is consteval with C++20
See https://github.com/fmtlib/fmt/issues/2438
Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com>
* fix: wrap runtime format strings with fmt::runtime for GTK client
Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com>
* fix: allow to override C and CXX standard via cmdline or env
Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com>
* fix: add job to check if transmission compiles with C++23
Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com>
* Address code review by mikedld
Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com>
* fix new found fmt build errors
Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com>
* Address code review by tearfur
Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com>
* fix: make tr_net_init_mgr singleton buildable with C++23
Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com>
---------
Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* fix: accurate timestamp in daemon logs
* fix: gtk build errors
* fixup! fix: gtk build errors
* code review: use system_clock typedefs
* code review: use the full buffer for string view
* fixup! fix: accurate timestamp in daemon logs
* code review: limit exposure of `using`
* refactor: use fmt::print in log.cc
https://github.com/fmtlib/fmt/issues/428#issuecomment-395442159
> You can use fmt::print("...\n") on Windows as well.
Use this mechanism instead of tr_sys_file_write_line()
* refactor: use FILE* in daemon
* refactor: remove unused tr_sys_file_flush_possible()
* refactor: remove unused tr_sys_file_write_line()
* refactor: remove unused tr_sys_file_get_std()
* refactor: remove unused tr_std_sys_file_t
This commit includes strict, but still compatible, service hardening for
transmission-daemon.service. The main goal is a defense-in-depth
strategy that protects users from unknown vulnerabilities in
transmission.
In practice, transmission does not use any of the features that are
blocked in this hardening. However, this is still a network facing
daemon that, by design, accepts connections from unknown peers. So
better safe than sorry.
This commit also installs the service via CMake
Co-authored-by: LaserEyess <LaserEyess@users.noreply.github.com>
* refactor: remove the tr_error** idiom
* fix: tr_error::message() is only constexpr in c++20 and up
* chore: silence a couple of g++-12 Wshadow warnings
* chore: rename tr_strvContains to tr_strv_contains
* chore: rename tr_strvStartsWith to tr_strv_starts_with
* chore: rename tr_strvEndsWith to tr_strv_ends_with
* chore: rename tr_strvSep to tr_strv_sep
* chore: rename tr_strvStrip to tr_strv_strip
* chore: rename tr_strvToBuf to tr_strv_to_buf
* refactor: rename tr_saveFile() to tr_file_save()
rename tr_loadFile() to tr_file_read()
rename tr_moveFile() to tr_file_move()
* refactor: rename tr_parseNum() to tr_num_parse()
refactor: rename tr_parseNumRange() to tr_num_parse_range()
* chore: group related functions together in header
* Use user-preferred locale
Previous fix adding `L` format specifier was correct but only fixed half
of the problem, as C++ locale is set up to be "C" by default. GTK client
used to call `setlocale(LC_ALL, "")` to set up user-preferred locale
which only affected C functions and `std::locale` (used by libfmt) was
unaware of those changes.
Apply the fix to all the binaries since they're all doing some sort of
output to the user and calling libtransmission helpers, as well as using
libfmt directly.
* Improve libtransmission's json-test
Set the locale C++ way to avoid any sort of inconsistencies, and also
restore it to the old one once finished testing.
* Improve transmission-show test runner script
Quote outputs to avoid CMake error about `message()` being called with
no arguments. Capture stderr to the same output file. Fallback to `git
diff` if `diff` wasn't found. A few other minor changes.
* Use imported CMake target for CURL
* Use imported CMake target for fmtlib
* Use imported CMake target for WideInteger
* Use imported CMake target for FastFloat
* Use imported CMake target for UtfCpp
* Use imported CMake target for Threads
* Use imported CMake target for Iconv
* Use imported CMake target for crypto backend
* Use imported CMake target for GTK
* Use imported CMake target for Qt
* Use imported CMake target for deflate
* Use imported CMake target for libevent
* Use imported CMake target for natpmp
* Use imported CMake target for miniupnpc
* Use imported CMake target for dht
* Use imported CMake target for psl
* Use imported CMake target for libutp
* Use imported CMake target for libb64
* Use include directories from libtransmission target
* Reformat CMake code
* Bump minimum CMake version to 3.12
* Add target sources separately via `target_source()`
* Make `tr_win32_app_info()` add target sources on its own
* Don't use `include_directories()`
* Don't use `add_definitions()`
* Limit use of `add_compile_options()`
* Move VDKQueue target declaration to a subdirectory
* Add `tr_disable_source_files_compile()` helper
* Add `tr_target_glib_resources()` helper
* Add `tr_gettext_msgfmt()` helper
* Enable AUTOUIC for Qt client
* Enable AUTORCC for Qt client
* Remove AUTO{MOC,RCC,UIC} source group overrides
* Add `tr_target_idl_files()` helper
* Move source group setup to `tr_qt_add_translation()`
* Add `tr_target_xib_files()` helper
* Prefer `target_sources()` to intermediate variables
* Use explicit visibility versions of `target_*()` commands
* Prefer genexes to conditions in `target_*()` commands
* Add `tr_allow_compile_if()` helper
* Leave only top-level `project()`, remove the rest
* Minor fixups
* Fixup Mac QL plugin install
* Fixup IDE target folders and source groups