mirror of
https://github.com/certbot/certbot.git
synced 2026-08-03 00:22:04 +02:00
Merge branch 'renew_verb' of ssh://github.com/letsencrypt/letsencrypt into renew_verb
This commit is contained in:
+15
-3
@@ -394,7 +394,7 @@ def _report_new_cert(cert_path, fullchain_path):
|
|||||||
|
|
||||||
def _suggest_donation_if_appropriate(config):
|
def _suggest_donation_if_appropriate(config):
|
||||||
"""Potentially suggest a donation to support Let's Encrypt."""
|
"""Potentially suggest a donation to support Let's Encrypt."""
|
||||||
if not config.staging: # --dry-run implies --staging
|
if not config.staging and not config.verb == "renew": # --dry-run implies --staging
|
||||||
reporter_util = zope.component.getUtility(interfaces.IReporter)
|
reporter_util = zope.component.getUtility(interfaces.IReporter)
|
||||||
msg = ("If you like Let's Encrypt, please consider supporting our work by:\n\n"
|
msg = ("If you like Let's Encrypt, please consider supporting our work by:\n\n"
|
||||||
"Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate\n"
|
"Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate\n"
|
||||||
@@ -716,6 +716,14 @@ def install(config, plugins):
|
|||||||
def renew(cli_config, plugins):
|
def renew(cli_config, plugins):
|
||||||
"""Renew previously-obtained certificates."""
|
"""Renew previously-obtained certificates."""
|
||||||
cli_config = configuration.RenewerConfiguration(cli_config)
|
cli_config = configuration.RenewerConfiguration(cli_config)
|
||||||
|
if cli_config.domains != []:
|
||||||
|
raise errors.Error("Currently, the renew verb is only capable of "
|
||||||
|
"renewing all installed certificates that are due "
|
||||||
|
"to be renewed; individual domains cannot be "
|
||||||
|
"specified with this action. If you would like to "
|
||||||
|
"renew specific certificates, use the certonly "
|
||||||
|
"command. The renew verb may provide other options "
|
||||||
|
"for selecting certificates to renew in the future.")
|
||||||
configs_dir = cli_config.renewal_configs_dir
|
configs_dir = cli_config.renewal_configs_dir
|
||||||
for renewal_file in reversed(os.listdir(configs_dir)):
|
for renewal_file in reversed(os.listdir(configs_dir)):
|
||||||
if not renewal_file.endswith(".conf"):
|
if not renewal_file.endswith(".conf"):
|
||||||
@@ -724,6 +732,7 @@ def renew(cli_config, plugins):
|
|||||||
# XXX: does this succeed in making a fully independent config object
|
# XXX: does this succeed in making a fully independent config object
|
||||||
# each time?
|
# each time?
|
||||||
config = configuration.RenewerConfiguration(copy.deepcopy(cli_config))
|
config = configuration.RenewerConfiguration(copy.deepcopy(cli_config))
|
||||||
|
config.noninteractive_mode = True
|
||||||
full_path = os.path.join(configs_dir, renewal_file)
|
full_path = os.path.join(configs_dir, renewal_file)
|
||||||
try:
|
try:
|
||||||
renewal_candidate = storage.RenewableCert(full_path, config)
|
renewal_candidate = storage.RenewableCert(full_path, config)
|
||||||
@@ -742,7 +751,10 @@ def renew(cli_config, plugins):
|
|||||||
"an authenticator. Skipping.", full_path)
|
"an authenticator. Skipping.", full_path)
|
||||||
continue
|
continue
|
||||||
# ?? config = configuration.NamespaceConfig(_AttrDict(renewalparams))
|
# ?? config = configuration.NamespaceConfig(_AttrDict(renewalparams))
|
||||||
# XXX: also need: webroot_map
|
if "webroot_map" in renewalparams:
|
||||||
|
config.__setattr__("webroot_map", renewalparams["webroot_map"])
|
||||||
|
print ("webroot_map", renewalparams["webroot_map"])
|
||||||
|
raw_input()
|
||||||
# XXX: also need: nginx_, apache_, and plesk_ items
|
# XXX: also need: nginx_, apache_, and plesk_ items
|
||||||
# string-valued items to add if they're present
|
# string-valued items to add if they're present
|
||||||
for config_item in ["config_dir", "log_dir", "work_dir", "user_agent",
|
for config_item in ["config_dir", "log_dir", "work_dir", "user_agent",
|
||||||
@@ -798,7 +810,7 @@ def renew(cli_config, plugins):
|
|||||||
config.__setattr__("domains", domains)
|
config.__setattr__("domains", domains)
|
||||||
|
|
||||||
print("Trying...")
|
print("Trying...")
|
||||||
print(obtain_cert(config, config, plugins, renewal_candidate))
|
print(obtain_cert(config, plugins, renewal_candidate))
|
||||||
|
|
||||||
|
|
||||||
def revoke(config, unused_plugins): # TODO: coop with renewal config
|
def revoke(config, unused_plugins): # TODO: coop with renewal config
|
||||||
|
|||||||
@@ -37,7 +37,9 @@ STAGING_URI = "https://acme-staging.api.letsencrypt.org/directory"
|
|||||||
RENEWER_DEFAULTS = dict(
|
RENEWER_DEFAULTS = dict(
|
||||||
renewer_enabled="yes",
|
renewer_enabled="yes",
|
||||||
renew_before_expiry="30 days",
|
renew_before_expiry="30 days",
|
||||||
deploy_before_expiry="20 days",
|
# This value should ensure that there is never a deployment delay by
|
||||||
|
# default.
|
||||||
|
deploy_before_expiry="99 years",
|
||||||
)
|
)
|
||||||
"""Defaults for renewer script."""
|
"""Defaults for renewer script."""
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user