Skip to content

Commit 8b04e4f

Browse files
authored
Merge pull request #13 from netboxlabs/develop
🚚 release
2 parents 85da26d + f102fb5 commit 8b04e4f

File tree

3 files changed

+33
-18
lines changed

3 files changed

+33
-18
lines changed

README.md

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Diode NetBox Plugin
22

3-
The Diode NetBox plugin is a [NetBox](https://netboxlabs.com/oss/netbox/) plugin and a required component of the [Diode](https://github.com/netboxlabs/diode) ingestion service.
3+
The Diode NetBox plugin is a [NetBox](https://netboxlabs.com/oss/netbox/) plugin. It is a required component of the [Diode](https://github.com/netboxlabs/diode) ingestion service.
44

55
Diode is a NetBox ingestion service that greatly simplifies and enhances the process to add and update network data
66
in NetBox, ensuring your network source of truth is always accurate and can be trusted to power your network automation
@@ -17,6 +17,15 @@ at [https://netboxlabs.com/blog/introducing-diode-streamlining-data-ingestion-in
1717

1818
## Installation
1919

20+
Source the NetBox Python virtual environment:
21+
22+
```shell
23+
cd /opt/netbox
24+
source venv/bin/activate
25+
```
26+
27+
Install the plugin:
28+
2029
```bash
2130
pip install netboxlabs-diode-netbox-plugin
2231
```
@@ -29,36 +38,37 @@ PLUGINS = [
2938
]
3039
```
3140

41+
Restart NetBox services to load the plugin:
42+
43+
```
44+
sudo systemctl restart netbox netbox-rq
45+
```
46+
3247
See [NetBox Documentation](https://netboxlabs.com/docs/netbox/en/stable/plugins/#installing-plugins) for details.
3348

3449
## Configuration
3550

36-
Source the NetBox Python virtual environment:
51+
Source the NetBox Python virtual environment (if not already):
3752

3853
```shell
3954
cd /opt/netbox
4055
source venv/bin/activate
4156
```
4257

43-
Generate 3 API keys as random 40 character long alphanumeric strings:
58+
Three API keys will be needed (these are random 40 character long alphanumeric strings). They can be generated and set to the appropriate environment variables with the following commands:
4459

4560
```shell
46-
echo "export DIODE_TO_NETBOX_API_KEY=$(head -c20 </dev/urandom|xxd -p)"
47-
echo "export NETBOX_TO_DIODE_API_KEY=$(head -c20 </dev/urandom|xxd -p)"
48-
echo "export INGESTION_API_KEY=$(head -c20 </dev/urandom|xxd -p)"
61+
# API key for the Diode service to interact with NetBox
62+
export DIODE_TO_NETBOX_API_KEY=$(head -c20 </dev/urandom|xxd -p); env | grep DIODE_TO_NETBOX_API_KEY
63+
# API key for the NetBox service to interact with Diode
64+
export NETBOX_TO_DIODE_API_KEY=$(head -c20 </dev/urandom|xxd -p); env | grep NETBOX_TO_DIODE_API_KEY
65+
# API key for Diode SDKs to ingest data into Diode
66+
export DIODE_API_KEY=$(head -c20 </dev/urandom|xxd -p); env | grep DIODE_API_KEY
4967
```
5068

5169
**Note:** store these API key strings in a safe place as they will be needed later to configure the Diode server
5270

53-
Set the environment variables based on the random generated strings:
54-
55-
```shell
56-
export DIODE_TO_NETBOX_API_KEY={random_string_1} # API key for the Diode service to interact with NetBox
57-
export NETBOX_TO_DIODE_API_KEY={random_string_2} # API key for the NetBox service to interact with Diode
58-
export INGESTION_API_KEY={random_string_3} # API key for Diode SDKs to ingest data into Diode
59-
```
60-
61-
Configure the plugin:
71+
Configure the plugin to use the previously generated API keys:
6272

6373
```shell
6474
cd /opt/netbox/netbox
@@ -74,3 +84,8 @@ make docker-compose-netbox-plugin-test
7484
## License
7585

7686
Distributed under the PolyForm Shield License 1.0.0 License. See [LICENSE.md](./LICENSE.md) for more information.
87+
88+
## Required Notice
89+
90+
Copyright NetBox Labs, Inc.
91+

docker/netbox/env/netbox.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,5 @@ WEBHOOKS_ENABLED=true
3939
RELOAD_NETBOX_ON_DIODE_PLUGIN_CHANGE=false
4040
DIODE_TO_NETBOX_API_KEY=1368dbad13e418d5a443d93cf255edde03a2a754
4141
NETBOX_TO_DIODE_API_KEY=1e99338b8cab5fc637bc55f390bda1446f619c42
42-
INGESTION_API_KEY=5a52c45ee8231156cb620d193b0291912dd15433
42+
DIODE_API_KEY=5a52c45ee8231156cb620d193b0291912dd15433
4343
BASE_PATH=netbox/

netbox_diode_plugin/management/commands/configurediodeplugin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class Command(BaseCommand):
4545

4646
diode_to_netbox_username = "DIODE_TO_NETBOX"
4747
netbox_to_diode_username = "NETBOX_TO_DIODE"
48-
ingestion_username = "INGESTION"
48+
diode_username = "DIODE"
4949

5050
def handle(self, *args, **options):
5151
"""Handle command execution."""
@@ -57,7 +57,7 @@ def handle(self, *args, **options):
5757
self.diode_to_netbox_username, group
5858
)
5959
_ = _create_user_with_token(self.netbox_to_diode_username, group, True)
60-
_ = _create_user_with_token(self.ingestion_username, group)
60+
_ = _create_user_with_token(self.diode_username, group)
6161

6262
diode_plugin_object_type = NetBoxType.objects.get(
6363
app_label="netbox_diode_plugin", model="diode"

0 commit comments

Comments
 (0)