Coder Social home page Coder Social logo

tmiland / invidious-updater Goto Github PK

View Code? Open in Web Editor NEW
228.0 9.0 39.0 7.2 MB

Automatic install and update script for Invidious

Home Page: https://github.com/iv-org/invidious

License: MIT License

Shell 100.00%
invidious bash-script auto-install auto-update docker centos7 bash archlinux arch-linux fedora

invidious-updater's Introduction

Invidious-Updater (And Installer)

                  ╔═══════════════════════════════════════════════════════════════════╗
                  ║                        Invidious Update.sh                        ║
                  ║               Automatic update script for Invidious               ║
                  ║                      Maintained by @tmiland                       ║
                  ╚═══════════════════════════════════════════════════════════════════╝

GitHub release licence Bash

Script to install and update Invidious

1) Install Invidious          6) Start, Stop or Restart   
2) Update Invidious           7) Uninstall Invidious      
3) Deploy with Docker         8) Set up PostgreSQL Backup 
4) Add Swap Space             9) Install Nginx            
5) Run Database Maintenance  10) Exit                     

Screenshots

screenshot

Debian Ubuntu
CentOS Fedora
Arch PureOS

Recommendation

It is recommended to use this script on a fresh installation to avoid unwanted complications.

Installation

If you're looking for a quick way to install, check out Invidious-Installer This is now integrated into the update script

Download and execute the script:

For latest release

curl -s https://api.github.com/repos/tmiland/Invidious-Updater/releases/latest \
| grep "browser_download_url.*sh" \
| cut -d : -f 2,3 \
| tr -d \" \
| wget -qi -
$ chmod +x invidious_update.sh
$ ./invidious_update.sh

Or directly

$ curl -sSL https://github.com/tmiland/Invidious-Updater/releases/latest/download/invidious_update.sh | bash

For master branch

$ wget https://github.com/tmiland/Invidious-Updater/raw/master/invidious_update.sh
$ chmod +x invidious_update.sh
$ ./invidious_update.sh

Repository

$ sudo curl -SsL -o /etc/apt/sources.list.d/tmiland.list https://deb.tmiland.com/debian/tmiland.list
$ curl -SsL https://deb.tmiland.com/debian/KEY.gpg | gpg --dearmor | sudo tee /usr/share/keyrings/tmiland-archive-keyring.gpg >/dev/null
$ sudo apt update
$ sudo apt install invidious-updater
  • Run script with invidious_update

  • Only for Debian/Ubuntu/LinuxMint/PureOS

Check for script update (Default "no")

$ ./invidious_update.sh -u

Update Invidious via Cron

Select option 2 once to manually set GitHub Credentials

$ /path/to/script/invidious_update.sh -c

Add job to cron:

$ crontab -e
@daily bash /path/to/script/invidious_update.sh -c > /dev/null 2>&1 # Automated Invidious Update

Note: you will be prompted to enter root password

If root password is not set, type:

sudo passwd root

Usage

  1. Install invidious

asciicast

  1. Update Invidious

Note: GitHub Credentials needs to be provided to keep the update from failing (Credentials are stored in /root/.gitconfig) This is required to stash & checkout a new branch which was implemented to prevent "Detached HEAD state".

  • Invidious is ready to be updated, press any key to continue...
  1. Deploy Invidious with Docker

      1. Build and start cluster
      1. Start, Stop or Restart cluster
      1. Rebuild cluster
      1. Delete data and rebuild
      1. Install Docker CE
      1. Run database maintenance
  2. Add Swap Space

  3. Run database maintenance

    Also works with argument -m

    $ /path/to/script/invidious_update.sh -m
  4. Start, Stop or Restart Invidious

  5. Uninstall Invidious

asciicast

  1. Set up PostgreSQL Backup

  2. Install Nginx

  3. Exit

  • Exits the script

screenshot

Testing

Tested and working on:

Debian Ubuntu CentOS Fedora Arch PureOS
  • Tested extensively on Debian 9/10/11

    • Docker option tested and working
  • Tested on Ubuntu 16.04

    • Docker option tested, not working
  • Tested on Ubuntu 18.10

    • Docker option tested and working
  • Tested on CentOS 8

    • Docker option tested and working
  • Tested on Fedora 33

    • Docker option tested and working
  • On Bash on Debian on Windows (in Gnome-Boxes)

    • Systemd not working
    • Docker option not working
  • Tested on Linux Mint.

  • Tested on Arch Linux

    • Docker option tested and working

    If you get permission issues, set selinux to permissive. See how to here: How do I enable or disable SELinux ?

    SELinux will be set to permissive on Fedora 33 and CentOS 8

    Postgresql 11 will be installed by default in both Fedora and CentOS. (If not already installed) Postgresql will be default from repo on Fedora 33 and CentOS 8

Latest install log - version: 1.4.4

install log Debian 10

Changelog

See Changelog

Compatibility and Requirements

  • Debian 8 and later
  • Ubuntu 16.04 and later
  • PureOS (Not tested)
  • CentOS 8
  • Fedora 33
  • Arch Linux

Credits

Feature request and bug reports

Donations

Coindrop.to me

Web Hosting

Sign up for web hosting using this link, and receive $200 in credit over 60 days.

DigitalOcean Referral Badge

Disclaimer

*** Use at own risk ***

License

MIT License Image

MIT License

invidious-updater's People

Contributors

benni347 avatar jonathonf avatar krvtech avatar quix0r avatar reawebcrawlerplayer avatar samantazfox avatar solisinvictum avatar tmiland avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

invidious-updater's Issues

help: installed on ubuntu vps but can't access it

Hi, I installed invidious using this updater on a vps. I'm trying to access that installation using http://[vps-ip]:3000 but I can't.

Running the installer I can see that:

Services running:
Invidious: ● active
PostgreSQL: ● active

How else can I check the installation?

Make Y/n (Yes by default)

By default Y is what is entered when just pressing enter. I think you should do the same in this script.

Setup fails on clean Debian 10 VM

I set up a fresh VM using the latest Debian (10). I downloaded and ran the script but the installation did not seem to be going as planned. This is the log:

 ╔═══════════════════════════════════════════════════════════════════╗
 ║                        Invidious Update.sh                        ║
 ║               Automatic update script for Invidio.us              ║
 ║                      Maintained by @tmiland                       ║
 ║                          version: 1.4.7                           ║
 ╚═══════════════════════════════════════════════════════════════════╝

Thank you for using the Invidious Update.sh script.



Documentation for this script is available here:
 ➜ https://github.com/tmiland/Invidious-Updater


Let's go through some configuration options.

Do you want to install Invidious release or master?
   1) release
   2) master

Select an option [1-2]: 1
Do you want to enter advanced options? [y/n]: n


You entered:

 ✔ branch        : release
 ✔ domain        : invidio.us
 ✔ ip adress     : localhost
 ✔ port          : 3000
 ✔ external port :
 ✔ dbname        : invidious
 ✔ dbpass        : kemal
 ✔ https only    : false



Invidious is ready to be installed, press any key to continue...

OK
deb https://dist.crystal-lang.org/apt crystal main
Vormals nicht ausgewähltes Paket libssl-dev:amd64 wird gewählt.
(Lese Datenbank ... 37978 Dateien und Verzeichnisse sind derzeit installiert.)
Vorbereitung zum Entpacken von .../libssl-dev_1.1.1f-1_amd64.deb ...
Entpacken von libssl-dev:amd64 (1.1.1f-1) ...
Vormals nicht ausgewähltes Paket crystal wird gewählt.
Vorbereitung zum Entpacken von .../crystal_0.34.0-1_amd64.deb ...
Entpacken von crystal (0.34.0-1) ...
crystal (0.34.0-1) wird eingerichtet ...
libssl-dev:amd64 (1.1.1f-1) wird eingerichtet ...
Trigger für man-db (2.9.1-1) werden verarbeitet ...
Vormals nicht ausgewähltes Paket libxml2-dev:amd64 wird gewählt.
(Lese Datenbank ... 39366 Dateien und Verzeichnisse sind derzeit installiert.)
Vorbereitung zum Entpacken von .../libxml2-dev_2.9.10+dfsg-4_amd64.deb ...
Entpacken von libxml2-dev:amd64 (2.9.10+dfsg-4) ...
libxml2-dev:amd64 (2.9.10+dfsg-4) wird eingerichtet ...
Trigger für man-db (2.9.1-1) werden verarbeitet ...
Vormals nicht ausgewähltes Paket libyaml-dev:amd64 wird gewählt.
(Lese Datenbank ... 39428 Dateien und Verzeichnisse sind derzeit installiert.)
Vorbereitung zum Entpacken von .../libyaml-dev_0.2.2-1_amd64.deb ...
Entpacken von libyaml-dev:amd64 (0.2.2-1) ...
libyaml-dev:amd64 (0.2.2-1) wird eingerichtet ...
Vormals nicht ausgewähltes Paket libgmp-dev:amd64 wird gewählt.
(Lese Datenbank ... 39435 Dateien und Verzeichnisse sind derzeit installiert.)
Vorbereitung zum Entpacken von .../libgmp-dev_2%3a6.2.0+dfsg-4_amd64.deb ...
Entpacken von libgmp-dev:amd64 (2:6.2.0+dfsg-4) ...
libgmp-dev:amd64 (2:6.2.0+dfsg-4) wird eingerichtet ...
Vormals nicht ausgewähltes Paket libreadline-dev:amd64 wird gewählt.
(Lese Datenbank ... 39450 Dateien und Verzeichnisse sind derzeit installiert.)
Vorbereitung zum Entpacken von .../libreadline-dev_8.0-4_amd64.deb ...
Entpacken von libreadline-dev:amd64 (8.0-4) ...
libreadline-dev:amd64 (8.0-4) wird eingerichtet ...
Vormals nicht ausgewähltes Paket librsvg2-bin wird gewählt.
(Lese Datenbank ... 39465 Dateien und Verzeichnisse sind derzeit installiert.)
Vorbereitung zum Entpacken von .../librsvg2-bin_2.48.0-2_amd64.deb ...
Entpacken von librsvg2-bin (2.48.0-2) ...
librsvg2-bin (2.48.0-2) wird eingerichtet ...
Trigger für man-db (2.9.1-1) werden verarbeitet ...
Vormals nicht ausgewähltes Paket libsqlite3-dev:amd64 wird gewählt.
(Lese Datenbank ... 39470 Dateien und Verzeichnisse sind derzeit installiert.)
Vorbereitung zum Entpacken von .../libsqlite3-dev_3.31.1-4_amd64.deb ...
Entpacken von libsqlite3-dev:amd64 (3.31.1-4) ...
libsqlite3-dev:amd64 (3.31.1-4) wird eingerichtet ...
➜ User invidious Not Found, adding user
➜ Downloading Invidious from GitHub
Klone nach 'invidious' ...
remote: Enumerating objects: 61, done.
remote: Counting objects: 100% (61/61), done.
remote: Compressing objects: 100% (51/51), done.
remote: Total 12318 (delta 18), reused 27 (delta 9), pack-reused 12257
Empfange Objekte: 100% (12318/12318), 15.52 MiB | 8.84 MiB/s, Fertig.
Löse Unterschiede auf: 100% (7871/7871), Fertig.
Zu neuem Branch 'release' gewechselt
➜ Done
/home/invidious
Synchronizing state of postgresql.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable postgresql
➜ Creating user kemal with password kemal
CREATE ROLE
➜ Creating database invidious with owner kemal
CREATE DATABASE
➜ Grant all on database invidious to user kemal
GRANT
➜ Running /home/invidious/invidious/config/sql/annotations.sql
CREATE TABLE
GRANT
➜ Running /home/invidious/invidious/config/sql/channels.sql
CREATE TABLE
GRANT
CREATE INDEX
➜ Running /home/invidious/invidious/config/sql/channel_videos.sql
CREATE TABLE
GRANT
CREATE INDEX
➜ Running /home/invidious/invidious/config/sql/nonces.sql
CREATE TABLE
GRANT
CREATE INDEX
➜ Running /home/invidious/invidious/config/sql/playlists.sql
psql:/home/invidious/invidious/config/sql/playlists.sql:16: FEHLER:  Typ »privacy« existiert nicht
ZEILE 10:     privacy privacy,
                      ^
psql:/home/invidious/invidious/config/sql/playlists.sql:18: FEHLER:  Relation »public.playlists« existiert nicht
➜ Running /home/invidious/invidious/config/sql/playlist_videos.sql
psql:/home/invidious/invidious/config/sql/playlist_videos.sql:17: FEHLER:  Relation »playlists« existiert nicht
psql:/home/invidious/invidious/config/sql/playlist_videos.sql:19: FEHLER:  Relation »public.playlist_videos« existiert nicht
➜ Running /home/invidious/invidious/config/sql/privacy.sql
CREATE TYPE
➜ Running /home/invidious/invidious/config/sql/session_ids.sql
CREATE TABLE
GRANT
CREATE INDEX
➜ Running /home/invidious/invidious/config/sql/users.sql
CREATE TABLE
GRANT
CREATE INDEX
➜ Running /home/invidious/invidious/config/sql/videos.sql
CREATE TABLE
GRANT
CREATE INDEX
✔ Finished Database section
➜ Updating config.yml with new info...
✔ Done.
Resolving dependencies
Fetching https://github.com/will/crystal-pg.git
Fetching https://github.com/crystal-lang/crystal-sqlite3.git
Fetching https://github.com/kemalcr/kemal.git
Fetching https://github.com/ysbaddaden/pool.git
Fetching https://github.com/omarroth/protodec.git
Fetching https://github.com/omarroth/lsquic.cr.git
Fetching https://github.com/crystal-lang/crystal-db.git
Fetching https://github.com/luislavena/radix.git
Fetching https://github.com/jeromegn/kilt.git
Fetching https://github.com/crystal-loot/exception_page.git
Installing pg (0.19.0)
Installing sqlite3 (0.14.0)
Installing kemal (0.26.1)
Installing pool (0.2.3)
Installing protodec (0.1.2)
Installing lsquic (0.1.9)
Installing db (0.7.0)
Installing radix (0.3.9)
Installing kilt (0.4.0)
Installing exception_page (0.1.4)
Writing shard.lock
Resolving dependencies
Fetching https://github.com/will/crystal-pg.git
Fetching https://github.com/crystal-lang/crystal-db.git
Fetching https://github.com/crystal-lang/crystal-sqlite3.git
Fetching https://github.com/kemalcr/kemal.git
Fetching https://github.com/luislavena/radix.git
Fetching https://github.com/jeromegn/kilt.git
Fetching https://github.com/crystal-loot/exception_page.git
Fetching https://github.com/ysbaddaden/pool.git
Fetching https://github.com/omarroth/protodec.git
Fetching https://github.com/omarroth/lsquic.cr.git
Using pg (0.19.0)
Using sqlite3 (0.14.0)
Using kemal (0.26.1)
Using pool (0.2.3)
Using protodec (0.1.2)
Using lsquic (0.1.9)
Using db (0.7.0)
Using radix (0.3.9)
Using kilt (0.4.0)
Using exception_page (0.1.4)
Writing shard.lock
Showing last frame. Use --error-trace for full trace.

In lib/pg/src/pq/connection.cr:170:20

 170 | rescue e : Errno
                  ^----
Error: Errno is not a subclass of Exception
✗ Invidious service installation failed...
Adding logrotate configuration...
/home/invidious/invidious/invidious.log {
    rotate 4
    weekly
    notifempty
    missingok
    compress
    minsize 1048576
}
 (done)


 ╔═══════════════════════════════════════════════════════════════════╗
 ║                        Invidious Update.sh                        ║
 ║               Automatic update script for Invidio.us              ║
 ║                      Maintained by @tmiland                       ║
 ║                          version: 1.4.7                           ║
 ╚═══════════════════════════════════════════════════════════════════╝




Thank you for using the Invidious Update.sh script.



✔ Invidious install done. Now visit http://localhost:3000




Documentation for this script is available here:
 ➜ https://github.com/tmiland/Invidious-Updater



 ╔═══════════════════════════════════════════════════════════════════╗
 ║                        Invidious Update.sh                        ║
 ║               Automatic update script for Invidio.us              ║
 ║                      Maintained by @tmiland                       ║
 ║                          version: 1.4.7                           ║
 ╚═══════════════════════════════════════════════════════════════════╝

Welcome to the Invidious Update.sh script.

What do you want to do?

  1) Install Invidious          5) Run Database Maintenance
  2) Update Invidious           6) Start, Stop or Restart
  3) Deploy with Docker         7) Uninstall Invidious
  4) Install Invidious service  8) Set up PostgreSQL Backup
  9) Exit


Documentation for this script is available here:
 ➜ https://github.com/tmiland/Invidious-Updater

Select an option [1-9]:

Updater script not supported on Linux Mint

Describe the bug
The updater script doesn't run on Linux Mint. It says the OS is unsupported.

To Reproduce

  1. Try to run the script on a Linux Mint machine.

Expected behavior
The updater should run on Linux Mint under the Debian/Ubuntu code path, as Mint is a derivative of Ubuntu.

Desktop (please complete the following information):

  • OS: Linux Mint

Additional context
"LinuxMint" is the DISTRIB_ID of Linux Mint in lsb-release, and it uses apt as the package manager.

All code paths looking for the distro will need to be updated to account for it (here, here, here, and here just to name a few).

If RAM is lower than 2GB, Install should suggest to create a swap space to avoid kill of crystal compiler

Is your feature request related to a problem? Please describe.
If not enough RAM is available, Crystal compiler will be killed by the system when building Invidious.
The script already have an option to add swap space. A check at the beginning of the install process should warn the user that, if their machine have less than 2GB of RAM, adding a swap space is recommended.

The option could even be part of the install process and would call the swap creation on demand.

Describe alternatives you've considered
Currently, if the crystal compiler is killed, no message warn the user that not enough memory is available.
Therefore, the user should be aware of the issue and creating the swap space before doing the install.

This might confuse new comers or people not aware of the required RAM to build the project.

"Start", "stop", "restart" action can be run even if Invidious is not installed

Describe the bug
It is possible to launch start, stop, or restart actions even if Invidious is not installed or the service is missing.

To Reproduce
Steps to reproduce the behavior:

  1. Download the script on a machine without Invidious installed.
  2. Run the script and choose "6) Start, stop or restart"
  3. Choose any action
  4. The operation will fail as invidious (or its service) is not installed but the process will be reported as done & successful.

Expected behavior
Start, Stop or Restart should check if the service is installed. If the service is not installed, it should inform the user that Invidious needs to be installed.

openSUSE support

Running the script returns the error: "X unknown distro: openSUSE".
Do you think you can add support for openSUSE Tumbleweed ?

Multiple errors on CentOS 7

Describe the bug
Multiple problems on CentOS 7 which may cause the script to fail:

  • if you run the script with "bash invidious_update.sh it will fail to restart itself, because it assumes that the script has already the executable flag.

  • on creating the docker image, in the packages dependency check it is silently assumed that docker-compose is installed.

  • on CentOS7 the package "redhat-lsb" won't be installed if it is missing and why do you even need this?

  • some circular references in the docker system (don't know much about Arch there):
    Deploy Invidious with Docker.

What do you want to do?

  1. Build and start cluster
  2. Start, Stop or Restart cluster
  3. Rebuild cluster
  4. Delete data and rebuild
  5. Install Docker CE

Select an option [1-5]: 1
Build and start cluster? [y/n]: y
Building invidious
Step 1/6 : FROM archlinux/base
---> 5e2b896c9d63
Step 2/6 : RUN pacman -Sy --noconfirm shards crystal imagemagick librsvg which pkgconf gcc ttf-liberation glibc
---> Running in 10a13de5dba3
:: Synchronizing package databases...
downloading core.db...
downloading extra.db...
downloading community.db...
resolving dependencies...
warning: glibc-2.29-4 is up to date -- reinstalling
looking for conflicting packages...
warning: dependency cycle detected:
warning: harfbuzz will be installed before its freetype2 dependency

Packages (57) binutils-2.32-2 cairo-1.17.2+17+g52a7c79fd-1 fontconfig-2:2.13.1+12+g5f5ec56-1 freetype2-2.10.1-1 fribidi-1.0.5-1 gc-7.6.8-1 gdk-pixbuf2-2.38.1-1 git-2.22.0-1 graphite-1:1.3.13-1 grep-3.3-1 harfbuzz-2.5.3-1 icu-64.2-1 jasper-2.0.16-1 lcms2-2.9-2 libatomic_ops-7.6.10-1 libcroco-0.6.13-1 libdatrie-0.2.12-1 libedit-20190324_3.1-1 libevent-2.1.10-1 libjpeg-turbo-2.0.2-1 liblqr-0.4.2-2 libmpc-1.1.0-1 libpng-1.6.37-1 libraqm-0.7.0-1 libthai-0.1.28-1 libtiff-4.0.10-1 libtool-2.4.6+42+gb88cebd5-5 libx11-1.6.8-1 libxau-1.0.9-1 libxcb-1.13.1-1 libxdmcp-1.1.3-1 libxext-1.3.4-1 libxft-2.3.3-1 libxml2-2.9.9-2 libxrender-0.9.10-2 libyaml-0.2.2-1 llvm6-libs-6.0.1-2 lzo-2.10-2 mpfr-4.0.2-1 pango-1:1.44.2+1+gb50f0ef8-1 perl-error-0.17027-2 perl-mailtools-2.21-2 perl-timedate-2.30-6 pixman-0.38.4-1 shared-mime-info-1.12-1 tar-1.32-1 xcb-proto-1.13-2 xorgproto-2019.1-1 crystal-0.29.0-1 gcc-9.1.0-2 glibc-2.29-4 imagemagick-7.0.8.58-1 librsvg-2:2.44.14+1+g17bb3cd6-1 pkgconf-1.6.3-1 shards-0.9.0-1 ttf-liberation-2.00.5-2 which-2.21-3
....
checking keyring...
checking package integrity...
loading package files...
checking for file conflicts...
checking available disk space...
:: Processing package changes...
installing libyaml...
reinstalling glibc...
error: could not remove database entry glibc-2.29-4
error: could not create directory /var/lib/pacman/local/glibc-2.29-4/: File exists
error: could not commit transaction
error: failed to commit transaction (transaction aborted)
Errors occurred, no packages were upgraded.
ERROR: Service 'invidious' failed to build: The command '/bin/sh -c pacman -Sy --noconfirm shards crystal imagemagick librsvg which pkgconf gcc ttf-liberation glibc' returned a non-zero code: 1

Resorting to install it directly:
4) install Invidious service (after trying out installing docker)
Select an option [1-9]: 4
Created symlink from /etc/systemd/system/multi-user.target.wants/invidious.service to /usr/lib/systemd/system/invidious.service.
✗ Invidious service installation failed...

Really, this script is a bit iffy...

Dunno, how this was tested on CentOS 7, but looking at the screenshot for CentOS7, you just installed the Desktop / Everything flavor and called it a day. If you want to test the script PROPERLY, install the CentOS 7 minimal / bare bones variant and THEN let it run.

Most people who are using CentOS, do not use the Desktop, they just install the bare minimum and then only put things in it they actually need.

Uninstallation errors.
Select an option [1-9]: 7
Remove database for Invidious ? [y/n]: y
⚠ (( A backup will be placed in ➜ /home/backup/invidious ))
Your Invidious database name: invidious
⚠ (( If yes, only data will be dropped ))
Do you intend to reinstall?: n
Remove Packages ? [y/n]: y
Purge Package configuration files ? [y/n]: y
⚠ (( This option will remove ➜ /home/invidious/invidious ))
Remove files ? [y/n]: y
⚠ (( This option will remove ➜ /home/invidious ))
⚠ (( Not needed for reinstall ))
Remove user ? [y/n]: y
Is that correct? [y/n]: y

Invidious is ready to be uninstalled, press any key to continue...

➜ Running database backup

pg_dump: [archiver (db)] connection to database "invidious" failed: FATAL: database "invidious" does not exist

( the script does not really check if postgresql is really installed or not it just brutally does its thing. I really hope the script does not also nuke all other databases and the pgsql installation if other databases are present )

➜ Dropping Invidious PostgreSQL database
ERROR: database "invidious" does not exist

( well, if you did not create it, you cannot delete it ...)

➜ Removing user kemal
NOTICE: role "kemal" does not exist, skipping
DROP ROLE
( see above. do not assume you are alone on the system. period. and get better usernames )

➜ Removing packages installed during installation.
Note: PostgreSQL will not be removed due to unwanted complications
( gee whiz, I wonder why )

➜ Removing invidious files and modules files.
rm: cannot remove ‘/etc/yum.repos.d/crystal.repo’: No such file or directory
( don't remember ever having installed such a repo )

➜ Folder Found, removing folder
Warning: invidious.service changed on disk. Run 'systemctl daemon-reload' to reload units.
( issue that in the script )

Listen to all interfaces

Currently it only listens at localhost:3000

It would be good to access from different devices by localip:3000

I mean to access from devices same network 192.168.1.55 something like this

App listening only on IPv6, not IPv4

I've completed the installation on a VPS with a clean Debian 10 OS install. I chose #1 on the Invidious-Updater installation prompt for a clean install, without any customization. In my terminal, I see that both the Invidious and PostgreSQL services are running without issue--but when I navigate to my VPS' IP in my browser, the application does not come up.

I ran netstat, and found that my app is only listening on IPv6, and not on IPv4 (screenshot attached). Any guidance to get it to listen on IPv4? I appreciate the help!

netstat_edited

gpg dependency

Describe the bug
When installing on a minimal install without gnupg1/2, the install will fail, as the dependency isnt checked or installed.

To Reproduce
Steps to reproduce the behavior:

  1. Use minimal install without gnupg2 installed.
  2. Use script.
  3. Fail, as the additional repositories cant be added.

Expected behavior
Either install the dependency,prompt the user to or mention it in the readme.

Desktop (please complete the following information):

  • OS: Debian 10 - minimal install

Secondary issue is that it all fails very quietly. At the end, the script will say that the install was successful, even though it was not.

Systemctl daemon needs to be reloaded after an update

Describe the bug
When updating Invidious, a warning will quickly appear saying that because the service file has changed "systemctl daemon-reload" is needed. It would be nice if the script did it itself.

Additional context
Bare metal install (not docker).

The script shouldn't let users choose between Release and Master

The script currently ask the users what they want between Release and Master when Installing / Updating.

Releases are deprecated (I recently added a message here about it), and I don't think we'll ever do any more releases, so letting users choose to use a release is a bad idea.

This should only deploy invidious from master, and completely ignore the releases.

In short: this shouldn't be asked:

script

Docker Choose diffrent port for compose

It would be very nice if the taken port from the compose docker configuration file could be changed from within the script otherwise port 3000 f. e. is taken as well taken by other services like searx

Installation on a fresh debian 9 results in errors

It seems like that your script writes the database password in some source code? In my test setup I entered 12345 as password for the database.

Unhandled exception: Expected String, not 12345 at line 7, column 13 (YAML::ParseException)                                                                                        
  from /usr/share/crystal/src/yaml/nodes/nodes.cr:30:9 in 'raise'                                                                                                                  
  from /usr/share/crystal/src/yaml/from_yaml.cr:0:7 in 'new'                                                                                                                       
  from /usr/share/crystal/src/yaml/from_yaml.cr:165:3 in '???'                                                                                                                     
  from /usr/share/crystal/src/string/builder.cr:0:5 in '???'                                                                                                                       
  from src/invidious/videos.cr:0:1 in '__crystal_main'                                                                                                                             
  from /usr/share/crystal/src/crystal/main.cr:47:14 in 'main'                                                                                                                      
  from /usr/share/crystal/src/string/builder.cr:11:3 in 'dump'                                                                                                                     
  from _start                                                                                                                                                                      
  from ???

Change command for latest release

You can just use curl -sSL https://github.com/tmiland/Invidious-Updater/releases/latest/download/invidious_update.sh | bash as far as I know.

My install can only be accessed via my ip

Like the title states, I can only access my instance via the ip I fed the installer (pretty sure it'd work either way though). HTTP only even though I specified HTTPS-only.

OS: Ubuntu 18.04

Problem installing on Debian 10

Hi i tried installing invidious script using Invidious-Updater. My server running a Debian 10 on DigitalOcean as recommended. Fresh install. See screenshot below.

Installation fails, iptables unknown option "--to-destination"

Hi

Docker deployment fails on Arch with the following error :

Successfully built aeb1a3bfe4
Successfully tagged invidious_invidious:latest
WARNING: Image for service invidious was built because it did not already exist. To rebuild this image you must use `docker-compose build` or `docker-compose up --build`.
Creating invidious_postgres_1 ... done
Creating invidious_invidious_1 ... 
Creating invidious_invidious_1 ... error

ERROR: for invidious_invidious_1  Cannot start service invidious: driver failed programming external connectivity on endpoint invidious_invidious_1 (...):  (iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 127.0.0.1 --dport 3000 -j DNAT --to-destination 172.18.0.3:3000 ! -i br-b630b4afd2: iptables v1.8.6 (legacy): unknown option "--to-destination"
Try `iptables -h' or 'iptables --help' for more information.
 (exit status 2))

ERROR: for invidious  Cannot start service invidious: driver failed programming external connectivity on endpoint invidious_invidious_1 (...):  (iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 127.0.0.1 --dport 3000 -j DNAT --to-destination 172.18.0.3:3000 ! -i br-b630b4afd2: iptables v1.8.6 (legacy): unknown option "--to-destination"
Try `iptables -h' or 'iptables --help' for more information.
 (exit status 2))
ERROR: Encountered errors while bringing up the project.
✔ Deployment done.

Desktop (please complete the following information):

  • OS: Arch Linux

Any ideas ? Have a good day !

Fedora 32 install broken

To Reproduce
Steps to reproduce the behavior:
Try to install on Fedora 32 with option 1, then 1, then y

Expected behavior
That It just works, its still a very nice project 👍

Desktop (please complete the following information):

  • OS: Fedora
  • Browser: Chrome
  • Version 32

Additional context
Method arguments are broken, atleast on Fedora 32 it seems like.
Error Fedora 32 invidious install

Exiting the script (by pressing 9) is broken

Describe the bug:

Exiting the script (by pressing 9) just start the docker containers and goes back to the script without exiting

Gif:

gif

Running on:

  • OS: Arch
  • Setup: Docker
  • Version: 1.4.7

Debian Buster installation fails

the bug:
invidious.service: Failed with result 'exit-code'.
ERROR: relation "nonces" does not exist
LINE 1: DELETE FROM nonces * WHERE expire < current_timestamp;
^
➜ Truncating videos table.
ERROR: relation "videos" does not exist
Dec 11 16:11 xyz634 systemd[1]: Started Invidious (An alternative YouTube front-end).
Dec 11 16:1 xyz634 invidious[28093]: Unhandled exception: mapping values are not allowed in this context at line 2, column 15 (YAML::ParseException)

With Docker everything works well.

// invidious_update.sh: line 1293: ./invidious_update.sh: Permission denied
// is not causing the bug, i guess

Reproduce:

sadly i did not safe selection 1, but it was like 2 not showing directly that it does not work.
only the potential hint: Shard "lsquic" version (2.18.1) doesn't match tag version (2.18.1-1)


Select an option [1-10]: 2

Invidious is ready to be updated, press any key to continue...a
➜ Pulling Invidious from GitHub
fatal: Unable to mark file config/config.yml
Already up to date.
Saved working directory and index state WIP on master: b566c4b Untrack config.yml (#1557)
Branch 'master' set up to track remote branch 'master' from 'origin'.
Reset branch 'master'
Your branch is up to date with 'origin/master'.

-- Rebuilding /home/invidious/invidious
Resolving dependencies
Fetching https://github.com/will/crystal-pg.git
Fetching https://github.com/crystal-lang/crystal-sqlite3.git
Fetching https://github.com/kemalcr/kemal.git
Fetching https://github.com/ysbaddaden/pool.git
Fetching https://github.com/omarroth/protodec.git
Fetching https://github.com/iv-org/lsquic.cr.git
Fetching https://github.com/crystal-lang/crystal-db.git
Fetching https://github.com/luislavena/radix.git
Fetching https://github.com/jeromegn/kilt.git
Fetching https://github.com/crystal-loot/exception_page.git
Shard "lsquic" version (2.18.1) doesn't match tag version (2.18.1-1)
Using db (0.9.0)
Using pg (0.21.1)
Using sqlite3 (0.16.0)
Using radix (0.3.9)
Using kilt (0.4.0)
Using exception_page (0.1.4)
Using kemal (0.26.1 at dfe7dca)
Using pool (0.2.3)
Using protodec (0.1.3)
Using lsquic (2.18.1-1)
Writing shard.lock
Resolving dependencies
Fetching https://github.com/will/crystal-pg.git
Fetching https://github.com/crystal-lang/crystal-db.git
Fetching https://github.com/crystal-lang/crystal-sqlite3.git
Fetching https://github.com/kemalcr/kemal.git
Fetching https://github.com/luislavena/radix.git
Fetching https://github.com/jeromegn/kilt.git
Fetching https://github.com/crystal-loot/exception_page.git
Fetching https://github.com/ysbaddaden/pool.git
Fetching https://github.com/omarroth/protodec.git
Fetching https://github.com/iv-org/lsquic.cr.git
Shard "lsquic" version (2.18.1) doesn't match tag version (2.18.1-1)
Using db (0.9.0)
Using pg (0.21.1)
Using sqlite3 (0.16.0)
Using radix (0.3.9)
Using kilt (0.4.0)
Using exception_page (0.1.4)
Using kemal (0.26.1 at dfe7dca)
Using pool (0.2.3)
Using protodec (0.1.3)
Using lsquic (2.18.1-1)
/home/invidious/invidious

✔ Done Rebuilding /home/invidious/invidious 

-- restarting Invidious
● invidious.service - Invidious (An alternative YouTube front-end)
   Loaded: loaded (/lib/systemd/system/invidious.service; enabled; vendor preset: enabled)
   Active: activating (auto-restart) (Result: exit-code) since Fri 2020-12-11 16:49:33 MSK; 1s ago
  Process: 27727 ExecStart=/home/invidious/invidious/invidious -b -p -o invidious.log (code=exited, status=1/FAILURE)
 Main PID: 27727 (code=exited, status=1/FAILURE)

Dec 11 16:49:33 xyz634 systemd[1]: invidious.service: Failed with result 'exit-code'.

✔ Invidious has been restarted 
invidious_update.sh: line 1293: ./invidious_update.sh: Permission denied


##############################################################################

# Result in:  502 Bad Gateway nginx (of course i added the vhost with correct ssl cert)
# not like the default 502 Bad Gateway like after reboot. it is permanent

##############################################################################

Select an option [1-10]: 5
Are you sure you want to run Database Maintenance? Enter [y/n]: y

Your Invidious database name: 

Is that correct? Enter [y/n]: y
✗ stopping Invidious...
➜ Running Maintenance on  
➜ Deleting expired tokens
ERROR:  relation "nonces" does not exist
LINE 1: DELETE FROM nonces * WHERE expire < current_timestamp;
                    ^
➜ Truncating videos table.
ERROR:  relation "videos" does not exist
➜ Vacuuming .
vacuumdb: vacuuming database "postgres"
vacuumdb: query failed: ERROR:  relation "videos" does not exist
LINE 4:   AND c.oid OPERATOR(pg_catalog.=) 'videos'::pg_catalog.regc...
                                           ^
vacuumdb: query was: SELECT c.relname, ns.nspname
 FROM pg_catalog.pg_class c, pg_catalog.pg_namespace ns
 WHERE c.relnamespace OPERATOR(pg_catalog.=) ns.oid
  AND c.oid OPERATOR(pg_catalog.=) 'videos'::pg_catalog.regclass;
➜ Reindexing .
✔ Maintenance on  done.
➜ Restarting postgresql...
✔ Restarting postgresql done.
● postgresql.service - PostgreSQL RDBMS
   Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor preset: enabled)
   Active: active (exited) since Fri 2020-12-11 16:11 MSK; 52ms ago
  Process: 28086 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
 Main PID: 28086 (code=exited, status=0/SUCCESS)

Dec 11 16:11 xyz634 systemd[1]: Starting PostgreSQL RDBMS...
Dec 11 16:11 xyz634 systemd[1]: Started PostgreSQL RDBMS.
➜ Restarting Invidious...
✔ Restarting Invidious done.
● invidious.service - Invidious (An alternative YouTube front-end)
   Loaded: loaded (/lib/systemd/system/invidious.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2020-12-11 16:11 MSK; 30ms ago
 Main PID: 28093 (invidious)
    Tasks: 4 (limit: 2356)
   Memory: 2.2M
   CGroup: /system.slice/invidious.service
           └─28093 /home/invidious/invidious/invidious -b -p -o invidious.log

Dec 11 16:11 xyz634 systemd[1]: Started Invidious (An alternative YouTube front-end).
Dec 11 16:11 xyz634 invidious[28093]: Unhandled exception: mapping values are not allowed in this context at line 2, column 15 (YAML::ParseException)

Installation on a vps

Hi,

For an installation on a vps, is it necessary to change the domain, ip address and external port?

Thank you

Debian 10 error = ✗ unknown distro: ''

Describe the bug
The error shown in the title is presented when attempting to install via the "For latest release" method, as well as the, "Or directly" and the, "Repository" installation instructions.

To Reproduce
Steps to reproduce the behavior:
1.Follow the instructions for any of the above cases.
2. Be met with the error in the title.

Server (please complete the following information):
cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 10 (buster)"
NAME="Debian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=debian

Can't auto-update Invidious instance

Describe the bug
The script can't update my invidious instance because it failed to use installed shards from the OS...

I tried to install the missing one inside /home/invidious/invidious but it didn't changed anything 😕

To Reproduce
Steps to reproduce the behavior:

  1. Connect to my VPS in root
  2. Start invidious_update.sh from the root home or the /home/invidious/invidious
  3. Choose the update version
  4. See error

-- Rebuilding /home/invidious/invidious
Fetching https://github.com/will/crystal-pg.git
Fetching https://github.com/crystal-lang/crystal-db.git
Fetching https://github.com/crystal-lang/crystal-sqlite3.git
Fetching https://github.com/kemalcr/kemal.git
Fetching https://github.com/luislavena/radix.git
Fetching https://github.com/jeromegn/kilt.git
Fetching https://github.com/crystal-loot/exception_page.git
Using pg (0.18.1)
Using db (0.6.0)
Using sqlite3 (0.13.0)
Using kemal (0.26.0)
Using radix (0.3.9)
Using kilt (0.4.0)
Using exception_page (0.1.2)
Fetching https://github.com/will/crystal-pg.git
Fetching https://github.com/crystal-lang/crystal-db.git
Fetching https://github.com/crystal-lang/crystal-sqlite3.git
Fetching https://github.com/kemalcr/kemal.git
Fetching https://github.com/luislavena/radix.git
Fetching https://github.com/jeromegn/kilt.git
Fetching https://github.com/crystal-loot/exception_page.git
Using pg (0.18.1)
Using db (0.6.0)
Using sqlite3 (0.13.0)
Using kemal (0.26.0)
Using radix (0.3.9)
Using kilt (0.4.0)
Using exception_page (0.1.2)
Showing last frame. Use --error-trace for full trace.

In src/invidious.cr:20:1

 20 | require "markdown"
      ^
Error: can't find file 'markdown'

If you're trying to require a shard:
- Did you remember to run `shards install`?
- Did you make sure you're running the compiler in the same directory as your shard.yml?
/home/invidious/invidious

✔ Done Rebuilding /home/invidious/invidious 

Expected behavior
Updating my Invidious instance

Device (please complete the following information):

  • Hoster: DigitalOcean
  • OS: Debian Buster
  • Version: 1.3.9

Additional context
Here's the full console output :

$ ~/invidious_update.sh 
➜ Checking for updates...
✔ No update available.


 ╔═══════════════════════════════════════════════════════════════════╗
 ║                        Invidious Update.sh                        ║
 ║               Automatic update script for Invidio.us              ║
 ║                      Maintained by @tmiland                       ║
 ║                          version: 1.3.9                           ║
 ╚═══════════════════════════════════════════════════════════════════╝

Welcome to the Invidious Update.sh script.

What do you want to do?

  1) Install Invidious          5) Run Database Maintenance 
  2) Update Invidious           6) Start, Stop or Restart   
  3) Deploy with Docker         7) Uninstall Invidious      
  4) Install Invidious service  8) Set up PostgreSQL Backup 
  9) Exit                                                   

Services running:
Invidious: ● active PostgreSQL: ● active  

Documentation for this script is available here: 
 ➜ https://github.com/tmiland/Invidious-Updater

Select an option [1-9]: 2

Let's go through some configuration options.

Do you want to checkout Invidious release or master?

   1) release
   2) master

Select an option [1-2]: 2


You entered: 

✔ branch: master


Invidious is ready to be updated, press any key to continue...

➜ Pulling Invidious from GitHub
Updating 45ad212..7aada3f
error: Your local changes to the following files would be overwritten by merge:
	assets/css/default.css
Please commit your changes or stash them before you merge.
Aborting

*** Please tell me who you are.

Run

  git config --global user.email "[email protected]"
  git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: unable to auto-detect email address (got 'root@invidious-debian-Sing2.(none)')
Cannot save the current index state
error: Your local changes to the following files would be overwritten by checkout:
	assets/css/default.css
Please commit your changes or stash them before you switch branches.
Aborting

-- Rebuilding /home/invidious/invidious
Fetching https://github.com/will/crystal-pg.git
Fetching https://github.com/crystal-lang/crystal-db.git
Fetching https://github.com/crystal-lang/crystal-sqlite3.git
Fetching https://github.com/kemalcr/kemal.git
Fetching https://github.com/luislavena/radix.git
Fetching https://github.com/jeromegn/kilt.git
Fetching https://github.com/crystal-loot/exception_page.git
Using pg (0.18.1)
Using db (0.6.0)
Using sqlite3 (0.13.0)
Using kemal (0.26.0)
Using radix (0.3.9)
Using kilt (0.4.0)
Using exception_page (0.1.2)
Fetching https://github.com/will/crystal-pg.git
Fetching https://github.com/crystal-lang/crystal-db.git
Fetching https://github.com/crystal-lang/crystal-sqlite3.git
Fetching https://github.com/kemalcr/kemal.git
Fetching https://github.com/luislavena/radix.git
Fetching https://github.com/jeromegn/kilt.git
Fetching https://github.com/crystal-loot/exception_page.git
Using pg (0.18.1)
Using db (0.6.0)
Using sqlite3 (0.13.0)
Using kemal (0.26.0)
Using radix (0.3.9)
Using kilt (0.4.0)
Using exception_page (0.1.2)
Showing last frame. Use --error-trace for full trace.

In src/invidious.cr:20:1

 20 | require "markdown"
      ^
Error: can't find file 'markdown'

If you're trying to require a shard:
- Did you remember to run `shards install`?
- Did you make sure you're running the compiler in the same directory as your shard.yml?
/home/invidious/invidious

✔ Done Rebuilding /home/invidious/invidious 

-- restarting Invidious
● invidious.service - Invidious (An alternative YouTube front-end)
   Loaded: loaded (/etc/systemd/system/invidious.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2019-10-11 18:02:02 UTC; 2s ago
 Main PID: 3480 (invidious)
    Tasks: 1 (limit: 1167)
   Memory: 12.1M
   CGroup: /system.slice/invidious.service
           └─3480 /home/invidious/invidious/invidious -o invidious.log

Oct 11 18:02:02 invidious-debian-Sing2 systemd[1]: invidious.service: Main process exited, code=killed, status=15/TERM
Oct 11 18:02:02 invidious-debian-Sing2 systemd[1]: invidious.service: Succeeded.
Oct 11 18:02:02 invidious-debian-Sing2 systemd[1]: Stopped Invidious (An alternative YouTube front-end).
Oct 11 18:02:02 invidious-debian-Sing2 systemd[1]: Started Invidious (An alternative YouTube front-end).

redhat-lsb not installing on GCP Centos 7

Attemping to run invidious_update.sh on Centos 7 without redhat-lsb, won't install.

sudo ./invidious_update.sh

✗ Looks like redhat-lsb is not installed!

Do you want to download redhat-lsb? [y/n]? y

➜ Installing redhat-lsb on CentOS Linux release 7.7.1908 (Core)...
✗ Error: could not install redhat-lsb!
✔ Done

✗ Looks like redhat-lsb is not installed!

Do you want to download redhat-lsb? [y/n]? n

./invidious_update.sh: line 177: lsb_release: command not found
./invidious_update.sh: line 177: lsb_release: command not found
./invidious_update.sh: line 194: lsb_release: command not found
./invidious_update.sh: line 210: lsb_release: command not found
✗ Error: Sorry, your OS is not supported.

workaround, install it manually with yum

Script crashes if user tries to "Install Nginx Vhost for Invidious" while Nginx is not installed

Describe the bug
If a user tries to "Install Nginx Vhost for Invidious" while Nginx is not installed on the server, the script will crash without providing any information or error message.

To Reproduce
Steps to reproduce the behaviour:

  1. Ensure Nginx is not installed.
  2. Run invidious-updater.sh and select "9) Install Nginx".
  3. Select "Install Nginx Vhost for Invidious"
  4. The script will crash without an error message.

Expected behavior
The script should warn the user that Nginx is not installed and should go back to the home menu or the "9) Install Nginx" menu.

Support for Arch Linux

Is your feature request related to a problem? Please describe.
I've been wanting to make an unique instance on one of my ends using Arch Linux, and once i figured out that the system wasn't supported in the shell script it was slightly disappointing as it can be used as a beefy server distro (even if it's main targets are client-wise).

Describe the solution you'd like
Add a compatibility layer to pacman and parse the OS information using /etc/os_release instead. There is an Required Packages for Arch Linux on the official Invidious README so it should help on the development of such feature.

Describe alternatives you've considered
While i could compile the app by myself using the given instructions on the Invidious' README, I Ended up realizing on how it was not going to be that worth it as it's very difficult to keep up with the updates without something like a tool. That's where i found out this branch and tried it myself, only to realize that such compatibility wasn't even around.

Additional context
image

the script crash when running installation on a machine with less than 2GB of ram

Describe the bug
I'm trying to install invidious (option 1 in the menu) of invidious-updater on a freshly create virtual machine with Debian 10 on 32bits with 512GB of ram and 2 cores. The installation fails without information about the cause. This is the exact same error message as of bug #25 the submitter didn't state how much ram he's having.

...
Using exception_page (0.1.4)
Writing shard.lock
Showing last frame. Use --error-trace for full trace.

In lib/pg/src/pq/connection.cr:170:20

 170 | rescue e : Errno
                  ^----
Error: Errno is not a subclass of Exception

Expected behavior
I would expect to be notified by the upstream project on how much ram is needed to build the software. I submitted an issue there. iv-org/invidious#1152

I think it would be very nice to warn the user that it's not possible to build the software on a machine with less than 2 GB of ram. That could be somewhere in the menu of options in "red" if the system has less than 2GB of ram. I don't have PR for you on this, I don't know how to make that nice menu you did.

Additional context
Add any other context about the problem here.

I did try to build invidious with 512GB, 750GB, 1300GB without success. I was following this method. https://github.com/omarroth/invidious#setup-invidious

Installation should fail if Crystal does not build or properly install

Describe the bug
The install process fails when installing Invidious on Digital Ocean' Ubuntu 20.04 LTS droplets with Crystal 0.35.1, but the install process report a success.

Two errors are reported:

  • The service is no correctly installed.
  • Invidious seems to fail to build due to a badly typed variable but install process does not stops.

I attached the logs from the server so you can see that the process does not fail when it should.

To Reproduce
Steps to reproduce the behavior:

  1. Create a Digital Ocean droplet of Ubuntu 20.04 LTS (used the 5$ one)
  2. Follow README instruction to retrieve the invidious_updater.sh script and give it execution rights.
  3. Start the script and launch an install with default settings (answer N at the first install question). The script should install Crystal 0.35.1, on which Invidious' master fails to build (only working with Crystal 0.36).
  4. See error

Expected behavior
The script should crash when Invidious fails to build instead of continuing to proceed.

If the service fails to install, an explanation should be given.

Additional context
logs.txt

$(lsb_release -si) are case-sensitive, causing issues

Hi.

I have Linux Mint 20 Cinnamon and I've tried run the script (first install) with and without root, even via su root. I only get Error: Sorry, your OS is not supported..

I looked into the bash script and saw that it checks if $(lsb_release -si) is LinuxMint. If I run lsb_release -si in the terminal, it says Linuxmint (notice the lowercase m) so I changed LinuxMint to Linuxmint and that worked.

Please fix for future events :)

Database name does not match config when upper cased name is used as DB name

Describe the bug
When configuring Invidious' advanced options, it is possible to use an upper-cased database name (ex: Invidious).
However, when the database is created in PG, the name is lower-cased.
The DB installation therefore does not proceed as expected (many errors reporting DB not found) and the config.yml does not have the right DB name, hence blocking Invidious from starting.

To Reproduce
Steps to reproduce the behavior:

  1. Start a fresh install.
  2. Use a name with an upper case character as DB name in advanced configuration (ex: Invidious)
  3. Accept the configuration and proceed with installation.
  4. See errors during install process and during Invidious start.

Expected behavior
The DB name should either match the user name, or the config should use the lower-cased database name.

needs en_US

Hi

Installer cannot configure the database if en_US is absent but continues on anyway with errors. A bit tricky to uninstall / reinstall after generating the locales

Latest update broke manual updating

Describe the bug

Since #37 / 9749a77 manually updating is broken, and the script will just git pull, and nothing else (I had to rebuild manually, since even reverting to the previous commit (git reset 1e3a76eb91cff9d6ebb8e368c48f65030e18d46a) didn't work, since it assumed it was updated):

Select an option [1-10]: 2

remote: Enumerating objects: 20, done.
remote: Counting objects: 100% (20/20), done.
remote: Compressing objects: 100% (7/7), done.
remote: Total 20 (delta 13), reused 18 (delta 13), pack-reused 0
Unpacking objects: 100% (20/20), 4.46 KiB | 652.00 KiB/s, done.
From https://github.com/omarroth/invidious
   1380058..c7c732e  master     -> origin/master
Updating 1380058..c7c732e
Fast-forward
 assets/css/default.css                   |  16 +++++++++---
 src/invidious.cr                         | 253 +++----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 src/invidious/routes/user_preferences.cr | 251 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 266 insertions(+), 254 deletions(-)
 create mode 100644 src/invidious/routes/user_preferences.cr
No local changes to save
Branch 'master' set up to track remote branch 'master' from 'origin'.
Reset branch 'master'
Your branch is up to date with 'origin/master'.
not up to date, Pulling Invidious from GitHub
Select an option [1-10]: 2

Invidious is already up to date...
  • OS: Arch

Deploy with Docker doesn't work on Ubuntu 18.04

Hi there,

I'm trying to install Invidious with your script on my Ubuntu 18.04 machine.
I've chosen option 3) to deploy it with Docker. However, this doesn't work correctly.

After a while, your script runs into an error:
https://pastebin.com/raw/ARK3dUpd

Maybe you can do something with this information. I'm unsure what to do next. I'd appreciate it if you'd find a solution. :(

Error when trying to deploy with Docker: x86_64-alpine-linux-musl/bin/ld: cannot find -lyaml

I was trying to install Invidious locally (master branch). OS is Debian 10. I downloaded invidious_update.sh and installed everything. Then "Deploy Invidious with Docker" and "Build and start cluster".

I got the following error:

Step 9/22 : COPY ./.git/ ./.git/
 ---> Using cache
 ---> 6f3f1780d40d
Step 10/22 : RUN crystal build ./src/invidious.cr     --static --warnings all --error-on-warnings     -Dmusl     --link-flags "-lxml2 -llzma"
 ---> Running in c463a791db37
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: cannot find -lyaml (this usually means you need to install the development package for libyaml)
collect2: error: ld returned 1 exit status
Error: execution of command failed with code: 1: `cc "${@}" -o '/invidious/invidious' -lxml2 -llzma -rdynamic -static  /invidious/lib/lsquic/src/lsquic/ext/liblsquic.a -lz -lyaml /usr/lib/libxml2.a /usr/lib/libsqlite3.a -lz -lz /invidious/lib/lsquic/src/lsquic/ext/libssl.a `command -v pkg-config > /dev/null && pkg-config --libs --silence-errors libssl || printf %s '-lssl -lcrypto'` /invidious/lib/lsquic/src/lsquic/ext/liblsquic.a /invidious/lib/lsquic/src/lsquic/ext/libcrypto.a `command -v pkg-config > /dev/null && pkg-config --libs --silence-errors libcrypto || printf %s '-lcrypto'` /usr/lib/libpcre.a /usr/lib/libm.a /usr/lib/libgc.a /usr/lib/libpthread.a /usr/lib/crystal/core/ext/libcrystal.a /usr/lib/libevent.a /usr/lib/librt.a -L/usr/lib -L/usr/local/lib`
ERROR: Service 'invidious' failed to build: The command '/bin/sh -c crystal build ./src/invidious.cr     --static --warnings all --error-on-warnings     -Dmusl     --link-flags "-lxml2 -llzma"' returned a non-zero code: 1

libyaml-dev is definitely installed.

Can you help me, @tmiland ? Thank you.

ERROR: Service 'invidious' failed to build on Centos 7

Welcome to the Invidious Update.sh script.

What do you want to do?

  1. Install Invidious 5) Run Database Maintenance
  2. Update Invidious 6) Start, Stop or Restart
  3. Deploy with Docker 7) Uninstall Invidious
  4. Install Invidious service 8) Set up PostgreSQL Backup
  5. Exit

Docker Status:
Invidious: ▲ stopped PostgreSQL: ▲ stopped

Documentation for this script is available here:
https://github.com/tmiland/Invidious-Updater

Select an option [1-9]: 3

╔═══════════════════════════════════════════════════════════════════╗
║ Invidious Update.sh ║
║ Automatic update script for Invidio.us ║
║ Maintained by @tmiland
║ version: 1.4.1 ║
╚═══════════════════════════════════════════════════════════════════╝

Deploy Invidious with Docker.

What do you want to do?

  1. Build and start cluster
  2. Start, Stop or Restart cluster
  3. Rebuild cluster
  4. Delete data and rebuild
  5. Install Docker CE

Select an option [1-5]: 1
Build and start cluster? [y/n]: y
Creating network "invidious_default" with the default driver
Creating volume "invidious_postgresdata" with default driver
Building postgres
Step 1/6 : FROM postgres:10
10: Pulling from library/postgres
80369df48736: Pull complete
b18dd0a6efec: Pull complete
5c20c5b8227d: Pull complete
c5a7f905c8ec: Pull complete
5a3f55930dd8: Pull complete
ffc097878b09: Pull complete
3106d02490d4: Pull complete
88d1fc513b8f: Pull complete
f19250dffc5e: Pull complete
756351b7a443: Pull complete
0d24b08575ba: Pull complete
31babd3be108: Pull complete
16f2724dc303: Pull complete
69802daaa561: Pull complete
Digest: sha256:3263c8dad1b5aa6be80144786b18515910165ed771863d686c8b8fda30fea1ad
Status: Downloaded newer image for postgres:10
---> 9a05a2b9e69f
Step 2/6 : ENV POSTGRES_USER postgres
---> Running in 9becec36d96a
Removing intermediate container 9becec36d96a
---> 0a575e71e917
Step 3/6 : ADD ./config/sql /config/sql
---> 3c3a06301266
Step 4/6 : ADD ./docker/entrypoint.postgres.sh /entrypoint.sh
---> 0e8f0fb1779e
Step 5/6 : ENTRYPOINT [ "/entrypoint.sh" ]
---> Running in 0081a465be2a
Removing intermediate container 0081a465be2a
---> f030860964cb
Step 6/6 : CMD [ "postgres" ]
---> Running in ddab400ac4db
Removing intermediate container ddab400ac4db
---> b3ac904397d4
Successfully built b3ac904397d4
Successfully tagged invidious_postgres:latest
WARNING: Image for service postgres was built because it did not already exist. To rebuild this image you must use docker-compose build or docker-compose up --build.
Building invidious
Step 1/20 : FROM alpine:edge AS builder
edge: Pulling from library/alpine
8c15e203d0eb: Pull complete
Digest: sha256:2f0fcd44f200bb1c0ddaed7370f042e66df1b7106c081285ad894e2fb9ba5bd2
Status: Downloaded newer image for alpine:edge
---> 60d63d8e1431
Step 2/20 : RUN apk add --no-cache crystal shards libc-dev yaml-dev libxml2-dev sqlite-dev zlib-dev openssl-dev sqlite-static zlib-static openssl-libs-static
---> Running in 0434ffd68c7a
fetch http://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz
(1/57) Installing gc (8.0.4-r0)
(2/57) Installing libgcc (9.2.0-r2)
(3/57) Installing libstdc++ (9.2.0-r2)
(4/57) Installing libgc++ (8.0.4-r0)
(5/57) Installing pkgconf (1.6.3-r0)
(6/57) Installing gc-dev (8.0.4-r0)
(7/57) Installing libatomic_ops (7.6.10-r1)
(8/57) Installing libbz2 (1.0.8-r1)
(9/57) Installing expat (2.2.9-r0)
(10/57) Installing libffi (3.2.1-r6)
(11/57) Installing gdbm (1.13-r1)
(12/57) Installing xz-libs (5.2.4-r0)
(13/57) Installing ncurses-terminfo-base (6.1_p20191019-r0)
(14/57) Installing ncurses-terminfo (6.1_p20191019-r0)
(15/57) Installing ncurses-libs (6.1_p20191019-r0)
(16/57) Installing readline (8.0.1-r0)
(17/57) Installing sqlite-libs (3.30.1-r0)
(18/57) Installing python3 (3.8.0-r0)
(19/57) Installing libevent (2.1.11-r0)
(20/57) Installing libevent-dev (2.1.11-r0)
(21/57) Installing libevent-static (2.1.11-r0)
(22/57) Installing binutils (2.33.1-r0)
(23/57) Installing gmp (6.1.2-r1)
(24/57) Installing isl (0.18-r0)
(25/57) Installing libgomp (9.2.0-r2)
(26/57) Installing libatomic (9.2.0-r2)
(27/57) Installing mpfr4 (4.0.2-r1)
(28/57) Installing mpc1 (1.1.0-r1)
(29/57) Installing gcc (9.2.0-r2)
(30/57) Installing libgmpxx (6.1.2-r1)
(31/57) Installing gmp-dev (6.1.2-r1)
(32/57) Installing libpcre16 (8.43-r0)
(33/57) Installing libpcre32 (8.43-r0)
(34/57) Installing pcre (8.43-r0)
(35/57) Installing libpcrecpp (8.43-r0)
(36/57) Installing pcre-dev (8.43-r0)
(37/57) Installing llvm5-libs (5.0.2-r2)
(38/57) Installing crystal (0.31.1-r1)
(39/57) Installing musl-dev (1.1.24-r0)
(40/57) Installing libc-dev (0.7.1-r0)
(41/57) Installing zlib-dev (1.2.11-r3)
(42/57) Installing xz-dev (5.2.4-r0)
(43/57) Installing libxml2 (2.9.10-r0)
(44/57) Installing libxml2-dev (2.9.10-r0)
(45/57) Installing openssl-dev (1.1.1d-r2)
(46/57) Installing openssl-libs-static (1.1.1d-r2)
(47/57) Installing ca-certificates (20190108-r0)
(48/57) Installing nghttp2-libs (1.39.2-r2)
(49/57) Installing libcurl (7.67.0-r0)
(50/57) Installing pcre2 (10.33-r0)
(51/57) Installing git (2.24.0-r0)
(52/57) Installing yaml (0.2.2-r1)
(53/57) Installing shards (0.9.0-r1)
(54/57) Installing sqlite-dev (3.30.1-r0)
(55/57) Installing sqlite-static (3.30.1-r0)
(56/57) Installing yaml-dev (0.2.2-r1)
(57/57) Installing zlib-static (1.2.11-r3)
Executing busybox-1.31.1-r0.trigger
Executing ca-certificates-20190108-r0.trigger
OK: 290 MiB in 71 packages
Removing intermediate container 0434ffd68c7a
---> f7c8752a1751
Step 3/20 : WORKDIR /invidious
---> Running in 2ff490f1e27f
Removing intermediate container 2ff490f1e27f
---> 0a746fab55ea
Step 4/20 : COPY ./shard.yml ./shard.yml
---> c99ce4c8b1f8
Step 5/20 : RUN shards update && shards install
---> Running in fcbbf72ca8cc
Resolving dependencies
Fetching https://github.com/will/crystal-pg.git
Fetching https://github.com/crystal-lang/crystal-db.git
Fetching https://github.com/crystal-lang/crystal-sqlite3.git
Fetching https://github.com/kemalcr/kemal.git
Fetching https://github.com/luislavena/radix.git
Fetching https://github.com/jeromegn/kilt.git
Fetching https://github.com/crystal-loot/exception_page.git
Fetching https://github.com/ysbaddaden/pool.git
Fetching https://github.com/omarroth/protodec.git
Installing pg (0.19.0)
Installing sqlite3 (0.14.0)
Installing kemal (0.26.0)
Installing pool (0.2.3)
Installing protodec (0.1.2)
Installing radix (0.3.9)
Installing exception_page (0.1.2)
Installing db (0.7.0)
Installing kilt (0.4.0)
Writing shard.lock
Resolving dependencies
Fetching https://github.com/will/crystal-pg.git
Fetching https://github.com/crystal-lang/crystal-db.git
Fetching https://github.com/crystal-lang/crystal-sqlite3.git
Fetching https://github.com/kemalcr/kemal.git
Fetching https://github.com/luislavena/radix.git
Fetching https://github.com/jeromegn/kilt.git
Fetching https://github.com/crystal-loot/exception_page.git
Fetching https://github.com/ysbaddaden/pool.git
Fetching https://github.com/omarroth/protodec.git
Using pg (0.19.0)
Using sqlite3 (0.14.0)
Using kemal (0.26.0)
Using pool (0.2.3)
Using protodec (0.1.2)
Using radix (0.3.9)
Using exception_page (0.1.2)
Using db (0.7.0)
Using kilt (0.4.0)
Writing shard.lock
Removing intermediate container fcbbf72ca8cc
---> cdd5e8ca18aa
Step 6/20 : COPY ./src/ ./src/
---> a417c5d674fd
Step 7/20 : COPY ./.git/ ./.git/
---> ddb90d52ef04
Step 8/20 : RUN crystal build --static --release --warnings all --error-on-warnings -Dmusl ./src/invidious.cr
---> Running in 14b8d6e40d48

