Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
plietar committed Dec 9, 2024
1 parent c402371 commit 7c5f8cd
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
4 changes: 1 addition & 3 deletions src/montagu_deploy/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ def main(argv=None):
elif args.action == "stop":
montagu_stop(obj, args, cfg)
elif args.action == "renew-certificate":
montagu_renew_certificate(obj, cfg,
force_renewal=args.force_renewal,
expand=args.expand)
montagu_renew_certificate(obj, cfg, force_renewal=args.force_renewal, expand=args.expand)
return True


Expand Down
4 changes: 3 additions & 1 deletion src/montagu_deploy/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ def __init__(self, path, extra=None, options=None):
self.acme_email = config.config_string(dat, ["proxy", "acme", "email"])
self.acme_server = config.config_string(dat, ["proxy", "acme", "server"], is_optional=True)
self.acme_no_verify_ssl = config.config_boolean(dat, ["proxy", "acme", "no_verify_ssl"], is_optional=True)
self.acme_additional_domains = config.config_list(dat, ["proxy", "acme", "additional_domains"], is_optional=True, default=[])
self.acme_additional_domains = config.config_list(
dat, ["proxy", "acme", "additional_domains"], is_optional=True, default=[]
)
else:
self.ssl_mode = "self-signed"

Expand Down
8 changes: 4 additions & 4 deletions tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def test_acme_certificate():

try:
options = [
f"--option=proxy.acme.server=https://pebble/dir",
"--option=proxy.acme.server=https://pebble/dir",
"--option=proxy.acme.no_verify_ssl=true",
]

Expand All @@ -134,7 +134,7 @@ def test_acme_certificate():
# We set this up by adding a custom /etc/hosts in the pebble container pointing to the
# right IP address.
container = docker.from_env().containers.get("montagu-proxy")
ip = container.attrs['NetworkSettings']['Networks'][network]['IPAddress']
ip = container.attrs["NetworkSettings"]["Networks"][network]["IPAddress"]
hostnames = {
"montagu.org": ip,
"montagu-dev.org": ip,
Expand Down Expand Up @@ -167,8 +167,8 @@ def test_acme_certificate():
assert "CN=Pebble Intermediate CA" in cert.issuer.rfc4514_string()
san = cert.extensions.get_extension_for_oid(ExtensionOID.SUBJECT_ALTERNATIVE_NAME)
assert set(san.value.get_values_for_type(x509.DNSName)) == {
'montagu.org',
'montagu-dev.org',
"montagu.org",
"montagu-dev.org",
}

# When restarting the server, the certificate we got from ACME is
Expand Down
4 changes: 1 addition & 3 deletions tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@ def run_pebble(**kwargs):
}

with create_container(
"ghcr.io/letsencrypt/pebble:latest", command=["-config", "/config.json"],
environment=env,
**kwargs
"ghcr.io/letsencrypt/pebble:latest", command=["-config", "/config.json"], environment=env, **kwargs
) as container:
docker_util.string_into_container(json.dumps(config), container, "/config.json")
container.start()
Expand Down

0 comments on commit 7c5f8cd

Please sign in to comment.