+FROM node:14-bullseye-slim as builder
+# the JRE is required by the openapi-generator-cli
+RUN apt update && apt install -y openjdk-17-jre-headless
+WORKDIR /usr/src/app
+
+COPY package*.json ./
+
+RUN npm install
+
+COPY . .
+
+RUN npm run build
+
FROM openresty/openresty:1.21.4.1-4-alpine
-RUN apk add gettext
+RUN apk add gettext
COPY server/resty /usr/local/openresty/lualib/resty/
COPY server/nginx* ./
COPY docker_entrypoint.sh .
-COPY dist/frontend /usr/share/nginx/html
+COPY --from=builder /usr/src/app/dist/frontend /usr/share/nginx/html
ENTRYPOINT ["/docker_entrypoint.sh"]
EXPOSE ${NGINX_PORT}
CMD ["nginx", "-g", "daemon off;"]
envsubst '${BFF_URL} ${NGINX_PORT} ${KEYCLOAK_URL} ${KEYCLOAK_REALM} ${KEYCLOAK_INTERNAL_URL} ${CLUSTER_NAMESERVER_IP}' < ./nginx.template > /etc/nginx/conf.d/default.conf
+# dynamically set Angular environment config upon container startup
+envsubst < /usr/share/nginx/html/assets/env.template.js > /usr/share/nginx/html/assets/env.js
+
exec "$@"
isOnapTheme = false;
switchToMainContent: string = '';
isFullScreen = false;
- changePasswordUrl = `${environment.keycloakEditProfile}/password`;
+ changePasswordUrl = `${environment.keycloak.hostname}/auth/realms/${environment.keycloak.realm}/account/password`;
shortcuts: Map<KeyboardShortcuts,string> = this.shortcutService.getShortcuts();
public ACCESS_KEY = KeyboardShortcuts;
@Input() isSidebarCollapsed = false;
public ACCESS_KEY = KeyboardShortcuts;
- public keycloakEditProfile = environment.keycloakEditProfile;
public isKpiDashboardSubMenuCollapsed = false;
constructor() {
customStyleEnabled: boolean;
backendServerUrl: string;
hostname: string;
- keycloakEditProfile: string;
production: boolean;
keycloak: KeycloakEnvironment;
dateTimeFormat: string;
loggingUrl: string;
loggingEnabled: boolean
supportUrlLink: string
-
}
export interface KeycloakEnvironment {
- issuer: string;
+ hostname: string;
+ realm: string;
redirectUri: string;
clientId: string;
responseType: string;
export const authConfig: AuthConfig = {
// Url of the Identity Provider
- issuer: environment.keycloak.issuer,
+ issuer: `${environment.keycloak.hostname}/auth/realms/${environment.keycloak.realm}`,
// URL of the SPA to redirect the user to after login
redirectUri: environment.keycloak.redirectUri,
--- /dev/null
+(function(window) {
+ window["env"] = window["env"] || {};
+ window["env"]["keycloak"] = window["env"]["keycloak"] || {};
+
+ // Environment variables
+ window["env"]["customStyleEnabled"];
+ window["env"]["keycloak"]["hostname"];
+ window["env"]["keycloak"]["realm"];
+ window["env"]["keycloak"]["clientId"];
+})(this);
--- /dev/null
+(function(window) {
+ window["env"] = window["env"] || {};
+ window["env"]["keycloak"] = window["env"]["keycloak"] || {};
+
+ // Environment variables
+ window["env"]["customStyleEnabled"] = "${CUSTOM_STYLE_ENABLED}";
+ window["env"]["keycloak"]["hostname"] = "${KEYCLOAK_HOSTNAME}";
+ window["env"]["keycloak"]["realm"] = "${KEYCLOAK_REALM}";
+ window["env"]["keycloak"]["clientId"] = "${KEYCLOAK_CLIENT_ID}";
+})(this);
+// @ts-nocheck
/*
* Copyright (c) 2022. Deutsche Telekom AG
*
production: true,
keycloakEditProfile: `${window.location.origin}/auth/realms/ONAP/account`,
keycloak: {
- issuer: `${window.location.origin}/auth/realms/ONAP`, // Url of the Identity Provider
+ hostname: window["env"]["keycloak"]["hostname"] || `https://${window.location.host.replace('portal', 'keycloak')}`,
+ realm: window["env"]["keycloak"]["realm"] || 'ONAP',
redirectUri: window.location.origin, // URL of the SPA to redirect the user to after login
- clientId: 'portal-app', // The Frontend is registered with this id at the auth-server
+ clientId: window["env"]["keycloak"]["clientId"] || 'portal-app', // The Frontend is registered with this id at the auth-server
responseType: 'code',
scope: 'openid', // set the scope for the permissions the client should request
requireHttps: false, // Don't require https
export const environment: Environment = {
customStyleEnabled: true,
backendServerUrl: window.location.origin + '/api',
- keycloakEditProfile: `${window.location.origin}/auth/realms/ONAP/account`,
hostname: window.location.hostname,
production: false,
keycloak: {
- issuer: `${window.location.origin}/auth/realms/ONAP`, // Url of the Identity Provider
+ hostname: window.location.origin, // Url of the Identity Provider
+ realm: 'ONAP',
redirectUri: window.location.origin, // URL of the SPA to redirect the user to after login
clientId: 'portal-app', // The Frontend is registered with this id at the auth-server
responseType: 'code',
<link rel="icon" type="image/x-icon" href="favicon.ico" />
<script src="assets/js/jquery-2.1.3.min.js"></script>
<script src="assets/js/bootstrap.min.js"></script>
+ <!-- Load environment variables -->
+ <script src="assets/env.js"></script>
</head>
<body>
<app-root></app-root>