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

Update template project name/references #1

Merged
merged 1 commit into from
Jul 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 4 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ workflows:
# jira_env_type: staging
# context:
# - hmpps-common-vars
# - hmpps-template-typescript-preprod
# - hmpps-authorization-preprod
# requires:
# - request-preprod-approval
# helm_timeout: 5m
Expand All @@ -173,15 +173,15 @@ workflows:
# slack_channel_name: << pipeline.parameters.releases-slack-channel >>
# context:
# - hmpps-common-vars
# - hmpps-template-typescript-prod
# - hmpps-authorization-prod
# requires:
# - request-prod-approval
# helm_timeout: 5m

security:
triggers:
- schedule:
cron: "30 5 * * 1-5"
cron: "39 9 * * 1-5"
filters:
branches:
only:
Expand All @@ -207,7 +207,7 @@ workflows:
security-weekly:
triggers:
- schedule:
cron: "0 5 * * 1"
cron: "56 9 * * 1"
filters:
branches:
only:
Expand Down
24 changes: 0 additions & 24 deletions .github/workflows/rename_template_project_pr.yml

This file was deleted.

10 changes: 5 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,36 @@

It's not safe to retry idempotent calls as this introduces the risk of creating multiple resources. This fix changes the default to not carry out any retries but allows switching on retrying if desired.

