diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 7aea833..ae6b65a 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -5,9 +5,8 @@ name: Docker # latest and develop # - when a pull request is created and updated to make sure the # Dockerfile is still valid. -# To be able to push to dockerhub, this execpts the following +# To be able to push to dockerhub, this expects the following # secrets to be set in the project: -# - NPM_TOKEN : NPM auth token for accessing private chemaxon NPM registry # - DOCKERHUB_USERNAME : username that can push to the org # - DOCKERHUB_PASSWORD : password asscoaited with the username on: @@ -42,7 +41,6 @@ jobs: - name: Authenticate with private NPM package run: | - echo "//hub.chemaxon.com/artifactory/api/npm/npm/:_auth=${{ secrets.NPM_TOKEN }}" > $HOME/.npmrc echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> $HOME/.npmrc echo "npmrc_path=$HOME/.npmrc" >> "$GITHUB_ENV" @@ -94,4 +92,6 @@ jobs: tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} build-args: - configuration=staging \ No newline at end of file + configuration=staging + secret-files: | + NPMRC=${{env.npmrc_path}} diff --git a/.npmrc b/.npmrc index be42e19..a33f18f 100644 --- a/.npmrc +++ b/.npmrc @@ -1,2 +1 @@ -@chemaxon:registry=https://hub.chemaxon.com/artifactory/api/npm/npm/ -@moleculemaker:registry=https://npm.pkg.github.com/ \ No newline at end of file +@moleculemaker:registry=https://npm.pkg.github.com/ diff --git a/Dockerfile b/Dockerfile index 5be6fee..3dcdf83 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ # # Use official node image as the base image -FROM --platform=$BUILDPLATFORM node:22 as build +FROM --platform=$BUILDPLATFORM node:22 AS build # Set the working directory WORKDIR /usr/local/app @@ -19,6 +19,7 @@ COPY package.json package-lock.json ./ # Install all the dependencies RUN --mount=type=secret,id=NPMRC npm install +RUN npm install # Add the source code to app COPY angular.json entrypoint.sh tsconfig*.json package*.json proxy.conf.json tailwind.config.js ./ diff --git a/README.md b/README.md index 3bc4be1..d686abb 100644 --- a/README.md +++ b/README.md @@ -33,18 +33,6 @@ This repo includes a library that helps build frontend application quickly. ## Development server -For marvin.js license add the following lines to the ~/.npmrc file: -``` -@chemaxon:registry=https://hub.chemaxon.com/artifactory/api/npm/npm/ -hub.chemaxon.com/artifactory/api/npm/npm/:_auth="" -hub.chemaxon.com/artifactory/api/npm/npm/:_password="" -hub.chemaxon.com/artifactory/api/npm/npm/:username= -hub.chemaxon.com/artifactory/api/npm/npm/:email= -hub.chemaxon.com/artifactory/api/npm/npm/:always-auth=true -``` - -MMLI members can reach out to developers for the secrets. Non-MMLI members will need to make their own arrangements for a MarvinJS license. - Run `npm start` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files. ## Code scaffolding diff --git a/angular.json b/angular.json index 7cd498f..2a89ccf 100644 --- a/angular.json +++ b/angular.json @@ -32,26 +32,16 @@ "inlineStyleLanguage": "scss", "assets": [ "src/favicon.ico", - "src/assets", - { - "glob": "**/*", - "input": "node_modules/@chemaxon/marvinjs", - "output": "./assets/marvin-js" - } + "src/assets" ], "styles": [ "src/app/css/primeng_theme.scss", "node_modules/primeng/resources/primeng.min.css", "node_modules/primeicons/primeicons.css", "src/styles.scss", - "src/app/css/styles.scss", - "node_modules/@chemaxon/marvinjs/gui/css/editor.css" + "src/app/css/styles.scss" ], "scripts": [ - "node_modules/@chemaxon/marvinjs/gui/lib/promise-1.0.0.min.js", - "node_modules/@chemaxon/marvinjs/js/marvinjslauncher.js", - "node_modules/@chemaxon/marvinjs/js/util.js", - "node_modules/@chemaxon/marvinjs/js/webservices.js", "node_modules/chart.js/dist/chart.js" ], "browser": "src/main.ts" @@ -140,26 +130,16 @@ "inlineStyleLanguage": "scss", "assets": [ "src/favicon.ico", - "src/assets", - { - "glob": "**/*", - "input": "node_modules/@chemaxon/marvinjs", - "output": "./assets/marvin-js" - } + "src/assets" ], "styles": [ "node_modules/primeng/resources/themes/lara-light-blue/theme.css", "node_modules/primeng/resources/primeng.min.css", "node_modules/primeicons/primeicons.css", "src/styles.scss", - "src/app/css/styles.scss", - "node_modules/@chemaxon/marvinjs/gui/css/editor.css" + "src/app/css/styles.scss" ], "scripts": [ - "node_modules/@chemaxon/marvinjs/gui/lib/promise-1.0.0.min.js", - "node_modules/@chemaxon/marvinjs/js/marvinjslauncher.js", - "node_modules/@chemaxon/marvinjs/js/util.js", - "node_modules/@chemaxon/marvinjs/js/webservices.js" ] } } diff --git a/docker-compose.marvin.yaml b/docker-compose.marvin.yaml deleted file mode 100644 index c4b8a73..0000000 --- a/docker-compose.marvin.yaml +++ /dev/null @@ -1,83 +0,0 @@ - -version: '3.9' - -secrets: - NPMRC: - file: ~/.npmrc - -networks: - proxy: - - -services: - traefik: - image: "traefik:v2.10" - container_name: "cleandb-traefik" - networks: - - proxy - command: - - --log.level=DEBUG - - --api.insecure=true - - - --api=true - #- --api.dashboard=true - # Entrypoints - - --entrypoints.web.address=:80 - # Docker setup - - --providers.docker=true - - --providers.docker.endpoint=unix:///var/run/docker.sock - - --providers.docker.exposedbydefault=false - - --providers.docker.watch=true - ports: - - "80:80" - #- "8080:8080" - volumes: - - "/var/run/docker.sock:/var/run/docker.sock:ro" - #labels: - # - "traefik.enable=true" - # - "traefik.http.routers.traefik.entrypoints=web" - # - "traefik.http.routers.traefik.rule=Host(`traefik.cleandb.proxy.localhost`)" - # - "traefik.http.routers.traefik.service=api@internal" - - - marvin: - image: hub.chemaxon.com/cxn-docker-release/chemaxon/mjs-webservice:latest - container_name: "cleandb-marvin" - env_file: - - .env - networks: - - proxy - labels: - - "traefik.enable=true" - - "traefik.http.services.marvin.loadbalancer.server.port=8080" - - "traefik.http.routers.marvin.rule=Host(`cleandb.proxy.localhost`) && (PathPrefix(`/rest-v1/`) || PathPrefix(`/demo.html`) || PathPrefix(`/js/`) || PathPrefix(`/gui/`))" - - cleandb: - image: moleculemaker/cleandb-frontend:staging - container_name: cleandb-frontend - build: - context: . - secrets: - - NPMRC - env_file: - - .env - networks: - - proxy - - restart: unless-stopped - - #volumes: - # - ./src/assets/config/:/usr/share/nginx/html/assets/config - # - ./nginx/default.conf:/etc/nginx/conf.d/default.conf - # - ./dist/clean:/usr/share/nginx/html - labels: - - "traefik.enable=true" - - "traefik.http.routers.cleandb.rule=Host(`cleandb.proxy.localhost`) && PathPrefix(`/`)" - - "traefik.http.services.cleandb.loadbalancer.server.port=80" - - - "traefik.http.middlewares.cors-headers.headers.accesscontrolallowmethods=GET,OPTIONS,PUT,POST,DELETE" - - "traefik.http.middlewares.cors-headers.headers.accesscontrolallowheaders=*" - - "traefik.http.middlewares.cors-headers.headers.accesscontrolalloworiginlist=http://localhost:4200,http://chemcraper.proxy.localhost" - - "traefik.http.middlewares.cors-headers.headers.accesscontrolmaxage=100" - - "traefik.http.middlewares.cors-headers.headers.addvaryheader=true" - - "traefik.http.routers.cleandb.middlewares=cors-headers" diff --git a/docker-compose.yaml b/docker-compose.yaml index a981e9f..d6261e3 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -8,7 +8,6 @@ secrets: networks: proxy: - services: cleandb: image: moleculemaker/cleandb-frontend:localdev diff --git a/package-lock.json b/package-lock.json index 47fcbfa..4f1bb7d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,6 @@ "@angular/platform-browser": "^18.2.7", "@angular/platform-browser-dynamic": "^18.2.7", "@angular/router": "^18.2.7", - "@chemaxon/marvinjs": "^23.11.0", "@ngrx/store": "^1.0.0", "chart.js": "^3", "ngx-matomo-client": "^6.3.1", @@ -2571,12 +2570,6 @@ "dev": true, "license": "Apache-2.0" }, - "node_modules/@chemaxon/marvinjs": { - "version": "23.11.0", - "resolved": "https://hub.chemaxon.com:443/artifactory/api/npm/npm/@chemaxon/marvinjs/-/@chemaxon/marvinjs-23.11.0.tgz", - "integrity": "sha1-V7cZOy3zs3o0vKSOQvmMWuO16EI=", - "license": "Chemaxon End-User License Agreement / End User Subscription Agreement - EUSA" - }, "node_modules/@chromatic-com/storybook": { "version": "1.9.0", "resolved": "https://hub.chemaxon.com:443/artifactory/api/npm/npm/@chromatic-com/storybook/-/storybook-1.9.0.tgz", diff --git a/package.json b/package.json index 4715eca..fb9c012 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,6 @@ "@angular/platform-browser": "^18.2.7", "@angular/platform-browser-dynamic": "^18.2.7", "@angular/router": "^18.2.7", - "@chemaxon/marvinjs": "^23.11.0", "@ngrx/store": "^1.0.0", "chart.js": "^3", "ngx-matomo-client": "^6.3.1", diff --git a/proxy.conf.json b/proxy.conf.json index 28fd5c2..0967ef4 100644 --- a/proxy.conf.json +++ b/proxy.conf.json @@ -1,26 +1 @@ -{ - "/rest-v1": { - "localTarget": "http://localhost:8080", - "target": "https://marvinjs.backend.mmli1.ncsa.illinois.edu", - "secure": true, - "changeOrigin": true - }, - "/demo.html": { - "localTarget": "http://localhost:8080", - "target": "https://marvinjs.backend.mmli1.ncsa.illinois.edu", - "secure": true, - "changeOrigin": true - }, - "/gui": { - "localTarget": "http://localhost:8080", - "target": "https://marvinjs.backend.mmli1.ncsa.illinois.edu", - "secure": true, - "changeOrigin": true - }, - "/js": { - "localTarget": "http://localhost:8080", - "target": "https://marvinjs.backend.mmli1.ncsa.illinois.edu", - "secure": true, - "changeOrigin": true - } -} +{}