return certs;
}),
L.resolveDefault(fs.exec_direct('/usr/libexec/acmesh-dnsinfo.sh'), ''),
+ L.resolveDefault(fs.stat('/usr/lib/acme/client/dnsapi'), null),
]);
},
let certs = data[0];
let dnsApiInfoText = data[1];
let apiInfos = dnsapi.parseFile(dnsApiInfoText);
-
+ let hasDnsApi = data[2] != null;
let wikiUrl = 'https://github.com/acmesh-official/acme.sh/wiki/';
let wikiInstructionUrl = wikiUrl + 'dnsapi';
let m, s, o;
o.value('dns', _('DNS'));
o.default = 'standalone';
+ if (!hasDnsApi) {
+ let dnsApiPkg = 'acme-acmesh-dnsapi';
+ o = s.taboption('general', form.Button, '_install');
+ o.depends('validation_method', 'dns');
+ o.title = _('Package is not installed');
+ o.inputtitle = _('Install package %s').format(dnsApiPkg);
+ o.inputstyle = 'apply';
+ o.onclick = function () {
+ let link = L.url('admin/system/package-manager') + '?query=' + dnsApiPkg;
+ window.open(link, '_blank', 'noopener');
+ };
+ }
+
o = s.taboption('general', form.DynamicList, "domains", _("Domain names"),
_("Domain names to include in the certificate. " +
"The first name will be the subject name, subsequent names will be alt names. " +