mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Merge pull request #15 from omnivore-app/fix/simplify-puppeteer
Simplify startup of the puppeteer service
This commit is contained in:
commit
cfb2d683c9
3 changed files with 9 additions and 4 deletions
|
|
@ -57,7 +57,7 @@ services:
|
|||
- SSO_JWT_SECRET=some_sso_secret
|
||||
- CLIENT_URL=http://localhost:3000
|
||||
- GATEWAY_URL=http://localhost:8080/api
|
||||
- PUPPETEER_TASK_HANDLER_URL=http://localhost:9090/
|
||||
- PUPPETEER_TASK_HANDLER_URL=http://host.docker.internal:9090/
|
||||
- REMINDER_TASK_HANDLER_URL=/svc/reminders/trigger
|
||||
depends_on:
|
||||
migrate:
|
||||
|
|
|
|||
|
|
@ -25,8 +25,8 @@ const { pdfHandler } = require('./pdf-handler');
|
|||
const { mediumHandler } = require('./medium-handler');
|
||||
|
||||
const storage = new Storage();
|
||||
const previewBucket = storage.bucket(process.env.PREVIEW_IMAGE_BUCKET);
|
||||
const ALLOWED_ORIGINS = process.env.ALLOWED_ORIGINS.split(',');
|
||||
const ALLOWED_ORIGINS = process.env.ALLOWED_ORIGINS ? process.env.ALLOWED_ORIGINS.split(',') : [];
|
||||
const previewBucket = process.env.PREVIEW_IMAGE_BUCKET ? storage.bucket(process.env.PREVIEW_IMAGE_BUCKET) : undefined;
|
||||
|
||||
Sentry.GCPFunction.init({
|
||||
dsn: process.env.SENTRY_DSN,
|
||||
|
|
@ -402,6 +402,11 @@ exports.preview = Sentry.GCPFunction.wrapHttpFunction(async (req, res) => {
|
|||
},
|
||||
});
|
||||
|
||||
if (!process.env.PREVIEW_IMAGE_BUCKET) {
|
||||
logger.error(`PREVIEW_IMAGE_BUCKET not set`)
|
||||
return res.sendStatus(500);
|
||||
}
|
||||
|
||||
const url = getUrl(req);
|
||||
console.log('preview request url', url);
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
"@google-cloud/functions-framework": "^1.7.1"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "npx functions-framework --target=puppeteer",
|
||||
"start": "npx functions-framework --port=9090 --target=puppeteer",
|
||||
"start_preview": "npx functions-framework --target=preview",
|
||||
"test": "yarn mocha"
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue