New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement the --cert-name flag to select a lineage by its name. #3785
Changes from all commits
ce9305f
995eae8
c6853e1
52206a9
c23d31c
22642bc
5426721
ebbeaf5
60bb060
e395f7a
da6a477
a63004a
da05230
709a8c6
fec660a
4374876
78d9cf8
4675186
2c87cbb
33c2a23
e6e3261
2bfddcb
4562d78
f56a11d
ab01927
41aecf5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,6 +68,7 @@ | |
rollback Rollback server configuration changes made during install | ||
config_changes Show changes made to server config during installation | ||
update_symlinks Update cert symlinks based on renewal config file | ||
rename Update a certificate's name | ||
plugins Display information about installed plugins | ||
certificates Display information about certs configured with Certbot | ||
|
||
|
@@ -326,7 +327,7 @@ def __init__(self, args, plugins, detect_defaults=False): | |
"register": main.register, "renew": main.renew, | ||
"revoke": main.revoke, "rollback": main.rollback, | ||
"everything": main.run, "update_symlinks": main.update_symlinks, | ||
"certificates": main.certificates} | ||
"certificates": main.certificates, "rename": main.rename} | ||
|
||
# List of topics for which additional help can be provided | ||
HELP_TOPICS = ["all", "security", "paths", "automation", "testing"] + list(self.VERBS) | ||
|
@@ -686,6 +687,19 @@ def prepare_and_parse_args(plugins, args, detect_defaults=False): # pylint: dis | |
help="Domain names to apply. For multiple domains you can use " | ||
"multiple -d flags or enter a comma separated list of domains " | ||
"as a parameter.") | ||
helpful.add( | ||
[None, "run", "certonly"], | ||
"--cert-name", dest="certname", | ||
metavar="CERTNAME", default=None, | ||
help="Certificate name to apply. Only one certificate name can be used " | ||
"per Certbot run. To see certificate names, run 'certbot certificates'." | ||
"If there is no existing certificate with this name and " | ||
"domains are requested, create a new certificate with this name.") | ||
helpful.add( | ||
"rename", | ||
"--updated-cert-name", dest="new_certname", | ||
metavar="NEW_CERTNAME", default=None, | ||
help="New name for the certificate. Must be a valid filename.") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it valid to use only There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh good point. Maybe |
||
helpful.add( | ||
[None, "testing", "renew", "certonly"], | ||
"--dry-run", action="store_true", dest="dry_run", | ||
|
@@ -738,6 +752,12 @@ def prepare_and_parse_args(plugins, args, detect_defaults=False): # pylint: dis | |
"regardless of whether it is near expiry. (Often " | ||
"--keep-until-expiring is more appropriate). Also implies " | ||
"--expand.") | ||
helpful.add( | ||
"automation", "--renew-with-new-domains", | ||
action="store_true", dest="renew_with_new_domains", help="If a " | ||
"certificate already exists for the requested certificate name " | ||
"but does not match the requested domains, renew it now, " | ||
"regardless of whether it is near expiry.") | ||
helpful.add( | ||
["automation", "renew", "certonly"], | ||
"--allow-subset-of-names", action="store_true", | ||
|
@@ -1015,7 +1035,6 @@ def __call__(self, parser, namespace, domain, option_string=None): | |
"""Just wrap add_domains in argparseese.""" | ||
add_domains(namespace, domain) | ||
|
||
|
||
def add_domains(args_or_config, domains): | ||
"""Registers new domains to be used during the current client run. | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was originally wondering about the case where there's more than one matching lineage and whether we'd simply get
func()
of the last one, but now I see that since the intermediaterv
is an argument tofunc
, someone writing afunc
could also choose to have it accumulate values as it goes, like in a list, if they want information about multiple lineages. So, nice, flexible design there.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Flexibility is my goal! I'll put this in the docstring to make it clear.