mirror of
https://github.com/certd/certd.git
synced 2026-05-15 12:37:30 +08:00
chore: project fix
This commit is contained in:
@@ -157,9 +157,7 @@ export class DBBackupPlugin extends AbstractPlusTaskPlugin {
|
||||
async onInstance() {}
|
||||
|
||||
async execute(): Promise<void> {
|
||||
if (!this.isAdmin()) {
|
||||
throw new Error("只有管理员才能运行此任务");
|
||||
}
|
||||
this.checkAdmin();
|
||||
|
||||
this.logger.info("开始备份数据库");
|
||||
|
||||
|
||||
@@ -32,9 +32,7 @@ export class DeployToCertdPlugin extends AbstractTaskPlugin {
|
||||
cert!: CertInfo;
|
||||
async onInstance() { }
|
||||
async execute(): Promise<void> {
|
||||
if (!this.isAdmin()) {
|
||||
throw new Error('只有管理员才能运行此任务');
|
||||
}
|
||||
this.checkAdmin();
|
||||
|
||||
//部署证书
|
||||
let crtPath = "ssl/cert.crt";
|
||||
|
||||
@@ -17,9 +17,7 @@ import { httpsServer } from '../../modules/auto/https/server.js';
|
||||
export class RestartCertdPlugin extends AbstractTaskPlugin {
|
||||
async onInstance() {}
|
||||
async execute(): Promise<void> {
|
||||
if (!this.isAdmin()) {
|
||||
throw new Error('只有管理员才能运行此任务');
|
||||
}
|
||||
this.checkAdmin();
|
||||
this.logger.info('Certd https server 将在 3 秒后重启');
|
||||
await this.ctx.utils.sleep(3000);
|
||||
await httpsServer.restart();
|
||||
|
||||
@@ -47,9 +47,7 @@ export class CustomScriptPlugin extends AbstractTaskPlugin {
|
||||
|
||||
async onInstance() {}
|
||||
async execute(): Promise<void> {
|
||||
if (!this.isAdmin()) {
|
||||
throw new Error('只有管理员才能运行此任务');
|
||||
}
|
||||
this.checkAdmin();
|
||||
this.logger.info('执行自定义脚本:\n', this.script);
|
||||
const ctx: CustomScriptContext = {
|
||||
CertReader,
|
||||
|
||||
Reference in New Issue
Block a user