Skip to main content

Manage Passhup Netbox distribution initialization and behaviours.

Project description

Netbox Docker Plugin

Manage Passhup Netbox distribution initialization and behaviours.

Installation

Below the compatibility list of the Netbox Docker PLugin and Netbox. Please chose the right version of the plugin depending of the Netbox version you use:

Netbox Version Netbox Docker Plugin Version
4.1.* 0.0.*

You can follow the official plugins installation instructions.

If needed, source your Netbox's virtual environment and install the plugin like a package. We assume you have already installed Netbox and its source code are in /opt/netbox:

cd /opt/netbox
python3 -m venv venv # if virtual env was not created before
source /opt/netbox/venv/bin/activate
pip install netbox-passhup-plugin

Enable the plugin in the /opt/netbox/netbox/netbox/configuration.py file:

PLUGINS = [
    'netbox_passhup_plugin',
]

Environment variables

For running the plugin must Netbox started with this environment set:

  • VM_AGENT_BASE_URL (string): the base URL of the Passhup VM agent (eg: http://my.agent.com)
  • VM_AGENT_BODY_TEMPLATE (string): the string base64 encoded body template to send to the agent on VM creation

Alternative

Another way to install Netbox is to use the Official netbox-docker project.

With this alternate way, you can customize your Netbox image and migrations will be automatically execute each time you restart the container.

Contribute

Install our development environment

Requirements:

  • Python 3.11
  • PostgreSQL 15 Official Netbox doc
    • user: netbox (with database creation right)
    • password: secret
    • database: netbox
    • port: 5432
  • Redis 7.2
    • port: 6379

Set a PROJECT variable :

PROJECT="/project/netbox"

Create a project directory $PROJECT:

mkdir $PROJECT

Go inside your project directory, clone this repository and the Netbox repository:

cd $PROJECT
git clone git@github.com:SaaShup/netbox-passhup-plugin.git
git clone git@github.com:netbox-community/netbox.git

Create your venv and activate it:

python -m venv venv
source venv/bin/activate

Install netbox-passhup-plugin dependencies:

cd $PROJECT/netbox-passhup-plugin
pip install -e .

Configure Netbox and install Netbox dependencies:

cd $PROJECT/netbox
cp $PROJECT/netbox-passhup-plugin/netbox_configuration/configuration_dev.py $PROJECT/netbox/netbox/netbox/configuration.py
pip install -r requirements.txt

Run database migrations:

cd $PROJECT/netbox
python3 netbox/manage.py migrate

Create a Netbox super user:

cd $PROJECT/netbox
python3 netbox/manage.py createsuperuser

Start Netbox instance:

cd $PROJECT/netbox
python3 netbox/manage.py runserver 0.0.0.0:8000 --insecure

Visit http://localhost:8000/

Run tests

After installing your development environment, you can run the tests plugin (you don't need to start the Netbox instance):

cd $PROJECT/netbox
python3 -m pip install requests_mock
python3 netbox/manage.py test netbox_passhup_plugin.tests --keepdb -v 2

With code coverage, install coverage.py and use it:

cd $PROJECT/netbox
python3 -m pip install coverage

Then run the test with coverage.py and print the report:

cd $PROJECT/netbox
coverage run --include='*/netbox_passhup_plugin/*' netbox/manage.py test netbox_passhup_plugin.tests --keepdb -v 2
coverage report -m

Hosting

Check https://saashup.com for more information.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

netbox_passhup_plugin-0.0.1.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

netbox_passhup_plugin-0.0.1-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file netbox_passhup_plugin-0.0.1.tar.gz.

File metadata

  • Download URL: netbox_passhup_plugin-0.0.1.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for netbox_passhup_plugin-0.0.1.tar.gz
Algorithm Hash digest
SHA256 3edcded8d12bbe495bcafe7742ffde0c6b2f1b8649eccfbcbc63b45fedb66c78
MD5 45f5a78ad49fe3f20985710b7c379544
BLAKE2b-256 f4d903644218a5a6fc9f872ffa257789a6a4729b912bc2ea4f4a8e1c10eabe49

See more details on using hashes here.

Provenance

The following attestation bundles were made for netbox_passhup_plugin-0.0.1.tar.gz:

Publisher: tags_cd.yml on SaaShup/netbox-passhup-plugin

Attestations:

File details

Details for the file netbox_passhup_plugin-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for netbox_passhup_plugin-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d41f7e470b35c36d6ca01b187b3597ba431944f9bdcb6f15a328384f9177eb1c
MD5 33a6c42f382f6af684665591abb839d6
BLAKE2b-256 3a5624375713a9d19d5327c81a6dce7fda4f57c4fd748e57e821b7717e803f7c

See more details on using hashes here.

Provenance

The following attestation bundles were made for netbox_passhup_plugin-0.0.1-py3-none-any.whl:

Publisher: tags_cd.yml on SaaShup/netbox-passhup-plugin

Attestations:

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page