diff --git a/README.md b/README.md index 1fdec00..35f9ae2 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in [Movim](https://movim.eu) is a decentralized social network, written in PHP and HTML5 and based on the XMPP standard protocol. -**Shipped version:** 0.18 +**Shipped version:** 0.19 ## Screenshots diff --git a/README_fr.md b/README_fr.md index ea6ea5d..2130fd2 100644 --- a/README_fr.md +++ b/README_fr.md @@ -12,7 +12,7 @@ Si vous n'avez pas YunoHost, consultez [le guide](https://yunohost.org/#/install [Movim](https://movim.eu) est un réseau social décentralisé, écrit en PHP et HTML5 et basé sur le protocole standard XMPP. -**Version incluse :** 0.18 +**Version incluse :** 0.19 ## Captures d'écran diff --git a/check_process b/check_process index 7a65692..db9a3ce 100644 --- a/check_process +++ b/check_process @@ -1,8 +1,6 @@ # See here for more informations # https://github.com/YunoHost/package_check#syntax-check_process-file -# Move this file from check_process.default to check_process when you have filled it. - ;; Test complet ; Manifest domain="domain.tld" (DOMAIN) @@ -22,12 +20,12 @@ upgrade=1 backup_restore=1 multi_instance=0 - port_already_use=1 + port_already_use=0 change_url=0 ;;; Options Email= Notification=none ;;; Upgrade options - ; commit=CommitHash - name=Name and date of the commit. + ; commit= + name= manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=phrasedepasse&port=9537& diff --git a/conf/app.src b/conf/app.src index a704253..cf436e0 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/movim/movim/archive/v0.18.tar.gz -SOURCE_SUM=5d49757ee8c70c8b1a527a26279de76b9be5c938064aae7ed65cb123fe4290ca +SOURCE_URL=https://github.com/movim/movim/archive/v0.19.tar.gz +SOURCE_SUM=df98b5b0df6fd6bfa5fda88f387ac017bc7bcead42c462745296604f3e0ee501 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/conf/nginx.conf b/conf/nginx.conf index 7f054e0..839822e 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -36,6 +36,7 @@ location __PATH__/ { proxy_send_timeout 14400s; # (14400s is 4h) } + # Include SSOWAT user panel. include conf.d/yunohost_panel.conf.inc; } diff --git a/conf/systemd.service b/conf/systemd.service index 85b6e6c..73e3095 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -6,7 +6,7 @@ After=nginx.service network.target local-fs.target postgresql.service Type=simple User=__APP__ WorkingDirectory=__FINALPATH__ -ExecStart=/usr/bin/php__PHP_VERSION__ daemon.php start --interface=127.0.0.1 --url=https://__DOMAIN____PATH__/ --port=__PORT__ +ExecStart=/usr/bin/php__PHPVERSION__ daemon.php start --interface=127.0.0.1 --url=https://__DOMAIN____PATH__/ --port=__PORT__ StandardOutput=syslog SyslogIdentifier=__APP__ PIDFile=/run/movim.pid diff --git a/manifest.json b/manifest.json index ffa3a9b..42d847d 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Web-based cross-platform XMPP client", "fr": "Client XMPP multiplateforme basé sur le Web" }, - "version": "0.18~ynh5", + "version": "0.19~ynh1", "url": "https://movim.eu", "license": "AGPL-3.0-or-later", "maintainer": { @@ -14,7 +14,7 @@ "email": "" }, "requirements": { - "yunohost": ">= 3.8.1" + "yunohost": ">= 4.0.0" }, "multi_instance": false, "services": [ diff --git a/pull_request_template.md b/pull_request_template.md index 077ba48..6c28fc5 100644 --- a/pull_request_template.md +++ b/pull_request_template.md @@ -13,6 +13,4 @@ ## Package_check results --- -*If you have access to [App Continuous Integration for packagers](https://yunohost.org/#/packaging_apps_ci) you can provide a link to the package_check results like below, replacing '-NUM-' in this link by the PR number and USERNAME by your username on the ci-apps-dev. Or you provide a screenshot or a pastebin of the results* - -[![Build Status](https://ci-apps-dev.yunohost.org/jenkins/job/movim_ynh%20PR-NUM-%20(USERNAME)/badge/icon)](https://ci-apps-dev.yunohost.org/jenkins/job/movim_ynh%20PR-NUM-%20(USERNAME)/) +* An automatic package_check will be launch at https://ci-apps-dev.yunohost.org/, when you add a specific comment to your Pull Request: "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!"* diff --git a/scripts/_common.sh b/scripts/_common.sh index 83966a7..58ebdd4 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -9,7 +9,7 @@ pkg_dependencies="postgresql postgresql-contrib apt-transport-https" YNH_PHP_VERSION="7.3" -extra_php_dependencies="php${YNH_PHP_VERSION}-fpm php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-imagick php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-pgsql php${YNH_PHP_VERSION}-xml" +extra_php_dependencies="php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-imagick php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-pgsql php${YNH_PHP_VERSION}-xml" #================================================= # PERSONAL HELPERS @@ -23,15 +23,3 @@ extra_php_dependencies="php${YNH_PHP_VERSION}-fpm php${YNH_PHP_VERSION}-curl php # FUTURE OFFICIAL HELPERS #================================================= -# Execute a command as another user -# usage: ynh_exec_as USER COMMAND [ARG ...] -ynh_exec_as() { - local USER=$1 - shift 1 - - if [[ $USER = $(whoami) ]]; then - eval "$@" - else - sudo -u "$USER" "$@" - fi -} diff --git a/scripts/backup b/scripts/backup index 947603f..aca5c31 100644 --- a/scripts/backup +++ b/scripts/backup @@ -29,7 +29,6 @@ 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) -db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd) phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= diff --git a/scripts/install b/scripts/install index 1ff4524..2c1c9e7 100644 --- a/scripts/install +++ b/scripts/install @@ -48,7 +48,6 @@ 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=is_public --value=$is_public #================================================= # STANDARD MODIFICATIONS @@ -76,13 +75,9 @@ ynh_script_progression --message="Creating a PostgreSQL database..." --weight=2 db_name=$(ynh_sanitize_dbid --db_name=$app) db_user=$db_name -db_pwd=$(ynh_string_random --length=30) - ynh_app_setting_set --app=$app --key=db_name --value=$db_name -ynh_app_setting_set --app=$app --key=db_pwd --value=$db_pwd - ynh_psql_test_if_first_run -ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd +ynh_psql_setup_db --db_user=$db_name --db_name=$db_name ynh_psql_execute_as_root --sql="CREATE EXTENSION IF NOT EXISTS unaccent;" --database=$db_name ynh_psql_execute_as_root --sql="CREATE EXTENSION IF NOT EXISTS pg_trgm;" --database=$db_name @@ -128,16 +123,14 @@ phpversion=$(ynh_app_setting_get --app="$app" --key=phpversion) #================================================= ynh_script_progression --message="Modifying a config file..." --weight=1 -cp ../conf/db.example.inc.php $final_path/config/db.inc.php - -ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$final_path/config/db.inc.php" -ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/config/db.inc.php" +ynh_add_config --template="../conf/db.example.inc.php" --destination="$final_path/config/db.inc.php" ynh_store_file_checksum --file="$final_path/config/db.inc.php" #================================================= # Install PHP dependencies using composer #================================================= +ynh_script_progression --message="Configuring Composer..." --weight=1 pushd $final_path export COMPOSER_HOME=$final_path @@ -148,12 +141,12 @@ popd #================================================= # SETUP SYSTEMD #================================================= -ynh_script_progression --message="Configuring a systemd service..." --weight=1 +ynh_script_progression --message="Configuring a systemd service..." --weight=12 ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file=../conf/systemd.service ynh_replace_string --match_string="__PATH__" --replace_string="$path_url" --target_file=../conf/systemd.service ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file=../conf/systemd.service -ynh_replace_string --match_string="__PHP_VERSION__" --replace_string="$phpversion" --target_file=../conf/systemd.service +ynh_replace_string --match_string="__PHPVERSION__" --replace_string="$phpversion" --target_file=../conf/systemd.service ynh_add_systemd_config @@ -169,8 +162,8 @@ mkdir -p $cache_dir chown -R $app $cache_dir pushd $final_path - ynh_exec_as $app php$phpversion composer.phar $app:migrate --quiet - ynh_exec_as $app php$phpversion daemon.php config --username=$admin --password=$password --quiet + php$phpversion composer.phar $app:migrate --quiet + php$phpversion daemon.php config --username=$admin --password=$password --quiet popd #================================================= @@ -181,6 +174,7 @@ popd chown -R $app:www-data $final_path chown -R $app $final_path/src/Movim/ +chmod u+rwx $final_path #================================================= # INTEGRATE SERVICE IN YUNOHOST @@ -200,12 +194,12 @@ ynh_systemd_action --service_name=$app --action=start --log_path="systemd" #--li #================================================= # SETUP SSOWAT #================================================= -ynh_script_progression --message="Configuring SSOwat..." --weight=1 +ynh_script_progression --message="Configuring permissions..." --weight=1 # Make app public if necessary or protect it if [ $is_public -eq 1 ] then - ynh_permission_update --permission "main" --add "visitors" + ynh_permission_update --permission="main" --add="visitors" fi #================================================= diff --git a/scripts/restore b/scripts/restore index 1e83f6b..9effe72 100644 --- a/scripts/restore +++ b/scripts/restore @@ -32,7 +32,7 @@ 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 -db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd) +db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd) phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 24b4872..d54b3be 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -23,7 +23,7 @@ port=$(ynh_app_setting_get --app=$app --key=port) is_public=$(ynh_app_setting_get --app=$app --key=is_public) final_path=$(ynh_app_setting_get --app=$app --key=final_path) db_name=$(ynh_app_setting_get --app=$app --key=db_name) -db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd) +db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd) phpversion=$(ynh_app_setting_get --app="$app" --key=phpversion) timezone=$(cat /etc/timezone) @@ -59,6 +59,13 @@ if [ -z "$final_path" ]; then ynh_app_setting_set --app=$app --key=final_path --value=$final_path fi +# Cleaning legacy permissions +if ynh_legacy_permissions_exists; then + ynh_legacy_permissions_delete_all + + ynh_app_setting_delete --app=$app --key=is_public +fi + #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= @@ -80,7 +87,7 @@ ynh_abort_if_errors #================================================= ynh_script_progression --message="Stopping a systemd service..." --weight=23 -ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=$app --action=stop --log_path="/var/log/$app/$app.log" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -133,6 +140,7 @@ ynh_add_fpm_config --package="$extra_php_dependencies" chown -R $app:www-data $final_path chown -R $app $final_path/src/Movim/Bootstrap.php +chmod u+rwx $final_path #================================================= # INTEGRATE SERVICE IN YUNOHOST @@ -144,31 +152,26 @@ yunohost service add $app --description="Responsive web-based XMPP client" --log #================================================= # INSTALL PHP DEPENDENCIES USING COMPOSER #================================================= +ynh_script_progression --message="Installing Composer..." --weight=1 pushd "$final_path" ynh_exec_warn_less curl -sS https://getcomposer.org/installer | php$phpversion -- --version="1.10.16" --install-dir="$final_path" \ && php$phpversion composer.phar config --global discard-changes true --quiet \ - && php$phpversion composer.phar install --no-interaction --quiet + && php$phpversion composer.phar update --no-interaction --quiet \ + && php$phpversion composer.phar movim:migrate --quiet popd -#================================================= -# Set-up database -#================================================= -ynh_script_progression --message="Configuring database.." --weight=1 - -pushd $final_path - ynh_exec_as $app php$phpversion composer.phar movim:migrate --quiet -popd +#&& php$phpversion composer.phar install --no-interaction --quiet \ #================================================= # SETUP SYSTEMD #================================================= +ynh_script_progression --message="Upgrading systemd configuration..." --weight=5 -# Create a dedicated systemd config ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file=../conf/systemd.service ynh_replace_string --match_string="__PATH__" --replace_string="$path_url" --target_file=../conf/systemd.service ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file=../conf/systemd.service -ynh_replace_string --match_string="__PHP_VERSION__" --replace_string="$phpversion" --target_file=../conf/systemd.service +ynh_replace_string --match_string="__PHPVERSION__" --replace_string="$phpversion" --target_file=../conf/systemd.service ynh_add_systemd_config @@ -177,7 +180,7 @@ ynh_add_systemd_config #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=1 -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=$app --action=start --log_path="/var/log/$app/$app.log" #================================================= # RELOAD NGINX