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
Dashboard: Support hostname placeholder for external services #272
Comments
@ThomDietrich, so you ideas is that dashboard bundle should resolve the host name on runtime and replace $HOSTNAME by resolved host name? If yes, that should be doable :) |
Yes. The hostname of the device OR the host/domain the dashboard is presented on (e.g. https://home.domain.com/start/index). |
@ThomDietrich , what do you think about following: $HOSTADDRESS will be replaced by the IP address (InetAddress.getLocalHost().getHostAddress()). E.g. getCanonicalHostName is not guaranteed to work, so what should be done if it fails? Should we always try to fallback e.g. to IP address? What if server have multiple network interfaces? |
Good to know you can access all of these easily. While you are at and if they are easily accessible, could you also provide placeholders for the protocol (http/https) and the port (8080)? Who knows when they might become interesting... |
What do you mean by placeholder for protocol and port? Dashboard bundle can't know which protocol external service support (http or https), or which tcp port the external service is listening. Or did I totally misunderstand what your wrote? |
No you understood me just right. The dashboard is served by OH/ESH itself, I am not aware how much data you are able to retrieve regarding the connection of an end user. |
None. Implementation what I planning to do is just to replace those magic words during dashboard initialization (when tiles are added to dashboard) or when configuration file is reloaded. |
@ThomDietrich, see #274 |
@paulianttila this is a request related to #185
I've successfully integrated dashboard tile creation for additional components in openHABian (PR). One issue openHABian users are now facing is, that the URL in
dashboard.cfg
as created by openHABian includes the hostname of the system. This most of the time will work for the end user. Sadly some users already reported issues after changing the hostname, others might access their system via an external domain name.In order to solve this issue it would be one solution to allow placeholder in the configuration file.
Example:
A dashboard at http://my-custom-hostname:8080/start/index would redirect to http://my-custom-hostname:9001
Did I miss something? Do you think the idea goes into the right direction?
Best! Thomas
The text was updated successfully, but these errors were encountered: