Skip to content

Commit

Permalink
Change _ for _ in config options
Browse files Browse the repository at this point in the history
  • Loading branch information
javierdelapuente committed May 20, 2024
1 parent b71b5ce commit 45d5bef
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 22 deletions.
8 changes: 4 additions & 4 deletions charm/charmcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions charm/docs/how-to/configure-saml.md
Original file line number Diff line number Diff line change
Expand Up @@ -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=<your_sp_entity_id_url> saml_username=<saml_attribute_for_uid_and_username>
juju config netbox saml-sp-entity-id=<your_sp_entity_id_url> saml-username=<saml_attribute_for_uid_and_username>
```
4 changes: 2 additions & 2 deletions charm/docs/how-to/configure-scripts-reports.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
4 changes: 2 additions & 2 deletions charm/docs/how-to/contribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion charm/docs/tutorial/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion charm/src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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="")
Expand Down
10 changes: 5 additions & 5 deletions charm/tests/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")
Expand Down
6 changes: 3 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -60,7 +60,7 @@ deps =
pep8-naming
pydocstyle>=2.10
pylint
pyproject-flake8<6.0.0
pyproject-flake8
pytest
pytest-asyncio
pytest-operator
Expand Down

0 comments on commit 45d5bef

Please sign in to comment.