diff --git a/charm/charmcraft.yaml b/charm/charmcraft.yaml index 5a73595df..c8f2bb883 100644 --- a/charm/charmcraft.yaml +++ b/charm/charmcraft.yaml @@ -51,21 +51,21 @@ requires: config: options: - saml_sp_entity_id: + saml-sp-entity-id: description: |- SAML SP entity id. type: string - saml_username: + saml-username: description: |- SAML attribute used for both the social uid and the username. NameID can be used setting this config to 'name. type: string default: 'name' - saml_email: + saml-email: description: |- SAML attribute used for the email. type: string - aws_endpoint_url: + aws-endpoint-url: description: |- Environment variable for AWS_ENDPOINT_URL. This variable has to be set to the S3 compatible server that will host diff --git a/charm/docs/how-to/configure-saml.md b/charm/docs/how-to/configure-saml.md index 612d3e9ea..ed9e93cc9 100644 --- a/charm/docs/how-to/configure-saml.md +++ b/charm/docs/how-to/configure-saml.md @@ -13,11 +13,11 @@ juju integrate saml-integrator netbox ``` For NetBox to work, you may need to customise some of the following configuration options: - - `saml_sp_entity_id`: SAML SP entity id. This is mandatory, and should be a correct URL. - - `saml_username`: SAML attribute used for both the social uid and the username (name_id by default). - - `saml_email`: SAML attribute used for the email (optional). + - `saml-sp-entity-id`: SAML SP entity id. This is mandatory, and should be a correct URL. + - `saml-username`: SAML attribute used for both the social uid and the username (name_id by default). + - `saml-email`: SAML attribute used for the email (optional). NetBox configuration options for SAML can be configured like: ``` -juju config netbox saml_sp_entity_id= saml_username= +juju config netbox saml-sp-entity-id= saml-username= ``` diff --git a/charm/docs/how-to/configure-scripts-reports.md b/charm/docs/how-to/configure-scripts-reports.md index 56907b3fc..72950f8b4 100644 --- a/charm/docs/how-to/configure-scripts-reports.md +++ b/charm/docs/how-to/configure-scripts-reports.md @@ -9,10 +9,10 @@ To use scripts and reports, it is necessary to configure a Data Source, which ca a good source of examples of both scripts and reports. For S3 data sources, if the S3 server used is S3 compatible, the juju configuration -option `aws_endpoint_url` should be set to the url of the S3 server, as NetBox by default only +option `aws-endpoint-url` should be set to the url of the S3 server, as NetBox by default only allows using Amazon S3. This option limits the S3 compatible servers to just one possible S3 server. For example, if you use minio in the url `https://minio.example.com`, you -should run `juju config netbox aws_endpoint_url=https://minio.example.com`. +should run `juju config netbox aws-endpoint-url=https://minio.example.com`. Once a data source for "Git" or "Amazon S3" is configured (menu Operations -> Data Sources), it should be synced (blue button in the top right of the data source screen). diff --git a/charm/docs/how-to/contribute.md b/charm/docs/how-to/contribute.md index f28c4e0af..58482d96e 100644 --- a/charm/docs/how-to/contribute.md +++ b/charm/docs/how-to/contribute.md @@ -106,10 +106,10 @@ juju integrate redis-k8s netbox NetBox is built using Django. It is necessary to set the allowed hosts for it to work. For development (not recommended for production environments), you can allow all hosts using -the configuration option `django_allowed_hosts` like: +the configuration option `django-allowed-hosts` like: ```bash -juju config netbox django_allowed_hosts='["*"]' +juju config netbox django-allowed-hosts='["*"]' ``` The NetBox charm requires a postgresql_client interface to work. diff --git a/charm/docs/tutorial/getting-started.md b/charm/docs/tutorial/getting-started.md index 75df4a880..805adabe2 100644 --- a/charm/docs/tutorial/getting-started.md +++ b/charm/docs/tutorial/getting-started.md @@ -44,7 +44,7 @@ storage, Redis or PostgreSQL. Set the allowed hosts. In this example every host is allowed. For a production environment only the used hosts should be allowed. ``` -juju config netbox django_allowed_hosts='["*"]' +juju config netbox django-allowed-hosts='["*"]' ``` ### Redis diff --git a/charm/src/charm.py b/charm/src/charm.py index 9f616fd3a..5c81eacd3 100755 --- a/charm/src/charm.py +++ b/charm/src/charm.py @@ -125,7 +125,7 @@ def gen_extra_env(self) -> dict[str, str]: if self._ingress.url: env["DJANGO_BASE_URL"] = self._ingress.url # This may be problematic, as it could return http instead of https. - # In that case, the config option saml_sp_entity_id should be set. + # In that case, the config option saml-sp-entity-id should be set. if "DJANGO_SAML_SP_ENTITY_ID" not in env: parsed_ingress_url = urllib.parse.urlparse(self._ingress.url) parsed_ingress_url = parsed_ingress_url._replace(path="") diff --git a/charm/tests/integration/conftest.py b/charm/tests/integration/conftest.py index 4c8372ce5..dab1ae788 100644 --- a/charm/tests/integration/conftest.py +++ b/charm/tests/integration/conftest.py @@ -243,9 +243,9 @@ async def netbox_app_fixture( f"./{netbox_charm}", resources=resources, config={ - "django_debug": False, - "django_allowed_hosts": '["*"]', - "aws_endpoint_url": s3_netbox_configuration["endpoint"], + "django-debug": False, + "django-allowed-hosts": '["*"]', + "aws-endpoint-url": s3_netbox_configuration["endpoint"], }, ) # If update_status comes before pebble ready, the unit gets to @@ -317,9 +317,9 @@ async def netbox_saml_integration_fixture( """Integrate Netbox and SAML for saml integration.""" await netbox_app.set_config( { - "saml_sp_entity_id": f"https://{netbox_hostname}", + "saml-sp-entity-id": f"https://{netbox_hostname}", # The saml Name for FriendlyName "uid" - "saml_username": "urn:oid:0.9.2342.19200300.100.1.1", + "saml-username": "urn:oid:0.9.2342.19200300.100.1.1", } ) saml_helper.prepare_pod(model.name, f"{saml_app.name}-0") diff --git a/tox.ini b/tox.ini index b82bdd058..618e404b5 100644 --- a/tox.ini +++ b/tox.ini @@ -49,9 +49,9 @@ description = Check code against coding style standards deps = black codespell - flake8<6.0.0 + flake8 flake8-builtins - flake8-copyright<6.0.0 + flake8-copyright flake8-docstrings>=1.6.0 flake8-docstrings-complete>=1.0.3 flake8-test-docs>=1.0 @@ -60,7 +60,7 @@ deps = pep8-naming pydocstyle>=2.10 pylint - pyproject-flake8<6.0.0 + pyproject-flake8 pytest pytest-asyncio pytest-operator