diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..fda6b7a --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,134 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-docker-compose +{ + "name": "ffc-pay-web", + + // Update the 'dockerComposeFile' list if you have more compose files or use different names. + // The .devcontainer/docker-compose.yml file contains any overrides you need/want to make. + "dockerComposeFile": [ + "../docker-compose.yaml", + "docker-compose.yml" + ], + + // The 'service' property is the name of the service for the container that VS Code should + // use. Update this value and .devcontainer/docker-compose.yml to the real service name. + "service": "ffc-pay-web", + + // The optional 'workspaceFolder' property is the path VS Code should open by default when + // connected. This is typically a file mount in .devcontainer/docker-compose.yml + "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}", + "customizations": { + "vscode": { + "extensions": [ + "ms-azuretools.vscode-docker", + "orta.vscode-jest", + "andys8.jest-snippets", + "ms-ossdata.vscode-postgresql", + "asyncapi.asyncapi-preview", + "oderwat.indent-rainbow", + "snyk-security.snyk-vulnerability-scanner", + "sonarsource.sonarlint-vscode", + "esbenp.prettier-vscode", + "alexkrechik.cucumberautocomplete", + "JosefBiehler.cypress-fixture-intellisense", + "Shelex.vscode-cy-helper", + "dbaeumer.vscode-eslint", + "siarheikuchuk.gherkin-beautifier-vs-code-plugin", + "techer.open-in-browser", + "VisualStudioExptTeam.vscodeintellicode" + ], + "settings": { + "jest.runMode": "on-demand", + "editor.formatOnSave": true, + "editor.codeActionsOnSave": { + "source.fixAll.eslint": "explicit", + "eslint.validate": [ + "javascript", + "javascriptreact", + "json", + "jsonc", + "json5" + ], + "cSpell.words": [], + "cSpell.minWordLength": 4, + "cSpell.showStatus": true, + "cSpell.allowCompoundWords": true, + "compile-hero.disable-compile-files-on-did-save-code": true, + "breadcrumbs.enabled": false, + "editor.cursorBlinking": "blink", + "editor.lineDecorationsWidth": "30", + "editor.folding": false, + "editor.hideCursorInOverviewRuler": true, + "editor.occurrencesHighlight": "off", + "editor.roundedSelection": false, + "editor.selectionHighlight": true, + "editor.scrollBeyondLastLine": false, + "explorer.openEditors.visible": 1, + "window.zoomLevel": 0, + "workbench.editor.showIcons": true, + "workbench.startupEditor": "none", + "workbench.tree.renderIndentGuides": "none", + "editor.formatOnPaste": false, + "workbench.editor.highlightModifiedTabs": true, + "files.trimFinalNewlines": true, + "editor.acceptSuggestionOnEnter": "off", + "cypressHelper.menuItems.OpenCypress": false, + "editor.bracketPairColorization.enabled": true, + "editor.guides.bracketPairs": "active", + "editor.guides.indentation": false, + "cucumberautocomplete.smartSnippets": true, + "cucumberautocomplete.steps": "cypress/integration/steps/*.js", + "cucumberautocomplete.syncfeatures": "cypress/integration/features/*.feature", + "cucumberautocomplete.strictGherkinCompletion": false, + "cucumberautocomplete.strictGherkinValidation": false, + "cucumberautocomplete.skipDocStringsFormat": false, + "cucumberautocomplete.onTypeFormat": true, + "editor.quickSuggestions": { + "comments": false, + "strings": true, + "other": true + }, + "conf.view.indentSymbol": "space", + "conf.view.identsBefore.Feature": 0, + "conf.view.identsBefore.Scenario": 2, + "conf.view.identsBefore.Background": 2, + "conf.view.identsBefore.ScenarioOutline": 2, + "conf.view.identsBefore.Given": 4, + "conf.view.identsBefore.When": 4, + "conf.view.identsBefore.Then": 4, + "conf.view.identsBefore.And": 4, + "conf.view.identsBefore.Tag": "relative", + "conf.view.identsBefore.Table": 6, + "conf.view.identsBefore.Examples": 4, + "conf.view.table.autoformat": true, + "cSpell.ignoreWords": [], + "git.ignoreLimitWarning": true, + "[json]": { + "editor.formatOnSave": true + } + } + } + } + } + + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Uncomment the next line if you want start specific services in your Docker Compose config. + // "runServices": [], + + // Uncomment the next line if you want to keep your containers running after VS Code shuts down. + // "shutdownAction": "none", + + // Uncomment the next line to run commands after the container is created. + // "postCreateCommand": "cat /etc/os-release", + + // Configure tool-specific properties. + // "customizations": {}, + + // Uncomment to connect as an existing user other than the container default. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "devcontainer" +} diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml new file mode 100644 index 0000000..e5cabe9 --- /dev/null +++ b/.devcontainer/docker-compose.yml @@ -0,0 +1,26 @@ +services: + ffc-pay-web: + build: + target: development + image: ffc-pay-web-development + container_name: ffc-pay-web-development + ports: + - "3007:3007" + - "9238:9229" + volumes: + - ../.gitignore:/workspaces:cached/.gitignore + - ..:/workspaces:cached + environment: + AZURE_STORAGE_CONNECTION_STRING: DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://ffc-pay-event-store-azurite:10000/devstoreaccount1;TableEndpoint=http://ffc-pay-event-store-azurite:10002/devstoreaccount1; + JAVA_HOME: /usr/lib/jvm/java-17-openjdk + + ffc-pay-event-store-azurite: + volumes: + - azurite_data:/data + ports: + - "10070:10000" + - "10071:10001" + - "10072:10002" + +volumes: + azurite_data: diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..f33a02c --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,12 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for more information: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates +# https://containers.dev/guide/dependabot + +version: 2 +updates: + - package-ecosystem: "devcontainers" + directory: "/" + schedule: + interval: weekly diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 888b378..5ab1133 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/Yelp/detect-secrets - rev: v1.4.0 + rev: v1.5.0 hooks: - id: detect-secrets args: ['--baseline', '.secrets.baseline'] diff --git a/.secrets.baseline b/.secrets.baseline index 175704f..f0d3c09 100644 --- a/.secrets.baseline +++ b/.secrets.baseline @@ -1,5 +1,5 @@ { - "version": "1.4.0", + "version": "1.5.0", "plugins_used": [ { "name": "ArtifactoryDetector" @@ -26,6 +26,9 @@ { "name": "GitHubTokenDetector" }, + { + "name": "GitLabTokenDetector" + }, { "name": "HexHighEntropyString", "limit": 3.0 @@ -36,6 +39,9 @@ { "name": "IbmCosHmacDetector" }, + { + "name": "IPPublicDetector" + }, { "name": "JwtTokenDetector" }, @@ -49,9 +55,15 @@ { "name": "NpmDetector" }, + { + "name": "OpenAIDetector" + }, { "name": "PrivateKeyDetector" }, + { + "name": "PypiTokenDetector" + }, { "name": "SendGridDetector" }, @@ -67,6 +79,9 @@ { "name": "StripeDetector" }, + { + "name": "TelegramBotTokenDetector" + }, { "name": "TwilioKeyDetector" } @@ -108,20 +123,36 @@ } ], "results": { + ".devcontainer/docker-compose.yml": [ + { + "type": "Secret Keyword", + "filename": ".devcontainer/docker-compose.yml", + "hashed_secret": "564d0eeb4f4d2d1dce2900acdd94500570284e37", + "is_verified": false, + "line_number": 14 + }, + { + "type": "Azure Storage Account access key", + "filename": ".devcontainer/docker-compose.yml", + "hashed_secret": "5666459779d6a76bea73453137803fd27d8f79cd", + "is_verified": false, + "line_number": 14 + } + ], "docker-compose.override.yaml": [ { "type": "Secret Keyword", "filename": "docker-compose.override.yaml", - "hashed_secret": "3a9bc5cb5668e15fe0bcc6bfa6b5a0e6dd4d1c67", + "hashed_secret": "564d0eeb4f4d2d1dce2900acdd94500570284e37", "is_verified": false, - "line_number": 19 + "line_number": 17 }, { "type": "Azure Storage Account access key", "filename": "docker-compose.override.yaml", "hashed_secret": "5666459779d6a76bea73453137803fd27d8f79cd", "is_verified": false, - "line_number": 19 + "line_number": 17 } ], "docker-compose.test.yaml": [ @@ -130,21 +161,21 @@ "filename": "docker-compose.test.yaml", "hashed_secret": "10f38898af083f58af3e236b345843571ea5b3d4", "is_verified": false, - "line_number": 15 + "line_number": 13 }, { - "type": "Secret Keyword", + "type": "Azure Storage Account access key", "filename": "docker-compose.test.yaml", - "hashed_secret": "3a9bc5cb5668e15fe0bcc6bfa6b5a0e6dd4d1c67", + "hashed_secret": "5666459779d6a76bea73453137803fd27d8f79cd", "is_verified": false, - "line_number": 20 + "line_number": 18 }, { - "type": "Azure Storage Account access key", + "type": "Secret Keyword", "filename": "docker-compose.test.yaml", - "hashed_secret": "5666459779d6a76bea73453137803fd27d8f79cd", + "hashed_secret": "e6e0f255a8a4d88c13b994c38e109457e5c7e15d", "is_verified": false, - "line_number": 20 + "line_number": 18 } ], "docker-compose.yaml": [ @@ -153,7 +184,7 @@ "filename": "docker-compose.yaml", "hashed_secret": "d7f7a811463157aed6db3f8758aa6c93943d2a81", "is_verified": false, - "line_number": 20 + "line_number": 19 } ], "helm/ffc-pay-web/values.yaml": [ @@ -162,9 +193,25 @@ "filename": "helm/ffc-pay-web/values.yaml", "hashed_secret": "d7f7a811463157aed6db3f8758aa6c93943d2a81", "is_verified": false, - "line_number": 45 + "line_number": 46 + } + ], + ".devcontainer/docker-compose.yml": [ + { + "type": "Secret Keyword", + "filename": ".devcontainer/docker-compose.yml", + "hashed_secret": "564d0eeb4f4d2d1dce2900acdd94500570284e37", + "is_verified": false, + "line_number": 14 + }, + { + "type": "Azure Storage Account access key", + "filename": ".devcontainer/docker-compose.yml", + "hashed_secret": "5666459779d6a76bea73453137803fd27d8f79cd", + "is_verified": false, + "line_number": 14 } ] }, - "generated_at": "2023-04-13T11:32:50Z" + "generated_at": "2024-09-10T08:47:53Z" } diff --git a/Dockerfile b/Dockerfile index a8151a0..fd33521 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,7 +11,10 @@ ARG PORT ARG PORT_DEBUG ENV PORT ${PORT} EXPOSE ${PORT} ${PORT_DEBUG} +USER root +RUN apk add --update --no-cache openjdk17-jre +USER node COPY --chown=node:node package*.json ./ RUN npm install COPY --chown=node:node . . diff --git a/package.json b/package.json index 62e373f..0761da7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ffc-pay-web", - "version": "1.20.8", + "version": "1.20.9", "description": "FFC payment management service", "homepage": "https://github.com/DEFRA/ffc-pay-web", "main": "app/index.js",