Compare commits

...

73 commits

Author SHA1 Message Date
Girish Ramakrishnan
f63b6e5980 Update renovate.json5 2024-11-04 17:09:44 +00:00
Girish Ramakrishnan
77a94bc604 Add renovate.json5 2024-11-04 17:02:39 +00:00
Girish Ramakrishnan
e8d21f0c41 Delete renovate.json 2024-11-04 16:56:36 +00:00
Girish Ramakrishnan
9d5d5814bf Delete .gitlab-ci.yml 2024-11-04 08:37:34 +00:00
Johannes Zellner
a5ed218087 Bump version 2024-10-30 11:23:33 +01:00
Renovate Bot
4d3b7017aa chore(deps): update dependency chocobozzz/peertube to v6.3.3
| datasource      | package             | from  | to    |
| --------------- | ------------------- | ----- | ----- |
| github-releases | Chocobozzz/PeerTube | 6.3.2 | 6.3.3 |
2024-10-30 08:16:00 +00:00
Johannes Zellner
f95ab39f8e Bump version 2024-10-08 13:03:48 +02:00
Renovate Bot
9971b408f3 chore(deps): update dependency chocobozzz/peertube to v6.3.2 2024-10-08 10:22:28 +00:00
Renovate Bot
8d84919789 chore(deps): add renovate.json 2024-10-08 10:19:54 +00:00
Johannes Zellner
7863c6b4a8 Add renovate Dockerfile line 2024-10-08 12:19:03 +02:00
Johannes Zellner
9d935df33d Add gitlab-ci file 2024-10-08 12:16:24 +02:00
Johannes Zellner
ddb5032db9 Make tests possible without human interaction 2024-10-08 12:15:54 +02:00
Girish Ramakrishnan
9eea2f2e29 Version 3.0.1 2024-09-25 19:09:19 +02:00
Girish Ramakrishnan
1f1df0971b Update Peertube to 6.3.1 2024-09-25 18:38:30 +02:00
Johannes Zellner
9c07e658ba Update test deps 2024-09-22 13:13:10 +02:00
Johannes Zellner
c9e4392fd3 Bump version 2024-09-20 15:16:54 +02:00
Johannes Zellner
70a6487409 Add /usr/bin/migrate command only for this release 2024-09-19 19:40:21 +02:00
Johannes Zellner
1ef5ac6f04 Update test deps 2024-09-19 16:11:45 +02:00
Johannes Zellner
cf76785d51 Bump version 2024-09-18 14:19:07 +02:00
Johannes Zellner
b93429a414 Update test deps 2024-09-18 12:17:04 +02:00
Johannes Zellner
6edd1cf5c2 Update to 6.3.0 2024-09-18 12:11:51 +02:00
Girish Ramakrishnan
9b5bcc61c6 Version 2.17.1 2024-08-01 11:59:07 +02:00
Girish Ramakrishnan
3ec04d6700 Update test packages 2024-08-01 11:46:53 +02:00
Girish Ramakrishnan
8f22984b99 Update Peertube to 6.2.1 2024-08-01 11:40:10 +02:00
Johannes Zellner
7938a5b4d2 Bump version 2024-07-16 14:57:32 +02:00
Johannes Zellner
f4d628624e Update test deps 2024-07-16 10:11:31 +02:00
Johannes Zellner
89c32aad8f Update to 6.2.0 2024-07-16 10:11:22 +02:00
Johannes Zellner
46feafc923 Update nginx config according to upstream 2024-04-29 13:42:10 +02:00
Johannes Zellner
c348b44294 Bump version 2024-04-29 13:40:43 +02:00
Johannes Zellner
cad464a8c8 storage.original_video_files is now required 2024-04-29 13:37:34 +02:00
Johannes Zellner
539cce44d1 Update test deps 2024-04-29 11:23:23 +02:00
Johannes Zellner
252cee6e1c Update to 6.1.0 2024-04-29 11:23:01 +02:00
Johannes Zellner
942b937a8f Bump version 2024-04-04 15:56:19 +02:00
Johannes Zellner
0bd51a6143 Make tests language independent 2024-04-04 15:52:18 +02:00
Johannes Zellner
a54fd42ce9 Update test deps 2024-04-04 15:21:33 +02:00
Johannes Zellner
90c7834d38 Update to 6.0.4 2024-04-04 15:20:03 +02:00
Girish Ramakrishnan
6021c34466 Version 2.15.1 2024-01-18 12:23:32 +01:00
Girish Ramakrishnan
a2776ec87f Fix nginx config 2024-01-18 12:23:23 +01:00
Girish Ramakrishnan
441b8dba99 more test fixing 2024-01-18 12:21:14 +01:00
Girish Ramakrishnan
6f63008dd3 Fix tests 2024-01-18 11:47:58 +01:00
Girish Ramakrishnan
f97551091d Update Peertube to 6.0.3 2024-01-18 10:58:23 +01:00
Girish Ramakrishnan
854ffa875c Version 2.15.0 2024-01-16 15:31:38 +01:00
Girish Ramakrishnan
e92dfaed0b typo 2024-01-16 15:27:31 +01:00
Girish Ramakrishnan
27fb06cd91 optional configure it seems 2024-01-16 15:00:04 +01:00
Girish Ramakrishnan
82be3d5f13 Fix test 2024-01-16 14:23:23 +01:00
Girish Ramakrishnan
3c7afbe0ca always install oidc plugin 2024-01-16 14:22:02 +01:00
Vladimir D
4fcf9b1684 OIDC auth implemented, tests updated 2024-01-15 21:01:40 +04:00
Vladimir D
56009a97dd make it using nginx 2024-01-10 21:04:08 +04:00
Girish Ramakrishnan
07b2808530 Version 2.14.0-1 2024-01-05 13:05:36 +01:00
Girish Ramakrishnan
55d66cd2bb highlight breaking changes 2024-01-05 13:05:26 +01:00
Johannes Zellner
0471f18395 Bump version 2023-12-28 12:38:47 +01:00
Johannes Zellner
98a445de41 Fixup tests 2023-12-28 12:21:57 +01:00
Johannes Zellner
633d8f793c Update test deps 2023-12-24 13:51:30 +01:00
Johannes Zellner
b97e25852c Ensure newly required settings 2023-12-24 13:43:56 +01:00
Johannes Zellner
e6c37a102f Update to 6.0.2 2023-12-22 17:33:29 +01:00
Girish Ramakrishnan
1782eb10da Version 2.13.0-1 2023-11-22 13:00:15 +01:00
Girish Ramakrishnan
653d756d6e Give 1GB by default 2023-11-22 12:59:40 +01:00
Girish Ramakrishnan
cb59b8bda8 Version 2.13.0 2023-10-23 16:52:59 +02:00
Girish Ramakrishnan
ab618d6ccc Update test packages 2023-10-23 10:37:51 +02:00
Girish Ramakrishnan
0482d70e78 Update base image to 4.2.0 2023-10-22 19:51:48 +02:00
Johannes Zellner
22c3e9d18c Update test deps 2023-08-30 22:16:27 +02:00
Johannes Zellner
7f600cbce1 Bump version 2023-08-30 22:16:16 +02:00
Girish Ramakrishnan
4c0d48aedd Version 2.12.0-1 2023-07-11 10:00:39 +05:30
Girish Ramakrishnan
902a3c34b3 set maxmemory-policy to noeviction to prevent warnings 2023-07-11 09:34:11 +05:30
Girish Ramakrishnan
73730f82fe Fix issue where initial credentials are not working 2023-07-11 09:25:21 +05:30
Johannes Zellner
c91051c145 Better tab closing instructions 2023-06-22 21:09:28 +02:00
Johannes Zellner
bf5ec0eae5 Fixup tests 2023-06-21 18:03:32 +02:00
Johannes Zellner
2e661e50f8 New node needs new npm folder 2023-06-21 17:07:26 +02:00
Johannes Zellner
7438ee6b80 Bump version and update nodejs 2023-06-21 16:15:56 +02:00
Girish Ramakrishnan
953ab55b2e Need redis 6 2023-03-21 11:59:41 +01:00
Girish Ramakrishnan
1812ea1aef Version 2.11.0 2023-03-21 11:58:52 +01:00
Girish Ramakrishnan
f10e89d4ae Update test packages 2023-03-21 11:55:28 +01:00
Girish Ramakrishnan
adbceef3b0 Update PeerTube to 5.1.0 2023-03-21 11:10:57 +01:00
13 changed files with 1341 additions and 401 deletions

