-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added dns-01 challenge over Cloudflare; better command line parsing; …
…cleanups
- Loading branch information
Showing
4 changed files
with
600 additions
and
234 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
*.pem | ||
*.crt | ||
*.pem | ||
deno.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,41 @@ | ||
# deno-acme | ||
[![Latest version](https://deno.land/badge/acme/version)](https://deno.land/x/acme) | ||
|
||
Get certificates for your domains and subdomains via http challenges from an acme server. | ||
Use the CLI as a standalone acme client, ... | ||
or use the acme.ts library to use it in your own application. | ||
Get certificates for your domains and or your domains their subdomains from an acme server. | ||
Supports http-01 challenges and dns-01 challenges with domains hosted with Cloudflare's DNS server. | ||
Use the CLI as a standalone acme client, or use the acme.ts library to use it in your own application. | ||
|
||
## Prerequisites | ||
- Port 80 needs to be available on the maschine running the acme cli | ||
- The requested domain name(s) need to point the IP address of the maschine running the acme cli | ||
## Prerequisites for HTTP challenge | ||
- Port 80 needs to be available on the maschine running the acme cli or ... | ||
- (optional) Port 80 needs to be forwarded to the maschine running the acme cli | ||
- The requested domain name(s) need to point the IP address of the maschine running the acme cli | ||
|
||
## Prerequisites for Cloudflare DNS challenge | ||
- Domain and / or subdomain(s) with nameservers pointing to Cloudflare | ||
- Cloudflare API token with edit privileges for the given domain(s) / subdomain(s) DNS zone | ||
|
||
## CLI | ||
How to get & use the CLI: | ||
``` | ||
sudo deno install -A --allow-read=. --allow-write=. --allow-net --name acme --root /usr/local/ https://deno.land/x/acme/cli.ts | ||
sudo acme example.com | ||
sudo deno install -A --allow-read=. --allow-write=. --allow-net --name acme --root /usr/local/ https://deno.land/x/[email protected]/cli.ts | ||
# http challenge: | ||
sudo acme http example.com,subdomain.example.com | ||
# cloudflare dns challenge: | ||
sudo acme cloudflare example.com,subdomain.example.com | ||
``` | ||
|
||
## Library | ||
To use acme as a library in your application, add the following: | ||
``` | ||
import * as ACME from "https://deno.land/x/acme/acme.ts" | ||
const { domainCertificates } = await ACME.getCertificateForDomain("example.com", "https://acme-staging-v02.api.letsencrypt.org/directory"); | ||
import * as ACME from "https://deno.land/x/[email protected]/acme.ts" | ||
// http challenge: | ||
const { domainCertificates } = await ACME.getCertificatesWithHttp("example.com", "https://acme-staging-v02.api.letsencrypt.org/directory"); | ||
console.log(domainCertificates); | ||
// cloudflare dns challenge: | ||
const cloudflareToken = Deno.env.get("CLOUDFLARE_TOKEN"); | ||
const { domainCertificates } = await ACME.getCertificatesWithCloudflare(cloudflareToken, "example.com", "https://acme-staging-v02.api.letsencrypt.org/directory"); | ||
console.log(domainCertificates); | ||
``` | ||
|
||
|
Oops, something went wrong.