diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..9ae1a70 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,12 @@ +[submodule "external/torrent-peer"] + path = external/torrent-peer + url = ssh://git@git.cieric.com/cieric/Naut-Peer.git + branch = master +[submodule "external/torrent-tracker"] + path = external/torrent-tracker + url = ssh://git@git.cieric.com/cieric/Naut-Tracker.git + branch = main +[submodule "web/torrent-ui"] + path = web/torrent-ui + url = ssh://git@git.cieric.com/cieric/Naut-Plugin-WebUI.git + branch = webui-plugin diff --git a/CMakeLists.txt b/CMakeLists.txt index a1185e0..f4a1a75 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,9 +51,9 @@ 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 +add_subdirectory(${CMAKE_SOURCE_DIR}/external/torrent-peer ${CMAKE_BINARY_DIR}/torrent-peer) -add_subdirectory(${CMAKE_SOURCE_DIR}/../torrent-tracker +add_subdirectory(${CMAKE_SOURCE_DIR}/external/torrent-tracker ${CMAKE_BINARY_DIR}/torrent-tracker) if(NAUT_STANDALONE) diff --git a/README.md b/README.md index 0bbd687..e0908be 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ apps/echo/ Phase 1 gate: io_uring echo server on the buffer pool apps/leech/ Phase 3 gate: verified single-peer download apps/swarm/ tracker/DHT discovery, magnets, and concurrent peers apps/nautctl/ thin CLI frontend over daemon RPC -plugins/webui/ daemon plugin that serves ../torrent-ui as the web panel +plugins/webui/ daemon plugin that serves web/torrent-ui as the web panel tests/unit/ unit + concurrency tests ``` @@ -124,11 +124,11 @@ For tooling and plugin methods, the generic form remains ### Web panel The web panel is a daemon plugin, not part of `nautctl`. It serves the static -frontend from `../torrent-ui/public` by default and adapts that UI's `/api/*` +frontend from `web/torrent-ui/public` by default and adapts that UI's `/api/*` contract to Naut's daemon RPC surface: ```sh -NAUT_WEBUI_ROOT=../torrent-ui/public \ +NAUT_WEBUI_ROOT=web/torrent-ui/public \ NAUT_AUTH_PASSWORD='change-me' \ ./build/nautd --socket /tmp/nautd.sock --plugin ./build/naut_webui.so # open http://127.0.0.1:8080 @@ -139,7 +139,7 @@ Configuration: ```sh NAUT_WEBUI_HOST=127.0.0.1 # default NAUT_WEBUI_PORT=8080 # default -NAUT_WEBUI_ROOT=../torrent-ui/public +NAUT_WEBUI_ROOT=web/torrent-ui/public NAUT_AUTH_USER=admin # default NAUT_AUTH_PASSWORD=change-me # generated and logged if omitted NAUT_WEBUI_SAVE_PATH=/downloads # default add-torrent destination diff --git a/apps/swarm/main.c b/apps/swarm/main.c index da0eea6..c28a0f8 100644 --- a/apps/swarm/main.c +++ b/apps/swarm/main.c @@ -1,6 +1,6 @@ /* naut_swarm — multi-peer download driver built on the torrent-peer engine. * - * The engine (../torrent-peer, engine.h) owns all peer sockets, the wire + * The engine (external/torrent-peer, engine.h) owns all peer sockets, the wire * protocol, the request pipeline, transports (TCP/µTP/MSE), and piece selection. * This driver: * - parses the .torrent / magnet and (for magnet) fetches the info dict, diff --git a/external/torrent-peer b/external/torrent-peer new file mode 160000 index 0000000..f85278f --- /dev/null +++ b/external/torrent-peer @@ -0,0 +1 @@ +Subproject commit f85278fcf2cedda7c1d0da6f227f13714810c550 diff --git a/external/torrent-tracker b/external/torrent-tracker new file mode 160000 index 0000000..dabc487 --- /dev/null +++ b/external/torrent-tracker @@ -0,0 +1 @@ +Subproject commit dabc4875e5e3da928c2ceba948f796bd36004cc7 diff --git a/plugins/webui/webui.c b/plugins/webui/webui.c index b3af7e0..b4cb06e 100644 --- a/plugins/webui/webui.c +++ b/plugins/webui/webui.c @@ -2994,7 +2994,7 @@ static const char *find_root(void) { const char *env = getenv("NAUT_WEBUI_ROOT"); if (dir_exists(env)) return env; static const char *candidates[] = { - "../torrent-ui/public", + "web/torrent-ui/public", "torrent-ui/public", "./public", "/usr/share/naut/torrent-ui/public", diff --git a/web/torrent-ui b/web/torrent-ui new file mode 160000 index 0000000..d1b90cf --- /dev/null +++ b/web/torrent-ui @@ -0,0 +1 @@ +Subproject commit d1b90cfdcbb51de268b98edf2dc0843b9e891323