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 # Pass PUSH=true to also push the resulting images, or PUSH=latest to push them as :latest tag
# The different images we can build # 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 # Define push if not already defined
PUSH=${PUSH:-} PUSH=${PUSH:-}

@ -1,6 +1,22 @@
FROM quay.io/ekimekim/wubloader-downloader:32138bb FROM alpine:3.14
COPY girc /tmp/girc # 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 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 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"] ENTRYPOINT ["python", "-m", "chat_archiver", "--base-dir", "/mnt"]

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

Loading…
Cancel
Save