Skip to content

Commit

Permalink
PP-11361 node 18 baseline (#4118)
Browse files Browse the repository at this point in the history
- fix localhost bug in node 17-19
  - see [this issue](nodejs/node#40702) in the Node repo for context
  • Loading branch information
nlsteers authored Sep 11, 2023
1 parent eb00c60 commit daaa38e
Show file tree
Hide file tree
Showing 92 changed files with 137 additions and 137 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.20.1
18.17.1
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:16.20.2-alpine3.17@sha256:bbc110afcd56dea9d27969ce1c3585aac53192ad14b364b6c5cb1f25a144ad9f as builder
FROM node:18.17.1-alpine3.18@sha256:982b5b6f07cd9241c9ebb163829067deac8eaefc57cfa8f31927f4b18943d971 as builder

### Needed to run pact-mock-service
COPY sgerrand.rsa.pub /etc/apk/keys/sgerrand.rsa.pub
Expand All @@ -14,7 +14,7 @@ RUN npm ci --quiet
COPY . .
RUN npm run compile

FROM node:16.20.2-alpine3.17@sha256:bbc110afcd56dea9d27969ce1c3585aac53192ad14b364b6c5cb1f25a144ad9f AS final
FROM node:18.17.1-alpine3.18@sha256:982b5b6f07cd9241c9ebb163829067deac8eaefc57cfa8f31927f4b18943d971 AS final

RUN ["apk", "--no-cache", "upgrade"]

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Build the Selfservice app and start it
```

Open application in browser:
- http://localhost:3000
- http://127.0.0.1:3000

##### Log output
When using Docker, you can view log out with the following command:
Expand Down
4 changes: 2 additions & 2 deletions cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = defineConfig({
env: {
TEST_SESSION_ENCRYPTION_KEY:
'naskjwefvwei72rjkwfmjwfi72rfkjwefmjwefiuwefjkbwfiu24fmjbwfk',
MOUNTEBANK_URL: 'http://localhost:2525',
MOUNTEBANK_URL: 'http://127.0.0.1:2525',
MOUNTEBANK_IMPOSTERS_PORT: 8000
},
fileServerFolder: './test/cypress',
Expand All @@ -19,7 +19,7 @@ module.exports = defineConfig({
setupNodeEvents (on, config) {
return require('./test/cypress/plugins')(on, config)
},
baseUrl: 'http://localhost:3000',
baseUrl: 'http://127.0.0.1:3000',
specPattern: './test/cypress/integration/**/*.cy.{js,jsx,ts,tsx}',
supportFile: './test/cypress/support'
}
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"private": true,
"license": "MIT",
"engines": {
"node": "^16.20.1"
"node": "18.17.1"
},
"standard": {
"globals": [
Expand Down
44 changes: 22 additions & 22 deletions scripts/generate-dev-environment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,33 @@ rm -f "$ENV_FILE"
touch "$ENV_FILE"

read -r -d '' URL_TARGET_LOCAL << EOM
ADMINUSERS_URL=http://localhost:9700
CONNECTOR_URL=http://localhost:9300
PRODUCTS_URL=http://localhost:18000
LEDGER_URL=http://localhost:10700
PUBLIC_AUTH_BASE=http://localhost:9600
PUBLIC_AUTH_URL=http://localhost:9600/v1/frontend/auth
WEBHOOKS_URL=http://localhost:10800
ADMINUSERS_URL=http://127.0.0.1:9700
CONNECTOR_URL=http://127.0.0.1:9300
PRODUCTS_URL=http://127.0.0.1:18000
LEDGER_URL=http://127.0.0.1:10700
PUBLIC_AUTH_BASE=http://127.0.0.1:9600
PUBLIC_AUTH_URL=http://127.0.0.1:9600/v1/frontend/auth
WEBHOOKS_URL=http://127.0.0.1:10800
EOM

read -r -d '' URL_TARGET_TUNNEL << EOM
ADMINUSERS_URL=https://localhost:9001
CONNECTOR_URL=https://localhost:9003
PRODUCTS_URL=https://localhost:9005
LEDGER_URL=https://localhost:9007
PUBLIC_AUTH_BASE=http://localhost:9006
PUBLIC_AUTH_URL=http://localhost:9006/v1/frontend/auth
WEBHOOKS_URL=https://localhost:9008
ADMINUSERS_URL=https://127.0.0.1:9001
CONNECTOR_URL=https://127.0.0.1:9003
PRODUCTS_URL=https://127.0.0.1:9005
LEDGER_URL=https://127.0.0.1:9007
PUBLIC_AUTH_BASE=http://127.0.0.1:9006
PUBLIC_AUTH_URL=http://127.0.0.1:9006/v1/frontend/auth
WEBHOOKS_URL=https://127.0.0.1:9008
EOM

read -r -d '' URL_TARGET_DOCKER_TUNNEL << EOM
ADMINUSERS_URL=https://docker.for.mac.localhost:9001
CONNECTOR_URL=https://docker.for.mac.localhost:9003
PRODUCTS_URL=https://docker.for.mac.localhost:9005
LEDGER_URL=https://docker.for.mac.localhost:9007
PUBLIC_AUTH_BASE=https://docker.for.mac.localhost:9006
PUBLIC_AUTH_URL=https://docker.for.mac.localhost:9006/v1/frontend/auth
WEBHOOKS_URL=https://docker.for.mac.localhost:9008
ADMINUSERS_URL=https://docker.for.mac.127.0.0.1:9001
CONNECTOR_URL=https://docker.for.mac.127.0.0.1:9003
PRODUCTS_URL=https://docker.for.mac.127.0.0.1:9005
LEDGER_URL=https://docker.for.mac.127.0.0.1:9007
PUBLIC_AUTH_BASE=https://docker.for.mac.127.0.0.1:9006
PUBLIC_AUTH_URL=https://docker.for.mac.127.0.0.1:9006/v1/frontend/auth
WEBHOOKS_URL=https://docker.for.mac.127.0.0.1:9008
EOM

if [ "$1" = 'local' ] ; then
Expand Down Expand Up @@ -61,7 +61,7 @@ GOCARDLESS_TEST_OAUTH_BASE_URL=https://connect-sandbox.gocardless.com
GOCARDLESS_LIVE_OAUTH_BASE_URL=https://connect-sandbox.gocardless.com
SELFSERVICE_URL=https://selfservice.pymnt.localdomain
ZENDESK_URL=https://govuk.zendesk.com/api/v2
STRIPE_HOST=localhost
STRIPE_HOST=127.0.0.1
STRIPE_PORT=8000
$URL_MAP
EOM
20 changes: 10 additions & 10 deletions test/cypress/test.env
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
CONNECTOR_URL=http://localhost:8000
PUBLIC_AUTH_BASE=http://localhost:8000
PUBLIC_AUTH_URL=http://localhost:8000/v1/frontend/auth
ADMINUSERS_URL=http://localhost:8000
PRODUCTS_URL=http://localhost:8000
LEDGER_URL=http://localhost:8000
WEBHOOKS_URL=http://localhost:8000
CONNECTOR_URL=http://127.0.0.1:8000
PUBLIC_AUTH_BASE=http://127.0.0.1:8000
PUBLIC_AUTH_URL=http://127.0.0.1:8000/v1/frontend/auth
ADMINUSERS_URL=http://127.0.0.1:8000
PRODUCTS_URL=http://127.0.0.1:8000
LEDGER_URL=http://127.0.0.1:8000
WEBHOOKS_URL=http://127.0.0.1:8000
DISABLE_INTERNAL_HTTPS=true
COOKIE_MAX_AGE=10800000
SESSION_ENCRYPTION_KEY=naskjwefvwei72rjkwfmjwfi72rfkjwefmjwefiuwefjkbwfiu24fmjbwfk
Expand All @@ -14,11 +14,11 @@ LOGIN_ATTEMPT_CAP=2
DISABLE_REQUEST_LOGGING=true
NODE_TEST_MODE=true
NODE_ENV=test
ZENDESK_URL=http://localhost:8000/zendesk
STRIPE_HOST=localhost
ZENDESK_URL=http://127.0.0.1:8000/zendesk
STRIPE_HOST=127.0.0.1
STRIPE_PORT=8000
STRIPE_PROTOCOL=http
GOCARDLESS_TEST_OAUTH_BASE_URL=http://localhost:8000
GOCARDLESS_TEST_OAUTH_BASE_URL=http://127.0.0.1:8000
GOCARDLESS_TEST_CLIENT_ID=testClientId
PAYOUTS_RELEASE_DATE=1590148800
ENABLE_STRIPE_ONBOARDING_TASK_LIST=true
Expand Down
4 changes: 2 additions & 2 deletions test/fixtures/user.fixtures.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ function buildUserWithDefaults (opts) {
_links: [{
rel: 'self',
method: 'GET',
href: 'http://localhost:8080/v1/api/users/09283568e105442da3928d1fa99fb0eb'
href: 'http://127.0.0.1:8080/v1/api/users/09283568e105442da3928d1fa99fb0eb'
}]
})

Expand Down Expand Up @@ -426,7 +426,7 @@ module.exports = {
code: request.code || code,
date: '2010-12-31T22:59:59.132Z',
'_links': [{
'href': `http://localhost:8080/v1/api/forgotten-passwords/${code}`,
'href': `http://127.0.0.1:8080/v1/api/forgotten-passwords/${code}`,
'rel': 'self',
'method': 'GET'
}]
Expand Down
10 changes: 5 additions & 5 deletions test/integration/proxy.it.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ describe('request.js client', function () {
portfinder.getPort(function (err, aPort) {
if (err) { throw err }
proxyServer = httpProxy
.createProxyServer({ target: { host: 'localhost', port: proxiedServer.address().port } })
.createProxyServer({ target: { host: '127.0.0.1', port: proxiedServer.address().port } })
.listen(aPort)
proxyUrl = 'http://localhost:' + aPort
proxyUrl = 'http://127.0.0.1:' + aPort

proxyServer.on('proxyRes', function (proxyRes, req, res) {
proxyRes.headers['X-Proxy-Header'] = 'touched by proxy'
Expand All @@ -58,17 +58,17 @@ describe('request.js client', function () {
})

nonProxiedServerPort = aPort
nonProxiedServerUrl = 'http://localhost:' + aPort
nonProxiedServerUrl = 'http://127.0.0.1:' + aPort
})
})

proxiedServerUrl = 'http://localhost:' + aPort
proxiedServerUrl = 'http://127.0.0.1:' + aPort
})
})

