Integrate chat archiver as a proper component

pull/300/head
Mike Lang 2 years ago committed by Mike Lang
parent f8b3ace148
commit 315c9c8297

@ -11,7 +11,7 @@ cd "$(dirname "$(realpath "$0")")"
# Pass PUSH=true to also push the resulting images, or PUSH=latest to push them as :latest tag
# The different images we can build
COMPONENTS=(downloader restreamer backfiller thrimshim cutter sheetsync nginx postgres segment_coverage playlist_manager)
COMPONENTS=(downloader restreamer backfiller thrimshim cutter sheetsync nginx postgres segment_coverage playlist_manager chat_archiver)
# Define push if not already defined
PUSH=${PUSH:-}

@ -1,6 +1,22 @@
FROM quay.io/ekimekim/wubloader-downloader:32138bb
COPY girc /tmp/girc
FROM alpine:3.14
# dependencies needed for compiling c extensions
# also busybox-extras for telnet for easier use of backdoor
RUN apk --update add py3-pip g++ python3-dev libffi-dev musl-dev file make busybox-extras
# Install gevent so that we don't need to re-install it when common changes
RUN pip install gevent
# Install girc, it's not really properly published on pypi so we pull it in via submodule
COPY chat_archiver/girc /tmp/girc
RUN pip install /tmp/girc && rm -r /tmp/girc
COPY . /tmp/archiver
# Install common lib first as it changes less
COPY common /tmp/common
RUN pip install /tmp/common && rm -r /tmp/common
# Actual application
COPY chat_archiver /tmp/archiver
RUN pip install /tmp/archiver && rm -r /tmp/archiver
LABEL org.opencontainers.image.source https://github.com/ekimekim/wubloader
ENTRYPOINT ["python", "-m", "chat_archiver", "--base-dir", "/mnt"]

@ -27,6 +27,7 @@
playlist_manager: false,
nginx: true,
postgres: false,
chat_archiver: false,
},
// Twitch channels to capture. The first one will be used as the default channel in the editor.
@ -171,11 +172,12 @@
],
chat_archiver:: {
image: "ghcr.io/ekimekim/wubloader-downloader:chat-archiver-hack-1",
channel: "desertbus",
// We currently only support archiving chat from one channel at once.
// This defaults to the first channel in the $.channels list.
channel: $.clean_channels[0],
// Twitch user to log in as and path to oauth token
user: "dbvideostriketeam",
logs_path: "%s/chat_logs" % $.segments_path,
token_path: "./chat_token.txt".
token_path: "./chat_token.txt",
},
// Extra options to pass via environment variables,
@ -449,12 +451,11 @@
[if $.db_standby then "command"]: ["/standby_setup.sh"],
},
[if $.chat_archiver != "null" then "chat_archiver"]: {
local c = $.chat_archiver,
image: c.image,
[if $.enabled.chat_archiver then "chat_archiver"]: {
image: $.get_image("chat_archiver"),
restart: "always",
command: [c.channel, c.user, "/token"],
volumes: ["%s:/mnt" % c.logs_path, "%s:/token" % c.token_path],
command: [$.chat_archiver.channel, $.chat_archiver.user, "/token"],
volumes: ["%s:/mnt" % $.segments_path, "%s:/token" % $.chat_archiver.token_path],
},
},

Loading…
Cancel
Save