mirror of
https://github.com/YunoHost-Apps/wekan_ynh.git
synced 2024-09-03 20:36:09 +02:00
Upgrade to 6.27.1~ynh1
This commit is contained in:
parent
b74bbb4b5c
commit
fd1ada509b
13 changed files with 42 additions and 131 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1,3 +0,0 @@
|
||||||
*.swp
|
|
||||||
*.swo
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
SOURCE_URL=https://github.com/wekan/wekan/releases/download/v6.27/wekan-6.27-amd64.zip
|
SOURCE_URL=https://github.com/wekan/wekan/releases/download/v6.26/wekan-6.26-amd64.zip
|
||||||
SOURCE_SUM=2447075b30d3283cec39b531359b8cba5a815b57b37e60b6d9c6a97026ef8687
|
SOURCE_SUM=3e83de1fe5a77db6f7ec6a3f9b2a7ea401dbbc4fd57931dbb9b4a02aef9974ec
|
||||||
SOURCE_SUM_PRG=sha256sum
|
SOURCE_SUM_PRG=sha256sum
|
||||||
SOURCE_FORMAT=zip
|
SOURCE_FORMAT=zip
|
||||||
SOURCE_IN_SUBDIR=true
|
SOURCE_IN_SUBDIR=true
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
SOURCE_URL=https://github.com/wekan/wekan/releases/download/v6.27/wekan-6.27-arm64.zip
|
SOURCE_URL=https://github.com/wekan/wekan/releases/download/v6.26/wekan-6.26-arm64.zip
|
||||||
SOURCE_SUM=4df0e24ecc8587638077b7e5ae512364798407689775adc90d534ccde253a9f6
|
SOURCE_SUM=0f85b0e90e4dba6a0545ac1fa264c43a6e1b2d85bf227ffe0dc9a8d6ce84357f
|
||||||
SOURCE_SUM_PRG=sha256sum
|
SOURCE_SUM_PRG=sha256sum
|
||||||
SOURCE_FORMAT=zip
|
SOURCE_FORMAT=zip
|
||||||
SOURCE_IN_SUBDIR=true
|
SOURCE_IN_SUBDIR=true
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent;
|
#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent;
|
||||||
location __PATH__/ {
|
location __PATH__/ {
|
||||||
|
|
||||||
client_max_body_size 100M;
|
client_max_body_size 100M;
|
||||||
|
|
||||||
proxy_pass http://127.0.0.1:__PORT__;
|
proxy_pass http://127.0.0.1:__PORT__;
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
"en": "Trello-like kanban",
|
"en": "Trello-like kanban",
|
||||||
"fr": "Un kanban similaire à Trello"
|
"fr": "Un kanban similaire à Trello"
|
||||||
},
|
},
|
||||||
"version": "6.27~ynh1",
|
"version": "6.27.1~ynh1",
|
||||||
"url": "https://wekan.github.io",
|
"url": "https://wekan.github.io",
|
||||||
"upstream": {
|
"upstream": {
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
# dependencies used by the app
|
# dependencies used by the app
|
||||||
pkg_dependencies=""
|
pkg_dependencies=""
|
||||||
|
|
||||||
NODEJS_VERSION="14.19.2"
|
nodejs_version="14.19.3"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# PERSONAL HELPERS
|
# PERSONAL HELPERS
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
|
# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
|
||||||
source ../settings/scripts/_common.sh
|
source ../settings/scripts/_common.sh
|
||||||
source ../settings/scripts/ynh_mongo_db
|
source ../settings/scripts/ynh_mongo_db__2
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
source _common.sh
|
source _common.sh
|
||||||
source ynh_mongo_db
|
source ynh_mongo_db__2
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -73,7 +73,7 @@ ynh_app_setting_set --app=$app --key=port --value=$port
|
||||||
ynh_script_progression --message="Installing dependencies..."
|
ynh_script_progression --message="Installing dependencies..."
|
||||||
|
|
||||||
ynh_install_app_dependencies $pkg_dependencies
|
ynh_install_app_dependencies $pkg_dependencies
|
||||||
ynh_install_nodejs --nodejs_version=$NODEJS_VERSION
|
ynh_install_nodejs --nodejs_version=$nodejs_version
|
||||||
ynh_use_nodejs
|
ynh_use_nodejs
|
||||||
ynh_install_mongo
|
ynh_install_mongo
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
source _common.sh
|
source _common.sh
|
||||||
source ynh_mongo_db
|
source ynh_mongo_db__2
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
|
# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
|
||||||
source ../settings/scripts/_common.sh
|
source ../settings/scripts/_common.sh
|
||||||
source ../settings/scripts/ynh_mongo_db
|
source ../settings/scripts/ynh_mongo_db__2
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -44,13 +44,6 @@ test ! -d $final_path \
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD RESTORATION STEPS
|
# STANDARD RESTORATION STEPS
|
||||||
#=================================================
|
|
||||||
# RESTORE THE NGINX CONFIGURATION
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Restoring the NGINX web server configuration..."
|
|
||||||
|
|
||||||
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RECREATE THE DEDICATED USER
|
# RECREATE THE DEDICATED USER
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -79,10 +72,17 @@ ynh_script_progression --message="Reinstalling dependencies..."
|
||||||
|
|
||||||
# Define and install dependencies
|
# Define and install dependencies
|
||||||
ynh_install_app_dependencies $pkg_dependencies
|
ynh_install_app_dependencies $pkg_dependencies
|
||||||
ynh_install_nodejs --nodejs_version=$NODEJS_VERSION
|
ynh_install_nodejs --nodejs_version=$nodejs_version
|
||||||
ynh_use_nodejs
|
ynh_use_nodejs
|
||||||
ynh_install_mongo
|
ynh_install_mongo
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# RESTORE THE NGINX CONFIGURATION
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Restoring the NGINX web server configuration..."
|
||||||
|
|
||||||
|
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE THE MONGODB DATABASE
|
# RESTORE THE MONGODB DATABASE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -7,8 +7,7 @@
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
source _common.sh
|
source _common.sh
|
||||||
source ynh_package_version
|
source ynh_mongo_db__2
|
||||||
source ynh_mongo_db
|
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -46,17 +45,6 @@ ynh_clean_setup () {
|
||||||
# Exit if an error occurs during the execution of the script
|
# Exit if an error occurs during the execution of the script
|
||||||
ynh_abort_if_errors
|
ynh_abort_if_errors
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# CHECK VERSION NUMBER
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
if [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then
|
|
||||||
sleep 60
|
|
||||||
fi
|
|
||||||
abort_if_up_to_date
|
|
||||||
# previous function is what defines 'version', more precisely the 'previous version'
|
|
||||||
previous_version="${version}"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD UPGRADE STEPS
|
# STANDARD UPGRADE STEPS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -83,36 +71,7 @@ if ! ynh_permission_exists --permission="admin"; then
|
||||||
ynh_permission_create --permission="admin" --allowed=$admin
|
ynh_permission_create --permission="admin" --allowed=$admin
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
ynh_secure_remove --file="/etc/apt/sources.list.d/mongodb-org-3.2.list"
|
||||||
# MANAGE UPGRADE FROM PREVIOUS VERSION
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Managing upgrade from previous version..."
|
|
||||||
|
|
||||||
if ynh_version_gt "0.45-2" "${previous_version}" ; then
|
|
||||||
ynh_script_progression --message="Upgrading to 0.45-2..."
|
|
||||||
ynh_replace_string --match_string="Environment=ROOT_URL=http://127.0.0.1:$port$path_url" --replace_string="Environment=ROOT_URL=https://$domain$path_url/" --target_file="/etc/systemd/system/$app.service"
|
|
||||||
systemctl daemon-reload
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ynh_version_gt "0.45-3" "${previous_version}" ; then
|
|
||||||
ynh_script_progression --message="Upgrading to 0.45-3..."
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ynh_version_gt "1.07~ynh2" "${previous_version}" ; then
|
|
||||||
ynh_script_progression --message="Upgrading to 1.07~ynh2..."
|
|
||||||
|
|
||||||
# Replace mongodb packages
|
|
||||||
# Assume no other app needs it >.>
|
|
||||||
rm -f /etc/apt/sources.list.d/mongodb-org-3.2.list
|
|
||||||
ynh_remove_app_dependencies
|
|
||||||
ynh_install_app_dependencies "mongodb mongodb-server"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ynh_version_gt "2.56~ynh1" "${previous_version}" ; then
|
|
||||||
# Create a dedicated .env config
|
|
||||||
config_file="$final_path/.env"
|
|
||||||
touch $config_file
|
|
||||||
fi
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CREATE DEDICATED USER
|
# CREATE DEDICATED USER
|
||||||
|
@ -138,6 +97,16 @@ chmod 750 "$final_path"
|
||||||
chmod -R o-rwx "$final_path"
|
chmod -R o-rwx "$final_path"
|
||||||
chown -R $app:$app "$final_path"
|
chown -R $app:$app "$final_path"
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# UPGRADE DEPENDENCIES
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Upgrading dependencies..."
|
||||||
|
|
||||||
|
ynh_install_app_dependencies $pkg_dependencies
|
||||||
|
ynh_install_nodejs --nodejs_version=$nodejs_version
|
||||||
|
ynh_use_nodejs
|
||||||
|
ynh_install_mongo
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# NGINX CONFIGURATION
|
# NGINX CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -146,16 +115,6 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..."
|
||||||
# Create a dedicated NGINX config
|
# Create a dedicated NGINX config
|
||||||
ynh_add_nginx_config
|
ynh_add_nginx_config
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# UPGRADE DEPENDENCIES
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Upgrading dependencies..."
|
|
||||||
|
|
||||||
ynh_install_app_dependencies $pkg_dependencies
|
|
||||||
ynh_install_nodejs --nodejs_version=$NODEJS_VERSION
|
|
||||||
ynh_use_nodejs
|
|
||||||
ynh_install_mongo
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC UPGRADE
|
# SPECIFIC UPGRADE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -1,13 +1,10 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
MONGO_DEBIAN_SERVICENAME="mongodb"
|
|
||||||
MONGO_CE_SERVICENAME="mongod"
|
MONGO_CE_SERVICENAME="mongod"
|
||||||
MONGO_DEBIAN_DEPENDENCIES="mongodb mongodb-server mongo-tools"
|
|
||||||
MONGO_CE_DEPENDENCIES="mongodb-org mongodb-org-server mongodb-org-tools"
|
MONGO_CE_DEPENDENCIES="mongodb-org mongodb-org-server mongodb-org-tools"
|
||||||
MONGO_DEBIAN_CONFIG="/etc/mongodb.conf"
|
|
||||||
MONGO_CE_CONFIG="/etc/mongod.conf"
|
MONGO_CE_CONFIG="/etc/mongod.conf"
|
||||||
MONGO_CE_REPO="deb http://repo.mongodb.org/apt/debian buster/mongodb-org/4.4 main"
|
MONGO_CE_REPO="deb http://repo.mongodb.org/apt/debian buster/mongodb-org/5.0 main"
|
||||||
MONGO_CE_KEY="https://www.mongodb.org/static/pgp/server-4.4.asc"
|
MONGO_CE_KEY="https://www.mongodb.org/static/pgp/server-5.0.asc"
|
||||||
|
|
||||||
# Execute a mongo command
|
# Execute a mongo command
|
||||||
#
|
#
|
||||||
|
@ -307,27 +304,16 @@ ynh_mongo_remove_db() {
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
ynh_install_mongo() {
|
ynh_install_mongo() {
|
||||||
ynh_print_info --message="Installing MongoDB..."
|
ynh_print_info --message="Installing MongoDB Community Edition..."
|
||||||
|
ynh_install_extra_app_dependencies --repo="$MONGO_CE_REPO" --package="$MONGO_CE_DEPENDENCIES" --key="$MONGO_CE_KEY"
|
||||||
# Define Mongo Service Name
|
mongodb_servicename=$MONGO_CE_SERVICENAME
|
||||||
if dpkg --compare-versions $(cat /etc/debian_version) ge 10.0
|
|
||||||
then
|
|
||||||
ynh_print_info --message="Installing MongoDB Community Edition..."
|
|
||||||
ynh_install_extra_app_dependencies --repo="$MONGO_CE_REPO" --package="$MONGO_CE_DEPENDENCIES" --key="$MONGO_CE_KEY"
|
|
||||||
MONGODB_SERVICENAME=$MONGO_CE_SERVICENAME
|
|
||||||
else
|
|
||||||
ynh_print_info --message="Installing MongoDB Debian..."
|
|
||||||
ynh_install_app_dependencies $MONGO_DEBIAN_DEPENDENCIES
|
|
||||||
MONGODB_SERVICENAME=$MONGO_DEBIAN_SERVICENAME
|
|
||||||
fi
|
|
||||||
mongodb_servicename=$MONGODB_SERVICENAME
|
|
||||||
|
|
||||||
# Make sure MongoDB is started and enabled
|
# Make sure MongoDB is started and enabled
|
||||||
systemctl is-enabled $MONGODB_SERVICENAME -q || systemctl enable $MONGODB_SERVICENAME --quiet
|
systemctl is-enabled $mongodb_servicename -q || systemctl enable $mongodb_servicename --quiet
|
||||||
systemctl is-active $MONGODB_SERVICENAME -q || ynh_systemd_action --service_name=$MONGODB_SERVICENAME --action=restart --line_match="aiting for connections" --log_path="/var/log/mongodb/$MONGODB_SERVICENAME.log"
|
systemctl is-active $mongodb_servicename -q || ynh_systemd_action --service_name=$mongodb_servicename --action=restart --line_match="aiting for connections" --log_path="/var/log/mongodb/$mongodb_servicename.log"
|
||||||
|
|
||||||
# Integrate MongoDB service in YunoHost
|
# Integrate MongoDB service in YunoHost
|
||||||
yunohost service add $MONGODB_SERVICENAME --description="MongoDB daemon" --log="/var/log/mongodb/$MONGODB_SERVICENAME.log"
|
yunohost service add $mongodb_servicename --description="MongoDB daemon" --log="/var/log/mongodb/$mongodb_servicename.log"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Remove MongoDB
|
# Remove MongoDB
|
||||||
|
@ -342,14 +328,9 @@ ynh_remove_mongo() {
|
||||||
if ! ynh_package_is_installed --package="mongodb*"
|
if ! ynh_package_is_installed --package="mongodb*"
|
||||||
then
|
then
|
||||||
ynh_print_info --message="Removing MongoDB service..."
|
ynh_print_info --message="Removing MongoDB service..."
|
||||||
# Define Mongo Service Name
|
mongodb_servicename=$MONGO_CE_SERVICENAME
|
||||||
if [ "$(lsb_release --codename --short)" = "buster" ]; then
|
|
||||||
MONGODB_SERVICENAME=$MONGO_CE_SERVICENAME
|
|
||||||
else
|
|
||||||
MONGODB_SERVICENAME=$MONGO_DEBIAN_SERVICENAME
|
|
||||||
fi
|
|
||||||
# Remove the mongodb service
|
# Remove the mongodb service
|
||||||
yunohost service remove $MONGODB_SERVICENAME
|
yunohost service remove $mongodb_servicename
|
||||||
# ynh_secure_remove --file=$MONGO_ROOT_PWD_FILE
|
# ynh_secure_remove --file=$MONGO_ROOT_PWD_FILE
|
||||||
fi
|
fi
|
||||||
}
|
}
|
|
@ -1,27 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
read_json () {
|
|
||||||
sudo python3 -c "import sys, json;print(json.load(open('$1'))['$2'])"
|
|
||||||
}
|
|
||||||
|
|
||||||
read_manifest () {
|
|
||||||
if [ -f '../manifest.json' ] ; then
|
|
||||||
read_json '../manifest.json' "$1"
|
|
||||||
else
|
|
||||||
read_json '../settings/manifest.json' "$1"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
abort_if_up_to_date () {
|
|
||||||
version=$(read_json "/etc/yunohost/apps/$YNH_APP_INSTANCE_NAME/manifest.json" 'version' 2> /dev/null || echo '20160501-7')
|
|
||||||
last_version=$(read_manifest 'version')
|
|
||||||
if [ "${version}" = "${last_version}" ]; then
|
|
||||||
ynh_script_progression --message="Up-to-date, nothing to do"
|
|
||||||
ynh_die "" 0
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
ynh_version_gt ()
|
|
||||||
{
|
|
||||||
dpkg --compare-versions "$1" gt "$2"
|
|
||||||
}
|
|
Loading…
Reference in a new issue