X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/6ddbc50bc04b9bedce3f54cf69660fc819fce67a..bf6ffb898a38a806ea0dd98daca7b3801923b62f:/src/common/config.ts diff --git a/src/common/config.ts b/src/common/config.ts index 28d4855b47..2518c95eda 100644 --- a/src/common/config.ts +++ b/src/common/config.ts @@ -51,7 +51,6 @@ export interface ClusterConfigJSON { }; Workbench: { ArvadosDocsite: string; - VocabularyURL: string; FileViewersConfigURL: string; WelcomePageHTML: string; InactivePageHTML: string; @@ -89,7 +88,8 @@ export interface ClusterConfigJSON { Value: string, Protected?: boolean, } - } + }, + TrustAllContent: boolean }; Volumes: { [key: string]: { @@ -203,15 +203,10 @@ remove the entire ${varName} entry from ${WORKBENCH_CONFIG_URL}`); } config.fileViewersConfigUrl = fileViewerConfigUrl; - let vocabularyUrl; if (workbenchConfig.VOCABULARY_URL !== undefined) { - warnLocalConfig("VOCABULARY_URL"); - vocabularyUrl = workbenchConfig.VOCABULARY_URL; - } - else { - vocabularyUrl = config.clusterConfig.Workbench.VocabularyURL || "/vocabulary-example.json"; + console.warn(`A value for VOCABULARY_URL was found in ${WORKBENCH_CONFIG_URL}. It will be ignored as the cluster already provides its own endpoint, you can safely remove it.`) } - config.vocabularyUrl = vocabularyUrl; + config.vocabularyUrl = getVocabularyURL(workbenchConfig.API_HOST); return { config, apiHost: workbenchConfig.API_HOST }; }); @@ -239,7 +234,6 @@ export const mockClusterConfigJSON = (config: Partial): Clust }, Workbench: { ArvadosDocsite: "", - VocabularyURL: "", FileViewersConfigURL: "", WelcomePageHTML: "", InactivePageHTML: "", @@ -271,6 +265,7 @@ export const mockClusterConfigJSON = (config: Partial): Clust }, Collections: { ForwardSlashNameSubstitution: "", + TrustAllContent: false, }, Volumes: {}, ...config @@ -313,5 +308,7 @@ const getDefaultConfig = (): WorkbenchConfig => { export const ARVADOS_API_PATH = "arvados/v1"; export const CLUSTER_CONFIG_PATH = "arvados/v1/config"; +export const VOCABULARY_PATH = "arvados/v1/vocabulary"; export const DISCOVERY_DOC_PATH = "discovery/v1/apis/arvados/v1/rest"; -export const getClusterConfigURL = (apiHost: string) => `${window.location.protocol}//${apiHost}/${CLUSTER_CONFIG_PATH}?nocache=${(new Date()).getTime()}`; +export const getClusterConfigURL = (apiHost: string) => `https://${apiHost}/${CLUSTER_CONFIG_PATH}?nocache=${(new Date()).getTime()}`; +export const getVocabularyURL = (apiHost: string) => `https://${apiHost}/${VOCABULARY_PATH}?nocache=${(new Date()).getTime()}`;