diff --git a/pull_request_template.md b/pull_request_template.md index d97227b..36526ee 100644 --- a/pull_request_template.md +++ b/pull_request_template.md @@ -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** : -[](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. diff --git a/scripts/remove_sso_conf_persistent.py b/scripts/remove_sso_conf_persistent.py index 8708020..e459ea6 100644 --- a/scripts/remove_sso_conf_persistent.py +++ b/scripts/remove_sso_conf_persistent.py @@ -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))