zalando / zmon

Real-time monitoring of critical metrics & KPIs via elegant dashboards, Grafana3 visualizations & more
https://demo.zmon.io/
Other
359 stars 47 forks source link

Url configuration option #15

Closed dimaslv closed 8 years ago

dimaslv commented 8 years ago

Is there any way to change url from localhost to something else? I'm trying to start zmon with vagrant. When I connect to the https://localhost:8443/ browser get redirected to https://localhost:8443/?error=redirect_uri_mismatch&error_description=The+redirect_uri+MUST+match+the+registered+callback+URL+for+this+application.&error_uri=https%3A%2F%2Fdeveloper.github.com%2Fv3%2Foauth%2F%23redirect-uri-mismatch&state=16103fa3-2e01-4d6c-9037-69347e279e7a which of course is not working.

hjacobs commented 8 years ago

@dimaslv actually we registered a GitHub application with https://localhost:8443/auth/github as OAuth redirect URI, i.e. it should work.

Obviously you can register your own GitHub OAuth app with different redirect URI.

dimaslv commented 8 years ago

Sorry, I have make mistake in problem description. I have set up zmon on remote server and when I connected to it by ip (https://IP:8443/) I got redirected to localhost.

hjacobs commented 8 years ago

@dimaslv I just tested it in Vagrant box, works :smile:

dimaslv commented 8 years ago

You have cloned zmon, run vagrant up, pointed your browser to server ip (not localhost) and have not been redirected to https://localhost:8443/?error=redirect_uri_mismatch&error_description=The+redirect_uri+MUST+match+the+registered+callback+URL+for+this+application.&error_uri=https%3A%2F%2Fdeveloper.github.com%2Fv3%2Foauth%2F%23redirect-uri-mismatch&state=16103fa3-2e01-4d6c-9037-69347e279e7a? Maybe you have authenticated before? Can you try to logout?

hjacobs commented 8 years ago

@dimaslv I pointed my browser to https://localhost:8443/ --- only this will work (as the redirect URI is configured in GitHub with "localhost", see screenshot)

zmon-github-oauth-application

dimaslv commented 8 years ago

How to change it? Provide new credentials in zmon-controller/zmon-controller-app/src/main/resources/config/application-github.yml and recompile?

hjacobs commented 8 years ago

@dimaslv you can overwrite all settings (including OAuth client credentials) with environment variables.

You can find an example in our bootstrap script for https://demo.zmon.io : https://github.com/zalando/zmon-demo/blob/master/bootstrap/bootstrap.sh#L121