Invalid memory access (signal 11) at address 0x7f715c4428f8
[0x56050030fa36] ???
[0x56050025e7f9] __crystal_sigfault_handler +457
[0x7f7188b1528f] ???
ERROR: Service 'invidious' failed to build: The command '/bin/sh -c crystal build --static --release --warnings all --error-on-warnings -Dmusl ./src/invidious.cr' returned a non-zero code: 11
✔ Deployment done.

Permit to update through cron

Updating through a crontab is not currently possible as the script depends on the prompt interaction from a human.

It would be ideal to run something like ./inviduous-updater.sh --option=update without a prompt so that it can be called from a cron task.

Let's Encrypt integration if domain is configured

Is your feature request related to a problem? Please describe.
Issuing Let's Encrypt certificates is easy and certbot (or alternative tools) are widely available to automatically sign certificates.

it would be nice if certificates could be issued using Invidious Updater (the script would call certbot as it does with Nginx auto installer), and if the certificate were installed automatically, either by configuring Invidious directly, or using the VHost (which already uses Let's Encrypt certificate in its default configuration).

Describe the solution you'd like
During the install process, if a domain is provided, the user should have the possibility to install a certificate for the domain.

If the user decides to install Nginx Vhost, the configuration set in Invidious should be updated to transfer the certificate handling to Nginx (remove SSL configuration ? I am not knowledgeable enough to be sure about this).

Describe alternatives you've considered
Installing the certificate manually might be a bit confusing for new users or people without high tech skills.

failed to expand heap by 16777216 bytes

useing sqlite3
GC warning: failed to expand heap by 16777216 bytes
GC warning: failed to expand heap by 16777216 bytes
GC warning: failed to expand heap by 16777216 bytes
GC warning: failed to expand heap by 16777216 bytes

installation failed

debian9
How to solve this problem?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.