Skip to content

Commit

Permalink
Merge pull request #716 from opengovsg/release-v4.46.1-hotfix
Browse files Browse the repository at this point in the history
build: merge release 4.46.1 into master
  • Loading branch information
mantariksh authored Nov 24, 2020
2 parents bdf95b7 + 375df4f commit e7cc6b0
Show file tree
Hide file tree
Showing 103 changed files with 5,519 additions and 3,036 deletions.
43 changes: 24 additions & 19 deletions .ebextensions/eb-memory-monitor.config
Original file line number Diff line number Diff line change
@@ -1,24 +1,29 @@
###################################################################################################
#### Memory monitoring for Elastic Beanstalk
#### https://medium.com/tomincode/cloudwatch-memory-monitoring-for-elastic-beanstalk-1caa98d57d5c
#### https://aws.amazon.com/premiumsupport/knowledge-center/elastic-beanstalk-memory-monitoring/
###################################################################################################

packages:
yum:
perl-DateTime: []
perl-Sys-Syslog: []
perl-LWP-Protocol-https: []
perl-Switch: []
perl-URI: []
perl-Bundle-LWP: [] # TODO(#638): Replace this yum package with perl-Digest-SHA.x86_64 for Amazon Linux 2 instances
sources:
/opt/cloudwatch: https://aws-cloudwatch.s3.amazonaws.com/downloads/CloudWatchMonitoringScripts-1.2.1.zip

