hubot-stackstorm icon indicating copy to clipboard operation
hubot-stackstorm copied to clipboard

Cannot change the URL in st2 bot information.

Open pbialasiewicz opened this issue 8 years ago • 4 comments

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

pbialasiewicz avatar Nov 21 '16 16:11 pbialasiewicz

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 https://github.com/StackStorm/hubot-stackstorm/blob/29da5bddc5dc6a728e589f7374d049776b50c451/lib/utils.js#L36-L54

arm4b avatar Nov 21 '16 17:11 arm4b

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

pbialasiewicz avatar Nov 21 '16 17:11 pbialasiewicz

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?

arm4b avatar Nov 21 '16 18:11 arm4b

I just ran into this in 2.9.1

cognifloyd avatar May 13 '19 18:05 cognifloyd