Skip to content

Commit

Permalink
Merge pull request #822 from jetstreamapp/docker/fix-build
Browse files Browse the repository at this point in the history
Fix docker compose process
  • Loading branch information
paustint authored Apr 6, 2024
2 parents 40f3b00 + 19d1bea commit 76f7cbf
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions apps/api/src/app/controllers/oauth.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@ const salesforceOauthCallback = createRoute(routeDefinition.salesforceOauthCallb
returnParams.message = queryParams.error_description
? (queryParams.error_description as string)
: 'There was an error authenticating with Salesforce.';
req.log.info({ ...query, requestId: res.locals.requestId }, '[OAUTH][ERROR] %s', queryParams.error);
req.log.info({ ...query, requestId: res.locals.requestId, queryParams }, '[OAUTH][ERROR] %s', queryParams.error);
return res.redirect(`/oauth-link/?${new URLSearchParams(returnParams as any).toString().replaceAll('+', '%20')}`);
} else if (!orgAuth) {
returnParams.error = 'Authentication Error';
returnParams.message = queryParams.error_description
? (queryParams.error_description as string)
: 'There was an error authenticating with Salesforce.';
req.log.info({ ...query, requestId: res.locals.requestId }, '[OAUTH][ERROR] %s', queryParams.error);
req.log.info({ ...query, requestId: res.locals.requestId, queryParams }, '[OAUTH][ERROR] Missing orgAuth from session');
return res.redirect(`/oauth-link/?${new URLSearchParams(returnParams as any).toString().replaceAll('+', '%20')}`);
}

Expand Down
2 changes: 1 addition & 1 deletion apps/api/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ if (ENV.NODE_ENV === 'production' && cluster.isPrimary) {
cookie: {
path: '/',
// httpOnly: true,
secure: environment.production,
secure: !ENV.IS_LOCAL_DOCKER && environment.production,
maxAge: 1000 * 60 * 60 * 24 * SESSION_EXP_DAYS,
// sameSite: 'strict',
},
Expand Down
5 changes: 3 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ services:
env_file:
- .env.example
environment:
NODE_ENV: production
ENVIRONMENT: production
NODE_ENV: development
ENVIRONMENT: development
IS_LOCAL_DOCKER: true
JETSTREAM_POSTGRES_DBURI: postgres://postgres:postgres@postgres:5432/postgres
EXAMPLE_USER_OVERRIDE: true
JETSTREAM_SESSION_SECRET: '123456'
Expand Down
5 changes: 3 additions & 2 deletions libs/api-config/src/lib/env-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export const ENV = {
EXAMPLE_USER_OVERRIDE: ensureBoolean(process.env.EXAMPLE_USER_OVERRIDE),
EXAMPLE_USER: process.env.EXAMPLE_USER_OVERRIDE ? EXAMPLE_USER : null,
EXAMPLE_USER_PROFILE: process.env.EXAMPLE_USER_OVERRIDE ? EXAMPLE_USER_PROFILE : null,
IS_LOCAL_DOCKER: process.env.IS_LOCAL_DOCKER || false,
// SYSTEM
NODE_ENV: process.env.NODE_ENV,
ENVIRONMENT: process.env.ENVIRONMENT || 'production',
Expand All @@ -67,10 +68,10 @@ export const ENV = {
// JETSTREAM
JETSTREAM_SERVER_DOMAIN: process.env.JETSTREAM_SERVER_DOMAIN,
// FIXME: there was a typo in env variables, using both temporarily as a safe fallback
JETSTREAM_SESSION_SECRET: process.env.JETSTREAM_SESSION_SECRET || process.env.JESTREAM_SESSION_SECRET || '',
JETSTREAM_SESSION_SECRET: process.env.JETSTREAM_SESSION_SECRET || '',
JETSTREAM_SERVER_URL: process.env.JETSTREAM_SERVER_URL,
// FIXME: there was a typo in env variables, using both temporarily as a safe fallback
JETSTREAM_POSTGRES_DBURI: process.env.JETSTREAM_POSTGRES_DBURI || process.env.JESTREAM_POSTGRES_DBURI,
JETSTREAM_POSTGRES_DBURI: process.env.JETSTREAM_POSTGRES_DBURI,
JETSTREAM_CLIENT_URL: process.env.JETSTREAM_CLIENT_URL,
JETSTREAM_WORKER_URL: process.env.JETSTREAM_WORKER_URL,
PRISMA_DEBUG: ensureBoolean(process.env.PRISMA_DEBUG),
Expand Down

0 comments on commit 76f7cbf

Please sign in to comment.