Skip to content

Commit

Permalink
Merge pull request #109 from samply/release/v0.2.0
Browse files Browse the repository at this point in the history
Release v0.2.0
  • Loading branch information
torbrenner authored Jun 20, 2024
2 parents b7027ba + 8d5e745 commit b0377c0
Show file tree
Hide file tree
Showing 56 changed files with 3,295 additions and 981 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ COPY package.json package-lock.json ./
RUN npm install
COPY ./vite.config.ts ./vite.demo.config.ts ./extensions.json ./tsconfig.json ./tsconfig.node.json ./
COPY ./packages ./packages
COPY ./options_tester.cjs ./options_tester.cjs

RUN VITE_TARGET_ENVIRONMENT=${TARGET_ENVIRONMENT} npm run build
RUN VITE_TARGET_ENVIRONMENT=${TARGET_ENVIRONMENT} npm run build:demo

Expand Down
2 changes: 2 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
tsc --resolveJsonModule --esModuleInterop options_tester.ts
mv options_tester.js options_tester.cjs
6 changes: 4 additions & 2 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@ services:
spot:
image: samply/rustyspot:main
ports:
- 8080:8080
- 8055:8055
environment:
RUST_LOG: "info"
CORS_ORIGIN: http://localhost:5173
BEAM_SECRET: "${LOCAL_BEAM_SECRET_SPOT}"
BEAM_PROXY_URL: http://beam-proxy:8081
BEAM_APP_ID: "spot.${LOCAL_BEAM_ID}.${BROKER_HOST}"
BEAM_APP_ID: "focus.${LOCAL_BEAM_ID}.${BROKER_HOST}"
depends_on:
- "beam-proxy"
profiles:
Expand Down
12 changes: 11 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,13 @@ services:
# For some reason, login.verbis.dkfz.de does not have a "groups" scope but this comes automatically through a
# scope called microprofile-jwt. Remove the following line once we have a "groups" scope.
- OAUTH2_PROXY_SCOPE=openid profile email
# Pass Authorization Header and some user information to spot
- OAUTH2_PROXY_SET_AUTHORIZATION_HEADER=true
- OAUTH2_PROXY_SET_XAUTHREQUEST=true
labels:
- "traefik.enable=true"
- "traefik.http.middlewares.traefik-forward-auth.forwardauth.address=http://traefik-forward-auth:4180"
- "traefik.http.middlewares.traefik-forward-auth.forwardauth.authResponseHeaders=X-Forwarded-User"
- "traefik.http.middlewares.traefik-forward-auth.forwardauth.authResponseHeaders=Authorization, X-Forwarded-User, X-Auth-Request-User, X-Auth-Request-Email"
- "traefik.http.services.traefik-forward-auth.loadbalancer.server.port=4180"
- "traefik.http.routers.oauth2.rule=Host(`${GUI_HOST}`) && PathPrefix(`/oauth2/`)"
- "traefik.http.routers.oauth2.tls=true"
Expand All @@ -55,6 +58,8 @@ services:

spot:
image: samply/rustyspot:main
ports:
- "8055:8055"
environment:
HTTP_PROXY: ${http_proxy}
HTTPS_PROXY: ${https_proxy}
Expand All @@ -66,6 +71,11 @@ services:
CATALOGUE_URL: "${CATALOGUE_URL}"
BIND_ADDR: 0.0.0.0:8055
PRISM_URL: http://prism:8066
RUST_LOG: "info"
LOG_FILE: /requests.log
volumes:
- ./requests.log:/requests.log

depends_on:
- "beam-proxy"
labels:
Expand Down
1 change: 1 addition & 0 deletions example.env
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ GUI_HOST="data.dktk.dkfz.de|demo.lens.samply.de"
BROKER_HOST="broker.ccp-it.dktk.dkfz.de"
LOCAL_BEAM_ID="your-proxy-id"
LOCAL_BEAM_SECRET_SPOT="insert-a-random-passphrase-here"
LOCAL_BEAM_SECRET_PRISM="insert-a-random-passphrase-here"

# Request your OAUTH client from your oauth provider admin
OAUTH_ISSUER_URL="the-discovery-adress-of-your-oauth-provider"
Expand Down
36 changes: 36 additions & 0 deletions options_tester.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
"use strict";
const __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};

console.log(
"Checking Lens options for ",
process.env.VITE_TARGET_ENVIRONMENT,
);

let optionsPath = "";
if (process.env.VITE_TARGET_ENVIRONMENT === "production") {
optionsPath = "./packages/demo/public/options-ccp-prod.json";
} else if (process.env.VITE_TARGET_ENVIRONMENT === "staging") {
optionsPath = "./packages/demo/public/options-ccp-demo.json";
} else {
optionsPath = "./packages/demo/public/options-dev.json";
}

Object.defineProperty(exports, "__esModule", { value: true });
const options_schema_json_1 = __importDefault(require("./packages/lib/src/types/options.schema.json"));
const schemasafe_1 = require("@exodus/schemasafe");
const options_json_1 = __importDefault(require(optionsPath));
console.log("Checking Lens options");
const parse = (0, schemasafe_1.parser)(options_schema_json_1.default, {
includeErrors: true,
allErrors: true,
});
const validJSON = parse(JSON.stringify(options_json_1.default));
if (validJSON.valid === true) {
console.log("Options are valid");
}
else if (typeof options_json_1.default === "object") {
console.error("Lens-Options are not conform with the JSON schema", validJSON.errors);
process.exit(1);
}
35 changes: 35 additions & 0 deletions options_tester.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import optionsSchema from "./packages/lib/src/types/options.schema.json";
import { parser } from "@exodus/schemasafe";

import devOptions from "./packages/demo/public/options-dev.json";
import demoOptions from "./packages/demo/public/options-ccp-demo.json";
import prodOptions from "./packages/demo/public/options-ccp-prod.json";

console.log(
"Checking Lens options for ",
import.meta.env.VITE_TARGET_ENVIRONMENT,
);

let options = {};
if (import.meta.env.VITE_TARGET_ENVIRONMENT === "production") {
options = prodOptions;
} else if (import.meta.env.VITE_TARGET_ENVIRONMENT === "staging") {
options = demoOptions;
} else {
options = devOptions;
}

const parse = parser(optionsSchema, {
includeErrors: true,
allErrors: true,
});
const validJSON = parse(JSON.stringify(options));
if (validJSON.valid === true) {
console.log("Options are valid");
} else if (typeof options === "object") {
console.error(
"Lens-Options are not conform with the JSON schema",
validJSON.errors,
);
process.exit(1);
}
Loading

0 comments on commit b0377c0

Please sign in to comment.