-
Notifications
You must be signed in to change notification settings - Fork 1
/
rockcraft.yaml
81 lines (76 loc) · 2.57 KB
/
rockcraft.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# Copyright 2024 Canonical Ltd.
# See LICENSE file for licensing details.
name: netbox
base: [email protected]
version: '0.1'
summary: Charmed NetBox project (https://github.com/canonical/netbox/)
description: |
NetBox is the go-to solution for modeling and documenting network
infrastructure for thousands of organizations worldwide. As a successor
to legacy IPAM and DCIM applications, NetBox provides a cohesive,
extensive, and accessible data model for all things networked.
license: Apache-2.0
platforms:
amd64:
# To ensure the django-framework extension works properly, your Django application
# should have an `wsgi.py` file with an `application` object as the WSGI entrypoint.
extensions:
- django-framework
parts:
django-framework/dependencies:
overlay-packages:
- ca-certificates
build-packages:
- pkg-config
- libxmlsec1-dev
- libpq-dev
stage-packages:
# needed for saml
- libxmlsec1
- libxmlsec1-openssl
# needed for postgresql (psycopg[c])
- libpq5
override-build: |-
rm -f pyproject.toml
craftctl default
python-requirements:
- requirements.txt
- requirements-charm.txt
cron:
stage-packages:
- cron
plugin: nil
cron-tasks:
plugin: dump
source: cron.d
organize:
housekeeping: etc/cron.d/housekeeping
syncdatasource: etc/cron.d/syncdatasource
permissions:
- mode: "644"
netbox-post-process:
after:
- django-framework/dependencies
- django-framework/install-app
plugin: nil
override-prime: |-
# At this point, the original configuration does not work correctly.
# Some missing env vars like DJANGO_SECRET_KEY...
NETBOX_CONFIGURATION=netbox.configuration_testing PYTHONUSERBASE=${CRAFT_PRIME} python3 ${CRAFT_PRIME}/django/app/manage.py collectstatic --no-input
# Reports and scripts are written by the _daemon_ user.
chown 584792:584792 django/app/reports
chown 584792:584792 django/app/scripts
services:
# With the scheduler prefix it will just run in one unit
cron-scheduler:
override: merge
summary: "Cron Service"
command: "/usr/sbin/cron -f"
startup: enabled
netbox-rq-worker:
override: merge
summary: "NetBox Request Queue Worker"
command: "/bin/python3 manage.py rqworker high default low"
startup: enabled
user: _daemon_
working-dir: /django/app