diff --git a/Dockerfile b/Dockerfile index 217a0b8d3..7a606e82a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -41,94 +41,102 @@ ENV USE_DYNAMIC_WEBAPI_URL="false" ENV DYNAMIC_WEBAPI_SUFFIX="/WebAPI/" ENV WEBAPI_URL="http://localhost:8080/WebAPI/" ENV CONFIG_PATH="/etc/atlas/config-local.js" -ENV APP_NAME="OHDSI" -ENV COHORT_COMPARISON_RESULTS="false" -ENV USER_AUTHENTICATION="false" -ENV PLP_RESULTS="false" -ENV CLEAR_LOCAL_STORAGE="false" -ENV DISABLE_BROWSER_CHECK="false" -ENV ENABLE_PERMISSIONS_MGMT="true" -ENV CACHE_SOURCES="false" -ENV POLL_INTERVAL="60000" -ENV SKIP_LOGIN="false" -ENV USE_EXECUTION_ENGINE="false" -ENV VIEW_PROFILE_DATES="false" -ENV ENABLE_COSTS="false" -ENV SUPPORT_URL="https://github.com/ohdsi/atlas/issues" -ENV SUPPORT_MAIL="atlasadmin@your.org" -ENV FEEDBACK_CONTACTS="For access or questions concerning the Atlas application please contact:" -ENV FEEDBACK_HTML="" -ENV COMPANYINFO_HTML="" -ENV COMPANYINFO_SHOW="true" -ENV DEFAULT_LOCALE="en" - -ENV WIN_PROVIDER_ENABLED="false" -ENV WIN_PROVIDER_NAME="Windows" -ENV WIN_PROVIDER_URL="user/login/windows" -ENV WIN_PROVIDER_AJAX="true" -ENV WIN_PROVIDER_ICON="fab fa-windows" - -ENV KERB_PROVIDER_ENABLED="false" -ENV KERB_PROVIDER_NAME="Kerberos" -ENV KERB_PROVIDER_URL="user/login/kerberos" -ENV KERB_PROVIDER_AJAX="true" -ENV KERB_PROVIDER_ICON="fab fa-windows" - -ENV OID_PROVIDER_ENABLED="false" -ENV OID_PROVIDER_NAME="OpenID Connect" -ENV OID_PROVIDER_URL="user/login/openid" -ENV OID_PROVIDER_AJAX="false" -ENV OID_PROVIDER_ICON="fa fa-openid" - -ENV GGL_PROVIDER_ENABLED="false" -ENV GGL_PROVIDER_NAME="Google" -ENV GGL_PROVIDER_URL="user/oauth/google" -ENV GGL_PROVIDER_AJAX="false" -ENV GGL_PROVIDER_ICON="fab fa-google" - -ENV FB_PROVIDER_ENABLED="false" -ENV FB_PROVIDER_NAME="Facebook" -ENV FB_PROVIDER_URL="user/oauth/facebook" -ENV FB_PROVIDER_AJAX="false" -ENV FB_PROVIDER_ICON="fab fa-facebook-f" - -ENV GH_PROVIDER_ENABLED="false" -ENV GH_PROVIDER_NAME="Github" -ENV GH_PROVIDER_URL="user/oauth/github" -ENV GH_PROVIDER_AJAX="false" -ENV GH_PROVIDER_ICON="fab fa-github" - -ENV DB_PROVIDER_ENABLED="false" -ENV DB_PROVIDER_NAME="DB" -ENV DB_PROVIDER_URL="user/login/db" -ENV DB_PROVIDER_AJAX="true" -ENV DB_PROVIDER_ICON="fa fa-database" -ENV DB_PROVIDER_CREDFORM="true" - -ENV LDAP_PROVIDER_ENABLED="false" -ENV LDAP_PROVIDER_NAME="LDAP" -ENV LDAP_PROVIDER_URL="user/login/ldap" -ENV LDAP_PROVIDER_AJAX="true" -ENV LDAP_PROVIDER_ICON="fa fa-cubes" -ENV LDAP_PROVIDER_CREDFORM="true" - -ENV SAML_PROVIDER_ENABLED="false" -ENV SAML_PROVIDER_NAME="SAML" -ENV SAML_PROVIDER_URL="user/login/saml" -ENV SAML_PROVIDER_AJAX="false" -ENV SAML_PROVIDER_ICON="fab fa-openid" - -ENV AD_PROVIDER_ENABLED="false" -ENV AD_PROVIDER_NAME="Active Directory LDAP" -ENV AD_PROVIDER_URL="user/login/ad" -ENV AD_PROVIDER_AJAX="true" -ENV AD_PROVIDER_ICON="fa fa-cubes" -ENV AD_PROVIDER_CREDFORM="true" - -ENV ENABLE_TANDCS="true" -ENV ENABLE_PERSONCOUNT="true" -ENV ENABLE_TAGGING_SECTION="false" -ENV REFRESH_TOKEN_THRESHOLD="240" +ENV ATLAS_INSTANCE_NAME="OHDSI" +ENV ATLAS_COHORT_COMPARISON_RESULTS_ENABLED="false" +ENV ATLAS_USER_AUTH_ENABLED="false" +ENV ATLAS_PLP_RESULTS_ENABLED="false" +ENV ATLAS_CLEAR_LOCAL_STORAGE="false" +ENV ATLAS_DISABLE_BROWSER_CHECK="false" +ENV ATLAS_ENABLE_PERMISSIONS_MGMT="true" +ENV ATLAS_CACHE_SOURCES="false" +ENV ATLAS_POLL_INTERVAL="60000" +ENV ATLAS_SKIP_LOGIN="false" +ENV ATLAS_USE_EXECUTION_ENGINE="false" +ENV ATLAS_VIEW_PROFILE_DATES="false" +ENV ATLAS_ENABLE_COSTS="false" +ENV ATLAS_SUPPORT_URL="https://github.com/ohdsi/atlas/issues" +ENV ATLAS_SUPPORT_MAIL="atlasadmin@your.org" +ENV ATLAS_FEEDBACK_CONTACTS="For access or questions concerning the Atlas application please contact:" +ENV ATLAS_FEEDBACK_HTML="" +ENV ATLAS_COMPANYINFO_HTML="" +ENV ATLAS_COMPANYINFO_SHOW="true" +ENV ATLAS_DEFAULT_LOCALE="en" + +ENV ATLAS_SECURITY_WIN_PROVIDER_ENABLED="false" +ENV ATLAS_SECURITY_WIN_PROVIDER_NAME="Windows" +ENV ATLAS_SECURITY_WIN_PROVIDER_URL="user/login/windows" +ENV ATLAS_SECURITY_WIN_PROVIDER_AJAX="true" +ENV ATLAS_SECURITY_WIN_PROVIDER_ICON="fab fa-windows" + +ENV ATLAS_SECURITY_KERB_PROVIDER_ENABLED="false" +ENV ATLAS_SECURITY_KERB_PROVIDER_NAME="Kerberos" +ENV ATLAS_SECURITY_KERB_PROVIDER_URL="user/login/kerberos" +ENV ATLAS_SECURITY_KERB_PROVIDER_AJAX="true" +ENV ATLAS_SECURITY_KERB_PROVIDER_ICON="fab fa-windows" + +ENV ATLAS_SECURITY_OID_PROVIDER_ENABLED="false" +ENV ATLAS_SECURITY_OID_PROVIDER_NAME="OpenID Connect" +ENV ATLAS_SECURITY_OID_PROVIDER_URL="user/login/openid" +ENV ATLAS_SECURITY_OID_PROVIDER_AJAX="false" +ENV ATLAS_SECURITY_OID_PROVIDER_ICON="fa fa-openid" + +ENV ATLAS_SECURITY_GGL_PROVIDER_ENABLED="false" +ENV ATLAS_SECURITY_GGL_PROVIDER_NAME="Google" +ENV ATLAS_SECURITY_GGL_PROVIDER_URL="user/oauth/google" +ENV ATLAS_SECURITY_GGL_PROVIDER_AJAX="false" +ENV ATLAS_SECURITY_GGL_PROVIDER_ICON="fab fa-google" + +ENV ATLAS_SECURITY_FB_PROVIDER_ENABLED="false" +ENV ATLAS_SECURITY_FB_PROVIDER_NAME="Facebook" +ENV ATLAS_SECURITY_FB_PROVIDER_URL="user/oauth/facebook" +ENV ATLAS_SECURITY_FB_PROVIDER_AJAX="false" +ENV ATLAS_SECURITY_FB_PROVIDER_ICON="fab fa-facebook-f" + +ENV ATLAS_SECURITY_GH_PROVIDER_ENABLED="false" +ENV ATLAS_SECURITY_GH_PROVIDER_NAME="Github" +ENV ATLAS_SECURITY_GH_PROVIDER_URL="user/oauth/github" +ENV ATLAS_SECURITY_GH_PROVIDER_AJAX="false" +ENV ATLAS_SECURITY_GH_PROVIDER_ICON="fab fa-github" + +ENV ATLAS_SECURITY_DB_PROVIDER_ENABLED="false" +ENV ATLAS_SECURITY_DB_PROVIDER_NAME="DB" +ENV ATLAS_SECURITY_DB_PROVIDER_URL="user/login/db" +ENV ATLAS_SECURITY_DB_PROVIDER_AJAX="true" +ENV ATLAS_SECURITY_DB_PROVIDER_ICON="fa fa-database" +ENV ATLAS_SECURITY_DB_PROVIDER_CREDFORM="true" + +ENV ATLAS_SECURITY_LDAP_PROVIDER_ENABLED="false" +ENV ATLAS_SECURITY_LDAP_PROVIDER_NAME="LDAP" +ENV ATLAS_SECURITY_LDAP_PROVIDER_URL="user/login/ldap" +ENV ATLAS_SECURITY_LDAP_PROVIDER_AJAX="true" +ENV ATLAS_SECURITY_LDAP_PROVIDER_ICON="fa fa-cubes" +ENV ATLAS_SECURITY_LDAP_PROVIDER_CREDFORM="true" + +ENV ATLAS_SECURITY_SAML_PROVIDER_ENABLED="false" +ENV ATLAS_SECURITY_SAML_PROVIDER_NAME="SAML" +ENV ATLAS_SECURITY_SAML_PROVIDER_URL="user/login/saml" +ENV ATLAS_SECURITY_SAML_PROVIDER_AJAX="false" +ENV ATLAS_SECURITY_SAML_PROVIDER_ICON="fab fa-openid" + +ENV ATLAS_SECURITY_AD_PROVIDER_ENABLED="false" +ENV ATLAS_SECURITY_AD_PROVIDER_NAME="Active Directory LDAP" +ENV ATLAS_SECURITY_AD_PROVIDER_URL="user/login/ad" +ENV ATLAS_SECURITY_AD_PROVIDER_AJAX="true" +ENV ATLAS_SECURITY_AD_PROVIDER_ICON="fa fa-cubes" +ENV ATLAS_SECURITY_AD_PROVIDER_CREDFORM="true" + +# for existing broadsea implementations +ENV ATLAS_SECURITY_PROVIDER_ENABLED="true" +ENV ATLAS_SECURITY_PROVIDER_NAME="none" +ENV ATLAS_SECURITY_PROVIDER_TYPE="none" +ENV ATLAS_SECURITY_USE_AJAX="false" +ENV ATLAS_SECURITY_PROVIDER_ICON="fa-cubes" +ENV ATLAS_SECURITY_USE_FORM="false" + +ENV ATLAS_ENABLE_TANDCS="true" +ENV ATLAS_ENABLE_PERSONCOUNT="true" +ENV ATLAS_ENABLE_TAGGING_SECTION="false" +ENV ATLAS_REFRESH_TOKEN_THRESHOLD="240" # Configure webserver COPY ./docker/nginx-default.conf /etc/nginx/conf.d/default.conf diff --git a/docker/config-local.js b/docker/config-local.js index f9286dd7c..15f91a278 100644 --- a/docker/config-local.js +++ b/docker/config-local.js @@ -1,7 +1,7 @@ define([], function () { var configLocal = {}; - if ("${CLEAR_LOCAL_STORAGE}" == "true") { + if ("${ATLAS_CLEAR_LOCAL_STORAGE}" == "true") { localStorage.clear(); } @@ -14,118 +14,128 @@ define([], function () { // WebAPI configLocal.api = { - name: '${APP_NAME}', + name: '${ATLAS_INSTANCE_NAME}', url: webapi_url }; - configLocal.cohortComparisonResultsEnabled = ("${COHORT_COMPARISON_RESULTS}" == "true"); - configLocal.plpResultsEnabled = ("${PLP_RESULTS}" === "true"); - configLocal.userAuthenticationEnabled = ("${USER_AUTHENTICATION}" === "true"); + configLocal.cohortComparisonResultsEnabled = ("${ATLAS_COHORT_COMPARISON_RESULTS_ENABLED}" == "true"); + configLocal.plpResultsEnabled = ("${ATLAS_PLP_RESULTS_ENABLED}" === "true"); + configLocal.userAuthenticationEnabled = ("${ATLAS_USER_AUTH_ENABLED}" === "true"); configLocal.authProviders = []; - configLocal.disableBrowserCheck = ("${DISABLE_BROWSER_CHECK}" === "true"); - configLocal.enablePermissionManagement = ("${ENABLE_PERMISSIONS_MGMT}" === "true"); - configLocal.cacheSources = ("${CACHE_SOURCES}" === "true"); - configLocal.enableSkipLogin = ("${SKIP_LOGIN}" === "true"); // automatically opens login window when user is not authenticated - configLocal.useExecutionEngine = ("${USE_EXECUTION_ENGINE}" === "true"); - configLocal.viewProfileDates = ("${VIEW_PROFILE_DATES}" === "true"); - configLocal.enableCosts = ("${ENABLE_COSTS}" === "true"); - configLocal.supportUrl = "${SUPPORT_URL}"; - configLocal.supportMail = "${SUPPORT_MAIL}"; - configLocal.feedbackContacts = "${FEEDBACK_CONTACTS}"; - configLocal.feedbackCustomHtmlTemplate = "${FEEDBACK_HTML}"; - configLocal.companyInfoCustomHtmlTemplate = "${COMPANYINFO_HTML}"; - configLocal.showCompanyInfo = ("${COMPANYINFO_SHOW}" === "true"); - configLocal.defaultLocale = "${DEFAULT_LOCALE}"; - configLocal.pollInterval = parseInt("${POLL_INTERVAL}"); - - - if ("${WIN_PROVIDER_ENABLED}" === "true") { + configLocal.disableBrowserCheck = ("${ATLAS_DISABLE_BROWSER_CHECK}" === "true"); + configLocal.enablePermissionManagement = ("${ATLAS_ENABLE_PERMISSIONS_MGMT}" === "true"); + configLocal.cacheSources = ("${ATLAS_CACHE_SOURCES}" === "true"); + configLocal.enableSkipLogin = ("${ATLAS_SKIP_LOGIN}" === "true"); // automatically opens login window when user is not authenticated + configLocal.useExecutionEngine = ("${ATLAS_USE_EXECUTION_ENGINE}" === "true"); + configLocal.viewProfileDates = ("${ATLAS_VIEW_PROFILE_DATES}" === "true"); + configLocal.enableCosts = ("${ATLAS_ENABLE_COSTS}" === "true"); + configLocal.supportUrl = "${ATLAS_SUPPORT_URL}"; + configLocal.supportMail = "${ATLAS_SUPPORT_MAIL}"; + configLocal.feedbackContacts = "${ATLAS_FEEDBACK_CONTACTS}"; + configLocal.feedbackCustomHtmlTemplate = "${ATLAS_FEEDBACK_HTML}"; + configLocal.companyInfoCustomHtmlTemplate = "${ATLAS_COMPANYINFO_HTML}"; + configLocal.showCompanyInfo = ("${ATLAS_COMPANYINFO_SHOW}" === "true"); + configLocal.defaultLocale = "${ATLAS_DEFAULT_LOCALE}"; + configLocal.pollInterval = parseInt("${ATLAS_POLL_INTERVAL}"); + + + if ("${ATLAS_SECURITY_WIN_PROVIDER_ENABLED}" === "true") { configLocal.authProviders.push(openIdProvider = { - name: "${WIN_PROVIDER_NAME}", - url: "${WIN_PROVIDER_URL}", - ajax: ("${WIN_PROVIDER_AJAX}" === "true"), - icon: "${WIN_PROVIDER_ICON}", + name: "${ATLAS_SECURITY_WIN_PROVIDER_NAME}", + url: "${ATLAS_SECURITY_WIN_PROVIDER_URL}", + ajax: ("${ATLAS_SECURITY_WIN_PROVIDER_AJAX}" === "true"), + icon: "${ATLAS_SECURITY_WIN_PROVIDER_ICON}", }); } - if ("${KERB_PROVIDER_ENABLED}" === "true") { + if ("${ATLAS_SECURITY_KERB_PROVIDER_ENABLED}" === "true") { configLocal.authProviders.push(openIdProvider = { - name: "${KERB_PROVIDER_NAME}", - url: "${KERB_PROVIDER_URL}", - ajax: ("${KERB_PROVIDER_AJAX}" === "true"), - icon: "${KERB_PROVIDER_ICON}", + name: "${ATLAS_SECURITY_KERB_PROVIDER_NAME}", + url: "${ATLAS_SECURITY_KERB_PROVIDER_URL}", + ajax: ("${ATLAS_SECURITY_KERB_PROVIDER_AJAX}" === "true"), + icon: "${ATLAS_SECURITY_KERB_PROVIDER_ICON}", }); } - if ("${OID_PROVIDER_ENABLED}" === "true") { + if ("${ATLAS_SECURITY_OID_PROVIDER_ENABLED}" === "true") { configLocal.authProviders.push(openIdProvider = { - name: "${OID_PROVIDER_NAME}", - url: "${OID_PROVIDER_URL}", - ajax: ("${OID_PROVIDER_AJAX}" === "true"), - icon: "${OID_PROVIDER_ICON}", + name: "${ATLAS_SECURITY_OID_PROVIDER_NAME}", + url: "${ATLAS_SECURITY_OID_PROVIDER_URL}", + ajax: ("${ATLAS_SECURITY_OID_PROVIDER_AJAX}" === "true"), + icon: "${ATLAS_SECURITY_OID_PROVIDER_ICON}", }); } - if ("${GGL_PROVIDER_ENABLED}" === "true") { + if ("${ATLAS_SECURITY_GGL_PROVIDER_ENABLED}" === "true") { configLocal.authProviders.push(openIdProvider = { - name: "${GGL_PROVIDER_NAME}", - url: "${GGL_PROVIDER_URL}", - ajax: ("${GGL_PROVIDER_AJAX}" === "true"), - icon: "${GGL_PROVIDER_ICON}", + name: "${ATLAS_SECURITY_GGL_PROVIDER_NAME}", + url: "${ATLAS_SECURITY_GGL_PROVIDER_URL}", + ajax: ("${ATLAS_SECURITY_GGL_PROVIDER_AJAX}" === "true"), + icon: "${ATLAS_SECURITY_GGL_PROVIDER_ICON}", }); } - if ("${FB_PROVIDER_ENABLED}" === "true") { + if ("${ATLAS_SECURITY_FB_PROVIDER_ENABLED}" === "true") { configLocal.authProviders.push(openIdProvider = { - name: "${FB_PROVIDER_NAME}", - url: "${FB_PROVIDER_URL}", - ajax: ("${FB_PROVIDER_AJAX}" === "true"), - icon: "${FB_PROVIDER_ICON}", + name: "${ATLAS_SECURITY_FB_PROVIDER_NAME}", + url: "${ATLAS_SECURITY_FB_PROVIDER_URL}", + ajax: ("${ATLAS_SECURITY_FB_PROVIDER_AJAX}" === "true"), + icon: "${ATLAS_SECURITY_FB_PROVIDER_ICON}", }); } - if ("${GH_PROVIDER_ENABLED}" === "true") { + if ("${ATLAS_SECURITY_GH_PROVIDER_ENABLED}" === "true") { configLocal.authProviders.push(openIdProvider = { - name: "${GH_PROVIDER_NAME}", - url: "${GH_PROVIDER_URL}", - ajax: ("${GH_PROVIDER_AJAX}" === "true"), - icon: "${GH_PROVIDER_ICON}", + name: "${ATLAS_SECURITY_GH_PROVIDER_NAME}", + url: "${ATLAS_SECURITY_GH_PROVIDER_URL}", + ajax: ("${ATLAS_SECURITY_GH_PROVIDER_AJAX}" === "true"), + icon: "${ATLAS_SECURITY_GH_PROVIDER_ICON}", }); } - if ("${DB_PROVIDER_ENABLED}" === "true") { + if ("${ATLAS_SECURITY_DB_PROVIDER_ENABLED}" === "true") { configLocal.authProviders.push(openIdProvider = { - name: "${DB_PROVIDER_NAME}", - url: "${DB_PROVIDER_URL}", - ajax: ("${DB_PROVIDER_AJAX}" === "true"), - icon: "${DB_PROVIDER_ICON}", - isUseCredentialsForm: ("${DB_PROVIDER_CREDFORM}" === "true") + name: "${ATLAS_SECURITY_DB_PROVIDER_NAME}", + url: "${ATLAS_SECURITY_DB_PROVIDER_URL}", + ajax: ("${ATLAS_SECURITY_DB_PROVIDER_AJAX}" === "true"), + icon: "${ATLAS_SECURITY_DB_PROVIDER_ICON}", + isUseCredentialsForm: ("${ATLAS_SECURITY_DB_PROVIDER_CREDFORM}" === "true") }); } - if ("${LDAP_PROVIDER_ENABLED}" === "true") { + if ("${ATLAS_SECURITY_LDAP_PROVIDER_ENABLED}" === "true") { configLocal.authProviders.push(openIdProvider = { - name: "${LDAP_PROVIDER_NAME}", - url: "${LDAP_PROVIDER_URL}", - ajax: ("${LDAP_PROVIDER_AJAX}" === "true"), - icon: "${LDAP_PROVIDER_ICON}", - isUseCredentialsForm: ("${LDAP_PROVIDER_CREDFORM}" === "true") + name: "${ATLAS_SECURITY_LDAP_PROVIDER_NAME}", + url: "${ATLAS_SECURITY_LDAP_PROVIDER_URL}", + ajax: ("${ATLAS_SECURITY_LDAP_PROVIDER_AJAX}" === "true"), + icon: "${ATLAS_SECURITY_LDAP_PROVIDER_ICON}", + isUseCredentialsForm: ("${ATLAS_SECURITY_LDAP_PROVIDER_CREDFORM}" === "true") }); } - if ("${SAML_PROVIDER_ENABLED}" === "true") { + if ("${ATLAS_SECURITY_SAML_PROVIDER_ENABLED}" === "true") { configLocal.authProviders.push(openIdProvider = { - name: "${SAML_PROVIDER_NAME}", - url: "${SAML_PROVIDER_URL}", - ajax: ("${SAML_PROVIDER_AJAX}" === "true"), - icon: "${SAML_PROVIDER_ICON}", + name: "${ATLAS_SECURITY_SAML_PROVIDER_NAME}", + url: "${ATLAS_SECURITY_SAML_PROVIDER_URL}", + ajax: ("${ATLAS_SECURITY_SAML_PROVIDER_AJAX}" === "true"), + icon: "${ATLAS_SECURITY_SAML_PROVIDER_ICON}", }); } - configLocal.enableTermsAndConditions = ("${ENABLE_TANDCS}" === "true"); - configLocal.enablePersonCount = ("${ENABLE_PERSONCOUNT}" === "true"); - configLocal.enableTaggingSection = ("${ENABLE_TAGGING_SECTION}" === "true"); - configLocal.refreshTokenThreshold = 1000 * 60 * parseInt("${REFRESH_TOKEN_THRESHOLD}"); + // For existing broadsea implementations + if ("${ATLAS_SECURITY_PROVIDER_ENABLED}" === "true") { + configLocal.authProviders.push(openIdProvider = { + name: "${ATLAS_SECURITY_PROVIDER_NAME}", + url: "user/login/${ATLAS_SECURITY_PROVIDER_TYPE}", + ajax: ("${ATLAS_SECURITY_PROVIDER_AJAX}" === "true"), + icon: "${ATLAS_SECURITY_PROVIDER_ICON}", + }); + } + + configLocal.enableTermsAndConditions = ("${ATLAS_ENABLE_TANDCS}" === "true"); + configLocal.enablePersonCount = ("${ATLAS_ENABLE_PERSONCOUNT}" === "true"); + configLocal.enableTaggingSection = ("${ATLAS_ENABLE_TAGGING_SECTION}" === "true"); + configLocal.refreshTokenThreshold = 1000 * 60 * parseInt("${ATLAS_REFRESH_TOKEN_THRESHOLD}"); return configLocal; });