Support private openHAB Cloud instances via proxy URL discovery#1068
Support private openHAB Cloud instances via proxy URL discovery#1068digitaldan merged 2 commits intodevelopfrom
Conversation
Replace hardcoded myopenhab.org hostname checks with dynamic proxy URL resolution using the /api/v1/proxyurl endpoint, enabling private openHAB Cloud instances to work correctly with the app. Signed-off-by: Tim Mueller-Seydlitz <timbms@gmail.com>
|
I know |
Wrap supportsNotifications behind a semantic isCloudConnection property so the rest of the codebase doesn't depend on the preference name. Signed-off-by: Tim Mueller-Seydlitz <timbms@gmail.com>
|
I could also update the Preferences filter to use isCloudConnection. @digitaldan : Let me know |
|
Whatever you think is best 👍 |
|
For the moment I would leave it as is. We could change it when we redo the Preferences loading to become more flexible. |
|
@digitaldan: who could test it? I am not running a private openHAB Could instance. |
|
I can test it, but it should work exactly the same with out production service, right? It will pull the proxy host from the api? I'm actually working on a huge migration to typescript on the cloud service right at this moment so can give it a try since i have that up and running. |
1 similar comment
|
I can test it, but it should work exactly the same with out production service, right? It will pull the proxy host from the api? I'm actually working on a huge migration to typescript on the cloud service right at this moment so can give it a try since i have that up and running. |
|
I can confirm this works with a custom server 👍 |
|
Can we merge it? |
Summary
Fixes #729
GET /api/v1/proxyurlinstead of hardcodingmyopenhab.org→home.myopenhab.orgrewriteshasSuffix("myopenhab.org")) with thesupportsNotificationsconfiguration flag across all auth middlewareSessionChallengeHandlerclass (never instantiated)What this enables
https://cloud.example.com) with "openHAB Cloud Service" toggle on → app calls/api/v1/proxyurlto discover the correct web UI URLhttps://home.myopenhab.org:443, falls back gracefully if unavailablesupportsNotificationsis false, proxy URL is never fetchedFiles changed
NetworkTracker.swiftproxyURLtoConnectionInfo, addfetchProxyURL()helper, resolve after connection testOpenHABWebViewController.swiftmodifyUrl(), usesupportsNotificationsflag for cloud detectionSessionChallengeHandler.swiftAuthorisationMiddleware.swiftsupportsNotificationsinstead of hostname checkHTTPClient.swiftsupportsNotificationsinstead of hostname checkOpenHABAccessTokenAdapter.swiftsupportsNotificationsinstead of hostname checkTest plan
https://myopenhab.orgas remote → verify proxy URL is fetched and web view loadshome.myopenhab.org