Skip to content

Commit

Permalink
Merge pull request #77 from samply/release/v0.4.0
Browse files Browse the repository at this point in the history
Release Version v.0.4.0
  • Loading branch information
torbrenner authored Mar 28, 2024
2 parents 9c7856d + 739839a commit a41d8a8
Show file tree
Hide file tree
Showing 26 changed files with 2,743 additions and 256 deletions.
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
dist
.eslintrc.cjs
58 changes: 31 additions & 27 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,38 +1,42 @@
module.exports = {
plugins: ['@typescript-eslint/eslint-plugin', 'eslint-plugin-tsdoc', 'jsdoc'],
plugins: [
"@typescript-eslint/eslint-plugin",
"eslint-plugin-tsdoc",
"jsdoc",
],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:svelte/recommended',
'plugin:svelte/prettier',
'eslint-config-prettier',
'prettier',
"plugin:jsdoc/recommended-typescript-error",
"plugin:@typescript-eslint/recommended",
"plugin:svelte/recommended",
"plugin:svelte/prettier",
"eslint-config-prettier",
"prettier",
"plugin:jsdoc/recommended-typescript-error",
],
parser: '@typescript-eslint/parser',
parser: "@typescript-eslint/parser",
parserOptions: {
project: './tsconfig.json',
extraFileExtensions: ['.svelte'],
project: "./tsconfig.json",
extraFileExtensions: [".svelte"],
},
overrides: [
{
files: ['*.svelte'],
parser: 'svelte-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser',
}
}
{
files: ["*.svelte"],
parser: "svelte-eslint-parser",
parserOptions: {
parser: "@typescript-eslint/parser",
},
},
],
settings: {
'svelte/typescript': import('typescript'),
"svelte/typescript": import("typescript"),
},
rules: {
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/explicit-function-return-type': ['error', { allowExpressions: true }],
'svelte/no-at-html-tags': 'off',
'jsdoc/check-syntax': 2,
"jsdoc/check-param-names": 2,


"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/explicit-function-return-type": [
"error",
{ allowExpressions: true },
],
"svelte/no-at-html-tags": "off",
"jsdoc/check-syntax": 2,
"jsdoc/check-param-names": 2,
},
ignorePatterns: ['**/dist/**'],
};
};
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: "Build @samply/lens"
run: npm run build
- name: "Publish @samply/lens"
run: cd dist && npm publish --access public
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ TODO
# Deployment Files
.env
docker-compose.override.yml
*.priv.pem
traefik.yaml
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no-install commitlint --edit
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@ npm start

to start a development server, that will typically be available at [http://localhost:5173](http://localhost:5173). For further available npm scripts, you can review the [package.json](./package.json)

### Building the Library locally
If you want to make changes to the lens library while integrating those changes directly in the local development version of your application, you need to tell npm to make lens locally available. For this use-case, we prepared to npm scripts:

1) Run `npm run watch`, to start building the library on changes
2) Open a second terminal
3) Run `npm run link` which will make the library available locally
4) In your own applications repository run `npm link @samply/lens`

To controll that the linking of the local version worked, run `npm ls | grep lens` in your applications repository and verify that it refers to your local lens repository.

## Style Integration

To import the default stylings, use
Expand Down
7 changes: 7 additions & 0 deletions commitlint.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
extends: ["@commitlint/config-conventional"],
rules: {
"body-max-line-length": [0, "always"],
"footer-max-line-length": [0, "always"],
},
};
9 changes: 3 additions & 6 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,13 @@ services:
- "default"

spot:
# NOTE: This will be replaced by https://github.com/samply/spot soon.
image: docker.verbis.dkfz.de/ccp-private/central-spot
image: samply/rustyspot:main
ports:
- 8080:8080
environment:
BEAM_SECRET: "${LOCAL_BEAM_SECRET}"
BEAM_URL: http://beam-proxy:8081
BEAM_PROXY_ID: ${LOCAL_BEAM_ID}
BEAM_BROKER_ID: ${BROKER_HOST}
BEAM_APP_ID: "focus"
BEAM_PROXY_URL: http://beam-proxy:8081
BEAM_APP_ID: "focus.${LOCAL_BEAM_ID}.${BROKER_HOST}"
depends_on:
- "beam-proxy"
profiles:
Expand Down
67 changes: 31 additions & 36 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,36 @@ services:
- /var/run/docker.sock:/var/run/docker.sock:ro

traefik-forward-auth:
image: thomseddon/traefik-forward-auth:2
image: quay.io/oauth2-proxy/oauth2-proxy:latest
environment:
- http_proxy=${http_proxy}
- https_proxy=${https_proxy}
- DEFAULT_PROVIDER=oidc
# TODO: https://login.bbmri-eric.eu/oidc/
- PROVIDERS_OIDC_ISSUER_URL=https://git.verbis.dkfz.de
- PROVIDERS_OIDC_CLIENT_ID=${OAUTH_CLIENT_ID}
- PROVIDERS_OIDC_CLIENT_SECRET=${OAUTH_CLIENT_SECRET}
- SECRET=${AUTHENTICATION_SECRET}
- COOKIE_DOMAIN=${GUI_HOST}
- OAUTH2_PROXY_PROVIDER=oidc
- OAUTH2_PROXY_SKIP_PROVIDER_BUTTON=true
- OAUTH2_PROXY_OIDC_ISSUER_URL=${OAUTH_ISSUER_URL}
- OAUTH2_PROXY_CLIENT_ID=${OAUTH_CLIENT_ID}
- OAUTH2_PROXY_CLIENT_SECRET=${OAUTH_CLIENT_SECRET}
- OAUTH2_PROXY_COOKIE_SECRET=${AUTHENTICATION_SECRET}
- OAUTH2_PROXY_COOKIE_DOMAINS=.${GUI_HOST}
- OAUTH2_PROXY_HTTP_ADDRESS=:4180
- OAUTH2_PROXY_REVERSE_PROXY=true
- OAUTH2_PROXY_WHITELIST_DOMAINS=.${GUI_HOST}
- OAUTH2_PROXY_UPSTREAMS=static://202
- OAUTH2_PROXY_EMAIL_DOMAINS=*
- OAUTH2_PROXY_ALLOWED_GROUPS=${ALLOWED_GROUPS}
# 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
labels:
- "traefik.enable=true"
- "traefik.http.middlewares.traefik-forward-auth.forwardauth.address=http://traefik-forward-auth:4181"
- "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.services.traefik-forward-auth.loadbalancer.server.port=4181"
- "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"

lens-web-components:
image: lens-web-components
image: samply/lens:main
build: .
labels:
- "traefik.enable=true"
Expand All @@ -46,55 +57,39 @@ services:
- "traefik.http.routers.lens.middlewares=traefik-forward-auth"

spot:
image: docker.verbis.dkfz.de/ccp-private/central-spot
image: samply/rustyspot:main
environment:
BEAM_SECRET: "${LOCAL_BEAM_SECRET}"
BEAM_URL: http://beam-proxy:8081
BEAM_PROXY_ID: ${LOCAL_BEAM_ID}
BEAM_BROKER_ID: ${BROKER_HOST}
# TODO: Implement Switch between spot and focus
BEAM_APP_ID: "spot"
BEAM_PROXY_URL: http://beam-proxy:8081
BEAM_APP_ID: "focus.${LOCAL_BEAM_ID}.${BROKER_HOST}"
CORS_ORIGIN: "https://${GUI_HOST}"
depends_on:
- "beam-proxy"
labels:
- "traefik.enable=true"
- "traefik.http.services.spot.loadbalancer.server.port=8080"
- "traefik.http.middlewares.corsheaders.headers.accesscontrolallowmethods=GET,OPTIONS,POST"
- "traefik.http.middlewares.corsheaders.headers.accesscontrolallowheaders=content-type"
- "traefik.http.middlewares.corsheaders.headers.accesscontrolalloworiginlist=https://${GUI_HOST}"
- "traefik.http.middlewares.corsheaders.headers.accesscontrolallowcredentials=true"
- "traefik.http.middlewares.corsheaders.headers.accesscontrolmaxage=-1"
- "traefik.http.routers.spot.rule=Host(`backend.${GUI_HOST}`)"
- "traefik.http.routers.spot.rule=Host(`backend.${GUI_HOST}`) && PathPrefix(`/prod`)"
- "traefik.http.middlewares.stripprefix_spot_prod.stripprefix.prefixes=/prod"
- "traefik.http.routers.spot.tls=true"
- "traefik.http.routers.spot.middlewares=corsheaders,traefik-forward-auth"
- "traefik.http.routers.spot.middlewares=corsheaders,traefik-forward-auth,stripprefix_spot_prod"

beam-proxy:
image: docker.verbis.dkfz.de/cache/samply/beam-proxy:develop
environment:
BROKER_URL: https://${BROKER_HOST}
PROXY_ID: ${LOCAL_BEAM_ID}.${BROKER_HOST}
# TODO: Same for focus here
APP_spot_KEY: ${LOCAL_BEAM_SECRET}
APP_focus_KEY: ${LOCAL_BEAM_SECRET}
PRIVKEY_FILE: /run/secrets/proxy.pem
ALL_PROXY: ${http_proxy}
secrets:
- proxy.pem
- root.crt.pem

## Only use this for test purposes
blaze:
image: samply/blaze:develop
ports:
- "8082:8080"
profiles: ["development"]

test-data-loader:
image: samply/test-data-loader
environment:
FHIR_STORE_URL: "http://blaze:8080/fhir"
PATIENT_COUNT: "2000"
command: sh -c "sleep 60 && /app/run.sh"
profiles: ["development"]

secrets:
proxy.pem:
# TODO: Key in BBMRI was directly stored in lens directory!
Expand Down
Loading

0 comments on commit a41d8a8

Please sign in to comment.