Index: head/net-mgmt/netbox/Makefile =================================================================== --- head/net-mgmt/netbox/Makefile (revision 530514) +++ head/net-mgmt/netbox/Makefile (revision 530515) @@ -1,79 +1,79 @@ # $FreeBSD$ PORTNAME= netbox DISTVERSIONPREFIX= v -DISTVERSION= 2.7.10 +DISTVERSION= 2.7.11 CATEGORIES= net-mgmt MAINTAINER= kai@FreeBSD.org COMMENT= IP address management tool LICENSE= APACHE20 LICENSE_FILE= ${WRKSRC}/LICENSE.txt RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}django22>=2.2<2.3:www/py-django22@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}dj22-django-cacheops>=4.2:www/py-dj22-django-cacheops@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}dj22-django-cors-headers>=3.2.1:www/py-dj22-django-cors-headers@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}dj22-django-debug-toolbar>=2.1:www/py-dj22-django-debug-toolbar@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}dj22-django-filter>=2.2.0:www/py-dj22-django-filter@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}dj22-django-mptt>=0.9.1:www/py-dj22-django-mptt@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}dj22-django-prometheus>=1.1.0:www/py-dj22-django-prometheus@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}dj22-django-rq>=2.2.0:devel/py-dj22-django-rq@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}dj22-django-tables2>=2.2.1:www/py-dj22-django-tables2@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}dj22-django-taggit>=1.2.0:www/py-dj22-django-taggit@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}dj22-django-taggit-serializer>=0.1.7:www/py-dj22-django-taggit-serializer@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}dj22-django-timezone-field>=4.0:www/py-dj22-django-timezone-field@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}dj22-djangorestframework>=3.10.3:www/py-dj22-djangorestframework@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}dj22-drf-yasg>=1.17.0:www/py-dj22-drf-yasg@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}django-pglocks>=1.0.4:www/py-django-pglocks@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}gfm>=0.1.4:textproc/py-gfm@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}Jinja2>=2.10.1:devel/py-Jinja2@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}markdown>=2.6.11:textproc/py-markdown@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}netaddr>=0.7.19:net/py-netaddr@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}pycryptodome>=3.8.2:security/py-pycryptodome@${PY_FLAVOR} \ ${PY_PILLOW} \ ${PYTHON_PKGNAMEPREFIX}psycopg2>=2.8.4:databases/py-psycopg2@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}redis>=3.3.11:databases/py-redis@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}svgwrite>=1.3.1:graphics/py-svgwrite@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}yaml>=5.2:devel/py-yaml@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}gunicorn>=19.9.0.:www/py-gunicorn@${PY_FLAVOR} USES= pgsql:9.4+ python:3.5+ USE_GITHUB= yes GH_ACCOUNT= netbox-community SUB_FILES= netboxrc.sample pkg-message SUB_LIST= DATADIR=${DATADIR} PYTHON_CMD=${PYTHON_CMD} PYTHON_VER=${PYTHON_VER} WWWOWN=${WWWOWN} NO_BUILD= yes NO_ARCH= yes OPTIONS_DEFINE= DOCS EXAMPLES do-install: cd ${WRKSRC}/netbox ; \ for src in $$( ${FIND} . ! -name '*.bak' ) ; do \ dst=${STAGEDIR}${DATADIR}$${src#.} ; \ if ${TEST} -d "$$src" ; then \ ${MKDIR} "$$dst" ; \ else \ ${INSTALL_DATA} "$$src" "$$dst" ; \ fi \ done post-install-DOCS-on: cd ${WRKSRC}/docs ; \ ${MKDIR} ${STAGEDIR}${DOCSDIR} ; \ for src in $$( ${FIND} . ! -name '*.bak' ) ; do \ dst=${STAGEDIR}${DOCSDIR}$${src#.} ; \ if ${TEST} -d "$$src" ; then \ ${MKDIR} "$$dst" ; \ else \ ${INSTALL_DATA} "$$src" "$$dst" ; \ fi \ done post-install-EXAMPLES-on: @${MKDIR} ${STAGEDIR}${EXAMPLESDIR} ${INSTALL_DATA} ${WRKDIR}/netboxrc.sample ${STAGEDIR}${EXAMPLESDIR} .include Index: head/net-mgmt/netbox/distinfo =================================================================== --- head/net-mgmt/netbox/distinfo (revision 530514) +++ head/net-mgmt/netbox/distinfo (revision 530515) @@ -1,3 +1,3 @@ -TIMESTAMP = 1584023099 -SHA256 (netbox-community-netbox-v2.7.10_GH0.tar.gz) = 21743eda8f633761fd9a16c28658235e7ee9a79b15353770b4b1fe0d133a26e5 -SIZE (netbox-community-netbox-v2.7.10_GH0.tar.gz) = 5589759 +TIMESTAMP = 1585496811 +SHA256 (netbox-community-netbox-v2.7.11_GH0.tar.gz) = a910d6d32dd8912718cba228a7bbc1ef7d0ab3a6397a5a6a8089ab86603ed260 +SIZE (netbox-community-netbox-v2.7.11_GH0.tar.gz) = 5597953 Index: head/net-mgmt/netbox/files/netboxrc.sample.in =================================================================== --- head/net-mgmt/netbox/files/netboxrc.sample.in (revision 530514) +++ head/net-mgmt/netbox/files/netboxrc.sample.in (revision 530515) @@ -1,62 +1,91 @@ #!/bin/sh # This sample rc script eliminate the need to use sysutils/py-supervisor to # run NetBox as a system service. Only www/py-gunicorn is needed as a WSGI. # # Of course a working HTTP server like Apache/nginx is still required to make # use of the gunicorn WSGI. # # PROVIDE: netbox # REQUIRE: DAEMON # KEYWORD: shutdown # # Add the following line to /etc/rc.conf.local or /etc/rc.conf # to enable netbox: # -# netbox_enable (bool): Set to NO by default. -# Set it to YES to enable netbox. -# netbox_config (str): Default to "/usr/local/etc/${name}.conf}" -# Config file for gunicorn's netbox config file -# netbox_command (str): Default to "/usr/local/bin/gunicorn-3.6" -# Path to gunicorn to run netbox -# netbox_bind (str): Default to "localhost:8001" -# Interface and port to bind to -# netbox_workers (int): Default to "3" -# Number of gunicorn works -# netbox_timeout (int): Default to "120" -# Worker timeout for gunicorn +# netbox_enable (bool): Set to NO by default. +# Set it to YES to enable netbox. +# netbox_use_config (bool): Set to NO by default. +# If set, read the configuration parameter from file defined in +# "netbox_config" instead using rc variables. +# netbox_config (str): Default to "/usr/local/etc/${name}.conf}" +# Config file for gunicorn's netbox config file +# netbox_command (str): Default to "%%LOCALBASE%%/bin/gunicorn" +# Path to gunicorn to run netbox +# netbox_bind (str): Default to "localhost:8001" +# Interface and port to bind to +# netbox_workers (int): Default to "5" +# Number of gunicorn workers +# netbox_threads (int): Default to "3" +# Number of worker threads per handling request +# netbox_timeout (int): Default to "120" +# Worker timeout for gunicorn +# netbox_max_requests (int): Default to "5000" +# Maximum number of requests a worker process will process before respawning +# netbox_max_requests_jitter (int): Default to "500" +# Maximum number jitter to add to "netbox_max_requests" +# netbox_extra_args (str): Not set by default +# Extra arguments that are passed to gunicorn # . /etc/rc.subr name="netbox" rcvar=netbox_enable netbox_path=%%DATADIR%% load_rc_config $name start_precmd="netbox_precmd" command=${netbox_program:-%%LOCALBASE%%/bin/gunicorn} procname=${netbox_procname:-%%PYTHON_CMD%%} netbox_chdir=${netbox_path} pidfile=${netbox_pidfile:-/var/run/${name}/${name}.pid} netbox_user=${netbox_user:-%%WWWOWN%%} +netbox_use_config=${netbox_use_config:-no} +netbox_config=${netbox_config:-/${name}.conf} netbox_bind=${netbox_bind:-localhost:8001} -netbox_workers=${netbox_workers:-3} +netbox_workers=${netbox_workers:-5} +netbox_threads=${netbox_threads:-3} netbox_timeout=${netbox_timeout:-120} +netbox_max_requests=${netbox_max_requests:-5000} +netbox_max_requests_jitter=${netbox_max_requests_jitter:-500} -command_args="${netbox_args} -D \ - --log-syslog --log-syslog-prefix ${name} \ - --log-syslog-to unix:///var/run/log#dgram \ - --disable-redirect-access-to-syslog \ - -p ${pidfile} --pythonpath ${netbox_path} \ - -b ${netbox_bind} -w ${netbox_workers} -t ${netbox_timeout} \ - netbox.wsgi" +# Read settings from confguration file if set +if checkyesno netbox_use_config && [ -f "${netbox_config}" ]; then + command_args="${netbox_args} -D \ + --log-syslog --log-syslog-prefix ${name} \ + --log-syslog-to unix:///var/run/log#dgram \ + --disable-redirect-access-to-syslog \ + -p ${pidfile} --pythonpath ${netbox_path} \ + -c ${netbox_config} \ + netbox.wsgi" +else + command_args="${netbox_args} -D \ + --log-syslog --log-syslog-prefix ${name} \ + --log-syslog-to unix:///var/run/log#dgram \ + --disable-redirect-access-to-syslog \ + -p ${pidfile} --pythonpath ${netbox_path} \ + -b ${netbox_bind} -w ${netbox_workers} --threads ${netbox_threads} -t ${netbox_timeout} \ + --max-requests ${netbox_max_requests} --max-requests-jitter ${netbox_max_requests_jitter} \ + ${netbox_extra_args} \ + netbox.wsgi" +fi netbox_precmd() { install -d -o ${netbox_user} `dirname ${pidfile}` } run_rc_command "$1" Index: head/net-mgmt/netbox/files/pkg-message.in =================================================================== --- head/net-mgmt/netbox/files/pkg-message.in (revision 530514) +++ head/net-mgmt/netbox/files/pkg-message.in (revision 530515) @@ -1,184 +1,196 @@ [ { type: install message: <