mirror of
https://github.com/bitwarden/web
synced 2025-12-11 05:43:16 +00:00
Set urls from config file (#1151)
* Set environment URLs in webpack config. * Provide non NULL dev server * QA env uses the pq TLD * Include icons in qa env * Move base configs to develop. local configurations should be done in the `./config/local.json` file. * Fix config override loading to default to development * Standardize url formatting * Limit QA settings to those set in production * Set self hosted in a config * Specify cloud instead of production Self hosted and cloud are both production environments. The ENV setting is used to specify the env type while NODE_ENV specifies whether development error handling and services. * Update config instructions * Remove invalid json * Change env `production` references to `cloud` * Fix formatting
This commit is contained in:
@@ -62,7 +62,7 @@ import { CipherService as CipherServiceAbstraction } from 'jslib-common/abstract
|
||||
import { CollectionService as CollectionServiceAbstraction } from 'jslib-common/abstractions/collection.service';
|
||||
import { CryptoService as CryptoServiceAbstraction } from 'jslib-common/abstractions/crypto.service';
|
||||
import { CryptoFunctionService as CryptoFunctionServiceAbstraction } from 'jslib-common/abstractions/cryptoFunction.service';
|
||||
import { EnvironmentService as EnvironmentServiceAbstraction } from 'jslib-common/abstractions/environment.service';
|
||||
import { EnvironmentService as EnvironmentServiceAbstraction, Urls } from 'jslib-common/abstractions/environment.service';
|
||||
import { EventService as EventLoggingServiceAbstraction } from 'jslib-common/abstractions/event.service';
|
||||
import { ExportService as ExportServiceAbstraction } from 'jslib-common/abstractions/export.service';
|
||||
import { FileUploadService as FileUploadServiceAbstraction } from 'jslib-common/abstractions/fileUpload.service';
|
||||
@@ -147,16 +147,9 @@ export function initFactory(): Function {
|
||||
return async () => {
|
||||
await (storageService as HtmlStorageService).init();
|
||||
|
||||
if (process.env.ENV !== 'production' || platformUtilsService.isSelfHost()) {
|
||||
environmentService.setUrls({ base: window.location.origin }, false);
|
||||
} else {
|
||||
environmentService.setUrls({
|
||||
base: window.location.origin,
|
||||
icons: 'https://icons.bitwarden.net',
|
||||
notifications: 'https://notifications.bitwarden.com',
|
||||
enterprise: 'https://portal.bitwarden.com',
|
||||
}, false);
|
||||
}
|
||||
const urls = process.env.URLS as Urls;
|
||||
urls.base ??= window.location.origin;
|
||||
environmentService.setUrls(urls, false);
|
||||
|
||||
setTimeout(() => notificationsService.init(), 3000);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user