diff --git a/AGENTS.md b/AGENTS.md index c9e864d..06280db 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -22,4 +22,4 @@ Commits follow a Conventional Commits prefix (`fix:`, `refactor:`) in imperative Document expected locations for `yt-dlp`, cookies, and OPML files when altering defaults. If a change requires bgutil or other external services, provide startup commands and update the sample `config.json`. Ensure new options degrade gracefully for existing configs and call out migration steps in the PR description. ## HTTP API -Enable the intake server with `http_api.enable` (binds to `127.0.0.1:4416`). Set `auth_token` or point `auth_token_file` at a mounted secret, and use `queue_file` to persist pending jobs. Example: `curl -H "Authorization: Bearer $TOKEN" -d '{"url":"https://youtu.be/ID","out_dir":"Channel"}' http://127.0.0.1:4416/v1/videos`. Inspect the queue with `curl -H "Authorization: Bearer $TOKEN" http://127.0.0.1:4416/status`. +Enable the intake server with `http_api.enable` (default bind `0.0.0.0:6901`). Set `auth_token` or point `auth_token_file` at a mounted secret, and use `queue_file` to persist pending jobs. Example: `curl -H "Authorization: Bearer $TOKEN" -d '{"url":"https://youtu.be/ID","out_dir":"Channel"}' http://127.0.0.1:6901/v1/videos`. Inspect the queue with `curl -H "Authorization: Bearer $TOKEN" http://127.0.0.1:6901/status`. diff --git a/Containerfile b/Containerfile index d8b7242..893b14f 100644 --- a/Containerfile +++ b/Containerfile @@ -54,7 +54,7 @@ COPY <<-EOT /data/config.json "out_dir": "/data/vids", "http_api": { "enable": true, - "listen": "127.0.0.1:4416", + "listen": "127.0.0.1:6901", "auth_token_file": "/run/secrets/subsyt-token", "queue_file": "/data/api-queue.json" }, diff --git a/README.md b/README.md index 4e8bdda..7ae8e47 100644 --- a/README.md +++ b/README.md @@ -272,7 +272,7 @@ OPML export. { "http_api": { "enable": true, - "listen": "127.0.0.1:4416", + "listen": "0.0.0.0:6901", "auth_token_file": "/run/secrets/subsyt-token", "queue_file": "./tmp/api-queue.json" } @@ -286,7 +286,7 @@ curl \ -H "Authorization: Bearer $(cat /run/secrets/subsyt-token)" \ -H "Content-Type: application/json" \ --data '{"url":"https://youtu.be/VIDEO","out_dir":"Channel"}' \ - http://127.0.0.1:4416/v1/videos + http://127.0.0.1:6901/v1/videos ``` Requests reuse the configured yt-dlp binary, honor existing throttling, and @@ -295,7 +295,7 @@ persist through restarts when `queue_file` is provided. Check the pending queue for debugging: ``` -curl -H "Authorization: Bearer super-secret" http://127.0.0.1:4416/status +curl -H "Authorization: Bearer super-secret" http://127.0.0.1:6901/status ``` ## result diff --git a/internal/server/server.go b/internal/server/server.go index 4db42e9..3032feb 100644 --- a/internal/server/server.go +++ b/internal/server/server.go @@ -15,7 +15,7 @@ import ( "git.meatbag.se/varl/subsyt/internal/config" ) -const defaultListen = "127.0.0.1:4416" +const defaultListen = "0.0.0.0:6901" type Server struct { cfg config.Http_api