Commit Graph

107 Commits

Author SHA1 Message Date
xirvik d20c3234da Add system.sockets allocation budget commands.
They report the budget the socket manager enforces, so a client can show the limit.
2026-08-05 11:18:31 +02:00
xirvik 05831942a7 commands: don't register min_alloc/max_alloc for the generic socket category
SocketManager throws internal_error for category_generic, aborting rtorrent over RPC.
2026-07-30 12:42:24 +02:00
xirvik 41eef969ea commands: fix group.<name>.ratio.disable calling a removed command
group_insert() builds the disable method as "schedule_remove=...", but that
command no longer exists: the current name is schedule.remove, and the only
old-style aliases registered are schedule2 and schedule_remove2 (and those only
when deprecated commands are enabled at registration time). Every
group.<name>.ratio.disable therefore faults with

  Command "schedule_remove" does not exist.

including the built-in group.seeding.ratio.disable, so a ratio group can be
enabled but never disabled. The enable half already uses the current name.
2026-07-25 10:18:49 +02:00
Jari Sundell f6b3ad0efd Minor cleanup of pex and other commands. 2026-07-15 19:40:13 +09:00
Jari Sundell 2354c9cdb5 Moved ChunkManager out of public header directory. 2026-07-10 17:54:37 +09:00
Jari Sundell 1b25bc7f56 Moved all sync/diskspace related methods to MemoryManager. 2026-07-10 02:21:08 +09:00
Jari Sundell c6bde213b4 Added runtime::MemoryManager to split out unrelated features from ChunkManager. 2026-07-09 01:56:30 +09:00
Jari Sundell 08828045f5 Added min/max alloc for SocketManager categories. 2026-06-16 22:39:39 +09:00
Jari Sundell d08d7de20d Added "system.sockets.<category>.{size,max_size}" commands. 2026-06-15 18:38:54 +09:00
Jari Sundell 75377817b4 Deprecate commands and set DHT to auto by default. 2026-06-05 21:50:08 +09:00
Jari Sundell 797a194abc Cleaned up torrent header files. 2026-05-14 19:24:38 +09:00
Jari Sundell 5a4ba8bc32 Removed deprecated rak header files. 2026-04-10 22:04:02 +09:00
Xirvik 08a907b547 Whitelist additional read-only getters for untrusted connections
ruTorrent queries these commands for its settings and status pages.
They are all read-only getters with no side effects, safe to expose
for untrusted SCGI connections.

Tested against ruTorrent with both httprpc and multirpc plugins on
servers with active torrents — all modes (list, settings, totals,
open connections) work with zero blocked commands.
2026-03-30 11:55:24 +02:00
Xirvik d935e0ffe9 Address review feedback: explicit mark_safe whitelist and rpc trust flow 2026-03-23 15:11:07 +01:00
Xirvik f767053297 Mark safe commands with flag_untrusted_safe for whitelist enforcement
Annotate all commands that web UIs (ruTorrent) need for normal torrent
management with _U macro variants, which set flag_untrusted_safe.
Commands not marked are blocked by default for untrusted connections.

Safe commands include:
- d.* download getters, state, priorities, custom fields, start/stop
- f.* file getters, priority control
- p.* peer getters, disconnect, ban/snub
- t.* tracker getters, enable/disable
- throttle.* rate getters/setters, peer limits
- network.* read-only queries (getters safe, setters blocked)
- view.list, view.size, view.filter_all, ui.current_view
- load.*, download_list, d.multicall2, d.multicall.filtered
- convert.*, branch/if/and/or/not/cat/value/print
- system.* version/time/status queries (read-only)
- choke_group.* read-only queries
- method.has_key, method.const, method.list_keys, method.get, strings.*
- group.*.view, group.*.ratio.min/max/upload (dynamic, via flag propagation)

Blocked by default (not marked):
- execute*, method.insert/set/redirect, schedule*, import
- log.*, file.append, network.scgi.open_*, view.filter/sort/event_*
- system.shutdown, system.env, group.insert, choke_group.insert
- All user-defined commands (via method.insert)
2026-03-23 15:11:07 +01:00
sirus20x6 0aaa470053 Fix resource leaks and minor issues
- Close pipe fds on fork failure in ExecFile::execute
- Add exception-safe fclose in cmd_file_append via try/catch
- Add overflow guards before K/M/G bit shifts in parse_whole_value
- Fix %u format for int* in sscanf (change to %d)
- Fix typo "atter"→"after" in error message
2026-03-16 13:56:43 +01:00
Jari Sundell b233e24465 Deprecated rak::path_expand. 2026-01-08 23:27:53 +09:00
Jari Sundell a8b6a47054 Removed deprecated rak errno and file headers. 2026-01-04 03:22:02 +09:00
rakshasa 0b0c824b4b Changed magnet metadata handling and added 'magnet.path.set'. 2025-12-31 21:57:52 +01:00
Jari Sundell 4bdeb58eb6 Run multiple session save requests in parallel. 2025-12-22 06:26:35 +09:00
Jari Sundell 5dbb0020dc Replace ThreadWorker with scgi::ThreadScgi. 2025-12-18 07:43:43 +09:00
Jari Sundell 8f644e65dd Use separate thread for saving session data. 2025-12-18 06:42:44 +09:00
rakshasa 184ead294a Export 'group2.*' commands. 2025-11-01 14:35:32 +01:00
Jari Sundell 48f82c17c2 Remove deprecated no-target flags for commands. 2025-09-20 17:27:26 +09:00
Rosen Penev 5175414333 add chrono header
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2025-06-22 17:26:22 +02:00
Rosen Penev 0948b5f86a clang-tidy: convert loops to range based
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2025-06-19 09:57:21 +02:00
Jari Sundell f0809ec29d Various pool_event_* and thread API cleanups. 2025-06-01 01:22:14 +09:00
Jari Sundell 3618b9dc4f Added system.files.advise_random.hashing.set command. 2025-05-31 19:19:08 +09:00
Jari Sundell 9d5b769d78 Removed/replaced deprecated commands (execute/schedule/schedule_remove) and removed global lock in ExecFile. 2025-05-05 16:55:38 +09:00
Jari Sundell 85e74b5542 Removed priority_queue and rak/timer. 2025-05-02 18:03:51 +09:00
Jari Sundell 2ab7460cbc Fix SCGI threading and added missing header. 2025-04-01 01:26:07 +09:00
rakshasa 8d991b4ce5 Added 'system.files.session.fdatasync' config option. 2025-03-28 15:32:57 +01:00
Jari Sundell 3a227c190f Added system.files.advise_random.set command. 2025-03-28 19:21:25 +09:00
rakshasa d514e525ca Minor fixes. 2025-01-20 14:49:18 +01:00
Jari Sundell 2e0a417367 Add optional Lua scripting capabilties - kannibalox@gmail.com 2025-01-19 04:02:06 +09:00
Jari Sundell 7659cd0ec0 Backport changes from feature-bind. 2019-08-23 23:25:24 +09:00
rakshasa 89b02f275e Added "system.shutdown", "system.shutdown.normal" and "system.shutdown.quick". 2016-09-23 08:22:24 +09:00
rakshasa 66619840d8 Increased max file size to 512GB. 2016-08-06 03:02:14 +09:00
rakshasa efc9097d62 Renamed system.use_daemon to system.daemon. 2016-06-27 01:46:54 +09:00
zp 7ea5729676 trim modified files 2016-06-19 07:04:23 -05:00
zp c01709fa27 Allow rtorrent to run as a daemon, slightly modified version of the PR provided by sallyswiss 2016-06-19 02:06:30 -05:00
pyroscope 1f5e4d37d5 added system.env=NAME command 2016-03-05 03:12:35 +01:00
rakshasa 7343e33a6a Added 'log.open_file_pid' and 'log.open_gz_file_pid' commands that appends the pid automatically. 2014-11-04 23:34:51 +09:00
rakshasa 3cf9cffe68 Moved logging commands to a separate file. 2014-11-04 19:48:55 +09:00
rakshasa 3b39f37f49 C++11 compatibility fixes. 2014-05-13 23:36:37 +09:00
rakshasa 66edb39863 Added 'log.open_gz_file' option. 2013-08-30 00:09:08 +09:00
rakshasa 412a2f79b9 Removed obsolete logging facility. 2013-07-31 23:24:02 +09:00
rakshasa d0f6bb440a Fixed clang compilation issues. 2012-05-07 02:25:37 +09:00
rakshasa 03c0a4e18c Allow tilde for 'log.open_file' path. 2012-04-18 17:32:12 +09:00
rakshasa bb75f06c6d Replaced std::placeholders with tr1::placholders. 2012-03-21 01:24:35 +09:00