forked from bloom-housing/bloom
-
Notifications
You must be signed in to change notification settings - Fork 2
Feat/tf to cdk #1425
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
Open
gbbayareametro
wants to merge
222
commits into
main
Choose a base branch
from
feat/tf_to_cdk
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Feat/tf to cdk #1425
Changes from all commits
Commits
Show all changes
222 commits
Select commit
Hold shift + click to select a range
c754137
feat: adding entrypoint
gbbayareametro 3e43ae2
fix: fixing copy command
gbbayareametro 9f15ba4
feat: modifying for cdk build
gbbayareametro 7216f9d
fix: static database name
gbbayareametro ab30418
fix: fixing database url
gbbayareametro 1421c43
fix: adding dbname
gbbayareametro c404207
fix: pgdatabase
gbbayareametro 2fb2d2b
fix: chowning
gbbayareametro 1c66351
fix: chown
gbbayareametro 48fcbf5
fix: fixing entrypoints
gbbayareametro f21478f
fix: changing migration command
gbbayareametro d7e43a1
feat: cdk pipeline
gbbayareametro a825e3b
Merge branch 'main' into feat/tf_to_cdk
gbbayareametro 6066639
feat: adding migration
gbbayareametro 2e016db
fix: trying with migrate.yml temporarily
gbbayareametro 38702cb
fix: fixing migrate.yml
gbbayareametro ff1cfe8
fix: moving build role to the stack
gbbayareametro d67cb1f
fix: another buildrole move
gbbayareametro 4f4054f
feat: api service build
gbbayareametro b798544
fix: adding to pipeline
gbbayareametro e7eaa95
fix: fixing some env variable issues.
gbbayareametro 3e14186
fix: modifying migration commands
gbbayareametro e6e755f
fix: switching to stop backend
gbbayareametro 893fa79
fix: putting ECS Restart back in
gbbayareametro 9094671
fix: different db entrypoint
gbbayareametro a361871
fix: another entrypoint change
gbbayareametro 9af7e42
fix: api service
gbbayareametro d68d18a
fix: removing config source
gbbayareametro f33a500
feat adding serviceconnect
gbbayareametro 0d73659
fix: dupe log group name
gbbayareametro ddd9fb6
fix: port mapping name
gbbayareametro e1a9dcc
fix: removing role
gbbayareametro ce0bb0b
fix: creating role for serviceconnect
gbbayareametro cd26082
fix: changing role name
gbbayareametro 9fbf27d
fix: formatting
gbbayareametro f9015d1
fix: adding dependency on namespace
gbbayareametro 9bef54a
fix: granting access to private ca
gbbayareametro 09079ab
fix: fixing policy document
gbbayareametro ba34962
fix: adding api key back
gbbayareametro ad783a0
adding public site
gbbayareametro d5d1ac2
fix: fixing compile errors
gbbayareametro c95e9a5
feat: reconfiguring services
gbbayareametro 4ec4453
fix: using git commit hash for container name
gbbayareametro a147913
feat: load balancer setup
gbbayareametro 2b2550c
feat: more load balancer enhancements
gbbayareametro c607fd1
changing api to backend
gbbayareametro e0f08fd
fix: adding arecord
gbbayareametro 2b938fd
fix: duplicate zones
gbbayareametro cc8ee5e
fix: local synth issues
gbbayareametro 4843935
Merge branch 'main' into feat/tf_to_cdk
gbbayareametro a287e09
fix: changing serviceconnect protocol
gbbayareametro d899fbc
fix: changing port in backend definition
gbbayareametro 12c705c
fix: fixing secrets
gbbayareametro 11a35d5
fix: govdelivery url
gbbayareametro baea7bc
fix: granting proper sg access
gbbayareametro d4b63f6
fix: renaming secrets location
gbbayareametro ca69dde
feat: adding restart lambdas
gbbayareametro 9e84c18
fix: SecretStringChanged
gbbayareametro 64d3633
fix: event pattern detail
gbbayareametro 67a396a
fix: don't need to put a list in a list!
gbbayareametro 9aaff39
fix: Pipeline takes public and partners sites based on environments
gbbayareametro bcddf1d
fix: common lambda creation for all services
gbbayareametro 355cd23
fix: trying with secret name
gbbayareametro ca374d2
fix: fixing docker tags
gbbayareametro 0321391
fix: pipeline and dockertag fixes
gbbayareametro 053eb99
fix: sigh more docker fixes
gbbayareametro 063bd3a
fix: trying to trick codebuild into thinking something changed
gbbayareametro 27b61cc
fix: lost quote
gbbayareametro 331a3c5
fix: another attempt to fire it
gbbayareametro 73d32a4
feat: adding partners site
gbbayareametro e796750
fix: adding parners portal to lb
gbbayareametro 088f268
fix: duplicate name
gbbayareametro 0c3b53a
fix: dev2 url
gbbayareametro e0bc5ba
fix: new event format
gbbayareametro 863539b
fix: serviceprincipal addition of events
gbbayareametro 34459a2
fix: cert validation
gbbayareametro ce42e13
fix: role setup mixup
gbbayareametro 148121a
fix: cert issues
gbbayareametro 8aec176
fix: reverting back to original arn pattern
gbbayareametro 98101ee
fix: duplicate target groups
gbbayareametro ce304e9
fix: trying with secret prefix
gbbayareametro 7ef8a91
fix: sigh...another missed public-partners
gbbayareametro 0fa037a
fix: dealing with empty secrets set
gbbayareametro 5bb3b4c
fix: no cors origins in env file
gbbayareametro f28c074
fix: debugging origin
gbbayareametro 90ddd80
fix: trying with logger
gbbayareametro a3026e1
fix: using nestjs logger
gbbayareametro 90a8004
fix: another debugging attempt
gbbayareametro a08e708
fix: origins and docker versioning changes
gbbayareametro 6106b48
fix: moving serviceconnect logs out of main log group
gbbayareametro ff3788e
fix: yet more debugging
gbbayareametro 0e02968
fix: more time in debugging hell
gbbayareametro 7c4a7ef
fix trying with DISABLE_CORS again
gbbayareametro 6663ce2
fix: ok lets try this the ham handed way
gbbayareametro dff3cf6
fix: changing db migration to reseed
gbbayareametro 89aea6e
fix: turning off cors disable
gbbayareametro edaed26
fix: renaming services for dbmigrat
gbbayareametro 7aa581d
fix: applying migration cmd
gbbayareametro 8d390e8
fix: trying with entrypoint
gbbayareametro 1658883
fix: reverting to old format
gbbayareametro 3567b3a
fixing docker cmd
gbbayareametro ec37db2
trying to get back to initial docker build for migration
gbbayareametro df1e51c
fix: changing db url
gbbayareametro 2122d6b
fix: hard coding port
gbbayareametro 10c64c8
fix: temporary image change
gbbayareametro 2b46779
fix: moving secrets stuff to main
gbbayareametro 49fe109
fix: missing bracket
gbbayareametro 541a98f
fix: update migrate.yml
gbbayareametro 66e61e7
fix: debugging
gbbayareametro e849636
fix: more debugging
gbbayareametro 6277b13
fix: trying without DATABASE_URL
gbbayareametro ec85867
yet another attempt
gbbayareametro 525926c
fix: once more
gbbayareametro 5bb4144
fix: lets do this bad boy
gbbayareametro 53fdf8c
fix: adding the entrypoint run
gbbayareametro cefec6a
fix: missed one
gbbayareametro 8d258d8
fix: moving commands around
gbbayareametro d036911
fix: more moving
gbbayareametro 6129a24
moving prisma generate
gbbayareametro fb3e9a2
fix: debugging docker
gbbayareametro a2f803f
fix: encoding password
gbbayareametro a078402
getting rid of API key
gbbayareametro 5caeda1
fix: moving things around and fixing PGPORT
gbbayareametro c73ce2c
fix: fixing cruft from moving things around
gbbayareametro 14937ac
fix: fixing migrate dockerfile
gbbayareametro fd5ac03
fix: more debugging
gbbayareametro feda3a2
fix: tweeking CORS settings
gbbayareametro 78202b5
fix: samesite lax
gbbayareametro aaf52e3
fix: more more debugging
gbbayareametro e1903e2
fix: changing cookiedomain to localhost
gbbayareametro 6582c9a
fix: bad env variable
gbbayareametro 6aefb6d
changing -c to entrypoint
gbbayareametro 959fee7
fix: more debugging
gbbayareametro 33ee012
fix: changing entrypoint
gbbayareametro e643be8
fix: trying without the command line parm
gbbayareametro 5dff329
fix: fixing entrypoint
gbbayareametro b1b1901
fix: trying another edit of the script
gbbayareametro 7afff4d
fix: more futzing with the entrypoint
gbbayareametro 3ab60b8
fix: adding debug logging
gbbayareametro f4b4f16
fix: more debugging!
gbbayareametro 438ce6d
fix: running a test
gbbayareametro 61d05e4
fix: another test
gbbayareametro 8692717
fix: caching pipeline
gbbayareametro 9a96489
fix: removing line
gbbayareametro f0abcb6
fix: removing more code
gbbayareametro 6c80363
fix: adding dbmigrate back
gbbayareametro f2cfad7
fix: fixing buildspec
gbbayareametro fd5cbf9
fix: adding migration cmd
gbbayareametro dbbc7c1
fix: missed quote
gbbayareametro 646945f
fix: hard coding entrypoint
gbbayareametro e5f7429
fix: trying with script
gbbayareametro 209a182
fix: fixing migrate entrypoint and some echoing in the run script
gbbayareametro 4061a4a
fix: setting db url in entrypoint
gbbayareametro e8ddef1
fix: accidental newline
gbbayareametro d8651e6
fix: adding backend api base
gbbayareametro 768c532
fix: removing ecs interdependencies
gbbayareametro ee6ca59
fix: style change
gbbayareametro 1b8305a
fix: adding more environment variables
gbbayareametro 9e48bce
fix: dbmigrate role fixes and backend api variable change
gbbayareametro 1fb55ab
feat: adding cloudfront
gbbayareametro e0bb907
feat: moving s3 stack
gbbayareametro c0b9fb7
fix: adding access
gbbayareametro b310885
fix: adding cert and georestriction
gbbayareametro 5df953b
fix: pipeline fixes
gbbayareametro 8544173
fix: make api dependent on s3 stack
gbbayareametro 6d6628b
fix: Yay!
gbbayareametro 3671bf9
fix: pointing dns at cloudfront
gbbayareametro 2c03674
fix: re-adding migrate
gbbayareametro a6a0d38
Merge branch 'main' into feat/tf_to_cdk
gbbayareametro b1624b3
fix: removing secret field names
gbbayareametro ed2b929
fix: change namespace name to something more generic
gbbayareametro 818e253
fix: fixing log group and cloudfront origin
gbbayareametro 0f5aa01
fix: changing origin request policy
gbbayareametro ab93521
fix: fixing namespace
gbbayareametro 687a0fa
fix: cache policy
gbbayareametro 76b7a35
fix: autoscaling
gbbayareametro 54231f9
feat: private lb
gbbayareametro 290a2cd
removing serviceconnect
gbbayareametro 55547f7
moving lb to app subnets
gbbayareametro c8a4e25
fix: cdk issues
gbbayareametro 0e14a64
feat: going to https
gbbayareametro ef47682
fix: sigh....can't use https
gbbayareametro 1dc286f
fix: adding dbmigrate back
gbbayareametro 6e5ca7e
Merge branch 'main' into feat/tf_to_cdk
gbbayareametro 504e68c
feat: adding secrets to env deploy
gbbayareametro ad43ccf
fix: dependency fix
gbbayareametro d0431cc
fix. renaming application stack
gbbayareametro edfb3c6
fix: changing cloudfront definition
gbbayareametro 09769b2
feat: import listings task
gbbayareametro 5e77134
fix: reduce cpu size for listings import
gbbayareametro e37a0a6
fix: cpu definition and name
gbbayareametro 02395eb
feat: adding jsdoc comments
gbbayareametro e3c634a
fix: role for scheduler with run task grants
gbbayareametro 8c22182
fix: going with autogenerated schedule name
gbbayareametro d2af01a
feat: adding staging
gbbayareametro 7edd079
fix: fixing duplicate names
gbbayareametro 273696d
fix: CPU-> CPUS
gbbayareametro b03a40c
fix: fixing roles
gbbayareametro 924910f
fix: grants
gbbayareametro 2950826
fix: env variable fix
gbbayareametro eb516c4
fix: import listings s/b run candidate
gbbayareametro 0c451da
fix: import listings
gbbayareametro 3a7bd6f
fix: dotenv madness
gbbayareametro 2f9ba3c
fix: wrong api url
gbbayareametro 17455e9
fix: switching to ssm parameters for lb dns name
gbbayareametro f49b502
Merge branch 'main' into feat/tf_to_cdk
gbbayareametro 4d66146
fix: going with dev for env name but keeping dev2 urls. Plus fixing c…
gbbayareametro f271f1c
fix: back to dev2
gbbayareametro 52e5135
fix: adding cloudfront
gbbayareametro da97604
fix: bad env variable in build
gbbayareametro eba1b85
fix: prod!
gbbayareametro 92f44d6
fix: dev2->dev
gbbayareametro 4a54f54
fix: temporarily remove db migrate
gbbayareametro bc35592
fix: adding dev dbmigrate back
gbbayareametro e4a9e27
fix: correcting url issues
gbbayareametro b617e14
feat: make ses region configurable
gbbayareametro 1b50ff9
add additional logging (#1429)
ludtkemorgan 0c559a3
fix: switch log from console to logger (#1430)
ludtkemorgan f700a88
fix: try some more logging
ludtkemorgan 672189e
fix: switch to serversideprops
ludtkemorgan 1f19d49
fix: accidental s removed
ludtkemorgan 382e0fc
Merge branch 'main' into feat/tf_to_cdk
gbbayareametro File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| { | ||
| "singleQuote": false, | ||
| "trailingComma": "es5", | ||
| "semi": false, | ||
| "printWidth": 100 | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| *out | ||
| *logs | ||
| *actions | ||
| *notifications | ||
| *tools | ||
| plugins | ||
| user_trunk.yaml | ||
| user.yaml | ||
| tmp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| # Following source doesn't work in most setups | ||
| ignored: | ||
| - SC1090 | ||
| - SC1091 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| # Prettier friendly markdownlint config (all formatting rules disabled) | ||
| extends: markdownlint/style/prettier |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| enable=all | ||
| source-path=SCRIPTDIR | ||
| disable=SC2154 | ||
|
|
||
| # If you're having issues with shellcheck following source, disable the errors via: | ||
| # disable=SC1090 | ||
| # disable=SC1091 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| rules: | ||
| quoted-strings: | ||
| required: only-when-needed | ||
| extra-allowed: ["{|}"] | ||
| key-duplicates: {} | ||
| octal-values: | ||
| forbid-implicit-octal: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| export default { | ||
| plugins: [ | ||
| { | ||
| name: "preset-default", | ||
| params: { | ||
| overrides: { | ||
| removeViewBox: false, // https://github.com/svg/svgo/issues/1128 | ||
| sortAttrs: true, | ||
| removeOffCanvasPaths: true, | ||
| }, | ||
| }, | ||
| }, | ||
| ], | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| # This file controls the behavior of Trunk: https://docs.trunk.io/cli | ||
| # To learn more about the format of this file, see https://docs.trunk.io/reference/trunk-yaml | ||
| version: 0.1 | ||
| cli: | ||
| version: 1.24.0 | ||
| # Trunk provides extensibility via plugins. (https://docs.trunk.io/plugins) | ||
| plugins: | ||
| sources: | ||
| - id: trunk | ||
| ref: v1.7.1 | ||
| uri: https://github.com/trunk-io/plugins | ||
| # Many linters and tools depend on runtimes - configure them here. (https://docs.trunk.io/runtimes) | ||
| runtimes: | ||
| enabled: | ||
| - go@1.21.0 | ||
| - node@22.16.0 | ||
| - python@3.10.8 | ||
| # This is the section where you manage your linters. (https://docs.trunk.io/check/configuration) | ||
| lint: | ||
| enabled: | ||
| - actionlint@1.7.7 | ||
| - checkov@3.2.457 | ||
| - eslint@8.57.0 | ||
| - git-diff-check | ||
| - hadolint@2.12.1-beta | ||
| - markdownlint@0.45.0 | ||
| - osv-scanner@2.0.3 | ||
| - oxipng@9.1.5 | ||
| - prettier@3.6.2 | ||
| - shellcheck@0.10.0 | ||
| - shfmt@3.6.0 | ||
| - svgo@4.0.0 | ||
| - taplo@0.9.3 | ||
| - trufflehog@3.90.2 | ||
| - yamllint@1.37.1 | ||
| actions: | ||
| disabled: | ||
| - trunk-announce | ||
| - trunk-check-pre-push | ||
| - trunk-fmt-pre-commit | ||
| enabled: | ||
| - trunk-upgrade-available |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,34 +1,31 @@ | ||
| import * as aws from '@aws-sdk/client-sesv2'; | ||
| import { HttpService } from '@nestjs/axios'; | ||
| import { Inject, Injectable, Logger } from '@nestjs/common'; | ||
| import { ConfigService } from '@nestjs/config'; | ||
| import { HttpService } from '@nestjs/axios'; | ||
| import { | ||
| LanguagesEnum, | ||
| ListingEventsTypeEnum, | ||
| ReviewOrderTypeEnum, | ||
| } from '@prisma/client'; | ||
| import dayjs from 'dayjs'; | ||
| import advanced from 'dayjs/plugin/advancedFormat'; | ||
| import tz from 'dayjs/plugin/timezone'; | ||
| import utc from 'dayjs/plugin/utc'; | ||
| import fs from 'fs'; | ||
| import Handlebars from 'handlebars'; | ||
| import juice from 'juice'; | ||
| import Polyglot from 'node-polyglot'; | ||
| import { firstValueFrom } from 'rxjs'; | ||
| import path from 'path'; | ||
| import dayjs from 'dayjs'; | ||
| import utc from 'dayjs/plugin/utc'; | ||
| import tz from 'dayjs/plugin/timezone'; | ||
| import advanced from 'dayjs/plugin/advancedFormat'; | ||
| import * as aws from '@aws-sdk/client-sesv2'; | ||
| import { TranslationService } from './translation.service'; | ||
| import { JurisdictionService } from './jurisdiction.service'; | ||
| import { firstValueFrom } from 'rxjs'; | ||
| import { ApplicationCreate } from '../dtos/applications/application-create.dto'; | ||
| import { Jurisdiction } from '../dtos/jurisdictions/jurisdiction.dto'; | ||
| import { | ||
| LanguagesEnum, | ||
| ListingEventsTypeEnum, | ||
| ReviewOrderTypeEnum, | ||
| } from '@prisma/client'; | ||
| import { IdDTO } from '../dtos/shared/id.dto'; | ||
| import { Listing } from '../dtos/listings/listing.dto'; | ||
| import { ApplicationCreate } from '../dtos/applications/application-create.dto'; | ||
| import { User } from '../dtos/users/user.dto'; | ||
| import { IdDTO } from '../dtos/shared/id.dto'; | ||
| import Unit from '../dtos/units/unit.dto'; | ||
| import { User } from '../dtos/users/user.dto'; | ||
| import { getPublicEmailURL } from '../utilities/get-public-email-url'; | ||
|
|
||
| dayjs.extend(utc); | ||
| dayjs.extend(tz); | ||
|
Comment on lines
-30
to
-31
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. question: is there a reason these lines were deleted? We added these to add additional options for dayjs |
||
| import { JurisdictionService } from './jurisdiction.service'; | ||
| import { TranslationService } from './translation.service'; | ||
| dayjs.extend(advanced); | ||
|
|
||
| type listingInfo = { | ||
|
|
@@ -53,7 +50,7 @@ export class EmailService { | |
| private logger = new Logger(EmailService.name), | ||
| ) { | ||
| const sesClient = new aws.SESv2Client({ | ||
| region: process.env.AWS_REGION, | ||
| region: process.env.SES_REGION || process.env.AWS_REGION, | ||
| }); | ||
|
|
||
| this.client = sesClient; | ||
|
|
@@ -138,7 +135,7 @@ export class EmailService { | |
|
|
||
| // juice inlines css to allow for email styling | ||
| const inlineHtml = juice(rawHtml); | ||
| const govEmailXml = `<bulletin>\n <subject>${subject}</subject>\n <body><![CDATA[\n | ||
| const govEmailXml = `<bulletin>\n <subject>${subject}</subject>\n <body><![CDATA[\n | ||
| ${inlineHtml}\n ]]></body>\n <sms_body nil='true'></sms_body>\n <from_address_id>${fromEmailAddress}</from_address_id>\n <publish_rss type='boolean'>false</publish_rss>\n <open_tracking type='boolean'>true</open_tracking>\n <click_tracking type='boolean'>true</click_tracking>\n <share_content_enabled type='boolean'>true</share_content_enabled>\n <topics type='array'>\n <topic>\n <code>${GOVDELIVERY_TOPIC}</code>\n </topic>\n </topics>\n <categories type='array' />\n </bulletin>`; | ||
|
|
||
| await firstValueFrom( | ||
|
|
@@ -177,8 +174,8 @@ export class EmailService { | |
| }, | ||
| Text: mailOptions.text | ||
| ? { | ||
| Data: mailOptions.text, | ||
| } | ||
| Data: mailOptions.text, | ||
| } | ||
| : undefined, | ||
| }, | ||
| }, | ||
|
|
@@ -659,9 +656,8 @@ export class EmailService { | |
| ); | ||
| tableRows.push({ | ||
| label: this.polyglot.t(`rentalOpportunity.${key}`), | ||
| value: `${bedroom?.length} unit${ | ||
| bedroom.length > 1 ? 's' : '' | ||
| }${bathroomstring}${sqFtString}`, | ||
| value: `${bedroom?.length} unit${bedroom.length > 1 ? 's' : '' | ||
| }${bathroomstring}${sqFtString}`, | ||
| }); | ||
| }); | ||
| if (units?.rent?.length) { | ||
|
|
@@ -854,9 +850,8 @@ export class EmailService { | |
| formatPricing = (values: number[]): string => { | ||
| const minPrice = Math.min(...values); | ||
| const maxPrice = Math.max(...values); | ||
| return `$${minPrice.toLocaleString()}${ | ||
| minPrice !== maxPrice ? ' - $' + maxPrice.toLocaleString() : '' | ||
| } per month`; | ||
| return `$${minPrice.toLocaleString()}${minPrice !== maxPrice ? ' - $' + maxPrice.toLocaleString() : '' | ||
| } per month`; | ||
| }; | ||
|
|
||
| formatUnitDetails = ( | ||
|
|
@@ -874,9 +869,8 @@ export class EmailService { | |
| if (mappedField?.length) { | ||
| const minValue = Math.min(...mappedField); | ||
| const maxValue = Math.max(...mappedField); | ||
| return `, ${minValue.toLocaleString()}${ | ||
| minValue !== maxValue ? ' - ' + maxValue.toLocaleString() : '' | ||
| } ${pluralLabel && maxValue === 1 ? pluralLabel : label}`; | ||
| return `, ${minValue.toLocaleString()}${minValue !== maxValue ? ' - ' + maxValue.toLocaleString() : '' | ||
| } ${pluralLabel && maxValue === 1 ? pluralLabel : label}`; | ||
| } | ||
| return ''; | ||
| }; | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| #!/bin/sh | ||
| # Debug the individual secret values | ||
| echo "PGUSER: $PGUSER" | ||
| echo "PGHOST: $PGHOST" | ||
| echo "PGPORT: $PGPORT" | ||
| echo "PGDATABASE: $PGDATABASE" | ||
| echo "PGPASSWORD length: ${#PGPASSWORD}" | ||
|
|
||
| # Validate port is numeric | ||
| if ! echo "$PGPORT" | grep -qE '^[0-9]+$'; then | ||
| echo "ERROR: PGPORT is not a valid number: '$PGPORT'" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # URL encode the password to handle special characters | ||
| ENCODED_PASSWORD=$(node -e "console.log(encodeURIComponent('$PGPASSWORD'))") | ||
|
|
||
| export DATABASE_URL="postgresql://${PGUSER}:${ENCODED_PASSWORD}@${PGHOST}:${PGPORT}/${PGDATABASE}" | ||
| echo "DATABASE_URL (password masked): postgresql://${PGUSER}:***@${PGHOST}:${PGPORT}/${PGDATABASE}" | ||
|
|
||
|
|
||
| if [ "$SKIP_MIGRATIONS" = TRUE ];then | ||
| echo "Skipping Migrations" | ||
| yarn db:migration:skip 00_init || true && yarn db:migration:skip 02_hba_to_prisma || true && yarn db:migration:skip 03_0_external_listing || true && yarn db:migration:run; | ||
| else | ||
| echo "Running migrations...${MIGRATION_CMD}"; | ||
| yarn ${MIGRATION_CMD}; | ||
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| #!/bin/sh | ||
|
|
||
| # Debug the individual secret values | ||
| echo "PGUSER: $PGUSER" | ||
| echo "PGHOST: $PGHOST" | ||
| echo "PGPORT: $PGPORT" | ||
| echo "PGDATABASE: $PGDATABASE" | ||
| echo "PGPASSWORD length: ${#PGPASSWORD}" | ||
|
|
||
| # Validate port is numeric | ||
| if ! echo "$PGPORT" | grep -qE '^[0-9]+$'; then | ||
| echo "ERROR: PGPORT is not a valid number: '$PGPORT'" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # URL encode the password to handle special characters | ||
| ENCODED_PASSWORD=$(node -e "console.log(encodeURIComponent('$PGPASSWORD'))") | ||
|
|
||
| export DATABASE_URL="postgresql://${PGUSER}:${ENCODED_PASSWORD}@${PGHOST}:${PGPORT}/${PGDATABASE}" | ||
| echo "DATABASE_URL (password masked): postgresql://${PGUSER}:***@${PGHOST}:${PGPORT}/${PGDATABASE}" | ||
|
|
||
| echo "Starting Service..." | ||
| yarn start:prod |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| *.js | ||
| !jest.config.js | ||
| *.d.ts | ||
| node_modules | ||
|
|
||
| # CDK asset staging directory | ||
| .cdk.staging | ||
| cdk.out |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| *.ts | ||
| !*.d.ts | ||
|
|
||
| # CDK asset staging directory | ||
| .cdk.staging | ||
| cdk.out |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| # Doorway App CDK Project | ||
|
|
||
| This project uses [CDK](https://aws.amazon.com/cdk/) to deploy the ECS tasks and services to AWS. This presumes that you have already deployed [doorway-infra](https://github.com/metrotranscom/doorway-infra) to the environment. | ||
|
|
||
| The `cdk.json` file tells the CDK Toolkit how to execute your app. | ||
|
|
||
| # Necessary workstation setup | ||
|
|
||
| You will need the following things set up before you work with the code in this repo: | ||
|
|
||
| - A Typescript IDE like VS Code. | ||
| - NodeJS - currently version 22 - I reccomend using [NVM](https://github.com/nvm-sh/nvm). | ||
| - The [AWS CLI](https://aws.amazon.com/cli/). | ||
| - The [AWS CDK](https://docs.aws.amazon.com/cdk/v2/guide/getting-started.html) | ||
| - [Yarn](https://yarnpkg.com/) | ||
|
|
||
| ## Useful commands | ||
|
|
||
| - `yarn test` Perform the jest unit tests. | ||
| - `cdk synth` emits the synthesized CloudFormation template. This is also good to use on your local | ||
| workstation to make sure your CDK code hangs together. **This doesn't touch the actual AWS | ||
| infrastructure.** | ||
| - `cdk deploy DoorwayBuildPipelineStack` This deploys the Doorway application delivery pipeline. **This impacts AWS and will only work if you have the proper access and have configured your AWS credentials file.** | ||
| - `cdk deploy DoorwayAppEnvironmentStack` This deploys a Doorway application. You will likely need to be an AWS admin to run this. You will also need to set an an environment variable named ENVIRONMENT. and a ".env" file named [$ENVIRONMENT].env for the scriot to load. **This impacts AWS and will only work if you have the proper access and have configured your AWS credentials file.** | ||
| - `cdk diff` compare deployed stack with current state | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| import * as cdk from "aws-cdk-lib" | ||
| import { DoorwayBuildPipelineStack } from "../lib/build-pipeline/doorway-build-pipeline-stack" | ||
| import { DoorwayAppEnvironmentStack } from "../lib/doorway_environment/doorway-app-environment-stack" | ||
| import { DoorwayCloudFrontStack } from "../lib/doorway_environment/doorway-cloudfront-stack" | ||
|
|
||
| /** | ||
| * This script is really just a wrapper to execute the various | ||
| * stacks that make up the Doorway Application infrastructure and build pipeline. | ||
| **/ | ||
| const app = new cdk.App() | ||
| const environment = process.env.ENVIRONMENT || "dev" | ||
|
|
||
|
|
||
| /** This stack creates the doorway application build pipeline **/ | ||
| new DoorwayBuildPipelineStack(app, "DoorwayBuildPipelineStack", { | ||
| githubSecret: "mtc/githubSecret", | ||
| dockerHubSecret: "mtc/dockerHub", | ||
| }) | ||
| /** This stack actually creates a doorway environment. */ | ||
| const appStack = new DoorwayAppEnvironmentStack(app, `DoorwayAppEnvironmentStack-${environment}`, environment) | ||
|
|
||
| /** This stack creates the cert used by the cloudfront distribution. It sits in it's own stack because cloudfront certs have to be created in us-east-1 **/ | ||
| const cfCertStack = new DoorwayCloudFrontStack(app, `DoorwayCloudFrontStack-${environment}`, { | ||
| environment: environment, | ||
| publicDomainName: process.env.PUBLIC_PORTAL_DOMAIN || `${environment}.housingbayarea.mtc.ca.gov`, | ||
| partnersDomainName: process.env.PARTNERS_PORTAL_DOMAIN || `partners.${environment}.housingbayarea.mtc.ca.gov`, | ||
| loadBalancerDnsName: appStack.loadBalancerDnsName | ||
| }) | ||
|
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: we usually use ESLint as our linter, do we need both prettier and eslimnt?