Browse Source

new: [peertube] update to v3.3.0

Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
pull/1/head
Valentin Lab 3 years ago
parent
commit
39ff6f9c3b
  1. 14
      peertube/build/Dockerfile
  2. 26
      peertube/build/dbname.patch
  3. 1
      peertube/hooks/init
  4. 2
      peertube/hooks/postgres_database-relation-joined

14
peertube/build/Dockerfile

@ -1,4 +1,4 @@
FROM alpine:3.9 AS common
FROM alpine:3.14 AS common
RUN apk add gnupg ffmpeg
@ -13,11 +13,10 @@ FROM common AS builder
## Download target release
##
ENV PEERTUBE_RELEASE=v2.1.1
ENV PEERTUBE_RELEASE=v3.3.0
RUN apk add wget
COPY ./*.patch /tmp
RUN mkdir -p /opt/apps/peertube && \
cd /opt/apps/peertube && \
wget https://github.com/Chocobozzz/PeerTube/releases/download/${PEERTUBE_RELEASE}/peertube-${PEERTUBE_RELEASE}.tar.xz && \
@ -25,12 +24,12 @@ RUN mkdir -p /opt/apps/peertube && \
rm peertube-${PEERTUBE_RELEASE}.tar.xz && \
mv peertube-${PEERTUBE_RELEASE}/* . && \
rmdir peertube-${PEERTUBE_RELEASE} && \
cat /tmp/*.patch | patch -p1 && \
mkdir -p /etc/peertube /var/lib/peertube && \
ln -sf /var/lib/peertube /opt/apps/peertube/storage
RUN apk add yarn ## Build command
RUN apk add git build-base python bash ## Build deps
RUN apk add yarn ## Build command
RUN apk add git build-base python3 bash && \
ln -sf /usr/bin/python3 /usr/local/bin/python ## Build deps
RUN chown -R peertube:peertube /opt/apps/peertube
@ -39,7 +38,6 @@ RUN apk add npm ## only needed to install things that should be in yarn
USER peertube
RUN cd /opt/apps/peertube && \
npm install bcrypt && \
yarn install --production --pure-lockfile && \
yarn cache clean
@ -92,7 +90,7 @@ VOLUME /etc/peertube
EXPOSE 9000
RUN apk add nodejs-npm
RUN apk add nodejs npm
## runtime deps
RUN apk add openssl

26
peertube/build/dbname.patch

@ -1,26 +0,0 @@
diff --git a/dist/server/initializers/checker-before-init.js b/dist/server/initializers/checker-before-init.js
index d8422ee..5eb3678 100644
--- a/dist/server/initializers/checker-before-init.js
+++ b/dist/server/initializers/checker-before-init.js
@@ -16,7 +16,7 @@ function checkMissedConfig() {
const required = ['listen.port', 'listen.hostname',
'webserver.https', 'webserver.hostname', 'webserver.port',
'trust_proxy',
- 'database.hostname', 'database.port', 'database.suffix', 'database.username', 'database.password', 'database.pool.max',
+ 'database.hostname', 'database.port', 'database.dbname', 'database.username', 'database.password', 'database.pool.max',
'smtp.hostname', 'smtp.port', 'smtp.username', 'smtp.password', 'smtp.tls', 'smtp.from_address',
'email.body.signature', 'email.subject.prefix',
'storage.avatars', 'storage.videos', 'storage.logs', 'storage.previews', 'storage.thumbnails', 'storage.torrents', 'storage.cache',
diff --git a/dist/server/initializers/config.js b/dist/server/initializers/config.js
index 6aa916f..89d16fe 100644
--- a/dist/server/initializers/config.js
+++ b/dist/server/initializers/config.js
@@ -12,7 +12,7 @@ const CONFIG = {
HOSTNAME: config.get('listen.hostname')
},
DATABASE: {
- DBNAME: 'peertube' + config.get('database.suffix'),
+ DBNAME: config.get('database.dbname'),
HOSTNAME: config.get('database.hostname'),
PORT: config.get('database.port'),
USERNAME: config.get('database.username'),

1
peertube/hooks/init

@ -66,6 +66,7 @@ for section in "${VALID_SECTION[@]}"; do
done >> "$HOST_CONFIG_DIR/local.yaml"
if ! [ -e "$HOST_DATA_DIR/config.json" ]; then
mkdir -p "$HOST_DATA_DIR"
echo "{}" > "$HOST_DATA_DIR/config.json"
fi

2
peertube/hooks/postgres_database-relation-joined

@ -15,7 +15,7 @@ cat <<EOF >> "$HOST_CONFIG_DIR/local.yaml"
database:
hostname: '$TARGET_SERVICE_NAME'
## We had to patch peertube to have a direct dbname (doh!)
dbname: '$DBNAME'
name: '$DBNAME'
port: 5432
username: '$USER'
password: '$PASSWORD'

Loading…
Cancel
Save