container_commands:
00download:
command: "wget http://aws-cloudwatch.s3.amazonaws.com/downloads/CloudWatchMonitoringScripts-1.2.2.zip"
ignoreErrors: true
01extract:
command: "unzip -o CloudWatchMonitoringScripts-1.2.2.zip"
ignoreErrors: true
02rmzip:
command: "rm CloudWatchMonitoringScripts-1.2.2.zip"
ignoreErrors: true
03prereq:
command: "yum install -y perl-Switch perl-DateTime perl-Sys-Syslog perl-LWP-Protocol-https"
ignoreErrors: false
04cdinto:
command: "mv aws-scripts-mon/ /home/ec2-user"
ignoreErrors: true
05cron:
command: "crontab -l | grep -q 'mon-put-instance-data.pl' || crontab -l | { cat; echo '* * * * * /home/ec2-user/aws-scripts-mon/mon-put-instance-data.pl --mem-util --mem-used --mem-avail'; } | crontab -"
ignoreErrors: false
01-setupcron:
command: |
echo '*/5 * * * * root perl /opt/cloudwatch/aws-scripts-mon/mon-put-instance-data.pl `{"Fn::GetOptionSetting" : { "OptionName" : "CloudWatchMetrics", "DefaultValue" : "--mem-util --disk-space-util --disk-path=/" }}` >> /var/log/cwpump.log 2>&1' > /etc/cron.d/cwpump
02-changeperm:
command: chmod 644 /etc/cron.d/cwpump
03-changeperm:
command: chmod u+x /opt/cloudwatch/aws-scripts-mon/mon-put-instance-data.pl
option_settings:
"aws:autoscaling:launchconfiguration" :
IamInstanceProfile : "aws-elasticbeanstalk-ec2-role"
"aws:elasticbeanstalk:customoption" :
CloudWatchMetrics : "--mem-util --mem-used --mem-avail --disk-space-util --disk-space-used --disk-space-avail --disk-path=/ --auto-scaling"
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"extends": ["plugin:@typescript-eslint/recommended"],
"rules": {
// Rules for auto sort of imports
"simple-import-sort/sort": [
"simple-import-sort/imports": [
"error",
{
"groups": [
Expand Down
1 change: 1 addition & 0 deletions .template-env
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ FORMSG_SDK_MODE=
# Default environment variables have been included for local development
# purposes.
# MYINFO_CLIENT_CONFIG=stg
# MYINFO_FORMSG_KEY_PATH=./node_modules/@opengovsg/mockpass/static/certs/key.pem
# SPCP_COOKIE_MAX_AGE=7200000

# SP_FORMSG_KEY_PATH=./node_modules/@opengovsg/mockpass/static/certs/key.pem
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ script:
- set -e
- npm run lint-ci
- npm run build
- npm run test-ci
- travis_retry npm run test-ci
- npm run test-e2e-ci

before_deploy:
Expand Down
53 changes: 50 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,56 @@ All notable changes to this project will be documented in this file. Dates are d

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### [v4.45.1](https://github.com/opengovsg/FormSG/compare/v4.45.0...v4.45.1)

- fix: update email list correctly when deleting emails [`5776c2d`](https://github.com/opengovsg/FormSG/commit/5776c2d3d079e2876aacb17c41c398031a8ff939)
#### [v4.46.1](https://github.com/opengovsg/FormSG/compare/v4.46.0...v4.46.1)

- fix: check for undefined-ness on attachmentMetadata [`46d3357`](https://github.com/opengovsg/FormSG/commit/46d335785f51f40722ec0ba87510a17e7cf82edd)
- fix: early return on undefined verification signature [`e67bb8b`](https://github.com/opengovsg/FormSG/commit/e67bb8b1fc12e41c7c9cf1347a52ed7e30f2fbf5)

#### [v4.46.0](https://github.com/opengovsg/FormSG/compare/v4.45.0...v4.46.0)

> 18 November 2020
- chore: use travis_retry to retry flaky tests automatically [`#641`](https://github.com/opengovsg/FormSG/pull/641)
- refactor: migrate MyInfo functionality to TypeScript [`#560`](https://github.com/opengovsg/FormSG/pull/560)
- feat: upgrade spcp-auth-client [`#649`](https://github.com/opengovsg/FormSG/pull/649)
- feat: allow .oa files to be attached [`#650`](https://github.com/opengovsg/FormSG/pull/650)
- fix(deps): bump mongoose from 5.10.10 to 5.10.14 [`#645`](https://github.com/opengovsg/FormSG/pull/645)
- chore: merge release 4.45.1 hotfix back to develop [`#648`](https://github.com/opengovsg/FormSG/pull/648)
- refactor: migrate NRIC validator to TypeScript [`#639`](https://github.com/opengovsg/FormSG/pull/639)
- ref: migrate streamEncryptedResponses flow to Typescript [`#615`](https://github.com/opengovsg/FormSG/pull/615)
- chore(deps-dev): bump eslint-plugin-simple-import-sort from 5.0.3 to 6.0.0 [`#646`](https://github.com/opengovsg/FormSG/pull/646)
- chore(deps-dev): bump @types/mongoose from 5.7.37 to 5.10.0 [`#644`](https://github.com/opengovsg/FormSG/pull/644)
- chore(deps-dev): bump eslint from 7.12.1 to 7.13.0 [`#643`](https://github.com/opengovsg/FormSG/pull/643)
- ref: migrate fetch form submission counts flow to Typescript [`#592`](https://github.com/opengovsg/FormSG/pull/592)
- fix: resolve & in url upon redirect, shift prefill to textfield component [`#569`](https://github.com/opengovsg/FormSG/pull/569)
- feat(monitoring): add memory monitoring to EC2 instances [`#620`](https://github.com/opengovsg/FormSG/pull/620)
- ref: migrate createPresignedPost endpoint for logos to TypeScript [`#607`](https://github.com/opengovsg/FormSG/pull/607)
- fix: package.json & package-lock.json to reduce vulnerabilities [`#637`](https://github.com/opengovsg/FormSG/pull/637)
- fix(deps): bump @sentry/browser from 5.24.2 to 5.27.3 [`#631`](https://github.com/opengovsg/FormSG/pull/631)
- fix(deps): bump helmet from 4.1.1 to 4.2.0 [`#624`](https://github.com/opengovsg/FormSG/pull/624)
- style: make transfer ownership email more prominent [`#630`](https://github.com/opengovsg/FormSG/pull/630)
- fix(deps): bump angular from 1.8.0 to 1.8.2 [`#633`](https://github.com/opengovsg/FormSG/pull/633)
- chore(deps-dev): bump babel-loader from 8.1.0 to 8.2.1 [`#625`](https://github.com/opengovsg/FormSG/pull/625)
- chore(deps-dev): bump testcafe from 1.8.6 to 1.9.4 [`#632`](https://github.com/opengovsg/FormSG/pull/632)
- ref: migrate createPresignedPost endpoint for images to TypeScript [`#604`](https://github.com/opengovsg/FormSG/pull/604)
- fix(deps): bump uuid from 8.3.0 to 8.3.1 [`#626`](https://github.com/opengovsg/FormSG/pull/626)
- chore(deps-dev): bump supertest from 5.0.0 to 6.0.1 [`#622`](https://github.com/opengovsg/FormSG/pull/622)
- fix(deps): bump jwt-decode from 2.2.0 to 3.1.1 [`#594`](https://github.com/opengovsg/FormSG/pull/594)
- test: enable local e2e tests [`#616`](https://github.com/opengovsg/FormSG/pull/616)
- chore(deps-dev): bump @types/mongoose from 5.7.36 to 5.7.37 [`#597`](https://github.com/opengovsg/FormSG/pull/597)
- refactor: convert req.hashedFields to Set [`#617`](https://github.com/opengovsg/FormSG/pull/617)
- feat: Backend implementation for bulk attachment downloading [`#555`](https://github.com/opengovsg/FormSG/pull/555)
- fix(deps): bump angular-aria from 1.8.0 to 1.8.2 [`#619`](https://github.com/opengovsg/FormSG/pull/619)
- fix: use maildev for dev environment emails [`#613`](https://github.com/opengovsg/FormSG/pull/613)
- refactor: convert errors.server.controller to typescript utility function [`#602`](https://github.com/opengovsg/FormSG/pull/602)
- chore(deps-dev): bump @typescript-eslint/parser from 4.5.0 to 4.7.0 [`#610`](https://github.com/opengovsg/FormSG/pull/610)
- fix: add required env vars for MyInfo [`#612`](https://github.com/opengovsg/FormSG/pull/612)
- chore(deps-dev): bump @types/node from 14.14.6 to 14.14.7 [`#611`](https://github.com/opengovsg/FormSG/pull/611)
- build: merge release 4.45.0 into develop [`#608`](https://github.com/opengovsg/FormSG/pull/608)
- ref: migrate inline queries for retrieval of submissions metadata to model static methods [`#601`](https://github.com/opengovsg/FormSG/pull/601)
- chore: bump version to v4.46.0 [`bcdcf03`](https://github.com/opengovsg/FormSG/commit/bcdcf03afdbffb3562386129c793dee5b459b321)
- chore: bump version to 4.45.1 [`d2ec536`](https://github.com/opengovsg/FormSG/commit/d2ec536e5154c9459b97d6977724928dc68e2a19)
- fix: add minimal polyfill for ie11 in decryption worker [`a9d2068`](https://github.com/opengovsg/FormSG/commit/a9d2068d70c61c09910599a37bb8d5e14ead2ffc)

#### [v4.45.0](https://github.com/opengovsg/FormSG/compare/v4.44.0...v4.45.0)

Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ Run the following shell command to build the Docker image from scratch. This wil
npm run dev
```

After the Docker image has finished building, the application can be accessed at [localhost:5000](localhost:5000).

If there have been no dependency changes in `package.json` or changes in the
`src/server.ts` file, you can run

Expand All @@ -71,6 +73,10 @@ docker-compose up
which does **not** rebuild the Docker image from scratch. This command usually
only takes ~15 seconds to finish starting up the image.

### Accessing email locally

We use [MailDev](https://github.com/maildev/maildev) to access emails in the development environment. The MailDev UI can be accessed at [localhost:1080](localhost:1080) when the Docker container is running.

### Environment variables

Docker-compose looks at various places for environment variables to inject into the containers.
Expand Down Expand Up @@ -195,7 +201,7 @@ Please contact FormSG ([email protected]) for any details.

## Acknowledgements

FormSG acknowledges the work done by [Arielle Baldwynn](https://github.com/whitef0x0) to build and maintain [TellForm](https://github.com/tellform), on which FormSG is based.
FormSG acknowledges the work done by [Arielle Baldwynn](https://github.com/whitef0x0) to build and maintain [TellForm](https://github.com/tellform), on which FormSG is based.

Contributions have also been made by:
[@RyanAngJY](https://github.com/RyanAngJY)
Expand Down
10 changes: 8 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@ services:
- AWS_ENDPOINT=http://localhost:4566
- SUBMISSIONS_RATE_LIMIT=200
- SEND_AUTH_OTP_RATE_LIMIT=60
- SES_PORT=25
- SES_HOST=maildev
- GA_TRACKING_ID
- SENTRY_CONFIG_URL
- TWILIO_ACCOUNT_SID
- TWILIO_API_KEY
- TWILIO_API_SECRET
- TWILIO_MESSAGING_SERVICE_SID
- SES_HOST
- SES_PASS
- SES_USER
- SES_PORT
- OTP_LIFE_SPAN
- AWS_REGION
- GOOGLE_CAPTCHA
Expand All @@ -64,6 +64,7 @@ services:
- CORPPASS_PARTNER_ENTITY_ID
- CORPPASS_ESRVC_ID
- CORPPASS_IDP_ID
- MYINFO_FORMSG_KEY_PATH
- IS_SP_MAINTENANCE
- IS_CP_MAINTENANCE
- AGGREGATE_COLLECTION
Expand Down Expand Up @@ -112,5 +113,10 @@ services:
- './docker-entrypoint-initaws.d:/docker-entrypoint-initaws.d'
network_mode: 'service:formsg' # reuse formsg service's network stack so that it can resolve localhost:4566 to localstack:4566

maildev:
image: maildev/maildev
ports:
- '1080:80'

volumes:
mongodata:
Loading

0 comments on commit e7cc6b0

Please sign in to comment.