docker-compose: Allow setting up sheetsync for sheets or streamlog

pull/401/head
Mike Lang 1 year ago committed by Mike Lang
parent 986a1db964
commit db3a779292

@ -157,7 +157,10 @@
// Path to a JSON file containing google credentials for sheetsync as keys // Path to a JSON file containing google credentials for sheetsync as keys
// 'client_id', 'client_secret' and 'refresh_token'. // 'client_id', 'client_secret' and 'refresh_token'.
// May be the same as cutter_creds_file. // May be the same as cutter_creds_file.
sheetsync_creds_file:: "./google_creds.json", sheet_creds_file:: "./google_creds.json",
// Path to a text file containing the auth token for the streamlog server
streamlog_creds_file:: "./streamlog_token.txt",
// The URL to write to the sheet for edit links, with {} being replaced by the id // The URL to write to the sheet for edit links, with {} being replaced by the id
edit_url:: "https://wubloader.example.com/thrimbletrimmer/edit.html?id={}", edit_url:: "https://wubloader.example.com/thrimbletrimmer/edit.html?id={}",
@ -178,6 +181,7 @@
backfill_dirs:: ["emotes"], backfill_dirs:: ["emotes"],
// The spreadsheet id and worksheet names for sheet sync to act on // The spreadsheet id and worksheet names for sheet sync to act on
// Set to null to disable syncing from sheets.
sheet_id:: "your_id_here", sheet_id:: "your_id_here",
worksheets:: ["Tech Test & Preshow"] + ["Day %d" % n for n in std.range(1, 8)], worksheets:: ["Tech Test & Preshow"] + ["Day %d" % n for n in std.range(1, 8)],
playlist_worksheet:: "Tags", playlist_worksheet:: "Tags",
@ -186,6 +190,13 @@
// schema and alternate behaviour suitable for long-term archival videos instead of uploads. // schema and alternate behaviour suitable for long-term archival videos instead of uploads.
archive_worksheet:: "Video Trim Times", archive_worksheet:: "Video Trim Times",
// Set to true to enable reverse-sync mode into Sheets, instead of syncing from it.
sheet_reverse_sync:: false,
// The StreamLog server and event to use, or null to disable sync from StreamLog.
streamlog_url:: "https://streamlog.example.com",
streamlog_event:: "myevent",
// A map from youtube playlist IDs to a list of tags. // A map from youtube playlist IDs to a list of tags.
// Playlist manager will populate each playlist with all videos which have all those tags. // Playlist manager will populate each playlist with all videos which have all those tags.
// For example, tags ["Day 1", "Technical"] will populate the playlist with all Technical // For example, tags ["Day 1", "Technical"] will populate the playlist with all Technical
@ -430,26 +441,38 @@
}, },
[if $.enabled.sheetsync then "sheetsync"]: { [if $.enabled.sheetsync then "sheetsync"]: {
image: $.get_image("sheetsync"), local sync_sheet = {
// Args for the sheetsync
command: [
"--backdoor-port", std.toString($.backdoor_port),
$.db_connect,
std.manifestJson({
type: "sheets", type: "sheets",
creds: "/etc/wubloader-creds.json", creds: "/etc/sheet-creds.json",
sheet_id: $.sheet_id, sheet_id: $.sheet_id,
worksheets: $.worksheets, worksheets: $.worksheets,
allocate_ids: true, allocate_ids: true,
edit_url: $.edit_url, edit_url: $.edit_url,
bustime_start: $.bustime_start, bustime_start: $.bustime_start,
playlist_worksheet: $.playlist_worksheet, playlist_worksheet: $.playlist_worksheet,
}), reverse_sync: $.sheet_reverse_sync,
], },
volumes: [ local sync_streamlog = {
// Mount the creds file into /etc type: "streamlog",
"%s:/etc/wubloader-creds.json" % $.sheetsync_creds_file, creds: "/etc/streamlog-token.txt",
], url: $.streamlog_url,
event_name: $.streamlog_event,
},
local config = std.prune([
if $.sheet_id != null then sync_sheet,
if $.streamlog_url != null then sync_streamlog,
]),
image: $.get_image("sheetsync"),
// Args for the sheetsync
command: [
"--backdoor-port", std.toString($.backdoor_port),
$.db_connect,
] + std.map(std.manifestJson, config),
// Mount the creds file(s) into /etc
volumes: std.prune([
if $.sheet_id != null then "%s:/etc/sheet-creds.json" % $.sheet_creds_file,
if $.streamlog_url != null then "%s:/etc/streamlog-token.txt" % $.streamlog_creds_file,
]),
// If the application crashes, restart it. // If the application crashes, restart it.
restart: "on-failure", restart: "on-failure",
// Expose on the configured host port by mapping that port to the default // Expose on the configured host port by mapping that port to the default

Loading…
Cancel
Save