PR: [here](https://github.com/ministryofjustice/hmpps-template-typescript/pull/197)
PR: [here](https://github.com/ministryofjustice/hmpps-authorization/pull/197)

---

**April 13th 2023** - Caching fix

Asset caching was only set to 20 seconds. This fix changes the default to 1 hour which has a profound effect on the number of requests the application serves.

PR: [here](https://github.com/ministryofjustice/hmpps-template-typescript/pull/178)
PR: [here](https://github.com/ministryofjustice/hmpps-authorization/pull/178)

---

**April 4th 2023** - Remove unnecessary build step

There was an additional unnecessary build step as part of start:dev npm task. This more than doubled the start time on the initial run.

PR: [here](https://github.com/ministryofjustice/hmpps-template-typescript/pull/172)
PR: [here](https://github.com/ministryofjustice/hmpps-authorization/pull/172)

---

**March 20th 2023** - CSP fix for redirects during POST on session timeout

Updates the Content Security Policy to fix issues when users would be stuck on pages after submitting a form after their session times out. (Lots more detail in the PR)

PR: [here](https://github.com/ministryofjustice/hmpps-template-typescript/pull/170)
PR: [here](https://github.com/ministryofjustice/hmpps-authorization/pull/170)

---

**February 3rd 2023** - Revert multi build docker image

Multibuild docker images ended up taking a very long time after the upgrade to node 18 (1hr+). Some work needs to be done to move to support multi host builds in our circle orb, in the meantime we’ve removed this and are just building images solely for deployment.

PR: [here](https://github.com/ministryofjustice/hmpps-template-typescript/pull/149)
PR: [here](https://github.com/ministryofjustice/hmpps-authorization/pull/149)
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# hmpps-template-typescript
[![repo standards badge](https://img.shields.io/badge/dynamic/json?color=blue&style=flat&logo=github&label=MoJ%20Compliant&query=%24.result&url=https%3A%2F%2Foperations-engineering-reports.cloud-platform.service.justice.gov.uk%2Fapi%2Fv1%2Fcompliant_public_repositories%2Fhmpps-template-typescript)](https://operations-engineering-reports.cloud-platform.service.justice.gov.uk/public-github-repositories.html#hmpps-template-typescript "Link to report")
[![CircleCI](https://circleci.com/gh/ministryofjustice/hmpps-template-typescript/tree/main.svg?style=svg)](https://circleci.com/gh/ministryofjustice/hmpps-template-typescript)
# hmpps-authorization
[![repo standards badge](https://img.shields.io/badge/dynamic/json?color=blue&style=flat&logo=github&label=MoJ%20Compliant&query=%24.result&url=https%3A%2F%2Foperations-engineering-reports.cloud-platform.service.justice.gov.uk%2Fapi%2Fv1%2Fcompliant_public_repositories%2Fhmpps-authorization)](https://operations-engineering-reports.cloud-platform.service.justice.gov.uk/public-github-repositories.html#hmpps-authorization "Link to report")
[![CircleCI](https://circleci.com/gh/ministryofjustice/hmpps-authorization/tree/main.svg?style=svg)](https://circleci.com/gh/ministryofjustice/hmpps-authorization)

Template github repo used for new Typescript based projects.

Expand All @@ -12,15 +12,15 @@ see https://github.com/ministryofjustice/dps-project-bootstrap.
This bootstrap is community managed by the mojdt `#typescript` slack channel.
Please raise any questions or queries there. Contributions welcome!

Our security policy is located [here](https://github.com/ministryofjustice/hmpps-template-typescript/security/policy).
Our security policy is located [here](https://github.com/ministryofjustice/hmpps-authorization/security/policy).

More information about the template project including features can be found [here](https://dsdmoj.atlassian.net/wiki/spaces/NDSS/pages/3488677932/Typescript+template+project).

## Creating a CloudPlatform namespace

When deploying to a new namespace, you may wish to use this template typescript project namespace as the basis for your new namespace:

<https://github.com/ministryofjustice/cloud-platform-environments/tree/main/namespaces/live.cloud-platform.service.justice.gov.uk/hmpps-template-typescript>
<https://github.com/ministryofjustice/cloud-platform-environments/tree/main/namespaces/live.cloud-platform.service.justice.gov.uk/hmpps-authorization>

This template namespace includes an AWS elasticache setup - which is required by this template project.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
appVersion: '1.0'
description: A Helm chart for Kubernetes
name: hmpps-template-typescript
name: hmpps-authorization
version: 0.2.0
dependencies:
- name: generic-service
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
---
generic-service:
nameOverride: hmpps-template-typescript
nameOverride: hmpps-authorization

replicaCount: 4

image:
repository: quay.io/hmpps/hmpps-template-typescript
repository: quay.io/hmpps/hmpps-authorization
tag: app_version # override at deployment time
port: 3000

ingress:
enabled: true
host: app-hostname.local # override per environment
tlsSecretName: hmpps-template-typescript-cert
tlsSecretName: hmpps-authorization-cert

livenessProbe:
httpGet:
Expand Down Expand Up @@ -41,7 +41,7 @@ generic-service:
# [name of environment variable as seen by app]: [key of kubernetes secret to load]

namespace_secrets:
hmpps-template-typescript:
hmpps-authorization:
APPINSIGHTS_INSTRUMENTATIONKEY: "APPINSIGHTS_INSTRUMENTATIONKEY"
API_CLIENT_ID: "API_CLIENT_ID"
API_CLIENT_SECRET: "API_CLIENT_SECRET"
Expand All @@ -63,4 +63,4 @@ generic-service:
cloudplatform-live-3: "35.177.252.54/32"

generic-prometheus-alerts:
targetApplication: hmpps-template-typescript
targetApplication: hmpps-authorization
6 changes: 3 additions & 3 deletions helm_deploy/values-dev.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
# Per environment values which override defaults in hmpps-template-typescript/values.yaml
# Per environment values which override defaults in hmpps-authorization/values.yaml

generic-service:
replicaCount: 2

ingress:
host: hmpps-template-typescript-dev.hmpps.service.justice.gov.uk
host: hmpps-authorization-dev.hmpps.service.justice.gov.uk

env:
INGRESS_URL: "https://hmpps-template-typescript-dev.hmpps.service.justice.gov.uk"
INGRESS_URL: "https://hmpps-authorization-dev.hmpps.service.justice.gov.uk"
HMPPS_AUTH_URL: "https://sign-in-dev.hmpps.service.justice.gov.uk/auth"
TOKEN_VERIFICATION_API_URL: "https://token-verification-api-dev.prison.service.justice.gov.uk"

Expand Down
6 changes: 3 additions & 3 deletions helm_deploy/values-preprod.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
# Per environment values which override defaults in hmpps-template-typescript/values.yaml
# Per environment values which override defaults in hmpps-authorization/values.yaml

generic-service:
replicaCount: 2

ingress:
host: hmpps-template-typescript-preprod.hmpps.service.justice.gov.uk
host: hmpps-authorization-preprod.hmpps.service.justice.gov.uk

env:
INGRESS_URL: "https://hmpps-template-typescript-preprod.hmpps.service.justice.gov.uk"
INGRESS_URL: "https://hmpps-authorization-preprod.hmpps.service.justice.gov.uk"
HMPPS_AUTH_URL: "https://sign-in-preprod.hmpps.service.justice.gov.uk/auth"
TOKEN_VERIFICATION_API_URL: "https://token-verification-api-preprod.prison.service.justice.gov.uk"

Expand Down
6 changes: 3 additions & 3 deletions helm_deploy/values-prod.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
# Per environment values which override defaults in hmpps-template-typescript/values.yaml
# Per environment values which override defaults in hmpps-authorization/values.yaml

generic-service:
ingress:
host: hmpps-template-typescript.hmpps.service.justice.gov.uk
host: hmpps-authorization.hmpps.service.justice.gov.uk

env:
INGRESS_URL: "https://hmpps-template-typescript.hmpps.service.justice.gov.uk"
INGRESS_URL: "https://hmpps-authorization.hmpps.service.justice.gov.uk"
HMPPS_AUTH_URL: "https://sign-in.hmpps.service.justice.gov.uk/auth"
TOKEN_VERIFICATION_API_URL: "https://token-verification-api.prison.service.justice.gov.uk"

Expand Down
2 changes: 1 addition & 1 deletion logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ import config from './server/config'

const formatOut = bunyanFormat({ outputMode: 'short', color: !config.production })

const logger = bunyan.createLogger({ name: 'HMPPS Typescript Template', stream: formatOut, level: 'debug' })
const logger = bunyan.createLogger({ name: 'Hmpps Authorization', stream: formatOut, level: 'debug' })

export default logger
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.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "hmpps-template-typescript",
"name": "hmpps-authorization",
"version": "0.0.1",
"description": "HMPPS Typescript Template",
"repository": "git@github.com:ministryofjustice/hmpps-template-typescript.git",
"description": "Hmpps Authorization",
"repository": "git@github.com:ministryofjustice/hmpps-authorization.git",
"license": "MIT",
"scripts": {
"prepare": "husky install",
Expand Down
55 changes: 0 additions & 55 deletions rename-project.bash

This file was deleted.

2 changes: 1 addition & 1 deletion server/utils/nunjucksSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default function nunjucksSetup(app: express.Express, applicationInfo: App
app.set('view engine', 'njk')

app.locals.asset_path = '/assets/'
app.locals.applicationName = 'HMPPS Typescript Template'
app.locals.applicationName = 'Hmpps Authorization'

// Cachebusting version string
if (production) {
Expand Down