hof 20.2.11-upgrade-redis-beta → 20.2.13

Sign up to get free protection for your applications and to get access to all the features.
@@ -26,11 +26,8 @@ const defaults = {
26
26
  loglevel: process.env.LOG_LEVEL || 'info',
27
27
  ignoreMiddlewareLogs: ['/healthz'],
28
28
  redis: {
29
- socket: {
30
- port: process.env.REDIS_PORT || '6379',
31
- host: process.env.REDIS_HOST || '127.0.0.1'
32
- },
33
- legacyMode: true
29
+ port: process.env.REDIS_PORT || '6379',
30
+ host: process.env.REDIS_HOST || '127.0.0.1'
34
31
  },
35
32
  session: {
36
33
  ttl: process.env.SESSION_TTL || 1800,
@@ -29,7 +29,7 @@
29
29
  type="{{type}}"
30
30
  name="{{key}}"
31
31
  id="{{key}}-{{value}}"
32
- value="{{value}}"
32
+ value="{{value}}"
33
33
  {{#toggle}} data-toggle="{{toggle}}"{{/toggle}}
34
34
  {{#selected}} checked="checked"{{/selected}}
35
35
  {{^error}}{{#optionHint}} aria-describedby="{{key}}-{{value}}-hint"{{/optionHint}}{{^optionHint}}{{#hint}} aria-describedby="{{key}}-hint"{{/hint}}{{/optionHint}}{{/error}}
@@ -28,7 +28,7 @@
28
28
  value="{{value}}"
29
29
  {{#toggle}} data-toggle="{{toggle}}"{{/toggle}}
30
30
  {{#selected}} checked="checked"{{/selected}}
31
- {{^error}}{{#optionHint}} aria-describedby="{{key}}-{{value}}-item-hint"{{/optionHint}}{{^optionHint}}{{#hint}} aria-describedby="{{key}}-item-hint"{{/hint}}{{/optionHint}}{{/error}}
31
+ {{^error}}{{#optionHint}} aria-describedby="{{key}}-{{value}}-item-hint"{{/optionHint}}{{^optionHint}}{{#hint}} aria-describedby="{{key}}-hint"{{/hint}}{{/optionHint}}{{/error}}
32
32
  {{#error}} aria-describedby="{{key}}-error" aria-invalid="true"{{/error}}
33
33
  >
34
34
  <label class="govuk-label govuk-radios__label" for="{{key}}-{{value}}">
@@ -17,9 +17,9 @@
17
17
  {{#renderChild}}{{/renderChild}}
18
18
  <textarea name="{{id}}" id="{{id}}"
19
19
  class="govuk-textarea {{#isMaxlengthOrMaxword}}govuk-js-character-count{{/isMaxlengthOrMaxword}} {{#className}}{{className}}{{/className}} {{#error}}govuk-input--error{{/error}}"
20
- aria-describedby="{{id}}-info"
21
- {{#attributes}}
22
- {{attribute}}="{{value}}"
20
+ aria-describedby="{{id}}-info"
21
+ {{#attributes}}
22
+ {{attribute}}="{{value}}"
23
23
  {{/attributes}}
24
24
  {{^error}}{{#hintId}}{{#maxlength}} aria-describedby="{{id}}-maxlength-hint {{hintId}}"{{/maxlength}}{{/hintId}}{{/error}}
25
25
  {{^error}}{{#hintId}}{{^maxlength}} aria-describedby="{{hintId}}"{{/maxlength}}{{/hintId}}{{/error}}
@@ -19,7 +19,7 @@
19
19
  <span class="govuk-phase-banner__text">This is a new service – your <a href="{{feedbackUrl}}{{^feedbackUrl}}https://eforms.homeoffice.gov.uk/outreach/feedback.ofml{{/feedbackUrl}}" class="govuk-link" id="feedback-link" target="_blank">feedback</a> will help us to improve it.</span>
20
20
  </p>
21
21
  </div>
22
- {{/feedbackUrl}}
22
+ {{/feedbackUrl}}
23
23
  <span id="step">
24
24
  {{> partials-back}} <span>{{$step}}{{/step}}</span>
25
25
  </span>
@@ -10,9 +10,9 @@
10
10
  </div>
11
11
  </div>
12
12
  </div>
13
- <div id="cookie-banner-actions" class="govuk-button-group">
13
+ <div id="cookie-banner-actions" class="govuk-button-group">
14
14
  <button id="accept-cookies-button" class="gem-c-button govuk-button" type="submit" data-module="gem-track-click" data-accept-cookies="true" data-track-category="cookieBanner" data-track-action="Cookie banner accepted" data-cookie-types="all">Accept additional cookies</button>
15
-
15
+
16
16
  <button id="reject-cookies-button" class="gem-c-button govuk-button" type="submit" data-module="gem-track-click" data-reject-cookies="true" data-track-category="cookieBanner" data-track-action="Cookie banner rejected">Reject additional cookies</button>
17
17
 
18
18
  <a class="govuk-link" href="/cookies">View cookies</a>
package/index.js CHANGED
@@ -78,8 +78,16 @@ const getContentSecurityPolicy = (config, res) => {
78
78
  styleSrc: ['www.googletagmanager.com', 'fonts.googleapis.com', 'tagmanager.google.com'],
79
79
  fontSrc: ['fonts.gstatic.com '],
80
80
  scriptSrc: ['www.google-analytics.com', 'ssl.google-analytics.com'],
81
- imgSrc: ['www.google-analytics.com', 'ssl.gstatic.com'],
82
- connectSrc: ['https://www.google-analytics.com', 'https://region1.google-analytics.com']
81
+ imgSrc: [
82
+ 'www.google-analytics.com',
83
+ 'ssl.gstatic.com',
84
+ 'www.google.co.uk/ads/ga-audiences'
85
+ ],
86
+ connectSrc: [
87
+ 'https://www.google-analytics.com',
88
+ 'https://region1.google-analytics.com',
89
+ 'https://region1.analytics.google.com'
90
+ ]
83
91
  };
84
92
 
85
93
  if (config.gaTagId) {
package/lib/health.js CHANGED
@@ -15,7 +15,7 @@ module.exports = redis => {
15
15
 
16
16
  router.get('/readiness', healthCheck({
17
17
  test: () => {
18
- if (!redis.isOpen && !redis.isReady) {
18
+ if (!redis.connected && !redis.ready) {
19
19
  return new Error('Session store unhealthy');
20
20
  }
21
21
  return 0;
package/lib/sessions.js CHANGED
@@ -51,8 +51,6 @@ module.exports = (app, config) => {
51
51
  });
52
52
  }
53
53
 
54
- client.connect();
55
-
56
54
  const store = new RedisStore({
57
55
  client: client,
58
56
  ttl: config.session.ttl,
@@ -25,11 +25,9 @@ module.exports = (options, rateLimitType) => {
25
25
  }
26
26
 
27
27
  const closeConnection = async err => {
28
- await redisClient.v4.QUIT();
28
+ await redisClient.quit();
29
29
  return next(err);
30
30
  };
31
- redisClient.on('error', err => logger.log('error', err));
32
- await redisClient.connect();
33
31
 
34
32
  try {
35
33
  // fetch records of current user using IP address, returns null when no record is found
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "hof",
3
3
  "description": "A bootstrap for HOF projects",
4
- "version": "20.2.11-upgrade-redis-beta",
4
+ "version": "20.2.13",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
7
7
  "author": "HomeOffice",
@@ -80,7 +80,7 @@
80
80
  "nodemailer-smtp-transport": "^2.7.4",
81
81
  "nodemailer-stub-transport": "^1.1.0",
82
82
  "notifications-node-client": "^6.0.0",
83
- "redis": "^4.6.6",
83
+ "redis": "^3.1.2",
84
84
  "reqres": "^3.0.1",
85
85
  "request": "^2.79.0",
86
86
  "rimraf": "^3.0.2",
@@ -16,9 +16,6 @@ module.exports = {
16
16
  },
17
17
  name: {
18
18
  validate: ['required', 'notUrl', { type: 'maxlength', arguments: 200 }],
19
- // need to remove this for the heading to go
20
- labelClassName: ['govuk-label--l'],
21
- isPageHeading: 'true'
22
19
  },
23
20
  'dateOfBirth': dateComponent('dateOfBirth', {
24
21
  mixin: 'input-date',
@@ -70,8 +67,6 @@ module.exports = {
70
67
  ]
71
68
  },
72
69
  email: {
73
- isPageHeading: 'true',
74
- labelClassName: ['govuk-label--l'],
75
70
  validate: ['required', 'email']
76
71
  },
77
72
  phone: {
@@ -114,7 +109,6 @@ module.exports = {
114
109
  // apply the other default formatters
115
110
  formatter: ['trim', 'hyphens'],
116
111
  isPageHeading: 'true',
117
- labelClassName: ['govuk-label--l'],
118
112
  // attributes here are passed to the field element
119
113
  validate: ['required', { type: 'maxword', arguments: 10 }],
120
114
  attributes: [{
@@ -18,7 +18,7 @@
18
18
  "label": "Full name"
19
19
  },
20
20
  "dateOfBirth": {
21
- "legend": "Date of birth",
21
+ "legend": "What is your date of birth?",
22
22
  "hint": "For example, 31 10 1990"
23
23
  },
24
24
  "building": {
@@ -29,8 +29,8 @@
29
29
  },
30
30
  "townOrCity": {
31
31
  "label": "Town or city"
32
- },
33
- "postcode": {
32
+ },
33
+ "postcode": {
34
34
  "label": "Postcode"
35
35
  },
36
36
  "incomeTypes" : {
@@ -66,8 +66,8 @@
66
66
  },
67
67
  "northernIreland": {
68
68
  "label": "Northern Ireland"
69
- }
70
- }
69
+ }
70
+ }
71
71
  },
72
72
  "email" : {
73
73
  "label": "Email address"
@@ -50,7 +50,7 @@
50
50
  },
51
51
  "confirmation": {
52
52
  "title": "Application sent",
53
- "alert": "Application sent",
53
+ "alert": "Application sent",
54
54
  "subheader": "What happens next",
55
55
  "content": "We’ll contact you with the decision of your application or if we need more information from you."
56
56
  }
package/sandbox/config.js CHANGED
@@ -2,7 +2,6 @@
2
2
 
3
3
  /* eslint no-process-env: 0 */
4
4
  module.exports = {
5
- port: 8082,
6
5
  email: {
7
6
  caseworker: process.env.CASEWORKER_EMAIL || '',
8
7
  from: process.env.FROM_ADDRESS || '',
@@ -13,6 +12,6 @@ module.exports = {
13
12
  region: process.env.EMAIL_REGION || ''
14
13
  },
15
14
  hosts: {
16
- acceptanceTests: process.env.ACCEPTANCE_HOST_NAME || `http://localhost:${process.env.PORT || 8082}`
15
+ acceptanceTests: process.env.ACCEPTANCE_HOST_NAME || `http://localhost:${process.env.PORT || 8080}`
17
16
  }
18
17
  };
package/sandbox/server.js CHANGED
@@ -2,7 +2,6 @@
2
2
  'use strict';
3
3
 
4
4
  const bootstrap = require('../');
5
- const config = require('./config')
6
5
 
7
6
  bootstrap({
8
7
  translations: './apps/sandbox/translations',
@@ -15,7 +14,5 @@ bootstrap({
15
14
  }
16
15
  },
17
16
  getAccessibility: true,
18
- "port": config.port
17
+ "port": 8082
19
18
  });
20
-
21
- console.log(`Running on port ${config.port}`);