diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 60593af21..9ea1cda44 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -70,8 +70,10 @@ jobs: type=edge,branch=main,priority=700 # Test Phase + - name: Test frontend license headers + run: npm --prefix frontend run license-file-headers-check - - name: Test with npm + - name: Test frontend dependency licenses ## TODO are there any frontend tests? run: npm --prefix frontend run license-check diff --git a/Dockerfile b/Dockerfile index 81343f31c..bd786e9ec 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,7 +26,18 @@ RUN mvn clean package -DskipTests=true -Dspotbugs.skip=true -Dpmd.skip=true # Runtime Container FROM amazoncorretto:17-alpine + +# Setup rights for overwriting frontend runtime variables +COPY --from=VUE /frontend/setup-runtime.sh setup-runtime.sh + +RUN \ + mkdir public && \ + chmod a+x ./setup-runtime.sh && \ + chmod -R a+rw ./public + +COPY --from=VUE /frontend/dist/env.js ./public/env.js COPY --from=MAVEN /home/maven/business-partner-agent/target/business-partner-agent*SNAPSHOT.jar business-partner-agent.jar + EXPOSE 8080 -CMD java -XX:+UnlockExperimentalVMOptions -Dcom.sun.management.jmxremote ${JAVA_OPTS} -jar business-partner-agent.jar +CMD ./setup-runtime.sh public/env.js business-partner-agent.jar && java -XX:+UnlockExperimentalVMOptions -Dcom.sun.management.jmxremote ${JAVA_OPTS} -jar business-partner-agent.jar diff --git a/Dockerfile.run b/Dockerfile.run index 695cf9761..e5265306c 100644 --- a/Dockerfile.run +++ b/Dockerfile.run @@ -3,10 +3,23 @@ FROM adoptopenjdk/openjdk15:alpine RUN adduser --disabled-password app + +WORKDIR /home/app + +# Setup rights for overwriting frontend runtime variables +COPY ./frontend/setup-runtime.sh setup-runtime.sh + +RUN \ + mkdir public && \ + chmod a+x ./setup-runtime.sh && \ + chmod -R a+rw ./public + +# Non-root USER app WORKDIR /home/app -EXPOSE 8080 -CMD java -XX:+UnlockExperimentalVMOptions -Dcom.sun.management.jmxremote ${JAVA_OPTS} -jar business-partner-agent.jar +COPY ./frontend/dist/env.js ./public/env.js +COPY ./backend/business-partner-agent/target/business-partner-agent*.jar business-partner-agent.jar -COPY ./backend/business-partner-agent/target/business-partner-agent*.jar business-partner-agent.jar \ No newline at end of file +EXPOSE 8080 +CMD ./setup-runtime.sh public/env.js business-partner-agent.jar && java -XX:+UnlockExperimentalVMOptions -Dcom.sun.management.jmxremote ${JAVA_OPTS} -jar business-partner-agent.jar diff --git a/frontend/.eslintignore b/frontend/.eslintignore index d9fbc8df0..bae29bcd1 100644 --- a/frontend/.eslintignore +++ b/frontend/.eslintignore @@ -7,5 +7,6 @@ **/*.scss **/*.sass **/*.html +**/*.sh node_modules dist diff --git a/frontend/.eslintrc.js b/frontend/.eslintrc.js index 0f35c6269..03474eef5 100644 --- a/frontend/.eslintrc.js +++ b/frontend/.eslintrc.js @@ -31,6 +31,7 @@ module.exports = { "vue/comment-directive": "warn", "unicorn/prefer-module": "off", "unicorn/filename-case": "off", + "unicorn/prevent-abbreviations": "off", "@typescript-eslint/ban-ts-comment": "warn", }, }; diff --git a/frontend/.prettierignore b/frontend/.prettierignore index e2a6e94da..e377552aa 100644 --- a/frontend/.prettierignore +++ b/frontend/.prettierignore @@ -5,3 +5,4 @@ # SPDX-License-Identifier: Apache-2.0 dist node_modules +setup-runtime.sh diff --git a/frontend/license-header/config.json b/frontend/license-header/config.json index 9ee911227..ad8698caa 100644 --- a/frontend/license-header/config.json +++ b/frontend/license-header/config.json @@ -1,7 +1,13 @@ { - "ignore": ["**/*.md", "**/*.svg", "license-header/license-header"], + "ignore": [ + "**/*.md", + "**/*.svg", + "license-header/license-header", + "licenses/attribution.txt", + ".husky/_/**/*" + ], "license": "license-header/license-header", - "regexIdentifier": "##", + "regexIdentifier": "_!##", "defaultFormat": { "eachLine": { "prepend": "# " diff --git a/frontend/license-header/license-header b/frontend/license-header/license-header index ac88bcbb8..e9f766809 100644 --- a/frontend/license-header/license-header +++ b/frontend/license-header/license-header @@ -1,4 +1,4 @@ -Copyright (c) 2020-##[0-9]{4}## - for information on the respective copyright owner +Copyright (c) 2020-_!##[0-9]{4}_!## - for information on the respective copyright owner see the NOTICE file and/or the repository at https://github.com/hyperledger-labs/business-partner-agent diff --git a/frontend/licenses/licenseInfos.json b/frontend/licenses/licenseInfos.json index de1f143fd..190529db8 100644 --- a/frontend/licenses/licenseInfos.json +++ b/frontend/licenses/licenseInfos.json @@ -1,13 +1,4 @@ { - "@types/vue-moment": { - "ignore": false, - "name": "@types/vue-moment", - "version": "4.0.3", - "authors": "Dominik Schmidt ", - "url": "https://github.com/DefinitelyTyped/DefinitelyTyped", - "license": "MIT", - "licenseText": " MIT License\n\n Copyright (c) Microsoft Corporation.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE\n" - }, "argparse": { "ignore": false, "name": "argparse", @@ -28,7 +19,7 @@ "core-js": { "ignore": false, "name": "core-js", - "version": "3.19.2", + "version": "3.19.3", "url": "https://github.com/zloirock/core-js", "license": "MIT", "licenseText": "Copyright (c) 2014-2021 Denis Pushkarev\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n" @@ -89,11 +80,11 @@ "lamejs": { "ignore": false, "name": "lamejs", - "version": "1.2.0", + "version": "1.2.1", "authors": "Alex Zhukov", "url": "https://github.com/zhuker/lamejs", "license": "LGPL-3.0", - "licenseText": "Can I use LAME in my commercial program? \n\nYes, you can, under the restrictions of the LGPL. The easiest\nway to do this is to:\n\n1. Link to LAME as separate jar (lame.min.js or lame.all.js)\n\n2. Fully acknowledge that you are using LAME, and give a link\n to our web site, www.mp3dev.org\n\n3. If you make modifications to LAME, you *must* release these\n these modifications back to the LAME project, under the LGPL.\n" + "licenseText": "Can I use LAME in my commercial program? \n\nYes, you can, under the restrictions of the LGPL. The easiest\nway to do this is to:\n\n1. Link to LAME as separate jar (lame.min.js or lame.all.js)\n\n2. Fully acknowledge that you are using LAME, and give a link\n to our web site, lame.sourceforge.net\n\n3. If you make modifications to LAME, you *must* release these\n these modifications back to the LAME project, under the LGPL.\n" }, "linkify-it": { "ignore": false, @@ -184,7 +175,7 @@ "vue-advanced-chat": { "ignore": false, "name": "vue-advanced-chat", - "version": "1.4.2", + "version": "1.4.3", "authors": "Antoine Dupont ", "url": "https://github.com/antoine92190/vue-advanced-chat", "license": "MIT", @@ -193,7 +184,7 @@ "vue-i18n": { "ignore": false, "name": "vue-i18n", - "version": "8.26.5", + "version": "8.26.7", "authors": "kazuya kawaguchi ", "url": "https://github.com/kazupon/vue-i18n", "license": "MIT", diff --git a/frontend/package-lock.json b/frontend/package-lock.json index eb9920293..96e7ae903 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -2434,13 +2434,13 @@ "dev": true }, "@typescript-eslint/eslint-plugin": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.5.0.tgz", - "integrity": "sha512-4bV6fulqbuaO9UMXU0Ia0o6z6if+kmMRW8rMRyfqXj/eGrZZRGedS4n0adeGNnjr8LKAM495hrQ7Tea52UWmQA==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.6.0.tgz", + "integrity": "sha512-MIbeMy5qfLqtgs1hWd088k1hOuRsN9JrHUPwVVKCD99EOUqScd7SrwoZl4Gso05EAP9w1kvLWUVGJOVpRPkDPA==", "dev": true, "requires": { - "@typescript-eslint/experimental-utils": "5.5.0", - "@typescript-eslint/scope-manager": "5.5.0", + "@typescript-eslint/experimental-utils": "5.6.0", + "@typescript-eslint/scope-manager": "5.6.0", "debug": "^4.3.2", "functional-red-black-tree": "^1.0.1", "ignore": "^5.1.8", @@ -2482,55 +2482,55 @@ } }, "@typescript-eslint/experimental-utils": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-5.5.0.tgz", - "integrity": "sha512-kjWeeVU+4lQ1SLYErRKV5yDXbWDPkpbzTUUlfAUifPYvpX0qZlrcCZ96/6oWxt3QxtK5WVhXz+KsnwW9cIW+3A==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-5.6.0.tgz", + "integrity": "sha512-VDoRf3Qj7+W3sS/ZBXZh3LBzp0snDLEgvp6qj0vOAIiAPM07bd5ojQ3CTzF/QFl5AKh7Bh1ycgj6lFBJHUt/DA==", "dev": true, "requires": { "@types/json-schema": "^7.0.9", - "@typescript-eslint/scope-manager": "5.5.0", - "@typescript-eslint/types": "5.5.0", - "@typescript-eslint/typescript-estree": "5.5.0", + "@typescript-eslint/scope-manager": "5.6.0", + "@typescript-eslint/types": "5.6.0", + "@typescript-eslint/typescript-estree": "5.6.0", "eslint-scope": "^5.1.1", "eslint-utils": "^3.0.0" } }, "@typescript-eslint/parser": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.5.0.tgz", - "integrity": "sha512-JsXBU+kgQOAgzUn2jPrLA+Rd0Y1dswOlX3hp8MuRO1hQDs6xgHtbCXEiAu7bz5hyVURxbXcA2draasMbNqrhmg==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.6.0.tgz", + "integrity": "sha512-YVK49NgdUPQ8SpCZaOpiq1kLkYRPMv9U5gcMrywzI8brtwZjr/tG3sZpuHyODt76W/A0SufNjYt9ZOgrC4tLIQ==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "5.5.0", - "@typescript-eslint/types": "5.5.0", - "@typescript-eslint/typescript-estree": "5.5.0", + "@typescript-eslint/scope-manager": "5.6.0", + "@typescript-eslint/types": "5.6.0", + "@typescript-eslint/typescript-estree": "5.6.0", "debug": "^4.3.2" } }, "@typescript-eslint/scope-manager": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.5.0.tgz", - "integrity": "sha512-0/r656RmRLo7CbN4Mdd+xZyPJ/fPCKhYdU6mnZx+8msAD8nJSP8EyCFkzbd6vNVZzZvWlMYrSNekqGrCBqFQhg==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.6.0.tgz", + "integrity": "sha512-1U1G77Hw2jsGWVsO2w6eVCbOg0HZ5WxL/cozVSTfqnL/eB9muhb8THsP0G3w+BB5xAHv9KptwdfYFAUfzcIh4A==", "dev": true, "requires": { - "@typescript-eslint/types": "5.5.0", - "@typescript-eslint/visitor-keys": "5.5.0" + "@typescript-eslint/types": "5.6.0", + "@typescript-eslint/visitor-keys": "5.6.0" } }, "@typescript-eslint/types": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.5.0.tgz", - "integrity": "sha512-OaYTqkW3GnuHxqsxxJ6KypIKd5Uw7bFiQJZRyNi1jbMJnK3Hc/DR4KwB6KJj6PBRkJJoaNwzMNv9vtTk87JhOg==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.6.0.tgz", + "integrity": "sha512-OIZffked7mXv4mXzWU5MgAEbCf9ecNJBKi+Si6/I9PpTaj+cf2x58h2oHW5/P/yTnPkKaayfjhLvx+crnl5ubA==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.5.0.tgz", - "integrity": "sha512-pVn8btYUiYrjonhMAO0yG8lm7RApzy2L4RC7Td/mC/qFkyf6vRbGyZozoA94+w6D2Y2GRqpMoCWcwx/EUOzyoQ==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.6.0.tgz", + "integrity": "sha512-92vK5tQaE81rK7fOmuWMrSQtK1IMonESR+RJR2Tlc7w4o0MeEdjgidY/uO2Gobh7z4Q1hhS94Cr7r021fMVEeA==", "dev": true, "requires": { - "@typescript-eslint/types": "5.5.0", - "@typescript-eslint/visitor-keys": "5.5.0", + "@typescript-eslint/types": "5.6.0", + "@typescript-eslint/visitor-keys": "5.6.0", "debug": "^4.3.2", "globby": "^11.0.4", "is-glob": "^4.0.3", @@ -2574,12 +2574,12 @@ } }, "@typescript-eslint/visitor-keys": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.5.0.tgz", - "integrity": "sha512-4GzJ1kRtsWzHhdM40tv0ZKHNSbkDhF0Woi/TDwVJX6UICwJItvP7ZTXbjTkCdrors7ww0sYe0t+cIKDAJwZ7Kw==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.6.0.tgz", + "integrity": "sha512-1p7hDp5cpRFUyE3+lvA74egs+RWSgumrBpzBCDzfTFv0aQ7lIeay80yU0hIxgAhwQ6PcasW35kaOCyDOv6O/Ng==", "dev": true, "requires": { - "@typescript-eslint/types": "5.5.0", + "@typescript-eslint/types": "5.6.0", "eslint-visitor-keys": "^3.0.0" }, "dependencies": { @@ -6060,9 +6060,9 @@ } }, "core-js": { - "version": "3.19.2", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.19.2.tgz", - "integrity": "sha512-ciYCResnLIATSsXuXnIOH4CbdfgV+H1Ltg16hJFN7/v6OxqnFr/IFGeLacaZ+fHLAm0TBbXwNK9/DNBzBUrO/g==" + "version": "3.19.3", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.19.3.tgz", + "integrity": "sha512-LeLBMgEGSsG7giquSzvgBrTS7V5UL6ks3eQlUSbN8dJStlLFiRzUm5iqsRyzUB8carhfKjkJ2vzKqE6z1Vga9g==" }, "core-js-compat": { "version": "3.19.2", @@ -7778,9 +7778,9 @@ } }, "eslint-plugin-vue": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-8.1.1.tgz", - "integrity": "sha512-rx64IrlhdfPya6u2V5ukOGiLCTgaCBdMSpczLVqyo8A0l+Vbo+lzvIfEUfAQ2auj+MF6y0TwxLorzdCIzHunnw==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-8.2.0.tgz", + "integrity": "sha512-cLIdTuOAMXyHeQ4drYKcZfoyzdwdBpH279X8/N0DgmotEI9yFKb5O/cAgoie/CkQZCH/MOmh0xw/KEfS90zY2A==", "dev": true, "requires": { "eslint-utils": "^3.0.0", @@ -7853,14 +7853,6 @@ "dev": true, "requires": { "eslint-visitor-keys": "^2.0.0" - }, - "dependencies": { - "eslint-visitor-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", - "dev": true - } } }, "eslint-visitor-keys": { @@ -11186,9 +11178,9 @@ "dev": true }, "lamejs": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/lamejs/-/lamejs-1.2.0.tgz", - "integrity": "sha1-Aln4PbRmYUGntnG4yqY2nZUXfQg=", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/lamejs/-/lamejs-1.2.1.tgz", + "integrity": "sha512-s7bxvjvYthw6oPLCm5pFxvA84wUROODB8jEO2+CE1adhKgrIvVOlmMgY8zyugxGrvRaDHNJanOiS21/emty6dQ==", "optional": true, "requires": { "use-strict": "1.0.1" @@ -11257,58 +11249,6 @@ "yargs": "^13.3.0" }, "dependencies": { - "@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true - }, - "array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true - }, - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "requires": { - "fill-range": "^7.0.1" - } - }, - "dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dev": true, - "requires": { - "path-type": "^4.0.0" - } - }, - "fast-glob": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.7.tgz", - "integrity": "sha512-rYGMRwip6lUMvYD3BTScMwT1HtAs2d71SMv66Vrxs0IekGZEjhM0pcMfjQPnknBt2zeCwQMEupiN02ZP4DiT1Q==", - "dev": true, - "requires": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - } - }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "requires": { - "to-regex-range": "^5.0.1" - } - }, "fs-extra": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", @@ -11342,42 +11282,11 @@ "integrity": "sha512-2zeMQpbKz5dhZ9IwL0gbxSW5w0NK/MSAMtNuhgIHEPmaU3vPdKPL0UdvUCXs5SS4JAwsBxysK5sFMW8ocFiVjQ==", "dev": true }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true - }, - "micromatch": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", - "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", - "dev": true, - "requires": { - "braces": "^3.0.1", - "picomatch": "^2.2.3" - } - }, - "path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true - }, "slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true - }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "requires": { - "is-number": "^7.0.0" - } } } }, @@ -14481,9 +14390,9 @@ "dev": true }, "prettier": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.5.0.tgz", - "integrity": "sha512-FM/zAKgWTxj40rH03VxzIPdXmj39SwSjwG0heUcNFwI+EMZJnY93yAiKXM3dObIKAM5TA88werc8T/EwhB45eg==", + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.5.1.tgz", + "integrity": "sha512-vBZcPRUR5MZJwoyi3ZoyQlc1rXeEck8KgeC9AwwOn+exuxLxq5toTRDTSaVrXHxelDMHy9zlicw8u66yxoSUFg==", "dev": true }, "prettier-linter-helpers": { @@ -17207,9 +17116,9 @@ "dev": true }, "typescript": { - "version": "4.5.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.2.tgz", - "integrity": "sha512-5BlMof9H1yGt0P8/WF+wPNw6GfctgGjXp5hkblpyT+8rkASSmkUKMXrxR0Xg8ThVCi/JnHQiKXeBaEwCeQwMFw==", + "version": "4.5.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.3.tgz", + "integrity": "sha512-eVYaEHALSt+s9LbvgEv4Ef+Tdq7hBiIZgii12xXJnukryt3pMgJf6aKhoCZ3FWQsu6sydEnkg11fYXLzhLBjeQ==", "dev": true }, "uc.micro": { @@ -17581,9 +17490,9 @@ "integrity": "sha512-x2284lgYvjOMj3Za7kqzRcUSxBboHqtgRE2zlos1qWaOye5yUmHn42LB1250NJBLRwEcdrB0JRwyPTEPhfQjiQ==" }, "vue-advanced-chat": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/vue-advanced-chat/-/vue-advanced-chat-1.4.2.tgz", - "integrity": "sha512-5SlLLjcfMF/OgfTxXdGuyj3nQbhto6HzUrXkaOsZS2RBuoZbBWkGxXyfVoiIfLg2LcMg8g77eB+ZgDQMV0gy8g==", + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/vue-advanced-chat/-/vue-advanced-chat-1.4.3.tgz", + "integrity": "sha512-1hnwEQoCHzJ/IxyWaZ4oZnbJWgN9zR0kuTGuooF4vn8i1SZHZKrp1xCM6OfyfjfA2pEgh0anUBtiA97VkDXSGQ==", "requires": { "emoji-picker-element": "^1.8.2", "lamejs": "^1.2.0", @@ -17619,9 +17528,9 @@ } }, "vue-cli-plugin-vuetify": { - "version": "2.4.4", - "resolved": "https://registry.npmjs.org/vue-cli-plugin-vuetify/-/vue-cli-plugin-vuetify-2.4.4.tgz", - "integrity": "sha512-asc6G7+yN7NCk2ha0zaaeVZ+hSUP++Akao99SeW8rPO/nCxN2AIeCZg7PHPHDvcDYL9+KWhTsw5YbqYCk8x4LA==", + "version": "2.4.5", + "resolved": "https://registry.npmjs.org/vue-cli-plugin-vuetify/-/vue-cli-plugin-vuetify-2.4.5.tgz", + "integrity": "sha512-CnCVzG6iZAsMMqTkijZ0gRkPB6s4zHPWyFX1VpBBKVyxZESayQhUoMCZRZUOZNjvvZpq1LPgviq+8zcliSu73g==", "dev": true, "requires": { "null-loader": "^4.0.1", @@ -17725,9 +17634,9 @@ "dev": true }, "vue-i18n": { - "version": "8.26.5", - "resolved": "https://registry.npmjs.org/vue-i18n/-/vue-i18n-8.26.5.tgz", - "integrity": "sha512-qYqfsFd8v2QFSLDAabqXXXpwjGvkuqJtTWqRpZPXpAFO6PArGH4A9vSplnA0HLmnB8km7OB5ZSdP8lkkX0rLew==" + "version": "8.26.7", + "resolved": "https://registry.npmjs.org/vue-i18n/-/vue-i18n-8.26.7.tgz", + "integrity": "sha512-7apa5PvRg1YCLoraE3lOgpCG8hJGupLCtywQWedWsgBbvF0TOgFvhitqK9xRH0PBGG1G8aiJz9oklyNDFfDxLg==" }, "vue-i18n-extract": { "version": "1.0.2", diff --git a/frontend/package.json b/frontend/package.json index 786cf8b05..4f68a70d4 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -6,17 +6,18 @@ "serve": "vue-cli-service serve", "build": "vue-cli-service build", "test:unit": "vue-cli-service test:unit", - "lint": "vue-cli-service lint && npm run license-file-headers-add", - "prettify": "prettier --write **/*.{css,html,js,json,mjs,scss,ts,tsx,yml,md,vue}", + "lint": "vue-cli-service lint", + "prettify": "npm run license && prettier --write **/*.{css,html,js,json,mjs,scss,ts,tsx,yml,md,vue}", "i18n:report": "vue-cli-service i18n:report --src './src/**/*.?(js|vue)' --locales './src/locales/**/*.json'", "license-file-headers-add": "license-check-and-add add -f license-header/config.json -r 2021", + "license-file-headers-check": "license-check-and-add check -f license-header/config.json -r 2021", "license": "generate-attribution -o ./licenses", "license-check": "license-checker --production --json --onlyAllow 'MIT;Python-2.0;Apache-2.0;BSD-2-Clause;BSD-3-Clause' --excludePackages 'business-partner-agent-frontend@0.1.0'", "prepare": "cd ../ && husky install ./frontend/.husky" }, "dependencies": { "axios": "0.24.0", - "core-js": "3.19.2", + "core-js": "3.19.3", "csv-string": "4.0.1", "deepmerge": "4.2.2", "font-awesome": "4.7.0", @@ -24,8 +25,8 @@ "moment": "2.29.1", "qrcode.vue": "1.7.0", "vue": "2.6.14", - "vue-advanced-chat": "1.4.2", - "vue-i18n": "8.26.5", + "vue-advanced-chat": "1.4.3", + "vue-i18n": "8.26.7", "vue-json-pretty": "1.8.2", "vue-markdown-render": "1.1.3", "vue-moment": "4.1.0", @@ -39,8 +40,8 @@ "@mdi/font": "6.5.95", "@mdi/js": "6.5.95", "@types/vue-moment": "4.0.3", - "@typescript-eslint/eslint-plugin": "5.5.0", - "@typescript-eslint/parser": "5.5.0", + "@typescript-eslint/eslint-plugin": "5.6.0", + "@typescript-eslint/parser": "5.6.0", "@vue/cli-plugin-babel": "4.5.15", "@vue/cli-plugin-eslint": "4.5.15", "@vue/cli-plugin-router": "4.5.15", @@ -53,18 +54,18 @@ "eslint": "7.32.0", "eslint-plugin-prettier": "4.0.0", "eslint-plugin-unicorn": "39.0.0", - "eslint-plugin-vue": "8.1.1", + "eslint-plugin-vue": "8.2.0", "husky": "7.0.4", "license-check-and-add": "4.0.3", "license-checker": "25.0.1", "lint-staged": "12.1.2", "oss-attribution-generator": "1.7.1", - "prettier": "2.5.0", + "prettier": "2.5.1", "sass": "1.32.0", "sass-loader": "8.0.2", - "typescript": "4.5.2", + "typescript": "4.5.3", "vue-cli-plugin-i18n": "2.3.1", - "vue-cli-plugin-vuetify": "2.4.4", + "vue-cli-plugin-vuetify": "2.4.5", "vue-jest": "3.0.7", "vue-template-compiler": "2.6.14", "vuetify-loader": "1.7.3" diff --git a/frontend/public/env.js b/frontend/public/env.js new file mode 100644 index 000000000..909fff907 --- /dev/null +++ b/frontend/public/env.js @@ -0,0 +1,12 @@ +/* + * Copyright (c) 2020-2021 - for information on the respective copyright owner + * see the NOTICE file and/or the repository at + * https://github.com/hyperledger-labs/business-partner-agent + * + * SPDX-License-Identifier: Apache-2.0 + */ +// Runtime variables - values must have '__' prefix and suffix - no secret values +window.env = { + SIDEBAR_CLOSE_ON_STARTUP: "__SIDEBAR_CLOSE_ON_STARTUP__", + SIDEBAR_HIDE_BURGER_BUTTON: "__SIDEBAR_HIDE_BURGER_BUTTON__", +}; diff --git a/frontend/public/index.html b/frontend/public/index.html index de35f8c8a..fed5f9d4f 100644 --- a/frontend/public/index.html +++ b/frontend/public/index.html @@ -12,6 +12,7 @@ + Loading... diff --git a/frontend/setup-runtime.sh b/frontend/setup-runtime.sh new file mode 100644 index 000000000..3ee7fb199 --- /dev/null +++ b/frontend/setup-runtime.sh @@ -0,0 +1,19 @@ +#!/bin/sh +# Copyright (c) 2020-2021 - for information on the respective copyright owner +# see the NOTICE file and/or the repository at +# https://github.com/hyperledger-labs/business-partner-agent +# +# SPDX-License-Identifier: Apache-2.0 + +# First argument: Path to env.js which needs to be modified +# Second argument: Path to BPA jar file to replace env.js +echo "Start setting runtime variables" + +# Overwrite frontend runtime variables with environment variables from container +sed -i 's#__SIDEBAR_CLOSE_ON_STARTUP__#'"$SIDEBAR_CLOSE_ON_STARTUP"'#g' "$1" +sed -i 's#__SIDEBAR_HIDE_BURGER_BUTTON__#'"$SIDEBAR_HIDE_BURGER_BUTTON"'#g' "$1" + +# Overwrite env.js in given jar file (path) +jar uf "$2" "$1" + +echo "Finish setting runtime variables" diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 1e7edd16a..524b10d07 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -7,7 +7,11 @@ -->