Software /
code /
prosody
Comparison
prosodyctl @ 8249:cc664a3917e2
prosodyctl: cert import: Use env variable set by certbot if invoked as post-renew hook
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Mon, 18 Sep 2017 18:28:29 +0200 |
parent | 8248:259e0010a6d4 |
child | 8253:3a6f5b0f56f0 |
child | 8265:17ebd8ac8545 |
comparison
equal
deleted
inserted
replaced
8248:259e0010a6d4 | 8249:cc664a3917e2 |
---|---|
869 -- Move hostname arguments out of arg, the rest should be a list of paths | 869 -- Move hostname arguments out of arg, the rest should be a list of paths |
870 while arg[1] and prosody.hosts[ arg[1] ] do | 870 while arg[1] and prosody.hosts[ arg[1] ] do |
871 table.insert(hostnames, table.remove(arg, 1)); | 871 table.insert(hostnames, table.remove(arg, 1)); |
872 end | 872 end |
873 if hostnames[1] == nil then | 873 if hostnames[1] == nil then |
874 for host in pairs(prosody.hosts) do | 874 local domains = os.getenv"RENEWED_DOMAINS"; -- Set if invoked via certbot |
875 if host ~= "*" and config.get(host, "enabled") ~= false then | 875 if domains then |
876 for host in domains:gmatch("%S+") do | |
876 table.insert(hostnames, host); | 877 table.insert(hostnames, host); |
878 end | |
879 else | |
880 for host in pairs(prosody.hosts) do | |
881 if host ~= "*" and config.get(host, "enabled") ~= false then | |
882 table.insert(hostnames, host); | |
883 end | |
877 end | 884 end |
878 end | 885 end |
879 end | 886 end |
880 if not arg[1] or arg[1] == "--help" then -- Probably forgot the path | 887 if not arg[1] or arg[1] == "--help" then -- Probably forgot the path |
881 show_usage("cert import [HOSTNAME+] /path/to/certs [/other/paths/]+", | 888 show_usage("cert import [HOSTNAME+] /path/to/certs [/other/paths/]+", |