Skip to content

Commit 93178ab

Browse files
committed
Add Inv sig helper
- Added Inv sig helper
1 parent 6281834 commit 93178ab

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

invidious_installer.sh

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,55 @@ add_swap() {
422422
read_sleep 3
423423
}
424424

425+
install_inv_sig_helper() {
426+
if [[ -d $USER_DIR ]]
427+
then
428+
echo -e "Downloading Invidious sig helper service from GitHub"
429+
430+
cd $USER_DIR || exit 1
431+
432+
git clone https://github.com/iv-org/inv_sig_helper.git
433+
chown -R $USER_NAME:$USER_NAME inv_sig_helper
434+
cd inv_sig_helper || exit 1
435+
# Install cargo / rust
436+
curl -fsSL sh.rustup.rs | sh -s -- -y
437+
# Source cargo
438+
. "$HOME/.cargo/env"
439+
# Build release
440+
cargo build --release
441+
# Copy service file to systemd folder
442+
cp -rp $USER_DIR/inv_sig_helper/inv_sig_helper.service /etc/systemd/system/
443+
# Add socket to config
444+
${SUDO} echo "signature_server: /home/invidious/tmp/inv_sig_helper.sock" >> $USER_DIR/invidious/config/config.yml
445+
if [[ ! -d /home/invidious/tmp ]]
446+
then
447+
${SUDO} mkdir -p /home/invidious/tmp
448+
chown -R $USER_NAME:$USER_NAME /home/invidious/tmp
449+
fi
450+
SERVICE_NAME=inv_sig_helper.service
451+
# Enable invidious sig helper at boot
452+
${SUDO} $SYSTEM_CMD enable ${SERVICE_NAME}
453+
# Reload Systemd
454+
${SUDO} $SYSTEM_CMD daemon-reload
455+
# Start Invidious sig helper
456+
${SUDO} $SYSTEM_CMD start ${SERVICE_NAME}
457+
if ( $SYSTEM_CMD -q is-active ${SERVICE_NAME})
458+
then
459+
echo -e "Invidious sig helper service has been successfully installed!"
460+
${SUDO} $SYSTEM_CMD status ${SERVICE_NAME} --no-pager
461+
echo -e "Restarting Invidious for changes to take effect..."
462+
${SUDO} $SYSTEM_CMD restart invidious
463+
read_sleep 5
464+
else
465+
echo -e "Invidious sig helper service installation failed..."
466+
${SUDO} journalctl -u ${SERVICE_NAME}
467+
read_sleep 5
468+
fi
469+
else
470+
echo -e "Invidious is not installed..."
471+
fi
472+
}
473+
425474
## get total free memory size in megabytes(MB)
426475
free=$(free -mt | grep Total | awk '{print $4}')
427476
if [[ "$free" -le 2048 ]]; then
@@ -1190,6 +1239,7 @@ host replication all ::1/128 md5" | ${SUDO} t
11901239
# Not figured out why yet, so let's set permissions after as well...
11911240
run_ok "set_permissions" "Setting folder permissions again to be sure"
11921241
run_ok "logrotate_install" "Adding logrotate configuration"
1242+
run_ok "install_inv_sig_helper" "Installing Inv sig helper"
11931243
log_success "Invidious Setup Finished"
11941244

11951245
# Make sure the cursor is back (if spinners misbehaved)

0 commit comments

Comments
 (0)