From 82415934ce23c4f64116f5a0c140d26671bcb29c Mon Sep 17 00:00:00 2001 From: Bill Himmelsbach Date: Tue, 10 Dec 2024 10:58:59 -0800 Subject: [PATCH] Revert "Upgrade to Node v22 (#1047)" This reverts commit 1143bfec2d417dc4363cb14f540eb9339104f33e. --- .nvmrc | 2 +- Dockerfile | 41 +++++++++---------- README.md | 4 +- .../InstitutionProfile.spec.ts | 2 +- package.json | 2 +- 5 files changed, 24 insertions(+), 27 deletions(-) diff --git a/.nvmrc b/.nvmrc index 53d1c14db..3f430af82 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -v22 +v18 diff --git a/Dockerfile b/Dockerfile index d7a403c4f..0d62abef2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,10 @@ -FROM ghcr.io/cfpb/regtech/sbl/node-js-alpine:3.20 as build-stage +FROM ghcr.io/cfpb/regtech/sbl/nodejs-alpine:3.20 as build-stage WORKDIR /usr/src/app ARG DOCKER_TAG="latest" # build import-meta-env for alpine for later env var injection RUN npm i -D @import-meta-env/cli RUN npm i -D @import-meta-env/unplugin - -# TODO: Find a way to update the target node version for import-meta-env -# https://github.com/cfpb/sbl-frontend/issues/1061 RUN npx pkg ./node_modules/@import-meta-env/cli/bin/import-meta-env.js \ -t node18-alpine-x64 \ -o import-meta-env-alpine @@ -30,32 +27,32 @@ COPY --from=build-stage /usr/src/app/dist /usr/share/nginx/html # copy necessary import-meta-env-alpine files for env var injection COPY --from=build-stage \ - /usr/src/app/import-meta-env-alpine \ - /usr/src/app/nginx-entrypoint.sh \ - /usr/src/app/.env.example.public \ - /usr/share/nginx/html/ + /usr/src/app/import-meta-env-alpine \ + /usr/src/app/nginx-entrypoint.sh \ + /usr/src/app/.env.example.public \ + /usr/share/nginx/html/ # copy nginx configuration into template folder for env var injection COPY nginx/nginx.conf /etc/nginx/templates/nginx.conf.template - + # Security Basline - Meets requirement 9 RUN find /etc/nginx -type d | xargs chmod 750 && \ - find /etc/nginx -type f | xargs chmod 640 + find /etc/nginx -type f | xargs chmod 640 # Security Basline - The `sed` was added to meet requirement 17 RUN sed -i '/Faithfully yours/d' /usr/share/nginx/html/50x.html && \ - addgroup -S $NGINX_USER && \ - adduser -S $NGINX_USER -G $NGINX_USER && \ - # We need to come back and reconcile the multiple pids. - touch /run/nginx.pid && \ - touch /var/run/nginx.pid && \ - touch /var/run/nginx.pid && \ - chown -R $NGINX_USER:$NGINX_USER \ - /etc/nginx \ - /run/nginx.pid \ - /var/cache/nginx/ \ - /var/run/nginx.pid \ - /usr/share/nginx/html + addgroup -S $NGINX_USER && \ + adduser -S $NGINX_USER -G $NGINX_USER && \ + # We need to come back and reconcile the multiple pids. + touch /run/nginx.pid && \ + touch /var/run/nginx.pid && \ + touch /var/run/nginx.pid && \ + chown -R $NGINX_USER:$NGINX_USER \ + /etc/nginx \ + /run/nginx.pid \ + /var/cache/nginx/ \ + /var/run/nginx.pid \ + /usr/share/nginx/html EXPOSE 8080 USER svc_nginx_sbl diff --git a/README.md b/README.md index 603c17e4a..ebac233b3 100644 --- a/README.md +++ b/README.md @@ -8,9 +8,9 @@ The frontend of the Small Business Lending Data Filing Platform. - Write unit and integration tests with [Vitest](https://vitest.dev/) and [React Testing Library](https://testing-library.com/). - Write e2e tests with [Playwright](https://playwright.dev/). -## Getting started (Updated 11/08/2024) +## Getting started (Updated 12/13/2023) -1. Install Node v22+: `nvm install 22 && nvm use 22` +1. Install Node v18.2+: `nvm install 18 && nvm use 18` 1. Enable [corepack](https://yarnpkg.com/getting-started/install): `corepack enable`. 1. [Docker](https://docs.docker.com/get-docker/) engine version 1.13.0+ with docker compose version 3.0+ support needs to be installed to run all the containerized support services. 1. Have the six repos [sbl-frontend](https://github.com/cfpb/sbl-frontend), [sbl-project](https://github.com/cfpb/sbl-project), [regtech-user-fi-management](https://github.com/cfpb/regtech-user-fi-management), [sbl-filing-api](https://github.com/cfpb/sbl-filing-api/), [regtech-mail-api](https://github.com/cfpb/regtech-mail-api), and [regtech-cleanup-api](https://github.com/cfpb/regtech-cleanup-api) as **sibling directories**. diff --git a/e2e/pages/shared-lending-platform/InstitutionProfile.spec.ts b/e2e/pages/shared-lending-platform/InstitutionProfile.spec.ts index 6fcfeae86..855365b72 100644 --- a/e2e/pages/shared-lending-platform/InstitutionProfile.spec.ts +++ b/e2e/pages/shared-lending-platform/InstitutionProfile.spec.ts @@ -143,7 +143,7 @@ test('Institution Profile Page', async ({ page, navigateToFilingHome }) => { ).toContainText('Type of financial institution'); await expect( page.locator('#main h3').nth(8).locator('xpath=../p[1]'), - 'Type is correct when not provided', + 'Type is correct', ).toContainText('Not provided'); await expect( page.getByText( diff --git a/package.json b/package.json index f25dbc663..71dca2c9a 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "private": true, "version": "0.0.0", "engines": { - "node": ">=22", + "node": ">=18.20.4 <19.0.0", "yarn": ">=3.6.1" }, "scripts": {