summaryrefslogtreecommitdiff
path: root/packages/backend/src/cli/CommandService.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/backend/src/cli/CommandService.ts')
-rw-r--r--packages/backend/src/cli/CommandService.ts49
1 files changed, 49 insertions, 0 deletions
diff --git a/packages/backend/src/cli/CommandService.ts b/packages/backend/src/cli/CommandService.ts
new file mode 100644
index 0000000000..cdb2a9f382
--- /dev/null
+++ b/packages/backend/src/cli/CommandService.ts
@@ -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,
+ });
+ }
+}