diff --git a/SELFHOST.md b/SELFHOST.md index 5eb46239..2e3fb28b 100644 --- a/SELFHOST.md +++ b/SELFHOST.md @@ -4,7 +4,7 @@ Craig can be installed and ran locally. Some use cases for this are: - Creating multiple instances of Craig ## Pre-requisites/dependencies -Craig can only be ran on a Linux machine. The installation has been tested on a fresh install of **Ubuntu 22.04**. +Craig can only be ran on a Linux machine. The installation has been tested on a fresh install of **Ubuntu 22.04** and **Kubuntu 23.10**. The following `apt` packages will be automatically installed by the install script [install.sh](install.sh): @@ -129,6 +129,31 @@ Most if not all browsers won't serve this because `localhost` doesn't have a sig http://localhost:5029/rec/RECORDING_ID +### Error that Redis package is not signed + +When testing with Kubuntu 23.10, the following error stops `sudo apt update` from working, which prematurely exits the install script: + +``` +E: Failed to fetch https://packages.redis.io/deb/dists/mantic/InRelease 403 Forbidden [IP: 18.173.121.98 443] +E: The repository 'https://packages.redis.io/deb mantic InRelease' is not signed. +``` + +This occurs because Redis does not have a signature for the Kubuntu 23.10 release (Mantic). + +A workaround is to comment out the first line in `/etc/apt/sources.list.d/redis.list`, i.e.: + +```sh +#deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb mantic main +``` + +To avoid having to continually comment this out every time the install script is ran, you can add the `#` directly in [install.sh](install.sh): + +```sh +echo "#deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list +``` + +This might need to be done for other distributions as well. + ### Restarting Craig after reboot By default, Craig will not automatically restart if you reboot your computer. You can re-run a modified version of [install.sh](install.sh) script so that the following steps are performed: diff --git a/install.config.example b/install.config.example index 0e3f3994..6d7a47cd 100644 --- a/install.config.example +++ b/install.config.example @@ -20,6 +20,8 @@ GOOGLE_CLIENT_ID=test GOOGLE_CLIENT_SECRET=test MICROSOFT_CLIENT_ID=test MICROSOFT_CLIENT_SECRET=test +DROPBOX_CLIENT_ID=test +DROPBOX_CLIENT_SECRET=test APP_URI=http://localhost:3000 JWT_SECRET=1234 diff --git a/install.sh b/install.sh index 9faa25f9..1542e3f8 100755 --- a/install.sh +++ b/install.sh @@ -99,7 +99,7 @@ install_apt_packages() { # for more info, see: https://redis.io/docs/install/install-redis/install-redis-on-linux/ curl -fsSL https://packages.redis.io/gpg | sudo gpg --yes --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list - sudo apt-get update + sudo apt-get update || true sudo apt-get -y install redis } @@ -107,7 +107,11 @@ install_node() { # Install and run node (must come before npm install because npm is included with node) # we have to source nvm first otherwise in this non-interactive script it will not be available curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash - source ~/.nvm/nvm.sh + + # There is a version error raised somewhere in "nvm.sh" + # because of set -e at the top of this script, we need to add the || true + source ~/.nvm/nvm.sh || true + nvm install $NODE_VERSION nvm use $NODE_VERSION @@ -123,7 +127,7 @@ start_redis() { # otherwise 'redis-server' will not be found if this function # is ran separately - source ~/.nvm/nvm.sh + source ~/.nvm/nvm.sh || true nvm use $NODE_VERSION # start redis and check if it is running, timeout if it hasn't started @@ -203,6 +207,10 @@ start_postgresql() { fi sudo -u postgres -i psql -c "GRANT ALL PRIVILEGES ON DATABASE $DATABASE_NAME TO $POSTGRESQL_USER;" + sudo -u postgres -i psql -c "GRANT ALL ON SCHEMA public TO $POSTGRESQL_USER;" + sudo -u postgres -i psql -c "GRANT USAGE ON SCHEMA public TO $POSTGRESQL_USER;" + sudo -u postgres -i psql -c "ALTER DATABASE $DATABASE_NAME OWNER TO $POSTGRESQL_USER;" + sudo -u postgres -i psql -c "\l" # unnecessary but just for debugging } @@ -245,6 +253,8 @@ config_env() { "GOOGLE_CLIENT_SECRET" "MICROSOFT_CLIENT_ID" "MICROSOFT_CLIENT_SECRET" + "DROPBOX_CLIENT_ID" + "DROPBOX_CLIENT_SECRET" "APP_URI" "JWT_SECRET" ) @@ -340,7 +350,7 @@ start_app(){ # otherwise 'pm2' will not be found if this function # is ran separately - source ~/.nvm/nvm.sh + source ~/.nvm/nvm.sh || true nvm use $NODE_VERSION info "Starting Craig..."