beforeEach(function () {
process.env.HTTP_PROXY = proxyUrl
process.env.NO_PROXY = 'localhost:' + nonProxiedServerPort
process.env.NO_PROXY = '127.0.0.1:' + nonProxiedServerPort
})

afterEach(function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe('adminusers client - authenticate', () => {

before(async () => {
const opts = await provider.setup()
adminUsersClient = getAdminUsersClient({ baseUrl: `http://localhost:${opts.port}` })
adminUsersClient = getAdminUsersClient({ baseUrl: `http://127.0.0.1:${opts.port}` })
})
after(() => provider.finalize())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe('adminusers client - create forgotten password', function () {

before(async () => {
const opts = await provider.setup()
adminUsersClient = getAdminUsersClient({ baseUrl: `http://localhost:${opts.port}` })
adminUsersClient = getAdminUsersClient({ baseUrl: `http://127.0.0.1:${opts.port}` })
})
after(() => provider.finalize())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe('adminusers client - get forgotten password', function () {

before(async () => {
const opts = await provider.setup()
adminUsersClient = getAdminUsersClient({ baseUrl: `http://localhost:${opts.port}` })
adminUsersClient = getAdminUsersClient({ baseUrl: `http://127.0.0.1:${opts.port}` })
})
after(() => provider.finalize())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe('adminusers client - complete an invite', function () {

before(async () => {
const opts = await provider.setup()
adminUsersClient = getAdminUsersClient({ baseUrl: `http://localhost:${opts.port}` })
adminUsersClient = getAdminUsersClient({ baseUrl: `http://127.0.0.1:${opts.port}` })
})
after(() => provider.finalize())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe('adminusers client - create invite to join service', function () {

before(async () => {
const opts = await provider.setup()
adminUsersClient = getAdminUsersClient({ baseUrl: `http://localhost:${opts.port}` })
adminUsersClient = getAdminUsersClient({ baseUrl: `http://127.0.0.1:${opts.port}` })
})
after(() => provider.finalize())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe('adminusers client - create self-registration invite', function () {

before(async () => {
const opts = await provider.setup()
adminUsersClient = getAdminUsersClient({ baseUrl: `http://localhost:${opts.port}` })
adminUsersClient = getAdminUsersClient({ baseUrl: `http://127.0.0.1:${opts.port}` })
})
after(() => provider.finalize())

Expand Down
2 changes: 1 addition & 1 deletion test/pact/adminusers-client/invite/get-invite.pact.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe('adminusers client - get an invite', function () {

before(async () => {
const opts = await provider.setup()
adminUsersClient = getAdminUsersClient({ baseUrl: `http://localhost:${opts.port}` })
adminUsersClient = getAdminUsersClient({ baseUrl: `http://127.0.0.1:${opts.port}` })
})
after(() => provider.finalize())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe('adminusers client - re-provision OTP key', function () {

before(async () => {
const opts = await provider.setup()
adminUsersClient = getAdminUsersClient({ baseUrl: `http://localhost:${opts.port}` })
adminUsersClient = getAdminUsersClient({ baseUrl: `http://127.0.0.1:${opts.port}` })
})
after(() => provider.finalize())

Expand Down
2 changes: 1 addition & 1 deletion test/pact/adminusers-client/invite/send-otp.pact.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe('adminusers client - send OTP code', function () {

before(async () => {
const opts = await provider.setup()
adminUsersClient = getAdminUsersClient({ baseUrl: `http://localhost:${opts.port}` })
adminUsersClient = getAdminUsersClient({ baseUrl: `http://127.0.0.1:${opts.port}` })
})
after(() => provider.finalize())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe('adminusers client - update invite password', function () {

before(async () => {
const opts = await provider.setup()
adminUsersClient = getAdminUsersClient({ baseUrl: `http://localhost:${opts.port}` })
adminUsersClient = getAdminUsersClient({ baseUrl: `http://127.0.0.1:${opts.port}` })
})
after(() => provider.finalize())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe('adminusers client - update invite phone number', function () {

before(async () => {
const opts = await provider.setup()
adminUsersClient = getAdminUsersClient({ baseUrl: `http://localhost:${opts.port}` })
adminUsersClient = getAdminUsersClient({ baseUrl: `http://127.0.0.1:${opts.port}` })
})
after(() => provider.finalize())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe('adminusers client - validate otp code for a service', function () {

before(async () => {
const opts = await provider.setup()
adminUsersClient = getAdminUsersClient({ baseUrl: `http://localhost:${opts.port}` })
adminUsersClient = getAdminUsersClient({ baseUrl: `http://127.0.0.1:${opts.port}` })
})
after(() => provider.finalize())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ describe('admin users client - add gateway accounts to service', () => {

before(async () => {
const opts = await provider.setup()
adminUsersClient = getAdminUsersClient({ baseUrl: `http://localhost:${opts.port}` })
adminUsersClient = getAdminUsersClient({ baseUrl: `http://127.0.0.1:${opts.port}` })
})
after(() => provider.finalize())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe('adminusers client - create a new service', function () {

before(async () => {
const opts = await provider.setup()
adminUsersClient = getAdminUsersClient({ baseUrl: `http://localhost:${opts.port}` })
adminUsersClient = getAdminUsersClient({ baseUrl: `http://127.0.0.1:${opts.port}` })
})
after(() => provider.finalize())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe('adminusers client - service users', () => {

before(async () => {
const opts = await provider.setup()
adminUsersClient = getAdminUsersClient({ baseUrl: `http://localhost:${opts.port}` })
adminUsersClient = getAdminUsersClient({ baseUrl: `http://127.0.0.1:${opts.port}` })
})
after(() => provider.finalize())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe('adminusers client - post govuk pay agreement - email address', () => {

before(async () => {
const opts = await provider.setup()
adminUsersClient = getAdminUsersClient({ baseUrl: `http://localhost:${opts.port}` })
adminUsersClient = getAdminUsersClient({ baseUrl: `http://127.0.0.1:${opts.port}` })
})
after(() => provider.finalize())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe('adminusers client - post stripe agreement - ip address', () => {

before(async () => {
const opts = await provider.setup()
adminUsersClient = getAdminUsersClient({ baseUrl: `http://localhost:${opts.port}` })
adminUsersClient = getAdminUsersClient({ baseUrl: `http://127.0.0.1:${opts.port}` })
})
after(() => provider.finalize())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe('adminusers client - patch collect billing address toggle', function ()

before(async () => {
const opts = await provider.setup()
adminUsersClient = getAdminUsersClient({ baseUrl: `http://localhost:${opts.port}` })
adminUsersClient = getAdminUsersClient({ baseUrl: `http://127.0.0.1:${opts.port}` })
})
after(() => provider.finalize())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe('adminusers client - patch collect billing address toggle', function ()

before(async () => {
const opts = await provider.setup()
adminUsersClient = getAdminUsersClient({ baseUrl: `http://localhost:${opts.port}` })
adminUsersClient = getAdminUsersClient({ baseUrl: `http://127.0.0.1:${opts.port}` })
})
after(() => provider.finalize())

Expand Down
Loading

0 comments on commit daaa38e

Please sign in to comment.