# Netbox Cloudflare Plugin
[![Testing Report](https://github.com/SaaShup/netbox-cloudflare-plugin/actions/workflows/main_ci.yml/badge.svg)](https://github.com/SaaShup/netbox-cloudflare-plugin/actions/workflows/main_ci.yml)
Manage Cloudflare with Netbox & style.
![UI Container view with dependencies](/docs/assets/screenshot.png)
## Installation
You can follow [the official plugins installation
instructions](https://docs.netbox.dev/en/stable/plugins/#installing-plugins).
If needed, source your Netbox's virtual environment and install the plugin like
a package. We assume [you have already installed
Netbox](https://docs.netbox.dev/en/stable/installation/) and its source code are
in `/opt/netbox`:
```bash
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:
```python
PLUGINS = [
'netbox_cloudflare_plugin',
]
```
Then, run migrations:
```bash
cd /opt/netbox
python3 netbox/manage.py migrate
```
### Alternative
Another way to install Netbox is to use the [Official netbox-docker
project](https://github.com/netbox-community/netbox-docker).
With this alternate way, you can [customize your Netbox image](https://github.com/netbox-community/netbox-docker/wiki/Using-Netbox-Plugins) 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](https://github.com/netbox-community/netbox/blob/master/docs/installation/1-postgresql.md)
- 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`:
```bash
mkdir $PROJECT
```
Go inside your project directory, clone this repository and the Netbox repository:
```bash
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:
```bash
python -m venv venv
source venv/bin/activate
```
Install netbox-cloudflare-plugin dependencies:
```bash
cd $PROJECT/netbox-cloudflare-plugin
pip install -e .
```
Configure Netbox and install Netbox dependencies:
```bash
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:
```bash
cd $PROJECT/netbox
python3 netbox/manage.py migrate
```
Create a Netbox super user:
```bash
cd $PROJECT/netbox
python3 netbox/manage.py createsuperuser
```
Start Netbox instance:
```bash
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):
```bash
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](https://coverage.readthedocs.io/en/7.3.2/) and use it:
```bash
cd $PROJECT/netbox
python3 -m pip install coverage
```
Then run the test with coverage.py and print the report:
```bash
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.
Raw data
{
"_id": null,
"home_page": null,
"name": "netbox-cloudflare-plugin",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "netbox, netbox-plugin, cloudflare",
"author": null,
"author_email": "Vincent Simonin <vincent@saashup.com>",
"download_url": "https://files.pythonhosted.org/packages/af/47/8e51961eb5df418a975d9f191b94b308d9c01dc897c68133ebe79868ccb0/netbox_cloudflare_plugin-0.3.0.tar.gz",
"platform": null,
"description": "# Netbox Cloudflare Plugin\n\n[![Testing Report](https://github.com/SaaShup/netbox-cloudflare-plugin/actions/workflows/main_ci.yml/badge.svg)](https://github.com/SaaShup/netbox-cloudflare-plugin/actions/workflows/main_ci.yml)\n\nManage Cloudflare with Netbox & style.\n\n![UI Container view with dependencies](/docs/assets/screenshot.png)\n\n## Installation\n\nYou can follow [the official plugins installation\ninstructions](https://docs.netbox.dev/en/stable/plugins/#installing-plugins).\n\nIf needed, source your Netbox's virtual environment and install the plugin like\na package. We assume [you have already installed\nNetbox](https://docs.netbox.dev/en/stable/installation/) and its source code are\nin `/opt/netbox`:\n\n```bash\ncd /opt/netbox\npython3 -m venv venv # if virtual env was not created before\nsource /opt/netbox/venv/bin/activate\npip install netbox-cloudflare-plugin\n```\n\nEnable the plugin in the `/opt/netbox/netbox/netbox/configuration.py` file:\n\n```python\nPLUGINS = [\n 'netbox_cloudflare_plugin',\n]\n```\n\nThen, run migrations:\n\n```bash\ncd /opt/netbox\npython3 netbox/manage.py migrate\n```\n\n### Alternative\n\nAnother way to install Netbox is to use the [Official netbox-docker\nproject](https://github.com/netbox-community/netbox-docker).\n\nWith this alternate way, you can [customize your Netbox image](https://github.com/netbox-community/netbox-docker/wiki/Using-Netbox-Plugins) and migrations will be\nautomatically execute each time you restart the container.\n\n## Contribute\n\n### Install our development environment\n\nRequirements:\n* Python 3.11\n* PostgreSQL 15 [Official Netbox doc](https://github.com/netbox-community/netbox/blob/master/docs/installation/1-postgresql.md)\n - user: netbox (with database creation right)\n - password: secret\n - database: netbox\n - port: 5432\n* Redis 7.2\n - port: 6379\n\nSet a PROJECT variable :\n\n```\nPROJECT=\"/project/netbox\"\n```\n\nCreate a project directory `$PROJECT`:\n\n```bash\nmkdir $PROJECT\n```\n\nGo inside your project directory, clone this repository and the Netbox repository:\n\n```bash\ncd $PROJECT\ngit clone git@github.com:SaaShup/netbox-cloudflare-plugin.git\ngit clone git@github.com:netbox-community/netbox.git\n```\n\nCreate your venv and activate it:\n\n```bash\npython -m venv venv\nsource venv/bin/activate\n```\n\nInstall netbox-cloudflare-plugin dependencies:\n\n```bash\ncd $PROJECT/netbox-cloudflare-plugin\npip install -e .\n```\n\nConfigure Netbox and install Netbox dependencies:\n\n```bash\ncd $PROJECT/netbox\ncp $PROJECT/netbox-cloudflare-plugin/netbox_configuration/configuration_dev.py $PROJECT/netbox/netbox/netbox/configuration.py\npip install -r requirements.txt\n```\n\nRun database migrations:\n\n```bash\ncd $PROJECT/netbox\npython3 netbox/manage.py migrate\n```\n\nCreate a Netbox super user:\n\n```bash\ncd $PROJECT/netbox\npython3 netbox/manage.py createsuperuser\n```\n\nStart Netbox instance:\n\n```bash\ncd $PROJECT/netbox\npython3 netbox/manage.py runserver 0.0.0.0:8000 --insecure\n```\n\nVisit http://localhost:8000/\n\n### Run tests\n\nAfter installing your development environment, you can run the tests plugin\n(you don't need to start the Netbox instance):\n\n```bash\ncd $PROJECT/netbox\npython3 -m pip install requests_mock\npython3 netbox/manage.py test netbox_cloudflare_plugin.tests --keepdb -v 2\n```\n\nWith code coverage, install [coverage.py](https://coverage.readthedocs.io/en/7.3.2/) and use it:\n\n```bash\ncd $PROJECT/netbox\npython3 -m pip install coverage\n```\n\nThen run the test with coverage.py and print the report:\n\n```bash\ncd $PROJECT/netbox\ncoverage run --include='*/netbox_cloudflare_plugin/*' netbox/manage.py test netbox_cloudflare_plugin.tests --keepdb -v 2\ncoverage report -m\n```\n\n# Hosting\n\nCheck https://saashup.com for more information.\n",
"bugtrack_url": null,
"license": null,
"summary": "Manage Cloudflare with Netbox & style.",
"version": "0.3.0",
"project_urls": {
"Bug Tracker": "https://github.com/SaaShup/netbox-cloudflare-plugin/issues",
"Homepage": "https://github.com/SaaShup/netbox-cloudflare-plugin"
},
"split_keywords": [
"netbox",
" netbox-plugin",
" cloudflare"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "c3dd1f140f46d220cf95724cd5cd90244155bb43231bf93a2303cf531e1dab98",
"md5": "7d30ad3cce1d3bff3a5c885b031cd285",
"sha256": "3f4ec45674082004fc3ed99a178ab0868c082ce903849c2f9c3a66e72b107200"
},
"downloads": -1,
"filename": "netbox_cloudflare_plugin-0.3.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "7d30ad3cce1d3bff3a5c885b031cd285",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 22754,
"upload_time": "2024-09-02T12:36:30",
"upload_time_iso_8601": "2024-09-02T12:36:30.577781Z",
"url": "https://files.pythonhosted.org/packages/c3/dd/1f140f46d220cf95724cd5cd90244155bb43231bf93a2303cf531e1dab98/netbox_cloudflare_plugin-0.3.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "af478e51961eb5df418a975d9f191b94b308d9c01dc897c68133ebe79868ccb0",
"md5": "684957b97dddd32480f01d33dfd66a94",
"sha256": "102d30e48d9af035fbaf79cfb57f418b7f32498db810461dee29b10170b7d55b"
},
"downloads": -1,
"filename": "netbox_cloudflare_plugin-0.3.0.tar.gz",
"has_sig": false,
"md5_digest": "684957b97dddd32480f01d33dfd66a94",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 15093,
"upload_time": "2024-09-02T12:36:31",
"upload_time_iso_8601": "2024-09-02T12:36:31.764295Z",
"url": "https://files.pythonhosted.org/packages/af/47/8e51961eb5df418a975d9f191b94b308d9c01dc897c68133ebe79868ccb0/netbox_cloudflare_plugin-0.3.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-02 12:36:31",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "SaaShup",
"github_project": "netbox-cloudflare-plugin",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "netbox-cloudflare-plugin"
}