mirror of
https://github.com/certd/certd.git
synced 2026-04-24 04:17:25 +08:00
chore: suite first
This commit is contained in:
@@ -0,0 +1,77 @@
|
||||
CREATE TABLE "cd_product"
|
||||
(
|
||||
"id" integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
"icon" varchar(100),
|
||||
"title" varchar(100),
|
||||
"type" varchar(100),
|
||||
"max_domain_count" integer,
|
||||
"max_pipeline_count" integer,
|
||||
"max_deploy_count" integer,
|
||||
"deploy_count_period" varchar(100),
|
||||
"site_monitor" boolean,
|
||||
"expires_time" integer,
|
||||
"price" integer,
|
||||
"origin_price" integer,
|
||||
"intro" varchar(2048),
|
||||
"order" integer,
|
||||
"disabled" boolean NOT NULL DEFAULT (false),
|
||||
"create_time" datetime NOT NULL DEFAULT (CURRENT_TIMESTAMP),
|
||||
"update_time" datetime NOT NULL DEFAULT (CURRENT_TIMESTAMP)
|
||||
);
|
||||
|
||||
|
||||
|
||||
CREATE TABLE "cd_payment"
|
||||
(
|
||||
"id" integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
"type" varchar(100),
|
||||
"title" varchar(100),
|
||||
"setting" text,
|
||||
"order" integer,
|
||||
"disabled" boolean NOT NULL DEFAULT (false),
|
||||
"create_time" datetime NOT NULL DEFAULT (CURRENT_TIMESTAMP),
|
||||
"update_time" datetime NOT NULL DEFAULT (CURRENT_TIMESTAMP)
|
||||
);
|
||||
|
||||
|
||||
CREATE TABLE "cd_order"
|
||||
(
|
||||
"id" integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
"user_id" integer,
|
||||
"product_id" integer,
|
||||
"title" varchar(100),
|
||||
"count" integer,
|
||||
"price" integer,
|
||||
"amount" integer,
|
||||
"remark" varchar(100),
|
||||
"status" varchar(100),
|
||||
"pay_id" integer,
|
||||
"pay_time" integer,
|
||||
"pay_type" varchar(100),
|
||||
"pay_no" varchar(100),
|
||||
"create_time" datetime NOT NULL DEFAULT (CURRENT_TIMESTAMP),
|
||||
"update_time" datetime NOT NULL DEFAULT (CURRENT_TIMESTAMP)
|
||||
);
|
||||
|
||||
|
||||
|
||||
CREATE TABLE "cd_user_suite"
|
||||
(
|
||||
"id" integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
"user_id" integer,
|
||||
"product_id" integer,
|
||||
"icon" varchar(100),
|
||||
"title" varchar(100),
|
||||
"max_domain_count" integer,
|
||||
"max_pipeline_count" integer,
|
||||
"max_deploy_count" integer,
|
||||
"used_deploy_count" integer,
|
||||
"site_monitor" boolean,
|
||||
"expires_time" integer,
|
||||
"disabled" boolean NOT NULL DEFAULT (false),
|
||||
"create_time" datetime NOT NULL DEFAULT (CURRENT_TIMESTAMP),
|
||||
"update_time" datetime NOT NULL DEFAULT (CURRENT_TIMESTAMP)
|
||||
);
|
||||
|
||||
|
||||
|
||||
@@ -208,31 +208,37 @@ export class CopyCertToLocalPlugin extends AbstractTaskPlugin {
|
||||
const handle = async ({ reader, tmpCrtPath, tmpKeyPath, tmpDerPath, tmpPfxPath, tmpIcPath, tmpJksPath }) => {
|
||||
this.logger.info('复制到目标路径');
|
||||
if (crtPath) {
|
||||
crtPath = crtPath.trim();
|
||||
crtPath = crtPath.startsWith('/') ? crtPath : path.join(Constants.dataDir, crtPath);
|
||||
this.copyFile(tmpCrtPath, crtPath);
|
||||
this.hostCrtPath = crtPath;
|
||||
}
|
||||
if (keyPath) {
|
||||
keyPath = keyPath.trim();
|
||||
keyPath = keyPath.startsWith('/') ? keyPath : path.join(Constants.dataDir, keyPath);
|
||||
this.copyFile(tmpKeyPath, keyPath);
|
||||
this.hostKeyPath = keyPath;
|
||||
}
|
||||
if (icPath) {
|
||||
icPath = icPath.trim();
|
||||
icPath = icPath.startsWith('/') ? icPath : path.join(Constants.dataDir, icPath);
|
||||
this.copyFile(tmpIcPath, icPath);
|
||||
this.hostIcPath = icPath;
|
||||
}
|
||||
if (pfxPath) {
|
||||
pfxPath = icPath.trim();
|
||||
pfxPath = pfxPath.startsWith('/') ? pfxPath : path.join(Constants.dataDir, pfxPath);
|
||||
this.copyFile(tmpPfxPath, pfxPath);
|
||||
this.hostPfxPath = pfxPath;
|
||||
}
|
||||
if (derPath) {
|
||||
derPath = derPath.trim();
|
||||
derPath = derPath.startsWith('/') ? derPath : path.join(Constants.dataDir, derPath);
|
||||
this.copyFile(tmpDerPath, derPath);
|
||||
this.hostDerPath = derPath;
|
||||
}
|
||||
if (jksPath) {
|
||||
jksPath = jksPath.trim();
|
||||
jksPath = jksPath.startsWith('/') ? jksPath : path.join(Constants.dataDir, jksPath);
|
||||
this.copyFile(tmpJksPath, jksPath);
|
||||
this.hostJksPath = jksPath;
|
||||
|
||||
@@ -239,7 +239,8 @@ export class UploadCertToHostPlugin extends AbstractTaskPlugin {
|
||||
this.logger.info(`复制文件:${srcFile} => ${destFile}`);
|
||||
}
|
||||
async execute(): Promise<void> {
|
||||
const { crtPath, keyPath, cert, accessId } = this;
|
||||
const { cert, accessId } = this;
|
||||
let { crtPath, keyPath, icPath, pfxPath, derPath, jksPath } = this;
|
||||
const certReader = new CertReader(cert);
|
||||
|
||||
const handle = async (opts: CertReaderHandleContext) => {
|
||||
@@ -269,6 +270,7 @@ export class UploadCertToHostPlugin extends AbstractTaskPlugin {
|
||||
|
||||
const transports: any = [];
|
||||
if (crtPath) {
|
||||
crtPath = crtPath.trim();
|
||||
transports.push({
|
||||
localPath: tmpCrtPath,
|
||||
remotePath: crtPath,
|
||||
@@ -276,39 +278,44 @@ export class UploadCertToHostPlugin extends AbstractTaskPlugin {
|
||||
this.logger.info(`上传证书到主机:${crtPath}`);
|
||||
}
|
||||
if (keyPath) {
|
||||
keyPath = keyPath.trim();
|
||||
transports.push({
|
||||
localPath: tmpKeyPath,
|
||||
remotePath: keyPath,
|
||||
});
|
||||
this.logger.info(`上传私钥到主机:${keyPath}`);
|
||||
}
|
||||
if (this.icPath) {
|
||||
if (icPath) {
|
||||
icPath = icPath.trim();
|
||||
transports.push({
|
||||
localPath: tmpIcPath,
|
||||
remotePath: this.icPath,
|
||||
remotePath: icPath,
|
||||
});
|
||||
this.logger.info(`上传中间证书到主机:${this.icPath}`);
|
||||
this.logger.info(`上传中间证书到主机:${icPath}`);
|
||||
}
|
||||
if (this.pfxPath) {
|
||||
if (pfxPath) {
|
||||
pfxPath = pfxPath.trim();
|
||||
transports.push({
|
||||
localPath: tmpPfxPath,
|
||||
remotePath: this.pfxPath,
|
||||
remotePath: pfxPath,
|
||||
});
|
||||
this.logger.info(`上传PFX证书到主机:${this.pfxPath}`);
|
||||
this.logger.info(`上传PFX证书到主机:${pfxPath}`);
|
||||
}
|
||||
if (this.derPath) {
|
||||
if (derPath) {
|
||||
derPath = derPath.trim();
|
||||
transports.push({
|
||||
localPath: tmpDerPath,
|
||||
remotePath: this.derPath,
|
||||
remotePath: derPath,
|
||||
});
|
||||
this.logger.info(`上传DER证书到主机:${this.derPath}`);
|
||||
this.logger.info(`上传DER证书到主机:${derPath}`);
|
||||
}
|
||||
if (this.jksPath) {
|
||||
jksPath = jksPath.trim();
|
||||
transports.push({
|
||||
localPath: tmpJksPath,
|
||||
remotePath: this.jksPath,
|
||||
remotePath: jksPath,
|
||||
});
|
||||
this.logger.info(`上传jks证书到主机:${this.jksPath}`);
|
||||
this.logger.info(`上传jks证书到主机:${jksPath}`);
|
||||
}
|
||||
this.logger.info('开始上传文件到服务器');
|
||||
await sshClient.uploadFiles({
|
||||
@@ -320,10 +327,10 @@ export class UploadCertToHostPlugin extends AbstractTaskPlugin {
|
||||
//输出
|
||||
this.hostCrtPath = crtPath;
|
||||
this.hostKeyPath = keyPath;
|
||||
this.hostIcPath = this.icPath;
|
||||
this.hostPfxPath = this.pfxPath;
|
||||
this.hostDerPath = this.derPath;
|
||||
this.hostJksPath = this.jksPath;
|
||||
this.hostIcPath = icPath;
|
||||
this.hostPfxPath = pfxPath;
|
||||
this.hostDerPath = derPath;
|
||||
this.hostJksPath = jksPath;
|
||||
};
|
||||
|
||||
await certReader.readCertFile({
|
||||
|
||||
Reference in New Issue
Block a user