From b4b1204f77e9736af0a754115d98b2ab720c013f Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Tue, 6 Dec 2022 21:47:59 +0100 Subject: [PATCH 01/12] server: remove integration-related fields from meta --- .../1670359028055-removeIntegrations.js | 27 ++++++++++ packages/backend/src/models/entities/meta.ts | 51 ------------------- .../src/server/api/endpoints/admin/meta.ts | 45 ---------------- .../server/api/endpoints/admin/update-meta.ts | 45 ---------------- .../backend/src/server/api/endpoints/meta.ts | 31 ----------- 5 files changed, 27 insertions(+), 172 deletions(-) create mode 100644 packages/backend/migration/1670359028055-removeIntegrations.js diff --git a/packages/backend/migration/1670359028055-removeIntegrations.js b/packages/backend/migration/1670359028055-removeIntegrations.js new file mode 100644 index 000000000..fa8d3e4a0 --- /dev/null +++ b/packages/backend/migration/1670359028055-removeIntegrations.js @@ -0,0 +1,27 @@ +export class removeIntegrations1670359028055 { + name = 'removeIntegrations1670359028055' + + async up(queryRunner) { + await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "enableTwitterIntegration"`); + await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "twitterConsumerKey"`); + await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "twitterConsumerSecret"`); + await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "enableGithubIntegration"`); + await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "githubClientId"`); + await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "githubClientSecret"`); + await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "enableDiscordIntegration"`); + await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "discordClientId"`); + await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "discordClientSecret"`); + } + + async down(queryRunner) { + await queryRunner.query(`ALTER TABLE "meta" ADD "discordClientSecret" character varying(128)`); + await queryRunner.query(`ALTER TABLE "meta" ADD "discordClientId" character varying(128)`); + await queryRunner.query(`ALTER TABLE "meta" ADD "enableDiscordIntegration" boolean NOT NULL DEFAULT false`); + await queryRunner.query(`ALTER TABLE "meta" ADD "githubClientSecret" character varying(128)`); + await queryRunner.query(`ALTER TABLE "meta" ADD "githubClientId" character varying(128)`); + await queryRunner.query(`ALTER TABLE "meta" ADD "enableGithubIntegration" boolean NOT NULL DEFAULT false`); + await queryRunner.query(`ALTER TABLE "meta" ADD "twitterConsumerSecret" character varying(128)`); + await queryRunner.query(`ALTER TABLE "meta" ADD "twitterConsumerKey" character varying(128)`); + await queryRunner.query(`ALTER TABLE "meta" ADD "enableTwitterIntegration" boolean NOT NULL DEFAULT false`); + } +} diff --git a/packages/backend/src/models/entities/meta.ts b/packages/backend/src/models/entities/meta.ts index c812b882a..d30bfd67e 100644 --- a/packages/backend/src/models/entities/meta.ts +++ b/packages/backend/src/models/entities/meta.ts @@ -246,57 +246,6 @@ export class Meta { }) public swPrivateKey: string; - @Column('boolean', { - default: false, - }) - public enableTwitterIntegration: boolean; - - @Column('varchar', { - length: 128, - nullable: true, - }) - public twitterConsumerKey: string | null; - - @Column('varchar', { - length: 128, - nullable: true, - }) - public twitterConsumerSecret: string | null; - - @Column('boolean', { - default: false, - }) - public enableGithubIntegration: boolean; - - @Column('varchar', { - length: 128, - nullable: true, - }) - public githubClientId: string | null; - - @Column('varchar', { - length: 128, - nullable: true, - }) - public githubClientSecret: string | null; - - @Column('boolean', { - default: false, - }) - public enableDiscordIntegration: boolean; - - @Column('varchar', { - length: 128, - nullable: true, - }) - public discordClientId: string | null; - - @Column('varchar', { - length: 128, - nullable: true, - }) - public discordClientSecret: string | null; - @Column('enum', { enum: TranslationService, nullable: true, diff --git a/packages/backend/src/server/api/endpoints/admin/meta.ts b/packages/backend/src/server/api/endpoints/admin/meta.ts index ddd64f6b1..57e60f1c6 100644 --- a/packages/backend/src/server/api/endpoints/admin/meta.ts +++ b/packages/backend/src/server/api/endpoints/admin/meta.ts @@ -102,18 +102,6 @@ export const meta = { type: 'boolean', optional: false, nullable: false, }, - enableTwitterIntegration: { - type: 'boolean', - optional: false, nullable: false, - }, - enableGithubIntegration: { - type: 'boolean', - optional: false, nullable: false, - }, - enableDiscordIntegration: { - type: 'boolean', - optional: false, nullable: false, - }, translatorAvailable: { type: 'boolean', optional: false, nullable: false, @@ -163,30 +151,6 @@ export const meta = { optional: true, nullable: true, format: 'id', }, - twitterConsumerKey: { - type: 'string', - optional: true, nullable: true, - }, - twitterConsumerSecret: { - type: 'string', - optional: true, nullable: true, - }, - githubClientId: { - type: 'string', - optional: true, nullable: true, - }, - githubClientSecret: { - type: 'string', - optional: true, nullable: true, - }, - discordClientId: { - type: 'string', - optional: true, nullable: true, - }, - discordClientSecret: { - type: 'string', - optional: true, nullable: true, - }, summaryProxy: { type: 'string', optional: true, nullable: true, @@ -324,9 +288,6 @@ export default define(meta, paramDef, async (ps, me) => { defaultLightTheme: instance.defaultLightTheme, defaultDarkTheme: instance.defaultDarkTheme, enableEmail: instance.enableEmail, - enableTwitterIntegration: instance.enableTwitterIntegration, - enableGithubIntegration: instance.enableGithubIntegration, - enableDiscordIntegration: instance.enableDiscordIntegration, pinnedPages: instance.pinnedPages, pinnedClipId: instance.pinnedClipId, cacheRemoteFiles: instance.cacheRemoteFiles, @@ -338,12 +299,6 @@ export default define(meta, paramDef, async (ps, me) => { hcaptchaSecretKey: instance.hcaptchaSecretKey, recaptchaSecretKey: instance.recaptchaSecretKey, proxyAccountId: instance.proxyAccountId, - twitterConsumerKey: instance.twitterConsumerKey, - twitterConsumerSecret: instance.twitterConsumerSecret, - githubClientId: instance.githubClientId, - githubClientSecret: instance.githubClientSecret, - discordClientId: instance.discordClientId, - discordClientSecret: instance.discordClientSecret, summalyProxy: instance.summalyProxy, email: instance.email, smtpSecure: instance.smtpSecure, diff --git a/packages/backend/src/server/api/endpoints/admin/update-meta.ts b/packages/backend/src/server/api/endpoints/admin/update-meta.ts index c6913a675..965140018 100644 --- a/packages/backend/src/server/api/endpoints/admin/update-meta.ts +++ b/packages/backend/src/server/api/endpoints/admin/update-meta.ts @@ -60,15 +60,6 @@ export const paramDef = { deeplAuthKey: { type: 'string', nullable: true }, libreTranslateAuthKey: { type: 'string', nullable: true }, libreTranslateEndpoint: { type: 'string', nullable: true }, - enableTwitterIntegration: { type: 'boolean' }, - twitterConsumerKey: { type: 'string', nullable: true }, - twitterConsumerSecret: { type: 'string', nullable: true }, - enableGithubIntegration: { type: 'boolean' }, - githubClientId: { type: 'string', nullable: true }, - githubClientSecret: { type: 'string', nullable: true }, - enableDiscordIntegration: { type: 'boolean' }, - discordClientId: { type: 'string', nullable: true }, - discordClientSecret: { type: 'string', nullable: true }, enableEmail: { type: 'boolean' }, email: { type: 'string', nullable: true }, smtpSecure: { type: 'boolean' }, @@ -230,42 +221,6 @@ export default define(meta, paramDef, async (ps, me) => { set.summalyProxy = ps.summalyProxy; } - if (ps.enableTwitterIntegration !== undefined) { - set.enableTwitterIntegration = ps.enableTwitterIntegration; - } - - if (ps.twitterConsumerKey !== undefined) { - set.twitterConsumerKey = ps.twitterConsumerKey; - } - - if (ps.twitterConsumerSecret !== undefined) { - set.twitterConsumerSecret = ps.twitterConsumerSecret; - } - - if (ps.enableGithubIntegration !== undefined) { - set.enableGithubIntegration = ps.enableGithubIntegration; - } - - if (ps.githubClientId !== undefined) { - set.githubClientId = ps.githubClientId; - } - - if (ps.githubClientSecret !== undefined) { - set.githubClientSecret = ps.githubClientSecret; - } - - if (ps.enableDiscordIntegration !== undefined) { - set.enableDiscordIntegration = ps.enableDiscordIntegration; - } - - if (ps.discordClientId !== undefined) { - set.discordClientId = ps.discordClientId; - } - - if (ps.discordClientSecret !== undefined) { - set.discordClientSecret = ps.discordClientSecret; - } - if (ps.enableEmail !== undefined) { set.enableEmail = ps.enableEmail; } diff --git a/packages/backend/src/server/api/endpoints/meta.ts b/packages/backend/src/server/api/endpoints/meta.ts index 569b8f56b..a36178c26 100644 --- a/packages/backend/src/server/api/endpoints/meta.ts +++ b/packages/backend/src/server/api/endpoints/meta.ts @@ -170,18 +170,6 @@ export const meta = { type: 'boolean', optional: false, nullable: false, }, - enableTwitterIntegration: { - type: 'boolean', - optional: false, nullable: false, - }, - enableGithubIntegration: { - type: 'boolean', - optional: false, nullable: false, - }, - enableDiscordIntegration: { - type: 'boolean', - optional: false, nullable: false, - }, translatorAvailable: { type: 'boolean', optional: false, nullable: false, @@ -222,18 +210,6 @@ export const meta = { type: 'boolean', optional: false, nullable: false, }, - twitter: { - type: 'boolean', - optional: false, nullable: false, - }, - github: { - type: 'boolean', - optional: false, nullable: false, - }, - discord: { - type: 'boolean', - optional: false, nullable: false, - }, serviceWorker: { type: 'boolean', optional: true, nullable: false, @@ -314,10 +290,6 @@ export default define(meta, paramDef, async (ps, me) => { defaultDarkTheme: instance.defaultDarkTheme, enableEmail: instance.enableEmail, - enableTwitterIntegration: instance.enableTwitterIntegration, - enableGithubIntegration: instance.enableGithubIntegration, - enableDiscordIntegration: instance.enableDiscordIntegration, - translatorAvailable: translatorAvailable(instance), pinnedPages: instance.pinnedPages, @@ -338,9 +310,6 @@ export default define(meta, paramDef, async (ps, me) => { hcaptcha: instance.enableHcaptcha, recaptcha: instance.enableRecaptcha, objectStorage: instance.useObjectStorage, - twitter: instance.enableTwitterIntegration, - github: instance.enableGithubIntegration, - discord: instance.enableDiscordIntegration, serviceWorker: true, miauth: true, }, From 5d328729991606cc9ed72d785d6ad362f786a0e0 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Tue, 6 Dec 2022 21:48:31 +0100 Subject: [PATCH 02/12] server: remove integration API routes --- packages/backend/src/server/api/index.ts | 7 - .../backend/src/server/api/service/discord.ts | 294 ------------------ .../backend/src/server/api/service/github.ts | 265 ---------------- .../backend/src/server/api/service/twitter.ts | 207 ------------ 4 files changed, 773 deletions(-) delete mode 100644 packages/backend/src/server/api/service/discord.ts delete mode 100644 packages/backend/src/server/api/service/github.ts delete mode 100644 packages/backend/src/server/api/service/twitter.ts diff --git a/packages/backend/src/server/api/index.ts b/packages/backend/src/server/api/index.ts index 456f5ff11..2d2680e55 100644 --- a/packages/backend/src/server/api/index.ts +++ b/packages/backend/src/server/api/index.ts @@ -16,9 +16,6 @@ import signup from './private/signup.js'; import signin from './private/signin.js'; import signupPending from './private/signup-pending.js'; import { oauth } from './common/oauth.js'; -import discord from './service/discord.js'; -import github from './service/github.js'; -import twitter from './service/twitter.js'; // Init app const app = new Koa(); @@ -82,10 +79,6 @@ router.post('/signup', signup); router.post('/signin', signin); router.post('/signup-pending', signupPending); -router.use(discord.routes()); -router.use(github.routes()); -router.use(twitter.routes()); - router.get('/v1/instance/peers', async ctx => { const instances = await Instances.find({ select: ['host'], diff --git a/packages/backend/src/server/api/service/discord.ts b/packages/backend/src/server/api/service/discord.ts deleted file mode 100644 index c9b8e03b9..000000000 --- a/packages/backend/src/server/api/service/discord.ts +++ /dev/null @@ -1,294 +0,0 @@ -import Koa from 'koa'; -import Router from '@koa/router'; -import { OAuth2 } from 'oauth'; -import { v4 as uuid } from 'uuid'; -import { IsNull } from 'typeorm'; -import { getJson } from '@/misc/fetch.js'; -import config from '@/config/index.js'; -import { publishMainStream } from '@/services/stream.js'; -import { fetchMeta } from '@/misc/fetch-meta.js'; -import { Users, UserProfiles } from '@/models/index.js'; -import { ILocalUser } from '@/models/entities/user.js'; -import { redisClient } from '@/db/redis.js'; -import { I18n } from '@/misc/i18n.js'; -import signin from '../common/signin.js'; - -function getUserToken(ctx: Koa.BaseContext): string | null { - return ((ctx.headers['cookie'] || '').match(/igi=(\w+)/) || [null, null])[1]; -} - -function compareOrigin(ctx: Koa.BaseContext): boolean { - function normalizeUrl(url?: string): string { - return url ? url.endsWith('/') ? url.substr(0, url.length - 1) : url : ''; - } - - const referer = ctx.headers['referer']; - - return (normalizeUrl(referer) === normalizeUrl(config.url)); -} - -// Init router -const router = new Router(); - -router.get('/disconnect/discord', async ctx => { - if (!compareOrigin(ctx)) { - ctx.throw(400, 'invalid origin'); - return; - } - - const userToken = getUserToken(ctx); - if (!userToken) { - ctx.throw(400, 'signin required'); - return; - } - - const user = await Users.findOneByOrFail({ - host: IsNull(), - token: userToken, - }); - - const profile = await UserProfiles.findOneByOrFail({ userId: user.id }); - const i18n = new I18n(profile.lang ?? 'en-US'); - - delete profile.integrations.discord; - - await UserProfiles.update(user.id, { - integrations: profile.integrations, - }); - - ctx.body = i18n.t('_services._discord.disconnected'); - - // Publish i updated event - publishMainStream(user.id, 'meUpdated', await Users.pack(user, user, { - detail: true, - includeSecrets: true, - })); -}); - -async function getOAuth2() { - const meta = await fetchMeta(true); - - if (meta.enableDiscordIntegration) { - return new OAuth2( - meta.discordClientId!, - meta.discordClientSecret!, - 'https://discord.com/', - 'api/oauth2/authorize', - 'api/oauth2/token'); - } else { - return null; - } -} - -router.get('/connect/discord', async ctx => { - if (!compareOrigin(ctx)) { - ctx.throw(400, 'invalid origin'); - return; - } - - const userToken = getUserToken(ctx); - if (!userToken) { - ctx.throw(400, 'signin required'); - return; - } - - const params = { - redirect_uri: `${config.url}/api/dc/cb`, - scope: ['identify'], - state: uuid(), - response_type: 'code', - }; - - redisClient.set(userToken, JSON.stringify(params)); - - const oauth2 = await getOAuth2(); - ctx.redirect(oauth2!.getAuthorizeUrl(params)); -}); - -router.get('/signin/discord', async ctx => { - const sessid = uuid(); - - const params = { - redirect_uri: `${config.url}/api/dc/cb`, - scope: ['identify'], - state: uuid(), - response_type: 'code', - }; - - ctx.cookies.set('signin_with_discord_sid', sessid, { - path: '/', - secure: config.url.startsWith('https'), - httpOnly: true, - }); - - redisClient.set(sessid, JSON.stringify(params)); - - const oauth2 = await getOAuth2(); - ctx.redirect(oauth2!.getAuthorizeUrl(params)); -}); - -router.get('/dc/cb', async ctx => { - const userToken = getUserToken(ctx); - - const oauth2 = await getOAuth2(); - - if (!userToken) { - const sessid = ctx.cookies.get('signin_with_discord_sid'); - - if (!sessid) { - ctx.throw(400, 'invalid session'); - return; - } - - const code = ctx.query.code; - - if (!code || typeof code !== 'string') { - ctx.throw(400, 'invalid session'); - return; - } - - const { redirect_uri, state } = await new Promise((res, rej) => { - redisClient.get(sessid, async (_, state) => { - res(JSON.parse(state)); - }); - }); - - if (ctx.query.state !== state) { - ctx.throw(400, 'invalid session'); - return; - } - - const { accessToken, refreshToken, expiresDate } = await new Promise((res, rej) => - oauth2!.getOAuthAccessToken(code, { - grant_type: 'authorization_code', - redirect_uri, - }, (err, accessToken, refreshToken, result) => { - if (err) { - rej(err); - } else if (result.error) { - rej(result.error); - } else { - res({ - accessToken, - refreshToken, - expiresDate: Date.now() + Number(result.expires_in) * 1000, - }); - } - })); - - const { id, username, discriminator } = (await getJson('https://discord.com/api/users/@me', '*/*', 10 * 1000, { - 'Authorization': `Bearer ${accessToken}`, - })) as Record; - - if (typeof id !== 'string' || typeof username !== 'string' || typeof discriminator !== 'string') { - ctx.throw(400, 'invalid session'); - return; - } - - const profile = await UserProfiles.createQueryBuilder() - .where('"integrations"->\'discord\'->>\'id\' = :id', { id }) - .andWhere('"userHost" IS NULL') - .getOne(); - - if (profile == null) { - ctx.throw(404, `There were no FoundKey accounts linked to @${username}#${discriminator}...`); - return; - } - - await UserProfiles.update(profile.userId, { - integrations: { - ...profile.integrations, - discord: { - id, - accessToken, - refreshToken, - expiresDate, - username, - discriminator, - }, - }, - }); - - signin(ctx, await Users.findOneBy({ id: profile.userId }) as ILocalUser, true); - } else { - const code = ctx.query.code; - - if (!code || typeof code !== 'string') { - ctx.throw(400, 'invalid session'); - return; - } - - const { redirect_uri, state } = await new Promise((res, rej) => { - redisClient.get(userToken, async (_, state) => { - res(JSON.parse(state)); - }); - }); - - if (ctx.query.state !== state) { - ctx.throw(400, 'invalid session'); - return; - } - - const { accessToken, refreshToken, expiresDate } = await new Promise((res, rej) => - oauth2!.getOAuthAccessToken(code, { - grant_type: 'authorization_code', - redirect_uri, - }, (err, accessToken, refreshToken, result) => { - if (err) { - rej(err); - } else if (result.error) { - rej(result.error); - } else { - res({ - accessToken, - refreshToken, - expiresDate: Date.now() + Number(result.expires_in) * 1000, - }); - } - })); - - const { id, username, discriminator } = (await getJson('https://discord.com/api/users/@me', '*/*', 10 * 1000, { - 'Authorization': `Bearer ${accessToken}`, - })) as Record; - if (typeof id !== 'string' || typeof username !== 'string' || typeof discriminator !== 'string') { - ctx.throw(400, 'invalid session'); - return; - } - - const user = await Users.findOneByOrFail({ - host: IsNull(), - token: userToken, - }); - - const profile = await UserProfiles.findOneByOrFail({ userId: user.id }); - const i18n = new I18n(profile.lang ?? 'en-US'); - - await UserProfiles.update(user.id, { - integrations: { - ...profile.integrations, - discord: { - accessToken, - refreshToken, - expiresDate, - id, - username, - discriminator, - }, - }, - }); - - ctx.body = i18n.t('_services._discord.connected', { - username, - discriminator, - mkUsername: user.username, - }); - - // Publish i updated event - publishMainStream(user.id, 'meUpdated', await Users.pack(user, user, { - detail: true, - includeSecrets: true, - })); - } -}); - -export default router; diff --git a/packages/backend/src/server/api/service/github.ts b/packages/backend/src/server/api/service/github.ts deleted file mode 100644 index 5e78130e7..000000000 --- a/packages/backend/src/server/api/service/github.ts +++ /dev/null @@ -1,265 +0,0 @@ -import Koa from 'koa'; -import Router from '@koa/router'; -import { OAuth2 } from 'oauth'; -import { v4 as uuid } from 'uuid'; -import { IsNull } from 'typeorm'; -import { getJson } from '@/misc/fetch.js'; -import config from '@/config/index.js'; -import { publishMainStream } from '@/services/stream.js'; -import { fetchMeta } from '@/misc/fetch-meta.js'; -import { Users, UserProfiles } from '@/models/index.js'; -import { ILocalUser } from '@/models/entities/user.js'; -import { redisClient } from '@/db/redis.js'; -import signin from '../common/signin.js'; -import { I18n } from '@/misc/i18n.js'; - -function getUserToken(ctx: Koa.BaseContext): string | null { - return ((ctx.headers['cookie'] || '').match(/igi=(\w+)/) || [null, null])[1]; -} - -function compareOrigin(ctx: Koa.BaseContext): boolean { - function normalizeUrl(url?: string): string { - return url ? url.endsWith('/') ? url.substr(0, url.length - 1) : url : ''; - } - - const referer = ctx.headers['referer']; - - return (normalizeUrl(referer) === normalizeUrl(config.url)); -} - -// Init router -const router = new Router(); - -router.get('/disconnect/github', async ctx => { - if (!compareOrigin(ctx)) { - ctx.throw(400, 'invalid origin'); - return; - } - - const userToken = getUserToken(ctx); - if (!userToken) { - ctx.throw(400, 'signin required'); - return; - } - - const user = await Users.findOneByOrFail({ - host: IsNull(), - token: userToken, - }); - - const profile = await UserProfiles.findOneByOrFail({ userId: user.id }); - const i18n = new I18n(profile.lang ?? 'en-US'); - - delete profile.integrations.github; - - await UserProfiles.update(user.id, { - integrations: profile.integrations, - }); - - ctx.body = i18n.t('_services._github.disconnected'); - - // Publish i updated event - publishMainStream(user.id, 'meUpdated', await Users.pack(user, user, { - detail: true, - includeSecrets: true, - })); -}); - -async function getOath2() { - const meta = await fetchMeta(true); - - if (meta.enableGithubIntegration && meta.githubClientId && meta.githubClientSecret) { - return new OAuth2( - meta.githubClientId, - meta.githubClientSecret, - 'https://github.com/', - 'login/oauth/authorize', - 'login/oauth/access_token'); - } else { - return null; - } -} - -router.get('/connect/github', async ctx => { - if (!compareOrigin(ctx)) { - ctx.throw(400, 'invalid origin'); - return; - } - - const userToken = getUserToken(ctx); - if (!userToken) { - ctx.throw(400, 'signin required'); - return; - } - - const params = { - redirect_uri: `${config.url}/api/gh/cb`, - scope: ['read:user'], - state: uuid(), - }; - - redisClient.set(userToken, JSON.stringify(params)); - - const oauth2 = await getOath2(); - ctx.redirect(oauth2!.getAuthorizeUrl(params)); -}); - -router.get('/signin/github', async ctx => { - const sessid = uuid(); - - const params = { - redirect_uri: `${config.url}/api/gh/cb`, - scope: ['read:user'], - state: uuid(), - }; - - ctx.cookies.set('signin_with_github_sid', sessid, { - path: '/', - secure: config.url.startsWith('https'), - httpOnly: true, - }); - - redisClient.set(sessid, JSON.stringify(params)); - - const oauth2 = await getOath2(); - ctx.redirect(oauth2!.getAuthorizeUrl(params)); -}); - -router.get('/gh/cb', async ctx => { - const userToken = getUserToken(ctx); - - const oauth2 = await getOath2(); - - if (!userToken) { - const sessid = ctx.cookies.get('signin_with_github_sid'); - - if (!sessid) { - ctx.throw(400, 'invalid session'); - return; - } - - const code = ctx.query.code; - - if (!code || typeof code !== 'string') { - ctx.throw(400, 'invalid session'); - return; - } - - const { redirect_uri, state } = await new Promise((res, rej) => { - redisClient.get(sessid, async (_, state) => { - res(JSON.parse(state)); - }); - }); - - if (ctx.query.state !== state) { - ctx.throw(400, 'invalid session'); - return; - } - - const { accessToken } = await new Promise((res, rej) => - oauth2!.getOAuthAccessToken(code, { - redirect_uri, - }, (err, accessToken, refresh, result) => { - if (err) { - rej(err); - } else if (result.error) { - rej(result.error); - } else { - res({ accessToken }); - } - })); - - const { login, id } = (await getJson('https://api.github.com/user', 'application/vnd.github.v3+json', 10 * 1000, { - 'Authorization': `bearer ${accessToken}`, - })) as Record; - if (typeof login !== 'string' || typeof id !== 'string') { - ctx.throw(400, 'invalid session'); - return; - } - - const link = await UserProfiles.createQueryBuilder() - .where('"integrations"->\'github\'->>\'id\' = :id', { id }) - .andWhere('"userHost" IS NULL') - .getOne(); - - if (link == null) { - ctx.throw(404, `There were no FoundKey accounts linked to @${login}...`); - return; - } - - signin(ctx, await Users.findOneBy({ id: link.userId }) as ILocalUser, true); - } else { - const code = ctx.query.code; - - if (!code || typeof code !== 'string') { - ctx.throw(400, 'invalid session'); - return; - } - - const { redirect_uri, state } = await new Promise((res, rej) => { - redisClient.get(userToken, async (_, state) => { - res(JSON.parse(state)); - }); - }); - - if (ctx.query.state !== state) { - ctx.throw(400, 'invalid session'); - return; - } - - const { accessToken } = await new Promise((res, rej) => - oauth2!.getOAuthAccessToken( - code, - { redirect_uri }, - (err, accessToken, refresh, result) => { - if (err) { - rej(err); - } else if (result.error) { - rej(result.error); - } else { - res({ accessToken }); - } - })); - - const { login, id } = (await getJson('https://api.github.com/user', 'application/vnd.github.v3+json', 10 * 1000, { - 'Authorization': `bearer ${accessToken}`, - })) as Record; - - if (typeof login !== 'string' || typeof id !== 'string') { - ctx.throw(400, 'invalid session'); - return; - } - - const user = await Users.findOneByOrFail({ - host: IsNull(), - token: userToken, - }); - - const profile = await UserProfiles.findOneByOrFail({ userId: user.id }); - const i18n = new I18n(profile.lang ?? 'en-US'); - - await UserProfiles.update(user.id, { - integrations: { - ...profile.integrations, - github: { - accessToken, - id, - login, - }, - }, - }); - - ctx.body = i18n.t('_services._github.connected', { - login, - userName: user.username, - }); - - // Publish i updated event - publishMainStream(user.id, 'meUpdated', await Users.pack(user, user, { - detail: true, - includeSecrets: true, - })); - } -}); - -export default router; diff --git a/packages/backend/src/server/api/service/twitter.ts b/packages/backend/src/server/api/service/twitter.ts deleted file mode 100644 index 59da0f6ba..000000000 --- a/packages/backend/src/server/api/service/twitter.ts +++ /dev/null @@ -1,207 +0,0 @@ -import Koa from 'koa'; -import Router from '@koa/router'; -import { v4 as uuid } from 'uuid'; -import autwh from 'autwh'; -import { IsNull } from 'typeorm'; -import { publishMainStream } from '@/services/stream.js'; -import config from '@/config/index.js'; -import { fetchMeta } from '@/misc/fetch-meta.js'; -import { Users, UserProfiles } from '@/models/index.js'; -import { ILocalUser } from '@/models/entities/user.js'; -import { redisClient } from '@/db/redis.js'; -import signin from '../common/signin.js'; -import { I18n } from '@/misc/i18n.js'; - -function getUserToken(ctx: Koa.BaseContext): string | null { - return ((ctx.headers['cookie'] || '').match(/igi=(\w+)/) || [null, null])[1]; -} - -function compareOrigin(ctx: Koa.BaseContext): boolean { - function normalizeUrl(url?: string): string { - return url == null ? '' : url.endsWith('/') ? url.substr(0, url.length - 1) : url; - } - - const referer = ctx.headers['referer']; - - return (normalizeUrl(referer) === normalizeUrl(config.url)); -} - -// Init router -const router = new Router(); - -router.get('/disconnect/twitter', async ctx => { - if (!compareOrigin(ctx)) { - ctx.throw(400, 'invalid origin'); - return; - } - - const userToken = getUserToken(ctx); - if (userToken == null) { - ctx.throw(400, 'signin required'); - return; - } - - const user = await Users.findOneByOrFail({ - host: IsNull(), - token: userToken, - }); - - const profile = await UserProfiles.findOneByOrFail({ userId: user.id }); - const i18n = new I18n(profile.lang ?? 'en-US'); - - delete profile.integrations.twitter; - - await UserProfiles.update(user.id, { - integrations: profile.integrations, - }); - - ctx.body = i18n.t('_services._twitter.disconnected'); - - // Publish i updated event - publishMainStream(user.id, 'meUpdated', await Users.pack(user, user, { - detail: true, - includeSecrets: true, - })); -}); - -async function getTwAuth() { - const meta = await fetchMeta(true); - - if (meta.enableTwitterIntegration && meta.twitterConsumerKey && meta.twitterConsumerSecret) { - return autwh({ - consumerKey: meta.twitterConsumerKey, - consumerSecret: meta.twitterConsumerSecret, - callbackUrl: `${config.url}/api/tw/cb`, - }); - } else { - return null; - } -} - -router.get('/connect/twitter', async ctx => { - if (!compareOrigin(ctx)) { - ctx.throw(400, 'invalid origin'); - return; - } - - const userToken = getUserToken(ctx); - if (userToken == null) { - ctx.throw(400, 'signin required'); - return; - } - - const twAuth = await getTwAuth(); - const twCtx = await twAuth!.begin(); - redisClient.set(userToken, JSON.stringify(twCtx)); - ctx.redirect(twCtx.url); -}); - -router.get('/signin/twitter', async ctx => { - const twAuth = await getTwAuth(); - const twCtx = await twAuth!.begin(); - - const sessid = uuid(); - - redisClient.set(sessid, JSON.stringify(twCtx)); - - ctx.cookies.set('signin_with_twitter_sid', sessid, { - path: '/', - secure: config.url.startsWith('https'), - httpOnly: true, - }); - - ctx.redirect(twCtx.url); -}); - -router.get('/tw/cb', async ctx => { - const userToken = getUserToken(ctx); - - const twAuth = await getTwAuth(); - - if (userToken == null) { - const sessid = ctx.cookies.get('signin_with_twitter_sid'); - - if (sessid == null) { - ctx.throw(400, 'invalid session'); - return; - } - - const get = new Promise((res, rej) => { - redisClient.get(sessid, async (_, twCtx) => { - res(twCtx); - }); - }); - - const twCtx = await get; - - const verifier = ctx.query.oauth_verifier; - if (!verifier || typeof verifier !== 'string') { - ctx.throw(400, 'invalid session'); - return; - } - - const result = await twAuth!.done(JSON.parse(twCtx), verifier); - - const link = await UserProfiles.createQueryBuilder() - .where('"integrations"->\'twitter\'->>\'userId\' = :id', { id: result.userId }) - .andWhere('"userHost" IS NULL') - .getOne(); - - if (link == null) { - ctx.throw(404, `There were no FoundKey accounts linked to @${result.screenName}...`); - return; - } - - signin(ctx, await Users.findOneBy({ id: link.userId }) as ILocalUser, true); - } else { - const verifier = ctx.query.oauth_verifier; - - if (!verifier || typeof verifier !== 'string') { - ctx.throw(400, 'invalid session'); - return; - } - - const get = new Promise((res, rej) => { - redisClient.get(userToken, async (_, twCtx) => { - res(twCtx); - }); - }); - - const twCtx = await get; - - const result = await twAuth!.done(JSON.parse(twCtx), verifier); - - const user = await Users.findOneByOrFail({ - host: IsNull(), - token: userToken, - }); - - const profile = await UserProfiles.findOneByOrFail({ userId: user.id }); - const i18n = new I18n(profile.lang ?? 'en-US'); - - await UserProfiles.update(user.id, { - integrations: { - ...profile.integrations, - twitter: { - accessToken: result.accessToken, - accessTokenSecret: result.accessTokenSecret, - userId: result.userId, - screenName: result.screenName, - }, - }, - }); - - ctx.body = i18n.t('_services._twitter.connected', { - twitterUserName: result.screenName, - userName: user.username, - }); - - // Publish i updated event - publishMainStream(user.id, 'meUpdated', await Users.pack(user, user, { - detail: true, - includeSecrets: true, - })); - } -}); - -export default router; From 4cc5b734e774ff209faf94ffc1001934dc98cf91 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Tue, 6 Dec 2022 21:49:19 +0100 Subject: [PATCH 03/12] activitypub: remove integration fields from person and nodeinfo --- .../src/remote/activitypub/models/person.ts | 43 ++----------------- packages/backend/src/server/nodeinfo.ts | 3 -- 2 files changed, 4 insertions(+), 42 deletions(-) diff --git a/packages/backend/src/remote/activitypub/models/person.ts b/packages/backend/src/remote/activitypub/models/person.ts index 13107f24f..503547972 100644 --- a/packages/backend/src/remote/activitypub/models/person.ts +++ b/packages/backend/src/remote/activitypub/models/person.ts @@ -401,37 +401,6 @@ export async function resolvePerson(uri: string, resolver: Resolver): Promise any - } = { - 'misskey:authentication:twitter': (userId, screenName) => ({ userId, screenName }), - 'misskey:authentication:github': (id, login) => ({ id, login }), - 'misskey:authentication:discord': (id, name) => $discord(id, name), - }; - -const $discord = (id: string, name: string) => { - if (typeof name !== 'string') { - return { id, username: 'unknown', discriminator: '0000' }; - } else { - const [username, discriminator] = name.split('#'); - return { id, username, discriminator }; - } -}; - -function addService(target: { [x: string]: any }, source: IApPropertyValue) { - const service = services[source.name]; - - if (typeof source.value !== 'string') { - source.value = 'unknown'; - } - - const [id, username] = source.value.split('@'); - - if (service) { - target[source.name.split(':')[2]] = service(id, username); - } -} - export function analyzeAttachments(attachments: IObject | IObject[] | undefined) { const fields: { name: string, @@ -441,14 +410,10 @@ export function analyzeAttachments(attachments: IObject | IObject[] | undefined) if (Array.isArray(attachments)) { for (const attachment of attachments.filter(isPropertyValue)) { - if (isPropertyValue(attachment.identifier)) { - addService(services, attachment.identifier); - } else { - fields.push({ - name: attachment.name, - value: fromHtml(attachment.value), - }); - } + fields.push({ + name: attachment.name, + value: fromHtml(attachment.value), + }); } } diff --git a/packages/backend/src/server/nodeinfo.ts b/packages/backend/src/server/nodeinfo.ts index b06e01f90..eb1769722 100644 --- a/packages/backend/src/server/nodeinfo.ts +++ b/packages/backend/src/server/nodeinfo.ts @@ -97,9 +97,6 @@ const nodeinfo2 = async (): Promise => { enableHcaptcha: meta.enableHcaptcha, enableRecaptcha: meta.enableRecaptcha, maxNoteTextLength: config.maxNoteTextLength, - enableTwitterIntegration: meta.enableTwitterIntegration, - enableGithubIntegration: meta.enableGithubIntegration, - enableDiscordIntegration: meta.enableDiscordIntegration, enableEmail: meta.enableEmail, proxyAccountName: proxyAccount?.username ?? null, themeColor: meta.themeColor || '#86b300', From 95384d0bb28e7a0d50cd789ff0869fa318cca5c2 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Tue, 6 Dec 2022 21:50:20 +0100 Subject: [PATCH 04/12] client: remove integration admin settings --- packages/client/src/pages/admin/index.vue | 6 -- .../src/pages/admin/integrations.discord.vue | 59 ------------------- .../src/pages/admin/integrations.github.vue | 59 ------------------- .../src/pages/admin/integrations.twitter.vue | 59 ------------------- .../client/src/pages/admin/integrations.vue | 54 ----------------- 5 files changed, 237 deletions(-) delete mode 100644 packages/client/src/pages/admin/integrations.discord.vue delete mode 100644 packages/client/src/pages/admin/integrations.github.vue delete mode 100644 packages/client/src/pages/admin/integrations.twitter.vue delete mode 100644 packages/client/src/pages/admin/integrations.vue diff --git a/packages/client/src/pages/admin/index.vue b/packages/client/src/pages/admin/index.vue index e45ac1772..289f4fd29 100644 --- a/packages/client/src/pages/admin/index.vue +++ b/packages/client/src/pages/admin/index.vue @@ -157,11 +157,6 @@ const menuDef = $computed(() => [{ text: i18n.ts.relays, to: '/admin/relays', active: props.initialPage === 'relays', - }, { - icon: 'fas fa-share-alt', - text: i18n.ts.integration, - to: '/admin/integrations', - active: props.initialPage === 'integrations', }, { icon: 'fas fa-ban', text: i18n.ts.instanceBlocking, @@ -204,7 +199,6 @@ const component = $computed(() => { case 'object-storage': return defineAsyncComponent(() => import('./object-storage.vue')); case 'security': return defineAsyncComponent(() => import('./security.vue')); case 'relays': return defineAsyncComponent(() => import('./relays.vue')); - case 'integrations': return defineAsyncComponent(() => import('./integrations.vue')); case 'instance-block': return defineAsyncComponent(() => import('./instance-block.vue')); case 'proxy-account': return defineAsyncComponent(() => import('./proxy-account.vue')); case 'translation-settings': return defineAsyncComponent(() => import('./translation-settings.vue')); diff --git a/packages/client/src/pages/admin/integrations.discord.vue b/packages/client/src/pages/admin/integrations.discord.vue deleted file mode 100644 index a6bfcf05a..000000000 --- a/packages/client/src/pages/admin/integrations.discord.vue +++ /dev/null @@ -1,59 +0,0 @@ - - - diff --git a/packages/client/src/pages/admin/integrations.github.vue b/packages/client/src/pages/admin/integrations.github.vue deleted file mode 100644 index d523007bd..000000000 --- a/packages/client/src/pages/admin/integrations.github.vue +++ /dev/null @@ -1,59 +0,0 @@ - - - diff --git a/packages/client/src/pages/admin/integrations.twitter.vue b/packages/client/src/pages/admin/integrations.twitter.vue deleted file mode 100644 index c8044f67f..000000000 --- a/packages/client/src/pages/admin/integrations.twitter.vue +++ /dev/null @@ -1,59 +0,0 @@ - - - diff --git a/packages/client/src/pages/admin/integrations.vue b/packages/client/src/pages/admin/integrations.vue deleted file mode 100644 index cb27a54e2..000000000 --- a/packages/client/src/pages/admin/integrations.vue +++ /dev/null @@ -1,54 +0,0 @@ - - - From 547a1f81d4a629bb6c53420e14578cd1af631a73 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Tue, 6 Dec 2022 21:50:34 +0100 Subject: [PATCH 05/12] client: remove integration settings --- packages/client/src/pages/settings/index.vue | 1 - .../client/src/pages/settings/integration.vue | 95 ------------------- 2 files changed, 96 deletions(-) delete mode 100644 packages/client/src/pages/settings/integration.vue diff --git a/packages/client/src/pages/settings/index.vue b/packages/client/src/pages/settings/index.vue index b6a60a4b0..280f5d210 100644 --- a/packages/client/src/pages/settings/index.vue +++ b/packages/client/src/pages/settings/index.vue @@ -200,7 +200,6 @@ const component = computed(() => { case 'mute-block': return defineAsyncComponent(() => import('./mute-block.vue')); case 'word-mute': return defineAsyncComponent(() => import('./word-mute.vue')); case 'instance-mute': return defineAsyncComponent(() => import('./instance-mute.vue')); - case 'integration': return defineAsyncComponent(() => import('./integration.vue')); case 'security': return defineAsyncComponent(() => import('./security.vue')); case '2fa': return defineAsyncComponent(() => import('./2fa.vue')); case 'api': return defineAsyncComponent(() => import('./api.vue')); diff --git a/packages/client/src/pages/settings/integration.vue b/packages/client/src/pages/settings/integration.vue deleted file mode 100644 index 766bd1807..000000000 --- a/packages/client/src/pages/settings/integration.vue +++ /dev/null @@ -1,95 +0,0 @@ - - - From c785fbab6ef05afc8dc32f99c87cbee8dbb67b32 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Tue, 6 Dec 2022 21:51:01 +0100 Subject: [PATCH 06/12] client: remove integration signin options --- packages/client/src/components/signin.vue | 5 ----- 1 file changed, 5 deletions(-) diff --git a/packages/client/src/components/signin.vue b/packages/client/src/components/signin.vue index bc4063f9b..d6dd3ff4a 100644 --- a/packages/client/src/components/signin.vue +++ b/packages/client/src/components/signin.vue @@ -39,11 +39,6 @@ - From 7e8d5c3b79ae37747c3c3561f42142c6a529d2f7 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Tue, 6 Dec 2022 21:52:16 +0100 Subject: [PATCH 07/12] foundkey-js: remove integration fields from instance type --- packages/foundkey-js/src/entities.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/packages/foundkey-js/src/entities.ts b/packages/foundkey-js/src/entities.ts index 3616dc445..2fd05c1cf 100644 --- a/packages/foundkey-js/src/entities.ts +++ b/packages/foundkey-js/src/entities.ts @@ -277,9 +277,6 @@ export type LiteInstanceMetadata = { swPublickey: string | null; maxNoteTextLength: number; enableEmail: boolean; - enableTwitterIntegration: boolean; - enableGithubIntegration: boolean; - enableDiscordIntegration: boolean; enableServiceWorker: boolean; emojis: CustomEmoji[]; iconUrl: string; From 87e1e658f2975fa07c1db7730b898047abaf4b63 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Tue, 6 Dec 2022 22:03:34 +0100 Subject: [PATCH 08/12] locales: remove integration-related locales --- locales/ar-SA.yml | 4 ---- locales/bn-BD.yml | 4 ---- locales/cs-CZ.yml | 4 ---- locales/de-DE.yml | 16 ---------------- locales/en-US.yml | 14 -------------- locales/es-ES.yml | 4 ---- locales/fr-FR.yml | 16 ---------------- locales/id-ID.yml | 4 ---- locales/it-IT.yml | 4 ---- locales/ja-JP.yml | 14 -------------- locales/ja-KS.yml | 2 -- locales/kab-KAB.yml | 1 - locales/ko-KR.yml | 4 ---- locales/pl-PL.yml | 4 ---- locales/ro-RO.yml | 4 ---- locales/ru-RU.yml | 4 ---- locales/sk-SK.yml | 4 ---- locales/uk-UA.yml | 4 ---- locales/vi-VN.yml | 4 ---- locales/zh-CN.yml | 4 ---- locales/zh-TW.yml | 4 ---- 21 files changed, 123 deletions(-) diff --git a/locales/ar-SA.yml b/locales/ar-SA.yml index 8493f72ba..74869f65a 100644 --- a/locales/ar-SA.yml +++ b/locales/ar-SA.yml @@ -293,9 +293,6 @@ dayX: "{day}" monthX: "{month}" yearX: "{year}" pages: "الصفحات" -integration: "التكامل" -connectService: "اتصل" -disconnectService: "اقطع الاتصال" enableLocalTimeline: "تفعيل الخيط المحلي" enableGlobalTimeline: "تفعيل الخيط الزمني الشامل" disablingTimelinesInfo: "سيتمكن المديرون والمشرفون من الوصول إلى كل الخيوط الزمنية\ @@ -402,7 +399,6 @@ normalPassword: "الكلمة السرية جيدة" strongPassword: "الكلمة السرية قوية" passwordMatched: "التطابق صحيح!" passwordNotMatched: "غير متطابقتان" -signinWith: "الولوج عبر {x}" signinFailed: "فشل الولوج، خطأ في اسم المستخدم أو كلمة المرور." tapSecurityKey: "أنقر مفتاح الأمان" or: "أو" diff --git a/locales/bn-BD.yml b/locales/bn-BD.yml index 9cee3b901..cdaac8b2d 100644 --- a/locales/bn-BD.yml +++ b/locales/bn-BD.yml @@ -308,9 +308,6 @@ dayX: "{day}" monthX: "{month}" yearX: "{year}" pages: "পৃষ্ঠা" -integration: "ইন্টিগ্রেশন" -connectService: "সংযুক্ত করুন" -disconnectService: "সংযোগ বিচ্ছিন্ন করুন" enableLocalTimeline: "স্থানীয় টাইমলাইন চালু করুন" enableGlobalTimeline: "গ্লোবাল টাইমলাইন চালু করুন" disablingTimelinesInfo: "আপনি এই টাইমলাইনগুলি বন্ধ করলেও প্রশাসক এবং মডারেটররা এই\ @@ -417,7 +414,6 @@ normalPassword: "সাধারণ পাসওয়ার্ড" strongPassword: "শক্তিশালী পাসওয়ার্ড" passwordMatched: "মিলেছে" passwordNotMatched: "মিলেনি" -signinWith: "{x} এর সাহায্যে সাইন ইন করুন" signinFailed: "লগ ইন করা যায়নি। আপনার ব্যবহারকারীর নাম এবং পাসওয়ার্ড চেক করুন." tapSecurityKey: "সিকিউরিটি কী স্পর্শ করুন" or: "অথবা" diff --git a/locales/cs-CZ.yml b/locales/cs-CZ.yml index 69e01db57..53c7f4aa4 100644 --- a/locales/cs-CZ.yml +++ b/locales/cs-CZ.yml @@ -277,9 +277,6 @@ dayX: "{day}" monthX: "{month}" yearX: "{year}" pages: "Stránky" -integration: "Integrace" -connectService: "Připojit" -disconnectService: "Odpojit" enableLocalTimeline: "Povolit lokální čas" enableGlobalTimeline: "Povolit globální čas" enableRegistration: "Povolit registraci novým uživatelům" @@ -353,7 +350,6 @@ normalPassword: "Dobré heslo" strongPassword: "Silné heslo" passwordMatched: "Hesla se schodují" passwordNotMatched: "Hesla se neschodují" -signinWith: "Přihlásit se s {x}" signinFailed: "Nelze se přihlásit. Zkontrolujte prosím své uživatelské jméno a heslo." or: "Nebo" language: "Jazyk" diff --git a/locales/de-DE.yml b/locales/de-DE.yml index aa97782f0..ff6e082ab 100644 --- a/locales/de-DE.yml +++ b/locales/de-DE.yml @@ -321,9 +321,6 @@ dayX: "{day}" monthX: "{month}" yearX: "{year}" pages: "Seiten" -integration: "Integration" -connectService: "Verbinden" -disconnectService: "Trennen" enableLocalTimeline: "Lokale Chronik aktivieren" enableGlobalTimeline: "Globale Chronik aktivieren" disablingTimelinesInfo: "Administratoren und Moderatoren haben immer Zugriff auf alle\ @@ -433,7 +430,6 @@ normalPassword: "Durchschnittliches Passwort" strongPassword: "Starkes Passwort" passwordMatched: "Stimmt überein" passwordNotMatched: "Stimmt nicht überein" -signinWith: "Mit {x} anmelden" signinFailed: "Anmeldung fehlgeschlagen. Überprüfe Benutzername und Passswort." tapSecurityKey: "Tippe deinen Sicherheitsschlüssel an" or: "Oder" @@ -1373,18 +1369,6 @@ recommended: "Empfehlung" check: "Check" maxCustomEmojiPicker: Maximale Anzahl vorgeschlagener benutzerdefinierter Emoji maxUnicodeEmojiPicker: Maximale Anzahl vorgeschlagener Unicode-Emoji -_services: - _discord: - connected: 'Discord: @{username}#{discriminator} wurde mit Foundkey-Account @{mkUsername} - verknüpft!' - disconnected: Discord-Verknüpfung wurde entfernt. - _twitter: - connected: Twitter-Account @{twitterUserName} wurde mit Foundkey-Account @{userName} - verknüpft! - disconnected: Twitter-Verknüpfung wurde entfernt. - _github: - connected: GitHub-Account @{login} wurde mit Foundkey-Account @{userName} verknüpft! - disconnected: GitHub-Verknüpfung wurde entfernt. documentation: Dokumentation signinHistoryExpires: Frühere Login-Versuche werden aus Datenschutzgründen nach 60 Tagen automatisch gelöscht. diff --git a/locales/en-US.yml b/locales/en-US.yml index 75d2643f0..bc6d47502 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -311,9 +311,6 @@ dayX: "{day}" monthX: "{month}" yearX: "{year}" pages: "Pages" -integration: "Integration" -connectService: "Connect" -disconnectService: "Disconnect" enableLocalTimeline: "Enable local timeline" enableGlobalTimeline: "Enable global timeline" disablingTimelinesInfo: "Adminstrators and Moderators will always have access to all\ @@ -420,7 +417,6 @@ normalPassword: "Average password" strongPassword: "Strong password" passwordMatched: "Matches" passwordNotMatched: "Does not match" -signinWith: "Sign in with {x}" signinFailed: "Unable to sign in. The entered username or password is incorrect." tapSecurityKey: "Tap your security key" or: "Or" @@ -1344,16 +1340,6 @@ _deck: list: "List" mentions: "Mentions" direct: "Direct notes" -_services: - _discord: - connected: "Discord: @{username}#{discriminator} connected to FoundKey: @{mkUsername}!" - disconnected: "Discord linkage has been removed." - _twitter: - connected: "Twitter: @{twitterUserName} connected to FoundKey: @{userName}!" - disconnected: "Twitter linkage has been removed." - _github: - connected: "GitHub: @{login} connected to FoundKey: @{userName}!" - disconnected: "GitHub linkage has been removed." _translationService: _deepl: authKey: "DeepL Auth Key" diff --git a/locales/es-ES.yml b/locales/es-ES.yml index 969639f9b..8e022fa27 100644 --- a/locales/es-ES.yml +++ b/locales/es-ES.yml @@ -311,9 +311,6 @@ dayX: "Día {day}" monthX: "Mes {month}" yearX: "Año {year}" pages: "Páginas" -integration: "Integración" -connectService: "Conectar" -disconnectService: "Desconectar" enableLocalTimeline: "Habilitar linea de tiempo local" enableGlobalTimeline: "Habilitar linea de tiempo global" disablingTimelinesInfo: "Aunque se desactiven estas lineas de tiempo, por conveniencia\ @@ -420,7 +417,6 @@ normalPassword: "Buena contraseña" strongPassword: "Muy buena contraseña" passwordMatched: "Correcto" passwordNotMatched: "Las contraseñas no son las mismas" -signinWith: "Inicie sesión con {x}" signinFailed: "Autenticación fallida. Asegúrate de haber usado el nombre de usuario\ \ y contraseña correctos." tapSecurityKey: "Toque la clave de seguridad" diff --git a/locales/fr-FR.yml b/locales/fr-FR.yml index 5150905cb..1cbcb20a4 100644 --- a/locales/fr-FR.yml +++ b/locales/fr-FR.yml @@ -311,9 +311,6 @@ dayX: "{day}" monthX: "{month}" yearX: "{year}" pages: "Pages" -integration: "Intégrations" -connectService: "Connexion" -disconnectService: "Déconnexion" enableLocalTimeline: "Activer le fil local" enableGlobalTimeline: "Activer le fil global" disablingTimelinesInfo: "Même si vous désactivez ces fils, les administrateur·rice·s\ @@ -423,7 +420,6 @@ normalPassword: "Mot de passe acceptable" strongPassword: "Mot de passe fort" passwordMatched: "Les mots de passe correspondent" passwordNotMatched: "Les mots de passe ne correspondent pas" -signinWith: "Se connecter avec {x}" signinFailed: "Échec d’authentification. Veuillez vérifier que votre nom d’utilisateur\ \ et mot de passe sont corrects." tapSecurityKey: "Appuyez sur votre clé de sécurité" @@ -1331,18 +1327,6 @@ _deck: list: "Listes" mentions: "Mentions" direct: "Direct" -_services: - _discord: - connected: '@{username}#{discriminator} sur Discord est connecté à @{mkUsername} - sur FoundKey !' - disconnected: La liaison avec Discord à été supprimée. - _twitter: - connected: '@{twitterUserName} sur Twitter est connecté à @{userName} sur FoundKey - !' - disconnected: La liaison avec Twitter à été supprimée. - _github: - disconnected: La liaison avec Github à été supprimée. - connected: '@{login} sur Github est connecté à @{userName} sur FoundKey !' exportAll: Tout exporter stopActivityDeliveryDescription: L'activité locale ne sera pas envoyé à cette instance. La réception de l'activité continuera de fonctionner comme avant. diff --git a/locales/id-ID.yml b/locales/id-ID.yml index 585a64499..5e9ba9b46 100644 --- a/locales/id-ID.yml +++ b/locales/id-ID.yml @@ -310,9 +310,6 @@ dayX: "{day}" monthX: "{month}" yearX: "{year}" pages: "Halaman" -integration: "Integrasi" -connectService: "Sambungkan" -disconnectService: "Putuskan" enableLocalTimeline: "Nyalakan linimasa lokal" enableGlobalTimeline: "Nyalakan linimasa global" disablingTimelinesInfo: "Admin dan Moderator akan selalu memiliki akses ke semua linimasa\ @@ -419,7 +416,6 @@ normalPassword: "Kata sandi baik" strongPassword: "Kata sandi kuat" passwordMatched: "Kata sandi sama" passwordNotMatched: "Kata sandi tidak sama" -signinWith: "Masuk dengan {x}" signinFailed: "Tidak dapat masuk. Nama pengguna atau kata sandi yang kamu masukkan\ \ salah." tapSecurityKey: "Ketuk kunci keamanan kamu" diff --git a/locales/it-IT.yml b/locales/it-IT.yml index f502484d0..da6a6a7af 100644 --- a/locales/it-IT.yml +++ b/locales/it-IT.yml @@ -304,9 +304,6 @@ dayX: "{day}" monthX: "{month}" yearX: "{year}" pages: "Pagine" -integration: "App collegate" -connectService: "Connessione" -disconnectService: "Disconnessione " enableLocalTimeline: "Abilita Timeline locale" enableGlobalTimeline: "Abilita Timeline federata" disablingTimelinesInfo: "Anche se disabiliti queste timeline, gli amministratori e\ @@ -413,7 +410,6 @@ normalPassword: "Password buona" strongPassword: "Password forte" passwordMatched: "Corretta" passwordNotMatched: "Le password non corrispondono." -signinWith: "Accedi con {x}" signinFailed: "Autenticazione non riuscita. Controlla la tua password e nome utente." tapSecurityKey: "Premi la chiave di sicurezza" or: "oppure" diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 30f1cbf69..38be75c28 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -286,9 +286,6 @@ dayX: "{day}日" monthX: "{month}月" yearX: "{year}年" pages: "ページ" -integration: "連携" -connectService: "接続する" -disconnectService: "切断する" enableLocalTimeline: "ローカルタイムラインを有効にする" enableGlobalTimeline: "グローバルタイムラインを有効にする" disablingTimelinesInfo: "これらのタイムラインを無効化しても、利便性のため管理者およびモデレーターは引き続き利用することができます。" @@ -392,7 +389,6 @@ normalPassword: "普通のパスワード" strongPassword: "強いパスワード" passwordMatched: "一致しました" passwordNotMatched: "一致していません" -signinWith: "{x}でログイン" signinFailed: "ログインできませんでした。ユーザー名とパスワードを確認してください。" tapSecurityKey: "セキュリティキーにタッチ" or: "もしくは" @@ -1273,13 +1269,3 @@ _deck: list: "リスト" mentions: "あなた宛て" direct: "ダイレクト" -_services: - _discord: - connected: "Discord: @{username}#{discriminator} を、FoundKey: @{mkUsername} に接続しました!" - disconnected: "Discordの連携を解除しました :v:" - _twitter: - connected: "Twitter: @{twitterUserName} を、FoundKey: @{userName} に接続しました!" - disconnected: "Twitterの連携を解除しました :v:" - _github: - connected: "GitHub: @{login} を、FoundKey: @{userName} に接続しました!" - disconnected: "GitHubの連携を解除しました :v:" diff --git a/locales/ja-KS.yml b/locales/ja-KS.yml index 9aa2b4358..d365def00 100644 --- a/locales/ja-KS.yml +++ b/locales/ja-KS.yml @@ -288,7 +288,6 @@ dayX: "{day}日" monthX: "{month}月" yearX: "{year}年" pages: "ページ" -integration: "連携" enableLocalTimeline: "ローカルタイムラインを使えるようにする" enableGlobalTimeline: "グローバルタイムラインを使えるようにする" disablingTimelinesInfo: "ここらへんのタイムラインを使えんようにしてしもても、管理者とモデレーターは使えるままになってるで、そうやなかったら不便やからな。" @@ -391,7 +390,6 @@ normalPassword: "普通のパスワード" strongPassword: "ええ感じのパスワード" passwordMatched: "よし!一致や!" passwordNotMatched: "一致しとらんで?" -signinWith: "{x}でログイン" or: "それか" language: "言語" uiLanguage: "UIの表示言語" diff --git a/locales/kab-KAB.yml b/locales/kab-KAB.yml index 55a3984b1..dc4f8ba17 100644 --- a/locales/kab-KAB.yml +++ b/locales/kab-KAB.yml @@ -39,7 +39,6 @@ userList: "Tibdarin" securityKey: "Tasarutt n tɣellist" securityKeyName: "Isem n tsarutt" signinRequired: "Ttxil jerred" -signinWith: "Tuqqna s {x}" tapSecurityKey: "Sekcem tasarutt-ik·im n tɣellist" uiLanguage: "Tutlayt n wegrudem" plugins: "Izegrar" diff --git a/locales/ko-KR.yml b/locales/ko-KR.yml index 4f8cac7cb..69a2ad1af 100644 --- a/locales/ko-KR.yml +++ b/locales/ko-KR.yml @@ -315,9 +315,6 @@ dayX: "{day}일" monthX: "{month}월" yearX: "{year}년" pages: "페이지" -integration: "연동" -connectService: "계정 연동" -disconnectService: "계정 연동 해제" enableLocalTimeline: "로컬 타임라인 활성화" enableGlobalTimeline: "글로벌 타임라인 활성화" disablingTimelinesInfo: "특정 타임라인을 비활성화하더라도 관리자 및 모더레이터는 계속 사용할 수 있습니다." @@ -438,7 +435,6 @@ normalPassword: "좋은 비밀번호" strongPassword: "강한 비밀번호" passwordMatched: "일치합니다" passwordNotMatched: "일치하지 않습니다" -signinWith: "{x}로 로그인" signinFailed: "로그인할 수 없습니다. 사용자명과 비밀번호를 확인하여 주십시오." tapSecurityKey: "보안 키를 터치" or: "혹은" diff --git a/locales/pl-PL.yml b/locales/pl-PL.yml index 4345bede6..ae9065097 100644 --- a/locales/pl-PL.yml +++ b/locales/pl-PL.yml @@ -298,9 +298,6 @@ dayX: "{day}" monthX: "{month}" yearX: "{year}" pages: "Strony" -integration: "Integracja" -connectService: "Połącz" -disconnectService: "Rozłącz" enableLocalTimeline: "Włącz lokalną oś czasu" enableGlobalTimeline: "Włącz globalną oś czasu" disablingTimelinesInfo: "Administratorzy i moderatorzy będą zawsze mieć dostęp do\ @@ -407,7 +404,6 @@ normalPassword: "Dobre hasło" strongPassword: "Silne hasło" passwordMatched: "Pasuje" passwordNotMatched: "Hasła nie pasują do siebie" -signinWith: "Zaloguj się z {x}" signinFailed: "Nie udało się zalogować. Wprowadzona nazwa użytkownika lub hasło są\ \ nieprawidłowe." tapSecurityKey: "Wybierz swój klucz bezpieczeństwa" diff --git a/locales/ro-RO.yml b/locales/ro-RO.yml index 1b343337a..34c2ce7f6 100644 --- a/locales/ro-RO.yml +++ b/locales/ro-RO.yml @@ -311,9 +311,6 @@ dayX: "{day}" monthX: "{month}" yearX: "{year}" pages: "Pagini" -integration: "Integrare" -connectService: "Conectează" -disconnectService: "Deconectează" enableLocalTimeline: "Activează cronologia locală" enableGlobalTimeline: "Activeaza cronologia globală" disablingTimelinesInfo: "Administratorii și Moderatorii vor avea mereu access la toate\ @@ -420,7 +417,6 @@ normalPassword: "Parolă medie" strongPassword: "Parolă puternică" passwordMatched: "Se potrivește!" passwordNotMatched: "Nu se potrivește" -signinWith: "Autentifică-te cu {x}" signinFailed: "Nu se poate autentifica. Numele de utilizator sau parola introduse\ \ sunt incorecte." tapSecurityKey: "Apasă pe cheia ta de securitate." diff --git a/locales/ru-RU.yml b/locales/ru-RU.yml index 697bf9f9e..e851d93cb 100644 --- a/locales/ru-RU.yml +++ b/locales/ru-RU.yml @@ -304,9 +304,6 @@ dayX: "{day} день" monthX: "{month} месяц" yearX: "{year} год" pages: "Страницы" -integration: "Интеграция" -connectService: "Подключиться" -disconnectService: "Отключиться" enableLocalTimeline: "Включить локальную ленту" enableGlobalTimeline: "Включить глобальную ленту" disablingTimelinesInfo: "У администраторов и модераторов есть доступ ко всем лентам,\ @@ -415,7 +412,6 @@ normalPassword: "Годный пароль" strongPassword: "Надёжный пароль" passwordMatched: "Совпали" passwordNotMatched: "Не совпадают" -signinWith: "Использовать {x} для входа" signinFailed: "Невозможно войти в систему. Введенное вами имя пользователя или пароль\ \ неверны." tapSecurityKey: "Нажмите на свой электронный ключ" diff --git a/locales/sk-SK.yml b/locales/sk-SK.yml index 1b41b5d5a..ca8b01729 100644 --- a/locales/sk-SK.yml +++ b/locales/sk-SK.yml @@ -305,9 +305,6 @@ dayX: "{day}" monthX: "{month}" yearX: "{year}" pages: "Stránky" -integration: "Integrácia" -connectService: "Pripojiť" -disconnectService: "Odpojiť" enableLocalTimeline: "Povoliť lokálnu časovú os" enableGlobalTimeline: "Povoliť globálnu časovú os" disablingTimelinesInfo: "Administrátori a moderátori majú vždy prístup ku všetkým\ @@ -414,7 +411,6 @@ normalPassword: "Dobré heslo" strongPassword: "Silné heslo" passwordMatched: "Heslá sú rovnaké" passwordNotMatched: "Heslá nie sú rovnaké" -signinWith: "Prihlásiť sa použitím {x}" signinFailed: "Nedá sa prihlásiť. Skontrolujte prosím meno používateľa a heslo." tapSecurityKey: "Ťuknite na bezpečnostný kľúč" or: "Alebo" diff --git a/locales/uk-UA.yml b/locales/uk-UA.yml index 8964a01cd..7f06ac629 100644 --- a/locales/uk-UA.yml +++ b/locales/uk-UA.yml @@ -305,9 +305,6 @@ dayX: "{day}" monthX: "{month}" yearX: "{year}" pages: "Сторінки" -integration: "Інтеграція" -connectService: "Під’єднати" -disconnectService: "Відключитися" enableLocalTimeline: "Увімкнути локальну стрічку" enableGlobalTimeline: "Увімкнути глобальну стрічку" disablingTimelinesInfo: "Адміністратори та модератори завжди мають доступ до всіх\ @@ -414,7 +411,6 @@ normalPassword: "Достатній пароль" strongPassword: "Міцний пароль" passwordMatched: "Все вірно" passwordNotMatched: "Паролі не співпадають" -signinWith: "Увійти за допомогою {x}" signinFailed: "Не вдалося увійти. Введені ім’я користувача або пароль неправильнi." tapSecurityKey: "Торкніться ключа безпеки" or: "або" diff --git a/locales/vi-VN.yml b/locales/vi-VN.yml index 7b450e850..59e95a6ae 100644 --- a/locales/vi-VN.yml +++ b/locales/vi-VN.yml @@ -305,9 +305,6 @@ dayX: "{day}" monthX: "{month}" yearX: "{year}" pages: "Trang" -integration: "Tương tác" -connectService: "Kết nối" -disconnectService: "Ngắt kết nối" enableLocalTimeline: "Bật bảng tin máy chủ" enableGlobalTimeline: "Bật bảng tin liên hợp" disablingTimelinesInfo: "Quản trị viên và Kiểm duyệt viên luôn có quyền truy cập mọi\ @@ -415,7 +412,6 @@ normalPassword: "Mật khẩu tạm được" strongPassword: "Mật khẩu mạnh" passwordMatched: "Trùng khớp" passwordNotMatched: "Không trùng khớp" -signinWith: "Đăng nhập bằng {x}" signinFailed: "Không thể đăng nhập. Vui lòng kiểm tra tên người dùng và mật khẩu của\ \ bạn." tapSecurityKey: "Nhấn mã bảo mật của bạn" diff --git a/locales/zh-CN.yml b/locales/zh-CN.yml index e7f1b58a9..d01be6f06 100644 --- a/locales/zh-CN.yml +++ b/locales/zh-CN.yml @@ -284,9 +284,6 @@ dayX: "{day}日" monthX: "{month}月" yearX: "{year}年" pages: "页面" -integration: "关联" -connectService: "连接" -disconnectService: "断开连接" enableLocalTimeline: "启用本地时间线功能" enableGlobalTimeline: "启用全局时间线" disablingTimelinesInfo: "即使时间线功能被禁用,出于方便,管理员和数据图表也可以继续使用。" @@ -390,7 +387,6 @@ normalPassword: "密码强度:中等" strongPassword: "密码强度:强" passwordMatched: "密码一致" passwordNotMatched: "密码不一致" -signinWith: "以{x}登录" signinFailed: "无法登录,请检查您的用户名和密码是否正确。" tapSecurityKey: "轻触硬件安全密钥" or: "或者" diff --git a/locales/zh-TW.yml b/locales/zh-TW.yml index 01a810bd6..3beedc5b9 100644 --- a/locales/zh-TW.yml +++ b/locales/zh-TW.yml @@ -284,9 +284,6 @@ dayX: "{day}日" monthX: "{month}月" yearX: "{year}年" pages: "頁面" -integration: "整合" -connectService: "己連結" -disconnectService: "己斷開 " enableLocalTimeline: "開啟本地時間軸" enableGlobalTimeline: "啟用公開時間軸" disablingTimelinesInfo: "即使您關閉了時間線功能,管理員和協調人仍可以繼續使用,以方便您。" @@ -390,7 +387,6 @@ normalPassword: "密碼強度普通" strongPassword: "密碼強度高" passwordMatched: "密碼一致" passwordNotMatched: "密碼不一致" -signinWith: "以{x}登錄" signinFailed: "登入失敗。 請檢查使用者名稱和密碼。" tapSecurityKey: "點擊安全密鑰" or: "或者" From b023741f5026289edccdb11cdfab1e6871b238e0 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Tue, 6 Dec 2022 23:00:08 +0100 Subject: [PATCH 09/12] server: remove integrations field from user --- .../backend/migration/1670359028055-removeIntegrations.js | 2 ++ packages/backend/src/models/entities/user-profile.ts | 5 ----- packages/backend/src/models/repositories/user.ts | 1 - packages/backend/src/models/schema/user.ts | 4 ---- .../backend/src/server/api/endpoints/admin/show-user.ts | 6 ------ packages/foundkey-js/src/entities.ts | 1 - 6 files changed, 2 insertions(+), 17 deletions(-) diff --git a/packages/backend/migration/1670359028055-removeIntegrations.js b/packages/backend/migration/1670359028055-removeIntegrations.js index fa8d3e4a0..fd0888a6e 100644 --- a/packages/backend/migration/1670359028055-removeIntegrations.js +++ b/packages/backend/migration/1670359028055-removeIntegrations.js @@ -11,9 +11,11 @@ export class removeIntegrations1670359028055 { await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "enableDiscordIntegration"`); await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "discordClientId"`); await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "discordClientSecret"`); + await queryRunner.query(`ALTER TABLE "user_profile" DROP COLUMN "integrations"`); } async down(queryRunner) { + await queryRunner.query(`ALTER TABLE "user_profile" ADD "integrations" jsonb NOT NULL DEFAULT '{}'`); await queryRunner.query(`ALTER TABLE "meta" ADD "discordClientSecret" character varying(128)`); await queryRunner.query(`ALTER TABLE "meta" ADD "discordClientId" character varying(128)`); await queryRunner.query(`ALTER TABLE "meta" ADD "enableDiscordIntegration" boolean NOT NULL DEFAULT false`); diff --git a/packages/backend/src/models/entities/user-profile.ts b/packages/backend/src/models/entities/user-profile.ts index 58ab00d01..93358e17a 100644 --- a/packages/backend/src/models/entities/user-profile.ts +++ b/packages/backend/src/models/entities/user-profile.ts @@ -167,11 +167,6 @@ export class UserProfile { @JoinColumn() public pinnedPage: Page | null; - @Column('jsonb', { - default: {}, - }) - public integrations: Record; - @Index() @Column('boolean', { default: false, select: false, diff --git a/packages/backend/src/models/repositories/user.ts b/packages/backend/src/models/repositories/user.ts index 56fd4e218..00dcf7f87 100644 --- a/packages/backend/src/models/repositories/user.ts +++ b/packages/backend/src/models/repositories/user.ts @@ -387,7 +387,6 @@ export const UserRepository = db.getRepository(User).extend({ hasUnreadMessagingMessage: this.getHasUnreadMessagingMessage(user.id), hasUnreadNotification: this.getHasUnreadNotification(user.id), hasPendingReceivedFollowRequest: this.getHasPendingReceivedFollowRequest(user.id), - integrations: profile!.integrations, mutedWords: profile!.mutedWords, mutedInstances: profile!.mutedInstances, mutingNotificationTypes: profile!.mutingNotificationTypes, diff --git a/packages/backend/src/models/schema/user.ts b/packages/backend/src/models/schema/user.ts index dae8f692c..fcb61f918 100644 --- a/packages/backend/src/models/schema/user.ts +++ b/packages/backend/src/models/schema/user.ts @@ -352,10 +352,6 @@ export const packedMeDetailedOnlySchema = { type: 'boolean', nullable: false, optional: false, }, - integrations: { - type: 'object', - nullable: true, optional: false, - }, mutedWords: { type: 'array', nullable: false, optional: false, diff --git a/packages/backend/src/server/api/endpoints/admin/show-user.ts b/packages/backend/src/server/api/endpoints/admin/show-user.ts index bc9c193f8..d7cf37ea3 100644 --- a/packages/backend/src/server/api/endpoints/admin/show-user.ts +++ b/packages/backend/src/server/api/endpoints/admin/show-user.ts @@ -45,11 +45,6 @@ export default define(meta, paramDef, async (ps, me) => { }; } - const maskedKeys = ['accessToken', 'accessTokenSecret', 'refreshToken']; - Object.keys(profile.integrations).forEach(integration => { - maskedKeys.forEach(key => profile.integrations[integration][key] = ''); - }); - const signins = await Signins.findBy({ userId: user.id }); return { @@ -61,7 +56,6 @@ export default define(meta, paramDef, async (ps, me) => { carefulBot: profile.carefulBot, injectFeaturedNote: profile.injectFeaturedNote, receiveAnnouncementEmail: profile.receiveAnnouncementEmail, - integrations: profile.integrations, mutedWords: profile.mutedWords, mutedInstances: profile.mutedInstances, mutingNotificationTypes: profile.mutingNotificationTypes, diff --git a/packages/foundkey-js/src/entities.ts b/packages/foundkey-js/src/entities.ts index 2fd05c1cf..236b2a8a3 100644 --- a/packages/foundkey-js/src/entities.ts +++ b/packages/foundkey-js/src/entities.ts @@ -98,7 +98,6 @@ export type MeDetailed = UserDetailed & { hasUnreadSpecifiedNotes: boolean; hideOnlineStatus: boolean; injectFeaturedNote: boolean; - integrations: Record; isDeleted: boolean; isExplorable: boolean; mutedWords: string[][]; From 96c37445554ad270d4fc58214f296e85c5fceb04 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Tue, 6 Dec 2022 23:00:32 +0100 Subject: [PATCH 10/12] client: remove integration settings menu entry --- packages/client/src/pages/settings/index.vue | 5 ----- 1 file changed, 5 deletions(-) diff --git a/packages/client/src/pages/settings/index.vue b/packages/client/src/pages/settings/index.vue index 280f5d210..4810d80c9 100644 --- a/packages/client/src/pages/settings/index.vue +++ b/packages/client/src/pages/settings/index.vue @@ -89,11 +89,6 @@ const menuDef = computed(() => [{ text: i18n.ts.email, to: '/settings/email', active: props.initialPage === 'email', - }, { - icon: 'fas fa-share-alt', - text: i18n.ts.integration, - to: '/settings/integration', - active: props.initialPage === 'integration', }, { icon: 'fas fa-lock', text: i18n.ts.security, From 1aa3898db54cd9a7589943871a910771538280ac Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Tue, 6 Dec 2022 23:12:45 +0100 Subject: [PATCH 11/12] server: remove unused import --- packages/backend/src/remote/activitypub/models/person.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend/src/remote/activitypub/models/person.ts b/packages/backend/src/remote/activitypub/models/person.ts index 503547972..c6eb92b4a 100644 --- a/packages/backend/src/remote/activitypub/models/person.ts +++ b/packages/backend/src/remote/activitypub/models/person.ts @@ -25,7 +25,7 @@ import { publishInternalEvent } from '@/services/stream.js'; import { db } from '@/db/postgre.js'; import { apLogger } from '../logger.js'; import { fromHtml } from '@/mfm/from-html.js'; -import { isCollectionOrOrderedCollection, isCollection, IActor, getApId, getOneApHrefNullable, IObject, isPropertyValue, IApPropertyValue, getApType, isActor } from '../type.js'; +import { isCollectionOrOrderedCollection, isCollection, IActor, getApId, getOneApHrefNullable, IObject, isPropertyValue, getApType, isActor } from '../type.js'; import Resolver from '../resolver.js'; import { extractApHashtags } from './tag.js'; import { resolveNote, extractEmojis } from './note.js'; From d3f1ad9a88f7f13805a642414948e1fd898267b6 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Tue, 6 Dec 2022 23:18:27 +0100 Subject: [PATCH 12/12] chore: remove unused packages --- packages/backend/package.json | 2 -- packages/client/package.json | 2 -- yarn.lock | 29 ----------------------------- 3 files changed, 33 deletions(-) diff --git a/packages/backend/package.json b/packages/backend/package.json index dc18c5e30..4dd134b32 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -29,7 +29,6 @@ "ajv": "8.11.0", "archiver": "5.3.1", "autobind-decorator": "2.4.0", - "autwh": "0.1.0", "aws-sdk": "2.1165.0", "bcryptjs": "2.4.3", "blurhash": "1.1.5", @@ -146,7 +145,6 @@ "@types/node": "18.7.16", "@types/node-fetch": "3.0.3", "@types/nodemailer": "6.4.5", - "@types/oauth": "^0.9.1", "@types/pg": "^8.6.5", "@types/pug": "2.0.6", "@types/punycode": "2.1.0", diff --git a/packages/client/package.json b/packages/client/package.json index d672895ce..bc904ffbe 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -18,7 +18,6 @@ "abort-controller": "3.0.0", "autobind-decorator": "2.4.0", "autosize": "5.0.1", - "autwh": "0.1.0", "blurhash": "1.1.5", "broadcast-channel": "4.13.0", "browser-image-resizer": "2.4.1", @@ -86,7 +85,6 @@ "@types/katex": "0.14.0", "@types/matter-js": "0.17.7", "@types/mocha": "9.1.1", - "@types/oauth": "0.9.1", "@types/punycode": "2.1.0", "@types/qrcode": "1.5.0", "@types/seedrandom": "3.0.2", diff --git a/yarn.lock b/yarn.lock index 7432ff230..7ddb9e66b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2216,15 +2216,6 @@ __metadata: languageName: node linkType: hard -"@types/oauth@npm:0.9.1, @types/oauth@npm:^0.9.1": - version: 0.9.1 - resolution: "@types/oauth@npm:0.9.1" - dependencies: - "@types/node": "*" - checksum: 5c079611b455eff58fba6358e028b191a1e65475600f8ed8d98c1696fedcfb0290aa6c6a19cf50f21a9e2d816ecb43a19f910900d91f8ba3727e33c48f97d7f3 - languageName: node - linkType: hard - "@types/parse5@npm:*": version: 7.0.0 resolution: "@types/parse5@npm:7.0.0" @@ -3474,15 +3465,6 @@ __metadata: languageName: node linkType: hard -"autwh@npm:0.1.0": - version: 0.1.0 - resolution: "autwh@npm:0.1.0" - dependencies: - oauth: 0.9.15 - checksum: 5ca904d43421e7475de29adfda65ca769105cbf597c9c43fef934f20b0daa331621157cdf34513eae5f492e1b4fc6443f37438da08bf2ba1c4e3e7d6d3f3f738 - languageName: node - linkType: hard - "aws-sdk@npm:2.1165.0": version: 2.1165.0 resolution: "aws-sdk@npm:2.1165.0" @@ -3675,7 +3657,6 @@ __metadata: "@types/node": 18.7.16 "@types/node-fetch": 3.0.3 "@types/nodemailer": 6.4.5 - "@types/oauth": ^0.9.1 "@types/pg": ^8.6.5 "@types/pug": 2.0.6 "@types/punycode": 2.1.0 @@ -3702,7 +3683,6 @@ __metadata: ajv: 8.11.0 archiver: 5.3.1 autobind-decorator: 2.4.0 - autwh: 0.1.0 aws-sdk: 2.1165.0 bcryptjs: 2.4.3 blurhash: 1.1.5 @@ -4704,7 +4684,6 @@ __metadata: "@types/katex": 0.14.0 "@types/matter-js": 0.17.7 "@types/mocha": 9.1.1 - "@types/oauth": 0.9.1 "@types/punycode": 2.1.0 "@types/qrcode": 1.5.0 "@types/seedrandom": 3.0.2 @@ -4719,7 +4698,6 @@ __metadata: abort-controller: 3.0.0 autobind-decorator: 2.4.0 autosize: 5.0.1 - autwh: 0.1.0 blurhash: 1.1.5 broadcast-channel: 4.13.0 browser-image-resizer: 2.4.1 @@ -12623,13 +12601,6 @@ __metadata: languageName: node linkType: hard -"oauth@npm:0.9.15": - version: 0.9.15 - resolution: "oauth@npm:0.9.15" - checksum: 957c0d8d85300398dcb0e293953650c0fc3facc795bee8228238414f19f59cef5fd4ee8d17a972c142924c10c5f6ec50ef80f77f4a6cc6e3c98f9d22c027801c - languageName: node - linkType: hard - "object-assign@npm:^4.0.1, object-assign@npm:^4.1.0, object-assign@npm:^4.1.1": version: 4.1.1 resolution: "object-assign@npm:4.1.1"