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

backport v0.89.0 #1412

Merged
merged 47 commits into from
Jun 13, 2024
Merged

backport v0.89.0 #1412

merged 47 commits into from
Jun 13, 2024

Conversation

alexanderleegs
Copy link
Contributor

Details in #1411

kishore03109 and others added 30 commits November 9, 2023 17:35
release(v0.64.0): merge to master
fix(repoChecker): unintended alarms
* fix(otp): increment instead of update for concurrency (#1186)

* fix(otp): increment instead of update for concurrency

* ref(otp): migrate to use neverthrow instead

* chore: remove unneeded check for empty string

* Fix/add validators (#1197)

* chore: add validators

* fix: tests

* fix: add test

* chore: enforce 6 length otp

* fix(autoLogoutIssue): failing whoami (#1196)

## Problem

There was an issue with  #1183 due to the removal of the 

`trust proxy` setting in express. There are two packages that rely on express apis,  `express-rate-limit` and `express-session`. due to changes in the way we used `express-rate-limit`, I thought that this setting can be removed, and this was only done with the intention of a cleanup and does not affect the functionality of how we are currently using `express-rate-limit`.


The [documentation](https://github.com/expressjs/session?tab=readme-ov-file#cookiesecure) for `express-session` also states that:
>  If secure is set, and you access your site over HTTP, the cookie will not be set. If you have your node.js behind a proxy and are using secure: true, you need to set "trust proxy" in express

Checking in with the vapt folks to sense check this fix as well


## Solution

add back trust proxy 

**Breaking Changes**

<!-- Does this PR contain any backward incompatible changes? If so, what are they and should there be special considerations for release? -->

- [ ] Yes - this PR contains breaking changes
  - Details ...
- [X] No - this PR is backwards compatible with ALL of the following feature flags in this [doc](https://www.notion.so/opengov/Existing-feature-flags-518ad2cdc325420893a105e88c432be5)


#  Note: This test will take a while, and requires at worse 15 mins to conduct 
## Tests
- [ ] create a file called ddos.js
```
const stg = "https://staging-cms-api.isomer.gov.sg/v2/auth/verify"
async function send() {
  try {
    const resp = await fetch(stg, {
      method: "POST",
      body: JSON.stringify({
        email: "[email protected]",
        otp: "111111",
      }),
      headers: {
        "Content-Type": "application/json",
        "X-Forwarded-For": generateRandomIp(),
      },
    })
    const text = await resp.text()
    console.log(text)
    console.log({
      Limit: resp.headers.get("Ratelimit-Limit"),
      Remaining: resp.headers.get("Ratelimit-Remaining"),
      Reset: resp.headers.get("Ratelimit-Reset"),
    })
  } catch (err) {
    console.log(err.message)
  }
}
for (let i = 1; i <= 25; i++) {
  send()
}

```
- [ ] connect to ogp vpn 
- [ ] run `node ddos.js` 
- [ ] assert that the remaining counter fell from 100 
![Screenshot 2024-03-08 at 9 09 39 AM](https://github.com/isomerpages/isomercms-backend/assets/42832651/9cfb6417-c96c-45fd-8b58-820dd14c90bc)
- [ ] note the reset time (this is the window time, and by extension the amount of time to wait for this test)
- [ ] unconnect from vpn
- [ ] run `node ddos.js` 
- [ ] assert that the remaining counter fell from 100 
![Screenshot 2024-03-08 at 9 09 39 AM](https://github.com/isomerpages/isomercms-backend/assets/42832651/9cfb6417-c96c-45fd-8b58-820dd14c90bc)
- [ ] After the reset time is achieved, do above steps again and verify that after the reset time, the counters for both the simulated user resets. 
![Screenshot 2024-03-08 at 9 14 36 AM](https://github.com/isomerpages/isomercms-backend/assets/42832651/54e99386-6339-43ee-8bf8-1d182e299d33)

* 0.70.0

---------

Co-authored-by: Alexander Lee <[email protected]>
Co-authored-by: Kishore <[email protected]>
* build(deps): bump @aws-sdk/client-secrets-manager (#1218)

Bumps [@aws-sdk/client-secrets-manager](https://github.com/aws/aws-sdk-js-v3/tree/HEAD/clients/client-secrets-manager) from 3.501.0 to 3.533.0.
- [Release notes](https://github.com/aws/aws-sdk-js-v3/releases)
- [Changelog](https://github.com/aws/aws-sdk-js-v3/blob/main/clients/client-secrets-manager/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-js-v3/commits/v3.533.0/clients/client-secrets-manager)

---
updated-dependencies:
- dependency-name: "@aws-sdk/client-secrets-manager"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix: upgrade isomorphic-dompurify from 0.24.0 to 0.27.0 (#881)

Snyk has created this PR to upgrade isomorphic-dompurify from 0.24.0 to 0.27.0.

See this package in npm:
https://www.npmjs.com/package/isomorphic-dompurify

See this project in Snyk:
https://app.snyk.io/org/isomer/project/676b9e26-cebf-4964-b7b3-d9843e3339ff?utm_source=github&utm_medium=referral&page=upgrade-pr

Co-authored-by: snyk-bot <[email protected]>
Co-authored-by: seaerchin <[email protected]>

* fix: upgrade dd-trace from 4.7.0 to 4.11.0 (#922)

Snyk has created this PR to upgrade dd-trace from 4.7.0 to 4.11.0.

See this package in npm:
https://www.npmjs.com/package/dd-trace

See this project in Snyk:
https://app.snyk.io/org/isomer/project/676b9e26-cebf-4964-b7b3-d9843e3339ff?utm_source=github&utm_medium=referral&page=upgrade-pr

Co-authored-by: snyk-bot <[email protected]>

* fix: upgrade @aws-sdk/client-amplify from 3.370.0 to 3.382.0 (#923)

Snyk has created this PR to upgrade @aws-sdk/client-amplify from 3.370.0 to 3.382.0.

See this package in npm:
https://www.npmjs.com/package/@aws-sdk/client-amplify

See this project in Snyk:
https://app.snyk.io/org/isomer/project/676b9e26-cebf-4964-b7b3-d9843e3339ff?utm_source=github&utm_medium=referral&page=upgrade-pr

Co-authored-by: snyk-bot <[email protected]>

* fix: upgrade @aws-sdk/client-secrets-manager from 3.370.0 to 3.389.0 (#932)

Snyk has created this PR to upgrade @aws-sdk/client-secrets-manager from 3.370.0 to 3.389.0.

See this package in npm:
https://www.npmjs.com/package/@aws-sdk/client-secrets-manager

See this project in Snyk:
https://app.snyk.io/org/isomer/project/676b9e26-cebf-4964-b7b3-d9843e3339ff?utm_source=github&utm_medium=referral&page=upgrade-pr

Co-authored-by: snyk-bot <[email protected]>

* fix: upgrade aws-sdk from 2.1428.0 to 2.1450.0 (#948)

Snyk has created this PR to upgrade aws-sdk from 2.1428.0 to 2.1450.0.

See this package in npm:
https://www.npmjs.com/package/aws-sdk

See this project in Snyk:
https://app.snyk.io/org/isomer/project/676b9e26-cebf-4964-b7b3-d9843e3339ff?utm_source=github&utm_medium=referral&page=upgrade-pr

Co-authored-by: snyk-bot <[email protected]>

* fix: package.json & package-lock.json to reduce vulnerabilities (#1161)

The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-INFLIGHT-6095116

Co-authored-by: snyk-bot <[email protected]>

* feat(pino): removes extraneous stuff (#1212)

* fix(logger): delete old files, shift to pino

* fix(pino-pretty): intsall as dev deps

* refactor(tracer): inject logs based on env

* fix(ggsrepair): delete outdated import

* fix(stats-spec): update error log

* build(deps): bump follow-redirects from 1.15.5 to 1.15.6 (#1221)

Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.5 to 1.15.6.
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/follow-redirects/follow-redirects/commit/35a517c5861d79dc8bff7db8626013d20b711b06"><code>35a517c</code></a> Release version 1.15.6 of the npm package.</li>
<li><a href="https://github.com/follow-redirects/follow-redirects/commit/c4f847f85176991f95ab9c88af63b1294de8649b"><code>c4f847f</code></a> Drop Proxy-Authorization across hosts.</li>
<li><a href="https://github.com/follow-redirects/follow-redirects/commit/8526b4a1b2ab3a2e4044299377df623a661caa76"><code>8526b4a</code></a> Use GitHub for disclosure.</li>
<li>See full diff in <a href="https://github.com/follow-redirects/follow-redirects/compare/v1.15.5...v1.15.6">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=follow-redirects&package-manager=npm_and_yarn&previous-version=1.15.5&new-version=1.15.6)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/isomerpages/isomercms-backend/network/alerts).

</details>

* chore(admin): convert manual release creation steps into automated script (#1209)

* chore(admin): convert manual release creation steps into automated script

* feat: prepare the draft release

* fix: correct spelling for "grouped"

* feat: extract and present deploy notes

* chore: slight comment update

* feat: extract tests and notes in one pass

* chore: add comment

* fix: fix invalid string concat in subshells (use file holders instead)

* feat: sync local tags to remote tags

* chore: more comments

* chore: remove empty line

* chore: add more comments

* fix: upgrade @aws-sdk/client-cloudwatch-logs from 3.501.0 to 3.521.0 (#1226)

Snyk has created this PR to upgrade @aws-sdk/client-cloudwatch-logs from 3.501.0 to 3.521.0.

See this package in npm:
https://www.npmjs.com/package/@aws-sdk/client-cloudwatch-logs

See this project in Snyk:
https://app.snyk.io/org/isomer/project/676b9e26-cebf-4964-b7b3-d9843e3339ff?utm_source=github&utm_medium=referral&page=upgrade-pr

Co-authored-by: snyk-bot <[email protected]>

* fix: upgrade @aws-sdk/lib-dynamodb from 3.501.0 to 3.521.0 (#1225)

Snyk has created this PR to upgrade @aws-sdk/lib-dynamodb from 3.501.0 to 3.521.0.

See this package in npm:
https://www.npmjs.com/package/@aws-sdk/lib-dynamodb

See this project in Snyk:
https://app.snyk.io/org/isomer/project/676b9e26-cebf-4964-b7b3-d9843e3339ff?utm_source=github&utm_medium=referral&page=upgrade-pr

Co-authored-by: snyk-bot <[email protected]>

* fix: upgrade aws-sdk from 2.1545.0 to 2.1565.0 (#1223)

Snyk has created this PR to upgrade aws-sdk from 2.1545.0 to 2.1565.0.

See this package in npm:
https://www.npmjs.com/package/aws-sdk

See this project in Snyk:
https://app.snyk.io/org/isomer/project/676b9e26-cebf-4964-b7b3-d9843e3339ff?utm_source=github&utm_medium=referral&page=upgrade-pr

Co-authored-by: snyk-bot <[email protected]>

* fix: upgrade @aws-sdk/client-dynamodb from 3.501.0 to 3.521.0 (#1224)

Snyk has created this PR to upgrade @aws-sdk/client-dynamodb from 3.501.0 to 3.521.0.

See this package in npm:
https://www.npmjs.com/package/@aws-sdk/client-dynamodb

See this project in Snyk:
https://app.snyk.io/org/isomer/project/676b9e26-cebf-4964-b7b3-d9843e3339ff?utm_source=github&utm_medium=referral&page=upgrade-pr

Co-authored-by: snyk-bot <[email protected]>

* perf(I/O): rm blocking fs calls (#1220)

## Problem

We have quite a number of blocking I/O calls that has lead to unwanted CPU spikes in the event pool thread. 

This PR scrapes any existence of I/O calls and ensures that there is no lingering sync fs calls made from node. 


## Solution
use `fs.promises` instead

Looking at the spike after running the site checker
### NOTE: initial spike in event loop delay is due to the startup push to staging environment, this is not due to the site checker calls that were made
![Screenshot 2024-03-19 at 2 30 02 PM](https://github.com/isomerpages/isomercms-backend/assets/42832651/10604267-a702-4764-9ba4-e428987a8317)



![Screenshot 2024-03-19 at 1 30 03 PM](https://github.com/isomerpages/isomercms-backend/assets/42832651/fd9432b0-c83d-4a34-9c56-3e62d5d23a37)

**Breaking Changes**

<!-- Does this PR contain any backward incompatible changes? If so, what are they and should there be special considerations for release? -->

- [ ] Yes - this PR contains breaking changes
  - Details ...
- [X] No - this PR is backwards compatible with ALL of the following feature flags in this [doc](https://www.notion.so/opengov/Existing-feature-flags-518ad2cdc325420893a105e88c432be5)

**Features**:


when running the site repair form:

- Details ...

**Improvements**:

- Details ...

**Bug Fixes**:

- Details ...

## Before & After Screenshots

**BEFORE**:

<!-- [insert screenshot here] -->

**AFTER**:

<!-- [insert screenshot here] -->

## Tests

- [ ] Run the following command from the command line: 
```
grep -rE '(accessSync|appendFileSync|chmodSync|chownSync|closeSync|copyFileSync|cpSync|existsSync|fchmodSync|fchownSync|fdatasyncSync|fstatSync|fsyncSync|ftruncateSync|futimesSync|lchmodSync|lchownSync|lutimesSync|linkSync|lstatSync|mkdirSync|mkdtempSync|opendirSync|openSync|readdirSync|readFileSync|readlinkSync|readSync|readvSync|realpathSync|renameSync|rmdirSync|rmSync|statSync|statfsSync|symlinkSync|truncateSync|unlinkSync|utimesSync|writeFileSync|writeSync|writevSync)\b' src 
```

the only results should be from the `GitFileSystemService.spec.ts` which is fine since this test file runs locally and not in prod line

- [ ] Submit a form [here](https://form.gov.sg/65e4a3d2c25a061b046f3f01) for a repo in staging efs, and assert that the attachments are sent properly

- [ ] submit the site create form 


## Deploy Notes

<!-- Notes regarding deployment of the contained body of work.  -->
<!-- These should note any new dependencies, new scripts, etc. -->

**New environment variables**:

- `env var` : env var details
    - [ ] added env var to 1PW + SSM script (`fetch_ssm_parameters.sh`)

**New scripts**:

- `script` : script details

**New dependencies**:

- `dependency` : dependency details

**New dev dependencies**:

- `dependency` : dependency details

* fix(tags): update tagging for dd (#1222)

* fix(tags): update tagging for dd

* fix(task-def): update to isomer

* fix(link checker): wrong error reported (#1227)

## Problem

when pages are empty, we currently throw a link checker error which trips up alarms 

it is ok for a page content to be empty (eg, newly created page)


## Solution

remove the existing errors being reported

**Breaking Changes**

<!-- Does this PR contain any backward incompatible changes? If so, what are they and should there be special considerations for release? -->

- [ ] Yes - this PR contains breaking changes
  - Details ...
- [ ] No - this PR is backwards compatible with ALL of the following feature flags in this [doc](https://www.notion.so/opengov/Existing-feature-flags-518ad2cdc325420893a105e88c432be5)

**Features**:

- Details ...

**Improvements**:

- Details ...

**Bug Fixes**:

- Details ...

## Before & After Screenshots

**BEFORE**:

<!-- [insert screenshot here] -->

**AFTER**:

<!-- [insert screenshot here] -->

## Tests

<!-- What tests should be run to confirm functionality? -->

## Deploy Notes

<!-- Notes regarding deployment of the contained body of work.  -->
<!-- These should note any new dependencies, new scripts, etc. -->

**New environment variables**:

- `env var` : env var details
    - [ ] added env var to 1PW + SSM script (`fetch_ssm_parameters.sh`)

**New scripts**:

- `script` : script details

**New dependencies**:

- `dependency` : dependency details

**New dev dependencies**:

- `dependency` : dependency details

* chore: bump version to v0.72.0

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Hsu Zhong Jun <[email protected]>
Co-authored-by: Isomer Admin <[email protected]>
Co-authored-by: snyk-bot <[email protected]>
Co-authored-by: Timothee Groleau <[email protected]>
Co-authored-by: Kishore <[email protected]>
* chore(package): use npm (#1237)

* fix: upgrade dotenv from 16.4.1 to 16.4.5 (#1233)

Snyk has created this PR to upgrade dotenv from 16.4.1 to 16.4.5.

See this package in npm:
https://www.npmjs.com/package/dotenv

See this project in Snyk:
https://app.snyk.io/org/isomer/project/676b9e26-cebf-4964-b7b3-d9843e3339ff?utm_source=github&utm_medium=referral&page=upgrade-pr

Co-authored-by: snyk-bot <[email protected]>

* build(deps): bump express from 4.17.3 to 4.19.2 (#1242)

Bumps [express](https://github.com/expressjs/express) from 4.17.3 to 4.19.2.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/master/History.md)
- [Commits](expressjs/express@4.17.3...4.19.2)

---
updated-dependencies:
- dependency-name: express
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix: package.json & package-lock.json to reduce vulnerabilities (#1241)

The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-EXPRESS-6474509

Co-authored-by: snyk-bot <[email protected]>

* fix: upgrade @growthbook/growthbook from 0.27.0 to 0.34.0 (#1232)

Snyk has created this PR to upgrade @growthbook/growthbook from 0.27.0 to 0.34.0.

See this package in npm:
https://www.npmjs.com/package/@growthbook/growthbook

See this project in Snyk:
https://app.snyk.io/org/isomer/project/676b9e26-cebf-4964-b7b3-d9843e3339ff?utm_source=github&utm_medium=referral&page=upgrade-pr

Co-authored-by: snyk-bot <[email protected]>

* fix: upgrade @aws-sdk/client-dynamodb from 3.501.0 to 3.521.0 (#1229)

Snyk has created this PR to upgrade @aws-sdk/client-dynamodb from 3.501.0 to 3.521.0.

See this package in npm:
https://www.npmjs.com/package/@aws-sdk/client-dynamodb

See this project in Snyk:
https://app.snyk.io/org/isomer/project/676b9e26-cebf-4964-b7b3-d9843e3339ff?utm_source=github&utm_medium=referral&page=upgrade-pr

Co-authored-by: snyk-bot <[email protected]>

* fix: upgrade @aws-sdk/client-amplify from 3.501.0 to 3.521.0 (#1230)

Snyk has created this PR to upgrade @aws-sdk/client-amplify from 3.501.0 to 3.521.0.

See this package in npm:
https://www.npmjs.com/package/@aws-sdk/client-amplify

See this project in Snyk:
https://app.snyk.io/org/isomer/project/676b9e26-cebf-4964-b7b3-d9843e3339ff?utm_source=github&utm_medium=referral&page=upgrade-pr

Co-authored-by: snyk-bot <[email protected]>

* fix: upgrade @aws-sdk/client-cloudwatch-logs from 3.501.0 to 3.521.0 (#1231)

Snyk has created this PR to upgrade @aws-sdk/client-cloudwatch-logs from 3.501.0 to 3.521.0.

See this package in npm:
https://www.npmjs.com/package/@aws-sdk/client-cloudwatch-logs

See this project in Snyk:
https://app.snyk.io/org/isomer/project/676b9e26-cebf-4964-b7b3-d9843e3339ff?utm_source=github&utm_medium=referral&page=upgrade-pr

Co-authored-by: snyk-bot <[email protected]>

* fix(dockerfile): add dig to image (#1244)

* feat(dd): add traces to gitfilesysteM (#1240)

* feat(dd): adding in metrics to gitfilesystem

* feat: instrument with wrap-tracers

* feat: patch dd-trace to understand neverthrow

* fix: missing tracer import

* fix: use the clear tracer.wrap() method

* fix(dd): fix patch type

* chore: add tests for tracer compatibility with neverthrow

* chore: upgrade dd-trace to v5 and patch for neverthrow

* chore: remove unecessary change from patch

* feat: implement a blacklist for methods that should not be instrumented

* chore: remove obsolete patch

* chore: lock dd-trace to 5.9.0 strictly so patch is always applied

---------

Co-authored-by: Timothee Groleau <[email protected]>

* fix: reduce log size to just last commit (#1243)

* fix: reduce log size to just last commit

* feat: defaults maxCount in getGitLog to 1

* chore(GitFileSystemService): add validation tests for getGitLog

* chore(dep): add flag (#1247)

* chore: bump version to v0.73.0

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: seaerchin <[email protected]>
Co-authored-by: Isomer Admin <[email protected]>
Co-authored-by: snyk-bot <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Timothee Groleau <[email protected]>
Co-authored-by: Timothee Groleau <[email protected]>
alexanderleegs and others added 16 commits April 4, 2024 17:02
* fix(server): server should die if unable to connect to db (#1265)

## Problem

something in me wanted to check if we indeed exit if we fail to connect to db, and the answer is... no 


[node.js](https://nodejs.org/docs/latest-v18.x/api/process.html#processexitcode_1) states that 
> A number which will be the process exit code, when the process either exits gracefully, or is exited via process.exit() without specifying a code.

so it does not actually do the exiting, which leads to silent failures

* fix(dig): dig not working (#1246)

## Problem

We do have some checks in the backend to check prior to any site launch that there are AAAA records/CAA records present. In this case, the dig commands to check the AAAA records [failed](https://ogp.datadoghq.com/logs?query=service%3Aisomer%20env%3Aproduction%20%22An%20error%20occurred%20while%20performing%20dig%20for%20domain%3A%22%20&cols=host%2Cservice&fromUser=true&index=%2A&messageDisplay=inline&refresh_mode=sliding&storage=hot&stream_sort=desc&viz=stream&from_ts=1711457521321&to_ts=1711543921321&live=true).

The reason for above is that we were using a library called `node-dig-dns`. This called the dig command [directly](https://github.com/StephanGeorg/node-dig-dns/blob/master/src/index.js#L78) at a system level. However, our docker container does not have the dig command out of the box. This resulted in the existence of AAAA records not being caught.


We are also codifying a check for CAA records and ensuring that if there exist at least one  caa record and it uses our redirection service, it should have letsencrypt as one of the caa record. 

To prevent accidental commits to live indirection repo during dev, also adding a check to only commit to the indirection repository iff it is in prod environment. 
 
## Solution

just use node's dns resolver directly. this way we dont have to depend on an external library's implementation of node and dont have to install unnecessary deps in the docker.

remove dep introduced in #1244 

**Breaking Changes**

<!-- Does this PR contain any backward incompatible changes? If so, what are they and should there be special considerations for release? -->

- [ ] Yes - this PR contains breaking changes
  - Details ...
- [x] No - this PR is backwards compatible with ALL of the following feature flags in this [doc](https://www.notion.so/opengov/Existing-feature-flags-518ad2cdc325420893a105e88c432be5)

**Features**:
<img width="1493" alt="Screenshot 2024-03-27 at 11 21 44 PM" src="https://github.com/isomerpages/isomercms-backend/assets/42832651/73edd437-492b-4bff-86c9-3392cb40fe49">


### Manual test (not to be copied over to deployment notes)

- [ ] add these lines of code at the end of server.js 
```
const formResponses = [
  {
    submissionId: "",
    requesterEmail: "[email protected]",
    repoName: "kishore-test-dev-emil",
    primaryDomain: "google.com",
    redirectionDomain: "www.google.com",
    agencyEmail: "[email protected]",
  },
]

formsgSiteLaunchRouter.handleSiteLaunchResults(formResponses, "test")
```  

- [ ] Assert that the email comes out to

* fix: remove unecessary join and site retrieval (#1268)

* Improve APM spans (no more <anonymous>) (#1267)

* refactor: rename wrapper based on original function, only when original.name exists

* feat: utility to name all methods of an object

* feat: ensure all route handlers are named

* feat: drop the bound prefix in span names

* chore: remove unused eslint rule disabling

---------

Co-authored-by: Alexander Lee <[email protected]>

* fix: external links in top level nav (#1272)

* chore: bump version to v0.76.0

---------

Co-authored-by: Timothee Groleau <[email protected]>
Co-authored-by: Kishore <[email protected]>
* fix: off-by-one error for month number (#1294)

* ref(app): shift support flows into separate folder + ecs service (#1269)

* feat(caddyfile): add initial caddyfile

* refactor(infra): shift infra stuff to new folder

* chore(formsg): shift stuff into sub folder

* refactor(server): shift infra stuff out

* refactor(common): shift shared stuff into common folder

* build(package/tsconfig): update packages + paths

* refactor(server): swap to ts

* refactor(request): update type

* feat(infra/routes): add new router

* refactor(router): shift initialisation in

* refactor(middleware): shift shared stuff out

* chore(exports): add exports from indexs

* chore(featureflag): disable single export

* feat(docker): add containers in docker-compose for infra

* feat(deploy): update deploy stuff

* chore(cleanup): remove unused/extra code in infra/server

* fix(aws_deploy): update deploy file

* fix(task def): removed portmappings

* fix(dockerfile): copy src files over

* fix(docker): update port mappings as ecs uses same network

* fix(caddy): update to use local dockerfile

* fix(caddyfile): upate proxies

* fix(caddyfile): try to netweork via loopback

* revert(aws_deploy): revert previous changes

* revert(deploy_staging): revert

* revert(task def): revert be task def

* revert(src): revert files that were used for sidecar

* refactor(support): shift into new container

* fix(docker): update dockerfile + add health check

* fix(aws_deploy): update tag

* refactor(index): remove unsnued

* fix(app spec): do replacement for container name and port

* fix(ci): update image names

* feat(support): connect db

* chore(request): remove unused import

* refactor(dockerfile): update to explicitly copy

* chore(index): add a line space

* refactor(support task def): update so that dd-service is `isomer-support` and team is isomer

* chore(formsg tests): shift tests from `src` -> `support`

* ci(sidecar): add deploy files for prod (#1285)

* feat(deploy_prod): update workflow to include deploy_support

* feat(support-task-def): add prod

* fix(task def): update dd tags to include service

* fix(dockerfile): revert to copy . (#1304)

* chore: bump version to v0.79.0

---------

Co-authored-by: Harish <[email protected]>
Co-authored-by: Hsu Zhong Jun <[email protected]>
Co-authored-by: Timothee Groleau <[email protected]>
Copy link

mergify bot commented Jun 13, 2024

⚠️ The sha of the head commit of this PR conflicts with #1411. Mergify cannot evaluate rules on this PR. ⚠️

Copy link

mergify bot commented Jun 13, 2024

⚠️ The sha of the head commit of this PR conflicts with #1411. Mergify cannot evaluate rules on this PR. ⚠️

@alexanderleegs alexanderleegs merged commit 1ad9b85 into develop Jun 13, 2024
11 of 12 checks passed
@alexanderleegs alexanderleegs deleted the release_v0.89.0 branch June 13, 2024 07:02
This was referenced Jun 27, 2024
@dcshzj dcshzj mentioned this pull request Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants