-
-
Notifications
You must be signed in to change notification settings - Fork 288
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
Use Public Suffix for homarr_domain #2147
Conversation
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.
Hi 👋. Thank you for making your first contribution to Homarr. Please ensure that you've completed all the points in the TODO checklist. We'll review your changes shortly.
I would suggest to add a new variable, otherwise this is a breaking change |
You're also have to add the var in the informational pop up where this element can be used (Mostly thinking of the apps setting's External address entry). I also would try to find a different name for the var as "domain" is the really non-descriptive way of addressing the address, and is normally followed or prefaced with a descriptor to better isolate the part, and alone would be common for the TLD - SLD combination only. (In this case, it was also based on tldts very definition of it listed further down from your example) For your var I would personally call it "Parent-Domain" or "Parent" for the short version. So "homarr_parent" feels more fitting here. My suggestion: return appType.behaviour.externalUrl
.replace('[homarr_base]', `${window.location.protocol}//${window.location.hostname}`)
.replace('[homarr_hostname]', tldts.getHostname(window.location.href) ?? '')
.replace('[homarr_domain]', tldts.getDomain(window.location.href) ?? '')
.replace('{homarr_parent]', tldts.getPublicSuffix(window.location.href, { allowPrivateDomains: true }) ?? '')
.replace('[homarr_protocol]', window.location.protocol.replace(':', ''))
.replace('[homarr_port]', window.location.port); remove parsedUrl and change the bracket under from that to "window.location". Edits: I'm a bit blind don't mind me. |
But then it would seem like an infinite number of new variables would need to be defined for multiple domains. |
@ColinHebert Are you still working on this or would you rather we take care of it? |
Closing the PR since it was voted in this PR #2189 that we won't be pursuing URI's with variable and they will be removed altogether. |
Category
Feature
Overview
Changes the
homarr_domain
detection to take the complete domain rather than the top domain only.When the domain of homarr is
homarr.myMachine.domain.tld
,myMachine.domain.tld
is detected aspublicSuffix
This makes use of
allowPrivateDomains
to detect the suffix as documented on https://www.npmjs.com/package/tldtsIssue Number
Related issue: #2146