From be9ec410196f7fb09146a0c8a30d9af5bb995c2b Mon Sep 17 00:00:00 2001 From: Julian Poyourow Date: Sat, 16 May 2020 09:47:33 -0700 Subject: [PATCH 1/7] Fix print recipe logo URL --- Backend/src/views/recipe-default.pug | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Backend/src/views/recipe-default.pug b/Backend/src/views/recipe-default.pug index eea2b11be..f1e8154e6 100644 --- a/Backend/src/views/recipe-default.pug +++ b/Backend/src/views/recipe-default.pug @@ -235,7 +235,7 @@ html div(class="logo-icon") a(href=recipeURL target="_blank") div(class="bg") - img(src="/assets/imgs/logo_green.png") + img(src="https://recipesage.com/assets/imgs/logo_green.png") a(class="openInRS" href=recipeURL target="_blank") Click to Open in RecipeSage if modifiers.showPrintButton ion-icon(name="print" class="print-icon" onclick="window.print()") From ae236cc2814c00cd00cc2a3956439b5e35877ef3 Mon Sep 17 00:00:00 2001 From: Julian Poyourow Date: Sun, 17 May 2020 12:17:06 -0700 Subject: [PATCH 2/7] Simplify localdev, specify local env vars directly --- docker-compose.yml | 36 ++++++++++++++++++------------------ scripts/restore-db.sh | 3 +++ 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 6888ccd6a..db7e107df 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -39,25 +39,25 @@ services: environment: - AWS_ACCESS_KEY_ID - AWS_SECRET_ACCESS_KEY - - AWS_REGION - - AWS_BUCKET - - NODE_ENV + - AWS_REGION=us-west-2 + - AWS_BUCKET=chefbook-dev + - NODE_ENV=development - VERBOSE=false - - POSTGRES_DB - - POSTGRES_USER - - POSTGRES_PASSWORD - - POSTGRES_PORT - - POSTGRES_HOST - - POSTGRES_SSL - - POSTGRES_LOGGING + - POSTGRES_DB=recipesage_dev + - POSTGRES_USER=recipesage_dev + - POSTGRES_PASSWORD=recipesage_dev + - POSTGRES_PORT=5432 + - POSTGRES_HOST=postgres + - POSTGRES_SSL=false + - POSTGRES_LOGGING=true - GCM_KEYPAIR - SENTRY_DSN - GRIP_URL=http://pushpin:5561/ - GRIP_KEY=changeme - - ELASTIC_ENABLE - - ELASTIC_IDX_PREFIX - - ELASTIC_CONN - - ELASTIC_PASSWORD + - ELASTIC_ENABLE=true + - ELASTIC_IDX_PREFIX=rs_dev_ + - ELASTIC_CONN=http://elastic:recipesage_dev@elasticsearch:9200 + - ELASTIC_PASSWORD=recipesage_dev - STRIPE_SK - STRIPE_WEBHOOK_SECRET - BROWSERLESS_HOST=browserless @@ -70,7 +70,7 @@ services: image: docker.elastic.co/elasticsearch/elasticsearch:7.6.1 environment: - discovery.type=single-node - - ELASTIC_PASSWORD + - ELASTIC_PASSWORD=recipesage_dev ports: - 9200:9200 pushpin: @@ -85,9 +85,9 @@ services: ports: - 5432:5432 environment: - - POSTGRES_DB - - POSTGRES_USER - - POSTGRES_PASSWORD + - POSTGRES_DB=recipesage_dev + - POSTGRES_USER=recipesage_dev + - POSTGRES_PASSWORD=recipesage_dev browserless: image: browserless/chrome:1.28.0-chrome-stable environment: diff --git a/scripts/restore-db.sh b/scripts/restore-db.sh index 444a2807c..01325505a 100755 --- a/scripts/restore-db.sh +++ b/scripts/restore-db.sh @@ -1,5 +1,8 @@ #!/bin/bash +POSTGRES_USER=recipesage_dev +POSTGRES_DB=recipesage_dev + if ! [ -z "$1" ] then cp $1 restore.sql From d21cadf4b942b7c5537d7eeb8420189dc75604ca Mon Sep 17 00:00:00 2001 From: Julian Poyourow Date: Sun, 17 May 2020 12:29:06 -0700 Subject: [PATCH 3/7] Fix page preview refetch issue on render cycle --- .../recipe-preview/recipe-preview.component.html | 2 +- .../components/recipe-preview/recipe-preview.component.ts | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Frontend/src/app/components/recipe-preview/recipe-preview.component.html b/Frontend/src/app/components/recipe-preview/recipe-preview.component.html index 1f03ff228..ca77d6327 100644 --- a/Frontend/src/app/components/recipe-preview/recipe-preview.component.html +++ b/Frontend/src/app/components/recipe-preview/recipe-preview.component.html @@ -1,7 +1,7 @@
- +
{{ description }}
diff --git a/Frontend/src/app/components/recipe-preview/recipe-preview.component.ts b/Frontend/src/app/components/recipe-preview/recipe-preview.component.ts index eef0f85c8..7b712c752 100644 --- a/Frontend/src/app/components/recipe-preview/recipe-preview.component.ts +++ b/Frontend/src/app/components/recipe-preview/recipe-preview.component.ts @@ -10,7 +10,13 @@ export class RecipePreviewComponent { @Input() selected: boolean; @Input() landscape: boolean; - @Input() url: string; + + trustedPreviewSrc: SafeResourceUrl = this.sanitizer.bypassSecurityTrustResourceUrl(""); + @Input() + set url(url: string) { + this.trustedPreviewSrc = this.sanitizer.bypassSecurityTrustResourceUrl(url || ""); + } + @Input() description: string; @Output() click = new EventEmitter(); From deb26f99359d674703d3601979169c27c1fb833e Mon Sep 17 00:00:00 2001 From: Julian Poyourow Date: Sun, 17 May 2020 20:11:42 -0700 Subject: [PATCH 4/7] Cache all generic assets for 24h --- scripts/deploy/push_static_s3.sh | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/scripts/deploy/push_static_s3.sh b/scripts/deploy/push_static_s3.sh index 44275eb28..1ebc2b365 100755 --- a/scripts/deploy/push_static_s3.sh +++ b/scripts/deploy/push_static_s3.sh @@ -16,18 +16,25 @@ mkdir -p www-revhashed find www/ -regextype egrep -regex '.+\.[a-f0-9]{20}\..+' -exec mv -t www-revhashed/ -- {} + -sync_to_s3 () { - DIR=$1 - CACHE_AGE=$2 - - aws s3 sync $DIR s3://chefbook-static/frontend/$TAG/ \ - --acl public-read \ - --cache-control "Cache-Control:max-age=${CACHE_AGE}, must-revalidate" -} - -# Push to tagged path -sync_to_s3 www 600 -sync_to_s3 www-revhashed 604800 +# Time sensitive assets only +aws s3 sync www s3://chefbook-static/frontend/$TAG/ \ + --exclude "*" \ + --include "index.html" \ + --include "service-worker.js" \ + --acl public-read \ + --cache-control "max-age=600, must-revalidate" + +# General, non-revhashed frontend files - semi time sensitive +aws s3 sync www s3://chefbook-static/frontend/$TAG/ \ + --exclude "index.html" \ + --exclude "service-worker.js" \ + --acl public-read \ + --cache-control "max-age=86400, must-revalidate" + +# Revhashed files (previously copied to www-revhashed) - persist long-term +aws s3 sync www-revhashed s3://chefbook-static/frontend/$TAG/ \ + --acl public-read \ + --cache-control "max-age=604800, must-revalidate" # Push to latest (STG) aws s3 sync s3://chefbook-static/frontend/$TAG/ s3://chefbook-static/frontend/latest From 43260c0f63de297a319d52e9d132ab33c70f8b7c Mon Sep 17 00:00:00 2001 From: Julian Poyourow Date: Sun, 17 May 2020 20:46:29 -0700 Subject: [PATCH 5/7] Reduce JPEG quality for high-res image conversion --- Backend/src/services/util.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Backend/src/services/util.js b/Backend/src/services/util.js index 48f21e85c..0d06f6e29 100644 --- a/Backend/src/services/util.js +++ b/Backend/src/services/util.js @@ -77,7 +77,7 @@ const S3_DEFAULT_CACHECONTROL = 'public,max-age=31536000,immutable'; // 365 Days const HIGH_RES_IMG_CONVERSION_WIDTH = 1024; const HIGH_RES_IMG_CONVERSION_HEIGHT = 1024; -const HIGH_RES_IMG_CONVERSION_QUALITY = 85; +const HIGH_RES_IMG_CONVERSION_QUALITY = 55; const LOW_RES_IMG_CONVERSION_WIDTH = 200; const LOW_RES_IMG_CONVERSION_HEIGHT = 200; From a6bb6f7afdb77eb06d56d41509cedcafa46a8ad8 Mon Sep 17 00:00:00 2001 From: Julian Poyourow Date: Sun, 17 May 2020 20:49:41 -0700 Subject: [PATCH 6/7] Update release notes --- .../info-components/release-notes/release-notes.page.html | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Frontend/src/app/pages/info-components/release-notes/release-notes.page.html b/Frontend/src/app/pages/info-components/release-notes/release-notes.page.html index 814e339fc..766ece684 100644 --- a/Frontend/src/app/pages/info-components/release-notes/release-notes.page.html +++ b/Frontend/src/app/pages/info-components/release-notes/release-notes.page.html @@ -20,6 +20,12 @@
+ v2.4.6 - May 17, 2020
+ - Fix a bug causing print preview to flicker
+ - Improve application performance in Europe, Asia, Austrailia, and South America
+ +
+ v2.4.5 - April 30, 2020
- Fix a bug where filtering by label would not refresh label listing
- Increase session expiry to 30 days
From 7eee1333ce9b3b72cad4062a14659e679885422d Mon Sep 17 00:00:00 2001 From: Julian Poyourow Date: Sun, 17 May 2020 20:50:45 -0700 Subject: [PATCH 7/7] Linting --- .../app/components/recipe-preview/recipe-preview.component.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Frontend/src/app/components/recipe-preview/recipe-preview.component.ts b/Frontend/src/app/components/recipe-preview/recipe-preview.component.ts index 7b712c752..f84f49aa4 100644 --- a/Frontend/src/app/components/recipe-preview/recipe-preview.component.ts +++ b/Frontend/src/app/components/recipe-preview/recipe-preview.component.ts @@ -11,10 +11,10 @@ export class RecipePreviewComponent { @Input() selected: boolean; @Input() landscape: boolean; - trustedPreviewSrc: SafeResourceUrl = this.sanitizer.bypassSecurityTrustResourceUrl(""); + trustedPreviewSrc: SafeResourceUrl = this.sanitizer.bypassSecurityTrustResourceUrl(''); @Input() set url(url: string) { - this.trustedPreviewSrc = this.sanitizer.bypassSecurityTrustResourceUrl(url || ""); + this.trustedPreviewSrc = this.sanitizer.bypassSecurityTrustResourceUrl(url || ''); } @Input() description: string;