-
Notifications
You must be signed in to change notification settings - Fork 505
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
support acme (let's encrypt) (close #2) #391
Merged
Merged
Changes from 12 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
668715b
update http server to support auto cert
localvar 337ec53
major logic for http01 & tlsalpn01
localvar d8b6a17
add DNS01 challenge
localvar 1cb4fa9
refactor & bugfix
localvar 7bc9ad2
support more dns provider
localvar 2ae6f09
refactor DNS provider creation
localvar b8dd377
sync certificate from storage
localvar fde9be5
update document
localvar 526be62
fix typo
localvar 22b9c90
fix issues in certificate renew process
localvar 93d0edf
clear globalACM when AutoCertManager is deleted
localvar d948b3a
fix issues reported by Github Actions
localvar 8d74483
update according to review comments
localvar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
|
@@ -18,6 +18,7 @@ | |
- [EurekaServiceRegistry](#eurekaserviceregistry) | ||
- [ZookeeperServiceRegistry](#zookeeperserviceregistry) | ||
- [NacosServiceRegistry](#nacosserviceregistry) | ||
- [AutoCertManager](#autocertmanager) | ||
- [Common Types](#common-types) | ||
- [tracing.Spec](#tracingspec) | ||
- [zipkin.Spec](#zipkinspec) | ||
|
@@ -29,6 +30,7 @@ | |
- [httppipeline.Filter](#httppipelinefilter) | ||
- [easemonitormetrics.Kafka](#easemonitormetricskafka) | ||
- [nacos.ServerSpec](#nacosserverspec) | ||
- [autocertmanager.DomainSpec](#autocertmanagerdomainspec) | ||
|
||
As the [architecture diagram](./architecture.png) shows, the controller is the core entity to control kinds of working. There are two kinds of controllers overall: | ||
|
||
|
@@ -301,6 +303,36 @@ servers: | |
| username | string | The username of client | No | | ||
| password | string | The password of client | No | | ||
|
||
### AutoCertManager | ||
|
||
AutoCertManager automatically manage HTTPS certificates. The config looks like: | ||
|
||
```yaml | ||
kind: AutoCertManager | ||
name: autocert | ||
email: [email protected] | ||
directoryUrl: https://acme-v02.api.letsencrypt.org/directory | ||
renewBefore: 720h | ||
enableHTTP01: true | ||
enableTLSALPN01: true | ||
enableDNS01: true | ||
domains: | ||
- name: "*.megaease.com" | ||
dnsProvider: | ||
name: alidns | ||
zone: megaease.com | ||
``` | ||
|
||
| Name | Type | Description | Required | | ||
| --------------- | ------------------------------------------ | ------------------------------------------------------------------------------------ | ---------------------------------- | | ||
| email | string | An email address for CA account | Yes | | ||
| directoryUrl | string | The endpoint of the CA directory | No (default to use Let's Encrypt) | | ||
| renewBefore | string | A certificate will be renewed before this duration of its expire time | No (default 720 hours) | | ||
| enableHTTP01 | bool | Enable HTTP-01 challenge (Easegress need to be accessable at port 80 when true) | No (default true) | | ||
| enableTLSALPN01 | bool | Enable TLS-ALPN-01 challenge (Easegress need to be accessable at port 443 when true) | No (default true) | | ||
| enableDNS01 | bool | Enable DNS-01 challenge | No (default true) | | ||
| domains | [][DomainSpec](#autocertmanagerdomainspec) | Domains to be managed | Yes | | ||
|
||
## Common Types | ||
|
||
### tracing.Spec | ||
|
@@ -394,3 +426,26 @@ The self-defining specification of each filter references to [filters](./filters | |
| port | uint16 | The port | Yes | | ||
| scheme | string | The scheme of protocol (support http, https) | No | | ||
| contextPath | string | The context path | No | | ||
|
||
### autocertmanager.DomainSpec | ||
|
||
| Name | Type | Description | Required | | ||
| ----------- | ----------------- | --------------------------| ------------------------------------ | | ||
| name | string | The name of the domain | Yes | | ||
| dnsProvider | map[string]string | DNS provider information | No (Yes if `name` is a wildcard one) | | ||
|
||
The fields in `dnsProvider` vary from DNS providers, but `name` and `zone` are required for all DNS providers. | ||
Below table list other required fields for each supported DNS provider: | ||
|
||
| DNS Provider Name | Required Fields | | ||
| ----------------- | ------------------------------------------------------------------- | | ||
| alidns | accessKeyId, accessKeySecret | | ||
| azure | tenantId, clientId, clientSecret, subscriptionId, resourceGroupName | | ||
| cloudflare | apiToken | | ||
| digitalocean | apiToken | | ||
| dnspod | apiToken | | ||
| duckdns | apiToken | | ||
| google | project | | ||
| hetzner | authApiToken | | ||
| route53 | accessKeyId, secretAccessKey, awsProfile | | ||
| vultr | apiToken | |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Propose
directoryURL
https://github.com/golang/go/wiki/CodeReviewComments#initialisms
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated.