๐ Deploy LE cert in a kawaii way
- Select a region that not in China Mainland
- Create a VPC network(console) and a NAS bucket(console), please ensure they are in the same available-region
- Enter Function Computing console
- Select
Service
- If you don't have an existing service/function, system will guide you to create a new one
- While creating function, select template
Event function
- While configuring function, please fill as follow:
- Name:
cron
- Runtime:
Node.JS 12.x
- Upload Code:
Source pack upload
- Function entry:
app-ali_cron.handler
- Memory:
128MB
- Timeout:
600s
- Name:
- Enter the service you created, select
Service Configuration
and clickEdit configuration
- In
Network Configuring
- Allow function access internet:
True
- Allow function access resoucres in VPC:
True
- Configure the VPC settings
- Allow function access internet:
- In
NAS File System
,NAS Mount Point
- Dir: select the NAS you created before
- Remote Dir:
/
- Local Dir:
/mnt/cert
- In
Permission Configuring
, create a new role which includes followAliyunVPCFullAccess
AliyunNASFullAccess
AliyunFCFullAccess
AliyunECSNetworkInterfaceManagementAccess
- Save configuration
- In
- Enter the function
cron
, setectCode running
and clickOnline editing
- Rename
config.example.js
toconfig.js
and open it - Fill the file (certPath:
/mnt/cert
, other instructions please see Configuration) - Click Save & Execute
- Rename
- Back to
service
page, create a new function same as above with the namehttp
, and enter the function- Update function entry from
app-ali_cron.handler
toapp-ali_http.handler
- Copy the config.js file from cron function to http function
- Now you can access your Tippy instance by post JSON object {"token": "your_token", "certName": "my_cert"} to the endpoint(like
https://12345678.cn-hongkong.fc.aliyuncs.com/2016-08-15/proxy/Tippy/http/
) to get the latest cert you request
- Update function entry from
- Enjoy~
POST https://12345678.cn-hongkong.fc.aliyuncs.com/2016-08-15/proxy/Tippy/http/
{
"token": "your_token",
"certName": "my_cert"
}
Response:
{
"code": 0,
"certPem": "-----BEGIN CERTIFICATE-----\n....",
"keyPem": "-----BEGIN RSA PRIVATE KEY-----\n...."
}
{
"code": -1
}
module.exports = {
logLevel: 'debug',
email: 'i@lyn.moe',
certPath: '/mnt/cert',
token: [
'abc123!@#'
],
dnsProvider: {
ali: {
provider: 'alidns',
accesskeyId: '',
accesskeySecret: ''
},
cf: {
provider: 'cloudflaredns',
key: 'abc',
email: 'i@lyn.moe',
zoneId: {
'lyn.moe': 'abc'
}
}
},
domainDnsMap: {
'cgl.li': 'ali',
'lyn.moe': 'cf'
},
certs: {
for_root: {
'cgl.li': [
'www',
'@'
],
'lyn.moe': [
'*',
'@'
]
}
},
cdnProvider: {
ali: {
type: 'alicdn',
accesskeyId: '',
accesskeySecret: ''
}
},
cdnCertMap: [
{
provider: 'ali',
cert: 'for_root',
domain: 'www.cgl.li'
}
]
}
dnsProvider
is fordomainDnsMap
,cdnProvider
is forcdnCertMap
dnsProvider
is used to deploy cert to CDN services, in whichprovider
stands forcdnProvider{}
, cert stands forcerts{}
, domain stands for the domain you configured in CDN Provider
Tippy from Gochuumon wa Usagi Desu ka?
MIT