From 542829429c6d3228ba96f4049da7e4a92ff85023 Mon Sep 17 00:00:00 2001 From: Mike Lang Date: Wed, 25 Oct 2023 23:42:21 +1100 Subject: [PATCH] docker-compose: Add ability to give downloader an auth token --- docker-compose.jsonnet | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/docker-compose.jsonnet b/docker-compose.jsonnet index bcca4c9..ad6eb3c 100644 --- a/docker-compose.jsonnet +++ b/docker-compose.jsonnet @@ -114,6 +114,10 @@ db_readonly_password:: "volunteer", // don't use default in production. Must not contain ' or \ as these are not escaped. db_standby:: false, // set to true to have this database replicate another server + // Path to a file containing a twitch OAuth token to use when downloading streams. + // This is optional (null to omit) but may be helpful to bypass ads. + downloader_creds_file:: null, + // Path to a JSON file containing google credentials for cutter as keys // 'client_id', 'client_secret' and 'refresh_token'. cutter_creds_file:: "./google_creds.json", @@ -284,9 +288,10 @@ "--base-dir", "/mnt", "--qualities", std.join(",", $.qualities), "--backdoor-port", std.toString($.backdoor_port), - ], + ] + if $.downloader_creds_file != null then ["--auth-file", "/token"] else [], // Mount the segments directory at /mnt - volumes: ["%s:/mnt" % $.segments_path], + volumes: ["%s:/mnt" % $.segments_path] + + if $.downloader_creds_file != null then ["%s:/token" % $.downloader_creds_file] else [], // If the application crashes, restart it. restart: "on-failure", // Expose on the configured host port by mapping that port to the default