diff --git a/check_process b/check_process index 03b75a3..9ec9afe 100644 --- a/check_process +++ b/check_process @@ -1,6 +1,7 @@ ;; Test complet ; Manifest domain="domain.tld" + synapse_domain="synapse.domain.tld" path="/path" admin="john" is_public=1 diff --git a/conf/.env b/conf/.env index 8c774b2..3be4fc3 100644 --- a/conf/.env +++ b/conf/.env @@ -2,7 +2,7 @@ # If you set this setting, the user will not be able to select # the server and have to use synapse-admin with this server. -REACT_APP_SERVER=https://__DOMAIN__ +REACT_APP_SERVER=https://__SYNAPSE_DOMAIN__ #Define the port to avoid collisions on port 3000 PORT=__PORT__ diff --git a/manifest.json b/manifest.json index 2e95c53..3c477ef 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Admin UI for Synapse", "fr": "Admin UI pour Synapse" }, - "version": "0.8.3~ynh1", + "version": "0.8.3~ynh2", "url": "https://github.com/Awesome-Technologies/synapse-admin", "upstream": { "license": "Apache-2.0", @@ -30,6 +30,16 @@ "name": "domain", "type": "domain" }, + { + "name": "synapse_domain", + "type": "domain", + "ask": { + "en": "The domain of your Synapse server", + "fr": "Le domain de votre serveur Synapse" + }, + "example": "matrix.example.com", + "default": "" + }, { "name": "is_public", "type": "boolean", diff --git a/scripts/change_url b/scripts/change_url index 9d6c716..18ec2f6 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -70,7 +70,7 @@ fi #================================================= ynh_script_progression --message="Stopping a systemd service..." --weight=1 -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="systemd" #================================================= # MODIFY URL IN NGINX CONF diff --git a/scripts/install b/scripts/install index c3b0557..dec0259 100644 --- a/scripts/install +++ b/scripts/install @@ -23,7 +23,8 @@ ynh_abort_if_errors domain=$YNH_APP_ARG_DOMAIN path_url="/" is_public=$YNH_APP_ARG_IS_PUBLIC -#synapse_domain=$(yunohost app setting synapse domain) +synapse_domain=$YNH_APP_ARG_SYNAPSE_DOMAIN + app=$YNH_APP_INSTANCE_NAME #================================================= @@ -44,6 +45,7 @@ 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=synapse_domain --value=$synapse_domain #================================================= # STANDARD MODIFICATIONS @@ -84,12 +86,6 @@ ynh_app_setting_set --app=$app --key=final_path --value=$final_path # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir=$final_path -#git clone --quiet https://github.com/Awesome-Technologies/synapse-admin.git -b master "$final_path" -# Reset branch to the level of update we needed -#pushd "$final_path" -# git reset --hard --quiet $version_commit -#popd - chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" @@ -102,13 +98,6 @@ ynh_script_progression --message="Configuring NGINX web server..." --weight=2 # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# ADD A CONFIGURATION -#================================================= -ynh_script_progression --message="Adding a configuration file..." --weight=1 - -ynh_add_config --template="../conf/.env" --destination="$final_path/.env" - #================================================= # SPECIFIC SETUP #============================================== diff --git a/scripts/upgrade b/scripts/upgrade index a186602..3028825 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -20,6 +20,7 @@ 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) port=$(ynh_app_setting_get --app=$app --key=port) +synapse_domain=$(ynh_app_setting_get --app=$app --key=synapse_domain) #================================================= # CHECK VERSION @@ -46,6 +47,10 @@ ynh_abort_if_errors #================================================= ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 +if ynh_compare_current_package_version --comparison le --version 0.8.3~ynh2 +then + ynh_die --message="Upgrade from version 0.8.3 is not possible. You must uninstall and reinstall Synapse-admin package manually" +fi # Cleaning legacy permissions if ynh_legacy_permissions_exists; then ynh_legacy_permissions_delete_all @@ -78,14 +83,7 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading source files..." --weight=160 - ynh_setup_source --dest_dir="$final_path" --keep="$final_path/.env" - - #pushd "$final_path" - # git fetch --quiet - # git checkout master --quiet - # git pull --quiet - # git reset --hard $version_commit --quiet - #popd + ynh_setup_source --dest_dir="$final_path" fi chmod 750 "$final_path"