From 9995d496ff5a2d528ebc956ba97e34d89dc1bb38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 16 Feb 2023 09:55:28 +0100 Subject: [PATCH 01/38] v2 --- conf/systemd.service | 4 +-- manifest.toml | 66 +++++++++++++++++++++++++++++++++++++ scripts/_common.sh | 6 ++-- scripts/backup | 16 ++++----- scripts/install | 78 ++++++++++++++++++++++---------------------- scripts/remove | 26 +++++++-------- scripts/restore | 46 +++++++++++++------------- scripts/upgrade | 72 ++++++++++++++++++++-------------------- 8 files changed, 190 insertions(+), 124 deletions(-) create mode 100644 manifest.toml diff --git a/conf/systemd.service b/conf/systemd.service index ae02c6d..b63fa19 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -7,9 +7,9 @@ After=network.target remote-fs.target nss-lookup.target nginx.service __MONGODB_ User=__APP__ Group=__APP__ Environment="NODE_ENV=production" -WorkingDirectory=__FINALPATH__/ +WorkingDirectory=__INSTALL_DIR__/ Environment="__YNH_NODE_LOAD_PATH__" -ExecStart=__YNH_NODE__ __FINALPATH__/main.js +ExecStart=__YNH_NODE__ __INSTALL_DIR__/main.js SyslogIdentifier=__APP__ Environment=MONGO_URL=mongodb://localhost:27017/__APP__?replicaSet=rs01 Environment=MONGO_OPLOG_URL=mongodb://localhost:27017/local?replicaSet=rs01 diff --git a/manifest.toml b/manifest.toml new file mode 100644 index 0000000..5b6604f --- /dev/null +++ b/manifest.toml @@ -0,0 +1,66 @@ +packaging_format = 2 + +id = "rocketchat" +name = "Rocket.Chat" +description.en = "Team collaboration communication platform" +description.fr = "Plateforme de communication collaborative en équipe" + +version = "5.4.3~ynh1" + +maintainers = ["eric_G"] + +[upstream] +license = "GPL-3.0" +website = "https://rocket.chat/" +demo = "https://cloud.rocket.chat/trial" +admindoc = "https://docs.rocket.chat/" +userdoc = "https://docs.rocket.chat/guides/user-guides" +code = "https://github.com/RocketChat/Rocket.Chat" +cpe = "???" # FIXME: optional but recommended if relevant, this is meant to contain the Common Platform Enumeration, which is sort of a standard id for applications defined by the NIST. In particular, Yunohost may use this is in the future to easily track CVE (=security reports) related to apps. The CPE may be obtained by searching here: https://nvd.nist.gov/products/cpe/search. For example, for Nextcloud, the CPE is 'cpe:2.3:a:nextcloud:nextcloud' (no need to include the version number) +fund = "???" # FIXME: optional but recommended (or remove if irrelevant / not applicable). This is meant to be an URL where people can financially support this app, especially when its development is based on volunteers and/or financed by its community. YunoHost may later advertise it in the webadmin. + +[integration] +yunohost = ">> 11.1.7" +architectures = "all" # FIXME: can be replaced by a list of supported archs using the dpkg --print-architecture nomenclature (amd64/i386/armhf/arm64), for example: ["amd64", "i386"] +multi_instance = true +ldap = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "sso" key : the "ldap" key corresponds to wether or not a user *can* login on the app using its YunoHost credentials. +sso = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "ldap" key : the "sso" key corresponds to wether or not a user is *automatically logged-in* on the app when logged-in on the YunoHost portal. +disk = "50M" # FIXME: replace with an **estimate** minimum disk requirement. e.g. 20M, 400M, 1G, ... +ram.build = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... +ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... + +[install] + [install.domain] + # this is a generic question - ask strings are automatically handled by Yunohost's core + type = "domain" + + [install.path] + # this is a generic question - ask strings are automatically handled by Yunohost's core + type = "path" + default = "/rocketchat" + + [install.init_main_permission] + help.en = "You must activate public site if you want to connect a Mobile or desktop client to Rocket.Chat. This can be changed later via the webadmin." + help.fr = "Vous devez activer site public si vous souhaitez connecter un client mobile ou desktop à Rocket.Chat. Vous pourrez changer ceci plus tard via la webadmin." + type = "group" + default = "visitors" + + [install.admin] + # this is a generic question - ask strings are automatically handled by Yunohost's core + type = "user" + + [install.password] + # this is a generic question - ask strings are automatically handled by Yunohost's core + type = "password" + +[resources] + [resources.system_user] + + [resources.install_dir] + + [resources.permissions] + main.url = "/" + [[resources.apt.extras]] + repo = "deb https://dl.yarnpkg.com/debian/ stable main" + key = "https://dl.yarnpkg.com/debian/pubkey.gpg" + packages = "yarn" diff --git a/scripts/_common.sh b/scripts/_common.sh index e8498e3..6a8082d 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -9,7 +9,7 @@ nodejs_version=14 mongo_version=5.0 # dependencies used by the app -pkg_dependencies="apt-transport-https build-essential gzip curl fontconfig graphicsmagick" +#REMOVEME? pkg_dependencies="apt-transport-https build-essential gzip curl fontconfig graphicsmagick" #================================================= # PERSONAL HELPERS @@ -287,7 +287,7 @@ ynh_mongo_setup_db() { ynh_mongo_create_user --db_user="$db_user" --db_pwd="$db_pwd" --db_name="$db_name" # Store the password in the app's config - ynh_app_setting_set --app=$app --key=db_pwd --value=$db_pwd +#REMOVEME? ynh_app_setting_set --app=$app --key=db_pwd --value=$db_pwd } # Remove a database if it exists, and the associated user @@ -343,7 +343,7 @@ ynh_install_mongo() { mongo_debian_release=buster fi - ynh_install_extra_app_dependencies --repo="deb http://repo.mongodb.org/apt/debian $mongo_debian_release/mongodb-org/$mongo_version main" --package="mongodb-org mongodb-org-server mongodb-org-tools mongodb-mongosh" --key="https://www.mongodb.org/static/pgp/server-$mongo_version.asc" +#REMOVEME? ynh_install_extra_app_dependencies --repo="deb http://repo.mongodb.org/apt/debian $mongo_debian_release/mongodb-org/$mongo_version main" --package="mongodb-org mongodb-org-server mongodb-org-tools mongodb-mongosh" --key="https://www.mongodb.org/static/pgp/server-$mongo_version.asc" mongodb_servicename=mongod # Make sure MongoDB is started and enabled diff --git a/scripts/backup b/scripts/backup index 5a3266b..0f46105 100644 --- a/scripts/backup +++ b/scripts/backup @@ -14,22 +14,22 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { +#REMOVEME? ynh_clean_setup () { true } # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_print_info --message="Loading installation settings..." +#REMOVEME? ynh_print_info --message="Loading installation settings..." -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -domain=$(ynh_app_setting_get --app=$app --key=domain) -db_name=$(ynh_app_setting_get --app=$app --key=db_name) +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) +#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) +#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name) #================================================= # DECLARE DATA AND CONF FILES TO BACKUP @@ -40,7 +40,7 @@ ynh_print_info --message="Declaring files to be backed up..." # BACKUP THE APP MAIN DIR #================================================= -ynh_backup --src_path="$final_path" +ynh_backup --src_path="$install_dir" #================================================= # BACKUP THE NGINX CONFIGURATION diff --git a/scripts/install b/scripts/install index 2726a6c..18b47c9 100644 --- a/scripts/install +++ b/scripts/install @@ -13,30 +13,30 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { +#REMOVEME? ynh_clean_setup () { ynh_clean_check_starting } # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # RETRIEVE ARGUMENTS FROM THE MANIFEST #================================================= -domain=$YNH_APP_ARG_DOMAIN -path_url=$YNH_APP_ARG_PATH -is_public=$YNH_APP_ARG_IS_PUBLIC -admin=$YNH_APP_ARG_ADMIN -password=$YNH_APP_ARG_PASSWORD +#REMOVEME? domain=$YNH_APP_ARG_DOMAIN +#REMOVEME? path=$YNH_APP_ARG_PATH +#REMOVEME? is_public=$YNH_APP_ARG_IS_PUBLIC +#REMOVEME? admin=$YNH_APP_ARG_ADMIN +#REMOVEME? password=$YNH_APP_ARG_PASSWORD -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME email=$(ynh_user_get_info --username=$admin --key=mail) #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= -ynh_script_progression --message="Validating installation parameters..." --weight=1 +#REMOVEME? ynh_script_progression --message="Validating installation parameters..." --weight=1 # Check machine architecture (in particular, we don't support ARM and 32bit machines) if [ $YNH_ARCH == "i386" ] || [ $YNH_ARCH == "armel" ] || [ $YNH_ARCH == "armhf" ] || [ $YNH_ARCH == "arm64" ] @@ -44,21 +44,21 @@ then ynh_die --message="Sorry, but this app can only be installed on a x86, 64 bits machine :(" fi -final_path=/var/www/$app -test ! -e "$final_path" || ynh_die --message="This path already contains a folder" +#REMOVEME? install_dir=/var/www/$app +#REMOVEME? test ! -e "$install_dir" || ynh_die --message="This path already contains a folder" # Register (book) web path -ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url +#REMOVEME? ynh_webpath_register --app=$app --domain=$domain --path=$path #================================================= # STORE SETTINGS FROM MANIFEST #================================================= -ynh_script_progression --message="Storing installation settings..." --weight=2 +#REMOVEME? ynh_script_progression --message="Storing installation settings..." --weight=2 -ynh_app_setting_set --app=$app --key=domain --value=$domain -ynh_app_setting_set --app=$app --key=path --value=$path_url -ynh_app_setting_set --app=$app --key=admin --value=$admin -ynh_app_setting_set --app=$app --key=password --value="$password" +#REMOVEME? ynh_app_setting_set --app=$app --key=domain --value=$domain +#REMOVEME? ynh_app_setting_set --app=$app --key=path --value=$path +#REMOVEME? ynh_app_setting_set --app=$app --key=admin --value=$admin +#REMOVEME? ynh_app_setting_set --app=$app --key=password --value="$password" ynh_app_setting_set --app=$app --key=email --value=$email #================================================= @@ -66,38 +66,38 @@ ynh_app_setting_set --app=$app --key=email --value=$email #================================================= # FIND AND OPEN A PORT #================================================= -ynh_script_progression --message="Finding an available port..." --weight=2 +#REMOVEME? ynh_script_progression --message="Finding an available port..." --weight=2 # Find an available port -port=$(ynh_find_port --port=3000) -ynh_app_setting_set --app=$app --key=port --value=$port +#REMOVEME? port=$(ynh_find_port --port=3000) +#REMOVEME? ynh_app_setting_set --app=$app --key=port --value=$port #================================================= # INSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Installing dependencies..." --weight=48 +#REMOVEME? ynh_script_progression --message="Installing dependencies..." --weight=48 -ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies +#REMOVEME? ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version ynh_exec_warn_less ynh_install_mongo --mongo_version=$mongo_version -ynh_exec_warn_less ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg" +#REMOVEME? ynh_exec_warn_less ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg" #================================================= # CREATE DEDICATED USER #================================================= -ynh_script_progression --message="Configuring system user..." --weight=3 +#REMOVEME? ynh_script_progression --message="Configuring system user..." --weight=3 # Create a system user -ynh_system_user_create --username=$app --home_dir="$final_path" +#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" #================================================= # CREATE A MONGODB DATABASE #================================================= ynh_script_progression --message="Creating a MongoDB database..." --weight=5 -db_name=$(ynh_sanitize_dbid --db_name=$app) -db_user=$db_name -ynh_app_setting_set --app=$app --key=db_name --value=$db_name +#REMOVEME? db_name=$(ynh_sanitize_dbid --db_name=$app) +#REMOVEME? db_user=$db_name +#REMOVEME? ynh_app_setting_set --app=$app --key=db_name --value=$db_name ynh_mongo_setup_db --db_user=$db_user --db_name=$db_name #================================================= @@ -105,15 +105,15 @@ ynh_mongo_setup_db --db_user=$db_user --db_name=$db_name #================================================= ynh_script_progression --message="Setting up source files..." --weight=10 -ynh_app_setting_set --app=$app --key=final_path --value=$final_path +#REMOVEME? ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir # Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir="$final_path" +ynh_setup_source --dest_dir="$install_dir" mkdir "/tmp/ufs" -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:$app "$final_path" +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R $app:$app "$install_dir" chown -R $app:$app "/tmp/ufs" #================================================= @@ -146,7 +146,7 @@ fi #============================================== ynh_script_progression --message="Building $app... (this will take some time and resources!)" --weight=29 -pushd $final_path/programs/server +pushd $install_dir/programs/server ynh_use_nodejs ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn install --unsafe-perm popd @@ -186,22 +186,22 @@ ynh_systemd_action --service_name=$app --action="start" --log_path=systemd --lin #================================================= # SETUP SSOWAT #================================================= -ynh_script_progression --message="Configuring permissions..." --weight=1 +#REMOVEME? ynh_script_progression --message="Configuring permissions..." --weight=1 # Make app public if necessary -if [ $is_public -eq 1 ] +#REMOVEME? if [ $is_public -eq 1 ] then # Everyone can access the app. # The "main" permission is automatically created before the install script. - ynh_permission_update --permission="main" --add="visitors" +#REMOVEME? ynh_permission_update --permission="main" --add="visitors" fi #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=2 +#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." --weight=2 -ynh_systemd_action --service_name=nginx --action=reload +#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload #================================================= # END OF SCRIPT diff --git a/scripts/remove b/scripts/remove index c1cbb8e..99c00b6 100644 --- a/scripts/remove +++ b/scripts/remove @@ -12,15 +12,15 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 +#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -domain=$(ynh_app_setting_get --app=$app --key=domain) -port=$(ynh_app_setting_get --app=$app --key=port) -db_name=$(ynh_app_setting_get --app=$app --key=db_name) -db_user=$db_name -final_path=$(ynh_app_setting_get --app=$app --key=final_path) +#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) +#REMOVEME? port=$(ynh_app_setting_get --app=$app --key=port) +#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name) +#REMOVEME? db_user=$db_name +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) #================================================= # STANDARD REMOVE @@ -68,10 +68,10 @@ ynh_mongo_remove_db --db_user=$db_user --db_name=$db_name #================================================= # REMOVE APP MAIN DIR #================================================= -ynh_script_progression --message="Removing app main directory..." --weight=2 +#REMOVEME? ynh_script_progression --message="Removing app main directory..." --weight=2 # Remove the app directory securely -ynh_secure_remove --file="$final_path" +#REMOVEME? ynh_secure_remove --file="$install_dir" if [ -d "/tmp/ufs" ]; then ynh_secure_remove --file="/tmp/ufs" @@ -88,10 +88,10 @@ ynh_remove_nginx_config #================================================= # REMOVE DEPENDENCIES #================================================= -ynh_script_progression --message="Removing dependencies..." --weight=4 +#REMOVEME? ynh_script_progression --message="Removing dependencies..." --weight=4 # Remove metapackage and its dependencies -ynh_remove_app_dependencies +#REMOVEME? ynh_remove_app_dependencies ynh_remove_nodejs ynh_remove_mongo @@ -100,10 +100,10 @@ ynh_remove_mongo #================================================= # REMOVE DEDICATED USER #================================================= -ynh_script_progression --message="Removing the dedicated system user..." --weight=1 +#REMOVEME? ynh_script_progression --message="Removing the dedicated system user..." --weight=1 # Delete a system user -ynh_system_user_delete --username=$app +#REMOVEME? ynh_system_user_delete --username=$app #================================================= # END OF SCRIPT diff --git a/scripts/restore b/scripts/restore index 93e5ed1..1651646 100644 --- a/scripts/restore +++ b/scripts/restore @@ -14,67 +14,67 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { +#REMOVEME? ynh_clean_setup () { ynh_clean_check_starting } # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 +#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -domain=$(ynh_app_setting_get --app=$app --key=domain) -path_url=$(ynh_app_setting_get --app=$app --key=path) -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -db_name=$(ynh_app_setting_get --app=$app --key=db_name) -db_user=$db_name -mongo_version=$(ynh_app_setting_get --app=$app --key=mongo_version) +#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) +#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) +#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name) +#REMOVEME? db_user=$db_name +#REMOVEME? mongo_version=$(ynh_app_setting_get --app=$app --key=mongo_version) #================================================= # CHECK IF THE APP CAN BE RESTORED #================================================= -ynh_script_progression --message="Validating restoration parameters..." --weight=1 +#REMOVEME? ynh_script_progression --message="Validating restoration parameters..." --weight=1 -test ! -d $final_path \ - || ynh_die --message="There is already a directory: $final_path " +#REMOVEME? test ! -d $install_dir \ + || ynh_die --message="There is already a directory: $install_dir " #================================================= # STANDARD RESTORATION STEPS #================================================= # RECREATE THE DEDICATED USER #================================================= -ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 +#REMOVEME? ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 # Create the dedicated user (if not existing) -ynh_system_user_create --username=$app --home_dir="$final_path" +#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" #================================================= # RESTORE THE APP MAIN DIR #================================================= ynh_script_progression --message="Restoring the app main directory..." --weight=1 -ynh_restore_file --origin_path="$final_path" +ynh_restore_file --origin_path="$install_dir" -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:$app "$final_path" +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R $app:$app "$install_dir" #================================================= # SPECIFIC RESTORATION #================================================= # REINSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Reinstalling dependencies..." --weight=40 +#REMOVEME? ynh_script_progression --message="Reinstalling dependencies..." --weight=40 # Define and install dependencies -ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies +#REMOVEME? ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version ynh_exec_warn_less ynh_install_mongo --mongo_version=$mongo_version -ynh_exec_warn_less ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg" +#REMOVEME? ynh_exec_warn_less ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg" #================================================= # RESTORE THE NGINX CONFIGURATION @@ -88,7 +88,7 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= ynh_script_progression --message="Restoring the MongoDB database..." --weight=10 -db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd) +#REMOVEME? db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd) ynh_mongo_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd ynh_mongo_restore_db --database="$db_name" < ./dump.bson diff --git a/scripts/upgrade b/scripts/upgrade index fa55c62..a8f17cd 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -12,20 +12,20 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 +#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -domain=$(ynh_app_setting_get --app=$app --key=domain) -path_url=$(ynh_app_setting_get --app=$app --key=path) -admin=$(ynh_app_setting_get --app=$app --key=admin) -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -db_name=$(ynh_app_setting_get --app=$app --key=db_name) -port=$(ynh_app_setting_get --app=$app --key=port) -password=$(ynh_app_setting_get --app=$app --key=password) -admin=$(ynh_app_setting_get --app=$app --key=admin) -email=$(ynh_app_setting_get --app=$app --key=email) -mongo_version=$(ynh_app_setting_get --app=$app --key=mongo_version) +#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) +#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) +#REMOVEME? admin=$(ynh_app_setting_get --app=$app --key=admin) +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) +#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name) +#REMOVEME? port=$(ynh_app_setting_get --app=$app --key=port) +#REMOVEME? password=$(ynh_app_setting_get --app=$app --key=password) +#REMOVEME? admin=$(ynh_app_setting_get --app=$app --key=admin) +#REMOVEME? email=$(ynh_app_setting_get --app=$app --key=email) +#REMOVEME? mongo_version=$(ynh_app_setting_get --app=$app --key=mongo_version) #================================================= # CHECK VERSION @@ -36,17 +36,17 @@ upgrade_type=$(ynh_check_app_version_changed) #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=45 +#REMOVEME? ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=45 # Backup the current version of the app -ynh_backup_before_upgrade -ynh_clean_setup () { +#REMOVEME? ynh_backup_before_upgrade +#REMOVEME? ynh_clean_setup () { ynh_clean_check_starting # Restore it if the upgrade fails - ynh_restore_upgradebackup +#REMOVEME? ynh_restore_upgradebackup } # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # STANDARD UPGRADE STEPS @@ -62,15 +62,15 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" #================================================= ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 -# If final_path doesn't exist, create it -if [ -z "$final_path" ]; then - final_path=/var/www/$app - ynh_app_setting_set --app=$app --key=final_path --value=$final_path +# If install_dir doesn't exist, create it +if [ -z "$install_dir" ]; then +#REMOVEME? install_dir=/var/www/$app +#REMOVEME? ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir fi # Cleaning legacy permissions -if ynh_legacy_permissions_exists; then - ynh_legacy_permissions_delete_all +#REMOVEME? if ynh_legacy_permissions_exists; then +#REMOVEME? ynh_legacy_permissions_delete_all ynh_app_setting_delete --app=$app --key=is_public fi @@ -84,10 +84,10 @@ fi #================================================= # CREATE DEDICATED USER #================================================= -ynh_script_progression --message="Making sure dedicated system user exists..." --weight=4 +#REMOVEME? ynh_script_progression --message="Making sure dedicated system user exists..." --weight=4 # Create a dedicated user (if not existing) -ynh_system_user_create --username=$app --home_dir="$final_path" +#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -97,24 +97,24 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading source files..." --weight=22 # Remove the app directory securely - ynh_secure_remove --file="$final_path" +#REMOVEME? ynh_secure_remove --file="$install_dir" # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$final_path" + ynh_setup_source --dest_dir="$install_dir" fi -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:$app "$final_path" +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R $app:$app "$install_dir" #================================================= # UPGRADE DEPENDENCIES #================================================= -ynh_script_progression --message="Upgrading dependencies..." --weight=7 +#REMOVEME? ynh_script_progression --message="Upgrading dependencies..." --weight=7 -ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies +#REMOVEME? ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version ynh_exec_warn_less ynh_install_mongo --mongo_version=$mongo_version -ynh_exec_warn_less ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg" +#REMOVEME? ynh_exec_warn_less ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg" #================================================= # NGINX CONFIGURATION @@ -146,7 +146,7 @@ fi #============================================== ynh_script_progression --message="Building $app... (this will take some time and resources!)" --weight=29 -pushd $final_path/programs/server +pushd $install_dir/programs/server ynh_use_nodejs ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn install --unsafe-perm popd @@ -186,9 +186,9 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --l #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 +#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." --weight=1 -ynh_systemd_action --service_name=nginx --action=reload +#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload #================================================= # END OF SCRIPT From 6191b388a186838e892c153f21088e0095ad6995 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 16 Feb 2023 10:07:14 +0100 Subject: [PATCH 02/38] v2 --- manifest.toml | 28 +++++++------- scripts/_common.sh | 3 -- scripts/backup | 18 +-------- scripts/change_url | 11 ------ scripts/install | 93 ++++------------------------------------------ scripts/remove | 29 +++------------ scripts/restore | 47 +++-------------------- scripts/upgrade | 67 ++++----------------------------- tests.toml | 10 +++++ 9 files changed, 51 insertions(+), 255 deletions(-) create mode 100644 tests.toml diff --git a/manifest.toml b/manifest.toml index 5b6604f..d8c4867 100644 --- a/manifest.toml +++ b/manifest.toml @@ -16,41 +16,35 @@ demo = "https://cloud.rocket.chat/trial" admindoc = "https://docs.rocket.chat/" userdoc = "https://docs.rocket.chat/guides/user-guides" code = "https://github.com/RocketChat/Rocket.Chat" -cpe = "???" # FIXME: optional but recommended if relevant, this is meant to contain the Common Platform Enumeration, which is sort of a standard id for applications defined by the NIST. In particular, Yunohost may use this is in the future to easily track CVE (=security reports) related to apps. The CPE may be obtained by searching here: https://nvd.nist.gov/products/cpe/search. For example, for Nextcloud, the CPE is 'cpe:2.3:a:nextcloud:nextcloud' (no need to include the version number) -fund = "???" # FIXME: optional but recommended (or remove if irrelevant / not applicable). This is meant to be an URL where people can financially support this app, especially when its development is based on volunteers and/or financed by its community. YunoHost may later advertise it in the webadmin. [integration] yunohost = ">> 11.1.7" -architectures = "all" # FIXME: can be replaced by a list of supported archs using the dpkg --print-architecture nomenclature (amd64/i386/armhf/arm64), for example: ["amd64", "i386"] +architectures = ["amd64"] multi_instance = true -ldap = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "sso" key : the "ldap" key corresponds to wether or not a user *can* login on the app using its YunoHost credentials. -sso = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "ldap" key : the "sso" key corresponds to wether or not a user is *automatically logged-in* on the app when logged-in on the YunoHost portal. -disk = "50M" # FIXME: replace with an **estimate** minimum disk requirement. e.g. 20M, 400M, 1G, ... -ram.build = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... -ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... +ldap = false +sso = false +disk = "50M" +ram.build = "50M" +ram.runtime = "50M" [install] [install.domain] - # this is a generic question - ask strings are automatically handled by Yunohost's core type = "domain" [install.path] - # this is a generic question - ask strings are automatically handled by Yunohost's core type = "path" default = "/rocketchat" [install.init_main_permission] - help.en = "You must activate public site if you want to connect a Mobile or desktop client to Rocket.Chat. This can be changed later via the webadmin." - help.fr = "Vous devez activer site public si vous souhaitez connecter un client mobile ou desktop à Rocket.Chat. Vous pourrez changer ceci plus tard via la webadmin." + help.en = "You must activate 'Visitors' if you want to connect a Mobile or desktop client to Rocket.Chat. This can be changed later via the webadmin." + help.fr = "Vous devez activer 'Visiteurs' si vous souhaitez connecter un client mobile ou desktop à Rocket.Chat. Vous pourrez changer ceci plus tard via la webadmin." type = "group" default = "visitors" [install.admin] - # this is a generic question - ask strings are automatically handled by Yunohost's core type = "user" [install.password] - # this is a generic question - ask strings are automatically handled by Yunohost's core type = "password" [resources] @@ -58,8 +52,14 @@ ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requiremen [resources.install_dir] + [resources.ports] + [resources.permissions] main.url = "/" + + [resources.apt] + packages = "apt-transport-https build-essential gzip curl fontconfig graphicsmagick" + [[resources.apt.extras]] repo = "deb https://dl.yarnpkg.com/debian/ stable main" key = "https://dl.yarnpkg.com/debian/pubkey.gpg" diff --git a/scripts/_common.sh b/scripts/_common.sh index 6a8082d..8de137a 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -8,9 +8,6 @@ nodejs_version=14 mongo_version=5.0 -# dependencies used by the app -#REMOVEME? pkg_dependencies="apt-transport-https build-essential gzip curl fontconfig graphicsmagick" - #================================================= # PERSONAL HELPERS #================================================= diff --git a/scripts/backup b/scripts/backup index 0f46105..79d7175 100644 --- a/scripts/backup +++ b/scripts/backup @@ -10,26 +10,12 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -#REMOVEME? ynh_clean_setup () { - true -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - #================================================= # LOAD SETTINGS #================================================= -#REMOVEME? ynh_print_info --message="Loading installation settings..." +ynh_print_info --message="Loading installation settings..." -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) -#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name) +db_name=$(ynh_app_setting_get --app=$app --key=db_name) #================================================= # DECLARE DATA AND CONF FILES TO BACKUP diff --git a/scripts/change_url b/scripts/change_url index f441582..a85a152 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -21,17 +21,6 @@ new_path=$YNH_APP_NEW_PATH app=$YNH_APP_INSTANCE_NAME -#================================================= -# LOAD SETTINGS -#================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 - -# Needed for helper "ynh_add_nginx_config" -final_path=$(ynh_app_setting_get --app=$app --key=final_path) - -# Add settings here as needed by your application -port=$(ynh_app_setting_get --app=$app --key=port) - #================================================= # BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP #================================================= diff --git a/scripts/install b/scripts/install index 18b47c9..6644b6b 100644 --- a/scripts/install +++ b/scripts/install @@ -9,95 +9,37 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -#REMOVEME? ynh_clean_setup () { - ynh_clean_check_starting -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - #================================================= # RETRIEVE ARGUMENTS FROM THE MANIFEST #================================================= -#REMOVEME? domain=$YNH_APP_ARG_DOMAIN -#REMOVEME? path=$YNH_APP_ARG_PATH -#REMOVEME? is_public=$YNH_APP_ARG_IS_PUBLIC -#REMOVEME? admin=$YNH_APP_ARG_ADMIN -#REMOVEME? password=$YNH_APP_ARG_PASSWORD - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - +password=$YNH_APP_ARG_PASSWORD email=$(ynh_user_get_info --username=$admin --key=mail) -#================================================= -# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS -#================================================= -#REMOVEME? ynh_script_progression --message="Validating installation parameters..." --weight=1 - -# Check machine architecture (in particular, we don't support ARM and 32bit machines) -if [ $YNH_ARCH == "i386" ] || [ $YNH_ARCH == "armel" ] || [ $YNH_ARCH == "armhf" ] || [ $YNH_ARCH == "arm64" ] -then - ynh_die --message="Sorry, but this app can only be installed on a x86, 64 bits machine :(" -fi - -#REMOVEME? install_dir=/var/www/$app -#REMOVEME? test ! -e "$install_dir" || ynh_die --message="This path already contains a folder" - -# Register (book) web path -#REMOVEME? ynh_webpath_register --app=$app --domain=$domain --path=$path - #================================================= # STORE SETTINGS FROM MANIFEST #================================================= -#REMOVEME? ynh_script_progression --message="Storing installation settings..." --weight=2 +ynh_script_progression --message="Storing installation settings..." --weight=2 -#REMOVEME? ynh_app_setting_set --app=$app --key=domain --value=$domain -#REMOVEME? ynh_app_setting_set --app=$app --key=path --value=$path -#REMOVEME? ynh_app_setting_set --app=$app --key=admin --value=$admin -#REMOVEME? ynh_app_setting_set --app=$app --key=password --value="$password" +ynh_app_setting_set --app=$app --key=password --value="$password" ynh_app_setting_set --app=$app --key=email --value=$email -#================================================= -# STANDARD MODIFICATIONS -#================================================= -# FIND AND OPEN A PORT -#================================================= -#REMOVEME? ynh_script_progression --message="Finding an available port..." --weight=2 - -# Find an available port -#REMOVEME? port=$(ynh_find_port --port=3000) -#REMOVEME? ynh_app_setting_set --app=$app --key=port --value=$port - #================================================= # INSTALL DEPENDENCIES #================================================= -#REMOVEME? ynh_script_progression --message="Installing dependencies..." --weight=48 +ynh_script_progression --message="Installing dependencies..." --weight=48 -#REMOVEME? ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version ynh_exec_warn_less ynh_install_mongo --mongo_version=$mongo_version -#REMOVEME? ynh_exec_warn_less ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg" - -#================================================= -# CREATE DEDICATED USER -#================================================= -#REMOVEME? ynh_script_progression --message="Configuring system user..." --weight=3 - -# Create a system user -#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" #================================================= # CREATE A MONGODB DATABASE #================================================= ynh_script_progression --message="Creating a MongoDB database..." --weight=5 -#REMOVEME? db_name=$(ynh_sanitize_dbid --db_name=$app) -#REMOVEME? db_user=$db_name -#REMOVEME? ynh_app_setting_set --app=$app --key=db_name --value=$db_name +db_name=$(ynh_sanitize_dbid --db_name=$app) +db_user=$db_name +ynh_app_setting_set --app=$app --key=db_name --value=$db_name ynh_mongo_setup_db --db_user=$db_user --db_name=$db_name #================================================= @@ -105,7 +47,6 @@ ynh_mongo_setup_db --db_user=$db_user --db_name=$db_name #================================================= ynh_script_progression --message="Setting up source files..." --weight=10 -#REMOVEME? ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" @@ -183,26 +124,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=29 ynh_systemd_action --service_name=$app --action="start" --log_path=systemd --line_match="SERVER RUNNING" -#================================================= -# SETUP SSOWAT -#================================================= -#REMOVEME? ynh_script_progression --message="Configuring permissions..." --weight=1 - -# Make app public if necessary -#REMOVEME? if [ $is_public -eq 1 ] -then - # Everyone can access the app. - # The "main" permission is automatically created before the install script. -#REMOVEME? ynh_permission_update --permission="main" --add="visitors" -fi - -#================================================= -# RELOAD NGINX -#================================================= -#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." --weight=2 - -#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/remove b/scripts/remove index 99c00b6..64bf733 100644 --- a/scripts/remove +++ b/scripts/remove @@ -12,15 +12,10 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 +ynh_script_progression --message="Loading installation settings..." --weight=1 -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) -#REMOVEME? port=$(ynh_app_setting_get --app=$app --key=port) -#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name) -#REMOVEME? db_user=$db_name -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) +db_name=$(ynh_app_setting_get --app=$app --key=db_name) +db_user=$db_name #================================================= # STANDARD REMOVE @@ -68,10 +63,7 @@ ynh_mongo_remove_db --db_user=$db_user --db_name=$db_name #================================================= # REMOVE APP MAIN DIR #================================================= -#REMOVEME? ynh_script_progression --message="Removing app main directory..." --weight=2 - -# Remove the app directory securely -#REMOVEME? ynh_secure_remove --file="$install_dir" +ynh_script_progression --message="Removing app main directory..." --weight=2 if [ -d "/tmp/ufs" ]; then ynh_secure_remove --file="/tmp/ufs" @@ -88,23 +80,12 @@ ynh_remove_nginx_config #================================================= # REMOVE DEPENDENCIES #================================================= -#REMOVEME? ynh_script_progression --message="Removing dependencies..." --weight=4 +ynh_script_progression --message="Removing dependencies..." --weight=4 # Remove metapackage and its dependencies -#REMOVEME? ynh_remove_app_dependencies ynh_remove_nodejs ynh_remove_mongo -#================================================= -# GENERIC FINALIZATION -#================================================= -# REMOVE DEDICATED USER -#================================================= -#REMOVEME? ynh_script_progression --message="Removing the dedicated system user..." --weight=1 - -# Delete a system user -#REMOVEME? ynh_system_user_delete --username=$app - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/restore b/scripts/restore index 1651646..2500648 100644 --- a/scripts/restore +++ b/scripts/restore @@ -10,47 +10,14 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -#REMOVEME? ynh_clean_setup () { - ynh_clean_check_starting -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - #================================================= # LOAD SETTINGS #================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 +ynh_script_progression --message="Loading installation settings..." --weight=1 -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) -#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name) -#REMOVEME? db_user=$db_name -#REMOVEME? mongo_version=$(ynh_app_setting_get --app=$app --key=mongo_version) - -#================================================= -# CHECK IF THE APP CAN BE RESTORED -#================================================= -#REMOVEME? ynh_script_progression --message="Validating restoration parameters..." --weight=1 - -#REMOVEME? test ! -d $install_dir \ - || ynh_die --message="There is already a directory: $install_dir " - -#================================================= -# STANDARD RESTORATION STEPS -#================================================= -# RECREATE THE DEDICATED USER -#================================================= -#REMOVEME? ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 - -# Create the dedicated user (if not existing) -#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" +db_name=$(ynh_app_setting_get --app=$app --key=db_name) +db_user=$db_name +mongo_version=$(ynh_app_setting_get --app=$app --key=mongo_version) #================================================= # RESTORE THE APP MAIN DIR @@ -68,13 +35,11 @@ chown -R $app:$app "$install_dir" #================================================= # REINSTALL DEPENDENCIES #================================================= -#REMOVEME? ynh_script_progression --message="Reinstalling dependencies..." --weight=40 +ynh_script_progression --message="Reinstalling dependencies..." --weight=40 # Define and install dependencies -#REMOVEME? ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version ynh_exec_warn_less ynh_install_mongo --mongo_version=$mongo_version -#REMOVEME? ynh_exec_warn_less ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg" #================================================= # RESTORE THE NGINX CONFIGURATION @@ -88,7 +53,7 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= ynh_script_progression --message="Restoring the MongoDB database..." --weight=10 -#REMOVEME? db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd) +db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd) ynh_mongo_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd ynh_mongo_restore_db --database="$db_name" < ./dump.bson diff --git a/scripts/upgrade b/scripts/upgrade index a8f17cd..aff0c07 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -12,20 +12,12 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 +ynh_script_progression --message="Loading installation settings..." --weight=1 -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) -#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) -#REMOVEME? admin=$(ynh_app_setting_get --app=$app --key=admin) -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name) -#REMOVEME? port=$(ynh_app_setting_get --app=$app --key=port) -#REMOVEME? password=$(ynh_app_setting_get --app=$app --key=password) -#REMOVEME? admin=$(ynh_app_setting_get --app=$app --key=admin) -#REMOVEME? email=$(ynh_app_setting_get --app=$app --key=email) -#REMOVEME? mongo_version=$(ynh_app_setting_get --app=$app --key=mongo_version) +db_name=$(ynh_app_setting_get --app=$app --key=db_name) +password=$(ynh_app_setting_get --app=$app --key=password) +email=$(ynh_app_setting_get --app=$app --key=email) +mongo_version=$(ynh_app_setting_get --app=$app --key=mongo_version) #================================================= # CHECK VERSION @@ -33,21 +25,6 @@ source /usr/share/yunohost/helpers upgrade_type=$(ynh_check_app_version_changed) -#================================================= -# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP -#================================================= -#REMOVEME? ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=45 - -# Backup the current version of the app -#REMOVEME? ynh_backup_before_upgrade -#REMOVEME? ynh_clean_setup () { - ynh_clean_check_starting - # Restore it if the upgrade fails -#REMOVEME? ynh_restore_upgradebackup -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - #================================================= # STANDARD UPGRADE STEPS #================================================= @@ -62,33 +39,12 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" #================================================= ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 -# If install_dir doesn't exist, create it -if [ -z "$install_dir" ]; then -#REMOVEME? install_dir=/var/www/$app -#REMOVEME? ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir -fi - -# Cleaning legacy permissions -#REMOVEME? if ynh_legacy_permissions_exists; then -#REMOVEME? ynh_legacy_permissions_delete_all - - ynh_app_setting_delete --app=$app --key=is_public -fi - # If mongo_version doesn't exist, create it if [ -z "$mongo_version" ]; then mongo_version="$(mongod --version | grep -oP 'db version v\K.{0,3}')" ynh_app_setting_set --app=$app --key=mongo_version --value=$mongo_version fi -#================================================= -# CREATE DEDICATED USER -#================================================= -#REMOVEME? ynh_script_progression --message="Making sure dedicated system user exists..." --weight=4 - -# Create a dedicated user (if not existing) -#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -97,7 +53,7 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading source files..." --weight=22 # Remove the app directory securely -#REMOVEME? ynh_secure_remove --file="$install_dir" + ynh_secure_remove --file="$install_dir" # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" fi @@ -109,12 +65,10 @@ chown -R $app:$app "$install_dir" #================================================= # UPGRADE DEPENDENCIES #================================================= -#REMOVEME? ynh_script_progression --message="Upgrading dependencies..." --weight=7 +ynh_script_progression --message="Upgrading dependencies..." --weight=7 -#REMOVEME? ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version ynh_exec_warn_less ynh_install_mongo --mongo_version=$mongo_version -#REMOVEME? ynh_exec_warn_less ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg" #================================================= # NGINX CONFIGURATION @@ -183,13 +137,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=19 ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="SERVER RUNNING" -#================================================= -# RELOAD NGINX -#================================================= -#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." --weight=1 - -#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload - #================================================= # END OF SCRIPT #================================================= diff --git a/tests.toml b/tests.toml new file mode 100644 index 0000000..9358b03 --- /dev/null +++ b/tests.toml @@ -0,0 +1,10 @@ +test_format = 1.0 + +[default] + + # ------------------------------- + # Commits to test upgrade from + # ------------------------------- + + test_upgrade_from.78312cfb.name = "Upgrade from 4.7.2" + From 9dd39366ada4ad54dde95d11524fc50273790f29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 16 Feb 2023 10:07:57 +0100 Subject: [PATCH 03/38] Fix --- doc/{DISCLAIMER.md => POST_INSTALL.md} | 0 doc/{DISCLAIMER_fr.md => POST_INSTALL_fr.md} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename doc/{DISCLAIMER.md => POST_INSTALL.md} (100%) rename doc/{DISCLAIMER_fr.md => POST_INSTALL_fr.md} (100%) diff --git a/doc/DISCLAIMER.md b/doc/POST_INSTALL.md similarity index 100% rename from doc/DISCLAIMER.md rename to doc/POST_INSTALL.md diff --git a/doc/DISCLAIMER_fr.md b/doc/POST_INSTALL_fr.md similarity index 100% rename from doc/DISCLAIMER_fr.md rename to doc/POST_INSTALL_fr.md From 2bc8019ad18b2d29f0549f95309626fbe131c843 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Thu, 16 Feb 2023 09:08:06 +0000 Subject: [PATCH 04/38] Auto-update README --- README.md | 23 ----------------------- README_fr.md | 24 ------------------------ 2 files changed, 47 deletions(-) diff --git a/README.md b/README.md index 4191d40..605944c 100644 --- a/README.md +++ b/README.md @@ -35,29 +35,6 @@ Rocket.Chat is an open-source fully customizable communications platform develop ![Screenshot of Rocket.Chat](./doc/screenshots/screenshot.jpg) -## Disclaimers / important information - -### E-mail Configuration - -To enable E-mail for address verification, go to Rocket.Chat Administration panel under Settings -> E-mail -> SMTP and set as follow: - -- Protocole: `smtp` -- Host: `localhost` -- Port: `25` -- From -mail: `rocketchat@domain.tld` - - -### Configure and activate federation for Rocket.Chat - -https://support.indie.host/help/fr-fr/13/40 - - -### Mobile Apps - -In addition to the web interface, you can also download Rocket.Chat clients for: - -[![Rocket.Chat on Apple App Store](https://user-images.githubusercontent.com/551004/29770691-a2082ff4-8bc6-11e7-89a6-964cd405ea8e.png)](https://itunes.apple.com/us/app/rocket-chat/id1148741252?mt=8) [![Rocket.Chat on Google Play](https://user-images.githubusercontent.com/551004/29770692-a20975c6-8bc6-11e7-8ab0-1cde275496e0.png)](https://play.google.com/store/apps/details?id=chat.rocket.android) [![](https://user-images.githubusercontent.com/551004/48210349-50649480-e35e-11e8-97d9-74a4331faf3a.png)](https://f-droid.org/en/packages/chat.rocket.android) - ## Documentation and resources * Official app website: diff --git a/README_fr.md b/README_fr.md index 10d2662..2dc2baf 100644 --- a/README_fr.md +++ b/README_fr.md @@ -35,30 +35,6 @@ Rocket.Chat est une plate-forme de communication open source entièrement person ![Capture d’écran de Rocket.Chat](./doc/screenshots/screenshot.jpg) -## Avertissements / informations importantes - -### Configuration de l'e-mail - -Pour activer l'e-mail pour la vérification des adresses, accédez au panneau d'administration de Rocket.Chat sous Paramètres -> E-mail -> SMTP et définissez comme suit : - -- Protocole : `smtp` -- Hôte : `localhost` -- Port : `25` -- De l'e-mail : `rocketchat@domain.tld` - - -### Configurer et activer la fédération pour Rocket.Chat - -https://support.indie.host/help/fr-fr/13/40 - - -### Applications Mobiles - -En plus de l'interface Web, vous pouvez également télécharger les clients Rocket.Chat pour : - -[![Rocket.Chat on Apple App Store](https://user-images.githubusercontent.com/551004/29770691-a2082ff4-8bc6-11e7-89a6-964cd405ea8e.png)](https://itunes.apple.com/us/app/rocket-chat/id1148741252?mt=8) [![Rocket.Chat on Google Play](https://user-images.githubusercontent.com/551004/29770692-a20975c6-8bc6-11e7-8ab0-1cde275496e0.png)](https://play.google.com/store/apps/details?id=chat.rocket.android) [![](https://user-images.githubusercontent.com/551004/48210349-50649480-e35e-11e8-97d9-74a4331faf3a.png)](https://f-droid.org/en/packages/chat.rocket.android) - - ## Documentations et ressources * Site officiel de l’app : From 9e10a11baa58c1c6586e35d7ece706805fe4a29f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 16 Feb 2023 10:08:48 +0100 Subject: [PATCH 05/38] cleanup --- check_process | 28 ----------------------- manifest.json | 62 --------------------------------------------------- 2 files changed, 90 deletions(-) delete mode 100644 check_process delete mode 100644 manifest.json diff --git a/check_process b/check_process deleted file mode 100644 index d5f2de5..0000000 --- a/check_process +++ /dev/null @@ -1,28 +0,0 @@ -;; Test complet - ; Manifest - domain="domain.tld" - path="/path" - is_public=1 - admin="john" - password="1Strong-Password" - ; Checks - pkg_linter=1 - setup_sub_dir=1 - setup_root=1 - setup_nourl=0 - setup_private=1 - setup_public=1 - upgrade=1 - #4.7.2~ynh2 - upgrade=1 from_commit=78312cfb3e6fc6b7bff47843ee8209aba07498c0 - backup_restore=1 - multi_instance=1 - port_already_use=0 - change_url=1 -;;; Options -Email= -Notification=none -;;; Upgrade options - ; commit=78312cfb3e6fc6b7bff47843ee8209aba07498c0 - name=Merge pull request #125 - manifest_arg=domain=DOMAIN&path=PATH&is_public=1&language=fr&admin=USER&password=pass&port=666& diff --git a/manifest.json b/manifest.json deleted file mode 100644 index bbb9965..0000000 --- a/manifest.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "name": "Rocket.Chat", - "id": "rocketchat", - "packaging_format": 1, - "description": { - "en": "Team collaboration communication platform", - "fr": "Plateforme de communication collaborative en équipe" - }, - "version": "5.4.3~ynh1", - "url": "https://rocket.chat", - "upstream": { - "license": "GPL-3.0", - "website": "https://rocket.chat/", - "demo": "https://cloud.rocket.chat/trial", - "admindoc": "https://docs.rocket.chat/", - "userdoc": "https://docs.rocket.chat/guides/user-guides", - "code": "https://github.com/RocketChat/Rocket.Chat" - }, - "license": "GPL-3.0", - "maintainer": { - "name": "eric_G", - "email": "" - }, - "requirements": { - "yunohost": ">> 11.1.7" - }, - "multi_instance": true, - "services": [ - "nginx" - ], - "arguments": { - "install": [ - { - "name": "domain", - "type": "domain" - }, - { - "name": "path", - "type": "path", - "example": "/rocketchat", - "default": "/rocketchat" - }, - { - "name": "is_public", - "type": "boolean", - "help": { - "en": "You must activate public site if you want to connect a Mobile or desktop client to Rocket.Chat. This can be changed later via the webadmin.", - "fr": "Vous devez activer site public si vous souhaitez connecter un client mobile ou desktop à Rocket.Chat. Vous pourrez changer ceci plus tard via la webadmin." - }, - "default": true - }, - { - "name": "admin", - "type": "user" - }, - { - "name": "password", - "type": "password" - } - ] - } -} From 1b1b5a8518d6976bbebfecbd59e1a9de2c6ba7bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 16 Feb 2023 10:11:20 +0100 Subject: [PATCH 06/38] Update manifest.toml --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index d8c4867..8106c02 100644 --- a/manifest.toml +++ b/manifest.toml @@ -18,7 +18,7 @@ userdoc = "https://docs.rocket.chat/guides/user-guides" code = "https://github.com/RocketChat/Rocket.Chat" [integration] -yunohost = ">> 11.1.7" +yunohost = ">= 11.1.7" architectures = ["amd64"] multi_instance = true ldap = false From d58fd8fc5a5cdbf7d75863e279b3ccd8a6792303 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 19 Feb 2023 18:42:54 +0100 Subject: [PATCH 07/38] Update manifest.toml --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 8106c02..02a63f0 100644 --- a/manifest.toml +++ b/manifest.toml @@ -18,7 +18,7 @@ userdoc = "https://docs.rocket.chat/guides/user-guides" code = "https://github.com/RocketChat/Rocket.Chat" [integration] -yunohost = ">= 11.1.7" +yunohost = ">= 11.1.8" architectures = ["amd64"] multi_instance = true ldap = false From e366ffd045097c74e4298862f19fa64f86ea2791 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 19 Feb 2023 19:02:44 +0100 Subject: [PATCH 08/38] Update manifest.toml --- manifest.toml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/manifest.toml b/manifest.toml index 02a63f0..221b009 100644 --- a/manifest.toml +++ b/manifest.toml @@ -58,9 +58,8 @@ ram.runtime = "50M" main.url = "/" [resources.apt] - packages = "apt-transport-https build-essential gzip curl fontconfig graphicsmagick" + packages = "apt-transport-https build-essential gzip curl fontconfig graphicsmagick" - [[resources.apt.extras]] - repo = "deb https://dl.yarnpkg.com/debian/ stable main" - key = "https://dl.yarnpkg.com/debian/pubkey.gpg" - packages = "yarn" + extras.yarn.repo = "deb https://dl.yarnpkg.com/debian/ stable main" + extras.yarn.key = "https://dl.yarnpkg.com/debian/pubkey.gpg" + extras.yarn.packages = "yarn" From 97952f9b48ab5fc992b2893423f216cce42fce5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 19 Feb 2023 19:03:54 +0100 Subject: [PATCH 09/38] fix --- doc/{POST_INSTALL.md => ADMIN.md} | 0 doc/{POST_INSTALL_fr.md => ADMIN_fr.md} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename doc/{POST_INSTALL.md => ADMIN.md} (100%) rename doc/{POST_INSTALL_fr.md => ADMIN_fr.md} (100%) diff --git a/doc/POST_INSTALL.md b/doc/ADMIN.md similarity index 100% rename from doc/POST_INSTALL.md rename to doc/ADMIN.md diff --git a/doc/POST_INSTALL_fr.md b/doc/ADMIN_fr.md similarity index 100% rename from doc/POST_INSTALL_fr.md rename to doc/ADMIN_fr.md From 0db57cee2723553a79bf69b57b41046485a7129d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 19 Feb 2023 19:06:09 +0100 Subject: [PATCH 10/38] fix --- scripts/_common.sh | 2 +- scripts/change_url | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 8de137a..b74e818 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -6,7 +6,7 @@ nodejs_version=14 -mongo_version=5.0 +mongo_version=6.0 #================================================= # PERSONAL HELPERS diff --git a/scripts/change_url b/scripts/change_url index a85a152..9743841 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -19,8 +19,6 @@ old_path=$YNH_APP_OLD_PATH new_domain=$YNH_APP_NEW_DOMAIN new_path=$YNH_APP_NEW_PATH -app=$YNH_APP_INSTANCE_NAME - #================================================= # BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP #================================================= From d044f8bb793ca4aafbc5a4012896f6651bd3a1f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 2 Mar 2023 22:25:13 +0100 Subject: [PATCH 11/38] Fix --- manifest.toml | 2 +- scripts/change_url | 75 +--------------------------------------------- 2 files changed, 2 insertions(+), 75 deletions(-) diff --git a/manifest.toml b/manifest.toml index 221b009..83c1df9 100644 --- a/manifest.toml +++ b/manifest.toml @@ -18,7 +18,7 @@ userdoc = "https://docs.rocket.chat/guides/user-guides" code = "https://github.com/RocketChat/Rocket.Chat" [integration] -yunohost = ">= 11.1.8" +yunohost = ">= 11.1.12" architectures = ["amd64"] multi_instance = true ldap = false diff --git a/scripts/change_url b/scripts/change_url index 9743841..f5cd86d 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -9,50 +9,6 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# RETRIEVE ARGUMENTS -#================================================= - -old_domain=$YNH_APP_OLD_DOMAIN -old_path=$YNH_APP_OLD_PATH - -new_domain=$YNH_APP_NEW_DOMAIN -new_path=$YNH_APP_NEW_PATH - -#================================================= -# BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP -#================================================= -ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --weight=48 - -# Backup the current version of the app -ynh_backup_before_upgrade -ynh_clean_setup () { - ynh_clean_check_starting - # Remove the new domain config file, the remove script won't do it as it doesn't know yet its location. - ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" - - # Restore it if the upgrade fails - ynh_restore_upgradebackup -} -# Exit if an error occurs during the execution of the script -ynh_abort_if_errors - -#================================================= -# CHECK WHICH PARTS SHOULD BE CHANGED -#================================================= - -change_domain=0 -if [ "$old_domain" != "$new_domain" ] -then - change_domain=1 -fi - -change_path=0 -if [ "$old_path" != "$new_path" ] -then - change_path=1 -fi - #================================================= # STANDARD MODIFICATIONS #================================================= @@ -67,29 +23,7 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" #================================================= ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1 -nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf - -# Change the path in the NGINX config file -if [ $change_path -eq 1 ] -then - # Make a backup of the original NGINX config file if modified - ynh_backup_if_checksum_is_different --file="$nginx_conf_path" - # Set global variables for NGINX helper - domain="$old_domain" - path_url="$new_path" - # Create a dedicated NGINX config - ynh_add_nginx_config -fi - -# Change the domain for NGINX -if [ $change_domain -eq 1 ] -then - # Delete file checksum for the old conf file location - ynh_delete_file_checksum --file="$nginx_conf_path" - mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf - # Store file checksum for the new config file location - ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" -fi +ynh_change_url_nginx_config #================================================= # SPECIFIC MODIFICATIONS @@ -108,13 +42,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=16 ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="SERVER RUNNING" -#================================================= -# RELOAD NGINX -#================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 - -ynh_systemd_action --service_name=nginx --action=reload - #================================================= # END OF SCRIPT #================================================= From fcb82704f8a067a1ef6db96e1a9d2112eb63f708 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 5 Mar 2023 17:14:12 +0100 Subject: [PATCH 12/38] Update manifest.toml --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 83c1df9..97c468e 100644 --- a/manifest.toml +++ b/manifest.toml @@ -18,7 +18,7 @@ userdoc = "https://docs.rocket.chat/guides/user-guides" code = "https://github.com/RocketChat/Rocket.Chat" [integration] -yunohost = ">= 11.1.12" +yunohost = ">= 11.1.13" architectures = ["amd64"] multi_instance = true ldap = false From be1852f38ff34d7d66978386f45bfbe1da053574 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 5 Mar 2023 17:14:49 +0100 Subject: [PATCH 13/38] Update _common.sh --- scripts/_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index b74e818..8de137a 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -6,7 +6,7 @@ nodejs_version=14 -mongo_version=6.0 +mongo_version=5.0 #================================================= # PERSONAL HELPERS From 688defe2ffd97b8a31d720c20f0f5b2fdb6dccd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 9 Mar 2023 22:05:21 +0100 Subject: [PATCH 14/38] Update manifest.toml --- manifest.toml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 97c468e..25516af 100644 --- a/manifest.toml +++ b/manifest.toml @@ -18,7 +18,7 @@ userdoc = "https://docs.rocket.chat/guides/user-guides" code = "https://github.com/RocketChat/Rocket.Chat" [integration] -yunohost = ">= 11.1.13" +yunohost = ">= 11.1.14" architectures = ["amd64"] multi_instance = true ldap = false @@ -48,6 +48,13 @@ ram.runtime = "50M" type = "password" [resources] + [resources.sources] + + [resources.sources.main] + url = "https://releases.rocket.chat/5.4.3/download" + sha256 = "f8b774f35bde97c601c4061e90747cb4a724646f5865e8074064ab24b9c68d0b" + + [resources.system_user] [resources.install_dir] From 162dd65500c9a28d2dea4a0fcbffc895b99e44ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 10 Mar 2023 08:34:27 +0100 Subject: [PATCH 15/38] 6.0.0 --- conf/app.src | 4 ++-- manifest.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/conf/app.src b/conf/app.src index 59f4a80..7eabd40 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://releases.rocket.chat/5.4.3/download -SOURCE_SUM=f8b774f35bde97c601c4061e90747cb4a724646f5865e8074064ab24b9c68d0b +SOURCE_URL=https://releases.rocket.chat/6.0.0/download +SOURCE_SUM=c2c60f66f345626c04af6c172202ff3e423884e2ca54d2d9553506bec816b1e0 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/manifest.toml b/manifest.toml index 25516af..02cf718 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Rocket.Chat" description.en = "Team collaboration communication platform" description.fr = "Plateforme de communication collaborative en équipe" -version = "5.4.3~ynh1" +version = "6.0.0~ynh1" maintainers = ["eric_G"] From 7dadb3c455ced0e3044536f79b0d204c5720b2ab Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Fri, 10 Mar 2023 07:34:34 +0000 Subject: [PATCH 16/38] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 605944c..bf4b73f 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ Rocket.Chat is an open-source fully customizable communications platform develop - Mobile Apps for [iOS](https://apps.apple.com/app/rocket-chat/id1148741252) and [Android](https://play.google.com/store/apps/details?id=chat.rocket.android) - Desktop Apps for [macOS](https://apps.apple.com/br/app/rocket-chat/id1086818840), [Linux](https://snapcraft.io/rocketchat-desktop) and [Windows](https://releases.rocket.chat/desktop/latest/download) -**Shipped version:** 5.4.3~ynh1 +**Shipped version:** 6.0.0~ynh1 **Demo:** https://cloud.rocket.chat/trial diff --git a/README_fr.md b/README_fr.md index 2dc2baf..535d6cd 100644 --- a/README_fr.md +++ b/README_fr.md @@ -27,7 +27,7 @@ Rocket.Chat est une plate-forme de communication open source entièrement person - Applications mobiles pour [iOS](https://apps.apple.com/app/rocket-chat/id1148741252) et [Android](https://play.google.com/store/apps/details?id=chat.rocket.android) - Applications de bureau pour [macOS](https://apps.apple.com/br/app/rocket-chat/id1086818840), [Linux](https://snapcraft.io/rocketchat-desktop) et [Windows](https://releases.rocket.chat/desktop/latest/download) -**Version incluse :** 5.4.3~ynh1 +**Version incluse :** 6.0.0~ynh1 **Démo :** https://cloud.rocket.chat/trial From 45027b7b1aa9dd0997df09b17df6e453c52e3257 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 10 Mar 2023 08:36:26 +0100 Subject: [PATCH 17/38] Update manifest.toml --- manifest.toml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/manifest.toml b/manifest.toml index 02cf718..6b4b756 100644 --- a/manifest.toml +++ b/manifest.toml @@ -51,9 +51,8 @@ ram.runtime = "50M" [resources.sources] [resources.sources.main] - url = "https://releases.rocket.chat/5.4.3/download" - sha256 = "f8b774f35bde97c601c4061e90747cb4a724646f5865e8074064ab24b9c68d0b" - + url = "https://releases.rocket.chat/6.0.0/download" + sha256 = "c2c60f66f345626c04af6c172202ff3e423884e2ca54d2d9553506bec816b1e0" [resources.system_user] From 40bec9eba38138ef8318fdc96fdc387f54ac128d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 10 Mar 2023 08:36:42 +0100 Subject: [PATCH 18/38] Delete app.src --- conf/app.src | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 conf/app.src diff --git a/conf/app.src b/conf/app.src deleted file mode 100644 index 7eabd40..0000000 --- a/conf/app.src +++ /dev/null @@ -1,7 +0,0 @@ -SOURCE_URL=https://releases.rocket.chat/6.0.0/download -SOURCE_SUM=c2c60f66f345626c04af6c172202ff3e423884e2ca54d2d9553506bec816b1e0 -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=tar.gz -SOURCE_IN_SUBDIR=true -SOURCE_FILENAME=rocket.chat.tgz -SOURCE_EXTRACT=true From 99e679ff16ebc47f21f30cc35ee6979bed7d3dd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 10 Mar 2023 08:38:41 +0100 Subject: [PATCH 19/38] Fix --- conf/rocketchat_ldap.js | 81 ----------------------------------------- scripts/backup | 7 ---- 2 files changed, 88 deletions(-) delete mode 100644 conf/rocketchat_ldap.js diff --git a/conf/rocketchat_ldap.js b/conf/rocketchat_ldap.js deleted file mode 100644 index 23de9a0..0000000 --- a/conf/rocketchat_ldap.js +++ /dev/null @@ -1,81 +0,0 @@ -use rocketchat - - -db.rocketchat_settings.update( - { "_id" : "LDAP_Enable" }, - { - $set: { "value": true } - } -) -db.rocketchat_settings.update( - { "_id" : "LDAP_Login_Fallback" }, - { - $set: { "value": false } - } -) -db.rocketchat_settings.update( - { "_id" : "LDAP_Host" }, - { - $set: { "value": "localhost" } - } -) -db.rocketchat_settings.update( - { "_id" : "LDAP_Port" }, - { - $set: { "value": "389" } - } -) -db.rocketchat_settings.update( - { "_id" : "LDAP_Reconnect" }, - { - $set: { "value": true } - } -) -db.rocketchat_settings.update( - { "_id" : "LDAP_BaseDN" }, - { - $set: { "value": "dc=yunohost,dc=org" } - } -) -db.rocketchat_settings.update( - { "_id" : "LDAP_Username_Field" }, - { - $set: { "value": "uid" } - } -) -db.rocketchat_settings.update( - { "_id" : "LDAP_Unique_Identifier_Field" }, - { - $set: { "value": "uid" } - } -) -db.rocketchat_settings.update( - { "_id" : "LDAP_Domain_Search_Object_Class" }, - { - $set: { "value": "inetOrgPerson" } - } -) -db.rocketchat_settings.update( - { "_id" : "LDAP_Sync_User_Data" }, - { - $set: { "value": true } - } -) -db.rocketchat_settings.update( - { "_id" : "Accounts_RegistrationForm" }, - { - $set: { "value": "Enabled" } - } -) -db.rocketchat_settings.update( - { "_id" : "LDAP_User_Search_Filter" }, - { - $set: { "value": "(objectclass=inetOrgPerson)" } - } -) -db.rocketchat_settings.update( - { "_id" : "LDAP_User_Search_Field" }, - { - $set: { "value": "uid" } - } -) diff --git a/scripts/backup b/scripts/backup index 79d7175..3f4ba63 100644 --- a/scripts/backup +++ b/scripts/backup @@ -10,13 +10,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# LOAD SETTINGS -#================================================= -ynh_print_info --message="Loading installation settings..." - -db_name=$(ynh_app_setting_get --app=$app --key=db_name) - #================================================= # DECLARE DATA AND CONF FILES TO BACKUP #================================================= From e2514251a189e530b6a3fa4027c2b14146d19c1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 10 Mar 2023 10:35:10 +0100 Subject: [PATCH 20/38] Update tests.toml --- tests.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests.toml b/tests.toml index 9358b03..0d6070f 100644 --- a/tests.toml +++ b/tests.toml @@ -6,5 +6,5 @@ test_format = 1.0 # Commits to test upgrade from # ------------------------------- - test_upgrade_from.78312cfb.name = "Upgrade from 4.7.2" - + test_upgrade_from.8c5ad8d9.name = "Upgrade from 5.4.3" + \ No newline at end of file From 72ac7e3800f47fda61dfd416e91ad442b816ace2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 10 Mar 2023 11:23:49 +0100 Subject: [PATCH 21/38] Update manifest.toml --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 6b4b756..e7bb6cc 100644 --- a/manifest.toml +++ b/manifest.toml @@ -50,7 +50,7 @@ ram.runtime = "50M" [resources] [resources.sources] - [resources.sources.main] + [resources.sources.main.app] url = "https://releases.rocket.chat/6.0.0/download" sha256 = "c2c60f66f345626c04af6c172202ff3e423884e2ca54d2d9553506bec816b1e0" From 98464d5f7d4b962ef1aa9d094157c386379d2918 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 10 Mar 2023 11:27:23 +0100 Subject: [PATCH 22/38] Update manifest.toml --- manifest.toml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/manifest.toml b/manifest.toml index e7bb6cc..093949b 100644 --- a/manifest.toml +++ b/manifest.toml @@ -49,10 +49,8 @@ ram.runtime = "50M" [resources] [resources.sources] - - [resources.sources.main.app] - url = "https://releases.rocket.chat/6.0.0/download" - sha256 = "c2c60f66f345626c04af6c172202ff3e423884e2ca54d2d9553506bec816b1e0" + url = "https://releases.rocket.chat/6.0.0/download" + sha256 = "c2c60f66f345626c04af6c172202ff3e423884e2ca54d2d9553506bec816b1e0" [resources.system_user] From 1e07d079030c27995e3ffd297ff3c1b340c024ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 10 Mar 2023 11:55:02 +0100 Subject: [PATCH 23/38] Update manifest.toml --- manifest.toml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/manifest.toml b/manifest.toml index 093949b..6ea79e1 100644 --- a/manifest.toml +++ b/manifest.toml @@ -49,8 +49,13 @@ ram.runtime = "50M" [resources] [resources.sources] - url = "https://releases.rocket.chat/6.0.0/download" - sha256 = "c2c60f66f345626c04af6c172202ff3e423884e2ca54d2d9553506bec816b1e0" + + [resources.sources.main] + # This will pre-fetch the asset which can then be deployed during the install/upgrade scripts with : + # ynh_setup_source --dest_dir="$install_dir" + # You can also define other assets than "main" and add --source_id="foobar" in the previous command + url = "https://releases.rocket.chat/6.0.0/download" + sha256 = "c2c60f66f345626c04af6c172202ff3e423884e2ca54d2d9553506bec816b1e0" [resources.system_user] From a221f39cbc22043093608dad94635bc1017d2c71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 10 Mar 2023 12:00:25 +0100 Subject: [PATCH 24/38] fix --- manifest.toml | 5 +---- scripts/install | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/manifest.toml b/manifest.toml index 6ea79e1..edec1b9 100644 --- a/manifest.toml +++ b/manifest.toml @@ -50,10 +50,7 @@ ram.runtime = "50M" [resources] [resources.sources] - [resources.sources.main] - # This will pre-fetch the asset which can then be deployed during the install/upgrade scripts with : - # ynh_setup_source --dest_dir="$install_dir" - # You can also define other assets than "main" and add --source_id="foobar" in the previous command + [resources.sources.app] url = "https://releases.rocket.chat/6.0.0/download" sha256 = "c2c60f66f345626c04af6c172202ff3e423884e2ca54d2d9553506bec816b1e0" diff --git a/scripts/install b/scripts/install index 6644b6b..f34a781 100644 --- a/scripts/install +++ b/scripts/install @@ -48,7 +48,7 @@ ynh_mongo_setup_db --db_user=$db_user --db_name=$db_name ynh_script_progression --message="Setting up source files..." --weight=10 # Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir="$install_dir" +ynh_setup_source --dest_dir="$install_dir" --source_id="app" mkdir "/tmp/ufs" From 3fceb713a428fc8d9280fb5ae1a0c3e53ac4b8ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 10 Mar 2023 12:40:35 +0100 Subject: [PATCH 25/38] Update manifest.toml --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index edec1b9..6b4b756 100644 --- a/manifest.toml +++ b/manifest.toml @@ -50,7 +50,7 @@ ram.runtime = "50M" [resources] [resources.sources] - [resources.sources.app] + [resources.sources.main] url = "https://releases.rocket.chat/6.0.0/download" sha256 = "c2c60f66f345626c04af6c172202ff3e423884e2ca54d2d9553506bec816b1e0" From 637bcaebbbe0e5b72a3ad3e198cb4ac81aa051dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 23 Mar 2023 08:13:23 +0100 Subject: [PATCH 26/38] Update manifest.toml --- manifest.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/manifest.toml b/manifest.toml index 6b4b756..21c8569 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Rocket.Chat" description.en = "Team collaboration communication platform" description.fr = "Plateforme de communication collaborative en équipe" -version = "6.0.0~ynh1" +version = "6.0.1~ynh1" maintainers = ["eric_G"] @@ -18,7 +18,7 @@ userdoc = "https://docs.rocket.chat/guides/user-guides" code = "https://github.com/RocketChat/Rocket.Chat" [integration] -yunohost = ">= 11.1.14" +yunohost = ">= 11.1.15" architectures = ["amd64"] multi_instance = true ldap = false @@ -51,8 +51,8 @@ ram.runtime = "50M" [resources.sources] [resources.sources.main] - url = "https://releases.rocket.chat/6.0.0/download" - sha256 = "c2c60f66f345626c04af6c172202ff3e423884e2ca54d2d9553506bec816b1e0" + url = "https://releases.rocket.chat/6.0.1/download" + sha256 = "b927af1a3d5e82abcdb1c54f5965daa2a5d4c3e28a5919bad90d72ee732c834e" [resources.system_user] From 2a913de15be2d629c0dd3b8796979b5a090030d6 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Thu, 23 Mar 2023 07:13:33 +0000 Subject: [PATCH 27/38] Auto-update README --- README.md | 6 +++++- README_fr.md | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bf4b73f..67bbe42 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ Rocket.Chat is an open-source fully customizable communications platform develop - Mobile Apps for [iOS](https://apps.apple.com/app/rocket-chat/id1148741252) and [Android](https://play.google.com/store/apps/details?id=chat.rocket.android) - Desktop Apps for [macOS](https://apps.apple.com/br/app/rocket-chat/id1086818840), [Linux](https://snapcraft.io/rocketchat-desktop) and [Windows](https://releases.rocket.chat/desktop/latest/download) -**Shipped version:** 6.0.0~ynh1 +**Shipped version:** 6.0.1~ynh1 **Demo:** https://cloud.rocket.chat/trial @@ -35,6 +35,10 @@ Rocket.Chat is an open-source fully customizable communications platform develop ![Screenshot of Rocket.Chat](./doc/screenshots/screenshot.jpg) +## :red_circle: Antifeatures + +- **Not totally free upstream**: The packaged app is under an overall free licence, but with clauses that restrict its use. + ## Documentation and resources * Official app website: diff --git a/README_fr.md b/README_fr.md index 535d6cd..bb5a4db 100644 --- a/README_fr.md +++ b/README_fr.md @@ -27,7 +27,7 @@ Rocket.Chat est une plate-forme de communication open source entièrement person - Applications mobiles pour [iOS](https://apps.apple.com/app/rocket-chat/id1148741252) et [Android](https://play.google.com/store/apps/details?id=chat.rocket.android) - Applications de bureau pour [macOS](https://apps.apple.com/br/app/rocket-chat/id1086818840), [Linux](https://snapcraft.io/rocketchat-desktop) et [Windows](https://releases.rocket.chat/desktop/latest/download) -**Version incluse :** 6.0.0~ynh1 +**Version incluse :** 6.0.1~ynh1 **Démo :** https://cloud.rocket.chat/trial @@ -35,6 +35,10 @@ Rocket.Chat est une plate-forme de communication open source entièrement person ![Capture d’écran de Rocket.Chat](./doc/screenshots/screenshot.jpg) +## :red_circle: Fonctions indésirables + +- **Not totally free upstream**: The packaged app is under an overall free licence, but with clauses that restrict its use. + ## Documentations et ressources * Site officiel de l’app : From 9a019ff10ef1c610947ab61b052463a85e7074cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 30 Mar 2023 15:59:55 +0200 Subject: [PATCH 28/38] Update manifest.toml --- manifest.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manifest.toml b/manifest.toml index 21c8569..0f5c1e8 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Rocket.Chat" description.en = "Team collaboration communication platform" description.fr = "Plateforme de communication collaborative en équipe" -version = "6.0.1~ynh1" +version = "6.1.0~ynh1" maintainers = ["eric_G"] @@ -51,8 +51,8 @@ ram.runtime = "50M" [resources.sources] [resources.sources.main] - url = "https://releases.rocket.chat/6.0.1/download" - sha256 = "b927af1a3d5e82abcdb1c54f5965daa2a5d4c3e28a5919bad90d72ee732c834e" + url = "https://releases.rocket.chat/6.1.0/download" + sha256 = "33b26edabb38d3539c865d7c83c161d3131b9caf4b1ce344e641df9d05750dd0" [resources.system_user] From eb15eb8c76e8c777cc964567513a6f25467091b6 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Thu, 30 Mar 2023 14:00:08 +0000 Subject: [PATCH 29/38] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 67bbe42..31b2a9e 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ Rocket.Chat is an open-source fully customizable communications platform develop - Mobile Apps for [iOS](https://apps.apple.com/app/rocket-chat/id1148741252) and [Android](https://play.google.com/store/apps/details?id=chat.rocket.android) - Desktop Apps for [macOS](https://apps.apple.com/br/app/rocket-chat/id1086818840), [Linux](https://snapcraft.io/rocketchat-desktop) and [Windows](https://releases.rocket.chat/desktop/latest/download) -**Shipped version:** 6.0.1~ynh1 +**Shipped version:** 6.1.0~ynh1 **Demo:** https://cloud.rocket.chat/trial diff --git a/README_fr.md b/README_fr.md index bb5a4db..356d703 100644 --- a/README_fr.md +++ b/README_fr.md @@ -27,7 +27,7 @@ Rocket.Chat est une plate-forme de communication open source entièrement person - Applications mobiles pour [iOS](https://apps.apple.com/app/rocket-chat/id1148741252) et [Android](https://play.google.com/store/apps/details?id=chat.rocket.android) - Applications de bureau pour [macOS](https://apps.apple.com/br/app/rocket-chat/id1086818840), [Linux](https://snapcraft.io/rocketchat-desktop) et [Windows](https://releases.rocket.chat/desktop/latest/download) -**Version incluse :** 6.0.1~ynh1 +**Version incluse :** 6.1.0~ynh1 **Démo :** https://cloud.rocket.chat/trial From 8d7c74be8ba891dff55be24ab05a421867179c48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 30 Mar 2023 16:01:11 +0200 Subject: [PATCH 30/38] Update install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index f34a781..6644b6b 100644 --- a/scripts/install +++ b/scripts/install @@ -48,7 +48,7 @@ ynh_mongo_setup_db --db_user=$db_user --db_name=$db_name ynh_script_progression --message="Setting up source files..." --weight=10 # Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir="$install_dir" --source_id="app" +ynh_setup_source --dest_dir="$install_dir" mkdir "/tmp/ufs" From bddd46c1d4df400dff9883a21f78f0b45f8c9694 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 30 Mar 2023 16:05:39 +0200 Subject: [PATCH 31/38] cleaning --- scripts/install | 49 +++++++++++++++---------------------------------- scripts/remove | 44 ++++++++++---------------------------------- scripts/restore | 28 ++-------------------------- scripts/upgrade | 24 +++--------------------- 4 files changed, 30 insertions(+), 115 deletions(-) diff --git a/scripts/install b/scripts/install index 6644b6b..35dc36f 100644 --- a/scripts/install +++ b/scripts/install @@ -52,19 +52,10 @@ ynh_setup_source --dest_dir="$install_dir" mkdir "/tmp/ufs" -chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:$app "$install_dir" chown -R $app:$app "/tmp/ufs" -#================================================= -# NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Configuring NGINX web server..." --weight=3 - -# Create a dedicated NGINX config -ynh_add_nginx_config - #================================================= # SPECIFIC SETUP #================================================= @@ -82,6 +73,21 @@ if ynh_exec_warn_less ynh_mongo_exec --command="printjson(rs.status())" | grep - ynh_exec_warn_less ynh_mongo_exec --command="printjson(rs.initiate())" --eval fi +#================================================= +# SETUP SYSTEMD +#================================================= +ynh_script_progression --message="Configuring a systemd service..." --weight=1 + +# Create a dedicated NGINX config +ynh_add_nginx_config + +# Create a dedicated systemd config +ynh_add_systemd_config + +# Use logrotate to manage application logfile(s) +ynh_use_logrotate +yunohost service add $app --description="Team collaboration communication platform" + #============================================== # INSTALL ROCKETCHAT #============================================== @@ -92,31 +98,6 @@ pushd $install_dir/programs/server ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn install --unsafe-perm popd -#================================================= -# SETUP SYSTEMD -#================================================= -ynh_script_progression --message="Configuring a systemd service..." --weight=1 - -# Create a dedicated systemd config -ynh_add_systemd_config - -#================================================= -# GENERIC FINALIZATION -#================================================= -# SETUP LOGROTATE -#================================================= -ynh_script_progression --message="Configuring log rotation..." --weight=1 - -# Use logrotate to manage application logfile(s) -ynh_use_logrotate - -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 - -yunohost service add $app --description="Team collaboration communication platform" - #================================================= # START SYSTEMD SERVICE #================================================= diff --git a/scripts/remove b/scripts/remove index 64bf733..99d5c9a 100644 --- a/scripts/remove +++ b/scripts/remove @@ -30,22 +30,22 @@ then yunohost service remove $app fi -#================================================= -# STOP AND REMOVE SERVICE -#================================================= -ynh_script_progression --message="Stopping and removing the systemd service..." --weight=1 - # Remove the dedicated systemd config ynh_remove_systemd_config -#================================================= -# REMOVE LOGROTATE CONFIGURATION -#================================================= -ynh_script_progression --message="Removing logrotate configuration..." --weight=1 - # Remove the app-specific logrotate config ynh_remove_logrotate +if [ -d "/tmp/ufs" ]; then + ynh_secure_remove --file="/tmp/ufs" +fi + +# Remove the dedicated NGINX config +ynh_remove_nginx_config + +# Remove metapackage and its dependencies +ynh_remove_nodejs + #================================================= # REMOVE THE MONGODB DATABASE #================================================= @@ -60,30 +60,6 @@ ynh_systemd_action --service_name=mongod --action=restart --log_path=/var/log/mo # Remove a database if it exists, along with the associated user ynh_mongo_remove_db --db_user=$db_user --db_name=$db_name -#================================================= -# REMOVE APP MAIN DIR -#================================================= -ynh_script_progression --message="Removing app main directory..." --weight=2 - -if [ -d "/tmp/ufs" ]; then - ynh_secure_remove --file="/tmp/ufs" -fi - -#================================================= -# REMOVE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1 - -# Remove the dedicated NGINX config -ynh_remove_nginx_config - -#================================================= -# REMOVE DEPENDENCIES -#================================================= -ynh_script_progression --message="Removing dependencies..." --weight=4 - -# Remove metapackage and its dependencies -ynh_remove_nodejs ynh_remove_mongo #================================================= diff --git a/scripts/restore b/scripts/restore index 2500648..30680e7 100644 --- a/scripts/restore +++ b/scripts/restore @@ -15,7 +15,6 @@ source /usr/share/yunohost/helpers #================================================= ynh_script_progression --message="Loading installation settings..." --weight=1 -db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_user=$db_name mongo_version=$(ynh_app_setting_get --app=$app --key=mongo_version) @@ -26,7 +25,6 @@ ynh_script_progression --message="Restoring the app main directory..." --weight= ynh_restore_file --origin_path="$install_dir" -chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:$app "$install_dir" @@ -41,13 +39,6 @@ ynh_script_progression --message="Reinstalling dependencies..." --weight=40 ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version ynh_exec_warn_less ynh_install_mongo --mongo_version=$mongo_version -#================================================= -# 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 #================================================= @@ -77,21 +68,13 @@ fi #================================================= ynh_script_progression --message="Restoring the systemd configuration..." --weight=1 +ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" + ynh_restore_file --origin_path="/etc/systemd/system/$app.service" systemctl enable $app.service --quiet -#================================================= -# RESTORE THE LOGROTATE CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the logrotate configuration..." --weight=1 - ynh_restore_file --origin_path="/etc/logrotate.d/$app" -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 - yunohost service add $app --description="Team collaboration communication platform" #================================================= @@ -101,13 +84,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=19 ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="SERVER RUNNING" -#================================================= -# GENERIC FINALIZATION -#================================================= -# RELOAD NGINX AND PHP-FPM -#================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 - ynh_systemd_action --service_name=nginx --action=reload #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index aff0c07..bfc0a40 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -58,7 +58,6 @@ then ynh_setup_source --dest_dir="$install_dir" fi -chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:$app "$install_dir" @@ -70,14 +69,6 @@ ynh_script_progression --message="Upgrading dependencies..." --weight=7 ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version ynh_exec_warn_less ynh_install_mongo --mongo_version=$mongo_version -#================================================= -# NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=2 - -# Create a dedicated NGINX config -ynh_add_nginx_config - #================================================= # SPECIFIC UPGRADE #================================================= @@ -110,24 +101,15 @@ popd #================================================= ynh_script_progression --message="Upgrading systemd configuration..." --weight=2 +# Create a dedicated NGINX config +ynh_add_nginx_config + # Create a dedicated systemd config ynh_add_systemd_config -#================================================= -# GENERIC FINALIZATION -#================================================= -# SETUP LOGROTATE -#================================================= -ynh_script_progression --message="Upgrading logrotate configuration..." --weight=1 - # Use logrotate to manage app-specific logfile(s) ynh_use_logrotate --non-append -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 - yunohost service add $app --description="Team collaboration communication platform" #================================================= From 604ba9225633ef57d33be2e53cc2f1ab593592ed Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Thu, 30 Mar 2023 14:06:35 +0000 Subject: [PATCH 32/38] Auto-update README --- README.md | 5 ----- README_fr.md | 4 ---- 2 files changed, 9 deletions(-) diff --git a/README.md b/README.md index 2a6e549..31b2a9e 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,6 @@ Rocket.Chat is an open-source fully customizable communications platform develop - Mobile Apps for [iOS](https://apps.apple.com/app/rocket-chat/id1148741252) and [Android](https://play.google.com/store/apps/details?id=chat.rocket.android) - Desktop Apps for [macOS](https://apps.apple.com/br/app/rocket-chat/id1086818840), [Linux](https://snapcraft.io/rocketchat-desktop) and [Windows](https://releases.rocket.chat/desktop/latest/download) - **Shipped version:** 6.1.0~ynh1 **Demo:** https://cloud.rocket.chat/trial @@ -40,10 +39,6 @@ Rocket.Chat is an open-source fully customizable communications platform develop - **Not totally free upstream**: The packaged app is under an overall free licence, but with clauses that restrict its use. -## :red_circle: Antifeatures - -- **Not totally free upstream**: The packaged app is under an overall free licence, but with clauses that restrict its use. - ## Documentation and resources * Official app website: diff --git a/README_fr.md b/README_fr.md index dcd5806..356d703 100644 --- a/README_fr.md +++ b/README_fr.md @@ -39,10 +39,6 @@ Rocket.Chat est une plate-forme de communication open source entièrement person - **Not totally free upstream**: The packaged app is under an overall free licence, but with clauses that restrict its use. -## :red_circle: Fonctions indésirables - -- **Not totally free upstream**: The packaged app is under an overall free licence, but with clauses that restrict its use. - ## Documentations et ressources * Site officiel de l’app : From e4f769228e71d2de707c22be5438a809e5df5032 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 30 Mar 2023 16:06:39 +0200 Subject: [PATCH 33/38] Update install --- scripts/install | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/install b/scripts/install index 35dc36f..b370abb 100644 --- a/scripts/install +++ b/scripts/install @@ -19,7 +19,6 @@ email=$(ynh_user_get_info --username=$admin --key=mail) #================================================= # STORE SETTINGS FROM MANIFEST #================================================= -ynh_script_progression --message="Storing installation settings..." --weight=2 ynh_app_setting_set --app=$app --key=password --value="$password" ynh_app_setting_set --app=$app --key=email --value=$email From 5b3a658ad87efefd5cb4adcdda8dfbddc617c36c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 13 Apr 2023 08:41:35 +0200 Subject: [PATCH 34/38] 6.1.2 --- conf/app.src | 4 ++-- manifest.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/conf/app.src b/conf/app.src index b390c17..22df0e7 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://releases.rocket.chat/6.0.1/download -SOURCE_SUM=b927af1a3d5e82abcdb1c54f5965daa2a5d4c3e28a5919bad90d72ee732c834e +SOURCE_URL=https://releases.rocket.chat/6.1.2/download +SOURCE_SUM=2600755e7c2b9f8cd072662368469b6fa03ba34efba3fccd813d4287c7086965 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/manifest.json b/manifest.json index ee3232d..3d03945 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Team collaboration communication platform", "fr": "Plateforme de communication collaborative en équipe" }, - "version": "6.0.1~ynh1", + "version": "6.1.2~ynh1", "url": "https://rocket.chat", "upstream": { "license": "GPL-3.0", From c18e54588e4b5cedc744dca6b8b3b382ceb37e3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 13 Apr 2023 08:42:33 +0200 Subject: [PATCH 35/38] Update manifest.toml --- manifest.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manifest.toml b/manifest.toml index 0f5c1e8..85dab57 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Rocket.Chat" description.en = "Team collaboration communication platform" description.fr = "Plateforme de communication collaborative en équipe" -version = "6.1.0~ynh1" +version = "6.1.2~ynh1" maintainers = ["eric_G"] @@ -51,8 +51,8 @@ ram.runtime = "50M" [resources.sources] [resources.sources.main] - url = "https://releases.rocket.chat/6.1.0/download" - sha256 = "33b26edabb38d3539c865d7c83c161d3131b9caf4b1ce344e641df9d05750dd0" + url = "https://releases.rocket.chat/6.1.2/download" + sha256 = "2600755e7c2b9f8cd072662368469b6fa03ba34efba3fccd813d4287c7086965" [resources.system_user] From 3b0dcd6c01b27ec7790d934575502b15c9d57e9d Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Thu, 13 Apr 2023 06:42:41 +0000 Subject: [PATCH 36/38] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 31b2a9e..39bde3d 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ Rocket.Chat is an open-source fully customizable communications platform develop - Mobile Apps for [iOS](https://apps.apple.com/app/rocket-chat/id1148741252) and [Android](https://play.google.com/store/apps/details?id=chat.rocket.android) - Desktop Apps for [macOS](https://apps.apple.com/br/app/rocket-chat/id1086818840), [Linux](https://snapcraft.io/rocketchat-desktop) and [Windows](https://releases.rocket.chat/desktop/latest/download) -**Shipped version:** 6.1.0~ynh1 +**Shipped version:** 6.1.2~ynh1 **Demo:** https://cloud.rocket.chat/trial diff --git a/README_fr.md b/README_fr.md index 356d703..1a2057d 100644 --- a/README_fr.md +++ b/README_fr.md @@ -27,7 +27,7 @@ Rocket.Chat est une plate-forme de communication open source entièrement person - Applications mobiles pour [iOS](https://apps.apple.com/app/rocket-chat/id1148741252) et [Android](https://play.google.com/store/apps/details?id=chat.rocket.android) - Applications de bureau pour [macOS](https://apps.apple.com/br/app/rocket-chat/id1086818840), [Linux](https://snapcraft.io/rocketchat-desktop) et [Windows](https://releases.rocket.chat/desktop/latest/download) -**Version incluse :** 6.1.0~ynh1 +**Version incluse :** 6.1.2~ynh1 **Démo :** https://cloud.rocket.chat/trial From 369b1389dd4944e24e007b01545b220b96a0a2c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 13 Apr 2023 08:55:12 +0200 Subject: [PATCH 37/38] Update _common.sh --- scripts/_common.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 8de137a..08da309 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -284,7 +284,7 @@ ynh_mongo_setup_db() { ynh_mongo_create_user --db_user="$db_user" --db_pwd="$db_pwd" --db_name="$db_name" # Store the password in the app's config -#REMOVEME? ynh_app_setting_set --app=$app --key=db_pwd --value=$db_pwd + ynh_app_setting_set --app=$app --key=db_pwd --value=$db_pwd } # Remove a database if it exists, and the associated user @@ -340,7 +340,7 @@ ynh_install_mongo() { mongo_debian_release=buster fi -#REMOVEME? ynh_install_extra_app_dependencies --repo="deb http://repo.mongodb.org/apt/debian $mongo_debian_release/mongodb-org/$mongo_version main" --package="mongodb-org mongodb-org-server mongodb-org-tools mongodb-mongosh" --key="https://www.mongodb.org/static/pgp/server-$mongo_version.asc" + ynh_install_extra_app_dependencies --repo="deb http://repo.mongodb.org/apt/debian $mongo_debian_release/mongodb-org/$mongo_version main" --package="mongodb-org mongodb-org-server mongodb-org-tools mongodb-mongosh" --key="https://www.mongodb.org/static/pgp/server-$mongo_version.asc" mongodb_servicename=mongod # Make sure MongoDB is started and enabled From dbca57a46169d1bef54226d16c96bd5f2226ff93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 13 Apr 2023 09:10:36 +0200 Subject: [PATCH 38/38] Update manifest.toml --- manifest.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/manifest.toml b/manifest.toml index 85dab57..4222621 100644 --- a/manifest.toml +++ b/manifest.toml @@ -53,6 +53,9 @@ ram.runtime = "50M" [resources.sources.main] url = "https://releases.rocket.chat/6.1.2/download" sha256 = "2600755e7c2b9f8cd072662368469b6fa03ba34efba3fccd813d4287c7086965" + in_subdir = true + extract = true + rename = "rocket.chat.tgz" [resources.system_user]