Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

luci-app-acme: improve UI for inexperienced users #7147

Draft
wants to merge 25 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
4007313
luci-app-acme: dns_wait option
stokito Jun 1, 2024
28ec2b4
luci-app-acme: Move link out of translations
stokito Jun 1, 2024
96495b6
luci-app-acme: introduction: remove LetsEncrypt mention
stokito Jun 1, 2024
b0d2426
luci-app-acme: introduction: clarify that ZeroSSL is by default
stokito Jun 1, 2024
abc07d5
luci-app-acme: acme_server: remove Let's Encrypt from title
stokito Jun 1, 2024
6249c07
luci-app-acme: acme_server: add "See more" link
stokito Jun 1, 2024
7706c6d
luci-app-acme: introduction: add link to OpenWrt Wiki
stokito Jun 1, 2024
76ca13f
luci-app-acme: put validation_method above domains
stokito Jun 1, 2024
99aea87
luci-app-acme: Validate domains
stokito Jun 1, 2024
30f8b1b
luci-app-acme: show button "Install package acme-acmesh-dnsapi" if DN…
stokito Jun 1, 2024
1e8a228
luci-app-acme: Guess the system domain and pre-fill it to domains.
stokito Jun 1, 2024
8e86389
luci-app-acme: Import domains from DDNS
stokito Jun 1, 2024
8ed4768
luci-app-acme: Add Log reader
stokito Jun 1, 2024
30e8b84
luci-app-acme: Set default validation_method to standalone
stokito Jun 2, 2024
86458bb
luci-app-acme: LetsEncrypt is default
stokito Jun 3, 2024
94f551e
luci-app-acme: code style: Use <br />
stokito Jun 3, 2024
dc3c47d
luci-app-acme: ACL for /proc/sys/kernel/hostname
stokito Jun 3, 2024
ef59e3c
luci-app-acme: domains validate
stokito Jun 3, 2024
35f4d1e
luci-app-acme: staging: show the flag only for letsencrypt
stokito Jun 3, 2024
c11d803
luci-app-acme: fix typo
stokito Jun 4, 2024
3ff1564
luci-app-acme: fix _isFqdn() to not allow raw IPv4
stokito Jun 4, 2024
6b4530d
luci-app-acme: remove the ZeroSSL mention
stokito Jun 4, 2024
c5a7289
luci-app-acme: DDNS import: check for duplicates
stokito Jun 4, 2024
faefaf1
luci-app-acme: DDNS import: also create a wildcard domain
stokito Jun 4, 2024
7b3206d
luci-app-acme: wildcards * require Validation method: DNS
stokito Jun 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,15 @@ return view.extend({
return certs;
}),
L.resolveDefault(fs.stat('/usr/lib/acme/client/dnsapi'), null),
fs.lines('/proc/sys/kernel/hostname'),
stokito marked this conversation as resolved.
Show resolved Hide resolved
]);
},

render: function (data) {
let certs = data[0];
let hasDnsApi = data[1] != null;
let hostname = data[2];
let systemDomain = _guessDomain(hostname);
let wikiUrl = 'https://github.com/acmesh-official/acme.sh/wiki/';
var wikiInstructionUrl = wikiUrl + 'dnsapi';
var m, s, o;
Expand Down Expand Up @@ -96,6 +99,9 @@ return view.extend({
"The first name will be the subject name, subsequent names will be alt names. " +
"Note that all domain names must point at the router in the global DNS."));
o.datatype = "list(string)";
if (systemDomain) {
o.default = [systemDomain];
}
o.validate = function (section_id, value) {
if (!/^[*a-z0-9.-]*$/.test(value)) {
stokito marked this conversation as resolved.
Show resolved Hide resolved
return _('Invalid domain');
Expand Down Expand Up @@ -579,6 +585,15 @@ return view.extend({
}
})

function _isFqdn(domain) {
// Is not an IP i.e. starts from alphanumeric and has least one dot
return /[a-z0-9-]\..*$/.test(domain);
stokito marked this conversation as resolved.
Show resolved Hide resolved
}

function _guessDomain(hostname) {
return _isFqdn(hostname) ? hostname : (_isFqdn(window.location.hostname) ? window.location.hostname : '');
}


function _addDnsProviderField(s, provider, env, title, desc) {
let o = s.taboption('challenge_dns', form.Value, '_' + env, _(title),
Expand Down