Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Commit 8352c86

Browse files
committed
feat(schema): add proxy_websocket_locations for expose settings
The setting "proxy_websocket_locations" below expose settings can be used to provide paths where WebSocket endpoints are being exposed. Those require special parameters when proxying!
1 parent 5ff6866 commit 8352c86

6 files changed

Lines changed: 22 additions & 1 deletion

File tree

Documentation/ansible-playbooks/inventory.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ all:
2323
stackhead__webserver: getstackhead.stackhead_webserver_nginx # use NGINX as webserver
2424
stackhead__container: getstackhead.stackhead_container_docker # use Docker for containers
2525
stackhead__plugins: [] # list of plugins
26-
stackhead__tf_update_realtime: yes # if "no" Terraform updates will be performed via cron (every 5 minutes)
26+
stackhead__tf_update_realtime: yes # if "no" Terraform updates will be performed via cron (every 5 minutes of an hour)
2727
stackhead__tf_update_interval: *:0/5 # Terraform auto-update interval, default: 5 minutes
2828
ansible_host: 123.456.789.10
2929
stackhead:

Documentation/introduction/project-definition.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ domains:
3434
- internal_port: 80 # port inside the container
3535
external_port: 80 # port where service can be reached by browsers (i.e. example.com:80)
3636
service: app # name of service that should be exposed
37+
proxy_websocket_locations: ["/socket"] # service provides a WebSocket endpoint at /socket we need to set here!
3738
security:
3839
authentication:
3940
- type: basic # basic authentication: users will have to authenticate with username ("user") and password ("pass")
@@ -91,6 +92,15 @@ Setting _external\_port_ to 443 is not allowed, as HTTPS forwarding is automatic
9192
Make sure to define the different _external\_port_ within one project definition, so that each port is only used once!
9293
{% endhint %}
9394

95+
#### proxy_websocket_locations
96+
97+
If your service provides WebSocket endpoint, set them here as those need to be proxied with special parameters.
98+
99+
{% hint style="warning" %}
100+
Please do not set `/` or `/.well-known/acme-challenge` as WebSocket locations.
101+
{% endhint %}
102+
103+
94104
### domains.\*.security
95105

96106
These options can be used to add further security to your projects.

Documentation/stackhead-cli/cli-configuration.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ modules:
1818
container: docker
1919
plugins:
2020
- watchtower # load getstackhead.stackhead_plugin_watchtower plugin
21+
certificates:
22+
register_email: "my-certificates-mail@mydomain.com" # Email address used for creating SSL certificates. Will receive notice when they expire.
2123
terraform:
2224
update_interval: "*-*-* 4:00:00" # perform Terraform update everyday at 4am, see Unix timer "OnCalendar" setting
2325
config:

ansible/roles/stackhead_module_api/testdata/variables.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ app_config:
1414
- service: nginx
1515
internal_port: 80
1616
external_port: 80
17+
proxy_websocket_locations: ['/socket']
1718
security:
1819
authentication:
1920
- type: basic

ansible/schemas/examples/project-definition/valid/project-secured.stackhead.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ domains:
1313
- type: basic
1414
username: user
1515
password: pass
16+
proxy_websocket_locations: ["/socket"]
1617
container:
1718
registries:
1819
- username: dockerhubuser

ansible/schemas/project-definition/container.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,13 @@
122122
"type": "integer",
123123
"description": "Port that is exposed by web server. Traffic received on this port is forwarded to the internal Docker container port. Note that HTTPS forwarding is generated automatically if external_port is 80, so port is not allowed here!"
124124
},
125+
"proxy_websocket_locations": {
126+
"type": "array",
127+
"description": "Locations that serve as Websocket endpoint. Those need to be proxied separately.",
128+
"items": {
129+
"type": "string"
130+
}
131+
},
125132
"required": ["service", "internal_port", "external_port"]
126133
}
127134
}

0 commit comments

Comments
 (0)