1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/synapse_ynh.git synced 2024-09-03 20:26:38 +02:00

Update clean persistent scripts

This commit is contained in:
Josué Tille 2021-02-14 15:20:07 +01:00
parent 6db9afe60c
commit b3f27311a7
No known key found for this signature in database
GPG key ID: 716A6C99B04194EF
2 changed files with 9 additions and 15 deletions

View file

@ -10,15 +10,3 @@
- [ ] Fix or enhancement tested.
- [ ] Upgrade from last version tested.
- [ ] Can be reviewed and tested.
## Validation
---
*Minor decision*
- **Upgrade previous version** :
- [ ] **Code review** :
- [ ] **Approval (LGTM)** :
- [ ] **Approval (LGTM)** :
- **CI succeeded** :
[![Build Status](https://ci-apps-hq.yunohost.org/jenkins/job/synapse_ynh%20PR-NUM-/badge/icon)](https://ci-apps-hq.yunohost.org/jenkins/job/synapse_ynh%20PR-NUM-/)
*Please replace '-NUM-' in this link by the PR number.*
When the PR is marked as ready to merge, you have to wait for 3 days before really merging it.

View file

@ -7,9 +7,15 @@ server_name = sys.argv[2]
with open("/etc/ssowat/conf.json.persistent", "r", encoding='utf-8') as jsonFile:
data = json.load(jsonFile)
data["skipped_urls"].remove("/_matrix")
data["skipped_urls"].remove("/.well-known/matrix/")
data["protected_urls"].remove("/_matrix/cas_server.php/login")
for domain in ("", sys.argv[1], sys.argv[2]):
for path in ("/_matrix", "/.well-known/matrix/", "/_matrix/cas_server.php/login"):
for l in (data["skipped_urls"],
data["protected_urls"],
data["permissions"]["custom_protected"]["uris"],
data["permissions"]["custom_skipped"]["uris"]):
url = domain + path
while url in l:
l.remove(url)
with open("/etc/ssowat/conf.json.persistent", "w", encoding='utf-8') as jsonFile:
jsonFile.write(json.dumps(data, indent=4, sort_keys=True))