Skip to content

Commit

Permalink
Merge pull request #504 from julianpoy/tweaks
Browse files Browse the repository at this point in the history
Tweaks
  • Loading branch information
julianpoy authored May 18, 2020
2 parents 2313826 + 1dd8702 commit ac886c0
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 34 deletions.
2 changes: 1 addition & 1 deletion Backend/src/services/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Backend/src/views/recipe-default.pug
Original file line number Diff line number Diff line change
Expand Up @@ -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()")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="template"
[ngClass]="{ selected: selected, landscape: landscape }"
(click)="onClick($event)">
<iframe id="{{ selected ? 'selectedTemplateFrame' : '' }}" class="template-frame" scrolling="no" [src]="sanitizer.bypassSecurityTrustResourceUrl(url)"></iframe>
<iframe id="{{ selected ? 'selectedTemplateFrame' : '' }}" class="template-frame" scrolling="no" [src]="trustedPreviewSrc"></iframe>
<div class="overlay"></div>
<div class="description">{{ description }}</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@

<br />

<b>v2.4.6</b> - May 17, 2020<br />
- Fix a bug causing print preview to flicker<br />
- Improve application performance in Europe, Asia, Austrailia, and South America<br />

<br />

<b>v2.4.5</b> - April 30, 2020<br />
- Fix a bug where filtering by label would not refresh label listing<br />
- Increase session expiry to 30 days<br />
Expand Down
36 changes: 18 additions & 18 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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:
Expand Down
31 changes: 19 additions & 12 deletions scripts/deploy/push_static_s3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 "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
Expand Down
3 changes: 3 additions & 0 deletions scripts/restore-db.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/bash

POSTGRES_USER=recipesage_dev
POSTGRES_DB=recipesage_dev

if ! [ -z "$1" ]
then
cp $1 restore.sql
Expand Down

0 comments on commit ac886c0

Please sign in to comment.