View file

@ -247,3 +247,123 @@
[2.10.2]
* Remove invokation of 5.0 upgade script
[2.11.0]
* Update PeerTube to 5.1.0
* [Full changelog](https://github.com/Chocobozzz/PeerTube/releases/tag/v5.1.0)
* **IMPORTANT**: If your instance has signup enabled, user registration approval is automatically enabled by the default configuration of this release. You can change this setting in your production.yaml or in the configuration page in the web admin
Update web browsers support list:
* Drop support of Safari 11 on iOS
* Drop support of Safari 11 on desktop
* Drop support of Firefox 68 on desktop
* Implement user registration approval (https://docs.joinpeertube.org/admin/managing-users#registration-approval) #5544
* Add "back to live" button in player
* Add Icelandic & Ukrainian locales
* Add Global views default trending algorithm option in admin configuration #5471
[2.12.0]
* Update PeerTube to 5.2.0
* [Full changelog](https://github.com/Chocobozzz/PeerTube/releases/tag/v5.2.0)
* Implement remote transcoding for VOD videos, Live streams and Studio editions tada #5769
* If enabled, remote PeerTube runners can process these high CPU jobs
* Admin documentation: https://docs.joinpeertube.org/admin/remote-runners
* PeerTube runner CLI documentation: https://docs.joinpeertube.org/maintain/tools#peertube-runner
* Demonstration video: https://peertube2.cpy.re/w/oJwHHYwt4oKjKhLNh2diAY
* Architecture documentation: https://docs.joinpeertube.org/contribute/architecture#remote-vod-live-transcoding
* Add Podcast RSS feed support: #5487
* Add ability to set custom privacy for live replays #5692
* Render images of markdown fields in About page #5732
* Admin can disable user video history by default #5728
* Improve global accessibility
[2.12.1]
* Update PeerTube to 5.2.1
* [Full changelog](https://github.com/Chocobozzz/PeerTube/releases/tag/v5.2.1)
* Fix loading spinner displayed forever on Chrome
* Fix broken replay with long live name
* Fix fps transcoding on remote runners
* Fix terms/code of conduct link toggle
[2.13.0]
* Update base image to 4.2.0
[2.14.0]
* Update PeerTube to 6.0.2
* [Full changelog](https://github.com/Chocobozzz/PeerTube/releases/tag/v6.0.2)
* [Important breaking changes in 6.0](https://github.com/Chocobozzz/PeerTube/blob/develop/CHANGELOG.md#v600). Some keys in `production.yaml` have been renamed (for example, object storage keys).
[2.15.0]
* Migrate to OIDC login
[2.15.1]
* Update PeerTube to 6.0.3
* [Full changelog](https://github.com/Chocobozzz/PeerTube/releases/tag/v6.0.3)
* Fix HTML meta tags with attributes that contain quotes
* Fix time parsing resulting in broken video start time in some cases
* Fix WebTorrent video import crash
* Reload Discover page on logout
* Fix privacy error when updating a live, even if the privacy has not changed
* Fix invalid remote live state change notification that causes the player to reload
* Don't apply big play button skin to settings menu
* Fix downloading video files from object storage with some video names (that include emojis, quotes etc)
[2.15.2]
* Update PeerTube to 6.0.4
* [Full changelog](https://github.com/Chocobozzz/PeerTube/releases/tag/v6.0.4)
* Important: Prevent XSS injection in embed. Thanks Syst3m0ver!
[2.16.0]
* Update PeerTube to 6.1.0
* [Full changelog](https://github.com/Chocobozzz/PeerTube/releases/tag/v6.1.0)
* Compact ActivityPub JSON-LD objects before using them to prevent incorrect access control @tesaguri
* Protect ActivityPub information related to private/internal/blocked videos
[2.17.0]
* Update PeerTube to 6.2.0
* [Full changelog](https://github.com/Chocobozzz/PeerTube/releases/tag/v6.2.0)
[2.17.1]
* Update PeerTube to 6.2.1
* [Full changelog](https://github.com/Chocobozzz/PeerTube/releases/tag/v6.2.1)
* Fix stuck runner jobs due to DB concurrency issue
* Respect OS orientation settings in PWA
* Fix "No results" not displayed on no video results
* Do not display "Download" option on lives
* Fix invalid current password error when updating user password
* Fix slow hotkeys detection
* Fix hidden runner jobs tab when remote runner is only enabled for transcription
* Fix broken HLS P2P by correctly updating HLS infohash on privacy update
* Fix videos filters pastille labels for categories and languages
[3.0.0]
* After the update to refresh metadata: run the `migrate` command in a webterminal into the app.
* Update PeerTube to 6.3.0
* [Full changelog](https://github.com/Chocobozzz/PeerTube/releases/tag/v6.3.0)
[3.0.1]
* Update PeerTube to 6.3.1
* [Full changelog](https://github.com/Chocobozzz/PeerTube/releases/tag/v6.3.1)
* Fix player settings button on mobile
* Fix removed audio when splitting audio and video streams on existing videos when running HLS transcoding
[3.0.2]
* Update PeerTube to 6.3.2
* [Full changelog](https://github.com/Chocobozzz/PeerTube/releases/tag/v6.3.2)
* Fix 403 error when downloading private/internal video
* Don't crash video federation and live replay generation on missing thumbnail/preview
* Fix advanced search input with multiple automatic search tokens
* Fix player "Copy URL" when the video is fullscreen
* Fix account videos search
* Add missing max transcoding fps config in admin
* Don't add mobile buttons if the player controls are disabled
[3.0.3]
* Update PeerTube to 6.3.3
* [Full changelog](https://github.com/Chocobozzz/PeerTube/releases/tag/v6.3.3)
* Fix broken thumbnails on live replay
* Fix detecting portrait rotation of some video
* Don't allow to select a frame from a live to set the thumbnail
* Fix lost video stream with specific transcoding settings and video input
* Fix creating playlist without thumbnail when using the REST API
* Fix .mov video upload on some Windows versions
* Fix video-plugin-metadata.result client plugin hook

View file

@ -1,6 +1,6 @@
{
"version": "2.10.2",
"upstreamVersion": "5.0.1",
"version": "3.0.3",
"upstreamVersion": "6.3.3",
"id": "org.joinpeertube.cloudronapp",
"title": "PeerTube",
"author": "PeerTube developers",
@ -10,7 +10,7 @@
"tagline": "Take back control of your videos",
"icon": "file://logo.png",
"healthCheckPath": "/",
"httpPort": 9000,
"httpPort": 80,
"tcpPorts": {
"RTMP_PORT": {
"title": "RTMP Port",
@ -23,13 +23,25 @@
"localstorage": {},
"postgresql": {},
"redis": {},
"sendmail": { "supportsDisplayName": false },
"ldap": {}
"sendmail": {
"supportsDisplayName": false
},
"oidc": {
"loginRedirectUri": "/plugins/auth-openid-connect/router/code-cb"
}
},
"memoryLimit": 536870912,
"memoryLimit": 1073741824,
"forumUrl": "https://forum.cloudron.io/category/91/peertube",
"optionalSso": true,
"tags": [ "video", "youtube", "vimeo", "blog", "instagram", "media", "federated" ],
"tags": [
"video",
"youtube",
"vimeo",
"blog",
"instagram",
"media",
"federated"
],
"mediaLinks": [
"https://screenshots.cloudron.io/org.joinpeertube.cloudronapp/peertube-screenshot.jpg",
"https://screenshots.cloudron.io/org.joinpeertube.cloudronapp/home.png",
@ -38,7 +50,6 @@
"changelog": "file://CHANGELOG.md",
"postInstallMessage": "file://POSTINSTALL.md",
"documentationUrl": "https://docs.cloudron.io/apps/peertube/",
"minBoxVersion": "7.2.0",
"minBoxVersion": "7.4.0",
"manifestVersion": 2
}

View file

@ -1,27 +1,22 @@
FROM cloudron/base:4.0.0@sha256:31b195ed0662bdb06a6e8a5ddbedb6f191ce92e8bee04c03fb02dd4e9d0286df
FROM cloudron/base:4.2.0@sha256:46da2fffb36353ef714f97ae8e962bd2c212ca091108d768ba473078319a47f4
RUN mkdir -p /app/code/server /app/pkg
WORKDIR /app/code/server
# https://github.com/Chocobozzz/PeerTube/blob/develop/support/doc/dependencies.md
ARG NODEJS_VERSION=16.13.2
RUN mkdir -p /usr/local/node-${NODEJS_VERSION} && \
curl -L https://nodejs.org/dist/v${NODEJS_VERSION}/node-v${NODEJS_VERSION}-linux-x64.tar.gz | tar zxf - --strip-components 1 -C /usr/local/node-${NODEJS_VERSION}
ENV PATH /usr/local/node-${NODEJS_VERSION}/bin:$PATH
RUN apt update && apt install -y prosody && rm -rf /var/cache/apt /var/lib/apt/lists
ARG VERSION=5.0.1
ARG NODE_VERSION=20.15.1
RUN mkdir -p /usr/local/node-${NODE_VERSION} && curl -L https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64.tar.gz | tar zxf - --strip-components 1 -C /usr/local/node-${NODE_VERSION}
ENV PATH /usr/local/node-${NODE_VERSION}/bin:$PATH
# renovate: datasource=github-releases depName=Chocobozzz/PeerTube versioning=semver extractVersion=^v(?<version>.+)$
ARG PEERTUBE_VERSION=6.3.3
# install peertube. the chown is required for some reason for ffmpeg. it fails with EROFS without it when transcoding
RUN curl -sL https://github.com/Chocobozzz/PeerTube/releases/download/v${VERSION}/peertube-v${VERSION}.tar.xz | tar --strip-components 1 -Jxvf - && \
RUN curl -sL https://github.com/Chocobozzz/PeerTube/releases/download/v${PEERTUBE_VERSION}/peertube-v${PEERTUBE_VERSION}.tar.xz | tar --strip-components 1 -Jxvf - && \
yarn install --production --pure-lockfile
RUN mkdir /app/code/cli && \
curl -L https://github.com/Chocobozzz/PeerTube/archive/v${VERSION}.tar.gz | tar -zxvf - --strip-components=1 -C /app/code/cli && \
cd /app/code/cli && \
NOCLIENT=1 yarn install --pure-lockfile && \
npm run setup:cli
RUN npm install -g @peertube/peertube-cli
# the json is created and managed by web ui. it overrides the yaml file (https://github.com/lorenwest/node-config/wiki/Configuration-Files)
RUN ln -sf /app/data/production.yaml /app/code/server/config/production.yaml && \
@ -31,7 +26,8 @@ RUN ln -sf /app/data/production.yaml /app/code/server/config/production.yaml &&
RUN curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl && chmod +x /usr/local/bin/youtube-dl
# required when installing plugins/themes that use node-gyp
RUN rm -rf /home/cloudron/.cache && ln -s /run/peertube/cache /home/cloudron/.cache
RUN rm -rf /home/cloudron/.cache && ln -s /run/peertube/cache /home/cloudron/.cache && \
rm -rf /home/cloudron/.npm && ln -s /run/peertube/npm /home/cloudron/.npm
COPY production.yaml.example start.sh /app/pkg/
@ -40,5 +36,20 @@ ENV NODE_CONFIG_DIR /app/code/server/config
RUN printf '#!/bin/bash\n\ncd /app/code/cli && node dist/server/tools/peertube.js $@\n' > /usr/bin/peertube && chmod +x /usr/bin/peertube
# remove with next releases
RUN printf '#!/bin/bash\n\ncd /app/code/server && NODE_ENV=production node dist/scripts/migrations/peertube-6.3.js $@\n' > /usr/bin/migrate && chmod +x /usr/bin/migrate
# add nginx config
RUN rm /etc/nginx/sites-enabled/*
RUN ln -sf /dev/stdout /var/log/nginx/access.log
RUN ln -sf /dev/stderr /var/log/nginx/error.log
RUN ln -sf /run/peertube-nginx.conf /etc/nginx/sites-enabled/peertube.conf
COPY nginx/readonlyrootfs.conf /etc/nginx/conf.d/readonlyrootfs.conf
COPY nginx/peertube.conf /app/pkg/peertube-nginx.conf
# supervisor
COPY supervisor/ /etc/supervisor/conf.d/
RUN sed -e 's,^logfile=.*$,logfile=/run/supervisord.log,' -i /etc/supervisor/supervisord.conf
CMD [ "/app/pkg/start.sh" ]

217
nginx/peertube.conf Normal file
View file

@ -0,0 +1,217 @@
upstream backend {
server 127.0.0.1:9000;
}
server {
listen 80;
server_name default_server;
##
# Application
##
location @api {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
client_max_body_size 100k; # default is 1M
proxy_connect_timeout 10m;
proxy_send_timeout 10m;
proxy_read_timeout 10m;
send_timeout 10m;
proxy_pass http://backend;
}
location / {
try_files /dev/null @api;
}
location ~ ^/api/v1/videos/(upload-resumable|([^/]+/source/replace-resumable))$ {
client_max_body_size 0;
proxy_request_buffering off;
try_files /dev/null @api;
}
location ~ ^/api/v1/users/[^/]+/imports/import-resumable$ {
client_max_body_size 0;
proxy_request_buffering off;
try_files /dev/null @api;
}
location ~ ^/api/v1/videos/(upload|([^/]+/studio/edit))$ {
limit_except POST HEAD { deny all; }
# This is the maximum upload size, which roughly matches the maximum size of a video file.
# Note that temporary space is needed equal to the total size of all concurrent uploads.
# This data gets stored in /var/lib/nginx by default, so you may want to put this directory
# on a dedicated filesystem.
client_max_body_size 12G; # default is 1M
add_header X-File-Maximum-Size 8G always; # inform backend of the set value in bytes before mime-encoding (x * 1.4 >= client_max_body_size)
try_files /dev/null @api;
}
location ~ ^/api/v1/runners/jobs/[^/]+/(update|success)$ {
client_max_body_size 12G; # default is 1M
add_header X-File-Maximum-Size 8G always; # inform backend of the set value in bytes before mime-encoding (x * 1.4 >= client_max_body_size)
try_files /dev/null @api;
}
location ~ ^/api/v1/(videos|video-playlists|video-channels|users/me) {
client_max_body_size 6M; # default is 1M
add_header X-File-Maximum-Size 4M always; # inform backend of the set value in bytes before mime-encoding (x * 1.4 >= client_max_body_size)
try_files /dev/null @api;
}
##
# Websocket
##
location @api_websocket {
proxy_http_version 1.1;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass http://backend;
}
location /socket.io {
try_files /dev/null @api_websocket;
}
location /tracker/socket {
# Peers send a message to the tracker every 15 minutes
# Don't close the websocket before then
proxy_read_timeout 15m; # default is 60s
try_files /dev/null @api_websocket;
}
# Plugin websocket routes
location ~ ^/plugins/[^/]+(/[^/]+)?/ws/ {
try_files /dev/null @api_websocket;
}
##
# Performance optimizations
# For extra performance please refer to https://github.com/denji/nginx-tuning
##
# root /var/www/peertube/storage;
root /app/data/storage;
# Enable compression for JS/CSS/HTML, for improved client load times.
# It might be nice to compress JSON/XML as returned by the API, but
# leaving that out to protect against potential BREACH attack.
gzip on;
gzip_vary on;
gzip_types # text/html is always compressed by HttpGzipModule
text/css
application/javascript
font/truetype
font/opentype
application/vnd.ms-fontobject
image/svg+xml;
gzip_min_length 1000; # default is 20 bytes
gzip_buffers 16 8k;
gzip_comp_level 2; # default is 1
client_body_timeout 30s; # default is 60
client_header_timeout 10s; # default is 60
send_timeout 10s; # default is 60
keepalive_timeout 10s; # default is 75
resolver_timeout 10s; # default is 30
reset_timedout_connection on;
proxy_ignore_client_abort on;
tcp_nopush on; # send headers in one piece
tcp_nodelay on; # don't buffer data sent, good for small data bursts in real time
# If you have a small /var/lib partition, it could be interesting to store temp nginx uploads in a different place
# See https://nginx.org/en/docs/http/ngx_http_core_module.html#client_body_temp_path
#client_body_temp_path /var/www/peertube/storage/nginx/;
# Bypass PeerTube for performance reasons. Optional.
# Should be consistent with client-overrides assets list in client.ts server controller
location ~ ^/client/(assets/images/(icons/icon-36x36\.png|icons/icon-48x48\.png|icons/icon-72x72\.png|icons/icon-96x96\.png|icons/icon-144x144\.png|icons/icon-192x192\.png|icons/icon-512x512\.png|logo\.svg|favicon\.png|default-playlist\.jpg|default-avatar-account\.png|default-avatar-account-48x48\.png|default-avatar-video-channel\.png|default-avatar-video-channel-48x48\.png))$ {
add_header Cache-Control "public, max-age=31536000, immutable"; # Cache 1 year
root /app/code/server;
# try_files /storage/client-overrides/$1 /peertube-latest/client/dist/$1 @api;
try_files /app/data/storage/client-overrides/$1 /app/code/server/client/dist/$1 @api;
}
# Bypass PeerTube for performance reasons. Optional.
location ~ ^/client/(.*\.(js|css|png|svg|woff2|otf|ttf|woff|eot))$ {
add_header Cache-Control "public, max-age=31536000, immutable"; # Cache 1 year
# alias /var/www/peertube/peertube-latest/client/dist/$1;
alias /app/code/server/client/dist/$1;
}
location ~ ^(/static/(webseed|web-videos|streaming-playlists/hls)/private/)|^/download {
# We can't rate limit a try_files directive, so we need to duplicate @api
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_limit_rate 5M;
proxy_pass http://backend;
}
# Bypass PeerTube for performance reasons. Optional.
location ~ ^/static/(webseed|web-videos|redundancy|streaming-playlists)/ {
limit_rate_after 5M;
set $peertube_limit_rate 5M;
# Use this line with nginx >= 1.17.0
limit_rate $peertube_limit_rate;
# Or this line with nginx < 1.17.0
# set $limit_rate $peertube_limit_rate;
if ($request_method = 'OPTIONS') {
add_header Access-Control-Allow-Origin '*';
add_header Access-Control-Allow-Methods 'GET, OPTIONS';
add_header Access-Control-Allow-Headers 'Range,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
add_header Access-Control-Max-Age 1728000; # Preflight request can be cached 20 days
add_header Content-Type 'text/plain charset=UTF-8';
add_header Content-Length 0;
return 204;
}
if ($request_method = 'GET') {
add_header Access-Control-Allow-Origin '*';
add_header Access-Control-Allow-Methods 'GET, OPTIONS';
add_header Access-Control-Allow-Headers 'Range,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
# Don't spam access log file with byte range requests
access_log off;
}
# Enabling the sendfile directive eliminates the step of copying the data into the buffer
# and enables direct copying data from one file descriptor to another.
sendfile on;
sendfile_max_chunk 1M; # prevent one fast connection from entirely occupying the worker process. should be > 800k.
aio threads;
# web-videos is the name of the directory mapped to the `storage.web_videos` key in your PeerTube configuration
rewrite ^/static/webseed/(.*)$ /web-videos/$1 break;
rewrite ^/static/(.*)$ /$1 break;
try_files $uri @api;
}
}

View file

@ -0,0 +1,7 @@
# this is already in a http block
client_body_temp_path /run/nginx;
proxy_temp_path /run/nginx;
fastcgi_temp_path /run/nginx;
uwsgi_temp_path /run/nginx;
scgi_temp_path /run/nginx;

View file

@ -76,12 +76,13 @@ email:
storage:
tmp: '/app/data/storage/tmp/' # Use to download data (imports etc), store uploaded files before processing...
avatars: '/app/data/storage/avatars/'
videos: '/app/data/storage/videos/'
web_videos: '/app/data/storage/web-videos/'
streaming_playlists: '/app/data/storage/streaming-playlists/'
redundancy: '/app/data/storage/redundancy/'
logs: '/app/data/storage/logs/'
previews: '/app/data/storage/previews/'
thumbnails: '/app/data/storage/thumbnails/'
storyboards: '/app/data/storage/storyboards/'
torrents: '/app/data/storage/torrents/'
captions: '/app/data/storage/captions/'
cache: '/app/data/storage/cache/'
@ -240,7 +241,7 @@ transcoding:
# Generate videos in a WebTorrent format (what we do since the first PeerTube release)
# If you also enabled the hls format, it will multiply videos storage by 2
# If disabled, breaks federation with PeerTube instances < 2.1
webtorrent:
web_videos:
enabled: true
# /!\ Requires ffmpeg >= 4.1

4
renovate.json5 Normal file
View file

@ -0,0 +1,4 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["local>devops/renovator//default.renovate.json5"]
}

View file

@ -2,21 +2,48 @@
set -eu
mkdir -p /app/data/storage /run/peertube/cache
mkdir -p /app/data/storage /run/peertube/cache /run/peertube/npm /tmp/peertube
# do not rely on WORKDIR
cd /app/code/server
update_ldap() {
echo "==> Updating Ldap credentials"
migrate_ldap_to_oidc() {
USERS_TO_MIGRATE=$(PGPASSWORD=${CLOUDRON_POSTGRESQL_PASSWORD} psql -h ${CLOUDRON_POSTGRESQL_HOST} -p ${CLOUDRON_POSTGRESQL_PORT} -U ${CLOUDRON_POSTGRESQL_USERNAME} -d ${CLOUDRON_POSTGRESQL_DATABASE} -AXqtc "SELECT count(*) FROM \"user\" u WHERE \"pluginAuth\"='peertube-plugin-auth-ldap'")
echo "==> Migrating users to OIDC";
echo " Users to migrate: ${USERS_TO_MIGRATE}"
if [ ${USERS_TO_MIGRATE} -gt 0 ]; then
PGPASSWORD=${CLOUDRON_POSTGRESQL_PASSWORD} psql -h ${CLOUDRON_POSTGRESQL_HOST} -p ${CLOUDRON_POSTGRESQL_PORT} -U ${CLOUDRON_POSTGRESQL_USERNAME} -d ${CLOUDRON_POSTGRESQL_DATABASE} -c "UPDATE \"user\" SET \"pluginAuth\"='peertube-plugin-auth-openid-connect' WHERE \"pluginAuth\"='peertube-plugin-auth-ldap'"
fi
LDAP_PLUGIN_INSTALLED=$(PGPASSWORD=${CLOUDRON_POSTGRESQL_PASSWORD} psql -h ${CLOUDRON_POSTGRESQL_HOST} -p ${CLOUDRON_POSTGRESQL_PORT} -U ${CLOUDRON_POSTGRESQL_USERNAME} -d ${CLOUDRON_POSTGRESQL_DATABASE} -AXqtc "SELECT count(*) FROM \"plugin\" WHERE name='auth-ldap'")
if [ ${LDAP_PLUGIN_INSTALLED} -gt 0 ]; then
echo "==> Uninstalling LDAP plugin"
gosu cloudron:cloudron npm run plugin:uninstall -- -n peertube-plugin-auth-ldap
echo "==> Deleting LDAP settings"
PGPASSWORD=${CLOUDRON_POSTGRESQL_PASSWORD} psql -h ${CLOUDRON_POSTGRESQL_HOST} -p ${CLOUDRON_POSTGRESQL_PORT} -U ${CLOUDRON_POSTGRESQL_USERNAME} -d ${CLOUDRON_POSTGRESQL_DATABASE} -c "DELETE FROM \"plugin\" WHERE name='auth-ldap'"
fi
}
install_oidc() {
# https://docs.joinpeertube.org/maintain-tools?id=cli-wrapper . Note that we have to restart peertube when installed this way
if [[ -n "${CLOUDRON_OIDC_ISSUER:-}" ]]; then
echo "==> Installing OIDC plugin"
gosu cloudron:cloudron npm run plugin:install -- -n peertube-plugin-auth-openid-connect -v 0.1.1
update_oidc
fi
}
update_oidc() {
echo "==> Updating OIDC config"
PGPASSWORD=${CLOUDRON_POSTGRESQL_PASSWORD} psql -h ${CLOUDRON_POSTGRESQL_HOST} -p ${CLOUDRON_POSTGRESQL_PORT} -U ${CLOUDRON_POSTGRESQL_USERNAME} -d ${CLOUDRON_POSTGRESQL_DATABASE} \
-c "UPDATE plugin SET settings='{\"url\": \"${CLOUDRON_LDAP_URL}\", \"weight\": 100, \"insecure-tls\": false, \"bind-dn\": \"${CLOUDRON_LDAP_BIND_DN}\", \"bind-credentials\": \"${CLOUDRON_LDAP_BIND_PASSWORD}\", \"search-base\": \"${CLOUDRON_LDAP_USERS_BASE_DN}\", \"mail-property\": \"mail\", \"search-filter\": \"(|(mail={{username}})(username={{username}}))\", \"username-property\": \"username\"}' WHERE name='auth-ldap'"
-c "UPDATE plugin SET settings='{\"scope\": \"openid email profile\", \"client-id\": \"${CLOUDRON_OIDC_CLIENT_ID}\", \"discover-url\": \"${CLOUDRON_OIDC_DISCOVERY_URL}\", \"client-secret\": \"${CLOUDRON_OIDC_CLIENT_SECRET}\", \"mail-property\": \"email\", \"auth-display-name\": \"Cloudron\", \"username-property\": \"preferred_username\", \"signature-algorithm\": \"RS256\", \"display-name-property\": \"name\"}' WHERE name='auth-openid-connect'"
}
first_time_setup() {
echo "==> Starting peertube to run migrations on first run"
npm start & # be wary of https://stackoverflow.com/questions/70738567/why-does-running-npm-run-script-as-root-switch-user
gosu cloudron:cloudron npm start & # be wary of https://stackoverflow.com/questions/70738567/why-does-running-npm-run-script-as-root-switch-user
sleep 10
while ! curl --silent --output /dev/null --fail http://localhost:9000/; do
@ -28,14 +55,12 @@ first_time_setup() {
sleep 5
echo "==> Reset root password"
echo "changeme" | npm run reset-password -- -u root
echo "changeme" | gosu cloudron:cloudron npm run reset-password -- -u root
sleep 5 # the above command seems to spawn a separate process to change password in background
# https://docs.joinpeertube.org/maintain-tools?id=cli-wrapper . Note that we have to restart peertube when installed this way
if [[ -n "${CLOUDRON_LDAP_SERVER:-}" ]]; then
echo "==> Installing LDAP plugin"
npm run plugin:install -- -n peertube-plugin-auth-ldap -v 0.0.10
update_ldap
fi
install_oidc
echo "==> First time setup complete"
}
update_config() {
@ -73,8 +98,33 @@ update_config() {
# ensure settings which were later added
yq eval ".storage.bin = \"/app/data/storage/bin/\"" -i /app/data/production.yaml
yq eval ".storage.well_known = \"/app/data/storage/well_known/\"" -i /app/data/production.yaml
yq eval ".storage.tmp_persistent = \"/app/data/storage/tmp_persistent/\"" -i /app/data/production.yaml
# changes for 6.0.0
yq eval ".storage.storyboards = \"/app/data/storage/storyboards/\"" -i /app/data/production.yaml
if [[ -d "/app/data/storage/videos" ]]; then
echo "==> Migrate videos/ to videos-web/"
mv /app/data/storage/videos /app/data/storage/web-videos
fi
yq eval ".storage.web_videos = \"/app/data/storage/web-videos/\"" -i /app/data/production.yaml
yq eval "del(.storage.videos)" -i /app/data/production.yaml
yq eval "del(.transcoding.webtorrent)" -i /app/data/production.yaml
yq eval ".transcoding.web_videos.enabled = true" -i /app/data/production.yaml
# changes for 6.1.0
yq eval ".storage.original_video_files = \"/app/data/storage/original_video_files/\"" -i /app/data/production.yaml
}
echo "==> Changing ownership"
chown -R cloudron:cloudron /app/data /run/peertube /tmp/peertube
# Set eviction policy to prevent warnings - https://docs.bullmq.io/guide/going-to-production#max-memory-policy
while ! REDISCLI_AUTH="${CLOUDRON_REDIS_PASSWORD}" redis-cli -h "${CLOUDRON_REDIS_HOST}" -p "${CLOUDRON_REDIS_PORT}" ping >/dev/null; do
echo "==> Waiting for redis"
sleep 5
done
REDISCLI_AUTH="${CLOUDRON_REDIS_PASSWORD}" redis-cli -h "${CLOUDRON_REDIS_HOST}" -p "${CLOUDRON_REDIS_PORT}" CONFIG SET maxmemory-policy noeviction
# cd /var/www/peertube/peertube-latest/scripts && sudo -H -u peertube ./upgrade.sh
if [[ ! -f "/app/data/production.yaml" ]]; then
echo "==> First run. creating config"
@ -84,11 +134,16 @@ if [[ ! -f "/app/data/production.yaml" ]]; then
first_time_setup
else
update_config
[[ -n "${CLOUDRON_LDAP_SERVER:-}" ]] && update_ldap
if [[ -n "${CLOUDRON_OIDC_ISSUER:-}" ]]; then
install_oidc
migrate_ldap_to_oidc
update_oidc
fi
fi
chown -R cloudron:cloudron /app/data /run/peertube
echo "==> Configuring nginx"
cp /app/pkg/peertube-nginx.conf /run/peertube-nginx.conf
echo "==> Starting PeerTube"
exec gosu cloudron:cloudron npm start
#exec gosu cloudron:cloudron npm start
exec /usr/bin/supervisord --configuration /etc/supervisor/supervisord.conf --nodaemon -i PeerTube

11
supervisor/nginx.conf Normal file
View file

@ -0,0 +1,11 @@
[program:nginx]
priority=100
directory=/tmp
command=/usr/sbin/nginx -g "daemon off;"
user=root
autostart=true
autorestart=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0

11
supervisor/peertube.conf Normal file
View file

@ -0,0 +1,11 @@
[program:peertube]
directory=/app/code/server
user=cloudron
environment=HOME="/home/cloudron",USER="cloudron"
command=npm start
autostart=true
autorestart=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0

1090
test/package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -10,10 +10,11 @@
"license": "ISC",
"devDependencies": {
"expect.js": "^0.3.1",
"mocha": "^10.2.0"
"mocha": "^10.7.3"
},
"dependencies": {
"chromedriver": "^110.0.0",
"selenium-webdriver": "^4.8.1"
"chromedriver": "^129.0.2",
"safetydance": "^2.4.0",
"selenium-webdriver": "^4.25.0"
}
}

View file

@ -1,9 +1,9 @@
#!/usr/bin/env node
/* jshint esversion: 8 */
/* global describe */
/* global before */
/* global after */
/* global afterEach */
/* global it */
'use strict';
@ -12,7 +12,9 @@ require('chromedriver');
const execSync = require('child_process').execSync,
expect = require('expect.js'),
fs = require('fs'),
path = require('path'),
safe = require('safetydance'),
util = require('util'),
{ Builder, By, Key, until } = require('selenium-webdriver'),
{ Options } = require('selenium-webdriver/chrome');
@ -25,30 +27,62 @@ if (!process.env.USERNAME || !process.env.PASSWORD || !process.env.EMAIL) {
describe('Application life cycle test', function () {
this.timeout(0);
const LOCATION = 'test';
const LOCATION = process.env.LOCATION || 'test';
const TEST_TIMEOUT = parseInt(process.env.TEST_TIMEOUT, 10) || 30000;
const EXEC_ARGS = { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' };
var browser;
var app;
var username = process.env.USERNAME;
var password = process.env.PASSWORD;
var email = process.env.EMAIL;
let browser;
let app;
let host_os;
let username = process.env.USERNAME;
let password = process.env.PASSWORD;
let email = process.env.EMAIL;
let athenticated_by_oidc = false;
before(function () {
browser = new Builder().forBrowser('chrome').setChromeOptions(new Options().windowSize({ width: 1280, height: 1024 })).build();
const chromeOptions = new Options().windowSize({ width: 1280, height: 1024 });
if (process.env.CI) chromeOptions.addArguments('no-sandbox', 'disable-dev-shm-usage', 'headless');
browser = new Builder().forBrowser('chrome').setChromeOptions(chromeOptions).build();
if (!fs.existsSync('./screenshots')) fs.mkdirSync('./screenshots');
});
after(function () {
browser.quit();
});
afterEach(async function () {
if (!process.env.CI || !app) return;
const currentUrl = await browser.getCurrentUrl();
if (!currentUrl.includes(app.domain)) return;
expect(this.currentTest.title).to.be.a('string');
const screenshotData = await browser.takeScreenshot();
fs.writeFileSync(`./screenshots/${new Date().getTime()}-${this.currentTest.title.replaceAll(' ', '_')}.png`, screenshotData, 'base64');
});
async function clearCache() {
await browser.manage().deleteAllCookies();
await browser.quit();
browser = null;
const chromeOptions = new Options().windowSize({ width: 1280, height: 1024 });
if (process.env.CI) chromeOptions.addArguments('no-sandbox', 'disable-dev-shm-usage', 'headless');
chromeOptions.addArguments(`--user-data-dir=${await fs.promises.mkdtemp('/tmp/test-')}`); // --profile-directory=Default
browser = new Builder().forBrowser('chrome').setChromeOptions(chromeOptions).build();
}
function getAppInfo() {
var inspect = JSON.parse(execSync('cloudron inspect'));
let inspect = JSON.parse(execSync('cloudron inspect'));
app = inspect.apps.filter(function (a) { return a.location.indexOf(LOCATION) === 0; })[0];
expect(app).to.be.an('object');
}
async function getOS() {
if (typeof(host_os) == 'undefined' || host_os == null)
host_os = String(await execSync('uname -s')).trim();
return host_os;
}
async function waitForElement(elem) {
await browser.wait(until.elementLocated(elem), TEST_TIMEOUT);
await browser.wait(until.elementIsVisible(browser.findElement(elem)), TEST_TIMEOUT);
@ -68,9 +102,31 @@ describe('Application life cycle test', function () {
await waitForElement(By.xpath('//a[contains(@href, "/my-library")]'));
}
async function loginOIDC(username, password) {
browser.manage().deleteAllCookies();
await browser.get(`https://${app.fqdn}/login`);
await browser.sleep(2000);
await browser.wait(until.elementLocated(By.xpath('//a[contains(., "Cloudron")]')), TEST_TIMEOUT);
await browser.findElement(By.xpath('//a[contains(., "Cloudron")]')).click();
await browser.sleep(2000);
if (!athenticated_by_oidc) {
await waitForElement(By.id('inputUsername'));
await browser.findElement(By.id('inputUsername')).sendKeys(username);
await browser.findElement(By.id('inputPassword')).sendKeys(password);
await browser.findElement(By.id('loginSubmitButton')).click();
athenticated_by_oidc = true;
}
await browser.sleep(20000);
await waitForElement(By.xpath('//a[contains(@href, "/my-library")]'));
}
async function closeAccountSetupDialog() {
await browser.get('https://' + app.fqdn);
await waitForElement(By.xpath('//span[contains(text(), "show me this anymore")]'));
await browser.findElement(By.xpath('//span[contains(text(), "show me this anymore")]')).click();
await browser.findElement(By.xpath('//a[contains(text(), "Set up")]')).click();
await browser.sleep(3000);
@ -82,25 +138,30 @@ describe('Application life cycle test', function () {
await browser.sleep(2000);
await browser.findElement(By.xpath('//div[@class="logged-in-display-name"]')).click();
await browser.sleep(2000);
await browser.findElement(By.xpath('//a[contains(text(), "Log out")]')).click();
await browser.findElement(By.xpath('//button[contains(text(), "Log out")]')).click();
await browser.sleep(2000);
}
async function completeSetup() {
var button;
let button;
await browser.get(`https://${app.fqdn}`);
await waitForElement(By.xpath('//a[contains(text(), "Configure my instance")]'));
await browser.sleep(2000);
const [error] = await safe(waitForElement(By.xpath('//a[contains(text(), "Configure my instance")]')));
if (error) return; // sometimes it doesn't appear, maybe it's cached in local storage
await browser.findElement(By.xpath('//a[contains(text(), "Configure my instance")]')).click(); // this opens a new window
console.log('Close the newly opened tab. Will wait for 60 seconds');
await browser.sleep(60000);
await browser.sleep(2000);
await closeTab();
}
async function uploadVideo() {
browser.get('https://' + app.fqdn + '/videos/upload');
await browser.sleep(2000);
await browser.findElement(By.xpath('//input[@id="videofile" and @type="file"]')).sendKeys(path.resolve(__dirname, './Cloudron Test Video.mp4'));
await browser.get(`https://${app.fqdn}/videos/upload#upload`);
await browser.sleep(3000);
await browser.wait(until.elementLocated(By.id('videofile')), TEST_TIMEOUT); // do not do element visible check . it fails, no clue why
await browser.findElement(By.id('videofile')).sendKeys(path.resolve(__dirname, './Cloudron Test Video.mp4'));
console.log('waiting 10 seconds for upload');
await browser.sleep(10000); // wait for upload
await waitForElement(By.xpath('//div[@class="submit-container"]//span[text()="Publish"]'));
@ -116,6 +177,13 @@ describe('Application life cycle test', function () {
await waitForElement(By.xpath('//a[contains(@title, "Cloudron Test Video")]'));
}
async function closeTab() {
const handles = await browser.getAllWindowHandles();
await browser.switchTo().window(handles[1]);
await browser.close();
await browser.switchTo().window(handles[0]);
}
xit('build app', function () { execSync('cloudron build', EXEC_ARGS); });
it('install app', async function () {
execSync('cloudron install --location ' + LOCATION, EXEC_ARGS);
@ -129,7 +197,7 @@ describe('Application life cycle test', function () {
it('video exists', videoExists);
it('logout', logout);
it('can login', login.bind(null, username, password));
it('can OIDC login', loginOIDC.bind(null, username, password));
it('can close account setup dialog', closeAccountSetupDialog);
it('logout', logout);
@ -147,7 +215,7 @@ describe('Application life cycle test', function () {
it('video exists', videoExists);
it('logout', logout);
it('can login', login.bind(null, username, password));
it('can OIDC login', loginOIDC.bind(null, username, password));
it('logout', logout);
it('can restart app', function () {
@ -157,7 +225,7 @@ describe('Application life cycle test', function () {
it('video exists', videoExists);
it('logout', logout);
it('can login', login.bind(null, username, password));
it('can OIDC login', loginOIDC.bind(null, username, password));
it('logout', logout);
// this is not supported for federation
@ -168,7 +236,7 @@ describe('Application life cycle test', function () {
it('video exists', videoExists);
it('logout', logout);
it('can login', login.bind(null, username, password));
it('can OIDC login', loginOIDC.bind(null, username, password));
it('logout', logout);
it('uninstall app', async function () {
@ -210,7 +278,8 @@ describe('Application life cycle test', function () {
it('video exists', videoExists);
it('logout', logout);
it('can login', login.bind(null, username, password));
it('can OIDC login', loginOIDC.bind(null, username, password));
it('can close account setup dialog', closeAccountSetupDialog);
it('logout', logout);
it('uninstall app', async function () {