From 1988479f6814c05c801f78b2f60b6828bab9a6ce Mon Sep 17 00:00:00 2001 From: "Daniel A.C. Martin" Date: Tue, 14 Feb 2023 20:45:33 +0000 Subject: [PATCH 1/4] Serverless: Update runtime to Node.js v18 --- apps/govuk-docs/aws.serverless.yml | 2 +- apps/govuk-template/aws.serverless.yml | 2 +- lib/plop-pack/skel/app/aws.serverless.yml.hbs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/govuk-docs/aws.serverless.yml b/apps/govuk-docs/aws.serverless.yml index b6e8bdfad..b0218ebb7 100644 --- a/apps/govuk-docs/aws.serverless.yml +++ b/apps/govuk-docs/aws.serverless.yml @@ -1,7 +1,7 @@ service: govuk-docs provider: name: aws - runtime: nodejs16.x + runtime: nodejs18.x environment: MODE: serverless NODE_ENV: production diff --git a/apps/govuk-template/aws.serverless.yml b/apps/govuk-template/aws.serverless.yml index 7d064ef1e..396afac00 100644 --- a/apps/govuk-template/aws.serverless.yml +++ b/apps/govuk-template/aws.serverless.yml @@ -1,7 +1,7 @@ service: govuk-template provider: name: aws - runtime: nodejs16.x + runtime: nodejs18.x environment: MODE: serverless NODE_ENV: production diff --git a/lib/plop-pack/skel/app/aws.serverless.yml.hbs b/lib/plop-pack/skel/app/aws.serverless.yml.hbs index 0a24f253e..ac137a2eb 100644 --- a/lib/plop-pack/skel/app/aws.serverless.yml.hbs +++ b/lib/plop-pack/skel/app/aws.serverless.yml.hbs @@ -1,7 +1,7 @@ service: {{{ name }}} provider: name: aws - runtime: nodejs16.x + runtime: nodejs18.x environment: MODE: serverless NODE_ENV: production From 845dff95300d81110f034fc55596b48ac04847dd Mon Sep 17 00:00:00 2001 From: "Daniel A.C. Martin" Date: Tue, 14 Feb 2023 20:46:10 +0000 Subject: [PATCH 2/4] CI: Update Node.js to v18 --- .github/actions/setup/action.yml | 2 +- .github/workflows/change-assurance.yml | 6 +++--- .github/workflows/deploy-to-heroku.yml | 2 +- .github/workflows/deploy-to-netlify.yml | 2 +- .github/workflows/deploy.yml | 4 ++-- .github/workflows/publish.yml | 2 +- .github/workflows/static-security-analysis.yml | 2 +- .github/workflows/update-built-files.yml | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index aa129f2d5..8cd9b48a3 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -4,7 +4,7 @@ inputs: node: description: The version of Node.js to use. required: false - default: 16 + default: 18 frozen-lockfile: description: Whether to require a frozen lock-file required: false diff --git a/.github/workflows/change-assurance.yml b/.github/workflows/change-assurance.yml index cbb77ec5c..4a57e6338 100644 --- a/.github/workflows/change-assurance.yml +++ b/.github/workflows/change-assurance.yml @@ -49,7 +49,7 @@ jobs: - name: Setup uses: ./.github/actions/setup with: - node: 16 + node: 18 - name: Build libraries run: npm run libs:build @@ -70,7 +70,7 @@ jobs: - name: Setup uses: ./.github/actions/setup with: - node: 16 + node: 18 - name: Build uses: ./.github/actions/build-app @@ -102,7 +102,7 @@ jobs: - name: Setup uses: ./.github/actions/setup with: - node: 16 + node: 18 - name: Download build directory uses: actions/download-artifact@v3 diff --git a/.github/workflows/deploy-to-heroku.yml b/.github/workflows/deploy-to-heroku.yml index fca3ba807..0abbc91f8 100644 --- a/.github/workflows/deploy-to-heroku.yml +++ b/.github/workflows/deploy-to-heroku.yml @@ -74,7 +74,7 @@ jobs: cypress-project-id: ${{ secrets.CYPRESS_PROJECT_ID }} cypress-record-key: ${{ secrets.CYPRESS_RECORD_KEY }} deployment: heroku - node: 16 + node: 18 smoke: true - name: Scan service for vulnerabilities diff --git a/.github/workflows/deploy-to-netlify.yml b/.github/workflows/deploy-to-netlify.yml index 2b961a71f..5b2c264c0 100644 --- a/.github/workflows/deploy-to-netlify.yml +++ b/.github/workflows/deploy-to-netlify.yml @@ -80,7 +80,7 @@ jobs: cypress-project-id: ${{ secrets.CYPRESS_PROJECT_ID }} cypress-record-key: ${{ secrets.CYPRESS_RECORD_KEY }} deployment: netlify - node: 16 + node: 18 smoke: true - name: Scan service for vulnerabilities diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 8076cb569..527cce0ef 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -15,7 +15,7 @@ jobs: - name: Setup uses: ./.github/actions/setup with: - node: 16 + node: 18 - name: Push Storybook to Chromatic uses: chromaui/action@v1 @@ -33,7 +33,7 @@ jobs: uses: './.github/workflows/deploy-to-netlify.yml' with: app: govuk-docs - node: 16 + node: 18 production-branch: master secrets: CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_PROJECT_ID }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ea35832fd..fb36d6462 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -19,7 +19,7 @@ jobs: - name: Setup uses: ./.github/actions/setup with: - node: 16 + node: 18 frozen-lockfile: true - name: Publish diff --git a/.github/workflows/static-security-analysis.yml b/.github/workflows/static-security-analysis.yml index e9cd0f988..5e44cf55a 100644 --- a/.github/workflows/static-security-analysis.yml +++ b/.github/workflows/static-security-analysis.yml @@ -22,7 +22,7 @@ jobs: - name: Setup uses: ./.github/actions/setup with: - node: 16 + node: 18 - name: Scan dependencies uses: ./.github/actions/scan-dependencies diff --git a/.github/workflows/update-built-files.yml b/.github/workflows/update-built-files.yml index 31933f82e..17f222c34 100644 --- a/.github/workflows/update-built-files.yml +++ b/.github/workflows/update-built-files.yml @@ -19,7 +19,7 @@ jobs: - name: Setup uses: ./.github/actions/setup with: - node: 16 + node: 18 - name: Scan dependencies uses: ./.github/actions/scan-dependencies From a81eb6fbf82a200e020ce6ec44ab3100f1ff6391 Mon Sep 17 00:00:00 2001 From: "Daniel A.C. Martin" Date: Tue, 14 Feb 2023 22:02:03 +0000 Subject: [PATCH 3/4] apps: Listen on IPv6 by default On linux this should also listen on IPv4. --- apps/govuk-docs/src/server/config.ts | 2 +- apps/govuk-template/src/server/config.ts | 2 +- lib/plop-pack/skel/app/src/server/config.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/govuk-docs/src/server/config.ts b/apps/govuk-docs/src/server/config.ts index 063c870b1..2227e1777 100644 --- a/apps/govuk-docs/src/server/config.ts +++ b/apps/govuk-docs/src/server/config.ts @@ -16,7 +16,7 @@ const serverConfig = { level: process.env.LOG_LEVEL || 'info' }, httpd: { - host: process.env.LISTEN_HOST || '0.0.0.0', + host: process.env.LISTEN_HOST || '::', port: Number(process.env.PORT) || Number(process.env.LISTEN_PORT) || 8080 }, mode: (process.env.MODE || 'server') as Mode, diff --git a/apps/govuk-template/src/server/config.ts b/apps/govuk-template/src/server/config.ts index 3d3ee8fb1..c4ff12820 100644 --- a/apps/govuk-template/src/server/config.ts +++ b/apps/govuk-template/src/server/config.ts @@ -41,7 +41,7 @@ const serverConfig = { level: process.env.LOG_LEVEL || 'info' }, httpd: { - host: process.env.LISTEN_HOST || '0.0.0.0', + host: process.env.LISTEN_HOST || '::', port: Number(process.env.PORT) || Number(process.env.LISTEN_PORT) || 8080 }, mode: (process.env.MODE || 'server') as Mode, diff --git a/lib/plop-pack/skel/app/src/server/config.ts b/lib/plop-pack/skel/app/src/server/config.ts index df739eab7..25aa4ae88 100644 --- a/lib/plop-pack/skel/app/src/server/config.ts +++ b/lib/plop-pack/skel/app/src/server/config.ts @@ -41,7 +41,7 @@ const serverConfig = { level: process.env.LOG_LEVEL || 'info' }, httpd: { - host: process.env.LISTEN_HOST || '0.0.0.0', + host: process.env.LISTEN_HOST || '::', port: Number(process.env.PORT) || Number(process.env.LISTEN_PORT) || 8080 }, mode: (process.env.MODE || 'server') as Mode, From 2e11b6d8b6804d28d398dcafe7be0ea7c591680b Mon Sep 17 00:00:00 2001 From: "Daniel A.C. Martin" Date: Tue, 14 Feb 2023 22:02:57 +0000 Subject: [PATCH 4/4] apps: Default to IPv6 in Docker image --- lib/plop-pack/skel/app/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/plop-pack/skel/app/Dockerfile b/lib/plop-pack/skel/app/Dockerfile index d29dc8a9c..131ed5e83 100644 --- a/lib/plop-pack/skel/app/Dockerfile +++ b/lib/plop-pack/skel/app/Dockerfile @@ -15,7 +15,7 @@ COPY package.json /app/ COPY dist/ /app/dist/ USER 31337 -ENV LISTEN_HOST="0.0.0.0" \ +ENV LISTEN_HOST="::" \ LISTEN_PORT="8080" \ SSR_ONLY="false" \ SESSIONS_SECRET="changeme" \