Bug 244629 - net-mgmt/netbox: localhost not listening on ::1
Summary: net-mgmt/netbox: localhost not listening on ::1
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Kai Knoblich
URL: https://wiki.freebsd.org/Ports/net-mg...
Keywords:
Depends on:
Blocks:
 
Reported: 2020-03-06 08:24 UTC by O. Hartmann
Modified: 2020-04-15 08:01 UTC (History)
0 users

See Also:
kai: maintainer-feedback+
kai: merge-quarterly+


Attachments
netboxrc.sample (2.82 KB, application/x-shellscript)
2020-03-28 10:41 UTC, Kai Knoblich
kai: maintainer-approval+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description O. Hartmann 2020-03-06 08:24:39 UTC
Running netbox serving CURRENT and 12-STABLE servers with IPv4/IPv6 dual-stack, netbox runs into trouble serving on IPv6.

Following the netbox wiki and perform setup as required for recent redis changes, netbox seems not to listen on ::1.
Comment 1 Kai Knoblich freebsd_committer freebsd_triage 2020-03-07 12:50:46 UTC
(In reply to O. Hartmann from comment #0)

Hi,

thank you for reporting it. Hm, it looks like www/py-gunicorn has some problems with resolving hostnames in relation to IPv4/IPv6 (see also the attached issue at GitHub).

Can you please try the following steps as a workaround? 

A) If you have www/py-gunicorn in conjunction with sysutils/py-supervisor running:

Change the bind line in the "gunicorn_conf.py" to

> bind = ['127.0.0.1:8001','[::1]:8001']


B) If you have the rc script supplied via the EXAMPLES option in use:

Add an additional bind argument to the netbox script to the "command_args":

> -b '[::1]:8001'
Comment 2 Kai Knoblich freebsd_committer freebsd_triage 2020-03-12 19:42:01 UTC
The NetBox page on the FreeBSD wiki has now updated installation/configuration instructions regarding www/py-gunicorn.

The rc script still needs to be updated and there is work in progress.
Comment 3 Kai Knoblich freebsd_committer freebsd_triage 2020-03-28 10:41:26 UTC
Created attachment 212781 [details]
netboxrc.sample

(In reply to O. Hartmann from comment #0)

Attached is a preliminary version of the netbox rc script. It allows to add extra parameters via rc.conf or to use a configuration file.

It also contains some new default values which reflect upstream's defaults.

If the configuration is completely done via rc.conf, following parameters should cope with the IPv4/IPv6 issue of www/py-gunicorn:

> netbox_enable="YES"
> netbox_extra_args="-b '[::1]:8001'"

If a configuration file should be used instead, following steps should also work:

rc.conf:

> netbox_enable="YES"
> netbox_use_config="YES"

If a gunicorn.conf already exists this file should be moved to /usr/local/etc/netbox.conf. Otherwise the example gunicorn.conf on the FreeBSD Wiki (see URL field) can be used as a template.

Of course it's also possible to use a different location/name for the configuration file. For that case just add the following line to the rc.conf:

> netbox_config="/your/own/path/to/netbox.conf"

Add/change the following line in the netbox.conf to enable listening on multiple interfaces:

> bind = ['127.0.0.1:8001','[::1]:8001']

If you have some spare cycles to test it that would be great.
Comment 4 commit-hook freebsd_committer freebsd_triage 2020-04-03 18:56:46 UTC
A commit references this bug:

Author: kai
Date: Fri Apr  3 18:46:26 UTC 2020
New revision: 530515
URL: https://svnweb.freebsd.org/changeset/ports/530515

Log:
  net-mgmt/netbox: Update to 2.7.11

  * Improve the sample rc script to allow passing of extra arguments, e.g. to
    listen on multiple interfaces/addresses [1] or use a configuration file
    instead using rc variables.

    Kudos to Thomas Kurschel for some extra testing of the updated rc script.

  Changelog:

  Enhancements:
  * Add ability to automatically check for new releases (must be enabled by
    setting RELEASE_CHECK_URL)
  * Custom script object variables now utilize dynamic form widgets
  * Add descriptive tooltip to custom fields on object views
  * Add a dedicated view for rack reservations
  * Enable webhooks for rack reservations
  * Enable export templates for rack reservations
  * Enable custom links for rack reservations
  * Update admin links for Django RQ to reflect multiple queues
  * Add a bulk edit view for device bays
  * Add cable trace button for circuit terminations

  Bug Fixes:
  * Improve prefix_length validation on available-prefixes API
  * Fix cable tracing across multiple rear ports
  * Enforce unique constraints for device and virtual machine names in the API
  * Fix Markdown support for tables
  * Fix exception raised on IP address bulk add view
  * Fix duplicate name validation on device model

  https://github.com/netbox-community/netbox/releases/tag/v2.7.11

  PR:		244629 [1]
  Reported by:	O. Hartmann <ohartmann@walstatt.org> [1]
  MFH:		2020Q2

Changes:
  head/net-mgmt/netbox/Makefile
  head/net-mgmt/netbox/distinfo
  head/net-mgmt/netbox/files/netboxrc.sample.in
  head/net-mgmt/netbox/files/pkg-message.in
  head/net-mgmt/netbox/pkg-plist
Comment 5 Kai Knoblich freebsd_committer freebsd_triage 2020-04-03 19:07:22 UTC
Committed to the /head branch, still waiting for approval from the ports-secteam to merge the changes into the 2020Q2 branch.
Comment 6 commit-hook freebsd_committer freebsd_triage 2020-04-06 07:55:50 UTC
A commit references this bug:

Author: kai
Date: Mon Apr  6 07:55:45 UTC 2020
New revision: 530868
URL: https://svnweb.freebsd.org/changeset/ports/530868

Log:
  MFH: r530515

  net-mgmt/netbox: Update to 2.7.11

  * Improve the sample rc script to allow passing of extra arguments, e.g. to
    listen on multiple interfaces/addresses [1] or use a configuration file
    instead using rc variables.

    Kudos to Thomas Kurschel for some extra testing of the updated rc script.

  Changelog:

  Enhancements:
  * Add ability to automatically check for new releases (must be enabled by
    setting RELEASE_CHECK_URL)
  * Custom script object variables now utilize dynamic form widgets
  * Add descriptive tooltip to custom fields on object views
  * Add a dedicated view for rack reservations
  * Enable webhooks for rack reservations
  * Enable export templates for rack reservations
  * Enable custom links for rack reservations
  * Update admin links for Django RQ to reflect multiple queues
  * Add a bulk edit view for device bays
  * Add cable trace button for circuit terminations

  Bug Fixes:
  * Improve prefix_length validation on available-prefixes API
  * Fix cable tracing across multiple rear ports
  * Enforce unique constraints for device and virtual machine names in the API
  * Fix Markdown support for tables
  * Fix exception raised on IP address bulk add view
  * Fix duplicate name validation on device model

  https://github.com/netbox-community/netbox/releases/tag/v2.7.11

  PR:		244629 [1]
  Reported by:	O. Hartmann <ohartmann@walstatt.org> [1]

  Approved by:	ports-secteam (riggs)

Changes:
_U  branches/2020Q2/
  branches/2020Q2/net-mgmt/netbox/Makefile
  branches/2020Q2/net-mgmt/netbox/distinfo
  branches/2020Q2/net-mgmt/netbox/files/netboxrc.sample.in
  branches/2020Q2/net-mgmt/netbox/files/pkg-message.in
  branches/2020Q2/net-mgmt/netbox/pkg-plist
Comment 7 Kai Knoblich freebsd_committer freebsd_triage 2020-04-15 08:01:07 UTC
Changes were also merged into the 2020Q2 branch and the related FreeBSD wiki page has been revised/updated with notes about IPv4/IPv6 dualstack configurations.