isomerpages / isomercms-backend

A static website builder and host for the Singapore Government
5 stars 1 forks source link

fix(dig): dig not working #1246

Closed kishore03109 closed 6 months ago

kishore03109 commented 6 months ago

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.

The reason for above is that we were using a library called node-dig-dns. This called the dig command directly 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

Features:

Screenshot 2024-03-27 at 11 21 44 PM

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

formsgSiteLaunchRouter.handleSiteLaunchResults(formResponses, "test")



- [ ] Assert that the email comes out to 
kishore03109 commented 6 months ago

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @kishore03109 and the rest of your teammates on Graphite Graphite