Skip to content

Commit

Permalink
Merge branch 'release/v1.9.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
appsol committed Jun 16, 2023
2 parents c8c2ea2 + d2eda25 commit 7da0b71
Show file tree
Hide file tree
Showing 303 changed files with 5,287 additions and 3,415 deletions.
5 changes: 5 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
VUE_APP_NAME=
VUE_APP_ENV=local
VUE_APP_URI=
VUE_APP_API_URI=
VUE_APP_FRONTEND_URI=
VUE_APP_API_CLIENT_ID=
VUE_APP_GOOGLE_API_KEY=
VUE_APP_SESSION_TIMEOUT=20
VUE_APP_BUGSNAG_API_KEY=
VUE_APP_CONTACT_EMAIL=
VUE_APP_CQC_LOCATION_ACTIVE=
VUE_APP_SERVICE_TAGS=
8 changes: 4 additions & 4 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
module.exports = {
root: true,
env: {
node: true
node: true,
},
extends: ["plugin:vue/essential", "@vue/prettier"],
rules: {
"no-console": process.env.NODE_ENV === "production" ? "error" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "error" : "off"
"no-debugger": process.env.NODE_ENV === "production" ? "error" : "off",
},
parserOptions: {
parser: "babel-eslint"
}
parser: "babel-eslint",
},
};
127 changes: 59 additions & 68 deletions aws/cloudformation.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# ==================================================
# This stack creates the API infrastructure.
# ==================================================
from troposphere import Template, Parameter, Ref, GetAtt, Join, Output
from troposphere.s3 import Bucket, PublicRead, WebsiteConfiguration, RedirectAllRequestsTo
from troposphere import Template, Parameter, Ref, GetAtt, Join, Sub, Output
from troposphere.s3 import Bucket, BucketPolicy, OwnershipControls, OwnershipControlsRule, PublicAccessBlockConfiguration
import troposphere.iam as iam
import troposphere.cloudfront as cloudfront
import uuid
Expand All @@ -11,8 +11,8 @@
# Template details.
# ==================================================
template = Template(
'Create the infrastructure needed to run the One Hounslow Connect Backend')
template.add_version('2010-09-09')
'Create the infrastructure needed to run the Connected Places Backend')
template.set_version('2010-09-09')

# ==================================================
# Parameters.
Expand Down Expand Up @@ -48,17 +48,6 @@
)
)

cname_301_parameter = template.add_parameter(
Parameter(
'Cname301',
Type='String',
Description='The CNAME that should be 301 redirected to the site CNAME.',
MinLength='1',
AllowedPattern='^(?!:\/\/)([a-zA-Z0-9-_]+\.)*[a-zA-Z0-9][a-zA-Z0-9-_]+\.[a-zA-Z]{2,11}?$',
ConstraintDescription='Must be a valid domain'
)
)

certificate_arn_parameter = template.add_parameter(
Parameter(
'CertificateArn',
Expand All @@ -67,14 +56,6 @@
)
)

certificate_301_arn_parameter = template.add_parameter(
Parameter(
'Certificate301Arn',
Type='String',
Description='The ARN for the CloudFront distribution SSL certificate covering the domain to be 301 redirected (must be in us-east-1).'
)
)

# ==================================================
# Variables.
# ==================================================
Expand All @@ -89,23 +70,60 @@
Bucket(
'Bucket',
BucketName=bucket_name_variable,
AccessControl=PublicRead
PublicAccessBlockConfiguration=PublicAccessBlockConfiguration(
BlockPublicAcls=True,
BlockPublicPolicy=True,
IgnorePublicAcls=True,
RestrictPublicBuckets=True
),
OwnershipControls=OwnershipControls(
Rules=[
OwnershipControlsRule(
ObjectOwnership="BucketOwnerPreferred"
)
]
),
)
)

bucket_301_resource = template.add_resource(
Bucket(
'Bucket301',
BucketName=Ref(cname_301_parameter),
AccessControl=PublicRead,
WebsiteConfiguration=WebsiteConfiguration(
RedirectAllRequestsTo=RedirectAllRequestsTo(
HostName=Ref(cname_parameter),
)
cloudfront_oai = template.add_resource(
cloudfront.CloudFrontOriginAccessIdentity(
'CloudFrontOAI',
CloudFrontOriginAccessIdentityConfig=cloudfront.CloudFrontOriginAccessIdentityConfig(
Comment=Sub("Cloudfront OAI for ${Cname}")
)
)
)

bucket_policy = template.add_resource(
BucketPolicy(
'PublicBucketPolicy',
Bucket=Ref(bucket_resource),
PolicyDocument={
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"s3:GetObject"
],
"Effect": "Allow",
"Resource": [
Join("", [
"arn:aws:s3:::",
Ref(bucket_resource),
"/*"
]
)
],
"Principal": {
'CanonicalUser': GetAtt(cloudfront_oai, 'S3CanonicalUserId')
}
}
]
}
)
)

distribution_resource = template.add_resource(
cloudfront.Distribution(
'Distribution',
Expand All @@ -130,6 +148,11 @@
ErrorCode=404,
ResponseCode=200,
ResponsePagePath='/index.html'
),
cloudfront.CustomErrorResponse(
ErrorCode=403,
ResponseCode=200,
ResponsePagePath='/index.html'
)
],
DefaultCacheBehavior=cloudfront.DefaultCacheBehavior(
Expand All @@ -146,7 +169,9 @@
cloudfront.Origin(
DomainName=GetAtt(bucket_resource, 'DomainName'),
Id=Join('-', ['S3', Ref(bucket_resource)]),
S3OriginConfig=cloudfront.S3Origin()
S3OriginConfig=cloudfront.S3OriginConfig(
OriginAccessIdentity=Join('', ['origin-access-identity/cloudfront/', Ref(cloudfront_oai)])
)
)
],
ViewerCertificate=cloudfront.ViewerCertificate(
Expand All @@ -157,40 +182,6 @@
)
)

distribution_301_resource = template.add_resource(
cloudfront.Distribution(
'Distribution301',
DistributionConfig=cloudfront.DistributionConfig(
Aliases=[
Ref(cname_301_parameter)
],
DefaultCacheBehavior=cloudfront.DefaultCacheBehavior(
ForwardedValues=cloudfront.ForwardedValues(
QueryString=False
),
TargetOriginId=Join('-', ['S3', Ref(bucket_301_resource)]),
ViewerProtocolPolicy='redirect-to-https'
),
Enabled=True,
IPV6Enabled=True,
Origins=[
cloudfront.Origin(
DomainName=Join('.', [Ref(cname_301_parameter), 's3-website', Ref('AWS::Region'),'amazonaws.com']),
Id=Join('-', ['S3', Ref(bucket_301_resource)]),
CustomOriginConfig=cloudfront.CustomOrigin(
OriginProtocolPolicy='http-only'
)
)
],
ViewerCertificate=cloudfront.ViewerCertificate(
AcmCertificateArn=Ref(certificate_301_arn_parameter),
SslSupportMethod='sni-only',
MinimumProtocolVersion='TLSv1.2_2019'
)
)
)
)

ci_user_resource = template.add_resource(
iam.User(
'CiUser',
Expand Down
8 changes: 4 additions & 4 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ module.exports = {
[
"@vue/app",
{
useBuiltIns: "entry"
}
]
]
useBuiltIns: "entry",
},
],
],
};
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: "3"

services:
troposphere:
image: royal-borough-kingston/ck-backend/troposphere
image: connected-places/backend/troposphere
build:
context: ./docker/troposphere
dockerfile: Dockerfile
Expand Down
2 changes: 1 addition & 1 deletion docker/troposphere/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
troposphere==2.3.3
troposphere==2.7.1
awacs==0.8.1
8 changes: 4 additions & 4 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ module.exports = {
"^.+\\.vue$": "vue-jest",
".+\\.(css|styl|less|sass|scss|png|jpg|ttf|woff|woff2)$":
"jest-transform-stub",
"^.+\\.jsx?$": "babel-jest"
"^.+\\.jsx?$": "babel-jest",
},
moduleNameMapper: {
"^@/(.*)$": "<rootDir>/src/$1"
"^@/(.*)$": "<rootDir>/src/$1",
},
snapshotSerializers: ["jest-serializer-vue"],
testMatch: [
"**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)"
"**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)",
],
testURL: "http://localhost/"
testURL: "http://localhost/",
};
4 changes: 2 additions & 2 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
plugins: {
autoprefixer: {}
}
autoprefixer: {},
},
};
Binary file modified public/assets/images/android-icon-144x144.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/assets/images/android-icon-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/assets/images/android-icon-36x36.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/assets/images/android-icon-48x48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/assets/images/android-icon-72x72.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/assets/images/android-icon-96x96.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/assets/images/apple-icon-114x114.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/assets/images/apple-icon-120x120.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/assets/images/apple-icon-144x144.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/assets/images/apple-icon-152x152.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/assets/images/apple-icon-180x180.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/assets/images/apple-icon-57x57.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/assets/images/apple-icon-60x60.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/assets/images/apple-icon-72x72.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/assets/images/apple-icon-76x76.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/assets/images/apple-icon-precomposed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/assets/images/apple-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions public/assets/images/browserconfig.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<browserconfig><msapplication><tile><square70x70logo src="/ms-icon-70x70.png"/><square150x150logo src="/ms-icon-150x150.png"/><square310x310logo src="/ms-icon-310x310.png"/><TileColor>#ffffff</TileColor></tile></msapplication></browserconfig>
Binary file modified public/assets/images/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/assets/images/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/assets/images/favicon-96x96.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/assets/images/favicon.ico
Binary file not shown.
Empty file modified public/assets/images/manifest.json
100755 → 100644
Empty file.
Binary file modified public/assets/images/ms-icon-144x144.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/assets/images/ms-icon-150x150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/assets/images/ms-icon-310x310.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/assets/images/ms-icon-70x70.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/favicon.ico
Binary file not shown.
36 changes: 18 additions & 18 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<template>
<div id="app">
<vue-headful
title="Hounslow Connect"
:title="appName"
:head="headAttributes"
:html="htmlAttributes"
/>

<gov-skip-link href="#main-content">Skip to main content</gov-skip-link>

<gov-header service-name="Hounslow Connect" :navigation="headerNav" />
<gov-header :service-name="appName" :navigation="headerNav" />

<div class="govuk-width-container">
<main
Expand Down Expand Up @@ -37,23 +37,23 @@ export default {
bodyClasses: ["js-enabled"],
mainClasses: [],
headerNav: [],
logoutInterval: null
logoutInterval: null,
};
},
computed: {
headAttributes() {
return {
"meta[name=theme-color]": {
content: this.themeColor
content: this.themeColor,
},
"meta[name=robots]": { content: "noindex" }
"meta[name=robots]": { content: "noindex" },
};
},
htmlAttributes() {
return {
body: {
class: [document.body.className, ...this.bodyClasses].join(" ")
}
class: [document.body.className, ...this.bodyClasses].join(" "),
},
};
},
loggedInItems() {
Expand All @@ -62,38 +62,38 @@ export default {
{ text: "Locations", to: { name: "locations-index" } },
{ text: "Referrals", to: { name: "referrals-index" } },
{ text: "Organisations", to: { name: "organisations-index" } },
{ text: "Events", to: { name: "events-index" } },
{ text: "Pages", to: { name: "pages-index" } },
{
text: "Users",
to: { name: "users-index" }
to: { name: "users-index" },
},
{
text: "Reports",
to: { name: "reports-index" },
hide: !Auth.isGlobalAdmin
hide: !Auth.isGlobalAdmin,
},
{
text: "Admin",
to: { name: "admin-index" },
hide: !Auth.isGlobalAdmin
hide: !Auth.isGlobalAdmin,
},
{
text: "Update requests",
to: { name: "update-requests-index" },
hide: !Auth.isGlobalAdmin
hide: !Auth.isGlobalAdmin,
},
{
text: "Help",
to: { name: "help-index" }
}
to: { name: "help-index" },
},
];
},
loggedOutItems() {
return [
{ text: "Register", to: { name: "register-index" } },
{ text: "Login", href: Auth.authorizeUrl }
{ text: "Login", href: Auth.authorizeUrl },
];
}
},
},
methods: {
setHeaderItems() {
Expand Down Expand Up @@ -122,7 +122,7 @@ export default {
endAutoLogoutInterval() {
clearInterval(this.logoutInterval);
this.logoutInterval = null;
}
},
},
created() {
Expand All @@ -138,6 +138,6 @@ export default {
destroyed() {
this.endAutoLogoutInterval();
}
},
};
</script>
Binary file removed src/assets/logo-white.png
Binary file not shown.
Binary file added src/assets/logo.png
Loading

0 comments on commit 7da0b71

Please sign in to comment.