diff --git a/README.md b/README.md index cc5282a..ee4bf8e 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Admin UI for Synapse -**Shipped version:** 0.8.3~ynh1 +**Shipped version:** 0.8.5~ynh1 diff --git a/README_fr.md b/README_fr.md index ae2daa9..7d7c422 100644 --- a/README_fr.md +++ b/README_fr.md @@ -13,7 +13,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour Admin UI pour Synapse -**Version incluse :** 0.8.3~ynh1 +**Version incluse :** 0.8.5~ynh1 diff --git a/check_process b/check_process index 852de38..86ae03c 100644 --- a/check_process +++ b/check_process @@ -1,12 +1,13 @@ ;; Test complet ; Manifest domain="domain.tld" + synapse_domain="sub.domain.tld" path="/path" admin="john" is_public=1 ; Checks pkg_linter=1 - setup_sub_dir=1 + setup_sub_dir=0 setup_root=1 setup_nourl=0 setup_private=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/conf/app.src b/conf/app.src index d210988..3670edf 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/Awesome-Technologies/synapse-admin/archive/refs/tags/0.8.4.tar.gz -SOURCE_SUM=5c49b539587bb58ccddf0aa102215dfb963b848cab9e8078f1ad5d626ffda98f +SOURCE_URL=https://github.com/Awesome-Technologies/synapse-admin/archive/refs/tags/0.8.5.tar.gz +SOURCE_SUM=9d3a3fd8f110e937061e37ebf2298f824f171020df8933a229f2ec40684394a8 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true \ No newline at end of file diff --git a/conf/nginx.conf b/conf/nginx.conf index 67627c3..79b2fd8 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -16,16 +16,20 @@ location / { include conf.d/yunohost_panel.conf.inc; } +location /.well-known/acme-challenge { + proxy_pass http://127.0.0.1:8009; +} + location /.well-known/matrix/server { - return 200 '{ "m.server": "__DOMAIN__:443" }'; + return 200 '{ "m.server": "__SYNAPSE_DOMAIN__:443" }'; } location /.well-known/matrix/client { - return 200 '{ "m.homeserver": { "base_url": "https://__DOMAIN__" } }'; + return 200 '{ "m.homeserver": { "base_url": "https://__SYNAPSE_DOMAIN__" } }'; } location /_matrix { - proxy_pass http://localhost:8008; + proxy_pass http://127.0.0.1:8008; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header Host $host; proxy_read_timeout 600; @@ -33,7 +37,7 @@ location /_matrix { } location /_synapse/admin { - proxy_pass http://localhost:8008; + proxy_pass http://127.0.0.1:8008; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header Host $host; proxy_read_timeout 600; diff --git a/manifest.json b/manifest.json index 2e95c53..92c9e6f 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.5~ynh1", "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": "synapse.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"