feat(server): allow customize server external url (#7270)

closes https://github.com/toeverything/AFFiNE/issues/7252
This commit is contained in:
forehalo
2024-06-19 12:03:36 +00:00
parent 9746ddb5e0
commit d34c5c42ef
7 changed files with 105 additions and 56 deletions
@@ -1,29 +1,25 @@
import { defineStartupConfig, ModuleConfig } from '../../fundamentals/config';
export interface ServerStartupConfigurations {
/**
* Base url of AFFiNE server, used for generating external urls.
* default to be `[AFFiNE.protocol]://[AFFiNE.host][:AFFiNE.port]?[AFFiNE.path]` if not specified
*/
externalUrl: string;
/**
* Whether the server is hosted on a ssl enabled domain
*/
https: boolean;
/**
* where the server get deployed.
*
* @default 'localhost'
* @env AFFINE_SERVER_HOST
* where the server get deployed(FQDN).
*/
host: string;
/**
* which port the server will listen on
*
* @default 3010
* @env AFFINE_SERVER_PORT
*/
port: number;
/**
* subpath where the server get deployed if there is.
*
* @default '' // empty string
* @env AFFINE_SERVER_SUB_PATH
*/
path: string;
}
@@ -35,6 +31,7 @@ declare module '../../fundamentals/config' {
}
defineStartupConfig('server', {
externalUrl: '',
https: false,
host: 'localhost',
port: 3010,