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
Check if config loaded in getHostname() #17526
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.
The code itself looks ok. But not sure if it fulfills the requirements. ping @tsteur
When visiting the diagnostic page over a trusted host, the hostname is shown in the archiving command. Coming from an untrusted host for me it now always uses the IP address as matomo-domain
, even though some trusted hosts are configured...
@sgiehl are you saying the |
@tsteur Actually I guess the code does exactly what it should. If the current hostname used is untrusted the code falls back to Lines 298 to 312 in 0d97901
Was just wondering if it would be more useful in this case to lookup the configured trusted hosts instead and use one of them instead of the IP. But might be unneeded, as viewing the diagnostics from an untrusted host might be uncommon. |
Ideally if it's not a trusted host then we wouldn't append the matomo-domain option as it wouldn't work anyway. Not sure how easy it is but there should be methods for checking if we are on a trusted host or not. |
@tsteur guess only appending the |
@flamisz could you look into this? |
yeah, sure |
@flamisz it's right in the line below |
@flamisz that's the system check page. You get to it by going to |
thanks, I found it, I'm on it 😄 |
9b5e362
to
c5dcf17
Compare
c5dcf17
to
a309ab2
Compare
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.
Seems to work as expected now. I've rebased the branch, if all tests are still working it should be good to merge
Description:
If the config already loaded when we use the
getHostname()
method, we can use the$checkIfTrusted
as true when getting the host.Review