mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-18 00:02:28 +08:00
feat(services/config): add TriliumConfig Type
This commit is contained in:
parent
edeaca6d1f
commit
c7bd5e2c67
@ -17,7 +17,28 @@ if (!fs.existsSync(dataDir.CONFIG_INI_PATH)) {
|
|||||||
|
|
||||||
const iniConfig = ini.parse(fs.readFileSync(dataDir.CONFIG_INI_PATH, "utf-8"));
|
const iniConfig = ini.parse(fs.readFileSync(dataDir.CONFIG_INI_PATH, "utf-8"));
|
||||||
|
|
||||||
const config = {
|
export interface TriliumConfig {
|
||||||
|
General: {
|
||||||
|
instanceName: string;
|
||||||
|
noAuthentication: boolean;
|
||||||
|
noBackup: boolean;
|
||||||
|
noDesktopIcon: boolean;
|
||||||
|
};
|
||||||
|
Network: {
|
||||||
|
host: string;
|
||||||
|
port: string;
|
||||||
|
https: boolean;
|
||||||
|
certPath: string;
|
||||||
|
keyPath: string;
|
||||||
|
trustedReverseProxy: boolean | string;
|
||||||
|
};
|
||||||
|
Sync: {
|
||||||
|
syncServerHost: string;
|
||||||
|
syncServerTimeout: string;
|
||||||
|
syncProxy: string;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
const config: TriliumConfig = {
|
||||||
|
|
||||||
General: {
|
General: {
|
||||||
instanceName: process.env.TRILIUM_GENERAL_INSTANCENAME || iniConfig.General.instanceName,
|
instanceName: process.env.TRILIUM_GENERAL_INSTANCENAME || iniConfig.General.instanceName,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user