Skip to content

Commit

Permalink
Add Inv sig helper
Browse files Browse the repository at this point in the history
- Added Inv sig helper
  • Loading branch information
tmiland committed Sep 30, 2024
1 parent 6281834 commit 93178ab
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions invidious_installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,55 @@ add_swap() {
read_sleep 3
}

install_inv_sig_helper() {
if [[ -d $USER_DIR ]]
then
echo -e "Downloading Invidious sig helper service from GitHub"

cd $USER_DIR || exit 1

git clone https://github.com/iv-org/inv_sig_helper.git
chown -R $USER_NAME:$USER_NAME inv_sig_helper
cd inv_sig_helper || exit 1
# Install cargo / rust
curl -fsSL sh.rustup.rs | sh -s -- -y
# Source cargo
. "$HOME/.cargo/env"
# Build release
cargo build --release
# Copy service file to systemd folder
cp -rp $USER_DIR/inv_sig_helper/inv_sig_helper.service /etc/systemd/system/
# Add socket to config
${SUDO} echo "signature_server: /home/invidious/tmp/inv_sig_helper.sock" >> $USER_DIR/invidious/config/config.yml
if [[ ! -d /home/invidious/tmp ]]
then
${SUDO} mkdir -p /home/invidious/tmp
chown -R $USER_NAME:$USER_NAME /home/invidious/tmp
fi
SERVICE_NAME=inv_sig_helper.service
# Enable invidious sig helper at boot
${SUDO} $SYSTEM_CMD enable ${SERVICE_NAME}
# Reload Systemd
${SUDO} $SYSTEM_CMD daemon-reload
# Start Invidious sig helper
${SUDO} $SYSTEM_CMD start ${SERVICE_NAME}
if ( $SYSTEM_CMD -q is-active ${SERVICE_NAME})
then
echo -e "Invidious sig helper service has been successfully installed!"
${SUDO} $SYSTEM_CMD status ${SERVICE_NAME} --no-pager
echo -e "Restarting Invidious for changes to take effect..."
${SUDO} $SYSTEM_CMD restart invidious
read_sleep 5
else
echo -e "Invidious sig helper service installation failed..."
${SUDO} journalctl -u ${SERVICE_NAME}
read_sleep 5
fi
else
echo -e "Invidious is not installed..."
fi
}

## get total free memory size in megabytes(MB)
free=$(free -mt | grep Total | awk '{print $4}')
if [[ "$free" -le 2048 ]]; then
Expand Down Expand Up @@ -1190,6 +1239,7 @@ host replication all ::1/128 md5" | ${SUDO} t
# Not figured out why yet, so let's set permissions after as well...
run_ok "set_permissions" "Setting folder permissions again to be sure"
run_ok "logrotate_install" "Adding logrotate configuration"
run_ok "install_inv_sig_helper" "Installing Inv sig helper"
log_success "Invidious Setup Finished"

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

0 comments on commit 93178ab

Please sign in to comment.