Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision

Target

Select target project
  • padme-development/padme-station-software
1 result
Select Git revision
Show changes
Commits on Source (4)
stages:
- release 🚀
- build 📦
# - test
- fetch-version 🔎
- deploy 🚅
- release 🚀
.common_release_config:
image: node:18
......@@ -17,6 +17,15 @@ variables:
REGISTRY_DIND_IMAGE: $CI_REGISTRY_IMAGE/dind
REGISTRY_VAULT_IMAGE: $CI_REGISTRY_IMAGE/vault
release:
extends: .common_release_config
stage: release 🚀
dependencies: []
script:
- npx semantic-release
rules:
- if: $CI_COMMIT_BRANCH == "main"
build_wizard_frontend:
stage: build 📦
image: node:18.18.2-bullseye-slim
......@@ -148,16 +157,6 @@ deploy_image_branch:
- docker push $HARBOR_VAULT_IMAGE:$CI_COMMIT_BRANCH
rules:
- if: $CI_COMMIT_BRANCH == "main"
release:
extends: .common_release_config
stage: release 🚀
dependencies: []
script:
- npx semantic-release
rules:
- if: $CI_COMMIT_BRANCH == "main"
# pages:
# image: ubuntu:latest
# stage: deploy
......
{
"name": "@padme-development/padme-station-software",
"version": "2.0.2",
"version": "2.0.3",
"description": "A Dockerized Javascript Web Application providing interfaces for Monitoring of the algorithms and components, which manage the business logic e.g. pulling a train, execute a train, inspect the results, and many more.",
"license": "MIT",
"homepage": "https://git.rwth-aachen.de/padme-development/padme-station-software",
......
......@@ -155,7 +155,7 @@ function resolveVaultPathList(callback) {
// key-value version 1 - START
let kv1Promise = new Promise((resolve) => {
//Get key-value engines (v1)
vault.getKeyValueEngines((version = 1)).then((result) => {
vault.getKeyValueEngines(1).then((result) => {
let promises = [];
let kvEnginesVersion1 = result;
kvEnginesVersion1.forEach((kvEngine) => {
......@@ -200,7 +200,7 @@ function resolveVaultPathList(callback) {
// key-value version 2 - START
let kv2Promise = new Promise((resolve) => {
//Get key-value engines (v2)
vault.getKeyValueEngines((version = 2)).then((result) => {
vault.getKeyValueEngines(2).then((result) => {
let promises = [];
let kvEnginesVersion2 = result;
kvEnginesVersion2.forEach((kvEngine) => {
......@@ -263,6 +263,14 @@ module.exports = (keycloak) => {
});
});
router.get("/v2/keycloakConfig", (req, res) => {
res.send({
realm: process.env.REACT_APP_KC_REALM || "PHT-Station",
url: process.env.REACT_APP_KC_AUTH_SERVER_URL || "https://localhost:8443",
clientId: process.env.REACT_APP_KC_CLIENT_ID || "pht-web"
});
});
router.get(
"/v2",
keycloak.protect(),
......
import Keycloak from "keycloak-js";
import axios from "axios";
const _kc = new Keycloak({
realm: process.env.REACT_APP_KC_REALM || "PHT-Station",
url: process.env.REACT_APP_KC_AUTH_SERVER_URL || "https://localhost:8443",
clientId: process.env.REACT_APP_KC_CLIENT_ID || "pht-web",
});
async function getKeycloakConfig() {
const baseURL = process.env.NODE_ENV === "production" ? "/" : "http://127.0.0.1:3030/";
const response = await axios.get(`${baseURL}dashboard/v2/keycloakConfig`);
return response.data;
}
let _kc;
/**
* Initializes Keycloak instance and calls the provided
* callback function if successfully authenticated.
*/
const initKeycloak = (onAuthenticatedCallback) => {
const initKeycloak = async (onAuthenticatedCallback) => {
const config = await getKeycloakConfig();
_kc = new Keycloak({
realm: config.realm,
url: config.url,
clientId: config.clientId,
});
_kc
.init({
onLoad: "login-required",
......@@ -24,9 +34,9 @@ const initKeycloak = (onAuthenticatedCallback) => {
.catch(console.error);
};
const doLogin = _kc.login;
const doLogin = () => _kc.login();
const doLogout = _kc.logout;
const doLogout = () => _kc.logout();
const getToken = () => _kc.token;
......