mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-14 16:56:00 +02:00
サーバー管理コマンド (#15882)
* wip * Update cli.ts * Update cli.ts * wip * Update CHANGELOG.md * Delete cli.mjs
This commit is contained in:
23
packages/backend/src/cli/CommandModule.ts
Normal file
23
packages/backend/src/cli/CommandModule.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: syuilo and misskey-project
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { Module } from '@nestjs/common';
|
||||
import { CoreModule } from '@/core/CoreModule.js';
|
||||
import { GlobalModule } from '@/GlobalModule.js';
|
||||
import { CommandService } from './CommandService.js';
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
GlobalModule,
|
||||
CoreModule,
|
||||
],
|
||||
providers: [
|
||||
CommandService,
|
||||
],
|
||||
exports: [
|
||||
CommandService,
|
||||
],
|
||||
})
|
||||
export class CommandModule {}
|
||||
49
packages/backend/src/cli/CommandService.ts
Normal file
49
packages/backend/src/cli/CommandService.ts
Normal file
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: syuilo and misskey-project
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { Inject, Injectable } from '@nestjs/common';
|
||||
import type { Config } from '@/config.js';
|
||||
import { DI } from '@/di-symbols.js';
|
||||
import type Logger from '@/logger.js';
|
||||
import { bindThis } from '@/decorators.js';
|
||||
import { MetaService } from '@/core/MetaService.js';
|
||||
|
||||
@Injectable()
|
||||
export class CommandService {
|
||||
private logger: Logger;
|
||||
|
||||
constructor(
|
||||
@Inject(DI.config)
|
||||
private config: Config,
|
||||
|
||||
private metaService: MetaService,
|
||||
) {
|
||||
}
|
||||
|
||||
@bindThis
|
||||
public async ping() {
|
||||
console.log('pong');
|
||||
}
|
||||
|
||||
@bindThis
|
||||
public async resetCaptcha() {
|
||||
await this.metaService.update({
|
||||
enableHcaptcha: false,
|
||||
hcaptchaSiteKey: null,
|
||||
hcaptchaSecretKey: null,
|
||||
enableMcaptcha: false,
|
||||
mcaptchaSitekey: null,
|
||||
mcaptchaSecretKey: null,
|
||||
mcaptchaInstanceUrl: null,
|
||||
enableRecaptcha: false,
|
||||
recaptchaSiteKey: null,
|
||||
recaptchaSecretKey: null,
|
||||
enableTurnstile: false,
|
||||
turnstileSiteKey: null,
|
||||
turnstileSecretKey: null,
|
||||
enableTestcaptcha: false,
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user