{"_id":"@delyva/greenlock-express","_rev":"1-96ef7727416095d2b596d945ec29766b","name":"@delyva/greenlock-express","dist-tags":{"latest":"4.0.40"},"versions":{"4.0.4":{"name":"@delyva/greenlock-express","version":"4.0.4","description":"Free SSL and managed or automatic HTTPS for node.js with Express, Koa, Connect, Hapi, and all other middleware systems.","main":"greenlock-express.js","homepage":"https://greenlock.domains","scripts":{"start":"node_todo server.js ./config.js","test":"node_todo test/greenlock.js"},"directories":{"example":"examples","lib":"lib","test":"test"},"dependencies":{"@root/greenlock":"^4.0.5","redirect-https":"^1.3.1"},"trulyOptionalDependencies":{"http-proxy":"^1.17.0","express":"^4.16.3","express-basic-auth":"^1.2.0","finalhandler":"^1.1.1","serve-index":"^1.9.1","serve-static":"^1.13.2","ws":"^5.2.1"},"devDependencies":{},"repository":{"type":"git","url":"https://git.rootprojects.org/root/greenlock-express.js.git"},"keywords":["Let's Encrypt","ACME","greenlock","Free SSL","Automated HTTPS","https","tls"],"author":{"name":"AJ ONeal","email":"coolaj86@gmail.com","url":"https://solderjs.com/"},"license":"MPL-2.0","bugs":{"url":"https://git.rootprojects.org/root/greenlock-express.js/issues"},"gitHead":"480352835a1617e5eb9011ee6eb1efe26aa6de97","_id":"@delyva/greenlock-express@4.0.4","_nodeVersion":"18.1.0","_npmVersion":"8.17.0","dist":{"integrity":"sha512-0QpeKNSeimyFo6sq7Uf9EXULPV8ReLeIovcqW6pJGIcjFB5D+uqkc1WSj7Zr2kOQHyZMGbdUwNZzTU/Kpz7BPA==","shasum":"75894b39a97720dcd95a0103ab03622107b39989","tarball":"https://registry.npmjs.org/@delyva/greenlock-express/-/greenlock-express-4.0.4.tgz","fileCount":17,"unpackedSize":80684,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGmQ7+B7XeL0Boo4CaLwiB6r/zdzJg4d4ESiwf9NYtPOAiEA1G5thqZ3qFBLRxHpAObwBHolZUqEe9PriAmlHkGswgA="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjFgn6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqV7A//YmniVcWk0UUIfhE0aYkrTLJsMs9qOBv2ozhW0dGoZ+roDLWW\r\nGoXgL+VNVRb2IhGYIsQfyvm1YJj6DkvdQDxQFaT/UUo0smaZR094PZR+lVUv\r\ny2lmG0QMSpLBkz0+gsKU+ejVEDueW1mPkjvwIN78GWOxmbAW/smQz3Ep0QUU\r\n8DybKayeYnSBjnw1oO5luj1CQ9NsacMLnqSOoNNGePDj4iymWt/n2ST7wAQe\r\nhaMtr9urfo+KZ2nE6uf5RtvP1qDquJYmaiyqksNWJKl49/Kw0AJp2dJI3AYt\r\nDiVAUhRp1GfyLCOFhdtYc1GT/l2sN/Q6lXX05TkSbpLqVVpiSQpJDkQExhel\r\ntIKadUuvDI95IWxlLdvXx4tGMOhOy5Vu9MZsvT+n9iHVxcoYWLB5ylyleAMP\r\nXy7s6EFYBvLtMIoSrLQJav/uYNaCOu9iDyv2jP1EPckRR03GOHbamiCA+POF\r\nRMjRNhI5iDlIBd/bxhyeUcAo1bX9B5O/CVNKWEF49EdYdlDF9FHbQUt4H8AB\r\nT0Xd8/cm2WFJFVE5YnJupc/sG9WARBjfF1Co2AxI+pCd+UD077+d5XvKmzvB\r\nXeV/JWuLrbDl5HGdoWmWL6qM5sgzc5Q1lgwrfHOpZm8uj5iaG/a4L1DCjUed\r\nr2U6sWoxUm+Z7vKjNMNCeK98j/jLshY2OXE=\r\n=lL49\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"delyva","email":"dev@delyva.com"},"maintainers":[{"name":"delyva","email":"dev@delyva.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/greenlock-express_4.0.4_1662388730373_0.02814106845587583"},"_hasShrinkwrap":false},"4.0.40":{"name":"@delyva/greenlock-express","version":"4.0.40","description":"Free SSL and managed or automatic HTTPS for node.js with Express, Koa, Connect, Hapi, and all other middleware systems.","main":"greenlock-express.js","homepage":"https://greenlock.domains","scripts":{"start":"node_todo server.js ./config.js","test":"node_todo test/greenlock.js"},"directories":{"example":"examples","lib":"lib","test":"test"},"dependencies":{"@root/greenlock":"^4.0.5","redirect-https":"^1.3.1"},"trulyOptionalDependencies":{"http-proxy":"^1.17.0","express":"^4.16.3","express-basic-auth":"^1.2.0","finalhandler":"^1.1.1","serve-index":"^1.9.1","serve-static":"^1.13.2","ws":"^5.2.1"},"devDependencies":{},"repository":{"type":"git","url":"https://git.rootprojects.org/root/greenlock-express.js.git"},"keywords":["Let's Encrypt","ACME","greenlock","Free SSL","Automated HTTPS","https","tls"],"author":{"name":"AJ ONeal","email":"coolaj86@gmail.com","url":"https://solderjs.com/"},"license":"MPL-2.0","bugs":{"url":"https://git.rootprojects.org/root/greenlock-express.js/issues"},"gitHead":"480352835a1617e5eb9011ee6eb1efe26aa6de97","_id":"@delyva/greenlock-express@4.0.40","_nodeVersion":"18.1.0","_npmVersion":"8.17.0","dist":{"integrity":"sha512-r2nCZNEF/h8SEuLEsQOaexbcdqaTXI74JBZCVzQ6uSzfCkUAdsii78/IHBP4AS6t7HS8/bjexRaHqIXOZY4CJg==","shasum":"b59c464850f6462fab45857053388f940efcdd76","tarball":"https://registry.npmjs.org/@delyva/greenlock-express/-/greenlock-express-4.0.40.tgz","fileCount":17,"unpackedSize":80735,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB2tB2meG5blEooBwmk1+k5ZDdvzi2tmR6AYM+jnndk7AiEAkDtEKZ3ley6GhrF4HCTerr/2sbpecm3ACiA3zb0XE6g="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjFsclACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqDOQ//UJSIz+E5Tn6B6FXXufYk2fI0gvK9gypBwaM84/V6PTLbKLjz\r\nPt5sXW0YaH/1IWP7SfDS5TyVQvyxpkc0fUz1qWSUWCVfX4gl+/Z2PC83YUTN\r\nHabVJ3YUfz4azpN7r+1sVTavliJwYhmkjvccOkuw7BtUHNJfP6UlU5zFPTy+\r\nkaI4DX1/wDvLdihwHjHHyv2fC+DmiiUHatlqD+v4qBMlou7IvXDdYFCX75xL\r\nD9C2TNO8TSFWzVEekRes1qEelwsz5s9rEtA7E7n2cBimdjAdC4FRVYOrKiSK\r\nwC50qQ5X9L5p6ls2kC9T7OQpbRdZuQuyK4Lna0K40xpyFErFH4FopAxZrIo/\r\nAL7sf0WhgLvpp1dDcNWH3EPe8lLtPGpJqKDUequ2pzLvnfnx38nenRh62wy3\r\njwme3Pb6HGWoM/oQH9ZkBNXe0/+udaTnoOvtbqyd6ZzVX1cCcGVlMiQxUqHd\r\nWGrJmM5qYELD4yxoWucbeD9GHFSZxeI4o+j7Wy6fSpPSyXn4Qk7d9llEwBaK\r\ndIMvltFay5Pv6ZEyDhAd4PlnmoLF+CWOSvj1gmZEzdREXThddPgVZa6nvr9B\r\nCD7Kf1xiUoXodsQ9Ww0VyKP4fYc7x0UNmbfCgrUHfVJsdGXhwpvcERe3BTxq\r\nD6y6qVkJe0y/tLYXHpQJPevPFbcKlW+SPdg=\r\n=dehH\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"delyva","email":"dev@delyva.com"},"maintainers":[{"name":"delyva","email":"dev@delyva.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/greenlock-express_4.0.40_1662437157216_0.9743500495946857"},"_hasShrinkwrap":false}},"time":{"created":"2022-09-05T14:38:50.182Z","4.0.4":"2022-09-05T14:38:50.583Z","modified":"2022-09-06T04:05:57.459Z","4.0.40":"2022-09-06T04:05:57.392Z"},"maintainers":[{"name":"delyva","email":"dev@delyva.com"}],"description":"Free SSL and managed or automatic HTTPS for node.js with Express, Koa, Connect, Hapi, and all other middleware systems.","homepage":"https://greenlock.domains","keywords":["Let's Encrypt","ACME","greenlock","Free SSL","Automated HTTPS","https","tls"],"repository":{"type":"git","url":"https://git.rootprojects.org/root/greenlock-express.js.git"},"author":{"name":"AJ ONeal","email":"coolaj86@gmail.com","url":"https://solderjs.com/"},"bugs":{"url":"https://git.rootprojects.org/root/greenlock-express.js/issues"},"license":"MPL-2.0","readme":"# [Greenlock Express v4](https://git.rootprojects.org/root/greenlock-express.js) is Let's Encrypt for Node\n\n| Built by [Root](https://therootcompany.com) for [Hub](https://rootprojects.org/hub/) |\n\n![Greenlock Logo](https://git.rootprojects.org/root/greenlock.js/raw/branch/master/logo/greenlock-1063x250.png \"Greenlock Logo\")\n\n### Free SSL for Node Web Servers\n\nGreenlock Express is a **Web Server** with **Fully Automated HTTPS** and renewals.\n\nYou define your app and let Greenlock handle issuing and renewing Free SSL Certificates.\n\n```bash\nnpm init\nnpm install --save greenlock-express@v4\n```\n\n`server.js`:\n\n```js\n\"use strict\";\n\nvar app = require(\"./app.js\");\n\nrequire(\"greenlock-express\")\n    .init({\n        packageRoot: __dirname,\n        configDir: \"./greenlock.d\",\n\n        // contact for security and critical bug notices\n        maintainerEmail: \"jon@example.com\",\n\n        // whether or not to run at cloudscale\n        cluster: false\n    })\n    // Serves on 80 and 443\n    // Get's SSL certificates magically!\n    .serve(app);\n```\n\n`./greenlock.d/config.json`:\n\n```json\n{ \"sites\": [{ \"subject\": \"example.com\", \"altnames\": [\"example.com\"] }] }\n```\n\n# Let's Encrypt for...\n\n-   IoT\n-   Enterprise On-Prem\n-   Local Development\n-   Home Servers\n-   Quitting Heroku\n\n# Features\n\n-   [x] Let's Encrypt v2 (November 2019)\n    -   [x] ACME Protocol (RFC 8555)\n    -   [x] HTTP Validation (HTTP-01)\n    -   [x] DNS Validation (DNS-01)\n    -   [ ] ALPN Validation (TLS-ALPN-01)\n        -   Need ALPN validation? [contact us](mailto:greenlock-support@therootcompany.com)\n-   [x] Automated HTTPS\n    -   [x] Fully Automatic Renewals every 45 days\n    -   [x] Free SSL\n    -   [x] **Wildcard** SSL\n    -   [x] **Localhost** certificates\n    -   [x] HTTPS-enabled Secure **WebSockets** (`wss://`)\n    -   [x] **Cloud-ready** with Node `cluster`.\n-   [x] Fully customizable\n    -   [x] **Reasonable defaults**\n    -   [x] Domain Management\n    -   [x] Key and Certificate Management\n    -   [x] ACME Challenge Plugins\n\n# Compatibility\n\nWorks with _any_ node http app, including\n\n-   [x] Express\n-   [x] Koa\n-   [x] hapi\n-   [x] rill\n-   [x] http2\n-   [x] cluster\n-   [x] etc...\n\n# v4 QuickStart\n\nServing sites with Free SSL is as easy as 1, 2, 3... 4\n\n## Overview\n\n1. Create a Project with Greenlock Express\n    - `server.js`\n    - `app.js`\n2. Setup the config file (or database)\n    - `.greenlockrc`\n    - `greenlock.d/config.json`\n3. Add Domains\n    - `npx greenlock add --subject example.com --altnames example.com`\n4. Hello, World!\n    - `npm start -- --staging`\n\n### TL;DR\n\nIf you're familiar with node, npm, and npx: this is all you need to do:\n\n```bash\nnpm init\nnpm install --save greenlock-express@v4\n\nnpx greenlock init --config-dir greenlock.d --maintainer-email jon@example.com\nnpx greenlock add --subject example.com --altnames example.com\n\nnpm start -- --staging\n```\n\nOnce you've tested that that works, you can change `app.js` to suit your needs replace the built-in callbacks for things like certificate storage as you like.\n\n## 1. Create your Project\n\nIf you need to install Node.js, do so:\n\nMac, Linux:\n\n```bash\ncurl -fsS https://webinstall.dev/node | bash\n```\n\nWindows 10:\n\n```pwsh\ncurl -fsSA \"MS\" https://webinstall.dev/node | powershell\n```\n\nThen create a directory for your project, and initialize it:\n\n```bash\nmkdir -p my-sites\npushd my-sites\nnpm init\nnpm install --save greenlock-express@v4\n```\n\n## 2. Initialize and Config (Dir or DB)\n\nYou can use **local file storage** or a **database**. The default is to use file storage.\n\nYou'll need to create `server.js` and `greenlock.d/config.json`. You can do so using the CLI, API, or by hand.\n\n### Using the CLI (simplest, recommended)\n\nAnytime you install an npm module that contains an executable,\nyou can run it using `npx`.\n\nTo initialize the Greenlock config, run `npx greenlock init`:\n\n```bash\nnpx greenlock init --config-dir ./greenlock.d --maintainer-email 'jon@example.com'\n```\n\n### By Hand (for advanced users)\n\nCreate `server.js` like so:\n\n`server.js`:\n\n```js\n'use strict';\n\nvar app = require('./app.js');\n\nrequire('greenlock-express')\n    .init({\n        packageRoot: __dirname,\n\n        // where to look for configuration\n        configDir: './greenlock.d',\n\n        // whether or not to run at cloudscale\n        cluster: false\n    })\n    // Serves on 80 and 443\n    // Get's SSL certificates magically!\n    .serve(app);\n```\n\nCreate `app.js` like so:\n\n`app.js`:\n\n```js\n'use strict';\n\n// Here's a vanilla HTTP app to start,\n// but feel free to replace it with Express, Koa, etc\nvar app = function(req, res) {\n    res.end('Hello, Encrypted World!');\n};\n\nmodule.exports = app;\n```\n\nGreenlock uses `.greenlockrc` to figure out whether to use the file system or a database for config,\nas well as where its root directory is.\n\n`.greenlockrc`\n\n```json\n{\"manager\":{\"module\":\"@greenlock/manager\"},\"configDir\":\"greenlock.d\"}\n```\n\nThe `greenlock.d/config.json` is NOT intended to be edited by hand, as it is a substitute for a database, but it looks like this:\n\n```json\n{ \"defaults\": { \"subscriberEmail\": \"john.doe@example.com\" }, \"sites\": [] }\n```\n\n## 3. Add Sites\n\nFor security, you must specify which sites you allow to request certificates. If you need this to be dynamic (i.e. checking a database or API, see the section below on custom site managers).\n\nEvery site has a \"subject\" (its primary domain name) and one or more \"altnames\" (secondary or related domain names on the same certificate).\n\n### Using CLI (simple, recommended)\n\nSimply supply the names of sites that you manage and they will be added to the file system config, or database.\n\n```bash\nnpx greenlock add --subject example.com --altnames example.com,www.example.com\n```\n\n### By Hand (debugging only)\n\nYou should NOT edit `greenlock.d/config.json` with your own tools. Use `greenlock.manager.add({})` instead.\n\n`greenlock.d/config.json`:\n\n<!-- TODO update manager to write array rather than object -->\n\n```json\n{ \"sites\": [{ \"subject\": \"example.com\", \"altnames\": [ \"example.com\", \"www.example.com\" ] }] }\n```\n\n## 4. Hello, Encrypted World!\n\nThat was it! Now you can run your server!\n\nWhen you run `npm start`, it will automatically run `node server.js` (or `package.json.scripts.start`).\n\nFor arguments that `npm start` should ignore, place them after `--`.\n\nHere we use `--staging` in order to tell greenlock to issue test certificates rather than real certificates.\n\n```bash\n# Note: you can use npm start to run server.js with the --staging flag set\nnpm start -- --staging\n```\n\n```txt\n> my-project@1.0.0 start /srv/www/my-project\n> node server.js\n\nListening on 0.0.0.0:80 for ACME challenges and HTTPS redirects\nListening on 0.0.0.0:443 for secure traffic\n```\n\nIf everything worked you can visit your site in your browser, and after a few seconds you'll get a certificate warning and, after that, see a \"Hello World\" message. The debug (staging) certificates will be saved in `greenlock.d/staging`. Run again without `--staging` and you will get real certificates.\n\n### Season to taste\n\nNow you're ready to update `app.js` with your code. For example, try this next:\n\n```bash\nnpm install --save express\nmkdir -p public\necho '<h1>Hello!</h1>' >> public/index.html\n```\n\n`app.js`:\n\n```js\n'use strict';\n\nvar path = require('path');\nvar express = require('express');\nvar app = express();\n\napp.get('/', express.static(path.join(__dirname, \"public\")));\n\nmodule.exports = app;\n\n// for development and debugging\nif (require.main === module) {\n    require('http').createServer(app).listen(3000, function () {\n        console.info(\"Listening for HTTP on\", this.address());\n    });\n}\n```\n\n# Walkthrough\n\nFor a more detail read the full\n[WALKTHROUGH](https://git.rootprojects.org/root/greenlock-express.js/src/branch/master/WALKTHROUGH.md).\n\n# Examples\n\nTo see all of the examples, just browse [greenlock-express.js/examples/](https://git.rootprojects.org/root/greenlock-express.js/src/branch/master/examples)\n\n|        Example         | Location + Description                                                                                                                     |\n| :--------------------: | :----------------------------------------------------------------------------------------------------------------------------------------- |\n|        Express         | [./examples/express/][ex-express] how to export an express app                                                                             |\n|    Node's **http2**    | [./examples/http2/][ex-http2] how to use Node's built-in http2 server                                                                      |\n|      Node's https      | [./examples/https][ex-https] how to customize the https server                                                                             |\n|     **WebSockets**     | [./examples/websockets/][ex-websockets] how to use `on('upgrade')`                                                                         |\n| <span>Socket.IO</span> | [./examples/socket.io][ex-socketio] how to overcomplicate a persistent connection                                                          |\n|        Cluster         | [./examples/cluster/][ex-cluster] how to use Node's built-in clustering with master and worker processes                                   |\n|     **Wildcards**      | [coming someday][ex-wildcards] (ask to help create this) how to use DNS-01 for wildcard certs                                              |\n|     **Localhost**      | [coming someday][ex-localhost] (ask to help create this) how to use DNS-01 for domains that resolve to private networks, such as 127.0.0.1 |\n|       **CI/CD**        | [coming someday][ex-cicd] (ask to help create this) how to use the `--staging` environment for test deployments                            |\n|       HTTP Proxy       | [examples/http-proxy][ex-http-proxy] how to (reverse) proxy decrypted traffic to another server                                            |\n|           -            | Build your own<br>Be sure to tell me about it (open an issue)                                                                              |\n\n[ex-express]: https://git.rootprojects.org/root/greenlock-express.js/src/branch/master/examples/express/\n[ex-http2]: https://git.rootprojects.org/root/greenlock-express.js/src/branch/master/examples/http2/\n[ex-https]: https://git.rootprojects.org/root/greenlock-express.js/src/branch/master/examples/https/\n[ex-websockets]: https://git.rootprojects.org/root/greenlock-express.js/src/branch/master/examples/websockets/\n[ex-socketio]: https://git.rootprojects.org/root/greenlock-express.js/src/branch/master/examples/socketo.io/\n[ex-cluster]: https://git.rootprojects.org/root/greenlock-express.js/src/branch/master/examples/cluster/\n[ex-wildcards]: https://git.rootprojects.org/root/greenlock-express.js/src/branch/master/examples/wildcards/\n[ex-localhost]: https://git.rootprojects.org/root/greenlock-express.js/src/branch/master/examples/localhost/\n[ex-cicd]: https://git.rootprojects.org/root/greenlock-express.js/src/branch/master/examples/ci-cd/\n[ex-http-proxy]: https://git.rootprojects.org/root/greenlock-express.js/src/branch/master/examples/http-proxy/\n\n\n# FAQ\n## 1. But did YOU read the QuickStart?\n\n99% of the questions I get are answered in the QuickStart, or in the Examples.\n\nBefore you go into your specific use case, just try out the QuickStart from start to finish so that you can see that the default setup works, you get feel for the \"lay of the land\", and you know what to edit.\n\n## 2. How to use JavaScript configuration?\n\nYou don't. It's JSON on purpose.\n\nThe configuration has to be serializable (i.e. could go in a database).\n\nThe config file is meant for **simple** use cases, for the average dev and it is managed with `npx greenlock ...`, as shown in the QuickStart.\n\nIf you have a **dynamic** or **advanced** use case (i.e. you need stuff in a database, or to change config on-the-fly), you can use the Greenlock API (not Greenlock Express) and you'll love it.\n\nIf you're layering a lot of **complexity** with dev ops tools, but you don't really understand the tools that well (i.e. **Docker**), either use ENVIRONMENT variables or put the `npx greenlock ...` commands in your setup script. You MUST use a database for **lambda** \"cloud functions\" and such.\n\nYou can also just mangle the Greenlock API to do what you want... but I don't recommend it. Keep it simple and your future self with thank you.\n\nGeneral rule of thumb: commit code, not data / config.\n\n## 3. How to use non-standard ports (not 80, 443)?\n\nYou don't. Not usually.\n\nLet's Encrypt **REQUIRES port 80** for HTTP-01 challenges.\n\nBut if you're using DNS-01 or you have a proxy in place, just use the raw node server. See these examples:\n\n- [examples/http/server.js](https://git.rootprojects.org/root/greenlock-express.js/src/branch/master/examples/http/server.js)\n- [examples/https/server.js](https://git.rootprojects.org/root/greenlock-express.js/src/branch/master/examples/https/server.js)\n\nIf you want to use Greenlock as a proxy, see this example:\n\n- [examples/http-proxy/server.js](https://git.rootprojects.org/root/greenlock-express.js/src/branch/master/examples/http-proxy/server.js)\n\n# Troubleshooting\n\n### What if the example didn't work?\n\nDouble check the following:\n\n-   **Public Facing IP** for `http-01` challenges\n    -   Are you running this _as_ a public-facing webserver (good)? or localhost (bad)?\n    -   Does `ifconfig` show a public address (good)? or a private one - 10.x, 192.168.x, etc (bad)?\n    -   If you're on a non-public server, are you using the `dns-01` challenge?\n-   **valid email**\n    -   You MUST set `maintainerEmail` to a **valid address**\n    -   MX records must validate (`dig MX example.com` for `'john@example.com'`)\n-   **valid DNS records**\n    -   Must have public DNS records (test with `dig +trace A example.com; dig +trace www.example.com` for `[ 'example.com', 'www.example.com' ]`)\n-   **write access**\n    -   You MUST set `configDir` to a writeable location (test with `touch ./greenlock.d/config.json`)\n-   **port binding privileges**\n    -   You MUST be able to bind to ports 80 and 443\n    -   You can do this via `sudo` or [`setcap`](https://gist.github.com/firstdoit/6389682)\n-   **API limits**\n    -   You MUST NOT exceed the API [**usage limits**](https://letsencrypt.org/docs/staging-environment/) per domain, certificate, IP address, etc\n-   **Red Lock, Untrusted**\n    -   You MUST switch from `npm start -- --staging` to `npm start` to use the **production** server\n    -   The API URL should not have 'acme-staging-v02', but should have 'acme-v02'\n\n# Using a Database, S3, etc\n\nIf you have a small site, the default file storage will work well for you.\n\nIf you have many sites with many users, you'll probably want to store config in a database of some sort.\n\nSee the section on **Custom** callbacks and plugins below.\n\n# Advanced Configuration\n\nAll of the advanced configuration is done by replacing the default behavior with callbacks.\n\nYou can whip up your own, or you can use something that's published to npm.\n\nSee the section on **Custom** callbacks and plugins below.\n\n# Easy to Customize\n\n<!-- greenlock-manager-test => greenlock-manager-custom -->\n\n<!--\n- [greenlock.js/examples/](https://git.rootprojects.org/root/greenlock.js/src/branch/master/examples)\n-->\n\n-   [Custom Domain Management](https://git.rootprojects.org/root/greenlock-manager-test.js)\n    -   edit `server.js` and/or `.greenlockrc` to switch from the default `configDir` manager to your config system or database\n    -   CLI example: `npx greenlock init --manager ./path-or-npm-name.js --manager-FOO 'set option FOO'`\n-   [Custom Key & Cert Storage](https://git.rootprojects.org/root/greenlock-store-test.js)\n    -   edit the `defaults` section of `greenlock.d/config.json` to change the certificate store or database\n    -   CLI example: `npx greenlock defaults --store greenlock-store-fs --store-base-path ./greenlock.d`\n-   [Custom ACME HTTP-01 Challenges](https://git.rootprojects.org/root/acme-http-01-test.js)\n    -   edit the `defaults` section of `greenlock.d/config.json` to change the challenges by hand\n    -   CLI example: `npx greenlock defaults --challenge-http-01 ./you-http-01.js`\n-   [Custom ACME DNS-01 Challenges](https://git.rootprojects.org/root/acme-dns-01-test.js)\n    -   edit the `defaults` section of `greenlock.d/config.json` to change the challenges by hand\n    -   CLI example: `npx greenlock defaults --challenge-dns-01 acme-dns-01-ovh --challenge-dns-01-token xxxx`\n    -   Per-site example: `npx greenlock update --subject example.com --challenge-dns-01 ./your-dns-01.js`\n    -   API example:\n        ```js\n        greenlock.sites.set({\n            subject: \"example.com\",\n            challenges: {\n                \"dns-01\": {\n                    module: \"my-npm-module-name\",\n                    foo: \"some option\",\n                    bar: \"some other option\"\n                }\n            }\n        });\n        ```\n\nIf you're using the default `configDir` management you can edit `greenlock.d/config.json` by hand to change\nwhich default and per-site modules are used.\n\nYou can use the CLI, even if you're using a database, buckets, or your own file storage.\n\nYou can also use the API, particularly if you need to set values dynamically per-site or per-user\nrather than using the global defaults. The certificate store and all challenges can be set\nper-site, but most per-site use cases are for DNS-01.\n\n# Ready-made Integrations\n\nGreenlock Express integrates between Let's Encrypt's ACME Challenges and many popular services.\n\n| Type        | Service                                                                             | Plugin                   |\n| ----------- | ----------------------------------------------------------------------------------- | ------------------------ |\n| dns-01      | CloudFlare                                                                          | acme-dns-01-cloudflare   |\n| dns-01      | [Digital Ocean](https://git.rootprojects.org/root/acme-dns-01-digitalocean.js)      | acme-dns-01-digitalocean |\n| dns-01      | [DNSimple](https://git.rootprojects.org/root/acme-dns-01-dnsimple.js)               | acme-dns-01-dnsimple     |\n| dns-01      | [DuckDNS](https://git.rootprojects.org/root/acme-dns-01-duckdns.js)                 | acme-dns-01-duckdns      |\n| http-01     | File System / [Web Root](https://git.rootprojects.org/root/acme-http-01-webroot.js) | acme-http-01-webroot     |\n| dns-01      | [GoDaddy](https://git.rootprojects.org/root/acme-dns-01-godaddy.js)                 | acme-dns-01-godaddy      |\n| dns-01      | [Gandi](https://git.rootprojects.org/root/acme-dns-01-gandi.js)                     | acme-dns-01-gandi        |\n| dns-01      | [NameCheap](https://git.rootprojects.org/root/acme-dns-01-namecheap.js)             | acme-dns-01-namecheap    |\n| dns-01      | [Name&#46;com](https://git.rootprojects.org/root/acme-dns-01-namedotcom.js)         | acme-dns-01-namedotcom   |\n| dns-01      | Route53 (AWS)                                                                       | acme-dns-01-route53      |\n| http-01     | S3 (AWS, Digital Ocean, Scaleway)                                                   | acme-http-01-s3          |\n| dns-01      | [Vultr](https://git.rootprojects.org/root/acme-dns-01-vultr.js)                     | acme-dns-01-vultr        |\n| dns-01      | [Build your own](https://git.rootprojects.org/root/acme-dns-01-test.js)             | acme-dns-01-test         |\n| http-01     | [Build your own](https://git.rootprojects.org/root/acme-http-01-test.js)            | acme-http-01-test        |\n| tls-alpn-01 | [Contact us](mailto:support@therootcompany.com)                                     | -                        |\n\nExample Usage:\n\n```bash\nnpx greenlock defaults --challenge-dns-01 acme-dns-01-ovh --challenge-dns-01-token xxxx\nnpx greenlock defaults --challenge-http-01 acme-http-01-s3 --challenge-http-01-bucket my-bucket\n```\n\nSearch `acme-http-01-` or `acme-dns-01-` on npm to find more.\n\n# Full Documentation\n\n<!--\n- Greenlock CLI\n- Greenlock JavaScript API\n-->\n\nMost of the documentation is done by use-case examples, as shown up at the top of the README.\n\nWe're working on more comprehensive documentation for this newly released version.\n**Please open an issue** with questions in the meantime.\n\n# Commercial Support\n\nDo you need...\n\n-   training?\n-   specific features?\n-   different integrations?\n-   bugfixes, on _your_ timeline?\n-   custom code, built by experts?\n-   commercial support and licensing?\n\nYou're welcome to [contact us](mailto:aj@therootcompany.com) in regards to IoT, On-Prem,\nEnterprise, and Internal installations, integrations, and deployments.\n\nWe have both commercial support and commercial licensing available.\n\nWe also offer consulting for all-things-ACME and Let's Encrypt.\n\n# Legal &amp; Rules of the Road\n\nGreenlock&trade; is a [trademark](https://rootprojects.org/legal/#trademark) of AJ ONeal\n\nThe rule of thumb is \"attribute, but don't confuse\". For example:\n\n> Built with [Greenlock Express](https://git.rootprojects.org/root/greenlock.js) (a [Root](https://rootprojects.org) project).\n\nPlease [contact us](mailto:aj@therootcompany.com) if you have any questions in regards to our trademark,\nattribution, and/or visible source policies. We want to build great software and a great community.\n\n[Greenlock&trade;](https://git.rootprojects.org/root/greenlock.js) |\nMPL-2.0 |\n[Terms of Use](https://therootcompany.com/legal/#terms) |\n[Privacy Policy](https://therootcompany.com/legal/#privacy)\n","readmeFilename":"README.md"}