mirror of
https://github.com/certd/certd.git
synced 2026-04-14 12:30:54 +08:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a70b4373de | ||
|
|
b7c12e6d91 | ||
|
|
6a88dd476e |
9
.gitignore
vendored
9
.gitignore
vendored
@@ -1,9 +1,16 @@
|
|||||||
# IntelliJ project files
|
# IntelliJ project files
|
||||||
|
.vscode/
|
||||||
|
node_modules/
|
||||||
|
npm-debug.log
|
||||||
|
yarn-error.log
|
||||||
|
yarn.lock
|
||||||
|
package-lock.json
|
||||||
|
/.idea/
|
||||||
|
|
||||||
.idea
|
.idea
|
||||||
*.iml
|
*.iml
|
||||||
out
|
out
|
||||||
gen
|
gen
|
||||||
node_modules/
|
|
||||||
/test/*.private.*
|
/test/*.private.*
|
||||||
|
|
||||||
/*.log
|
/*.log
|
||||||
|
|||||||
@@ -2,5 +2,5 @@
|
|||||||
"packages": [
|
"packages": [
|
||||||
"packages/*/*"
|
"packages/*/*"
|
||||||
],
|
],
|
||||||
"version": "0.2.0"
|
"version": "0.2.1"
|
||||||
}
|
}
|
||||||
|
|||||||
22168
package-lock.json
generated
22168
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
7
packages/core/api/.gitignore
vendored
Normal file
7
packages/core/api/.gitignore
vendored
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
.vscode/
|
||||||
|
node_modules/
|
||||||
|
npm-debug.log
|
||||||
|
yarn-error.log
|
||||||
|
yarn.lock
|
||||||
|
package-lock.json
|
||||||
|
/.idea/
|
||||||
2468
packages/core/api/package-lock.json
generated
2468
packages/core/api/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@certd/api",
|
"name": "@certd/api",
|
||||||
"version": "0.2.0",
|
"version": "0.2.1",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "src/index.js",
|
"main": "src/index.js",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
@@ -22,5 +22,5 @@
|
|||||||
"eslint-plugin-promise": "^4.2.1",
|
"eslint-plugin-promise": "^4.2.1",
|
||||||
"mocha": "^8.2.1"
|
"mocha": "^8.2.1"
|
||||||
},
|
},
|
||||||
"gitHead": "4a421d5b142d453203c68ce6d1036e168ea2455b"
|
"gitHead": "5fbd7742665c0a949333d805153e9b6af91c0a71"
|
||||||
}
|
}
|
||||||
|
|||||||
2493
packages/core/certd/package-lock.json
generated
2493
packages/core/certd/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@certd/certd",
|
"name": "@certd/certd",
|
||||||
"version": "0.2.0",
|
"version": "0.2.1",
|
||||||
"description": "a ssl cert keeper",
|
"description": "a ssl cert keeper",
|
||||||
"main": "src/index.js",
|
"main": "src/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@certd/acme-client": "^0.2.0",
|
"@certd/acme-client": "^0.2.0",
|
||||||
"@certd/api": "^0.2.0",
|
"@certd/api": "^0.2.1",
|
||||||
"dayjs": "^1.9.7",
|
"dayjs": "^1.9.7",
|
||||||
"lodash-es": "^4.17.20",
|
"lodash-es": "^4.17.20",
|
||||||
"node-forge": "^0.10.0"
|
"node-forge": "^0.10.0"
|
||||||
@@ -25,5 +25,5 @@
|
|||||||
"eslint-plugin-promise": "^4.2.1",
|
"eslint-plugin-promise": "^4.2.1",
|
||||||
"mocha": "^8.2.1"
|
"mocha": "^8.2.1"
|
||||||
},
|
},
|
||||||
"gitHead": "4a421d5b142d453203c68ce6d1036e168ea2455b"
|
"gitHead": "5fbd7742665c0a949333d805153e9b6af91c0a71"
|
||||||
}
|
}
|
||||||
|
|||||||
7
packages/core/executor/.gitignore
vendored
Normal file
7
packages/core/executor/.gitignore
vendored
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
.vscode/
|
||||||
|
node_modules/
|
||||||
|
npm-debug.log
|
||||||
|
yarn-error.log
|
||||||
|
yarn.lock
|
||||||
|
package-lock.json
|
||||||
|
/.idea/
|
||||||
5696
packages/core/executor/package-lock.json
generated
5696
packages/core/executor/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@certd/executor",
|
"name": "@certd/executor",
|
||||||
"version": "0.2.0",
|
"version": "0.2.1",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "src/index.js",
|
"main": "src/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -10,15 +10,15 @@
|
|||||||
},
|
},
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@certd/api": "^0.2.0",
|
"@certd/api": "^0.2.1",
|
||||||
"@certd/certd": "^0.2.0",
|
"@certd/certd": "^0.2.1",
|
||||||
"dayjs": "^1.9.7",
|
"dayjs": "^1.9.7",
|
||||||
"lodash-es": "^4.17.20"
|
"lodash-es": "^4.17.20"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@certd/plugin-aliyun": "^0.2.0",
|
"@certd/plugin-aliyun": "^0.2.1",
|
||||||
"@certd/plugin-host": "^0.2.0",
|
"@certd/plugin-host": "^0.2.1",
|
||||||
"@certd/plugin-tencent": "^0.2.0",
|
"@certd/plugin-tencent": "^0.2.1",
|
||||||
"@rollup/plugin-commonjs": "^17.0.0",
|
"@rollup/plugin-commonjs": "^17.0.0",
|
||||||
"@rollup/plugin-json": "^4.1.0",
|
"@rollup/plugin-json": "^4.1.0",
|
||||||
"@rollup/plugin-node-resolve": "^11.0.1",
|
"@rollup/plugin-node-resolve": "^11.0.1",
|
||||||
@@ -35,5 +35,5 @@
|
|||||||
"author": "Greper",
|
"author": "Greper",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"sideEffects": false,
|
"sideEffects": false,
|
||||||
"gitHead": "4a421d5b142d453203c68ce6d1036e168ea2455b"
|
"gitHead": "5fbd7742665c0a949333d805153e9b6af91c0a71"
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
7
packages/plugins/plugin-aliyun/.gitignore
vendored
Normal file
7
packages/plugins/plugin-aliyun/.gitignore
vendored
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
.vscode/
|
||||||
|
node_modules/
|
||||||
|
npm-debug.log
|
||||||
|
yarn-error.log
|
||||||
|
yarn.lock
|
||||||
|
package-lock.json
|
||||||
|
/.idea/
|
||||||
3104
packages/plugins/plugin-aliyun/package-lock.json
generated
3104
packages/plugins/plugin-aliyun/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,17 +1,20 @@
|
|||||||
{
|
{
|
||||||
"name": "@certd/plugin-aliyun",
|
"name": "@certd/plugin-aliyun",
|
||||||
"version": "0.2.0",
|
"version": "0.2.1",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "src/index.js",
|
"main": "src/index.js",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@alicloud/cs20151215": "^3.0.3",
|
||||||
|
"@alicloud/openapi-client": "^0.4.0",
|
||||||
"@alicloud/pop-core": "^1.7.10",
|
"@alicloud/pop-core": "^1.7.10",
|
||||||
"@certd/api": "^0.2.0",
|
"@certd/api": "^0.2.1",
|
||||||
"dayjs": "^1.9.7",
|
"dayjs": "^1.9.7",
|
||||||
"lodash-es": "^4.17.20"
|
"lodash-es": "^4.17.20"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@certd/certd": "^0.2.0",
|
"@certd/certd": "^0.2.1",
|
||||||
|
"@certd/plugin-common": "^0.2.1",
|
||||||
"chai": "^4.2.0",
|
"chai": "^4.2.0",
|
||||||
"eslint": "^7.15.0",
|
"eslint": "^7.15.0",
|
||||||
"eslint-config-standard": "^16.0.2",
|
"eslint-config-standard": "^16.0.2",
|
||||||
@@ -22,5 +25,5 @@
|
|||||||
},
|
},
|
||||||
"author": "Greper",
|
"author": "Greper",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"gitHead": "4a421d5b142d453203c68ce6d1036e168ea2455b"
|
"gitHead": "5fbd7742665c0a949333d805153e9b6af91c0a71"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,200 @@
|
|||||||
|
import { AbstractAliyunPlugin } from '../abstract-aliyun.js'
|
||||||
|
import Core from '@alicloud/pop-core'
|
||||||
|
import { K8sClient } from '@certd/plugin-common'
|
||||||
|
const ROAClient = Core.ROAClient
|
||||||
|
|
||||||
|
const define = {
|
||||||
|
name: 'deployCertToAliyunAckIngress',
|
||||||
|
label: '部署到阿里云AckIngress',
|
||||||
|
input: {
|
||||||
|
clusterId: {
|
||||||
|
label: '集群id',
|
||||||
|
component: {
|
||||||
|
placeholder: '集群id'
|
||||||
|
},
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
secretName: {
|
||||||
|
label: '保密字典Id',
|
||||||
|
component: {
|
||||||
|
placeholder: '保密字典Id'
|
||||||
|
},
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
regionId: {
|
||||||
|
label: '大区',
|
||||||
|
value: 'cn-shanghai',
|
||||||
|
component: {
|
||||||
|
placeholder: '集群所属大区'
|
||||||
|
},
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
namespace: {
|
||||||
|
label: '命名空间',
|
||||||
|
value: 'default',
|
||||||
|
component: {
|
||||||
|
placeholder: '命名空间'
|
||||||
|
},
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
ingressName: {
|
||||||
|
label: 'ingress名称',
|
||||||
|
value: '',
|
||||||
|
component: {
|
||||||
|
placeholder: 'ingress名称'
|
||||||
|
},
|
||||||
|
required: true,
|
||||||
|
helper: '可以传入一个数组'
|
||||||
|
},
|
||||||
|
ingressClass: {
|
||||||
|
label: 'ingress类型',
|
||||||
|
value: 'nginx',
|
||||||
|
component: {
|
||||||
|
placeholder: '暂时只支持nginx类型'
|
||||||
|
},
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
isPrivateIpAddress: {
|
||||||
|
label: '是否私网ip',
|
||||||
|
value: false,
|
||||||
|
component: {
|
||||||
|
placeholder: '集群连接端点是否是私网ip'
|
||||||
|
},
|
||||||
|
helper: '如果您当前certd运行在同一个私网下,可以选择是。',
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
accessProvider: {
|
||||||
|
label: 'Access提供者',
|
||||||
|
type: [String, Object],
|
||||||
|
desc: 'access授权',
|
||||||
|
component: {
|
||||||
|
name: 'access-provider-selector',
|
||||||
|
filter: 'aliyun'
|
||||||
|
},
|
||||||
|
required: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
output: {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class DeployCertToAliyunAckIngress extends AbstractAliyunPlugin {
|
||||||
|
static define () {
|
||||||
|
return define
|
||||||
|
}
|
||||||
|
|
||||||
|
async execute ({ cert, props, context }) {
|
||||||
|
const accessProvider = this.getAccessProvider(props.accessProvider)
|
||||||
|
const client = this.getClient(accessProvider, props.regionId)
|
||||||
|
|
||||||
|
const kubeConfigStr = await this.getKubeConfig(client, props.clusterId, props.isPrivateIpAddress)
|
||||||
|
|
||||||
|
this.logger.info('kubeconfig已成功获取')
|
||||||
|
const k8sClient = new K8sClient(kubeConfigStr)
|
||||||
|
const ingressType = props.ingressClass || 'qcloud'
|
||||||
|
if (ingressType === 'qcloud') {
|
||||||
|
throw new Error('暂未实现')
|
||||||
|
// await this.patchQcloudCertSecret({ k8sClient, props, context })
|
||||||
|
} else {
|
||||||
|
await this.patchNginxCertSecret({ cert, k8sClient, props, context })
|
||||||
|
}
|
||||||
|
|
||||||
|
await this.sleep(3000) // 停留2秒,等待secret部署完成
|
||||||
|
// await this.restartIngress({ k8sClient, props })
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
async restartIngress ({ k8sClient, props }) {
|
||||||
|
const { namespace } = props
|
||||||
|
|
||||||
|
const body = {
|
||||||
|
metadata: {
|
||||||
|
labels: {
|
||||||
|
certd: this.appendTimeSuffix('certd')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const ingressList = await k8sClient.getIngressList({ namespace })
|
||||||
|
console.log('ingressList:', ingressList)
|
||||||
|
if (!ingressList || !ingressList.body || !ingressList.body.items) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const ingressNames = ingressList.body.items.filter(item => {
|
||||||
|
if (!item.spec.tls) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
for (const tls of item.spec.tls) {
|
||||||
|
if (tls.secretName === props.secretName) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}).map(item => {
|
||||||
|
return item.metadata.name
|
||||||
|
})
|
||||||
|
for (const ingress of ingressNames) {
|
||||||
|
await k8sClient.patchIngress({ namespace, ingressName: ingress, body })
|
||||||
|
this.logger.info(`ingress已重启:${ingress}`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async patchNginxCertSecret ({ cert, k8sClient, props, context }) {
|
||||||
|
const crt = cert.crt
|
||||||
|
const key = cert.key
|
||||||
|
const crtBase64 = Buffer.from(crt).toString('base64')
|
||||||
|
const keyBase64 = Buffer.from(key).toString('base64')
|
||||||
|
|
||||||
|
const { namespace, secretName } = props
|
||||||
|
|
||||||
|
const body = {
|
||||||
|
data: {
|
||||||
|
'tls.crt': crtBase64,
|
||||||
|
'tls.key': keyBase64
|
||||||
|
},
|
||||||
|
metadata: {
|
||||||
|
labels: {
|
||||||
|
certd: this.appendTimeSuffix('certd')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let secretNames = secretName
|
||||||
|
if (typeof secretName === 'string') {
|
||||||
|
secretNames = [secretName]
|
||||||
|
}
|
||||||
|
for (const secret of secretNames) {
|
||||||
|
await k8sClient.patchSecret({ namespace, secretName: secret, body })
|
||||||
|
this.logger.info(`CertSecret已更新:${secret}`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
getClient (aliyunProvider, regionId) {
|
||||||
|
return new ROAClient({
|
||||||
|
accessKeyId: aliyunProvider.accessKeyId,
|
||||||
|
accessKeySecret: aliyunProvider.accessKeySecret,
|
||||||
|
endpoint: `https://cs.${regionId}.aliyuncs.com`,
|
||||||
|
apiVersion: '2015-12-15'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
async getKubeConfig (client, clusterId, isPrivateIpAddress = false) {
|
||||||
|
const httpMethod = 'GET'
|
||||||
|
const uriPath = `/k8s/${clusterId}/user_config`
|
||||||
|
const queries = {
|
||||||
|
PrivateIpAddress: isPrivateIpAddress
|
||||||
|
}
|
||||||
|
const body = '{}'
|
||||||
|
const headers = {
|
||||||
|
'Content-Type': 'application/json'
|
||||||
|
}
|
||||||
|
const requestOption = {}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const res = await client.request(httpMethod, uriPath, queries, body, headers, requestOption)
|
||||||
|
return res.config
|
||||||
|
} catch (e) {
|
||||||
|
console.error('请求出错:', e)
|
||||||
|
throw e
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
import pkg from 'chai'
|
||||||
|
import { DeployCertToAliyunAckIngress } from '../../src/plugins/deploy-to-ack-ingress/index.js'
|
||||||
|
import { Certd } from '@certd/certd'
|
||||||
|
import { createOptions } from '../../../../../test/options.js'
|
||||||
|
import { K8sClient } from '@certd/plugin-common'
|
||||||
|
|
||||||
|
const { expect } = pkg
|
||||||
|
|
||||||
|
async function getOptions () {
|
||||||
|
const options = createOptions()
|
||||||
|
options.args.test = false
|
||||||
|
options.cert.email = 'xiaojunnuo@qq.com'
|
||||||
|
options.cert.domains = ['*.docmirror.cn']
|
||||||
|
const certd = new Certd(options)
|
||||||
|
const cert = await certd.readCurrentCert()
|
||||||
|
const context = {}
|
||||||
|
const deployOpts = {
|
||||||
|
accessProviders: options.accessProviders,
|
||||||
|
cert,
|
||||||
|
props: {
|
||||||
|
accessProvider: 'aliyun-yonsz-prod',
|
||||||
|
regionId: 'cn-shanghai',
|
||||||
|
clusterId: 'c9e107ca518314f70973636965037fc00',
|
||||||
|
secretName: 'default-ingress-secret1638601684896',
|
||||||
|
namespace: 'default',
|
||||||
|
ingressClass: 'nginx'
|
||||||
|
},
|
||||||
|
context
|
||||||
|
}
|
||||||
|
return { options, deployOpts }
|
||||||
|
}
|
||||||
|
|
||||||
|
describe('DeployCertToAliyunAckIngressNginx', function () {
|
||||||
|
it('#getAliyunSecrets', async function () {
|
||||||
|
this.timeout(50000)
|
||||||
|
const { options, deployOpts } = await getOptions()
|
||||||
|
const plugin = new DeployCertToAliyunAckIngress(options)
|
||||||
|
const ackClient = plugin.getClient(options.accessProviders[deployOpts.props.accessProvider], deployOpts.props.regionId)
|
||||||
|
const kubeConfig = await plugin.getKubeConfig(ackClient, deployOpts.props.clusterId, false)
|
||||||
|
|
||||||
|
const k8sClient = new K8sClient(kubeConfig)
|
||||||
|
const secrets = await k8sClient.getSecret({ namespace: 'default' })
|
||||||
|
|
||||||
|
console.log('secrets:', secrets)
|
||||||
|
})
|
||||||
|
it('#getAliyunIngreses', async function () {
|
||||||
|
this.timeout(50000)
|
||||||
|
const { options, deployOpts } = await getOptions()
|
||||||
|
const plugin = new DeployCertToAliyunAckIngress(options)
|
||||||
|
const ackClient = plugin.getClient(options.accessProviders[deployOpts.props.accessProvider], deployOpts.props.regionId)
|
||||||
|
const kubeConfig = await plugin.getKubeConfig(ackClient, deployOpts.props.clusterId, false)
|
||||||
|
|
||||||
|
const k8sClient = new K8sClient(kubeConfig)
|
||||||
|
const list = await k8sClient.getIngressList({ namespace: 'default' })
|
||||||
|
|
||||||
|
console.log('list:', list)
|
||||||
|
})
|
||||||
|
it('#execute', async function () {
|
||||||
|
this.timeout(5000)
|
||||||
|
|
||||||
|
const { options, deployOpts } = await getOptions()
|
||||||
|
const plugin = new DeployCertToAliyunAckIngress(options)
|
||||||
|
|
||||||
|
const ret = await plugin.doExecute(deployOpts)
|
||||||
|
console.log('success', ret)
|
||||||
|
})
|
||||||
|
})
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
14
packages/plugins/plugin-common/.eslintrc
Normal file
14
packages/plugins/plugin-common/.eslintrc
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"extends": "standard",
|
||||||
|
"env": {
|
||||||
|
"mocha": true
|
||||||
|
},
|
||||||
|
"overrides": [
|
||||||
|
{
|
||||||
|
"files": ["*.test.js", "*.spec.js"],
|
||||||
|
"rules": {
|
||||||
|
"no-unused-expressions": "off"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
7
packages/plugins/plugin-common/.gitignore
vendored
Normal file
7
packages/plugins/plugin-common/.gitignore
vendored
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
.vscode/
|
||||||
|
node_modules/
|
||||||
|
npm-debug.log
|
||||||
|
yarn-error.log
|
||||||
|
yarn.lock
|
||||||
|
package-lock.json
|
||||||
|
/.idea/
|
||||||
23
packages/plugins/plugin-common/package.json
Normal file
23
packages/plugins/plugin-common/package.json
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
"name": "@certd/plugin-common",
|
||||||
|
"version": "0.2.1",
|
||||||
|
"description": "",
|
||||||
|
"main": "src/index.js",
|
||||||
|
"type": "module",
|
||||||
|
"dependencies": {
|
||||||
|
"kubernetes-client": "^9.0.0"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@certd/certd": "^0.2.1",
|
||||||
|
"chai": "^4.2.0",
|
||||||
|
"eslint": "^7.15.0",
|
||||||
|
"eslint-config-standard": "^16.0.2",
|
||||||
|
"eslint-plugin-import": "^2.22.1",
|
||||||
|
"eslint-plugin-node": "^11.1.0",
|
||||||
|
"eslint-plugin-promise": "^4.2.1",
|
||||||
|
"mocha": "^8.2.1"
|
||||||
|
},
|
||||||
|
"author": "Greper",
|
||||||
|
"license": "MIT",
|
||||||
|
"gitHead": "5fbd7742665c0a949333d805153e9b6af91c0a71"
|
||||||
|
}
|
||||||
1
packages/plugins/plugin-common/src/index.js
Normal file
1
packages/plugins/plugin-common/src/index.js
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export { K8sClient } from './lib/k8s.client.js'
|
||||||
@@ -87,6 +87,11 @@ export class K8sClient {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async getIngressList (opts) {
|
||||||
|
const namespace = opts.namespace || 'default'
|
||||||
|
return await this.client.apis.extensions.v1beta1.namespaces(namespace).ingresses.get()
|
||||||
|
}
|
||||||
|
|
||||||
async getIngress (opts) {
|
async getIngress (opts) {
|
||||||
const namespace = opts.namespace || 'default'
|
const namespace = opts.namespace || 'default'
|
||||||
const ingressName = opts.ingressName
|
const ingressName = opts.ingressName
|
||||||
7
packages/plugins/plugin-host/.gitignore
vendored
Normal file
7
packages/plugins/plugin-host/.gitignore
vendored
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
.vscode/
|
||||||
|
node_modules/
|
||||||
|
npm-debug.log
|
||||||
|
yarn-error.log
|
||||||
|
yarn.lock
|
||||||
|
package-lock.json
|
||||||
|
/.idea/
|
||||||
3166
packages/plugins/plugin-host/package-lock.json
generated
3166
packages/plugins/plugin-host/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,17 +1,17 @@
|
|||||||
{
|
{
|
||||||
"name": "@certd/plugin-host",
|
"name": "@certd/plugin-host",
|
||||||
"version": "0.2.0",
|
"version": "0.2.1",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "src/index.js",
|
"main": "src/index.js",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@certd/api": "^0.2.0",
|
"@certd/api": "^0.2.1",
|
||||||
"dayjs": "^1.9.7",
|
"dayjs": "^1.9.7",
|
||||||
"lodash-es": "^4.17.20",
|
"lodash-es": "^4.17.20",
|
||||||
"ssh2": "^0.8.9"
|
"ssh2": "^0.8.9"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@certd/certd": "^0.2.0",
|
"@certd/certd": "^0.2.1",
|
||||||
"chai": "^4.2.0",
|
"chai": "^4.2.0",
|
||||||
"eslint": "^7.15.0",
|
"eslint": "^7.15.0",
|
||||||
"eslint-config-standard": "^16.0.2",
|
"eslint-config-standard": "^16.0.2",
|
||||||
@@ -22,5 +22,5 @@
|
|||||||
},
|
},
|
||||||
"author": "Greper",
|
"author": "Greper",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"gitHead": "4a421d5b142d453203c68ce6d1036e168ea2455b"
|
"gitHead": "5fbd7742665c0a949333d805153e9b6af91c0a71"
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
7
packages/plugins/plugin-tencent/.gitignore
vendored
Normal file
7
packages/plugins/plugin-tencent/.gitignore
vendored
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
.vscode/
|
||||||
|
node_modules/
|
||||||
|
npm-debug.log
|
||||||
|
yarn-error.log
|
||||||
|
yarn.lock
|
||||||
|
package-lock.json
|
||||||
|
/.idea/
|
||||||
3752
packages/plugins/plugin-tencent/package-lock.json
generated
3752
packages/plugins/plugin-tencent/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,18 +1,19 @@
|
|||||||
{
|
{
|
||||||
"name": "@certd/plugin-tencent",
|
"name": "@certd/plugin-tencent",
|
||||||
"version": "0.2.0",
|
"version": "0.2.1",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "src/index.js",
|
"main": "src/index.js",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@certd/api": "^0.2.0",
|
"@certd/api": "^0.2.1",
|
||||||
"dayjs": "^1.9.7",
|
"dayjs": "^1.9.7",
|
||||||
"kubernetes-client": "^9.0.0",
|
"kubernetes-client": "^9.0.0",
|
||||||
"lodash-es": "^4.17.20",
|
"lodash-es": "^4.17.20",
|
||||||
"tencentcloud-sdk-nodejs": "^4.0.44"
|
"tencentcloud-sdk-nodejs": "^4.0.44"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@certd/certd": "^0.2.0",
|
"@certd/certd": "^0.2.1",
|
||||||
|
"@certd/plugin-common": "^0.2.1",
|
||||||
"chai": "^4.2.0",
|
"chai": "^4.2.0",
|
||||||
"eslint": "^7.15.0",
|
"eslint": "^7.15.0",
|
||||||
"eslint-config-standard": "^16.0.2",
|
"eslint-config-standard": "^16.0.2",
|
||||||
@@ -23,5 +24,5 @@
|
|||||||
},
|
},
|
||||||
"author": "Greper",
|
"author": "Greper",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"gitHead": "4a421d5b142d453203c68ce6d1036e168ea2455b"
|
"gitHead": "5fbd7742665c0a949333d805153e9b6af91c0a71"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { AbstractTencentPlugin } from '../abstract-tencent.js'
|
import { AbstractTencentPlugin } from '../abstract-tencent.js'
|
||||||
import tencentcloud from 'tencentcloud-sdk-nodejs'
|
import tencentcloud from 'tencentcloud-sdk-nodejs'
|
||||||
import { K8sClient } from '../../utils/util.k8s.client.js'
|
import { K8sClient } from '@certd/plugin-common'
|
||||||
export class DeployCertToTencentTKEIngress extends AbstractTencentPlugin {
|
export class DeployCertToTencentTKEIngress extends AbstractTencentPlugin {
|
||||||
/**
|
/**
|
||||||
* 插件定义
|
* 插件定义
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
7
packages/ui/certd-server/.gitignore
vendored
Normal file
7
packages/ui/certd-server/.gitignore
vendored
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
.vscode/
|
||||||
|
node_modules/
|
||||||
|
npm-debug.log
|
||||||
|
yarn-error.log
|
||||||
|
yarn.lock
|
||||||
|
package-lock.json
|
||||||
|
/.idea/
|
||||||
5707
packages/ui/certd-server/package-lock.json
generated
5707
packages/ui/certd-server/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@certd/server",
|
"name": "@certd/server",
|
||||||
"version": "0.2.0",
|
"version": "0.2.1",
|
||||||
"private": false,
|
"private": false,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -10,11 +10,11 @@
|
|||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@certd/api": "^0.2.0",
|
"@certd/api": "^0.2.1",
|
||||||
"@certd/executor": "^0.2.0",
|
"@certd/executor": "^0.2.1",
|
||||||
"@certd/plugin-aliyun": "^0.2.0",
|
"@certd/plugin-aliyun": "^0.2.1",
|
||||||
"@certd/plugin-host": "^0.2.0",
|
"@certd/plugin-host": "^0.2.1",
|
||||||
"@certd/plugin-tencent": "^0.2.0",
|
"@certd/plugin-tencent": "^0.2.1",
|
||||||
"compressing": "^1.5.1",
|
"compressing": "^1.5.1",
|
||||||
"debug": "^4.1.1",
|
"debug": "^4.1.1",
|
||||||
"fs-extra": "^9.1.0",
|
"fs-extra": "^9.1.0",
|
||||||
@@ -39,5 +39,5 @@
|
|||||||
"eslint-plugin-promise": "^4.2.1",
|
"eslint-plugin-promise": "^4.2.1",
|
||||||
"nodemon": "^1.19.1"
|
"nodemon": "^1.19.1"
|
||||||
},
|
},
|
||||||
"gitHead": "4a421d5b142d453203c68ce6d1036e168ea2455b"
|
"gitHead": "5fbd7742665c0a949333d805153e9b6af91c0a71"
|
||||||
}
|
}
|
||||||
|
|||||||
7
packages/ui/certd-ui/.gitignore
vendored
Normal file
7
packages/ui/certd-ui/.gitignore
vendored
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
.vscode/
|
||||||
|
node_modules/
|
||||||
|
npm-debug.log
|
||||||
|
yarn-error.log
|
||||||
|
yarn.lock
|
||||||
|
package-lock.json
|
||||||
|
/.idea/
|
||||||
18410
packages/ui/certd-ui/package-lock.json
generated
18410
packages/ui/certd-ui/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@certd/certd-ui",
|
"name": "@certd/certd-ui",
|
||||||
"version": "0.2.0",
|
"version": "0.2.1",
|
||||||
"private": false,
|
"private": false,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vue-cli-service serve",
|
"dev": "vue-cli-service serve",
|
||||||
@@ -58,5 +58,5 @@
|
|||||||
"git add"
|
"git add"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"gitHead": "4a421d5b142d453203c68ce6d1036e168ea2455b"
|
"gitHead": "5fbd7742665c0a949333d805153e9b6af91c0a71"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user