nautd/webui: scripting, labels, settings, set-location, pause fix
Session checkpoint on webui-plugin: - engine dump (nautctl dump) + engine endgame integration - per-file move locations persistence; torrent-level "Set location" with reset/keep-relative/leave-separate handling + residual prune - Lua: naut.get_labels, define_settings/get_setting (script_host struct) - daemon-owned labels (category+tags) + taxonomy persistence; webui write-through - fix: pausing a completed/seeding torrent now sticks (stop wins over result) - automation tab responsive layout; anime_sort label gating + settings Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
6dc711cf57
commit
b633b7d216
40 changed files with 3305 additions and 3267 deletions
117
CMakeLists.txt
117
CMakeLists.txt
|
|
@ -39,6 +39,23 @@ if(NOT URING_LIB OR NOT URING_INC)
|
|||
endif()
|
||||
find_package(OpenSSL REQUIRED COMPONENTS Crypto)
|
||||
|
||||
# --- external download engine + tracker/DHT protocol libraries --------------
|
||||
# torrent-peer: multi-peer download engine (engine.h) — replaces Naut's own peer
|
||||
# poll loop, request pipeline, and MSE transport.
|
||||
# torrent-tracker: tracker/DHT wire codec (tracker.h) — drives Naut's announce
|
||||
# and get_peers glue in src/discovery.
|
||||
set(PEER_NATIVE ${NAUT_NATIVE} CACHE BOOL "" FORCE)
|
||||
set(TRACKER_NATIVE ${NAUT_NATIVE} CACHE BOOL "" FORCE)
|
||||
set(TRACKER_TESTS OFF CACHE BOOL "" FORCE)
|
||||
if(NAUT_SAN STREQUAL "address" OR NAUT_SAN STREQUAL "undefined")
|
||||
set(PEER_ASAN ON CACHE BOOL "" FORCE)
|
||||
set(TRACKER_ASAN ON CACHE BOOL "" FORCE)
|
||||
endif()
|
||||
add_subdirectory(${CMAKE_SOURCE_DIR}/../torrent-peer
|
||||
${CMAKE_BINARY_DIR}/torrent-peer)
|
||||
add_subdirectory(${CMAKE_SOURCE_DIR}/../torrent-tracker
|
||||
${CMAKE_BINARY_DIR}/torrent-tracker)
|
||||
|
||||
if(NAUT_STANDALONE)
|
||||
include(FetchContent)
|
||||
|
||||
|
|
@ -141,24 +158,16 @@ target_link_libraries(naut_bencode PUBLIC naut_core)
|
|||
add_library(naut_metainfo STATIC src/metainfo/metainfo.c src/metainfo/magnet.c)
|
||||
target_link_libraries(naut_metainfo PUBLIC naut_bencode naut_crypto)
|
||||
|
||||
# --- tracker: HTTP + UDP announce (codec + blocking fetch) ------------------
|
||||
add_library(naut_tracker STATIC
|
||||
src/tracker/tracker.c src/tracker/udp.c src/tracker/fetch.c)
|
||||
target_link_libraries(naut_tracker PUBLIC naut_bencode)
|
||||
# --- discovery: tracker announce + DHT get_peers glue over torrent-tracker ---
|
||||
add_library(naut_discovery STATIC
|
||||
src/discovery/tracker_client.c src/discovery/dht_client.c)
|
||||
target_link_libraries(naut_discovery PUBLIC naut_core torrenttracker)
|
||||
|
||||
# --- dht: BEP-5 KRPC codec + bounded iterative peer lookup ------------------
|
||||
add_library(naut_dht STATIC src/dht/dht.c src/dht/fetch.c)
|
||||
target_link_libraries(naut_dht PUBLIC naut_bencode naut_tracker)
|
||||
|
||||
# --- peer: wire protocol codec (sans-IO) ------------------------------------
|
||||
# --- peer: wire protocol codec (sans-IO), retained for magnet metadata -------
|
||||
add_library(naut_peer STATIC
|
||||
src/peer/wire.c src/peer/extension.c src/peer/metadata.c src/peer/pipeline.c)
|
||||
src/peer/wire.c src/peer/extension.c src/peer/metadata.c)
|
||||
target_link_libraries(naut_peer PUBLIC
|
||||
naut_core naut_crypto naut_bencode naut_tracker m)
|
||||
|
||||
# MSE is optional at the application boundary and is the only OpenSSL user.
|
||||
add_library(naut_mse STATIC src/peer/mse.c)
|
||||
target_link_libraries(naut_mse PUBLIC naut_peer OpenSSL::Crypto)
|
||||
naut_core naut_crypto naut_bencode m)
|
||||
|
||||
# --- storage: file backend --------------------------------------------------
|
||||
add_library(naut_storage STATIC src/storage/storage.c)
|
||||
|
|
@ -209,26 +218,12 @@ target_include_directories(naut_webui PRIVATE ${CMAKE_SOURCE_DIR}/include)
|
|||
target_link_libraries(naut_webui PRIVATE ${NAUT_JANSSON_TARGET} pthread)
|
||||
set_target_properties(naut_webui PROPERTIES PREFIX "")
|
||||
|
||||
# --- echo: Phase 1 gate (io_uring echo server on the buffer pool) -----------
|
||||
# add_executable(naut_echo apps/echo/main.c)
|
||||
# target_link_libraries(naut_echo PRIVATE naut_platform naut_core)
|
||||
|
||||
# --- leech: Phase 3 gate (single-peer download, byte-correct + verified) ----
|
||||
# add_executable(naut_leech apps/leech/main.c)
|
||||
# target_link_libraries(naut_leech PRIVATE
|
||||
# naut_piece naut_peer naut_mse naut_metainfo)
|
||||
|
||||
# --- swarm: Phase 4 gate (multi-peer download, rarest-first + endgame) -------
|
||||
# --- swarm: multi-peer download driver over the torrent-peer engine ---------
|
||||
add_library(naut_swarm_engine STATIC apps/swarm/main.c)
|
||||
target_compile_definitions(naut_swarm_engine PRIVATE NAUT_SWARM_LIBRARY)
|
||||
target_link_libraries(naut_swarm_engine PUBLIC
|
||||
naut_piece naut_peer naut_metainfo naut_tracker naut_dht naut_system
|
||||
naut_session)
|
||||
|
||||
# add_executable(naut_swarm apps/swarm/main.c)
|
||||
# target_link_libraries(naut_swarm PRIVATE
|
||||
# naut_piece naut_peer naut_metainfo naut_tracker naut_dht naut_system
|
||||
# naut_session)
|
||||
naut_piece naut_peer naut_metainfo naut_discovery naut_system
|
||||
naut_session torrentpeer)
|
||||
|
||||
# --- daemon + CLI: Phase 7 extensibility surface ---------------------------
|
||||
add_executable(nautd apps/nautd/main.c)
|
||||
|
|
@ -250,10 +245,6 @@ add_executable(test_worker tests/unit/test_worker.c)
|
|||
target_link_libraries(test_worker PRIVATE naut_core naut_crypto)
|
||||
add_test(NAME test_worker COMMAND test_worker)
|
||||
|
||||
add_executable(test_pipeline tests/unit/test_pipeline.c)
|
||||
target_link_libraries(test_pipeline PRIVATE naut_peer)
|
||||
add_test(NAME test_pipeline COMMAND test_pipeline)
|
||||
|
||||
add_executable(test_rpc tests/unit/test_rpc.c)
|
||||
target_link_libraries(test_rpc PRIVATE naut_rpc)
|
||||
add_test(NAME test_rpc COMMAND test_rpc)
|
||||
|
|
@ -300,18 +291,6 @@ add_executable(test_extension tests/unit/test_extension.c)
|
|||
target_link_libraries(test_extension PRIVATE naut_peer)
|
||||
add_test(NAME test_extension COMMAND test_extension)
|
||||
|
||||
add_executable(test_mse tests/unit/test_mse.c)
|
||||
target_link_libraries(test_mse PRIVATE naut_mse)
|
||||
add_test(NAME test_mse COMMAND test_mse)
|
||||
|
||||
add_executable(test_tracker tests/unit/test_tracker.c)
|
||||
target_link_libraries(test_tracker PRIVATE naut_tracker)
|
||||
add_test(NAME test_tracker COMMAND test_tracker)
|
||||
|
||||
add_executable(test_dht tests/unit/test_dht.c)
|
||||
target_link_libraries(test_dht PRIVATE naut_dht)
|
||||
add_test(NAME test_dht COMMAND test_dht)
|
||||
|
||||
add_executable(test_storage tests/unit/test_storage.c)
|
||||
target_link_libraries(test_storage PRIVATE naut_storage)
|
||||
add_test(NAME test_storage COMMAND test_storage)
|
||||
|
|
@ -332,48 +311,6 @@ add_executable(test_picker tests/unit/test_picker.c)
|
|||
target_link_libraries(test_picker PRIVATE naut_piece)
|
||||
add_test(NAME test_picker COMMAND test_picker)
|
||||
|
||||
# Phase 3 interop gate: download from a real libtorrent seed (SKIPs without it).
|
||||
# These gates exercise the standalone naut_leech/naut_swarm/naut_echo binaries,
|
||||
# which are currently folded into the daemon — register them only when built.
|
||||
if(TARGET naut_leech)
|
||||
add_test(NAME interop_leech
|
||||
COMMAND bash ${CMAKE_SOURCE_DIR}/tests/integration/run_interop.sh $<TARGET_FILE:naut_leech>)
|
||||
set_tests_properties(interop_leech PROPERTIES SKIP_RETURN_CODE 77 TIMEOUT 180)
|
||||
|
||||
add_test(NAME interop_mse
|
||||
COMMAND bash ${CMAKE_SOURCE_DIR}/tests/integration/run_mse.sh $<TARGET_FILE:naut_leech>)
|
||||
set_tests_properties(interop_mse PROPERTIES SKIP_RETURN_CODE 77 TIMEOUT 60)
|
||||
endif()
|
||||
|
||||
if(TARGET naut_swarm)
|
||||
add_test(NAME interop_magnet_dht
|
||||
COMMAND bash ${CMAKE_SOURCE_DIR}/tests/integration/run_magnet_dht.sh
|
||||
$<TARGET_FILE:naut_swarm>)
|
||||
set_tests_properties(interop_magnet_dht PROPERTIES SKIP_RETURN_CODE 77 TIMEOUT 60)
|
||||
|
||||
# Phase 4 interop gate: both libtorrent seeds must contribute to one download.
|
||||
add_test(NAME interop_swarm
|
||||
COMMAND bash ${CMAKE_SOURCE_DIR}/tests/integration/run_swarm.sh $<TARGET_FILE:naut_swarm>)
|
||||
set_tests_properties(interop_swarm PROPERTIES SKIP_RETURN_CODE 77 TIMEOUT 60)
|
||||
|
||||
add_test(NAME interop_tracker_swarm
|
||||
COMMAND bash ${CMAKE_SOURCE_DIR}/tests/integration/run_tracker_swarm.sh
|
||||
$<TARGET_FILE:naut_swarm> http)
|
||||
set_tests_properties(interop_tracker_swarm PROPERTIES SKIP_RETURN_CODE 77 TIMEOUT 60)
|
||||
|
||||
add_test(NAME interop_udp_tracker_swarm
|
||||
COMMAND bash ${CMAKE_SOURCE_DIR}/tests/integration/run_tracker_swarm.sh
|
||||
$<TARGET_FILE:naut_swarm> udp)
|
||||
set_tests_properties(interop_udp_tracker_swarm PROPERTIES SKIP_RETURN_CODE 77 TIMEOUT 60)
|
||||
endif()
|
||||
|
||||
if(TARGET naut_echo)
|
||||
add_test(NAME interop_echo_scale
|
||||
COMMAND bash ${CMAKE_SOURCE_DIR}/tests/integration/run_echo_scale.sh
|
||||
$<TARGET_FILE:naut_echo>)
|
||||
set_tests_properties(interop_echo_scale PROPERTIES TIMEOUT 30)
|
||||
endif()
|
||||
|
||||
add_test(NAME phase7_extensibility
|
||||
COMMAND bash ${CMAKE_SOURCE_DIR}/tests/integration/run_phase7.sh
|
||||
$<TARGET_FILE:nautd> $<TARGET_FILE:nautctl>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue