mirror of
https://github.com/YunoHost-Apps/synapse_ynh.git
synced 2024-09-03 20:26:38 +02:00
Merge pull request #35 from YunoHost-Apps/fix_manifest_decode
Fix UnicodeDecodeError with python scripts
This commit is contained in:
commit
848d37d592
7 changed files with 9 additions and 9 deletions
|
@ -1,11 +1,11 @@
|
||||||
import json
|
import json
|
||||||
|
|
||||||
with open("/etc/ssowat/conf.json.persistent", "r") as jsonFile:
|
with open("/etc/ssowat/conf.json.persistent", "r", encoding='utf-8') as jsonFile:
|
||||||
data = json.load(jsonFile)
|
data = json.load(jsonFile)
|
||||||
if "skipped_urls" in data:
|
if "skipped_urls" in data:
|
||||||
data["skipped_urls"].append("/_matrix")
|
data["skipped_urls"].append("/_matrix")
|
||||||
else:
|
else:
|
||||||
data["skipped_urls"] = ["/_matrix"]
|
data["skipped_urls"] = ["/_matrix"]
|
||||||
|
|
||||||
with open("/etc/ssowat/conf.json.persistent", "w") as jsonFile:
|
with open("/etc/ssowat/conf.json.persistent", "w", encoding='utf-8') as jsonFile:
|
||||||
jsonFile.write(json.dumps(data, indent=4, sort_keys=True))
|
jsonFile.write(json.dumps(data, indent=4, sort_keys=True))
|
|
@ -1,8 +1,8 @@
|
||||||
import json
|
import json
|
||||||
|
|
||||||
with open("/etc/ssowat/conf.json.persistent", "r") as jsonFile:
|
with open("/etc/ssowat/conf.json.persistent", "r", encoding='utf-8') as jsonFile:
|
||||||
data = json.load(jsonFile)
|
data = json.load(jsonFile)
|
||||||
data["skipped_urls"].remove("/_matrix")
|
data["skipped_urls"].remove("/_matrix")
|
||||||
|
|
||||||
with open("/etc/ssowat/conf.json.persistent", "w") as jsonFile:
|
with open("/etc/ssowat/conf.json.persistent", "w", encoding='utf-8') as jsonFile:
|
||||||
jsonFile.write(json.dumps(data, indent=4, sort_keys=True))
|
jsonFile.write(json.dumps(data, indent=4, sort_keys=True))
|
|
@ -6,7 +6,7 @@
|
||||||
ynh_read_manifest () {
|
ynh_read_manifest () {
|
||||||
manifest="$1"
|
manifest="$1"
|
||||||
key="$2"
|
key="$2"
|
||||||
python3 -c "import sys, json;print(json.load(open('$manifest'))['$key'])"
|
python3 -c "import sys, json;print(json.load(open('$manifest', encoding='utf-8'))['$key'])"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Read the upstream version from the manifest
|
# Read the upstream version from the manifest
|
||||||
|
|
|
@ -269,7 +269,7 @@ ynh_use_logrotate /var/log/matrix-$app
|
||||||
# The script "add_sso_conf.py" will just add en entry for the path "/_matrix" in the sso conf.json.persistent file in the cathegory "skipped_urls".
|
# The script "add_sso_conf.py" will just add en entry for the path "/_matrix" in the sso conf.json.persistent file in the cathegory "skipped_urls".
|
||||||
cp ../conf/add_sso_conf.py $final_path
|
cp ../conf/add_sso_conf.py $final_path
|
||||||
cp ../conf/remove_sso_conf.py $final_path
|
cp ../conf/remove_sso_conf.py $final_path
|
||||||
python $final_path/add_sso_conf.py || ynh_die "Your file /etc/ssowat/conf.json.persistent don't respect the json synaxe. Please fix the synaxe to install this app. For more information see here : https://github.com/YunoHost-Apps/synapse_ynh/issues/32"
|
python3 $final_path/add_sso_conf.py || ynh_die "Your file /etc/ssowat/conf.json.persistent don't respect the json synaxe. Please fix the synaxe to install this app. For more information see here : https://github.com/YunoHost-Apps/synapse_ynh/issues/32"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SECURE FILES AND DIRECTORIES
|
# SECURE FILES AND DIRECTORIES
|
||||||
|
|
|
@ -64,7 +64,7 @@ closeport $turnserver_alt_tls_port
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# Remove the skipped url
|
# Remove the skipped url
|
||||||
python $final_path/remove_sso_conf.py
|
python3 $final_path/remove_sso_conf.py
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE DEPENDENCIES
|
# REMOVE DEPENDENCIES
|
||||||
|
|
|
@ -88,7 +88,7 @@ yunohost firewall allow Both $turnserver_alt_tls_port > /dev/null 2>&1
|
||||||
|
|
||||||
# Open access to server without a button the home
|
# Open access to server without a button the home
|
||||||
# The script "add_sso_conf.py" will just add en entry for the path "/_matrix" in the sso conf.json.persistent file in the cathegory "skipped_urls".
|
# The script "add_sso_conf.py" will just add en entry for the path "/_matrix" in the sso conf.json.persistent file in the cathegory "skipped_urls".
|
||||||
python $final_path/add_sso_conf.py || ynh_die "Your file /etc/ssowat/conf.json.persistent don't respect the json synaxe. Please fix the synaxe to install this app. For more information see here : https://github.com/YunoHost-Apps/synapse_ynh/issues/32"
|
python3 $final_path/add_sso_conf.py || ynh_die "Your file /etc/ssowat/conf.json.persistent don't respect the json synaxe. Please fix the synaxe to install this app. For more information see here : https://github.com/YunoHost-Apps/synapse_ynh/issues/32"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE THE POSTGRESQL DATABASE
|
# RESTORE THE POSTGRESQL DATABASE
|
||||||
|
|
|
@ -240,7 +240,7 @@ then
|
||||||
|
|
||||||
cp ../conf/add_sso_conf.py $final_path
|
cp ../conf/add_sso_conf.py $final_path
|
||||||
cp ../conf/remove_sso_conf.py $final_path
|
cp ../conf/remove_sso_conf.py $final_path
|
||||||
python $final_path/add_sso_conf.py || echo "Error while sso config, please add '/_matrix' in /etc/ssowat/conf.json.persistent"
|
python3 $final_path/add_sso_conf.py || echo "Error while sso config, please add '/_matrix' in /etc/ssowat/conf.json.persistent"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CREATE DEDICATED USER
|
# CREATE DEDICATED USER
|
||||||
|
|
Loading…
Add table
Reference in a new issue