summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO7
-rw-r--r--PKGBUILD14
-rw-r--r--gunicorn_config.py5
-rw-r--r--netbox-system.service2
-rw-r--r--netbox.install2
5 files changed, 23 insertions, 7 deletions
diff --git a/.SRCINFO b/.SRCINFO
index d5c506d81a84..68f3dcd47c31 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = netbox
pkgdesc = IP address management (IPAM) and data center infrastructure management (DCIM) tool.
pkgver = 1.6.3
- pkgrel = 2
+ pkgrel = 3
url = https://github.com/digitalocean/netbox
install = netbox.install
arch = any
@@ -30,12 +30,15 @@ pkgbase = netbox
depends = python2-xmltodict
conflicts = netbox-git
replaces = netbox-git
+ backup = etc/netbox/gunicorn_config.py
source = https://github.com/digitalocean/netbox/archive/v1.6.3.tar.gz
source = netbox-system.service
source = netbox.tmpfile
+ source = gunicorn_config.py
sha256sums = 426a7b31e15acaaa9286b423a26f6d6e262f6b94e9060c5acabee2e9c5685dd4
- sha256sums = af0e22f2756aacb3f3d261d19f2b18d1748f6d93dc16fa01a60fe40790e39c7e
+ sha256sums = 5aaf2eef73c77c64bd78a50a80b8f4b3af87b63c64b139d63aa4a95cd82b1ca4
sha256sums = b8f7030f570e7707eb9c0f41c382e37d54244e7885c795a9f31788efdd45914e
+ sha256sums = 7a5ae05cad7ec14193a43ef080776b5525c80b6258762a6cb6a108db83861ff9
pkgname = netbox
diff --git a/PKGBUILD b/PKGBUILD
index 91cb06ee2db6..0f195d3d26ea 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,7 +3,7 @@
_name=netbox
pkgname=${_name}
pkgver=1.6.3
-pkgrel=2
+pkgrel=3
pkgdesc="IP address management (IPAM) and data center infrastructure management (DCIM) tool."
arch=('any')
url="https://github.com/digitalocean/${_name}"
@@ -36,10 +36,13 @@ replaces=("${_name}-git")
install="${_name}.install"
source=("${url}/archive/v${pkgver}.tar.gz"
"${_name}-system.service"
- "${_name}.tmpfile")
+ "${_name}.tmpfile"
+ "gunicorn_config.py")
sha256sums=('426a7b31e15acaaa9286b423a26f6d6e262f6b94e9060c5acabee2e9c5685dd4'
- 'af0e22f2756aacb3f3d261d19f2b18d1748f6d93dc16fa01a60fe40790e39c7e'
- 'b8f7030f570e7707eb9c0f41c382e37d54244e7885c795a9f31788efdd45914e')
+ '5aaf2eef73c77c64bd78a50a80b8f4b3af87b63c64b139d63aa4a95cd82b1ca4'
+ 'b8f7030f570e7707eb9c0f41c382e37d54244e7885c795a9f31788efdd45914e'
+ '7a5ae05cad7ec14193a43ef080776b5525c80b6258762a6cb6a108db83861ff9')
+backup=('etc/netbox/gunicorn_config.py')
package() {
mkdir -p "${pkgdir}/opt/${_name}"
@@ -49,6 +52,9 @@ package() {
install -D -m644 ${_name}-system.service "$pkgdir/usr/lib/systemd/system/${_name}.service"
install -D -m644 ${_name}.tmpfile "$pkgdir/usr/lib/tmpfiles.d/${_name}.conf"
+ mkdir -p "$pkgdir/etc/netbox"
+ install -D -m644 gunicorn_config.py "$pkgdir/etc/netbox/gunicorn_config.py"
+
find "$pkgdir" -type d -name '.git' -exec rm -r '{}' +
}
diff --git a/gunicorn_config.py b/gunicorn_config.py
new file mode 100644
index 000000000000..4cb7111fac44
--- /dev/null
+++ b/gunicorn_config.py
@@ -0,0 +1,5 @@
+command = '/usr/bin/gunicorn'
+pythonpath = '/opt/netbox/netbox'
+bind = '127.0.0.1:8001'
+workers = 3
+user = 'netbox'
diff --git a/netbox-system.service b/netbox-system.service
index 0a9e8f8382a3..303b48137847 100644
--- a/netbox-system.service
+++ b/netbox-system.service
@@ -6,7 +6,7 @@ After=network.target
User=netbox
Type=forking
PIDFile=/run/netbox/netbox.pid
-ExecStart=gunicorn -c /opt/netbox/gunicorn_config.py /opt/netbox/netbox/netbox.wsgi
+ExecStart=/usr/bin/gunicorn -c /etc/netbox/gunicorn_config.py netbox.wsgi
[Install]
WantedBy=multi-user.target
diff --git a/netbox.install b/netbox.install
index 288888fe36c1..92f08a7b725b 100644
--- a/netbox.install
+++ b/netbox.install
@@ -9,6 +9,8 @@ post_install() {
echo -e "service: "
echo " systemctl enable --now netbox.service"
echo ""
+ echo "Tweak the gunicorn configuration in /etc/netbox/gunicorn_config.py"
+ echo ""
}
post_upgrade() {