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/]+", |