From 60b082788fe8e52e69648c4f5cb6bf159bb173eb Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Fri, 4 May 2018 23:59:05 +0000 Subject: [PATCH] save contact --- js/app.js | 25 +++++++++++++++++++++++++ legal.html | 3 +++ 2 files changed, 28 insertions(+) create mode 100644 legal.html diff --git a/js/app.js b/js/app.js index d82702a..41b3561 100644 --- a/js/app.js +++ b/js/app.js @@ -58,6 +58,29 @@ $el.addEventListener('change', updateChallengeType); }); + function saveContact(email, domains) { + // to be used for good, not evil + return window.fetch('https://api.ppl.family/api/ppl.family/public/list', { + method: 'POST' + , cors: true + , headers: new Headers({ 'Content-Type': 'application/json' }) + , body: JSON.stringify({ address: email, comment: 'greenlock sub for ' + domains.join(',') }) + }).then(function (resp) { + return resp.json().then(function (data) { + /* + if (data.error) { + window.alert("Couldn't save your contact. Email coolaj86@gmail.com instead."); + return; + } + */ + }); + }, function () { + /* + window.alert("Didn't get your contact. Bad network connection? Email coolaj86@gmail.com instead."); + */ + }); + } + steps[1] = function () { hideForms(); $qs('.js-acme-form-domains').hidden = false; @@ -90,6 +113,7 @@ steps[2].submit = function () { var email = $qs('.js-acme-account-email').value.toLowerCase().trim(); + info.contact = [ 'mailto:' + email ]; info.agree = $qs('.js-acme-account-tos').checked; info.greenlockAgree = $qs('.js-gl-tos').checked; @@ -99,6 +123,7 @@ // * ECDSA / RSA / bitlength // TODO ping with version and account creation + setTimeout(saveContact, 100, email, info.identifiers.map(function (ident) { return ident.value; })); var jwk = JSON.parse(localStorage.getItem('account:' + email) || 'null'); var p; diff --git a/legal.html b/legal.html new file mode 100644 index 0000000..08e7a35 --- /dev/null +++ b/legal.html @@ -0,0 +1,3 @@ +You will use the Greenlock™ service, code, libraries, documentation, etc (provided by ppl) for good, not evil (i.e. securing sites, not terrorizing underprivileged peoples or overpriviledged nations). + +We will use your contact You will use the Greenlock™ service, code, libraries, documentation, etc for good, not evil (i.e. notifying as we improve the service or need to disclose important information, not spam or selling your data to the devil and his minions for filthy lucre).