hubot-stackstorm
hubot-stackstorm copied to clipboard
Cannot change the URL in st2 bot information.
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
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
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
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:
-
Deprecate
ST2_WEBUI_URL
fromst2chatops.env
to avoid confusion and usewebui_base_url
fromst2.conf
only. -
ST2_WEBUI_URL
env will have priority overwebui_base_url
fromst2.conf
. We comment it inst2chatops.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?
I just ran into this in 2.9.1