Skip to content

Commit 9d965ad

Browse files
authored
Gateway Tunnelling Development Setup Improvements (#110)
1 parent be8cffe commit 9d965ad

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

docs/developer-guide/gateway-tunnelling-setup.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,38 @@ This guide describes the steps necessary to setup the gateway tunnelling functio
3939
* Set TCP port range in sish service (to allow raw TCP tunnelling)
4040
* Allow inbound access to port `2222` and to the TCP port range exposed on the instance
4141
* Generate or select existing SSH private key and add this to the deployment image and set SISH variable: `--private-keys-directory`
42+
43+
# Gateway Tunnelling Development Setup
44+
45+
To run the manager locally as an edge gateway, to test the gateway tunnelling functionality, two different docker compose profiles need to be running:
46+
* The central instance profile (e.g. `docker-compose.central.yml`) needs to be running to provide the sish server functionality, with the correctly configured environment variables
47+
* The testing (unproxied) development profile needs to be running to allow the manager to run properly in the IDE.
48+
49+
You need to setup the SSH keys as described in the "Edge Instance Setup" section above.
50+
51+
For the **central instance** profile:
52+
53+
Run the main `docker-compose.yml` file with `OR_HOSTNAME=localhost`, and add the following:
54+
* In the proxy service:
55+
* SISH_PORT: 8090
56+
* SISH_HOST: sish
57+
* In the manager service:
58+
* Add `8008:8008` to allow attaching the debugger from the IDE
59+
* Optionally, set the manager to be built from context `./manager/build/install/manager`, so that code changes are reflected during Docker image rebuild (after running `./gradlew clean installDist`)
60+
* Add `OR_JAVA_OPTS: "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:8008"` to allow remote debugging from the IDE
61+
* `OR_METRICS_ENABLED: false`
62+
* `OR_GATEWAY_TUNNEL_SSH_HOSTNAME: "localhost"`
63+
* `OR_GATEWAY_TUNNEL_SSH_PORT: 2222`
64+
* `OR_GATEWAY_TUNNEL_TCP_START: 9000`
65+
* `OR_GATEWAY_TUNNEL_HOSTNAME: "localhost"`
66+
* `OR_GATEWAY_TUNNEL_AUTO_CLOSE_MINUTES: 2`
67+
* Add the `sish` service, as found in `deploy.yml`, and modify:
68+
* Add volume `./deployment:/deployment` so that you can map the SSH keys that were generated above
69+
70+
The routing of requests from the central instance to the gateway looks like this: Central Instance --> Sish --> Gateway Proxy --> Keycloak/Manager
71+
72+
For the "Sish --> Gateway Proxy" requests to be routed correctly, we need to edit the local `/etc/hosts` file to route the `<tunnelID>.<tunnelSSHHost>` to localhost, like this:
73+
```
74+
127.0.0.1 gw-5fj1sxvwwfp7wvgqgve91n.localhost
75+
```
76+
The above setup should make the **`org.openremote.test.gateway.GatewayTest#Gateway Tunnelling Edge Gateway Integration test`** pass when run from the IDE or via Gradle.

0 commit comments

Comments
 (0)