mirror of
https://github.com/community-scripts/ProxmoxVED.git
synced 2026-03-10 04:54:58 +00:00
Add Invidious
This commit is contained in:
71
ct/invidious.sh
Normal file
71
ct/invidious.sh
Normal file
@@ -0,0 +1,71 @@
|
||||
#!/usr/bin/env bash
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func)
|
||||
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: vhsdream
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
|
||||
# Source: https://github.com/iv-org/invidious
|
||||
|
||||
APP="Invidious"
|
||||
var_tags="${var_tags:-streaming}"
|
||||
var_cpu="${var_cpu:-2}"
|
||||
var_ram="${var_ram:-2048}"
|
||||
var_disk="${var_disk:-4}"
|
||||
var_os="${var_os:-debian}"
|
||||
var_version="${var_version:-13}"
|
||||
var_unprivileged="${var_unprivileged:-1}"
|
||||
|
||||
header_info "$APP"
|
||||
variables
|
||||
color
|
||||
catch_errors
|
||||
|
||||
function update_script() {
|
||||
header_info
|
||||
check_container_storage
|
||||
check_container_resources
|
||||
|
||||
if [[ ! -d /opt/invidious ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
|
||||
if check_for_gh_release "Invidious" "iv-org/invidious"; then
|
||||
msg_info "Stopping services"
|
||||
$STD systemctl stop invidious-companion invidious
|
||||
msg_ok "Stopped services"
|
||||
|
||||
msg_info "Backing up config"
|
||||
cp /opt/invidious/config/config.yml /opt/invidious-config.yml
|
||||
msg_ok "Backed up config"
|
||||
|
||||
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "Invidious" "iv-org/invidious" "tarball" "latest" "/opt/invidious"
|
||||
if check_for_gh_release "Invidious-Companion" "iv-org/invidious-companion"; then
|
||||
CLEAN_INSTALL fetch_and_deploy_gh_release "Invidious-Companion" "iv-org/invidious-companion" "prebuild" "latest" "/opt/invidious-companion" "invidious_companion-x86_64-unknown-linux-gnu.tar.gz"
|
||||
fi
|
||||
|
||||
msg_info "Updating Invidious"
|
||||
PG_DB_PASS="$(sed -n '/Password:/s/[^:]*:[[:space:]]//p' ~/oxicloud.creds)"
|
||||
cd /opt/oxicloud
|
||||
export DATABASE_URL="postgres://oxicloud:${PG_DB_PASS}@localhost/oxicloud"
|
||||
export RUSTFLAGS="-C target-cpu=native"
|
||||
$STD cargo build --release
|
||||
mv target/release/oxicloud /usr/bin/oxicloud && chmod +x /usr/bin/oxicloud
|
||||
msg_ok "Updated Invidious"
|
||||
|
||||
msg_info "Starting Invidious"
|
||||
$STD systemctl start oxicloud
|
||||
msg_ok "Started Invidious"
|
||||
msg_ok "Updated successfully!"
|
||||
fi
|
||||
exit
|
||||
}
|
||||
|
||||
start
|
||||
build_container
|
||||
description
|
||||
|
||||
msg_ok "Completed successfully!\n"
|
||||
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
|
||||
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
|
||||
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8086${CL}"
|
||||
40
frontend/public/json/invidious.json
Normal file
40
frontend/public/json/invidious.json
Normal file
@@ -0,0 +1,40 @@
|
||||
{
|
||||
"name": "Invidious",
|
||||
"slug": "invidious",
|
||||
"categories": [
|
||||
13
|
||||
],
|
||||
"date_created": "2026-03-09",
|
||||
"type": "ct",
|
||||
"updateable": true,
|
||||
"privileged": false,
|
||||
"interface_port": 3000,
|
||||
"documentation": "https:/docs.invidious.io",
|
||||
"website": "https://invidious.io",
|
||||
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/invidious.webp",
|
||||
"config_path": "/opt/invidious/config",
|
||||
"description": "A self-hosted alternative frontend for YouTube",
|
||||
"install_methods": [
|
||||
{
|
||||
"type": "default",
|
||||
"script": "ct/invidious.sh",
|
||||
"resources": {
|
||||
"cpu": 2,
|
||||
"ram": 2048,
|
||||
"hdd": 4,
|
||||
"os": "Debian",
|
||||
"version": "13"
|
||||
}
|
||||
}
|
||||
],
|
||||
"default_credentials": {
|
||||
"username": null,
|
||||
"password": null
|
||||
},
|
||||
"notes": [
|
||||
{
|
||||
"text": "Invidious Companion comes pre-installed and is running on port 8082.",
|
||||
"type": "info"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
11,
|
||||
12
|
||||
],
|
||||
"date_created": "2026-03-11",
|
||||
"date_created": "2026-03-09",
|
||||
"type": "ct",
|
||||
"updateable": true,
|
||||
"privileged": false,
|
||||
|
||||
84
install/invidious-install.sh
Normal file
84
install/invidious-install.sh
Normal file
@@ -0,0 +1,84 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: vhsdream
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
|
||||
# Source: https://github.com/iv-org/invidious
|
||||
|
||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||
color
|
||||
verb_ip6
|
||||
catch_errors
|
||||
setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
msg_info "Installing Dependencies"
|
||||
$STD apt install -y \
|
||||
libssl-dev \
|
||||
libxml2-dev \
|
||||
libyaml-dev \
|
||||
libgmp-dev \
|
||||
libreadline-dev \
|
||||
librsvg2-bin \
|
||||
libsqlite3-dev \
|
||||
zlib1g-dev \
|
||||
libpcre3-dev \
|
||||
libevent-dev \
|
||||
fonts-open-sans
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
setup_deb822_repo "crystal" "https://download.opensuse.org/repositories/devel:/languages:/crystal/Debian_13/Release.key" "https://download.opensuse.org/repositories/devel:/languages:/crystal/Debian_13/" "./"
|
||||
$STD apt install -y crystal
|
||||
|
||||
PG_VERSION="17" setup_postgresql
|
||||
PG_DB_NAME="invidious" PG_DB_USER="invidious" setup_postgresql_db
|
||||
fetch_and_deploy_gh_release "Invidious" "iv-org/invidious" "tarball" "latest" "/opt/invidious"
|
||||
fetch_and_deploy_gh_release "Invidious Companion" "iv-org/invidious-companion" "prebuild" "latest" "/opt/invidious-companion" "invidious_companion-x86_64-unknown-linux-gnu.tar.gz"
|
||||
|
||||
msg_info "Building Invidious"
|
||||
cd /opt/invidious
|
||||
$STD make
|
||||
msg_ok "Built Invidious"
|
||||
|
||||
msg_info "Configuring Invidious"
|
||||
SECRET_KEY="$(openssl rand -hex 16)"
|
||||
sed -e '|^db|,|dbname|d' \
|
||||
-e "s|^#database_.*|database_url: postgres://${PG_DB_USER}:${PG_DB_PASS}@localhost:5432/${PG_DB_NAME}|" \
|
||||
-e 's|^#check_.*|check_tables: true|' \
|
||||
-e 's|^#invidious_companion:|invidious_companion:|' \
|
||||
-e 's|^# - private_| - private_|' \
|
||||
-e "s|^#invidious_companion_key:.*|inviduous_companion_key: \"${SECRET_KEY}\"|" \
|
||||
-e "s|hmac_key:.*|hmac_key: \"$(openssl rand -hex 32)\"|" \
|
||||
/opt/invidious/config/config.example.yml >/opt/invidious/config/config.yml
|
||||
chmod 600 /opt/invidious/config/config.yml
|
||||
|
||||
cat <<EOF >/etc/logrotate.d/invidious.logrotate
|
||||
rotate 4
|
||||
weekly
|
||||
notifempty
|
||||
missingok
|
||||
compress
|
||||
minsize 1048576
|
||||
EOF
|
||||
chmod 0644 /etc/logrotate.d/invidious.logrotate
|
||||
msg_ok "Configured Invidious"
|
||||
|
||||
msg_info "Migrating database"
|
||||
$STD ./invidious --migrate
|
||||
msg_ok "Migrated database"
|
||||
|
||||
msg_info "Configuring services"
|
||||
sed -e 's|=invidious|=root|' \
|
||||
-e 's|/home|/opt|' /opt/invidious.service /etc/systemd/system/invidious.service
|
||||
curl -fsSL https://github.com/iv-org/invidious-companion/raw/refs/heads/master/invidious-companion.service -o /etc/systemd/system/invidious-companion.service
|
||||
sed -i -e "s|CHANGE_ME$|${SECRET_KEY}|" \
|
||||
-e 's|=invidious$|=root|' \
|
||||
-e 's|/home|/opt|' /etc/systemd/system/invidious_companion.service
|
||||
systemctl daemon-reload
|
||||
systemctl -q enable --now invidious invidious-companion
|
||||
msg_ok "Configured services"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
Reference in New Issue
Block a user