144 lines
7.0 KiB
TypeScript
144 lines
7.0 KiB
TypeScript
/**
|
|
* Copyright since 2025 Mifos Initiative
|
|
*
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
*/
|
|
|
|
// The file contents for the current environment will overwrite these during build.
|
|
// The build system defaults to the dev environment which uses `environment.ts`, but if you do
|
|
// `ng build --env=prod` then `environment.prod.ts` will be used instead.
|
|
// The list of which env maps to which file can be found in `angular.json`.
|
|
|
|
// `.env.ts` is generated by the `npm run env` command
|
|
import env from './.env';
|
|
|
|
// The `window.env` object is loaded in the `index.html` file
|
|
const loadedEnv = window.env || {};
|
|
|
|
export const environment = {
|
|
production: false,
|
|
version: env.mifos_x.version,
|
|
hash: env.mifos_x.hash,
|
|
// For connecting to server running elsewhere update the tenant identifier
|
|
fineractPlatformTenantId: loadedEnv.fineractPlatformTenantId || 'default',
|
|
fineractPlatformTenantIds: loadedEnv.fineractPlatformTenantIds || 'default',
|
|
// For connecting to others servers running elsewhere update the base API URL
|
|
baseApiUrls:
|
|
loadedEnv.fineractApiUrls || 'https://demo.mifos.community,https://localhost:8443,' + window.location.origin,
|
|
// For connecting to server running elsewhere set the base API URL
|
|
baseApiUrl:
|
|
loadedEnv.fineractApiUrl ||
|
|
(loadedEnv.fineractApiUrls?.length > 0 ? loadedEnv.fineractApiUrls.split(',')[0] : window.location.origin),
|
|
allowServerSwitch: loadedEnv.allowServerSwitch || 'true',
|
|
apiProvider: loadedEnv.apiProvider || '/fineract-provider/api',
|
|
apiVersion: loadedEnv.apiVersion || '/v1',
|
|
apiActuator: loadedEnv.apiActuator || '/fineract-provider',
|
|
serverUrl: '',
|
|
/** Feature flag for Remember Me functionality */
|
|
enableRememberMe: false,
|
|
oauth: {
|
|
enabled: loadedEnv.oauthServerEnabled === true,
|
|
serverUrl: loadedEnv.oauthServerUrl || '',
|
|
logoutUrl: loadedEnv.oauthServerLogoutUrl || '',
|
|
appId: loadedEnv.oauthAppId || '',
|
|
authorizeUrl: loadedEnv.oauthAuthorizeUrl || '',
|
|
tokenUrl: loadedEnv.oauthTokenUrl || '',
|
|
redirectUri: loadedEnv.oauthRedirectUri || '',
|
|
scope: loadedEnv.oauthScope || ''
|
|
},
|
|
warningDialog: {
|
|
title: 'Warning',
|
|
content:
|
|
'This system is for authorized use only. Unauthorized access will result in possible legal action. By accessing this system, you acknowledge that you are authorized to do so and that all data stored and processed here is confidential.',
|
|
buttonText: 'Close'
|
|
},
|
|
defaultLanguage: loadedEnv.defaultLanguage || 'en-US',
|
|
supportedLanguages:
|
|
loadedEnv.supportedLanguages || 'cs-CS,de-DE,en-US,es-MX,fr-FR,it-IT,ko-KO,lt-LT,lv-LV,ne-NE,pt-PT,sw-SW',
|
|
defaultFormatDate: loadedEnv.defaultFormatDate || '',
|
|
defaultFormatDatetime: loadedEnv.defaultFormatDatetime || '',
|
|
preloadClients: loadedEnv['preloadClients'] || true,
|
|
|
|
defaultCharDelimiter: loadedEnv.defaultCharDelimiter || ',',
|
|
|
|
displayBackEndInfo: loadedEnv.displayBackEndInfo || 'true',
|
|
displayTenantSelector: loadedEnv.displayTenantSelector || 'true',
|
|
/** Production mode - when true, shows minimal hero with only branding at bottom */
|
|
productionMode: loadedEnv.productionMode === 'true' || loadedEnv.productionMode === true || false,
|
|
tenantLogoUrl: loadedEnv.tenantLogoUrl || 'assets/images/default_home.png',
|
|
tenantLogoUrlDark: loadedEnv.tenantLogoUrlDark || 'assets/images/white-mifos.png',
|
|
documentationBaseUrl: loadedEnv.documentationBaseUrl || 'https://mifosforge.jira.com/wiki',
|
|
// Time in seconds, default 60 seconds
|
|
waitTimeForNotifications: loadedEnv.waitTimeForNotifications || 60,
|
|
// Time in seconds, default 30 seconds
|
|
waitTimeForCOBCatchUp: loadedEnv.waitTimeForCOBCatchUp || 30,
|
|
session: {
|
|
timeout: {
|
|
idleTimeout: loadedEnv.sessionIdleTimeout || 300000 // 5 minutes
|
|
}
|
|
},
|
|
httpCacheEnabled: loadedEnv.httpCacheEnabled || false,
|
|
|
|
mifosInterbankTransfersApiUrl: window.env?.mifosInterbankTransfersApiUrl || 'https://apis.mifos.community',
|
|
mifosInterbankTransfersApiProvider: window.env?.mifosInterbankTransfersApiProvider || '/vnext1',
|
|
mifosInterbankTransfersApiVersion: window.env?.mifosInterbankTransfersApiVersion || '/v1.0',
|
|
mifosInterbankTransfersEnabled:
|
|
window.env?.mifosInterbankTransfersEnabled !== 'false' && window.env?.mifosInterbankTransfersEnabled !== false,
|
|
|
|
/** Remittance Module Integration */
|
|
mifosRemittanceApiUrl: window.env?.mifosRemittanceApiClientUrl || '',
|
|
mifosRemittanceApiProvider: window.env?.mifosRemittanceApiProvider || '',
|
|
mifosRemittanceApiVersion: window.env?.mifosRemittanceApiVersion || '',
|
|
mifosRemittanceEnabled:
|
|
loadedEnv['mifosRemittanceEnabled'] !== 'false' && loadedEnv['mifosRemittanceEnabled'] !== false,
|
|
mifosRemittanceApiHeader: window.env?.mifosRemittanceApiClientHeader || '',
|
|
mifosRemittanceApiKey: window.env?.mifosRemittanceApiClientKey || '',
|
|
|
|
/**
|
|
* External National ID System Integration
|
|
* When enabled, client creation/editing will lookup external National ID
|
|
* and auto-fill client details (name, DOB, gender) from the external system.
|
|
*/
|
|
enableExternalNationalIdSystem:
|
|
loadedEnv.enableExternalNationalIdSystem === 'true' || loadedEnv.enableExternalNationalIdSystem === true || false,
|
|
externalNationalIdSystemUrl: loadedEnv.externalNationalIdSystemUrl || '',
|
|
externalNationalIdSystemApiHeader: loadedEnv.externalNationalIdSystemApiHeader || '',
|
|
externalNationalIdSystemApiKey: loadedEnv.externalNationalIdSystemApiKey || '',
|
|
externalNationalIdRegex: loadedEnv.externalNationalIdRegex || '',
|
|
|
|
minPasswordLength: loadedEnv.minPasswordLength || 12,
|
|
|
|
/**
|
|
* Hide client data information (mask client names with *)
|
|
* Set via MIFOS_COMPLIANCE_HIDE_CLIENT_DATA env var
|
|
*/
|
|
complianceHideClientData:
|
|
loadedEnv.complianceHideClientData === 'true' || loadedEnv.complianceHideClientData === true || false,
|
|
|
|
/**
|
|
* Enable Role-Based Access Control (RBAC) for menus and buttons
|
|
* When enabled, menus/buttons visibility is controlled by user permissions
|
|
* When disabled (default), shows all menus/buttons for backward compatibility
|
|
* Set via MIFOS_PRODUCTION_MODE_ENABLE_RBAC env var
|
|
*/
|
|
productionModeEnableRBAC:
|
|
loadedEnv.productionModeEnableRBAC === 'true' || loadedEnv.productionModeEnableRBAC === true || false,
|
|
|
|
OIDC: {
|
|
// Support legacy FINERACT_PLUGIN_OIDC_* variable names for backward compatibility
|
|
oidcServerEnabled:
|
|
loadedEnv.oidcServerEnabled === true ||
|
|
loadedEnv.oidcServerEnabled === 'true' ||
|
|
loadedEnv.FINERACT_PLUGIN_OIDC_ENABLED === 'true',
|
|
oidcBaseUrl: loadedEnv.oidcBaseUrl || loadedEnv.FINERACT_PLUGIN_OIDC_BASE_URL || '',
|
|
oidcClientId: loadedEnv.oidcClientId || loadedEnv.FINERACT_PLUGIN_OIDC_CLIENT_ID || '',
|
|
oidcApiUrl: loadedEnv.oidcApiUrl || loadedEnv.FINERACT_PLUGIN_OIDC_API_URL || '',
|
|
oidcFrontUrl: loadedEnv.oidcFrontUrl || loadedEnv.FINERACT_PLUGIN_OIDC_FRONTEND_URL || ''
|
|
}
|
|
};
|
|
|
|
// Server URL
|
|
environment.serverUrl = `${environment.baseApiUrl}${environment.apiProvider}${environment.apiVersion}`;
|