diff --git a/pages/docs/other/hybrid-setup.mdx b/pages/docs/other/hybrid-setup.mdx index 72f775e..b451c8e 100644 --- a/pages/docs/other/hybrid-setup.mdx +++ b/pages/docs/other/hybrid-setup.mdx @@ -8,7 +8,7 @@ import { Callout } from 'nextra-theme-docs' There are two methods to send data to Golbat while continuing to use the device controller component from RealDeviceMap (RDM). This will allow you take advantage of Golbat's parsing. -## Using RDM Raw Reflection (Recommended) +## Using RDM Raw Reflection As of RealDeviceMap (RDM) version 1.51.0 (July 11, 2023) you can use the built-in `raw forward` option. Some notes: @@ -34,132 +34,3 @@ Example configuration: } } ``` - -## Using Nginx (Legacy) - -To use the Unown# stack for production purposes, you must supply some middleware to help split webhook requests between Golbat and RealDeviceMap. We will utilize [Nginx]'s mirror functionality to accomplish this task. - -The result is data intended for controlling devices will go to `http://RDM:/controler` while raw data goes to `http://RDM:/raw` and `http://GOLBAT:/raw`. - -### Nginx Config File - -Credit to [lenisko](https://github.com/jfberry/goforward/issues/1#issue-1528222766) for the original configuration. - -```ini -# target of controler server -upstream controller { - server RDM_IP_ADDRESS:9001; -} - -# target of raw mirror one -upstream mirrorOne { - server GOLBAT_IP_ADDRESS:9001; -} - -# target of raw mirror two. If you need more /raw mirrors -# uncomment and add the same way as commented below -# upstream mirrorTwo { -# server OTHER_IP_ADDRESS:9001; -# } - -server { - # listen port of nginx vhost - listen 80; - # server_name foobar.example.com; - # access_log off; - # error_log /dev/null crit; - - location /raw { - mirror /mirrorOne; - #mirror /mirrorTwo; - proxy_pass http://controller/raw; - proxy_connect_timeout 500ms; - proxy_read_timeout 500ms; - proxy_set_header Host $host; - client_body_buffer_size 10M; - } - - location /controler { - proxy_pass http://controller/controler; - proxy_connect_timeout 500ms; - proxy_read_timeout 500ms; - proxy_set_header Host $host; - } - - location = /mirrorOne { - internal; - proxy_pass http://mirrorOne/raw; - proxy_connect_timeout 500ms; - proxy_read_timeout 500ms; - proxy_set_header Host $host; - proxy_set_header X-Goforward "Forwarded!"; - } - - #location = /mirrorTwo { - # internal; - # proxy_pass http://mirrorTwo/raw; - # proxy_connect_timeout 500ms; - # proxy_read_timeout 500ms; - # proxy_set_header Host $host; - # proxy_set_header X-Goforward "Forwarded!"; - #} -} -``` - -### Manual Setup - -1. Install [Nginx] -2. Copy the above configuration file into `/etc/nginx/confg.d/relay.conf` -3. Adjust the following variables for your environment - - - RDM_IP_ADDRESS:9001 - - GOLBAT_IP_ADDRESS:9001 - - Might need to adjust the listen port or server_name - -4. Restart the nginx service `sudo systemctl restart nginx` -5. Adjust a few devices to send requests to this nginx endpoint -6. Monitor the access log located at `/var/log/nginx/access.log` -7. If everything works as intended, you will see `200` status messages in the access log. - -_Note:_ You might want to turn off the `access_log` after verifying success to save on disk IO. - -### Docker Setup - -Docker configuration is almost the same as manual. If your Golbat & RDM instances are in docker, we recommend you include all three services in one `docker-compose.yml` file or make them all a part of one network. Sharing the same docker network allows services to communicate over their service name. - -1. Copy the below contents and save it in a `docker-compose.yml` file - - ```yml - version: '3' - services: - relay: - image: nginx - container_name: relay - ports: - - "8001:80" # Right side is the external port - volumes: - - ./relay.conf:/etc/nginx/conf.d/default.conf - logging: - driver: "json-file" - options: - max-file: "5" - max-size: "20m" - - networks: - default: - name: scanner - ``` - -2. Copy the `nginx` configuration from the first section -3. Create a new file named `relay.conf` next to your `docker-compose.yml` file -4. Adjust the following variables for your environment. Remember, if all services are part of the same docker network, you can use their service name, and nginx will be able to resolve. IE - `rdm:9001`, `golbat:9001`, etc. - - - RDM_IP_ADDRESS:9001 - - GOLBAT_IP_ADDRESS:9001 - -5. Start the relay service with `docker compose up -d` -6. Monitor the logs `docker compose logs -f` -7. Adjust a few devices to send requests to this nginx endpoint -8. If everything works as intended, you will see `200` status messages in the access log. - -[Nginx]: https://nginx.org/