Skip to content

Commit fc891bf

Browse files
committed
Release version 4.2.1
2 parents 5beee08 + 9fea61e commit fc891bf

File tree

5 files changed

+24
-24
lines changed

5 files changed

+24
-24
lines changed

Dockerfile

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,24 @@ WORKDIR /app
1212

1313
COPY . .
1414

15-
RUN chmod u+x ./init.sh && \
16-
./init.sh
15+
RUN ./init.sh
1716

1817
FROM python:3.11-slim AS build-image
1918

2019
ARG APP_VERSION
2120

21+
RUN groupadd -g 10001 nonroot && \
22+
useradd nonroot -u 10001 -g 10001
23+
2224
COPY --from=compile-image /bin/ffmpeg /bin/ffmpeg
23-
COPY --from=compile-image /app /app
25+
COPY --chown=nonroot:nonroot --from=compile-image /app /app
2426

2527
WORKDIR /app
2628

2729
# Set XDG_CACHE_HOME for gallery-dl usage
2830
ENV XDG_CACHE_HOME=/app/volume
2931
ENV APP_VERSION=$APP_VERSION
3032

31-
RUN useradd nonroot && \
32-
mkdir -m 777 gallery-dl
33-
3433
USER nonroot
3534

36-
CMD ["/app/.venv/bin/my-discord-bot"]
35+
ENTRYPOINT ["/app/.venv/bin/my-discord-bot"]

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,14 @@ The list below only shows a subset of commands which I think need further explan
101101

102102
#### **Important**: You must have `ffmepg` installed and setup an OAuth token to use this command
103103

104-
To set the OAuth token, run `gallery-dl oauth:pixiv`, then follow the instructions given.
104+
To set the OAuth token, run `gallery-dl oauth:pixiv` (activate venv first), then follow the instructions given.
105105

106106
- **If you are using Docker**, `ffmpeg` has already been installed for you.
107107

108108
Start the discord bot container, then run in console:
109109

110110
1. `docker exec -it <container-name-or-id> /bin/bash`
111-
2. `gallery-dl oauth:pixiv`
111+
2. `./.venv/bin/gallery-dl oauth:pixiv`
112112
3. Follow the instructions given
113113

114114
### `/connect_music`

init.sh

100644100755
Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,37 @@
11
#!/bin/bash
22
set -eu -o pipefail
33

4-
# Get essential tools from apt repo
5-
apt -y update
6-
apt install -y --no-install-recommends curl xz-utils
4+
apt-get -y update
5+
apt-get install -y --no-install-recommends curl xz-utils
6+
7+
# https://serverfault.com/a/984599
8+
# Allow users to run the container with arbitary user ID
9+
mkdir -m 777 gallery-dl
10+
mkdir -m 777 volume
711

812
dir_name=ffmpeg
913
mkdir ../$dir_name
14+
1015
pushd ../$dir_name
1116

12-
# Download compiled FFMPEG binary and perform filehash checking
1317
# TODO: Build a static FFMPEG instead of downloading
1418
xz_name=$(
15-
curl -JOL https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-amd64-static.tar.xz \
19+
curl -JOL https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-linux64-gpl.tar.xz \
1620
-w "%{filename_effective}" --retry 3 --retry-all-errors
1721
)
18-
md5_name=$(
19-
curl -JOL https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-amd64-static.tar.xz.md5 \
22+
sha256_name=$(
23+
curl -JOL https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/checksums.sha256 \
2024
-w "%{filename_effective}" --retry 3 --retry-all-errors
2125
)
22-
md5sum -c "$md5_name"
26+
sha256sum -c "$sha256_name" --ignore-missing
2327

24-
# Extract the archive and move FFMPEG to PATH
28+
# Extract the archive and move FFMPEG to a fixed path
2529
tar xvf "$xz_name" --strip-components 1
26-
mv ffmpeg /bin/ffmpeg
30+
mv ./bin/ffmpeg /bin/ffmpeg
2731

2832
popd
2933

3034
# Install Python dependencies
3135
uv sync
3236

33-
# Use `chmod 777` here instead of `chown nonroot` in case user wants to use their own docker user
34-
chmod -R 777 ./
35-
3637
exit 0

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "my-discord-bot"
3-
version = "4.2.0"
3+
version = "4.2.1"
44
description = "Discord Bot by Reguna"
55
readme = "README.md"
66
requires-python = ">=3.11"

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)