This commit is contained in:
Slaviša Arežina 2025-10-21 21:50:26 +02:00 committed by GitHub
parent cc4b944b3b
commit 87ae749eba
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 29 deletions

View File

@ -27,31 +27,28 @@ function update_script() {
msg_error "No ${APP} Installation Found!" msg_error "No ${APP} Installation Found!"
exit exit
fi fi
RELEASE=$(curl -fsSL https://api.github.com/repos/projectsend/projectsend/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then if check_for_gh_release "projectsend" "projectsend/projectsend"; then
msg_info "Stopping Service" msg_info "Stopping Service"
systemctl stop apache2 systemctl stop apache2
msg_ok "Stopped Service" msg_ok "Stopped Service"
msg_info "Updating ${APP} to v${RELEASE}" php_ver=$(php -v | head -n 1 | awk '{print $2}')
cd /opt if [[ ! $php_ver == "8.4"* ]]; then
curl -fsSL "https://github.com/projectsend/projectsend/releases/download/r${RELEASE}/projectsend-r${RELEASE}.zip" -o $(basename "https://github.com/projectsend/projectsend/releases/download/r${RELEASE}/projectsend-r${RELEASE}.zip") PHP_VERSION="8.4" PHP_APACHE="YES" PHP_MODULE="pdo,mysql,gettext,fileinfo" setup_php
$STD unzip -o "projectsend-r${RELEASE}.zip" -d projectsend fi
mv /opt/projectsend/includes/sys.config.php /opt/sys.config.php
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "projectsend" "projectsend/projectsend" "prebuild" "latest" "/opt/projectsend" "projectsend-r*.zip"
mv /opt/sys.config.php /opt/projectsend/includes/sys.config.php
chown -R www-data:www-data /opt/projectsend chown -R www-data:www-data /opt/projectsend
chmod -R 775 /opt/projectsend chmod -R 775 /opt/projectsend
echo "${RELEASE}" >/opt/${APP}_version.txt
msg_ok "Updated $APP to v${RELEASE}"
msg_info "Starting Service" msg_info "Starting Service"
systemctl start apache2 systemctl start apache2
msg_ok "Started Service" msg_ok "Started Service"
msg_info "Cleaning up"
rm -rf "/opt/projectsend-r${RELEASE}.zip"
msg_ok "Cleaned"
msg_ok "Updated Successfully" msg_ok "Updated Successfully"
else
msg_ok "No update required. ${APP} is already at v${RELEASE}"
fi fi
exit exit
} }

View File

@ -13,14 +13,9 @@ setting_up_container
network_check network_check
update_os update_os
msg_info "Installing Dependencies" PHP_VERSION="8.4" PHP_APACHE="YES" PHP_MODULE="pdo,mysql,gettext,fileinfo" setup_php
$STD apt install -y \
apache2 \
libapache2-mod-php \
php8.2-{pdo,mysql,mbstring,gettext,fileinfo,gd,xml,zip}
msg_ok "Installed Dependencies"
setup_mariadb setup_mariadb
fetch_and_deploy_gh_release "projectsend" "projectsend/projectsend" "prebuild" "latest" "/opt/projectsend" "projectsend-r*.zip"
msg_info "Setting up MariaDB" msg_info "Setting up MariaDB"
DB_NAME=projectsend DB_NAME=projectsend
@ -37,12 +32,7 @@ $STD mariadb -u root -e "GRANT ALL ON $DB_NAME.* TO '$DB_USER'@'localhost'; FLUS
} >>~/projectsend.creds } >>~/projectsend.creds
msg_ok "Set up MariaDB" msg_ok "Set up MariaDB"
msg_info "Installing projectsend" msg_info "Installing ProjectSend"
RELEASE=$(curl -fsSL https://api.github.com/repos/projectsend/projectsend/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
cd /opt
curl -fsSL "https://github.com/projectsend/projectsend/releases/download/r${RELEASE}/projectsend-r${RELEASE}.zip" -o "projectsend-r${RELEASE}.zip"
mkdir projectsend
$STD unzip "projectsend-r${RELEASE}.zip" -d projectsend
mv /opt/projectsend/includes/sys.config.sample.php /opt/projectsend/includes/sys.config.php mv /opt/projectsend/includes/sys.config.sample.php /opt/projectsend/includes/sys.config.php
chown -R www-data:www-data /opt/projectsend chown -R www-data:www-data /opt/projectsend
chmod -R 775 /opt/projectsend chmod -R 775 /opt/projectsend
@ -55,8 +45,7 @@ sed -i -e "s/^\(memory_limit = \).*/\1 256M/" \
-e "s/^\(post_max_size = \).*/\1 256M/" \ -e "s/^\(post_max_size = \).*/\1 256M/" \
-e "s/^\(upload_max_filesize = \).*/\1 256M/" \ -e "s/^\(upload_max_filesize = \).*/\1 256M/" \
-e "s/^\(max_execution_time = \).*/\1 300/" \ -e "s/^\(max_execution_time = \).*/\1 300/" \
/etc/php/8.2/apache2/php.ini /etc/php/8.4/apache2/php.ini
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
msg_ok "Installed projectsend" msg_ok "Installed projectsend"
msg_info "Creating Service" msg_info "Creating Service"
@ -84,7 +73,6 @@ motd_ssh
customize customize
msg_info "Cleaning up" msg_info "Cleaning up"
rm -rf "/opt/projectsend-r${RELEASE}.zip"
$STD apt -y autoremove $STD apt -y autoremove
$STD apt -y autoclean $STD apt -y autoclean
$STD apt -y clean $STD apt -y clean