Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1500,7 +1500,7 @@ WFO and NetBox both use the GraphQL framework Strawberry[^9] which supports Apol

The following is required to facilitate GraphQL federation on top of WFO and other GraphQL backend(s):

- WFO must be configured with `FEDERATION_VERSION=2.9`
- WFO must be configured with `FEDERATION_VERSION=2.11`
- [`docker/orchestrator/orchestrator.env`](docker/orchestrator/orchestrator.env)
- The other backend must also enable federation
- NetBox: [`docker/netbox/Dockerfile`](docker/netbox/Dockerfile)
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ x-netbox: &netbox
- ./docker/netbox/netbox.env
- path: ./docker/overrides/netbox/netbox.env
required: false
user: "unit:root"
user: "1000:0"
healthcheck:
start_period: 360s
timeout: 3s
Expand Down Expand Up @@ -110,7 +110,7 @@ services:

federation:
container_name: federation
image: ghcr.io/apollographql/router:v2.6.2
image: ghcr.io/apollographql/router:v2.11.0
ports:
- "4000:4000"
depends_on:
Expand Down
2 changes: 1 addition & 1 deletion docker/federation/rover.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ RUN apt update && apt install curl -y
RUN useradd --create-home --shell /bin/bash rover-user

USER rover-user
RUN curl -sSL https://rover.apollo.dev/nix/v0.35.0 | sh
RUN curl -sSL https://rover.apollo.dev/nix/v0.38.1 | sh

USER root
RUN apt remove curl -y
Expand Down
2 changes: 1 addition & 1 deletion docker/federation/supergraph-config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
federation_version: =2.9.3
federation_version: =2.11.0
subgraphs:
orchestrator:
routing_url: http://orchestrator:8080/api/graphql
Expand Down
4 changes: 2 additions & 2 deletions docker/netbox/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM netboxcommunity/netbox:v4.4.1
FROM netboxcommunity/netbox:v4.5-4.0.2

# NOTE: when updating the Netbox version, remember to update the database snapshot. See docker/postgresql/README.md for details

# Patch strawberry schema to enable federation
RUN sed -i 's/= strawberry.Schema(/= strawberry.federation.Schema(enable_federation_2=True,/g' /opt/netbox/netbox/netbox/graphql/schema.py
RUN sed -i 's/= strawberry.Schema(/= strawberry.federation.Schema(/g' /opt/netbox/netbox/netbox/graphql/schema.py

# Patch strawberry types to allow joins
ADD patch_federation.py .
Expand Down
1 change: 1 addition & 0 deletions docker/netbox/configuration/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ def _environ_get_and_map(variable_name: str, default: str | None = None, map_fn:
# symbols. NetBox will not run without this defined. For more information, see
# https://docs.djangoproject.com/en/stable/ref/settings/#std:setting-SECRET_KEY
SECRET_KEY = _read_secret('secret_key', environ.get('SECRET_KEY', ''))
API_TOKEN_PEPPERS = { 1: _read_secret('api_token_pepper', environ.get('API_TOKEN_PEPPER', ''))}


#########################
Expand Down
14 changes: 9 additions & 5 deletions docker/netbox/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"first_name": "",
"last_name": "",
"email": "admin@admin.admin",
"is_staff": true,
"is_active": true,
"date_joined": "2023-04-03T20:31:46.411Z",
"groups": [],
Expand Down Expand Up @@ -44,13 +43,18 @@
"model": "users.token",
"pk": 1,
"fields": {
"version": 2,
"user": 1,
"created": "2023-04-04T20:50:21.369Z",
"description": "",
"created": "2026-05-01T16:46:57.511Z",
"expires": null,
"last_used": "2023-04-04T20:51:55.276Z",
"key": "e744057d755255a31818bf74df2350c26eeabe54",
"last_used": null,
"enabled": true,
"write_enabled": true,
"description": "",
"plaintext": null,
"key": "sDx3hakFeTCZ",
"pepper_id": 1,
"hmac_digest": "f36541405acbc41c5b26209011628b3bff980d390b103dae8c43e848168e0a6d",
"allowed_ips": []
}
}
Expand Down
1 change: 1 addition & 0 deletions docker/netbox/netbox.env
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ REDIS_PASSWORD=nwa
REDIS_SSL=false
RELEASE_CHECK_URL=https://api.github.com/repos/netbox-community/netbox/releases
SECRET_KEY=r8OwDznj!!dci#P9ghmRfdu1Ysxm0AiPeDCQhKE+N_rClfWNjN
API_TOKEN_PEPPER=xslRlHpCH)w53Umz*t0*tqLLe9iE3_uhhUuu*ryiCgmN5KNiiH
SKIP_SUPERUSER=false
SUPERUSER_NAME=admin
SUPERUSER_PASSWORD=admin
Expand Down
4 changes: 2 additions & 2 deletions docker/orchestrator/orchestrator.env
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ DATABASE_URI="postgresql+psycopg://nwa:nwa@postgres/orchestrator-core"
ENABLE_WEBSOCKETS="True"
TRANSLATIONS_DIR="/home/orchestrator/translations"
WEBSOCKET_BROADCASTER_URL="redis://:nwa@redis:6379"
NETBOX_TOKEN=e744057d755255a31818bf74df2350c26eeabe54
NETBOX_TOKEN=nbt_sDx3hakFeTCZ.lnGwrK42a7z1IelVaigWXqaAB0GKSpbOSZKTrLdb
NETBOX_URL=http://netbox:8080/
OAUTH2_ACTIVE=False
LSO_PLAYBOOK_URL=http://orchestrator-lso:8000/api/playbook
ORCHESTRATOR_URL=http://orchestrator:8080
FEDERATION_VERSION=2.9
FEDERATION_VERSION=2.11
CACHE_URI=redis://:nwa@redis:6379/0

# Uvicorn worker processes: increase this in production
Expand Down
Loading
Loading