mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-18 00:02:28 +08:00
feat: 🎸 Use ini file to configure MFA
This commit is contained in:
parent
8d7339b50a
commit
94cd54f17e
@ -47,3 +47,29 @@ cookieMaxAge=1814400
|
|||||||
#syncServerHost=
|
#syncServerHost=
|
||||||
#syncServerTimeout=
|
#syncServerTimeout=
|
||||||
#syncServerProxy=
|
#syncServerProxy=
|
||||||
|
|
||||||
|
[MultiFactorAuthentication]
|
||||||
|
# Set to true to enable TOTP authentication
|
||||||
|
# This will require users to enter a one-time password in addition to their password to log in to Trilium
|
||||||
|
# This is a security feature that adds an extra layer of protection to your account
|
||||||
|
totpEnabled=false
|
||||||
|
|
||||||
|
# Set the secret key for TOTP authentication
|
||||||
|
# This is a security feature that adds an extra layer of protection to your account
|
||||||
|
totpSecret=
|
||||||
|
|
||||||
|
# Set to true to enable OAuth/OpenID authentication
|
||||||
|
# This will allow users to log in to Trilium using an account from another service, like Google, to verify their identity
|
||||||
|
ssoEnabled=false
|
||||||
|
|
||||||
|
# Set the base URL for OAuth/OpenID authentication
|
||||||
|
# This is the URL of the service that will be used to verify the user's identity
|
||||||
|
oauthBaseUrl=
|
||||||
|
|
||||||
|
# Set the client ID for OAuth/OpenID authentication
|
||||||
|
# This is the ID of the client that will be used to verify the user's identity
|
||||||
|
oauthClientId=
|
||||||
|
|
||||||
|
# Set the client secret for OAuth/OpenID authentication
|
||||||
|
# This is the secret of the client that will be used to verify the user's identity
|
||||||
|
oauthClientSecret=
|
||||||
|
@ -41,6 +41,14 @@ export interface TriliumConfig {
|
|||||||
syncServerTimeout: string;
|
syncServerTimeout: string;
|
||||||
syncProxy: string;
|
syncProxy: string;
|
||||||
};
|
};
|
||||||
|
MultiFactorAuthentication: {
|
||||||
|
totpEnabled: boolean;
|
||||||
|
totpSecret: string;
|
||||||
|
ssoEnabled: boolean;
|
||||||
|
oauthBaseUrl: string;
|
||||||
|
oauthClientId: string;
|
||||||
|
oauthClientSecret: string;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
//prettier-ignore
|
//prettier-ignore
|
||||||
@ -98,8 +106,27 @@ const config: TriliumConfig = {
|
|||||||
syncProxy:
|
syncProxy:
|
||||||
// additionally checking in iniConfig for inconsistently named syncProxy for backwards compatibility
|
// additionally checking in iniConfig for inconsistently named syncProxy for backwards compatibility
|
||||||
process.env.TRILIUM_SYNC_SERVER_PROXY || iniConfig?.Sync?.syncProxy || iniConfig?.Sync?.syncServerProxy || ""
|
process.env.TRILIUM_SYNC_SERVER_PROXY || iniConfig?.Sync?.syncProxy || iniConfig?.Sync?.syncServerProxy || ""
|
||||||
}
|
},
|
||||||
|
|
||||||
|
MultiFactorAuthentication: {
|
||||||
|
totpEnabled:
|
||||||
|
envToBoolean(process.env.TRILIUM_TOTPENABLED) || iniConfig?.MultiFactorAuthentication?.totpEnabled || false,
|
||||||
|
|
||||||
|
totpSecret:
|
||||||
|
process.env.TRILIUM_TOTPSECRET || iniConfig?.MultiFactorAuthentication?.totpSecret || "",
|
||||||
|
|
||||||
|
ssoEnabled:
|
||||||
|
envToBoolean(process.env.TRILIUM_SSO_ENABLED) || iniConfig?.MultiFactorAuthentication?.ssoEnabled || false,
|
||||||
|
|
||||||
|
oauthBaseUrl:
|
||||||
|
process.env.TRILIUM_OAUTH_BASEURL || iniConfig?.MultiFactorAuthentication?.oauthBaseUrl || "",
|
||||||
|
|
||||||
|
oauthClientId:
|
||||||
|
process.env.TRILIUM_OAUTH_CLIENTID || iniConfig?.MultiFactorAuthentication?.oauthClientId || "",
|
||||||
|
|
||||||
|
oauthClientSecret:
|
||||||
|
process.env.TRILIUM_OAUTH_CLIENTSECRET || iniConfig?.MultiFactorAuthentication?.oauthClientSecret || ""
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export default config;
|
export default config;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user