mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-19 02:56:23 +08:00
chore(server): hide not configurable module (#11406)
This commit is contained in:
@@ -3,42 +3,6 @@
|
||||
"title": "AFFiNE Application Configuration",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"redis": {
|
||||
"type": "object",
|
||||
"description": "Configuration for redis module",
|
||||
"properties": {
|
||||
"db": {
|
||||
"type": "number",
|
||||
"description": "The database index of redis server to be used(Must be less than 10).\n@default 0\n@environment `REDIS_SERVER_DATABASE`",
|
||||
"default": 0
|
||||
},
|
||||
"host": {
|
||||
"type": "string",
|
||||
"description": "The host of the redis server.\n@default \"localhost\"\n@environment `REDIS_SERVER_HOST`",
|
||||
"default": "localhost"
|
||||
},
|
||||
"port": {
|
||||
"type": "number",
|
||||
"description": "The port of the redis server.\n@default 6379\n@environment `REDIS_SERVER_PORT`",
|
||||
"default": 6379
|
||||
},
|
||||
"username": {
|
||||
"type": "string",
|
||||
"description": "The username of the redis server.\n@default \"\"\n@environment `REDIS_SERVER_USERNAME`",
|
||||
"default": ""
|
||||
},
|
||||
"password": {
|
||||
"type": "string",
|
||||
"description": "The password of the redis server.\n@default \"\"\n@environment `REDIS_SERVER_PASSWORD`",
|
||||
"default": ""
|
||||
},
|
||||
"ioredis": {
|
||||
"type": "object",
|
||||
"description": "The config for the ioredis client.\n@default {}\n@link https://github.com/luin/ioredis",
|
||||
"default": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
"metrics": {
|
||||
"type": "object",
|
||||
"description": "Configuration for metrics module",
|
||||
@@ -50,19 +14,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"graphql": {
|
||||
"type": "object",
|
||||
"description": "Configuration for graphql module",
|
||||
"properties": {
|
||||
"apolloDriverConfig": {
|
||||
"type": "object",
|
||||
"description": "The config for underlying nestjs GraphQL and apollo driver engine.\n@default {\"introspection\":true}\n@link https://docs.nestjs.com/graphql/quick-start",
|
||||
"default": {
|
||||
"introspection": true
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"crypto": {
|
||||
"type": "object",
|
||||
"description": "Configuration for crypto module",
|
||||
@@ -92,10 +43,8 @@
|
||||
},
|
||||
"worker": {
|
||||
"type": "object",
|
||||
"description": "The config for job workers\n@default {\"defaultWorkerOptions\":{}}\n@link https://api.docs.bullmq.io/interfaces/v5.WorkerOptions.html",
|
||||
"default": {
|
||||
"defaultWorkerOptions": {}
|
||||
}
|
||||
"description": "The config for job workers\n@default {}\n@link https://api.docs.bullmq.io/interfaces/v5.WorkerOptions.html",
|
||||
"default": {}
|
||||
},
|
||||
"queues.copilot": {
|
||||
"type": "object",
|
||||
@@ -200,22 +149,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"db": {
|
||||
"type": "object",
|
||||
"description": "Configuration for db module",
|
||||
"properties": {
|
||||
"datasourceUrl": {
|
||||
"type": "string",
|
||||
"description": "The datasource url for the prisma client.\n@default \"postgresql://localhost:5432/affine\"\n@environment `DATABASE_URL`",
|
||||
"default": "postgresql://localhost:5432/affine"
|
||||
},
|
||||
"prisma": {
|
||||
"type": "object",
|
||||
"description": "The config for the prisma client.\n@default {}\n@link https://www.prisma.io/docs/reference/api-reference/prisma-client-reference",
|
||||
"default": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
"auth": {
|
||||
"type": "object",
|
||||
"description": "Configuration for auth module",
|
||||
|
||||
@@ -5,8 +5,18 @@ import '../src/app.module';
|
||||
import fs from 'node:fs';
|
||||
import { ProjectRoot } from '@affine-tools/utils/path';
|
||||
import { Package } from '@affine-tools/utils/workspace';
|
||||
import { getDescriptors, ConfigDescriptor } from '../src/base/config/register';
|
||||
import { pick } from 'lodash-es';
|
||||
import {
|
||||
getDescriptors as getAllDescriptors,
|
||||
ConfigDescriptor,
|
||||
} from '../src/base/config/register';
|
||||
|
||||
const IGNORED_MODULES = new Set(['db', 'redis', 'graphql']);
|
||||
|
||||
function getDescriptors() {
|
||||
return getAllDescriptors().filter(
|
||||
({ module }) => !IGNORED_MODULES.has(module)
|
||||
);
|
||||
}
|
||||
|
||||
interface PropertySchema {
|
||||
description: string;
|
||||
|
||||
@@ -1,49 +1,10 @@
|
||||
{
|
||||
"redis": {
|
||||
"db": {
|
||||
"type": "Number",
|
||||
"desc": "The database index of redis server to be used(Must be less than 10).",
|
||||
"env": "REDIS_SERVER_DATABASE"
|
||||
},
|
||||
"host": {
|
||||
"type": "String",
|
||||
"desc": "The host of the redis server.",
|
||||
"env": "REDIS_SERVER_HOST"
|
||||
},
|
||||
"port": {
|
||||
"type": "Number",
|
||||
"desc": "The port of the redis server.",
|
||||
"env": "REDIS_SERVER_PORT"
|
||||
},
|
||||
"username": {
|
||||
"type": "String",
|
||||
"desc": "The username of the redis server.",
|
||||
"env": "REDIS_SERVER_USERNAME"
|
||||
},
|
||||
"password": {
|
||||
"type": "String",
|
||||
"desc": "The password of the redis server.",
|
||||
"env": "REDIS_SERVER_PASSWORD"
|
||||
},
|
||||
"ioredis": {
|
||||
"type": "Object",
|
||||
"desc": "The config for the ioredis client.",
|
||||
"link": "https://github.com/luin/ioredis"
|
||||
}
|
||||
},
|
||||
"metrics": {
|
||||
"enabled": {
|
||||
"type": "Boolean",
|
||||
"desc": "Enable metric and tracing collection"
|
||||
}
|
||||
},
|
||||
"graphql": {
|
||||
"apolloDriverConfig": {
|
||||
"type": "Object",
|
||||
"desc": "The config for underlying nestjs GraphQL and apollo driver engine.",
|
||||
"link": "https://docs.nestjs.com/graphql/quick-start"
|
||||
}
|
||||
},
|
||||
"crypto": {
|
||||
"privateKey": {
|
||||
"type": "String",
|
||||
@@ -104,18 +65,6 @@
|
||||
"desc": "How many bytes or characters a message can be, before closing the session (to avoid DoS)."
|
||||
}
|
||||
},
|
||||
"db": {
|
||||
"datasourceUrl": {
|
||||
"type": "String",
|
||||
"desc": "The datasource url for the prisma client.",
|
||||
"env": "DATABASE_URL"
|
||||
},
|
||||
"prisma": {
|
||||
"type": "Object",
|
||||
"desc": "The config for the prisma client.",
|
||||
"link": "https://www.prisma.io/docs/reference/api-reference/prisma-client-reference"
|
||||
}
|
||||
},
|
||||
"auth": {
|
||||
"allowSignup": {
|
||||
"type": "Boolean",
|
||||
|
||||
@@ -35,13 +35,10 @@ type ConfigGroup<T extends AppConfigModule> = {
|
||||
}>[];
|
||||
};
|
||||
const IGNORED_MODULES: (keyof AppConfig)[] = [
|
||||
'db',
|
||||
'redis',
|
||||
'graphql',
|
||||
'copilot', // not ready
|
||||
];
|
||||
|
||||
if (!environment.isSelfHosted) {
|
||||
if (environment.isSelfHosted) {
|
||||
IGNORED_MODULES.push('payment');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user