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:
ookami125 2026-06-21 23:19:41 -04:00
parent 6dc711cf57
commit b633b7d216
40 changed files with 3305 additions and 3267 deletions

View file

@ -1,4 +1,5 @@
/* dht.h - BEP-5 KRPC codec and bounded IPv4 get_peers traversal. */
/* dht.h - bounded IPv4 BEP-5 get_peers traversal (KRPC codec from
* torrent-tracker; iterative walk + UDP socket in src/discovery). */
#ifndef NAUT_DHT_H
#define NAUT_DHT_H
@ -9,54 +10,6 @@
#define NAUT_DHT_MAX_NODES 256
#define NAUT_DHT_MAX_PEERS 256
typedef struct {
uint8_t id[NAUT_DHT_ID_LEN];
uint8_t ip[4];
uint16_t port;
} naut_dht_node;
typedef enum {
NAUT_DHT_RESPONSE,
NAUT_DHT_ERROR
} naut_dht_message_type;
typedef struct {
naut_dht_message_type type;
uint8_t transaction[8];
size_t transaction_len;
uint8_t id[NAUT_DHT_ID_LEN];
bool has_id;
uint8_t token[64];
size_t token_len;
naut_dht_node *nodes;
size_t num_nodes;
naut_peer_addr *peers;
size_t num_peers;
int error_code;
} naut_dht_response;
naut_err naut_dht_build_ping(const uint8_t *tx, size_t tx_len,
const uint8_t id[20],
uint8_t **out, size_t *out_len);
naut_err naut_dht_build_find_node(const uint8_t *tx, size_t tx_len,
const uint8_t id[20],
const uint8_t target[20],
uint8_t **out, size_t *out_len);
naut_err naut_dht_build_get_peers(const uint8_t *tx, size_t tx_len,
const uint8_t id[20],
const uint8_t info_hash[20],
uint8_t **out, size_t *out_len);
naut_err naut_dht_build_announce_peer(const uint8_t *tx, size_t tx_len,
const uint8_t id[20],
const uint8_t info_hash[20],
uint16_t port, bool implied_port,
const void *token, size_t token_len,
uint8_t **out, size_t *out_len);
naut_err naut_dht_parse_response(const uint8_t *data, size_t len,
naut_dht_response *out);
void naut_dht_response_free(naut_dht_response *response);
/* Query bootstrap endpoints ("host:port") and iteratively follow returned
* compact nodes until peers are found or the bounded traversal is exhausted. */
naut_err naut_dht_get_peers(const char *const *bootstrap, size_t num_bootstrap,