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

Cannot change the URL in st2 bot information. #129

Open
pbialasiewicz opened this issue Nov 21, 2016 · 4 comments
Open

Cannot change the URL in st2 bot information. #129

pbialasiewicz opened this issue Nov 21, 2016 · 4 comments
Assignees
Labels

Comments

@pbialasiewicz
Copy link

I'm not able to change the URL in st2 bot info.
After modifying the ST2_WEBUI_URL to a static ip in st2chatops.env and modifying webui_base_url in st2.conf and doing a st2ctl restart. The link still point to the hostname instead of the static value.
OS: Linux version 3.13.0-100-generic (buildd@lgw01-52) (gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.3)
This is a single node install using the curl installer.

export ST2_HOSTNAME="${ST2_HOSTNAME:-localhost}"
export NODE_TLS_REJECT_UNAUTHORIZED=0
export EXPRESS_PORT=8081
export HUBOT_LOG_LEVEL=debug
export HUBOT_NAME=hubot
export HUBOT_ALIAS='!'
export ST2_API="${ST2_API:-https://${ST2_HOSTNAME}/api}"
export ST2_AUTH_URL="${ST2_AUTH_URL:-https://${ST2_HOSTNAME}/auth}"
export ST2_API_KEY=secret_key
export ST2_WEBUI_URL=https://10.40.0.117
 export HUBOT_ADAPTER=slack
 export HUBOT_SLACK_TOKEN=xoxb-super-secret
@arm4b
Copy link
Member

arm4b commented Nov 21, 2016

I could reproduce it.

ST2_WEBUI_URL in st2chatops.env doesn't work at all.

It happens because st2.conf webui_base_url defaults to current machine hostname.

And because webui_base_url is set, it always takes precedence here

function getExecutionHistoryUrl(execution_model) {
var url = execution_model.web_url;
var execution_id = execution_model.id;
if (url) {
return url;
}
if (isNull(env.ST2_WEBUI_URL)) {
return null;
}
if (!execution_id) {
return null;
}
url = util.format(WEBUI_EXECUTION_HISTORY_URL, env.ST2_WEBUI_URL, execution_id);
return url;
}

@pbialasiewicz
Copy link
Author

It worked.
Just remember to unncomment the [webui] along with [webui_base_url] in st2.conf.
And if you want to make this change without killing all running jobs just do a service st2api restart

@arm4b arm4b added the bug label Nov 21, 2016
@arm4b arm4b reopened this Nov 21, 2016
@arm4b arm4b self-assigned this Nov 21, 2016
@arm4b
Copy link
Member

arm4b commented Nov 21, 2016

So this is definitely a bug, because ST2_WEBUI_URL is noop, just doesn't work in current state.

I think there are 2 options:

  1. Deprecate ST2_WEBUI_URL from st2chatops.env to avoid confusion and use webui_base_url from st2.conf only.

  2. ST2_WEBUI_URL env will have priority over webui_base_url from st2.conf.
    We comment it in st2chatops.env making it optional, so users should set it explicitly if they need it.

@emedvedev any opinions about ST2_WEBUI_URL vs webui_base_url precedence?

@cognifloyd
Copy link
Member

I just ran into this in 2.9.1

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

No branches or pull requests

3 participants