-
-
Notifications
You must be signed in to change notification settings - Fork 32
Make st2web use HTTP by default #20
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
8fa8742
Make st2web use HTTP by default
warrenvw 5a2f88b
Add missing patch files
warrenvw 76ad99c
Clean-up CMD
warrenvw 8da0928
Remove old st2.conf.patch file
warrenvw 03379ee
Fix typo in error_log value
warrenvw 82291db
Update README with reference to ST2WEB_HTTPS var
warrenvw File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,10 +10,13 @@ The following environment variables are available for configuration: | |
| - `ST2_AUTH_URL` (default: `http://st2auth:9100/`) - StackStorm Auth service | ||
| - `ST2_API_URL` (default: `http://st2api:9101/`) - StackStorm API service | ||
| - `ST2_STREAM_URL` (default: `http://st2stream:9102/`) - StackStorm Stream service | ||
| - `ST2WEB_HTTPS` (default: `0`) - Use https with st2web | ||
|
|
||
| > Warning! All 3 services should be DNS/network accessible for `st2web` container to start properly. Thanks to K8s pod restarts, it's not a problem. | ||
|
|
||
| ### Secrets | ||
| > Note! You may safely ignore this section if `ST2WEB_HTTPS` is set to `0`. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
|
|
||
| StackStorm Web UI uses nginx for SSL negotiation. A valid SSL certificate is required for `st2web` to run properly. | ||
| You have to share with the Docker container the following files: | ||
| - `/etc/ssl/st2/st2.crt` (required) - SSL certificate, [`ssl_certificate`](http://nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl_certificate) nginx directive | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| --- /etc/nginx/conf.d/st2.template 2019-05-27 14:11:20.000000000 -0700 | ||
| +++ /etc/nginx/conf.d/st2.conf 2019-05-27 14:22:28.000000000 -0700 | ||
| @@ -1,6 +1,6 @@ | ||
| # | ||
| -# nginx configuration to expose st2 webui, redirect HTTP->HTTPS, | ||
| -# provide SSL termination, and reverse-proxy st2api and st2auth API endpoint. | ||
| +# nginx configuration to expose st2 webui, and reverse-proxy the st2api and | ||
| +# st2auth API endpoints. | ||
| # To enable: | ||
| # cp ${LOCATION}/st2.conf /etc/nginx/sites-available | ||
| # ln -l /etc/nginx/sites-available/st2.conf /etc/nginx/sites-enabled/st2.conf | ||
| @@ -9,39 +9,12 @@ | ||
| server { | ||
| listen *:80 default_server; | ||
|
|
||
| - add_header Front-End-Https on; | ||
| add_header X-Content-Type-Options nosniff; | ||
|
|
||
| - if ($ssl_protocol = "") { | ||
| - return 308 https://$host$request_uri; | ||
| - } | ||
| - | ||
| - index index.html; | ||
| - | ||
| - access_log /var/log/nginx/st2webui.access.log combined; | ||
| - error_log /var/log/nginx/st2webui.error.log; | ||
| -} | ||
| - | ||
| -server { | ||
| - listen *:443 ssl; | ||
| - | ||
| - ssl on; | ||
| - | ||
| - ssl_certificate /etc/ssl/st2/st2.crt; | ||
| - ssl_certificate_key /etc/ssl/st2/st2.key; | ||
| - ssl_session_cache shared:SSL:10m; | ||
| - ssl_session_timeout 5m; | ||
| - ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | ||
| - ssl_ciphers EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH:ECDHE-RSA-AES128-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA128:DHE-RSA-AES128-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES128-GCM-SHA128:ECDHE-RSA-AES128-SHA384:ECDHE-RSA-AES128-SHA128:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES128-SHA128:DHE-RSA-AES128-SHA128:DHE-RSA-AES128-SHA:DHE-RSA-AES128-SHA:AES128-GCM-SHA384:AES128-GCM-SHA128:AES128-SHA128:AES128-SHA128:AES128-SHA:AES128-SHA:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4; | ||
| - ssl_prefer_server_ciphers on; | ||
| - | ||
| index index.html; | ||
|
|
||
| - access_log /var/log/nginx/ssl-st2webui.access.log combined; | ||
| - error_log /var/log/nginx/ssl-st2webui.error.log; | ||
| - | ||
| - add_header Front-End-Https on; | ||
| - add_header X-Content-Type-Options nosniff; | ||
| + access_log /proc/self/fd/1 combined; | ||
| + error_log stderr; | ||
|
|
||
| location @apiError { | ||
| add_header Content-Type application/json always; | ||
| @@ -53,7 +26,7 @@ | ||
|
|
||
| rewrite ^/api/(.*) /$1 break; | ||
|
|
||
| - proxy_pass http://127.0.0.1:9101/; | ||
| + proxy_pass ${ST2_API_URL}; | ||
| proxy_read_timeout 90; | ||
| proxy_connect_timeout 90; | ||
| proxy_redirect off; | ||
| @@ -83,7 +56,7 @@ | ||
|
|
||
| rewrite ^/stream/(.*) /$1 break; | ||
|
|
||
| - proxy_pass http://127.0.0.1:9102/; | ||
| + proxy_pass ${ST2_STREAM_URL}; | ||
| proxy_set_header Host $host; | ||
| proxy_set_header X-Real-IP $remote_addr; | ||
| proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
| @@ -111,7 +84,7 @@ | ||
|
|
||
| rewrite ^/auth/(.*) /$1 break; | ||
|
|
||
| - proxy_pass http://127.0.0.1:9100/; | ||
| + proxy_pass ${ST2_AUTH_URL}; | ||
| proxy_read_timeout 90; | ||
| proxy_connect_timeout 90; | ||
| proxy_redirect off; | ||
| @@ -136,4 +109,5 @@ | ||
| tcp_nopush on; | ||
| tcp_nodelay on; | ||
| } | ||
| + | ||
| } |
4 changes: 2 additions & 2 deletions
4
st2web/files/st2.conf.patch → st2web/files/st2.conf-https.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.