Skip to content

Commit

Permalink
Merge branch 'release/v1.5.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
appsol committed Nov 9, 2021
2 parents fc4d917 + cf8ff18 commit 0e124b0
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lts/*
lts/fermium
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ branches:
- develop

language: node_js
node_js:
- '14'

cache:
directories:
Expand Down
72 changes: 69 additions & 3 deletions aws/cloudformation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This stack creates the API infrastructure.
# ==================================================
from troposphere import Template, Parameter, Ref, GetAtt, Join, Output
import troposphere.s3 as s3
from troposphere.s3 import Bucket, PublicRead, WebsiteConfiguration, RedirectAllRequestsTo
import troposphere.iam as iam
import troposphere.cloudfront as cloudfront
import uuid
Expand Down Expand Up @@ -48,6 +48,17 @@
)
)

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 @@ -56,6 +67,14 @@
)
)

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 @@ -67,10 +86,23 @@
# Resources.
# ==================================================
bucket_resource = template.add_resource(
s3.Bucket(
Bucket(
'Bucket',
BucketName=bucket_name_variable,
AccessControl='PublicRead'
AccessControl=PublicRead
)
)

bucket_301_resource = template.add_resource(
Bucket(
'Bucket301',
BucketName=Ref(cname_301_parameter),
AccessControl=PublicRead,
WebsiteConfiguration=WebsiteConfiguration(
RedirectAllRequestsTo=RedirectAllRequestsTo(
HostName=Ref(cname_parameter),
)
)
)
)

Expand Down Expand Up @@ -125,6 +157,40 @@
)
)

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
2 changes: 1 addition & 1 deletion src/views/register/forms/DetailsTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<gov-hint slot="hint" for="name">
The name of your {{ service.type }} must be unique. The URL of your
page will be: <br />
onehounslowconnect.london/services/{{ service.slug }}
hounslowconnect.com/services/{{ service.slug }}
</gov-hint>
</ck-text-input>

Expand Down
2 changes: 1 addition & 1 deletion src/views/register/new/Organisation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<gov-hint slot="hint" for="name">
The name of your organisation must be unique. The URL of your page will
be: <br />
onehounslowconnect.london/organisations/{{ form.organisation.slug }}
hounslowconnect.com/organisations/{{ form.organisation.slug }}
</gov-hint>
</ck-text-input>

Expand Down

0 comments on commit 0e124b0

Please sign in to comment.