# Auto approve gateway network connection

**URL:** <https://forum.inductiveautomation.com/t/auto-approve-gateway-network-connection/73220>\
**Category:** Ignition\
**Tags:** docker\
**Created:** [May 3, 2023, 8:17pm UTC](https://forum.inductiveautomation.com/t/auto-approve-gateway-network-connection/73220 "2023-05-03T20:17:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![gnguyen](https://avatars.discourse-cdn.com/v4/letter/g/41988e/32.png) [@gnguyen](https://forum.inductiveautomation.com/u/gnguyen)\
**Post date:** [May 3, 2023, 8:17pm UTC](https://forum.inductiveautomation.com/t/auto-approve-gateway-network-connection/73220/1 "2023-05-03T20:17:53Z")

</div>

Hello community,

I've a simple compose file with one hub and one spoke and gateway network set up (image : latest). I'd like to have gateway network automatically approved.  
According to [https://github.com/thirdgen88/ignition-docker/blob/main/docs/README.md](https://github.com/thirdgen88/ignition-docker/blob/main/docs/README.md), I set the GATEWAY\_NETWORK\_AUTOACCEPT\_DELAY in the hub environment variables. But in the gateway network incoming tab, the remote certificate is still not approved.  
What am I missing?

Thanks,

---

<div class="post-metadata">

**Author:** ![Gabriel\_Hernandez](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/gabriel_hernandez/32/47179_2.png) [@Gabriel\_Hernandez](https://forum.inductiveautomation.com/u/Gabriel_Hernandez)\
**Post date:** [May 11, 2023, 11:15pm UTC](https://forum.inductiveautomation.com/t/auto-approve-gateway-network-connection/73220/2 "2023-05-11T23:15:51Z")

</div>

Hello,

Are you using the official Ignition image from Inductive Automation or the community image that is referenced in the link you provided? Both images have different environment variables. This user manual page for [Docker Image](https://docs.inductiveautomation.com/display/DOC81/Docker+Image) covers everything you need to know for the official image including available environment variables.

---

<div class="post-metadata">

**Author:** ![kcollins](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kcollins/32/19646_2.png) [@kcollins](https://forum.inductiveautomation.com/u/kcollins)\
**Post date:** [May 12, 2023, 3:18pm UTC](https://forum.inductiveautomation.com/t/auto-approve-gateway-network-connection/73220/3 "2023-05-12T15:18:09Z")

</div>

As @Gabriel_Hernandez correctly mentioned above, the "unofficial/community" image that you're linking to is very similar to the official one but there are still some differences between them. The auto-approve functionality that is there is also only for gateway network certificate acceptance; there is an approval for the connection itself that must still be done separately.

I've attached an example Compose stack that achieves what you're looking for (with our official image!) under the current constraints. The basic approach for creating this was as follows:

1. Bring up the initial stack without the _gateway restore_ and without the bind-mounts on the _spoke_ gateway for `metro-keystore` and `.uuid`.
2. Connect to the _hub_ and approve the incoming GAN connection from _spoke_. Perform any other baseline configurations that you'd like.
3. Create a `gw-init` sub-folder in your Compose solution `gw-init` that we'll use for bind-mounting some files into our containers.
4. Capture GWBK from the _hub_ (where the connection approvals are configured) and place as `gw-init/hub.gwbk`. Note: you can use `docker compose cp` to copy from the service containers to your host filesystem.
5. Capture the `data/.uuid` and `data/local/metro-keystore` files from _spoke_ and place then accordingly under `gw-init/`.
6. Modify the Compose YAML to bind-mount the GWBK into _hub_ (and update the `command` to issue the restore on first-launch). Also modify the _spoke_ service with bind-mounts for the files captured in (5). Note we're using the [long syntax](https://github.com/compose-spec/compose-spec/blob/master/spec.md#long-syntax-5) for volumes here so we can override the `create-host-path` setting.
7. Bring down the stack and wipe volumes. Then re-launch it and verify that everything comes up as connected out-of-the-box.

Here is the solution for everyone's reference:

[forum-73220.zip](https://forum.inductiveautomation.com/uploads/short-url/eBdfaZqW0ecSxdvjX1pr1wdwMOj.zip) (330.2 KB)

And the YAML displayed here for quick reference:

```yaml
---
x-ignition-env: &ignition-env
  IGNITION_EDITION: standard
  ACCEPT_IGNITION_EULA: "Y"
  GATEWAY_ADMIN_PASSWORD: password
  DISABLE_QUICKSTART: true

services:
  hub:
    image: inductiveautomation/ignition:8.1.27
    ports:
      - 8088:8088
    volumes:
      - hub-data:/usr/local/bin/ignition/data
      - ./gw-init/hub.gwbk:/usr/local/bin/ignition/base.gwbk
    environment:
      <<: *ignition-env
    command: >
      -n hub
      -r base.gwbk
  spoke:
    image: inductiveautomation/ignition:8.1.27
    hostname: spoke
    ports:
      - 8089:8088
    volumes:
      - type: volume
        source: spoke-data
        target: /usr/local/bin/ignition/data
      - type: bind
        source: ./gw-init/spoke-uuid.txt
        target: /usr/local/bin/ignition/data/.uuid
        bind:
          create_host_path: false
      - type: bind
        source: ./gw-init/spoke-metro-keystore
        target: /usr/local/bin/ignition/data/local/metro-keystore
        bind:
          create_host_path: false
    environment:
      <<: *ignition-env
      GATEWAY_NETWORK_0_HOST: hub
    command: >
      -n spoke

volumes:
  hub-data:
  spoke-data:

```

---

<div class="post-metadata">

**Author:** ![gnguyen](https://avatars.discourse-cdn.com/v4/letter/g/41988e/32.png) [@gnguyen](https://forum.inductiveautomation.com/u/gnguyen)\
**Post date:** [May 15, 2023, 5:27pm UTC](https://forum.inductiveautomation.com/t/auto-approve-gateway-network-connection/73220/4 "2023-05-15T17:27:35Z")

</div>

Hello @Gabriel_Hernandez, @kcollins

I'm using this the official one (inductiveautomation/ignition:latest); I'll test with all your recommandations and get back her for results.

Thank you.

---

<div class="post-metadata">

**Author:** ![gnguyen](https://avatars.discourse-cdn.com/v4/letter/g/41988e/32.png) [@gnguyen](https://forum.inductiveautomation.com/u/gnguyen)\
**Post date:** [May 26, 2023, 4:30pm UTC](https://forum.inductiveautomation.com/t/auto-approve-gateway-network-connection/73220/5 "2023-05-26T16:30:02Z")

</div>

Gentlemen,  
On click, and boum! Thanks a lot.

 ![2023-05-26_18-28-49](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/8/d8daf74d19a683cafd2def267013ccfa4acad172.jpeg)
