-
-
Notifications
You must be signed in to change notification settings - Fork 273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[enh] exclude .well-known subpaths from conflict checks #1647
base: dev
Are you sure you want to change the base?
Conversation
@@ -2869,7 +2869,7 @@ def _get_conflicting_apps(domain, path, ignore_app=None): | |||
for p, a in apps_map[domain].items(): | |||
if a["id"] == ignore_app: | |||
continue | |||
if path == p or path == "/" or p == "/": | |||
if path == p or ( not path.startswith("/.well-known/") and path == "/" ) or ( not path.startswith("/.well-known/") and p == "/" ): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if path == p or ( not path.startswith("/.well-known/") and path == "/" ) or ( not path.startswith("/.well-known/") and p == "/" ): | |
if path == p or ( not path.startswith("/.well-known/") and ( path == "/" or p == "/" ) ): |
A bit of factorization
Hmmmm, I'm confused by this PR 🤔 If two apps do add a |
It's been a while, I cannot remember why I implemented that. Basically this PR allows apps to publish something in (and you misread the description, it states we still return an error if apps try to register the same |
Thanks for the contribution, just to mention from testing I've done on a testbed server, it looks like the full_domain flag may need to have extra logic to prevent scripts for install and upgrade failing with the full_domain error. def _assert_no_conflicting_apps(domain, path, ignore_app=None, full_domain=False):
conflicts = _get_conflicting_apps(domain, path, ignore_app)
if conflicts:
apps = []
for path, app_id, app_label in conflicts:
apps.append(f" * {domain}{path} → {app_label} ({app_id})")
if full_domain:
raise YunohostValidationError("app_full_domain_unavailable", domain=domain)
else:
raise YunohostValidationError(
"app_location_unavailable", apps="\n".join(apps)
) For testing, I've installed Friendica on example.com, then installed Synapse on m.example.com but configuring accounts to use user@example.com using the option in the setup script for that. |
Thank you for your testing! Can you share the failed installation log? |
It worked for me. Bludit on / |
After further consideration, I would push for a dedicated "well-known path" resource, rather than patching the current "path" one. |
Attempts to solve:
Fixes YunoHost/issues#684
Fixes YunoHost/issues#2016
It basically adds an exception for app conflicts if an app is installed at the root of a domain and another app tries to add a
./well-known/foo
subpath, but keeps returning a conflict if any two apps try to register the same./well-known/foo
subpath.PR Status
Finished? Untested.
How to test
...