示例#1
0
def run(args):
    domains = map(lambda domain: '-d ' + domain, args.domains)
    domains = ' '.join(domains)

    Logger.info('obtain domains: ' + domains)

    deploy_hook = '--deploy-hook "python ' + deploy_path + '"' if Utils.is_enable_deployment(
    ) else ''
    cert_name = '--cert-name ' + args.cert if args.cert else ''
    force_renewal = '--force-renewal' if args.force else ''
    challenge_alias = '--challenge-alias ' + args.alias if args.alias else ''

    certbot_cmd = certbot_cmd_template % {
        'email': Config['base']['email'],
        'cert_name': cert_name,
        'force_renewal': force_renewal,
        'manual_path': manual_path,
        'dns': args.dns,
        'deploy_hook': deploy_hook,
        'domains': domains,
        'challenge_alias': challenge_alias
    }

    Logger.info('certbot obtain: ' + certbot_cmd)

    os.system(certbot_cmd)
示例#2
0
def run(args):
    cert_names = map(lambda domain: '--cert-name ' + domain, args.certs)
    cert_names = ' '.join(cert_names)

    Logger.info('obtain cert_names: ' + cert_names)

    force_renewal = '--force-renewal' if args.force else ''

    deploy_hook = '--deploy-hook "python ' + deploy_path + '"' if Utils.is_enable_deployment(
    ) else ''

    certbot_cmd = certbot_cmd_template % {
        'deploy_hook': deploy_hook,
        'cert_names': cert_names,
        'force_renewal': force_renewal
    }

    Logger.info('certbot renew: ' + certbot_cmd)

    os.system(certbot_cmd)