Our #Sharkey one-stop #upgrade script worked beautifully, and just finished using it to upgrade Sharkey here on bofh.social!
Fediverse
2
Posts
1
Posters
4
Views
-
Our #Sharkey one-stop #upgrade script worked beautifully, and just finished using it to upgrade Sharkey here on bofh.social! #SharkeyAdmin
#!/bin/bash set -e # Exit immediately if a command exits with a non-zero status set -u # Treat unset variables as an error echo "Stopping Sharkey and Redis services..." systemctl stop sharkey systemctl stop redis # Optional: Update NodeJS (uncomment if needed) # -------------------------------------------- # echo "Updating NodeJS..." # apt remove -y nodejs # curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash - # apt install -y nodejs # apt install -y libpango1.0-dev libcairo2-dev libpixman-1-dev echo "Updating Sharkey codebase..." sudo -u sharkey bash <<'EOF' cd ~/Sharkey git checkout stable git stash git pull --recurse-submodules pnpm clean-all # corepack enable && corepack prepare [email protected] --activate # Optional if using corepack pnpm install --frozen-lockfile pnpm run build pnpm run migrate EOF echo "Restarting services..." systemctl start redis systemctl start sharkey echo "✅ Sharkey update complete."
-
Our #Sharkey one-stop #upgrade script worked beautifully, and just finished using it to upgrade Sharkey here on bofh.social! #SharkeyAdmin
#!/bin/bash set -e # Exit immediately if a command exits with a non-zero status set -u # Treat unset variables as an error echo "Stopping Sharkey and Redis services..." systemctl stop sharkey systemctl stop redis # Optional: Update NodeJS (uncomment if needed) # -------------------------------------------- # echo "Updating NodeJS..." # apt remove -y nodejs # curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash - # apt install -y nodejs # apt install -y libpango1.0-dev libcairo2-dev libpixman-1-dev echo "Updating Sharkey codebase..." sudo -u sharkey bash <<'EOF' cd ~/Sharkey git checkout stable git stash git pull --recurse-submodules pnpm clean-all # corepack enable && corepack prepare [email protected] --activate # Optional if using corepack pnpm install --frozen-lockfile pnpm run build pnpm run migrate EOF echo "Restarting services..." systemctl start redis systemctl start sharkey echo "✅ Sharkey update complete."
Heads up #Sharkey #admins when #upgrading...
If you have a lot of #data in your #instance #database, runningpnpm run migrate
might fail because one or more of theALTER TABLE...
statements might actually timeout on your #PostgreSQL server!
To fix this, attach yourself to yoursharkey
database and enter the following...
...and try theALTER DATABASE sharkey SET statement_timeout = '10min'; ALTER ROLE sharkey SET statement_timeout = '10min';
pnpm run migrate
command again.
#SharkeyAdmin #InstanceAdmin @[email protected]