Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update invidious to version 2.20250314.0 #2467

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 17 additions & 18 deletions invidious/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: "3.7"

Check notice on line 1 in invidious/docker-compose.yml

View workflow job for this annotation

GitHub Actions / Lint apps

Potentially using unsafe user in service "sig_helper"

The default container user "root" can lead to security vulnerabilities. If you are using the root user, please try to specify a different user (e.g. "1000:1000") in the compose file or try to set the UID/PUID and GID/PGID environment variables to 1000.

services:
app_proxy:
Expand All @@ -7,28 +7,14 @@
APP_PORT: 3000

web:
image: ceramicwhite/invidious:build-9892604@sha256:b5a9f794d745fcbdbd4e83a9022552fc48ad91afac3dfdca5916c3ef21b43dd7
image: ceramicwhite/invidious:build-23ff613@sha256:cc751a8ba6e7c0fe075548bb790f4490594a49185f5ef929421efce83f215bae
restart: on-failure
stop_grace_period: 1m
user: "1000:1000"
# Using official images that include tini
#init: true
environment:
INVIDIOUS_CONFIG: |
db:
dbname: invidious
user: umbrel
password: moneyprintergobrrr
host: invidious_postgres_1
port: 5432
check_tables: true
external_port: 3420
captcha_enabled: false
admins: ["umbrel"]
default_user_preferences:
feed_menu: ["Trending", "Subscriptions", "Playlists"]
default_home: Trending
hmac_key: "${APP_SEED}"
env_file:
- ${APP_DATA_DIR}/inv.env
healthcheck:
disable: true
depends_on:
Expand All @@ -45,4 +31,17 @@
environment:
POSTGRES_DB: invidious
POSTGRES_USER: umbrel
POSTGRES_PASSWORD: moneyprintergobrrr
POSTGRES_PASSWORD: moneyprintergobrrr

sig_helper:
image: quay.io/invidious/inv-sig-helper:master-1c70bf6@sha256:1cfd80c42482f6524a3f7a11fdc0f623b761f8cd6686a4c027aaff05fb853fe5
restart: on-failure
init: true
command: ["--tcp", "0.0.0.0:12999"]
environment:
- RUST_LOG=info
cap_drop:
- ALL
read_only: true
security_opt:
- no-new-privileges:true
69 changes: 69 additions & 0 deletions invidious/hooks/pre-start
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#!/usr/bin/env bash
set -euo pipefail

APP_DIR="$(readlink -f "$(dirname "${BASH_SOURCE[0]}")/..")"
ENV_FILE="$APP_DIR/inv.env"

# Check if the file exists
if [ ! -f "$ENV_FILE" ]; then
echo "Error: Environment file not found at $ENV_FILE"
exit 1
fi

# Read the current content of the file
CURRENT_CONTENT=$(cat "$ENV_FILE")

# Check if we need to update the keys, matching the escaped quotes
# Note the \\\" pattern: one \ escapes the next \ for the shell,
# resulting in the pattern matcher seeing \* ... \" ... *\
if [[ "$CURRENT_CONTENT" == *"visitor_data: \\\"changeme\\\""* ]] || \
[[ "$CURRENT_CONTENT" == *"po_token: \\\"changeme\\\""* ]] || \
[[ "$CURRENT_CONTENT" == *"hmac_key: \\\"changeme\\\""* ]]; then

echo "Placeholder values detected. Generating new keys..."

# Generate HMAC key
HMAC_KEY=$(openssl rand -hex 32)
echo "Generated HMAC key: $HMAC_KEY"

# Run the docker command and capture its output
echo "Running docker to generate YouTube trusted session..."
# Handle potential errors from docker run
if ! KEYS_OUTPUT=$(docker run --rm quay.io/invidious/youtube-trusted-session-generator); then
echo "Error running docker command."
exit 1
fi

# Extract the visitor_data and po_token values using grep and cut
# Make patterns more robust in case of extra whitespace
VISITOR_DATA=$(echo "$KEYS_OUTPUT" | grep "visitor_data:" | cut -d' ' -f2)
PO_TOKEN=$(echo "$KEYS_OUTPUT" | grep "po_token:" | cut -d' ' -f2)

if [ -n "$VISITOR_DATA" ] && [ -n "$PO_TOKEN" ]; then
echo "Successfully extracted YouTube keys"
echo "VISITOR_DATA: $VISITOR_DATA"
echo "PO_TOKEN: $PO_TOKEN"

# Create a new variable with the updated content
# Use the corrected patterns with \\\" for matching
# Also ensure the replacement includes the necessary \\\"
NEW_CONTENT="${CURRENT_CONTENT}"
NEW_CONTENT="${NEW_CONTENT//visitor_data: \\\"changeme\\\"/visitor_data: \\\"$VISITOR_DATA\\\"}"
NEW_CONTENT="${NEW_CONTENT//po_token: \\\"changeme\\\"/po_token: \\\"$PO_TOKEN\\\"}"
NEW_CONTENT="${NEW_CONTENT//hmac_key: \\\"changeme\\\"/hmac_key: \\\"$HMAC_KEY\\\"}"

# Write the new content back to the file
# Use printf for potentially better handling of special characters than echo
printf "%s" "$NEW_CONTENT" > "$ENV_FILE"

echo "Successfully updated $ENV_FILE with new keys"
else
echo "Failed to extract keys from docker output:"
echo "$KEYS_OUTPUT" # Show the output for debugging
exit 1
fi
else
echo "Valid keys already seem to exist in $ENV_FILE based on content. No action needed."
fi

exit 0
1 change: 1 addition & 0 deletions invidious/inv.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
INVIDIOUS_CONFIG="db:\n dbname: invidious\n user: umbrel\n password: moneyprintergobrrr\n host: invidious_postgres_1\n port: 5432\ncheck_tables: true\nexternal_port: 3420\ncaptcha_enabled: false\nsignature_server: sig_helper:12999\nvisitor_data: \"changeme\"\npo_token: \"changeme\"\nadmins: [\"umbrel\"]\ndefault_user_preferences:\n feed_menu: [\"Trending\", \"Subscriptions\", \"Playlists\"]\n default_home: Trending\nhmac_key: \"changeme\"\n"
21 changes: 10 additions & 11 deletions invidious/umbrel-app.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
manifestVersion: 1
manifestVersion: 1.1
id: invidious
category: social
name: Invidious
version: "2.20241110.0"
version: "2.20250314.0"
tagline: Browse YouTube without tracking or ads
description: >-
An open source alternative front-end to YouTube
Expand Down Expand Up @@ -48,19 +48,18 @@ defaultUsername: ""
defaultPassword: ""
torOnly: false
releaseNotes: >-
This release addresses a critical issue that was causing channel pages to fail with a "Youtube API returned error 400" error.
Video playback issues still persist in this release.
This release brings the long awaited feature of supporting multiple audio tracks in a video, some bug fixes and UX improvements, and many other things primarily oriented to self-hosting instances, and developers using the API.


Key improvements in this release:
- Fixed channel pages loading issues
- Added new video preload control option in preferences
- Shorts can now be sorted by newest, oldest, and popular
- Added support for new interface languages: Bulgarian, Welsh and Lombard
- Improved instance switching speed
- Fixed various playback and subscription issues
- Invidious now supports videos with multiple audio tracks allowing you to select which one you want to hear with!
- Channel pages now have a proper previous page button
- RSS feeds for channels will no longer contain the channel's profile picture
- Support for channel courses page has been added
- Community tabs has been replaced with Posts to comply with YouTube changes
- Tamil is now an available interface language.


For full release notes, visit https://github.com/iv-org/invidious/releases
submitter: Jasper
submission: https://github.com/getumbrel/umbrel-apps/pull/129
submission: https://github.com/getumbrel/umbrel-apps/pull/129