Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paf 49 test cert 2 #112

Open
wants to merge 100 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
0b1f93f
rebased
JHoldergov Jan 31, 2024
4926892
PAF-50 Deploy ims-resolver
sulthan-ahmed Mar 22, 2023
2e1c161
PAF-50 add wsdl and endpoint as secrets
sulthan-ahmed Mar 22, 2023
327035b
PAF-50 deploy ims-resolver
sulthan-ahmed Mar 23, 2023
6fbdfea
PAF-50 deploy ims-resolver
sulthan-ahmed Mar 23, 2023
10bc6b3
PAF-50 deploy ims-resolver
sulthan-ahmed Mar 23, 2023
0a9e9df
PAF-50 deploy ims-resolver
sulthan-ahmed Mar 30, 2023
9caff0f
PAF-50 deploy ims-resolver
sulthan-ahmed Mar 30, 2023
5000ee4
PAF-50 deploy ims resolver
sulthan-ahmed Mar 30, 2023
d9f1078
PAF-50 update ims resolver key names as part of k8
sulthan-ahmed Apr 3, 2023
a9bb1f5
Update README about IMS API docs
sulthan-ahmed Apr 27, 2023
770f078
PAF-49 Test the private link
sulthan-ahmed Apr 28, 2023
ec8203f
WIP
sulthan-ahmed May 12, 2023
f42aee7
Deploy resolver that doesn't run the commands
sulthan-ahmed May 15, 2023
682282a
PAF-49 change the ims-resolver to use curl
sulthan-ahmed May 17, 2023
803688c
WIP
sulthan-ahmed May 17, 2023
dfd8017
WIP
sulthan-ahmed May 17, 2023
be0695a
PAF-49 deploy resolver to test private link
sulthan-ahmed May 22, 2023
1af3c6f
WIP
sulthan-ahmed May 22, 2023
f94adc5
Set NODE_TLS_REJECT_UNAUTHORIZED 0 in kube file
sulthan-ahmed May 23, 2023
04c806d
WIP check we can set env variable for TLS being 0
sulthan-ahmed May 23, 2023
2522fb0
PAF-135 use ims-resolver image for private link
sulthan-ahmed May 24, 2023
0cda1ba
deploy tls cert - PAF-153
JHoldergov Dec 20, 2023
b3f6881
Pvt link add deploy branch
JHoldergov Dec 20, 2023
9d96be8
error message fix
JHoldergov Dec 20, 2023
df14d43
self signed cert
JHoldergov Dec 20, 2023
d31ade3
redeploy
JHoldergov Dec 20, 2023
01df855
redeploy
JHoldergov Dec 20, 2023
bb4e1a4
mounting cert volume
JHoldergov Dec 27, 2023
c73a189
deploy error
JHoldergov Dec 27, 2023
fba0c2c
disable cert bypass
JHoldergov Dec 27, 2023
b1f95d6
configmap trial
JHoldergov Dec 28, 2023
aa059b5
syntax fix
JHoldergov Dec 28, 2023
bb7e31b
corrrection
JHoldergov Dec 28, 2023
919a470
error solve attempt
JHoldergov Dec 28, 2023
a3a9fb6
re-deployment
JHoldergov Dec 28, 2023
4a1b24c
adjustments
JHoldergov Dec 28, 2023
b053d1e
timeout changes
JHoldergov Dec 28, 2023
8b1e525
adding config map
JHoldergov Dec 29, 2023
1fe6450
memory increase
JHoldergov Dec 29, 2023
8c78f02
syntax
JHoldergov Dec 29, 2023
56ec28d
config on node
JHoldergov Dec 29, 2023
e33f199
Added certificate
TemitopeAyokuHO Jan 4, 2024
3f68d07
code changes for cert (trial)
JHoldergov Jan 15, 2024
2c89d49
syntax
JHoldergov Jan 15, 2024
cedeb46
untrusted source cert
JHoldergov Jan 15, 2024
f0bc624
change directory
JHoldergov Jan 15, 2024
ff7e75b
dir correction
JHoldergov Jan 15, 2024
f52a57f
try two vol mounts
JHoldergov Jan 16, 2024
f790fe6
volume mounts testing
JHoldergov Jan 16, 2024
8b3db71
typo
JHoldergov Jan 16, 2024
4c5b3ce
testing branch 2
JHoldergov Jan 16, 2024
c6e67e2
fast build CI
JHoldergov Jan 16, 2024
19cc41e
rebuild with yarn - redeploy
JHoldergov Jan 16, 2024
fb760dc
commenting out certs
JHoldergov Jan 16, 2024
061b3ba
vol mount deployment
JHoldergov Jan 16, 2024
4c0d625
alignment
JHoldergov Jan 16, 2024
76d0f8c
alignment2
JHoldergov Jan 16, 2024
5004c5f
imsrepo-change
JHoldergov Jan 16, 2024
707627d
new ims image
JHoldergov Jan 16, 2024
8181939
new ims image
JHoldergov Jan 16, 2024
06f7005
new image - 1520
JHoldergov Jan 16, 2024
9060da9
new ims iiage 1533
JHoldergov Jan 16, 2024
8d9162f
new ims image 1559
JHoldergov Jan 16, 2024
cff81c7
Update to latest resolver image
jamiecarterHO Jan 19, 2024
f62a540
Fix merge conflicts part two
jamiecarterHO Jan 19, 2024
a504843
Remove changes from server.js
jamiecarterHO Jan 19, 2024
b0f0c3d
removed clear text cert
JHoldergov Jan 23, 2024
ffe263c
setting the cert in the hof config services
JHoldergov Jan 23, 2024
00b00e7
revert the test changes
JHoldergov Jan 23, 2024
6b6eca3
add cert from hof cofig
JHoldergov Jan 23, 2024
3e17e38
cleaning up
JHoldergov Jan 23, 2024
5f387d3
memory re-adjust
JHoldergov Jan 23, 2024
8fe3514
merge conf
JHoldergov Jan 23, 2024
8ba1bc3
indent error
JHoldergov Jan 23, 2024
9ae20c1
Configmap1
JHoldergov Jan 23, 2024
b214c1f
cert mount
JHoldergov Jan 23, 2024
30efb6c
adding a cert mount without indent
JHoldergov Jan 23, 2024
555869f
trigger build
JHoldergov Jan 31, 2024
02647a7
rebasing
JHoldergov Feb 1, 2024
bc41d40
Fix discrepancies between fv URLs across deployments and ingress (#122)
jamiecarterHO Jan 22, 2024
dd3fb90
rebase
JHoldergov Feb 1, 2024
eda5836
rebase
JHoldergov Feb 1, 2024
413d5a2
PAF 166:Highlight sections on menu navigation (#95)
Rhodine-orleans-lindsay Jan 25, 2024
dae8055
PAF-129/ PAF-128 - Fix bug to add country from list and validate coun…
TemitopeAyokuHO Jan 30, 2024
5552818
rebase branch
jamiecarterHO Jan 30, 2024
1e46f8e
Update drone.yml and deploy.sh (#129)
jamiecarterHO Jan 30, 2024
3c83662
rebase
JHoldergov Feb 1, 2024
2ece81d
rebased
JHoldergov Jan 31, 2024
043ec00
rebase
JHoldergov Feb 1, 2024
82713c3
rebase
JHoldergov Feb 1, 2024
a5fcefd
rebase
JHoldergov Feb 1, 2024
6588b20
rebase
JHoldergov Feb 1, 2024
749407b
rebase
JHoldergov Feb 1, 2024
31eae29
rebase
JHoldergov Feb 1, 2024
eaf74eb
ims cert image
JHoldergov Feb 1, 2024
3fbe122
ims redeploy rebase
JHoldergov Feb 1, 2024
07404db
cert code rebase
JHoldergov Feb 1, 2024
912278c
merge conf
JHoldergov Jan 23, 2024
fafb9e0
file upload rebase
JHoldergov Feb 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ trigger:
branch:
- feature/*
- master
- PAF-49-test-private-link
- PAF-49-test-cert-2

linting: &linting
pull: if-not-exists
Expand Down Expand Up @@ -62,6 +64,8 @@ steps:
include:
- master
- feature/*
- PAF-49-test-private-link
- PAF-49-test-cert-2
event: [push, pull_request]

- name: setup_deploy
Expand Down Expand Up @@ -122,6 +126,8 @@ steps:
include:
- master
- feature/*
- PAF-49-test-private-link
- PAF-49-test-cert-2
event: [push, pull_request]

- name: image_to_quay
Expand All @@ -139,6 +145,8 @@ steps:
include:
- master
- feature/*
- PAF-49-test-private-link
- PAF-49-test-cert-2
event: [push, pull_request]

# Deploy to pull request UAT environment.
Expand All @@ -158,6 +166,14 @@ steps:
- master
- feature/*
event: pull_request
<<<<<<< HEAD
=======
=======
- PAF-49-test-private-link
- PAF-49-test-cert-2
event: [push, pull_request]
>>>>>>> 93e26e0 (Pvt link add deploy branch)
>>>>>>> c6e67e2 (fast build CI)

- name: setup_branch
pull: if-not-exists
Expand Down
21 changes: 21 additions & 0 deletions @
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
rebased

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# On branch PAF-49-test-cert-2
# Your branch and 'origin/PAF-49-test-cert-2' have diverged,
# and have 103 and 83 different commits each, respectively.
# (use "git pull" to merge the remote branch into yours)
#
# Last commands done (13 commands done):
# pick a79e1d1 Paf 210 work for british government (#131)
# pick 0b1f93f rebased
# Next commands to do (11 remaining commands):
# pick 4926892 PAF-50 Deploy ims-resolver
# pick a9bb1f5 Update README about IMS API docs
# You are currently editing a commit while rebasing branch 'PAF-49-test-cert-2' on '51fa1a4'.
#
# Changes to be committed:
# modified: server.js
#
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ The PAF app will send data to an AWS SQS (Simple Queue Service), the [ims-resolv

## IMS API integration

<<<<<<< HEAD
There is some sensitive information about IMS integration. The documentation of this can be found in an internal repo
=======
There is some sensitive information about IMS integration. The documentation of this can be found in an internal repo
>>>>>>> 6067174 (Update README about IMS API docs)
https://github.com/UKHomeOffice/ims-integration-documentation

## Getting Started
Expand Down
16 changes: 8 additions & 8 deletions apps/paf/behaviours/disable-file-upload.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
module.exports = superclass => class extends superclass {
locals(req, res) {
const locals = super.locals(req, res);
const images = req.sessionModel.get('images');
if (images && images.length >= 3) {
const locals = super.locals(req, res);
const images = req.sessionModel.get('images');
if (images && images.length >= 3) {
// disable file upload if attachment limit reached.
req.form.options.fields['other-info-file-upload'].attributes = [{attribute: 'disabled'}];
return locals;
}
req.form.options.fields['other-info-file-upload'].attributes = [];
req.form.options.fields['other-info-file-upload'].attributes = [{attribute: 'disabled'}];
return locals;
}
};
req.form.options.fields['other-info-file-upload'].attributes = [];
return locals;
}
}
38 changes: 1 addition & 37 deletions apps/paf/behaviours/save-file.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
'use strict';

const _ = require('lodash');
const config = require('../../../config');
const Model = require('../models/file-upload');
const fileSizeNum = size => size.match(/\d+/g)[0];

module.exports = name => superclass => class extends superclass {
process(req) {
Expand All @@ -22,41 +20,7 @@ module.exports = name => superclass => class extends superclass {
if (!Object.keys(req.form.errors).length) {
req.form.values['other-info-file-upload'] = null;
}
const maxNum = fileSizeNum(config.upload.maxFileSize);
const maxSize = config.upload.maxFileSize.match(/[a-zA-Z]+/g)[0].toUpperCase();
return Object.assign({}, super.locals(req, res, next), {
maxFileSize: `${maxNum} ${maxSize}`
});
}

validateField(key, req) {
if (req.form.values['other-info-file-upload']) {
const fileUpload = _.get(req.files, `${name}`);
if (fileUpload) {
const uploadSize = fileUpload.size;
const mimetype = fileUpload.mimetype;
const uploadSizeTooBig = uploadSize > (fileSizeNum(config.upload.maxFileSize) * 1000000);
const uploadSizeBeyondServerLimits = uploadSize === null;
const invalidMimetype = !config.upload.allowedMimeTypes.includes(mimetype);
const invalidSize = uploadSizeTooBig || uploadSizeBeyondServerLimits;

if (invalidSize || invalidMimetype) {
return new this.ValidationError(key, {
key,
type: invalidSize ? 'maxFileSize' : 'fileType',
redirect: undefined
});
}
} else {
return new this.ValidationError(key, {
key,
type: 'required',
redirect: undefined
});
}
}

return super.validateField(key, req);
return super.locals(req, res, next);
}

saveValues(req, res, next) {
Expand Down
3 changes: 1 addition & 2 deletions apps/paf/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';
/* eslint-disable max-len */
const saveImage = require('./behaviours/save-file');
const removeImage = require('./behaviours/remove-file');
const CombineAndLoopFields = require('hof').components.combineAndLoopFields;
Expand Down Expand Up @@ -701,7 +700,7 @@ module.exports = {
target: '/add-other-info-file-upload',
condition: req => {
if (req.form.values['other-info-file-upload']) {
return true;
return true
}
return false;
}
Expand Down
3 changes: 1 addition & 2 deletions apps/paf/models/file-upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ module.exports = class UploadModel extends Model {

async save() {
const result = await new Promise((resolve, reject) => {
console.log("url: " + config.upload.hostname);
const attributes = {
url: config.upload.hostname
};
Expand Down Expand Up @@ -73,4 +72,4 @@ module.exports = class UploadModel extends Model {
});
});
}
};
};
28 changes: 0 additions & 28 deletions apps/paf/translations/src/en/validation.json
Original file line number Diff line number Diff line change
Expand Up @@ -318,34 +318,6 @@
"when-to-contact": {
"maxlength": "You can't use more than {{maxlength}} characters for your answer"
},
"boat-country-departure": {
"required": "Enter a valid country",
"notUrl": "Enter a valid country on the list"
},
"airline-country-departure": {
"required": "Enter a valid country",
"notUrl": "Enter a valid country on the list"
},
"crime-location-country": {
"required": "Enter a valid country",
"notUrl": "Enter a valid country on the list"
},
"crime-another-location-country": {
"required": "Enter a valid country",
"notUrl": "Enter a valid country on the list"
},
"train-country-departure": {
"required": "Enter a valid country",
"notUrl": "Enter a valid country on the list"
},
"report-person-location-outside-uk-address-country": {
"required": "Enter a valid country",
"notUrl": "Enter a valid country on the list"
},
"report-person-location-travel-to-uk-country": {
"required": "Enter a valid country",
"notUrl": "Enter a valid country on the list"
},
"other-info-file-upload": {
"maxFileSize": "Select a file that is smaller than 100 MB",
"fileType": "This file is not a valid file format you can upload to this service."
Expand Down
43 changes: 0 additions & 43 deletions assets/scss/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -231,48 +231,6 @@ pre.looped-records {
word-break: break-all;
}

.crime-nav {
background-color: #1d70b8;
}
.crime-nav > a {
color: white !important;
}

.person-nav {
background-color: #1d70b8;
}
.person-nav > a {
color: white !important;
}

.organisation-nav {
background-color: #1d70b8;
}
.organisation-nav > a {
color: white !important;
}

.other-info-nav {
background-color: #1d70b8;
}
.other-info-nav > a {
color: white !important;
}

.about-you-nav {
background-color: #1d70b8;
}
.about-you-nav > a {
color: white !important;
}

.check-answers-nav {
background-color: #1d70b8;
}
.check-answers-nav > a {
color: white !important;
}

.time-input__item {
display: inline-block;
margin-right: 20px;
Expand All @@ -288,4 +246,3 @@ display: block;
.time-input__item .govuk-error-message {
display: none;
}

6 changes: 4 additions & 2 deletions bin/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,18 @@ set -e
export INGRESS_INTERNAL_ANNOTATIONS=$HOF_CONFIG/ingress-internal-annotations.yaml
export INGRESS_EXTERNAL_ANNOTATIONS=$HOF_CONFIG/ingress-external-annotations.yaml
export CONFIGMAP_VALUES=$HOF_CONFIG/configmap-values.yaml
export CONFIGMAP1_VALUES=$HOF_CONFIG/cacert-store.yaml
export NGINX_SETTINGS=$HOF_CONFIG/nginx-settings.yaml
export FILEVAULT_NGINX_SETTINGS=$HOF_CONFIG/filevault-nginx-settings.yaml
export FILEVAULT_INGRESS_EXTERNAL_ANNOTATIONS=$HOF_CONFIG/filevault-ingress-external-annotations.yaml

kd='kd --insecure-skip-tls-verify --timeout 10m --check-interval 10s'
kd='kd --insecure-skip-tls-verify --timeout 20m --check-interval 10s'

if [[ $1 == 'tear_down' ]]; then
export KUBE_NAMESPACE=$BRANCH_ENV
export DRONE_SOURCE_BRANCH=$(cat /root/.dockersock/branch_name.txt)
$kd --delete -f kube/configmaps/configmap.yml
$kd --delete -f kube/redis -f kube/app -f kube/ims-resolver -f kube/file-vault
$kd --delete -f kube/redis -f kube/app -f kube/ims-resolver
# echo "Torn Down UAT Branch - paf-$DRONE_SOURCE_BRANCH.internal.$BRANCH_ENV.homeoffice.gov.uk"
echo "Torn Down Branch - paf-${DRONE_SOURCE_BRANCH}.internal.${BRANCH_ENV}.homeoffice.gov.uk"
exit 0
Expand All @@ -26,6 +27,7 @@ export DRONE_SOURCE_BRANCH=$(echo $DRONE_SOURCE_BRANCH | tr '[:upper:]' '[:lower
if [[ ${KUBE_NAMESPACE} == ${BRANCH_ENV} ]]; then
$kd -f kube/file-vault/file-vault-ingress.yml
$kd -f kube/configmaps
$kd -f kube/certmounts
$kd -f kube/certs
$kd -f kube/redis
$kd -f kube/app
Expand Down
20 changes: 20 additions & 0 deletions certs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const https = require('https');
const fs = require('fs');




const getCertificate = function getRequest(){
https.get('https://ho-it-prp1-i-ie-ims.report-and-manage-intelligence.np.immigrationservices.phz/lagan/services/FL', options, (res) => {
// Handle the response
});
}

const options = {
ca: fs.readFileSync('/etc/ssl/certs/ims-prp1-ca.crt')
};

module.exports = {
getCertificate: getCertificate,
options : options
};
8 changes: 0 additions & 8 deletions config.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,4 @@ module.exports = {
clientId: process.env.KEYCLOAK_CLIENT_ID,
secret: process.env.KEYCLOAK_SECRET
},
awsSqs: {
region: process.env.AWS_REGION || 'eu-west-2',
queueUrl: process.env.SQS_URL,
credentials: {
accessKeyId: process.env.ACCESS_KEY_ID,
secretAccessKey: process.env.SECRET_ACCESS_KEY
}
}
};
15 changes: 9 additions & 6 deletions kube/app/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,14 +155,17 @@ spec:
resources:
requests:
cpu: "100m"
memory: "256Mi"
limits:
cpu: "250m"
memory: "512Mi"
memory: "200Mi"
volumeMounts:
- mountPath: /public
name: public

# - name: cacert-store
# mountPath: /etc/ssl/certs/ims-prp1-ca.crt
# readOnly: false
# volumes:
# - name: cacert-store
# configMap:
# name: cacert-store
- name: nginx-proxy
# nginx-proxy-govuk:v4
image: quay.io/ukhomeofficedigital/nginx-proxy-govuk@sha256:4470064d0b1d20ae08c5fd85551576cb687f342a22d6cb456fda9b2c4ce8c8df
Expand All @@ -184,4 +187,4 @@ spec:
runAsNonRoot: true
volumes:
- name: public
emptyDir: {}
emptyDir: {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new line

7 changes: 7 additions & 0 deletions kube/certmounts/certmounts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: cacert-store
data:
ims-prp1-ca.crt: |
{{ file .CONFIGMAP1_VALUES }}
1 change: 1 addition & 0 deletions kube/configmaps/configmap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ metadata:
{{ end }}
data:
{{ file .CONFIGMAP_VALUES | indent 2 }}
{{ file .CONFIGMAP1_VALUES | indent 2 }}
Loading