More fixes (#3587)

This commit is contained in:
Slaviša Arežina 2025-04-02 07:19:50 +02:00 committed by GitHub
parent e7b1cf46d6
commit ea9f19d5f4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 105 additions and 108 deletions

View File

@ -20,52 +20,52 @@ color
catch_errors
function update_script() {
header_info
check_container_storage
check_container_resources
header_info
check_container_storage
check_container_resources
if [[ ! -d /opt/actualbudget ]]; then
msg_error "No ${APP} Installation Found!"
exit
if [[ ! -d /opt/actualbudget ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
RELEASE=$(curl -fsSL https://api.github.com/repos/actualbudget/actual/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
if [[ ! -f /opt/actualbudget_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/actualbudget_version.txt)" ]]; then
msg_info "Stopping ${APP}"
systemctl stop actualbudget
msg_ok "${APP} Stopped"
msg_info "Updating ${APP} to ${RELEASE}"
cd /tmp || exit
curl -fsSL "https://github.com/actualbudget/actual/archive/refs/tags/v${RELEASE}.tar.gz" -o "v${RELEASE}.tar.gz"
mv /opt/actualbudget /opt/actualbudget_bak
tar -xzf "v${RELEASE}.tar.gz"
mv "actual-${RELEASE}" /opt/actualbudget
mkdir -p /opt/actualbudget-data/{server-files,upload,migrate,user-files,migrations,config}
for dir in server-files .migrate user-files migrations; do
if [[ -d /opt/actualbudget_bak/$dir ]]; then
mv /opt/actualbudget_bak/$dir/* /opt/actualbudget-data/$dir/ || true
fi
done
if [[ -f /opt/actualbudget-data/migrate/.migrations ]]; then
sed -i 's/null/1732656575219/g' /opt/actualbudget-data/migrate/.migrations
sed -i 's/null/1732656575220/g' /opt/actualbudget-data/migrate/.migrations
fi
if [[ -f /opt/actualbudget/server-files/account.sqlite ]] && [[ ! -f /opt/actualbudget-data/server-files/account.sqlite ]]; then
mv /opt/actualbudget/server-files/account.sqlite /opt/actualbudget-data/server-files/account.sqlite
fi
RELEASE=$(curl -fsSL https://api.github.com/repos/actualbudget/actual/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
if [[ ! -f /opt/actualbudget_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/actualbudget_version.txt)" ]]; then
msg_info "Stopping ${APP}"
systemctl stop actualbudget
msg_ok "${APP} Stopped"
if [[ -f /opt/actualbudget_bak/selfhost.key ]]; then
mv /opt/actualbudget_bak/selfhost.key /opt/actualbudget/selfhost.key
mv /opt/actualbudget_bak/selfhost.crt /opt/actualbudget/selfhost.crt
fi
msg_info "Updating ${APP} to ${RELEASE}"
cd /tmp
curl -fsSL -O https://github.com/actualbudget/actual/archive/refs/tags/v${RELEASE}.tar.gz
mv /opt/actualbudget /opt/actualbudget_bak
tar -xzf "v${RELEASE}.tar.gz"
mv actual-${RELEASE} /opt/actualbudget
mkdir -p /opt/actualbudget-data/{server-files,upload,migrate,user-files,migrations,config}
for dir in server-files .migrate user-files migrations; do
if [[ -d /opt/actualbudget_bak/$dir ]]; then
mv /opt/actualbudget_bak/$dir/* /opt/actualbudget-data/$dir/ || true
fi
done
if [[ -f /opt/actualbudget-data/migrate/.migrations ]]; then
sed -i 's/null/1732656575219/g' /opt/actualbudget-data/migrate/.migrations
sed -i 's/null/1732656575220/g' /opt/actualbudget-data/migrate/.migrations
fi
if [[ -f /opt/actualbudget/server-files/account.sqlite ]] && [[ ! -f /opt/actualbudget-data/server-files/account.sqlite ]]; then
mv /opt/actualbudget/server-files/account.sqlite /opt/actualbudget-data/server-files/account.sqlite
fi
if [[ -f /opt/actualbudget_bak/selfhost.key ]]; then
mv /opt/actualbudget_bak/selfhost.key /opt/actualbudget/selfhost.key
mv /opt/actualbudget_bak/selfhost.crt /opt/actualbudget/selfhost.crt
fi
if [[ -f /opt/actualbudget_bak/.env ]]; then
mv /opt/actualbudget_bak/.env /opt/actualbudget-data/.env
else
cat <<EOF >/opt/actualbudget-data/.env
if [[ -f /opt/actualbudget_bak/.env ]]; then
mv /opt/actualbudget_bak/.env /opt/actualbudget-data/.env
else
cat <<EOF >/opt/actualbudget-data/.env
ACTUAL_UPLOAD_DIR=/opt/actualbudget-data/upload
ACTUAL_DATA_DIR=/opt/actualbudget-data
ACTUAL_SERVER_FILES_DIR=/opt/actualbudget-data/server-files
@ -75,14 +75,14 @@ ACTUAL_TRUSTED_PROXIES="10.0.0.0/8,172.16.0.0/12,192.168.0.0/16,127.0.0.1/32,::1
ACTUAL_HTTPS_KEY=/opt/actualbudget/selfhost.key
ACTUAL_HTTPS_CERT=/opt/actualbudget/selfhost.crt
EOF
fi
cd /opt/actualbudget
$STD yarn workspaces focus @actual-app/sync-server --production
echo "${RELEASE}" >/opt/actualbudget_version.txt
msg_ok "Updated ${APP}"
fi
cd /opt/actualbudget || exit
$STD yarn workspaces focus @actual-app/sync-server --production
echo "${RELEASE}" >/opt/actualbudget_version.txt
msg_ok "Updated ${APP}"
msg_info "Starting ${APP}"
cat <<EOF >/etc/systemd/system/actualbudget.service
msg_info "Starting ${APP}"
cat <<EOF >/etc/systemd/system/actualbudget.service
[Unit]
Description=Actual Budget Service
After=network.target
@ -101,19 +101,19 @@ RestartSec=10
WantedBy=multi-user.target
EOF
systemctl daemon-reload
systemctl start actualbudget
msg_ok "Started ${APP}"
systemctl daemon-reload
systemctl start actualbudget
msg_ok "Started ${APP}"
msg_info "Cleaning Up"
rm -rf /opt/actualbudget_bak
rm -rf "/tmp/v${RELEASE}.tar.gz"
msg_ok "Cleaned"
msg_ok "Updated Successfully"
else
msg_ok "No update required. ${APP} is already at ${RELEASE}"
fi
exit
msg_info "Cleaning Up"
rm -rf /opt/actualbudget_bak
rm -rf "/tmp/v${RELEASE}.tar.gz"
msg_ok "Cleaned"
msg_ok "Updated Successfully"
else
msg_ok "No update required. ${APP} is already at ${RELEASE}"
fi
exit
}
start
@ -123,4 +123,4 @@ description
msg_ok "Completed Successfully!\n"
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
echo -e "${TAB}${GATEWAY}${BGN}https://${IP}:5006${CL}"
echo -e "${TAB}${GATEWAY}${BGN}https://${IP}:5006${CL}"

View File

@ -20,29 +20,29 @@ color
catch_errors
function update_script() {
header_info
check_container_storage
check_container_resources
if [[ ! -d /opt/emby-server ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
LATEST=$(curl -fsSL https://api.github.com/repos/MediaBrowser/Emby.Releases/releases/latest | grep '"tag_name":' | cut -d'"' -f4)
msg_info "Stopping ${APP}"
systemctl stop emby-server
msg_ok "Stopped ${APP}"
msg_info "Updating ${APP}"
$STD curl -fsSL "https://github.com/MediaBrowser/Emby.Releases/releases/download/${LATEST}/emby-server-deb_${LATEST}_amd64.deb" -O
$STD dpkg -i emby-server-deb_${LATEST}_amd64.deb
rm emby-server-deb_${LATEST}_amd64.deb
msg_ok "Updated ${APP}"
msg_info "Starting ${APP}"
systemctl start emby-server
msg_ok "Started ${APP}"
msg_ok "Updated Successfully"
header_info
check_container_storage
check_container_resources
if [[ ! -d /opt/emby-server ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
LATEST=$(curl -fsSL https://api.github.com/repos/MediaBrowser/Emby.Releases/releases/latest | grep '"tag_name":' | cut -d'"' -f4)
msg_info "Stopping ${APP}"
systemctl stop emby-server
msg_ok "Stopped ${APP}"
msg_info "Updating ${APP}"
$STD curl -fsSL "https://github.com/MediaBrowser/Emby.Releases/releases/download/${LATEST}/emby-server-deb_${LATEST}_amd64.deb" -o "emby-server-deb_${LATEST}_amd64.deb"
$STD dpkg -i "emby-server-deb_${LATEST}_amd64.deb"
rm "emby-server-deb_${LATEST}_amd64.deb"
msg_ok "Updated ${APP}"
msg_info "Starting ${APP}"
systemctl start emby-server
msg_ok "Started ${APP}"
msg_ok "Updated Successfully"
exit
}
start

View File

@ -39,15 +39,12 @@ function update_script() {
mv /opt/snipe-it /opt/snipe-it-backup
temp_file=$(mktemp)
curl -fsSL "https://github.com/snipe/snipe-it/archive/refs/tags/v${RELEASE}.tar.gz" -o "$temp_file"
tar zxf $temp_file
mv snipe-it-${RELEASE} /opt/snipe-it
$STD curl -fsSL "https://github.com/snipe/snipe-it/archive/refs/tags/v${RELEASE}.zip" -O
unzip -q v${RELEASE}.zip
mv snipe-it-${RELEASE} /opt/snipe-it
tar zxf "$temp_file"
mv "snipe-it-${RELEASE}" /opt/snipe-it
cp /opt/snipe-it-backup/.env /opt/snipe-it/.env
cp -r /opt/snipe-it-backup/public/uploads/ /opt/snipe-it/public/uploads/
cp -r /opt/snipe-it-backup/storage/private_uploads /opt/snipe-it/storage/private_uploads
cd /opt/snipe-it/
cd /opt/snipe-it/ || exit
export COMPOSER_ALLOW_SUPERUSER=1
$STD composer install --no-dev --optimize-autoloader --no-interaction
$STD composer dump-autoload
@ -58,7 +55,7 @@ function update_script() {
$STD php artisan view:clear
chown -R www-data: /opt/snipe-it
chmod -R 755 /opt/snipe-it
rm -rf /opt/v${RELEASE}.zip
rm -rf "$temp_file"
rm -rf /opt/snipe-it-backup
msg_ok "Updated ${APP}"

View File

@ -18,7 +18,7 @@ $STD apt-get install -y g++-multilib
msg_ok "Installed Dependencies"
msg_info "Installing Daemon Sync Server"
curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/raw/main/misc/daemonsync_2.2.0.0059_amd64.deb -O "daemonsync_2.2.0.0059_amd64.deb"
curl -fsSL "https://raw.githubusercontent.com/community-scripts/ProxmoxVE/raw/main/misc/daemonsync_2.2.0.0059_amd64.deb" -o "daemonsync_2.2.0.0059_amd64.deb"
$STD dpkg -i daemonsync_2.2.0.0059_amd64.deb
msg_ok "Installed Daemon Sync Server"

View File

@ -15,14 +15,14 @@ update_os
msg_info "Setting Phoscon Repository"
VERSION="$(awk -F'=' '/^VERSION_CODENAME=/{ print $NF }' /etc/os-release)"
curl -fsSL http://phoscon.de/apt/deconz.pub.key >/etc/apt/trusted.gpg.d/deconz.pub.asc
curl -fsSL "http://phoscon.de/apt/deconz.pub.key" >/etc/apt/trusted.gpg.d/deconz.pub.asc
echo "deb [arch=amd64] http://phoscon.de/apt/deconz $VERSION main" >/etc/apt/sources.list.d/deconz.list
msg_ok "Setup Phoscon Repository"
msg_info "Installing deConz"
libssl=$(curl -fsSL "http://security.ubuntu.com/ubuntu/pool/main/o/openssl/" | grep -o 'libssl1\.1_1\.1\.1f-1ubuntu2\.2[^"]*amd64\.deb' | head -n1)
curl -fsSL "http://security.ubuntu.com/ubuntu/pool/main/o/openssl/$libssl" -O
$STD dpkg -i $libssl
curl -fsSL "http://security.ubuntu.com/ubuntu/pool/main/o/openssl/$libssl" -o "$libssl"
$STD dpkg -i "$libssl"
$STD apt-get update
$STD apt-get install -y deconz
msg_ok "Installed deConz"
@ -51,7 +51,7 @@ motd_ssh
customize
msg_info "Cleaning up"
rm -rf $libssl
rm -rf "$libssl"
$STD apt-get -y autoremove
$STD apt-get -y autoclean
msg_ok "Cleaned"

View File

@ -58,10 +58,10 @@ $STD apt-get install -y \
tesseract-ocr \
tesseract-ocr-eng
cd /tmp
cd /tmp || exit
curl -fsSL "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs10040/ghostscript-10.04.0.tar.gz" -o $(basename "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs10040/ghostscript-10.04.0.tar.gz")
$STD tar -xzf ghostscript-10.04.0.tar.gz
cd ghostscript-10.04.0
cd ghostscript-10.04.0 || exit
$STD ./configure
$STD make
$STD sudo make install
@ -69,7 +69,7 @@ msg_ok "Installed OCR Dependencies"
msg_info "Installing JBIG2"
$STD git clone https://github.com/ie13/jbig2enc /opt/jbig2enc
cd /opt/jbig2enc
cd /opt/jbig2enc || exit
$STD bash ./autogen.sh
$STD bash ./configure
$STD make
@ -78,23 +78,23 @@ rm -rf /opt/jbig2enc
msg_ok "Installed JBIG2"
msg_info "Installing Paperless-ngx (Patience)"
Paperlessngx=$(curl -fsSL https://github.com/paperless-ngx/paperless-ngx/releases/latest | grep "title>Release" | cut -d " " -f 5)
cd /opt
$STD curl -fsSL "https://github.com/paperless-ngx/paperless-ngx/releases/download/$Paperlessngx/paperless-ngx-$Paperlessngx.tar.xz" -O
$STD tar -xf paperless-ngx-$Paperlessngx.tar.xz -C /opt/
Paperlessngx=$(curl -fsSL "https://github.com/paperless-ngx/paperless-ngx/releases/latest" | grep "title>Release" | cut -d " " -f 5)
cd /opt || exit
$STD curl -fsSL "https://github.com/paperless-ngx/paperless-ngx/releases/download/$Paperlessngx/paperless-ngx-$Paperlessngx.tar.xz" -o "paperless-ngx-$Paperlessngx.tar.xz"
$STD tar -xf "paperless-ngx-$Paperlessngx.tar.xz" -C /opt/
mv paperless-ngx paperless
rm paperless-ngx-$Paperlessngx.tar.xz
cd /opt/paperless
rm "paperless-ngx-$Paperlessngx.tar.xz"
cd /opt/paperless || exit
$STD pip install --upgrade pip
$STD pip install -r requirements.txt
curl -fsSL -o /opt/paperless/paperless.conf https://raw.githubusercontent.com/paperless-ngx/paperless-ngx/main/paperless.conf.example
curl -fsSL "https://raw.githubusercontent.com/paperless-ngx/paperless-ngx/main/paperless.conf.example" -o /opt/paperless/paperless.conf
mkdir -p {consume,data,media,static}
sed -i -e 's|#PAPERLESS_REDIS=redis://localhost:6379|PAPERLESS_REDIS=redis://localhost:6379|' /opt/paperless/paperless.conf
sed -i -e "s|#PAPERLESS_CONSUMPTION_DIR=../consume|PAPERLESS_CONSUMPTION_DIR=/opt/paperless/consume|" /opt/paperless/paperless.conf
sed -i -e "s|#PAPERLESS_DATA_DIR=../data|PAPERLESS_DATA_DIR=/opt/paperless/data|" /opt/paperless/paperless.conf
sed -i -e "s|#PAPERLESS_MEDIA_ROOT=../media|PAPERLESS_MEDIA_ROOT=/opt/paperless/media|" /opt/paperless/paperless.conf
sed -i -e "s|#PAPERLESS_STATICDIR=../static|PAPERLESS_STATICDIR=/opt/paperless/static|" /opt/paperless/paperless.conf
echo "${Paperlessngx}" >/opt/${APPLICATION}_version.txt
echo "${Paperlessngx}" >/opt/"${APPLICATION}"_version.txt
msg_ok "Installed Paperless-ngx"
msg_info "Installing Natural Language Toolkit (Patience)"
@ -121,7 +121,7 @@ sed -i -e "s|#PAPERLESS_DBNAME=paperless|PAPERLESS_DBNAME=$DB_NAME|" /opt/paperl
sed -i -e "s|#PAPERLESS_DBUSER=paperless|PAPERLESS_DBUSER=$DB_USER|" /opt/paperless/paperless.conf
sed -i -e "s|#PAPERLESS_DBPASS=paperless|PAPERLESS_DBPASS=$DB_PASS|" /opt/paperless/paperless.conf
sed -i -e "s|#PAPERLESS_SECRET_KEY=change-me|PAPERLESS_SECRET_KEY=$SECRET_KEY|" /opt/paperless/paperless.conf
cd /opt/paperless/src
cd /opt/paperless/src || exit
$STD python3 manage.py migrate
msg_ok "Set up PostgreSQL database"