convert Authorized Fetch to a setting and add support for hybrid mode (essential metadata only)
This commit is contained in:
parent
e3d949ced6
commit
a35c2f214b
28 changed files with 517 additions and 103 deletions
|
|
@ -8,6 +8,7 @@ import type { MiMeta } from '@/models/Meta.js';
|
|||
import { ModerationLogService } from '@/core/ModerationLogService.js';
|
||||
import { Endpoint } from '@/server/api/endpoint-base.js';
|
||||
import { MetaService } from '@/core/MetaService.js';
|
||||
import { instanceUnsignedFetchOptions } from '@/const.js';
|
||||
|
||||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
|
@ -205,6 +206,11 @@ export const paramDef = {
|
|||
type: 'string',
|
||||
},
|
||||
},
|
||||
allowUnsignedFetch: {
|
||||
type: 'string',
|
||||
enum: instanceUnsignedFetchOptions,
|
||||
nullable: false,
|
||||
},
|
||||
},
|
||||
required: [],
|
||||
} as const;
|
||||
|
|
@ -753,6 +759,10 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
set.federationHosts = ps.federationHosts.filter(Boolean).map(x => x.toLowerCase());
|
||||
}
|
||||
|
||||
if (ps.allowUnsignedFetch !== undefined) {
|
||||
set.allowUnsignedFetch = ps.allowUnsignedFetch;
|
||||
}
|
||||
|
||||
const before = await this.metaService.fetch(true);
|
||||
|
||||
await this.metaService.update(set);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue