Manage Cloudflare with Netbox & style.
Project description
Netbox Cloudflare Plugin
Manage Cloudflare with Netbox & style.
Installation
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-cloudflare-plugin
Enable the plugin in the /opt/netbox/netbox/netbox/configuration.py
file:
PLUGINS = [
'netbox_cloudflare_plugin',
]
Then, run migrations:
cd /opt/netbox
python3 netbox/manage.py migrate
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-cloudflare-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-cloudflare-plugin dependencies:
cd $PROJECT/netbox-cloudflare-plugin
pip install -e .
Configure Netbox and install Netbox dependencies:
cd $PROJECT/netbox
cp $PROJECT/netbox-cloudflare-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_cloudflare_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_cloudflare_plugin/*' netbox/manage.py test netbox_cloudflare_plugin.tests --keepdb -v 2
coverage report -m
Hosting
Check https://saashup.com for more information.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for netbox_cloudflare_plugin-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a4eb64a9302c8bd4c47b273fc3b6b9f64b58d7cc33bfb39a4dd45856ca130065 |
|
MD5 | 1f114feea4436269411983b20b93e39f |
|
BLAKE2b-256 | f7390285062ed58b76726a157818b43b8531e41d4410cdf5487299e067f7f4a6 |
Hashes for netbox_cloudflare_plugin-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a70ec25f9475fbe654db9d1dd55402d8d9332800d43eeda1cad12829492d8126 |
|
MD5 | ea91759041b1c06008c11ce871091c03 |
|
BLAKE2b-256 | 665747a3c0a92fe38d9275692b471b90f8965e93b301199aa682d8b24e418640 |