Skip to content
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

MainUI Hardcoded to home.myopenhab.org for Private OpenHabCloud #729

Open
lsafelix75 opened this issue Sep 7, 2023 · 4 comments
Open

MainUI Hardcoded to home.myopenhab.org for Private OpenHabCloud #729

lsafelix75 opened this issue Sep 7, 2023 · 4 comments

Comments

@lsafelix75
Copy link

I see the following code is hard-coded to myopenhab.org, any better way to handle this for private cloud instance? May be adding an option in setting for MainUI's URL? Please advise and i can make those changes and upload. Thanks.

   func modifyUrl(orig: URL?) -> URL? {
        // better way to cone/copy ?
        guard let urlString = orig?.absoluteString, var url = URL(string: urlString) else { return orig }
        if url.host == "myopenhab.org" {
            url = URL(string: "https://home.myopenhab.org") ?? url
        }

        if !Preferences.defaultMainUIPath.isEmpty {
            url.appendPathComponent(Preferences.defaultMainUIPath)
        }
        return url
    }
@lsafelix75
Copy link
Author

Shall we change the “Preferences.defaultMainUIPath” to the subdomain … e.g like home.

@digitaldan
Copy link
Contributor

I wonder if we should add an API endpoint to the myopenhab service to return the proxy host/URL, then we can get rid of this hack. I could see that cleaning up a few issues.

@lsafelix75
Copy link
Author

I wonder if we should add an API endpoint to the myopenhab service to return the proxy host/URL, then we can get rid of this hack. I could see that cleaning up a few issues.

I already made some changes but got stuck with this 😅image

@lsafelix75
Copy link
Author

I wonder if we should add an API endpoint to the myopenhab service to return the proxy host/URL, then we can get rid of this hack. I could see that cleaning up a few issues.

I already made some changes but got stuck with this 😅image

Finally to resolve this crap. openhab/openhab-cloud#440

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants