Browse Source

Mark as Mirror

github
AJ ONeal 4 years ago
parent
commit
006e15ac53
  1. 25
      README.md

25
README.md

@ -1,3 +1,10 @@
# Mirror of git.rootprojects.org/root/greenlock.js
Github does not expose the ability to automatically update mirrors,
so this may lag behind the official repository which is found at:
- <https://git.rootprojects.org/root/greenlock.js>
# New Documentation &amp; [v4 Migration Guide](https://git.rootprojects.org/root/greenlock.js/src/branch/master/MIGRATION_GUIDE.md) # New Documentation &amp; [v4 Migration Guide](https://git.rootprojects.org/root/greenlock.js/src/branch/master/MIGRATION_GUIDE.md)
We're still working on the full documentation for this new version, We're still working on the full documentation for this new version,
@ -87,7 +94,7 @@ var greenlock = Greenlock.create({
packageAgent: pkg.name + '/' + pkg.version, packageAgent: pkg.name + '/' + pkg.version,
maintainerEmail: pkg.author, maintainerEmail: pkg.author,
staging: true, staging: true,
notify: function(event, details) { notify: function (event, details) {
if ('error' === event) { if ('error' === event) {
// `details` is an error object in this case // `details` is an error object in this case
console.error(details); console.error(details);
@ -100,7 +107,7 @@ greenlock.manager
agreeToTerms: true, agreeToTerms: true,
subscriberEmail: 'webhosting@example.com' subscriberEmail: 'webhosting@example.com'
}) })
.then(function(fullConfig) { .then(function (fullConfig) {
// ... // ...
}); });
``` ```
@ -122,7 +129,7 @@ greenlock
subject: altnames[0], subject: altnames[0],
altnames: altnames altnames: altnames
}) })
.then(function() { .then(function () {
// saved config to db (or file system) // saved config to db (or file system)
}); });
``` ```
@ -145,13 +152,13 @@ or wait for the renewal to complete (or for it to fail again).
```js ```js
greenlock greenlock
.get({ servername: subject }) .get({ servername: subject })
.then(function(pems) { .then(function (pems) {
if (pems && pems.privkey && pems.cert && pems.chain) { if (pems && pems.privkey && pems.cert && pems.chain) {
console.info('Success'); console.info('Success');
} }
//console.log(pems); //console.log(pems);
}) })
.catch(function(e) { .catch(function (e) {
console.error('Big bad error:', e.code); console.error('Big bad error:', e.code);
console.error(e); console.error(e);
}); });
@ -300,7 +307,7 @@ of certificate requests.
- [Store Callback Documentation](https://git.rootprojects.org/root/greenlock-store-test.js) - [Store Callback Documentation](https://git.rootprojects.org/root/greenlock-store-test.js)
```js ```js
return greenlock.get({ servername }).then(function(site) { return greenlock.get({ servername }).then(function (site) {
if (!site) { if (!site) {
console.log(servername + ' was not found in any site config'); console.log(servername + ' was not found in any site config');
return; return;
@ -331,8 +338,8 @@ You are not required to call it. If you implement the `store` callbacks, the cer
will automatically be saved (and if you don't implement them, they all get saved to disk). will automatically be saved (and if you don't implement them, they all get saved to disk).
```js ```js
return greenlock.renew({}).then(function(results) { return greenlock.renew({}).then(function (results) {
results.forEach(function(site) { results.forEach(function (site) {
if (site.error) { if (site.error) {
console.error(site.subject, site.error); console.error(site.subject, site.error);
return; return;
@ -368,7 +375,7 @@ If you are implementing your own `manager` callbacks, I recommend that you mark
```js ```js
gl.remove({ gl.remove({
subject: 'example.com' subject: 'example.com'
}).then(function(siteConfig) { }).then(function (siteConfig) {
// save the old site config elsewhere, just in case you need it again // save the old site config elsewhere, just in case you need it again
}); });
``` ```

Loading…
Cancel
Save