Added option to define config.js for st2web by moonrail · Pull Request #165 · StackStorm/stackstorm-k8s

Hello maintainers,

while testing and developing internally we've experienced the requirement, where we would have to access StackStorm in a subpath of a FQDN, e.g. sub.domain.tld/stackstorm.

For this configuration is required for Ingress and st2web.

This PR adds the possibility to define configuration for st2web.

Ingress is pretty straight forward and already supported, e.g.:

ingress:
    enabled: true
    annotations:
      kubernetes.io/ingress.class: nginx
      kubernetes.io/tls-acme: 'true'
      nginx.ingress.kubernetes.io/rewrite-target: /$1
    hosts: 
      - host: 'sub.domain.tld'
        paths:
          - path: '/stackstorm/(.*)'
            serviceName: st2web
            servicePort: 80
    tls:
      - secretName: 'tls-sub.domain.tld'
        hosts:
          - 'sub.domain.tld'

With this Ingress configuration, st2web is properly reachable.

In short: Edit /opt/stackstorm/static/webui/config.js to include complete Endpoints for auth, api, and stream.

For our example config.js could be:

'use strict';

/* global angular */
angular.module('main')
  .constant('st2Config', {

    hosts: [
      {
        name: 'test',
        url: 'https://sub.domain.tld/stackstorm/api',
        auth: 'https://sub.domain.tld/stackstorm/auth',
        stream: 'https://sub.domain.tld/stackstorm/stream',
      }
    ]

  });