Merge upstream
This commit is contained in:
commit
b80629abed
75 changed files with 2749 additions and 3298 deletions
|
@ -0,0 +1,11 @@
|
|||
export class SSOWantEmailAddressNormalized1745247339195 {
|
||||
name = 'SSOWantEmailAddressNormalized1745247339195'
|
||||
|
||||
async up(queryRunner) {
|
||||
await queryRunner.query(`ALTER TABLE "sso_service_provider" ADD "wantEmailAddressNormalized" boolean NOT NULL DEFAULT true`);
|
||||
}
|
||||
|
||||
async down(queryRunner) {
|
||||
await queryRunner.query(`ALTER TABLE "sso_service_provider" DROP COLUMN "wantEmailAddressNormalized"`);
|
||||
}
|
||||
}
|
|
@ -33,18 +33,18 @@
|
|||
"generate-api-json": "pnpm build && node ./scripts/generate_api_json.js"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@swc/core-darwin-arm64": "1.11.13",
|
||||
"@swc/core-darwin-x64": "1.11.13",
|
||||
"@swc/core-linux-arm-gnueabihf": "1.11.13",
|
||||
"@swc/core-linux-arm64-gnu": "1.11.13",
|
||||
"@swc/core-linux-arm64-musl": "1.11.13",
|
||||
"@swc/core-linux-x64-gnu": "1.11.13",
|
||||
"@swc/core-linux-x64-musl": "1.11.13",
|
||||
"@swc/core-win32-arm64-msvc": "1.11.13",
|
||||
"@swc/core-win32-ia32-msvc": "1.11.13",
|
||||
"@swc/core-win32-x64-msvc": "1.11.13",
|
||||
"@tensorflow/tfjs": "4.22.0",
|
||||
"@tensorflow/tfjs-node": "4.22.0",
|
||||
"@swc/core-darwin-arm64": "1.11.24",
|
||||
"@swc/core-darwin-x64": "1.11.24",
|
||||
"@swc/core-linux-arm-gnueabihf": "1.11.24",
|
||||
"@swc/core-linux-arm64-gnu": "1.11.24",
|
||||
"@swc/core-linux-arm64-musl": "1.11.24",
|
||||
"@swc/core-linux-x64-gnu": "1.11.24",
|
||||
"@swc/core-linux-x64-musl": "1.11.24",
|
||||
"@swc/core-win32-arm64-msvc": "1.11.24",
|
||||
"@swc/core-win32-ia32-msvc": "1.11.24",
|
||||
"@swc/core-win32-x64-msvc": "1.11.24",
|
||||
"@tensorflow/tfjs": "managed",
|
||||
"@tensorflow/tfjs-node": "managed",
|
||||
"bufferutil": "4.0.9",
|
||||
"slacc-android-arm-eabi": "0.0.10",
|
||||
"slacc-android-arm64": "0.0.10",
|
||||
|
@ -63,11 +63,11 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@authenio/samlify-node-xmllint": "2.0.0",
|
||||
"@aws-sdk/client-s3": "3.779.0",
|
||||
"@aws-sdk/lib-storage": "3.779.0",
|
||||
"@bull-board/api": "6.7.10",
|
||||
"@bull-board/fastify": "6.7.10",
|
||||
"@bull-board/ui": "6.7.10",
|
||||
"@aws-sdk/client-s3": "3.808.0",
|
||||
"@aws-sdk/lib-storage": "3.808.0",
|
||||
"@bull-board/api": "6.9.6",
|
||||
"@bull-board/fastify": "6.9.6",
|
||||
"@bull-board/ui": "6.9.6",
|
||||
"@discordapp/twemoji": "15.1.0",
|
||||
"@elastic/elasticsearch": "8.17.1",
|
||||
"@fastify/accepts": "5.0.2",
|
||||
|
@ -78,20 +78,20 @@
|
|||
"@fastify/http-proxy": "11.1.2",
|
||||
"@fastify/multipart": "9.0.3",
|
||||
"@fastify/static": "8.1.1",
|
||||
"@fastify/view": "11.0.0",
|
||||
"@misskey-dev/sharp-read-bmp": "1.2.0",
|
||||
"@misskey-dev/summaly": "github:MisskeyIO/summaly#5.1.3",
|
||||
"@napi-rs/canvas": "0.1.68",
|
||||
"@nestjs/common": "11.0.12",
|
||||
"@nestjs/core": "11.0.12",
|
||||
"@nestjs/testing": "11.0.12",
|
||||
"@fastify/view": "11.1.0",
|
||||
"@misskey-dev/sharp-read-bmp": "1.3.0",
|
||||
"@misskey-dev/summaly": "managed",
|
||||
"@napi-rs/canvas": "0.1.70",
|
||||
"@nestjs/common": "11.1.0",
|
||||
"@nestjs/core": "11.1.0",
|
||||
"@nestjs/testing": "11.1.0",
|
||||
"@peertube/http-signature": "1.7.0",
|
||||
"@simplewebauthn/server": "13.1.1",
|
||||
"@sinonjs/fake-timers": "11.3.1",
|
||||
"@smithy/node-http-handler": "4.0.4",
|
||||
"@swc/cli": "0.6.0",
|
||||
"@swc/core": "1.11.13",
|
||||
"@twemoji/parser": "15.1.1",
|
||||
"@swc/cli": "0.7.7",
|
||||
"@swc/core": "1.11.24",
|
||||
"@twemoji/parser": "16.0.0",
|
||||
"accepts": "1.3.8",
|
||||
"ajv": "8.17.1",
|
||||
"archiver": "7.0.1",
|
||||
|
@ -99,39 +99,39 @@
|
|||
"bcryptjs": "3.0.2",
|
||||
"blurhash": "2.0.5",
|
||||
"body-parser": "2.2.0",
|
||||
"bullmq": "5.45.2",
|
||||
"bullmq": "5.52.2",
|
||||
"cacheable-lookup": "7.0.0",
|
||||
"cbor": "10.0.3",
|
||||
"chalk": "5.4.1",
|
||||
"chalk-template": "1.1.0",
|
||||
"chokidar": "4.0.3",
|
||||
"chokidar": "managed",
|
||||
"cli-highlight": "2.1.11",
|
||||
"color-convert": "3.0.1",
|
||||
"color-convert": "3.1.0",
|
||||
"content-disposition": "0.5.4",
|
||||
"date-fns": "4.1.0",
|
||||
"deep-email-validator": "0.1.21",
|
||||
"fastify": "5.2.2",
|
||||
"fastify": "5.3.3",
|
||||
"fastify-http-errors-enhanced": "6.0.1",
|
||||
"fastify-raw-body": "5.0.0",
|
||||
"feed": "4.2.2",
|
||||
"file-type": "20.4.1",
|
||||
"feed": "5.0.1",
|
||||
"file-type": "20.5.0",
|
||||
"fluent-ffmpeg": "2.1.3",
|
||||
"form-data": "4.0.2",
|
||||
"got": "14.4.7",
|
||||
"hpagent": "1.2.0",
|
||||
"htmlescape": "1.1.1",
|
||||
"http-link-header": "1.1.3",
|
||||
"ioredis": "5.6.0",
|
||||
"ioredis": "5.6.1",
|
||||
"ip-cidr": "4.0.2",
|
||||
"ipaddr.js": "2.2.0",
|
||||
"is-svg": "5.1.0",
|
||||
"jose": "6.0.10",
|
||||
"is-svg": "6.0.0",
|
||||
"jose": "6.0.11",
|
||||
"js-yaml": "4.1.0",
|
||||
"jsdom": "26.0.0",
|
||||
"jsdom": "26.1.0",
|
||||
"json5": "2.2.3",
|
||||
"jsonld": "8.3.3",
|
||||
"jsrsasign": "11.1.0",
|
||||
"meilisearch": "0.49.0",
|
||||
"meilisearch": "0.50.0",
|
||||
"mfm-js": "0.24.0",
|
||||
"microformats-parser": "2.0.2",
|
||||
"mime-types": "3.0.1",
|
||||
|
@ -142,15 +142,15 @@
|
|||
"nested-property": "4.0.0",
|
||||
"node-fetch": "3.3.2",
|
||||
"node-forge": "1.3.1",
|
||||
"nodemailer": "6.10.0",
|
||||
"nodemailer": "7.0.3",
|
||||
"nsfwjs": "4.2.0",
|
||||
"oauth": "0.10.2",
|
||||
"oauth2orize": "1.12.0",
|
||||
"oauth2orize-pkce": "0.1.2",
|
||||
"os-utils": "0.0.14",
|
||||
"otpauth": "9.4.0",
|
||||
"parse5": "7.2.1",
|
||||
"pg": "8.14.1",
|
||||
"parse5": "7.3.0",
|
||||
"pg": "8.16.0",
|
||||
"pino": "9.6.0",
|
||||
"pino-pretty": "13.0.0",
|
||||
"pkce-challenge": "5.0.0",
|
||||
|
@ -162,37 +162,37 @@
|
|||
"qrcode": "1.5.4",
|
||||
"random-seed": "0.3.0",
|
||||
"ratelimiter": "3.4.1",
|
||||
"re2": "1.21.4",
|
||||
"re2": "1.21.5",
|
||||
"reflect-metadata": "0.2.2",
|
||||
"rename": "1.0.4",
|
||||
"rss-parser": "3.13.0",
|
||||
"rxjs": "7.8.2",
|
||||
"samlify": "2.9.1",
|
||||
"sanitize-html": "2.15.0",
|
||||
"samlify": "2.10.0",
|
||||
"sanitize-html": "2.16.0",
|
||||
"secure-json-parse": "4.0.0",
|
||||
"sharp": "0.33.5",
|
||||
"sharp": "managed",
|
||||
"slacc": "0.0.10",
|
||||
"strict-event-emitter-types": "2.0.0",
|
||||
"stringz": "2.1.0",
|
||||
"systeminformation": "5.25.11",
|
||||
"tinycolor2": "1.6.0",
|
||||
"tmp": "0.2.3",
|
||||
"tsc-alias": "1.8.13",
|
||||
"tsc-alias": "1.8.16",
|
||||
"tsconfig-paths": "4.2.0",
|
||||
"typeorm": "0.3.21",
|
||||
"typescript": "5.8.2",
|
||||
"typeorm": "0.3.23",
|
||||
"typescript": "5.8.3",
|
||||
"ulid": "3.0.0",
|
||||
"vary": "1.1.2",
|
||||
"web-push": "3.6.7",
|
||||
"ws": "8.18.1",
|
||||
"ws": "8.18.2",
|
||||
"xev": "3.0.2",
|
||||
"xmlbuilder": "15.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@jest/globals": "29.7.0",
|
||||
"@misskey-dev/eslint-plugin": "1.0.0",
|
||||
"@nestjs/platform-express": "11.0.12",
|
||||
"@swc/jest": "0.2.37",
|
||||
"@nestjs/platform-express": "11.1.0",
|
||||
"@swc/jest": "0.2.38",
|
||||
"@types/accepts": "1.3.7",
|
||||
"@types/archiver": "6.0.3",
|
||||
"@types/body-parser": "1.19.5",
|
||||
|
@ -208,21 +208,21 @@
|
|||
"@types/jsrsasign": "10.5.15",
|
||||
"@types/mime-types": "2.1.4",
|
||||
"@types/ms": "2.1.0",
|
||||
"@types/node": "22.13.14",
|
||||
"@types/node": "22.15.17",
|
||||
"@types/node-forge": "1.3.11",
|
||||
"@types/nodemailer": "6.4.17",
|
||||
"@types/oauth": "0.9.6",
|
||||
"@types/oauth2orize": "1.11.5",
|
||||
"@types/oauth2orize-pkce": "0.1.2",
|
||||
"@types/pg": "8.11.11",
|
||||
"@types/pg": "8.15.1",
|
||||
"@types/psl": "1.1.3",
|
||||
"@types/pug": "2.0.10",
|
||||
"@types/punycode.js": "npm:@types/punycode@2.1.4",
|
||||
"@types/punycode.js": "managed",
|
||||
"@types/qrcode": "1.5.5",
|
||||
"@types/random-seed": "0.3.5",
|
||||
"@types/ratelimiter": "3.4.6",
|
||||
"@types/rename": "1.0.7",
|
||||
"@types/sanitize-html": "2.15.0",
|
||||
"@types/sanitize-html": "2.16.0",
|
||||
"@types/semver": "7.7.0",
|
||||
"@types/simple-oauth2": "5.0.7",
|
||||
"@types/sinonjs__fake-timers": "8.1.5",
|
||||
|
@ -230,18 +230,18 @@
|
|||
"@types/tmp": "0.2.6",
|
||||
"@types/vary": "1.1.3",
|
||||
"@types/web-push": "3.6.4",
|
||||
"@types/ws": "8.18.0",
|
||||
"@types/ws": "8.18.1",
|
||||
"@typescript-eslint/eslint-plugin": "7.10.0",
|
||||
"@typescript-eslint/parser": "7.10.0",
|
||||
"aws-sdk-client-mock": "4.1.0",
|
||||
"cross-env": "7.0.3",
|
||||
"eslint": "8.57.1",
|
||||
"eslint-plugin-import": "2.31.0",
|
||||
"execa": "9.5.2",
|
||||
"execa": "9.5.3",
|
||||
"fkill": "9.0.0",
|
||||
"jest": "29.7.0",
|
||||
"jest-mock": "29.7.0",
|
||||
"nodemon": "3.1.9",
|
||||
"nodemon": "3.1.10",
|
||||
"pid-port": "1.0.2",
|
||||
"simple-oauth2": "5.1.0"
|
||||
}
|
||||
|
|
|
@ -127,6 +127,8 @@ type Source = {
|
|||
perUserNotificationsMaxCount?: number;
|
||||
deactivateAntennaThreshold?: number;
|
||||
pidFile: string;
|
||||
|
||||
extraHead?: string;
|
||||
};
|
||||
|
||||
export type Config = {
|
||||
|
@ -232,6 +234,7 @@ export type Config = {
|
|||
perUserNotificationsMaxCount: number;
|
||||
deactivateAntennaThreshold: number;
|
||||
pidFile: string;
|
||||
extraHead: string | undefined;
|
||||
};
|
||||
|
||||
const _filename = fileURLToPath(import.meta.url);
|
||||
|
@ -341,6 +344,7 @@ export function loadConfig(): Config {
|
|||
perUserNotificationsMaxCount: config.perUserNotificationsMaxCount ?? 500,
|
||||
deactivateAntennaThreshold: config.deactivateAntennaThreshold ?? (1000 * 60 * 60 * 24 * 7),
|
||||
pidFile: config.pidFile,
|
||||
extraHead: config.extraHead,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -99,7 +99,7 @@ export class SearchService {
|
|||
if (config.meilisearch?.scope) {
|
||||
this.meilisearchIndexScope = config.meilisearch.scope;
|
||||
}
|
||||
/*this.meilisearchNoteIndex.updateSettings({
|
||||
this.meilisearchNoteIndex.updateSettings({
|
||||
searchableAttributes: [
|
||||
'text',
|
||||
'cw',
|
||||
|
@ -120,11 +120,10 @@ export class SearchService {
|
|||
pagination: {
|
||||
maxTotalHits: 10000,
|
||||
},
|
||||
});*/
|
||||
});
|
||||
} else if (this.elasticsearch) {
|
||||
this.elasticsearchNoteIndex = `${config.elasticsearch!.index}`;
|
||||
this.elasticsearchIdField = `${config.host}_id`;
|
||||
/* 外部からindexさせるのでこの処理は不要
|
||||
this.elasticsearch.indices.exists({
|
||||
index: this.elasticsearchNoteIndex,
|
||||
}).then((indexExists: boolean) => {
|
||||
|
@ -178,7 +177,6 @@ export class SearchService {
|
|||
}).catch((error: any) => {
|
||||
this.logger.error('Error while checking if index exists', error);
|
||||
});
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -217,7 +215,6 @@ export class SearchService {
|
|||
primaryKey: 'id',
|
||||
});
|
||||
} else if (this.elasticsearch) {
|
||||
/* 外部からindexさせるのでこの処理は不要
|
||||
const body = {
|
||||
createdAt: createdAt.getTime(),
|
||||
userId: note.userId,
|
||||
|
@ -234,7 +231,6 @@ export class SearchService {
|
|||
}).catch((error: any) => {
|
||||
this.logger.error(error);
|
||||
});
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -245,14 +241,12 @@ export class SearchService {
|
|||
if (this.meilisearch) {
|
||||
await this.meilisearchNoteIndex?.deleteDocument(note.id);
|
||||
} else if (this.elasticsearch) {
|
||||
/* 外部からindexさせるのでこの処理は不要
|
||||
await this.elasticsearch.delete({
|
||||
index: `${this.elasticsearchNoteIndex}-${this.idService.parse(note.id).date.toISOString().slice(0, 7).replace(/-/g, '')}`,
|
||||
id: note.id,
|
||||
}).catch((error) => {
|
||||
this.logger.error(error);
|
||||
});
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -266,7 +260,7 @@ export class SearchService {
|
|||
query: {
|
||||
match_all: {},
|
||||
},
|
||||
}).catch((error) => {
|
||||
}).catch((error: any) => {
|
||||
this.logger.error(error);
|
||||
});
|
||||
}
|
||||
|
@ -383,7 +377,7 @@ export class SearchService {
|
|||
const noteIds = res.hits.hits.map((hit) => {
|
||||
const source = hit._source as Record<string, unknown>;
|
||||
return (source[this.elasticsearchIdField] as string) || null;
|
||||
}).filter((id): id is string => id !== null);
|
||||
}).filter((id: any): id is string => id !== null);
|
||||
if (noteIds.length === 0) return [];
|
||||
const notes = await this.notesRepository.findBy({
|
||||
id: In(noteIds),
|
||||
|
|
|
@ -17,6 +17,7 @@ import { InstanceActorService } from '@/core/InstanceActorService.js';
|
|||
import type { Config } from '@/config.js';
|
||||
import { DI } from '@/di-symbols.js';
|
||||
import { DEFAULT_POLICIES } from '@/core/RoleService.js';
|
||||
import { envOption } from '@/env.js';
|
||||
|
||||
@Injectable()
|
||||
export class MetaEntityService {
|
||||
|
@ -66,7 +67,7 @@ export class MetaEntityService {
|
|||
feedbackUrl: instance.feedbackUrl,
|
||||
impressumUrl: instance.impressumUrl,
|
||||
privacyPolicyUrl: instance.privacyPolicyUrl,
|
||||
disableRegistration: instance.disableRegistration,
|
||||
disableRegistration: instance.disableRegistration || envOption.disableRegistration,
|
||||
emailRequiredForSignup: instance.emailRequiredForSignup,
|
||||
canSkipInitialTutorial: instance.canSkipInitialTutorial,
|
||||
enableHcaptcha: instance.enableHcaptcha,
|
||||
|
|
|
@ -12,6 +12,7 @@ const envOption = {
|
|||
logJson: false,
|
||||
withLogTime: false,
|
||||
quiet: false,
|
||||
disableRegistration: false,
|
||||
};
|
||||
|
||||
for (const key of Object.keys(envOption) as (keyof typeof envOption)[]) {
|
||||
|
|
|
@ -79,4 +79,9 @@ export class MiSingleSignOnServiceProvider {
|
|||
default: true,
|
||||
})
|
||||
public wantAssertionsSigned: boolean;
|
||||
|
||||
@Column('boolean', {
|
||||
default: true,
|
||||
})
|
||||
public wantEmailAddressNormalized: boolean;
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@ import { FastifyReplyError } from '@/misc/fastify-reply-error.js';
|
|||
import { bindThis } from '@/decorators.js';
|
||||
import { L_CHARS, secureRndstr } from '@/misc/secure-rndstr.js';
|
||||
import { LoggerService } from '@/core/LoggerService.js';
|
||||
import { envOption } from '@/env.js';
|
||||
import { SigninService } from './SigninService.js';
|
||||
import type { FastifyRequest, FastifyReply } from 'fastify';
|
||||
import { randomUUID } from 'node:crypto';
|
||||
|
@ -136,7 +137,7 @@ export class SignupApiService {
|
|||
|
||||
let ticket: MiRegistrationTicket | null = null;
|
||||
|
||||
if (instance.disableRegistration) {
|
||||
if (instance.disableRegistration || envOption.disableRegistration) {
|
||||
if (invitationCode == null || typeof invitationCode !== 'string') {
|
||||
logger.error('Invalid request: invitation code is required.');
|
||||
reply.code(400);
|
||||
|
|
|
@ -84,6 +84,10 @@ export const meta = {
|
|||
type: 'boolean',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
wantEmailAddressNormalized: {
|
||||
type: 'boolean',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
} as const;
|
||||
|
@ -101,6 +105,7 @@ export const paramDef = {
|
|||
cipherAlgorithm: { type: 'string', nullable: true },
|
||||
wantAuthnRequestsSigned: { type: 'boolean', nullable: false, default: false },
|
||||
wantAssertionsSigned: { type: 'boolean', nullable: false, default: true },
|
||||
wantEmailAddressNormalized: { type: 'boolean', nullable: false, default: true },
|
||||
useCertificate: { type: 'boolean', nullable: false, default: true },
|
||||
secret: { type: 'string', nullable: true },
|
||||
},
|
||||
|
@ -157,6 +162,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
cipherAlgorithm: ps.cipherAlgorithm ? ps.cipherAlgorithm : null,
|
||||
wantAuthnRequestsSigned: ps.wantAuthnRequestsSigned,
|
||||
wantAssertionsSigned: ps.wantAssertionsSigned,
|
||||
wantEmailAddressNormalized: ps.wantEmailAddressNormalized,
|
||||
}).then(r => this.singleSignOnServiceProviderRepository.findOneByOrFail({ id: r.identifiers[0].id }));
|
||||
|
||||
this.moderationLogService.log(me, 'createSSOServiceProvider', {
|
||||
|
@ -178,6 +184,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
cipherAlgorithm: ssoServiceProvider.cipherAlgorithm,
|
||||
wantAuthnRequestsSigned: ssoServiceProvider.wantAuthnRequestsSigned,
|
||||
wantAssertionsSigned: ssoServiceProvider.wantAssertionsSigned,
|
||||
wantEmailAddressNormalized: ssoServiceProvider.wantEmailAddressNormalized,
|
||||
};
|
||||
});
|
||||
}
|
||||
|
|
|
@ -77,6 +77,10 @@ export const meta = {
|
|||
type: 'boolean',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
wantEmailAddressNormalized: {
|
||||
type: 'boolean',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -116,6 +120,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
cipherAlgorithm: service.cipherAlgorithm,
|
||||
wantAuthnRequestsSigned: service.wantAuthnRequestsSigned,
|
||||
wantAssertionsSigned: service.wantAssertionsSigned,
|
||||
wantEmailAddressNormalized: service.wantEmailAddressNormalized,
|
||||
}));
|
||||
});
|
||||
}
|
||||
|
|
|
@ -37,6 +37,7 @@ export const paramDef = {
|
|||
cipherAlgorithm: { type: 'string', nullable: true },
|
||||
wantAuthnRequestsSigned: { type: 'boolean', nullable: false },
|
||||
wantAssertionsSigned: { type: 'boolean', nullable: false },
|
||||
wantEmailAddressNormalized: { type: 'boolean', nullable: false },
|
||||
regenerateCertificate: { type: 'boolean', nullable: true },
|
||||
secret: { type: 'string', nullable: true },
|
||||
},
|
||||
|
@ -92,6 +93,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
cipherAlgorithm: ps.cipherAlgorithm !== '' ? ps.cipherAlgorithm : null,
|
||||
wantAuthnRequestsSigned: ps.wantAuthnRequestsSigned,
|
||||
wantAssertionsSigned: ps.wantAssertionsSigned,
|
||||
wantEmailAddressNormalized: ps.wantEmailAddressNormalized,
|
||||
});
|
||||
|
||||
const updatedService = await this.singleSignOnServiceProviderRepository.findOneByOrFail({ id: service.id });
|
||||
|
|
|
@ -180,7 +180,9 @@ export class JWTIdentifyProviderService {
|
|||
preferred_username: user.username,
|
||||
profile: `${this.config.url}/@${user.username}`,
|
||||
picture: user.avatarUrl ?? undefined,
|
||||
email: profile.emailVerified ? normalizeEmailAddress(profile.email) : `${user.username}@${this.config.hostname}`,
|
||||
email: profile.emailVerified
|
||||
? (ssoServiceProvider.wantEmailAddressNormalized ? normalizeEmailAddress(profile.email) : profile.email)
|
||||
: `${user.username}@users.${this.config.hostname}`,
|
||||
email_verified: profile.emailVerified,
|
||||
mfa_enabled: profile.twoFactorEnabled,
|
||||
updated_at: Math.floor((user.updatedAt?.getTime() ?? user.createdAt.getTime()) / 1000),
|
||||
|
|
|
@ -444,7 +444,9 @@ export class SAMLIdentifyProviderService {
|
|||
'saml:Subject': {
|
||||
'saml:NameID': {
|
||||
'@Format': 'urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress',
|
||||
'#text': profile.emailVerified ? normalizeEmailAddress(profile.email) : `${user.username}@${this.config.hostname}`,
|
||||
'#text': profile.emailVerified
|
||||
? (ssoServiceProvider.wantEmailAddressNormalized ? normalizeEmailAddress(profile.email) : profile.email)
|
||||
: `${user.username}@users.${this.config.hostname}`,
|
||||
},
|
||||
'saml:SubjectConfirmation': {
|
||||
'@Method': 'urn:oasis:names:tc:SAML:2.0:cm:bearer',
|
||||
|
@ -569,7 +571,9 @@ export class SAMLIdentifyProviderService {
|
|||
'@NameFormat': 'urn:oasis:names:tc:SAML:2.0:attrname-format:basic',
|
||||
'saml:AttributeValue': {
|
||||
'@xsi:type': 'xs:string',
|
||||
'#text': profile.emailVerified ? normalizeEmailAddress(profile.email) : `${user.username}@${this.config.hostname}`,
|
||||
'#text': profile.emailVerified
|
||||
? (ssoServiceProvider.wantEmailAddressNormalized ? normalizeEmailAddress(profile.email) : profile.email)
|
||||
: `${user.username}@users.${this.config.hostname}`,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
|
@ -197,6 +197,7 @@ export class ClientServerService {
|
|||
instanceUrl: this.config.url,
|
||||
metaJson: htmlSafeJsonStringify(await this.metaEntityService.packDetailed(meta)),
|
||||
now: Date.now(),
|
||||
extraHead: this.config.extraHead,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -433,7 +434,7 @@ export class ClientServerService {
|
|||
return await reply.sendFile('/robots.txt', staticAssets);
|
||||
});
|
||||
|
||||
// OpenSearch XML
|
||||
/* OpenSearch XML
|
||||
fastify.get('/opensearch.xml', async (request, reply) => {
|
||||
const meta = await this.metaService.fetch();
|
||||
|
||||
|
@ -450,6 +451,7 @@ export class ClientServerService {
|
|||
reply.header('Content-Type', 'application/opensearchdescription+xml');
|
||||
return await reply.send(content);
|
||||
});
|
||||
*/
|
||||
|
||||
//#endregion
|
||||
|
||||
|
|
|
@ -37,7 +37,6 @@ export class UrlPreviewService {
|
|||
@bindThis
|
||||
private wrap(url?: string | null): string | null {
|
||||
if (!url) return null;
|
||||
if (!RegExp(/^https?:\/\//).exec(url)) return url;
|
||||
|
||||
return appendQuery(
|
||||
`${this.config.mediaProxy}/preview/${encodeURIComponent(omitHttps(url))}`,
|
||||
|
|
|
@ -73,6 +73,8 @@ html
|
|||
|
||||
script(src=`/assets/boot.${version}.js`)
|
||||
|
||||
| !{extraHead}
|
||||
|
||||
body
|
||||
noscript: p
|
||||
| JavaScriptを有効にしてください
|
||||
|
|
|
@ -7,18 +7,12 @@ services:
|
|||
memlock: -1
|
||||
environment:
|
||||
DFLY_version_check: false
|
||||
DFLY_tcp_backlog: 2048
|
||||
DFLY_default_lua_flags: allow-undeclared-keys
|
||||
DFLY_pipeline_squash: 0
|
||||
DFLY_multi_exec_squash: false
|
||||
DFLY_conn_io_threads: 4
|
||||
DFLY_epoll_file_threads: 4
|
||||
DFLY_proactor_threads: 4
|
||||
ports:
|
||||
- "127.0.0.1:56312:6379"
|
||||
|
||||
dbtest:
|
||||
image: postgres:15
|
||||
image: postgres:17
|
||||
ports:
|
||||
- "127.0.0.1:54312:5432"
|
||||
environment:
|
||||
|
|
|
@ -25,7 +25,7 @@ describe('Drive', () => {
|
|||
|
||||
const marker = Math.random().toString();
|
||||
|
||||
const url = 'https://raw.githubusercontent.com/MisskeyIO/misskey/io/packages/backend/test/resources/Lenna.jpg';
|
||||
const url = 'https://raw.githubusercontent.com/MisskeyIO/misskey/main/packages/backend/test/resources/Lenna.jpg';
|
||||
|
||||
const catcher = makeStreamCatcher(
|
||||
alice,
|
||||
|
|
|
@ -104,7 +104,7 @@ describe('Webリソース', () => {
|
|||
{ path: '/flush', type: HTML },
|
||||
{ path: '/robots.txt', type: 'text/plain; charset=utf-8' },
|
||||
{ path: '/favicon.ico', type: 'image/vnd.microsoft.icon' },
|
||||
{ path: '/opensearch.xml', type: 'application/opensearchdescription+xml' },
|
||||
// { path: '/opensearch.xml', type: 'application/opensearchdescription+xml' },
|
||||
{ path: '/apple-touch-icon.png', type: 'image/png' },
|
||||
{ path: '/twemoji/2764.svg', type: 'image/svg+xml' },
|
||||
{ path: '/twemoji/2764-fe0f-200d-1f525.svg', type: 'image/svg+xml' },
|
||||
|
|
|
@ -43,7 +43,7 @@ describe('Note', () => {
|
|||
});
|
||||
|
||||
test('ファイルを添付できる', async () => {
|
||||
const file = await uploadUrl(alice, 'https://raw.githubusercontent.com/MisskeyIO/misskey/io/packages/backend/test/resources/Lenna.jpg');
|
||||
const file = await uploadUrl(alice, 'https://raw.githubusercontent.com/MisskeyIO/misskey/main/packages/backend/test/resources/Lenna.jpg');
|
||||
|
||||
const res = await api('notes/create', {
|
||||
fileIds: [file.id],
|
||||
|
@ -55,7 +55,7 @@ describe('Note', () => {
|
|||
}, 1000 * 10);
|
||||
|
||||
test('他人のファイルで怒られる', async () => {
|
||||
const file = await uploadUrl(bob, 'https://raw.githubusercontent.com/MisskeyIO/misskey/io/packages/backend/test/resources/Lenna.jpg');
|
||||
const file = await uploadUrl(bob, 'https://raw.githubusercontent.com/MisskeyIO/misskey/main/packages/backend/test/resources/Lenna.jpg');
|
||||
|
||||
const res = await api('notes/create', {
|
||||
text: 'test',
|
||||
|
|
|
@ -354,8 +354,8 @@ describe('Timelines', () => {
|
|||
await api('following/create', { userId: bob.id }, alice);
|
||||
await sleep(1000);
|
||||
const [bobFile, carolFile] = await Promise.all([
|
||||
uploadUrl(bob, 'https://raw.githubusercontent.com/MisskeyIO/misskey/io/packages/backend/test/resources/Lenna.png'),
|
||||
uploadUrl(carol, 'https://raw.githubusercontent.com/MisskeyIO/misskey/io/packages/backend/test/resources/Lenna.png'),
|
||||
uploadUrl(bob, 'https://raw.githubusercontent.com/MisskeyIO/misskey/main/packages/backend/test/resources/Lenna.png'),
|
||||
uploadUrl(carol, 'https://raw.githubusercontent.com/MisskeyIO/misskey/main/packages/backend/test/resources/Lenna.png'),
|
||||
]);
|
||||
const bobNote1 = await post(bob, { text: 'hi' });
|
||||
const bobNote2 = await post(bob, { fileIds: [bobFile.id] });
|
||||
|
@ -654,7 +654,7 @@ describe('Timelines', () => {
|
|||
test.concurrent('[withFiles: true] ファイル付きノートのみ含まれる', async () => {
|
||||
const [alice, bob] = await Promise.all([signup(), signup()]);
|
||||
|
||||
const file = await uploadUrl(bob, 'https://raw.githubusercontent.com/MisskeyIO/misskey/io/packages/backend/test/resources/Lenna.png');
|
||||
const file = await uploadUrl(bob, 'https://raw.githubusercontent.com/MisskeyIO/misskey/main/packages/backend/test/resources/Lenna.png');
|
||||
const bobNote1 = await post(bob, { text: 'hi' });
|
||||
const bobNote2 = await post(bob, { fileIds: [file.id] });
|
||||
|
||||
|
@ -794,7 +794,7 @@ describe('Timelines', () => {
|
|||
test.concurrent('[withFiles: true] ファイル付きノートのみ含まれる', async () => {
|
||||
const [alice, bob] = await Promise.all([signup(), signup()]);
|
||||
|
||||
const file = await uploadUrl(bob, 'https://raw.githubusercontent.com/MisskeyIO/misskey/io/packages/backend/test/resources/Lenna.png');
|
||||
const file = await uploadUrl(bob, 'https://raw.githubusercontent.com/MisskeyIO/misskey/main/packages/backend/test/resources/Lenna.png');
|
||||
const bobNote1 = await post(bob, { text: 'hi' });
|
||||
const bobNote2 = await post(bob, { fileIds: [file.id] });
|
||||
|
||||
|
@ -1008,7 +1008,7 @@ describe('Timelines', () => {
|
|||
|
||||
const list = await api('users/lists/create', { name: 'list' }, alice).then(res => res.body);
|
||||
await api('users/lists/push', { listId: list.id, userId: bob.id }, alice);
|
||||
const file = await uploadUrl(bob, 'https://raw.githubusercontent.com/MisskeyIO/misskey/io/packages/backend/test/resources/Lenna.png');
|
||||
const file = await uploadUrl(bob, 'https://raw.githubusercontent.com/MisskeyIO/misskey/main/packages/backend/test/resources/Lenna.png');
|
||||
const bobNote1 = await post(bob, { text: 'hi' });
|
||||
const bobNote2 = await post(bob, { fileIds: [file.id] });
|
||||
|
||||
|
@ -1167,7 +1167,7 @@ describe('Timelines', () => {
|
|||
test.concurrent('[withFiles: true] ファイル付きノートのみ含まれる', async () => {
|
||||
const [alice, bob] = await Promise.all([signup(), signup()]);
|
||||
|
||||
const file = await uploadUrl(bob, 'https://raw.githubusercontent.com/MisskeyIO/misskey/io/packages/backend/test/resources/Lenna.png');
|
||||
const file = await uploadUrl(bob, 'https://raw.githubusercontent.com/MisskeyIO/misskey/main/packages/backend/test/resources/Lenna.png');
|
||||
const bobNote1 = await post(bob, { text: 'hi' });
|
||||
const bobNote2 = await post(bob, { fileIds: [file.id] });
|
||||
|
||||
|
|
|
@ -17,8 +17,8 @@ describe('users/notes', () => {
|
|||
|
||||
beforeAll(async () => {
|
||||
alice = await signup({ username: 'alice' });
|
||||
const jpg = await uploadUrl(alice, 'https://raw.githubusercontent.com/MisskeyIO/misskey/io/packages/backend/test/resources/Lenna.jpg');
|
||||
const png = await uploadUrl(alice, 'https://raw.githubusercontent.com/MisskeyIO/misskey/io/packages/backend/test/resources/Lenna.png');
|
||||
const jpg = await uploadUrl(alice, 'https://raw.githubusercontent.com/MisskeyIO/misskey/main/packages/backend/test/resources/Lenna.jpg');
|
||||
const png = await uploadUrl(alice, 'https://raw.githubusercontent.com/MisskeyIO/misskey/main/packages/backend/test/resources/Lenna.png');
|
||||
jpgNote = await post(alice, {
|
||||
fileIds: [jpg.id],
|
||||
});
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
process.env.NODE_ENV = 'test';
|
||||
|
||||
import { jest } from '@jest/globals';
|
||||
import { IsNull, Not } from 'typeorm';
|
||||
import { ModuleMocker } from 'jest-mock';
|
||||
import { Test } from '@nestjs/testing';
|
||||
import { GlobalModule } from '@/GlobalModule.js';
|
||||
|
@ -103,10 +104,10 @@ describe('AnnouncementService', () => {
|
|||
|
||||
afterEach(async () => {
|
||||
await Promise.all([
|
||||
app.get(DI.metasRepository).delete({}),
|
||||
usersRepository.delete({}),
|
||||
announcementsRepository.delete({}),
|
||||
announcementReadsRepository.delete({}),
|
||||
app.get(DI.metasRepository).delete({ id: Not(IsNull()) }),
|
||||
usersRepository.delete({ id: Not(IsNull()) }),
|
||||
announcementsRepository.delete({ id: Not(IsNull()) }),
|
||||
announcementReadsRepository.delete({ id: Not(IsNull()) }),
|
||||
]);
|
||||
|
||||
await app.close();
|
||||
|
|
|
@ -8,6 +8,7 @@ import { UserEntityService } from '@/core/entities/UserEntityService.js';
|
|||
process.env.NODE_ENV = 'test';
|
||||
|
||||
import { jest } from '@jest/globals';
|
||||
import { IsNull, Not } from 'typeorm';
|
||||
import { ModuleMocker } from 'jest-mock';
|
||||
import { Test } from '@nestjs/testing';
|
||||
import * as lolex from '@sinonjs/fake-timers';
|
||||
|
@ -132,10 +133,10 @@ describe('RoleService', () => {
|
|||
clock.uninstall();
|
||||
|
||||
await Promise.all([
|
||||
app.get(DI.metasRepository).delete({}),
|
||||
usersRepository.delete({}),
|
||||
rolesRepository.delete({}),
|
||||
roleAssignmentsRepository.delete({}),
|
||||
app.get(DI.metasRepository).delete({ id: Not(IsNull()) }),
|
||||
usersRepository.delete({ id: Not(IsNull()) }),
|
||||
rolesRepository.delete({ id: Not(IsNull()) }),
|
||||
roleAssignmentsRepository.delete({ id: Not(IsNull()) }),
|
||||
]);
|
||||
|
||||
await app.close();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue