Configurable public URL for remote-runner job payloads #5798

Open
opened 2026-02-22 12:02:59 -05:00 by deekerman · 2 comments
Owner

Originally created by @jDmacD on GitHub (Oct 19, 2024).

Describe the problem to be solved

Our peertube instance is configured with remote-runners connecting via a local address peertube.lan

peertube-runner \
  register \
  --url http://peertube.lan \
  --registration-token ptrrt-xxxx \
  --runner-name local-runner

When a job is submitted he payload for the runner contains the public URL peertube.io

{
  "input": {
    "videoFileUrl": "https://peertube.io/api/v1/runners/jobs/6da7ce67-870f-43d8-9bdf-74990ee48efe/files/videos/b2e4826d-8a11-43a5-be51-19239578e200/max-quality",
    "separatedAudioFileUrl": []
  },
  "output": {
    "fps": 25,
    "resolution": 576,
    "separatedAudio": false
  }
}

The runner pulls the job from the public URL

[10:10:55.829] INFO (1): Connected to http://peertube.lan/runners socket                                                    
[10:10:55.831] INFO (1): Checking available jobs on http://peertube.lan
[10:24:29.854] INFO (1): [http://peertube.lan] Processing job of type vod-web-video-transcoding: 648ae271-545c-4e34-a34d-15
[10:24:29.857] INFO (1): Downloading input file https://peertube.io/api/v1/runners/jobs/648ae271-545c-4e34-a34d-15c6d2df6ae7/files/videos/b2e4

Our instance is behind Cloudflare, which provides load balancing, TLS termination and a CDN. The preferable situation would be for the runners to pull jobs and files from peertube.lan, as opposed to the longer, more expensive, trip via Cloudflare to peertube.io.

Describe the solution you would like

A configuration option that would allow the setting of a base FQDN and scheme for the videoFileUrl that is supplied to the remote-runners. For instance:

PEERTUBE_REMOTE_RUNNER_JOB_BASE_URL: "http://peertube.lan"
Originally created by @jDmacD on GitHub (Oct 19, 2024). ### Describe the problem to be solved Our peertube instance is configured with remote-runners connecting via a local address `peertube.lan` ``` peertube-runner \ register \ --url http://peertube.lan \ --registration-token ptrrt-xxxx \ --runner-name local-runner ``` When a job is submitted he payload for the runner contains the public URL `peertube.io` ```json { "input": { "videoFileUrl": "https://peertube.io/api/v1/runners/jobs/6da7ce67-870f-43d8-9bdf-74990ee48efe/files/videos/b2e4826d-8a11-43a5-be51-19239578e200/max-quality", "separatedAudioFileUrl": [] }, "output": { "fps": 25, "resolution": 576, "separatedAudio": false } } ``` The runner pulls the job from the _public_ URL ``` [10:10:55.829] INFO (1): Connected to http://peertube.lan/runners socket [10:10:55.831] INFO (1): Checking available jobs on http://peertube.lan [10:24:29.854] INFO (1): [http://peertube.lan] Processing job of type vod-web-video-transcoding: 648ae271-545c-4e34-a34d-15 [10:24:29.857] INFO (1): Downloading input file https://peertube.io/api/v1/runners/jobs/648ae271-545c-4e34-a34d-15c6d2df6ae7/files/videos/b2e4 ``` Our instance is behind Cloudflare, which provides load balancing, TLS termination and a CDN. The preferable situation would be for the runners to pull jobs and files from `peertube.lan`, as opposed to the longer, more expensive, trip via Cloudflare to `peertube.io`. ### Describe the solution you would like A configuration option that would allow the setting of a base FQDN and scheme for the `videoFileUrl` that is supplied to the remote-runners. For instance: ``` PEERTUBE_REMOTE_RUNNER_JOB_BASE_URL: "http://peertube.lan" ```
Author
Owner

@jDmacD commented on GitHub (Oct 21, 2024):

The same result could be achieved purely on the peertube-runner side. Either have the --url flag dictate which address it pulls assets from, or introduce another flag.

@jDmacD commented on GitHub (Oct 21, 2024): The same result could be achieved purely on the peertube-runner side. Either have the `--url` flag dictate which address it pulls assets from, or introduce another flag.
Author
Owner

@saumyakswain commented on GitHub (Jan 16, 2025):

@jDmacD If peertube.lan has a static IP, as a workaround, you may set the /etc/hots on the runner host to resolve peertube.io to your local IP

@saumyakswain commented on GitHub (Jan 16, 2025): @jDmacD If `peertube.lan` has a static IP, as a workaround, you may set the `/etc/hots` on the runner host to resolve `peertube.io` to your local IP
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/PeerTube#5798
No description provided.