1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/synapse-admin_ynh.git synced 2024-09-03 20:26:34 +02:00
This commit is contained in:
ericgaspar 2022-02-21 13:59:39 +01:00
parent 1a942a32f7
commit 9be76c1b18
6 changed files with 23 additions and 25 deletions

View file

@ -1,6 +1,7 @@
;; Test complet
; Manifest
domain="domain.tld"
synapse_domain="synapse.domain.tld"
path="/path"
admin="john"
is_public=1

View file

@ -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__

View file

@ -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",

View file

@ -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

View file

@ -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
#==============================================

View file

@ -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"