You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Docker users**: The official `netboxcommunity/netbox` images do **NOT** include PostGIS and GDAL libraries by default. You will need to create a custom Docker image. See the Docker-specific instructions below.
142
+
143
+
### Step 1: Enable PostGIS in PostgreSQL
144
+
145
+
Connect to your NetBox database and enable the PostGIS extension:
146
+
147
+
```sql
148
+
-- Connect to your NetBox database
149
+
\c netbox
150
+
151
+
-- Enable PostGIS extension
152
+
CREATE EXTENSION IF NOT EXISTS postgis;
153
+
154
+
-- Verify installation
155
+
SELECT PostGIS_version();
156
+
```
157
+
158
+
### Step 2: Configure NetBox Database Engine
159
+
160
+
**CRITICAL**: Update your NetBox `configuration.py` to use the PostGIS database engine:
**Note**: This is just an example. If you're using NetBox Docker, this can be configured via environment variables in your `docker-compose.yml` or similar configuration files.
180
+
181
+
### Step 3: Install the Plugin
182
+
183
+
#### Standard Installation (pip)
97
184
98
-
1. Install the plugin:
99
185
```bash
100
186
pip install cesnet_service_path_plugin
101
187
```
102
188
103
-
2. Enable the plugin in your NetBox configuration:
189
+
#### Docker Installation
190
+
191
+
The official NetBox Docker images do not include the required geographic libraries. You need to create a custom Docker image.
192
+
193
+
**Option 1: Create a Custom Dockerfile**
194
+
195
+
Create a `Dockerfile` extending the official NetBox image:
196
+
197
+
```dockerfile
198
+
FROM netboxcommunity/netbox:v4.4
199
+
200
+
# Install PostGIS and geographic libraries
201
+
RUN apt-get update && \
202
+
apt-get install -y --no-install-recommends \
203
+
postgresql-client \
204
+
postgis \
205
+
gdal-bin \
206
+
libgdal-dev \
207
+
libgeos-dev \
208
+
libproj-dev \
209
+
python3-gdal \
210
+
&& rm -rf /var/lib/apt/lists/*
211
+
212
+
# Copy plugin requirements
213
+
COPY plugin_requirements.txt /opt/netbox/
214
+
RUN /opt/netbox/venv/bin/pip install --no-cache-dir -r /opt/netbox/plugin_requirements.txt
215
+
```
216
+
217
+
Then create a `plugin_requirements.txt` file:
218
+
```
219
+
cesnet_service_path_plugin
220
+
```
221
+
222
+
Build your custom image:
223
+
```bash
224
+
docker build -t netbox-with-gis:latest .
225
+
```
226
+
227
+
Update your `docker-compose.yml` to use the custom image:
228
+
```yaml
229
+
services:
230
+
netbox:
231
+
image: netbox-with-gis:latest
232
+
# ... rest of your configuration
233
+
```
234
+
235
+
**Option 2: Use docker-compose override**
236
+
237
+
Add a `docker-compose.override.yml` file:
238
+
239
+
```yaml
240
+
version: '3.8'
241
+
services:
242
+
netbox:
243
+
build:
244
+
context: .
245
+
dockerfile: Dockerfile.custom
246
+
```
247
+
248
+
For detailed Docker setup instructions, see [using netbox-docker with plugins](https://github.com/netbox-community/netbox-docker/wiki/Using-Netbox-Plugins).
For NetBox Docker installations, add to your `plugin_requirements.txt`:
287
+
**Docker users:**
140
288
```bash
141
-
cesnet_service_path_plugin
289
+
docker-compose restart netbox netbox-worker
142
290
```
143
291
144
-
**Docker users**: Ensure your NetBox Docker image includes PostGIS and GDAL libraries.
292
+
### Verification
145
293
146
-
For detailed Docker setup instructions, see [using netbox-docker with plugins](https://github.com/netbox-community/netbox-docker/wiki/Using-Netbox-Plugins).
294
+
To verify the installation:
147
295
148
-
## Configuration
296
+
1. Log into NetBox
297
+
2. Check that "Service Paths" appears in the navigation menu
298
+
3. Navigate to **Service Paths → Segments** to confirm the plugin is working
149
299
150
-
### Database Configuration
300
+
For geographic feature verification, you can use the diagnostic function in the Django shell:
151
301
152
-
Ensure your NetBox database has PostGIS enabled:
153
-
```sql
154
-
CREATE EXTENSION IF NOT EXISTS postgis;
302
+
```python
303
+
python manage.py nbshell
304
+
305
+
from cesnet_service_path_plugin.utils import check_gis_environment
306
+
check_gis_environment()
155
307
```
156
308
309
+
## Additional Configuration
310
+
157
311
### Custom Status Choices
158
312
159
313
Extend or override default status choices in your `configuration.py`:
0 commit comments