Skip to content

Commit

Permalink
fix breaking arg parsing when plugin not in use
Browse files Browse the repository at this point in the history
  • Loading branch information
TheEnbyperor committed Jul 12, 2023
1 parent cc352ee commit 9986f6b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "certbot-onion"
version = "0.1.5"
version = "0.1.6"
description = "Certbot authenticator plugin for the onion-csr-01 challenge"
authors = [
{name = "Q Misell", email = "[email protected]"}
Expand Down
6 changes: 4 additions & 2 deletions src/certbot_onion/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,12 @@ def __init__(self, *args, **kwargs):

@classmethod
def add_parser_arguments(cls, add: typing.Callable[..., None]) -> None:
add("hs-dir", help="Path to a Tor hidden service directory", nargs="+", required=True)
add("hs-dir", help="Path to a Tor hidden service directory", nargs="+", required=False)

def prepare(self) -> None:
for hs_dir in self.conf("hs-dir"):
hs_dirs = self.conf("hs-dir")
hs_dirs = hs_dirs if hs_dirs is not None else []
for hs_dir in hs_dirs:
if not os.path.isdir(hs_dir):
raise certbot.errors.PluginError(f"Hidden service directory path {hs_dir} is not a directory")

Expand Down

0 comments on commit 9986f6b

Please sign in to comment.