Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • digit-c4/netbox-plugins
  • abramda/netbox-plugins-for-git-lab-pilot
2 results
Show changes
Commits on Source (8)
......@@ -13,6 +13,7 @@ RUN apt-get update && \
RUN mkdir /opt/netbox/plugins
COPY requirements.txt /opt/netbox/plugins
COPY netbox_configuration/plugins.py /etc/netbox/config/plugins.py
COPY netbox_configuration/extra.py /etc/netbox/config/extra.py
RUN pip install -r /opt/netbox/plugins/requirements.txt
......
......@@ -35,10 +35,10 @@
mode: "0644"
- name: Run `docker-compose up`
community.docker.docker_compose:
community.docker.docker_compose_v2:
project_src: "/home/debian/netbox/{{ lookup('ansible.builtin.env', 'CI_PIPELINE_ID') }}/"
state: present
pull: true
pull: always
- name: Wait until the metrics are available
ansible.builtin.uri:
......
......@@ -3,7 +3,7 @@
tasks:
- name: Run `docker-compose down`
community.docker.docker_compose:
community.docker.docker_compose_v2:
project_src: "/home/debian/netbox/{{ lookup('ansible.builtin.env', 'CI_PIPELINE_ID') }}/"
state: absent
remove_volumes: true
......
......@@ -30,7 +30,6 @@ REDIS_DATABASE=0
REDIS_INSECURE_SKIP_TLS_VERIFY=false
REDIS_PASSWORD=H733Kdjndks81
REDIS_SSL=false
RELEASE_CHECK_URL=https://api.github.com/repos/netbox-community/netbox/releases
SECRET_KEY=r(m)9nLGnz$(_q3N4z1k(EFsMCjjjzx08x9VhNVcfd%6RF#r!6DE@+V5Zk2X
SKIP_SUPERUSER=false
SUPERUSER_PASSWORD=thisnetboxisnot4u
......
CENSUS_REPORTING_ENABLED = False
RELEASE_CHECK_URL = None
DEFAULT_DASHBOARD = [
{
"widget": "extras.BookmarksWidget",
"width": 4,
"height": 5,
"title": "Bookmarks",
"color": "orange",
},
{
"widget": "extras.ObjectCountsWidget",
"width": 4,
"height": 2,
"title": "Organization",
"config": {
"models": [
"dcim.site",
"tenancy.tenant",
"tenancy.contact",
]
},
},
{
"widget": "extras.NoteWidget",
"width": 4,
"height": 2,
"title": "Welcome!",
"color": "green",
"config": {
"content": (
"This is your personal dashboard. Feel free to customize it by rearranging, resizing, or removing "
'widgets. You can also add new widgets using the "add widget" button below. Any changes affect only '
"_your_ dashboard, so feel free to experiment!"
)
},
},
{
"widget": "extras.ObjectCountsWidget",
"width": 4,
"height": 3,
"title": "IPAM",
"config": {
"models": [
"ipam.vrf",
"ipam.aggregate",
"ipam.prefix",
"ipam.iprange",
"ipam.ipaddress",
"ipam.vlan",
]
},
},
{
"widget": "extras.ObjectCountsWidget",
"width": 4,
"height": 3,
"title": "Circuits",
"config": {
"models": [
"circuits.provider",
"circuits.circuit",
"circuits.providernetwork",
"circuits.provideraccount",
]
},
},
{
"widget": "extras.ObjectCountsWidget",
"width": 4,
"height": 3,
"title": "DCIM",
"config": {
"models": [
"dcim.site",
"dcim.rack",
"dcim.devicetype",
"dcim.device",
"dcim.cable",
],
},
},
{
"widget": "extras.ObjectCountsWidget",
"width": 4,
"height": 2,
"title": "Virtualization",
"config": {
"models": [
"virtualization.cluster",
"virtualization.virtualmachine",
]
},
},
{
"widget": "extras.ObjectListWidget",
"width": 12,
"height": 5,
"title": "Change Log",
"color": "blue",
"config": {
"model": "extras.objectchange",
"page_size": 25,
},
},
]
PLUGINS = ['netbox_dns', 'netbox_rps_plugin', 'netbox_cert_plugin', 'netbox_prometheus_sd', 'netbox_docker_plugin']
PLUGINS = [
"netbox_dns",
"netbox_rps_plugin",
"netbox_cert_plugin",
"netbox_prometheus_sd",
"netbox_docker_plugin",
]
......@@ -358,7 +358,7 @@ class TestMappingPropertiesValidation(Base):
)
def test_that_client_max_body_size_have_limit(self) -> None:
"""Test that client_max_body_size property is between 1 and 255"""
"""Test that client_max_body_size property limit is 128"""
response = requests.post(
url=f"http://{HOST}:{PORT}/api/plugins/rps/mapping/",
......@@ -374,7 +374,7 @@ class TestMappingPropertiesValidation(Base):
self.assertEqual(response.status_code, 400)
self.assertEqual(
response.content,
b'{"client_max_body_size":["Ensure this value is greater than or equal to 1."]}',
b'{"client_max_body_size":["\\"0\\" is not a valid choice."]}',
)
response = requests.post(
......@@ -382,7 +382,7 @@ class TestMappingPropertiesValidation(Base):
json={
"source": "https://truc00.com/api",
"target": "http://10.10.10.10:1800/api",
"client_max_body_size": 256,
"client_max_body_size": 3000,
},
headers={"Authorization": f"Token {API_KEY}"},
timeout=5,
......@@ -391,7 +391,7 @@ class TestMappingPropertiesValidation(Base):
self.assertEqual(response.status_code, 400)
self.assertEqual(
response.content,
b'{"client_max_body_size":["Ensure this value is less than or equal to 255."]}',
b'{"client_max_body_size":["\\"3000\\" is not a valid choice."]}',
)
response = requests.post(
......@@ -399,19 +399,19 @@ class TestMappingPropertiesValidation(Base):
json={
"source": "https://truc00.com/api",
"target": "http://10.10.10.10:1800/api",
"client_max_body_size": 200,
"client_max_body_size": 2048,
},
headers={"Authorization": f"Token {API_KEY}"},
timeout=5,
)
self.assertEqual(response.status_code, 201)
self.assertEqual(response.json()["client_max_body_size"], 200)
self.assertEqual(response.json()["client_max_body_size"], 2048)
self.mapping_id = json.loads(response.content)["id"]
def test_that_client_max_body_size_default_value_is_60(self) -> None:
"""Test that client_max_body_size property default value is 1"""
def test_that_client_max_body_size_default_value_is_128(self) -> None:
"""Test that client_max_body_size property default value is 128"""
response = requests.post(
url=f"http://{HOST}:{PORT}/api/plugins/rps/mapping/",
......@@ -424,7 +424,7 @@ class TestMappingPropertiesValidation(Base):
)
self.assertEqual(response.status_code, 201)
self.assertEqual(response.json()["client_max_body_size"], 1)
self.assertEqual(response.json()["client_max_body_size"], 128)
self.mapping_id = json.loads(response.content)["id"]
......
......@@ -2,6 +2,6 @@ netbox-plugin-dns == 0.19.*
netbox-plugin-prometheus-sd
netbox-docker-plugin
--extra-index-url https://code.europa.eu/api/v4/projects/662/packages/pypi/simple
netbox-cert-plugin
netbox-cert-plugin == 0.1.*
--extra-index-url https://code.europa.eu/api/v4/projects/623/packages/pypi/simple
netbox-rps-plugin == 0.13.*
netbox-rps-plugin == 0.15.*