Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions deploy/docker-compose/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ services:
ports:
- '80:80'
- '443:443'
environment:
NGINX_WEBHOOK_SYNC_TIMEOUT: '${OPS_FLOW_TIMEOUT_SECONDS:-600}s'
volumes:
- ./${OPS_NGINX_CONFIG_FILE:-nginx.gateway.conf}:/etc/nginx/conf.d/default.conf
- ./nginx.gateway.routing.conf:/etc/nginx/includes/routing.conf
- ./nginx.gateway.routing.template:/etc/nginx/templates/gateway.routing.template
- ./tls:/etc/nginx/tls
depends_on:
openops-tables:
Expand Down Expand Up @@ -36,7 +38,7 @@ services:
image: public.ecr.aws/openops/openops-engine:${OPS_VERSION:-latest}
restart: unless-stopped
env_file: .env
command: ["cp -r /var/tmp-base/. /tmp/ && node main.js; exit $?"]
command: ['cp -r /var/tmp-base/. /tmp/ && node main.js; exit $?']
environment:
OPS_BASE_CODE_DIRECTORY: /tmp/codes
OPS_COMPONENT: engine
Expand Down Expand Up @@ -137,7 +139,7 @@ services:
volumes:
- 'redis_data:/data'
healthcheck:
test: [ 'CMD', 'redis-cli', 'ping' ]
test: ['CMD', 'redis-cli', 'ping']
interval: 5s
timeout: 3s
retries: 3
Expand Down
2 changes: 1 addition & 1 deletion deploy/docker-compose/nginx.gateway.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ server {

server_name openops;

include includes/routing.conf;
include /etc/nginx/conf.d/gateway.routing;
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,20 @@ location /openops-tables {
proxy_set_header X-Forwarded-Proto $scheme;
}

location ~ ^/api/v1/webhooks/[^/]+/sync$ {
add_header X-Frame-Options DENY;
proxy_pass http://openops-app;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;

proxy_connect_timeout ${NGINX_WEBHOOK_SYNC_TIMEOUT};
proxy_send_timeout ${NGINX_WEBHOOK_SYNC_TIMEOUT};
proxy_read_timeout ${NGINX_WEBHOOK_SYNC_TIMEOUT};
send_timeout ${NGINX_WEBHOOK_SYNC_TIMEOUT};
}

location /.well-known/acme-challenge/ {
root /etc/nginx/tls/acme;
}
2 changes: 1 addition & 1 deletion deploy/docker-compose/nginx.gateway.tls.conf
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ server {

add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;

include includes/routing.conf;
include /etc/nginx/conf.d/gateway.routing;
}

server {
Expand Down
37 changes: 21 additions & 16 deletions packages/blocks/microsoft-outlook/src/lib/triggers/new-email.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
TriggerStrategy,
createTrigger,
} from '@openops/blocks-framework';
import { logger } from '@openops/server-shared';
import { isEmpty, isString } from '@openops/shared';
import dayjs from 'dayjs';
import { microsoftOutlookAuth } from '../common/auth';
Expand Down Expand Up @@ -166,22 +167,26 @@ const polling: Polling<
> = {
strategy: DedupeStrategy.TIMEBASED,
items: async ({ auth, lastFetchEpochMS, propsValue }) => {
const client = await createGraphClient(auth.access_token);

const messages = await fetchMessages(
client,
propsValue['mailBox'] as string,
lastFetchEpochMS,
);

const filteredMessages = messages.filter((message) =>
applyClientSideFilters(message, propsValue),
);

return filteredMessages.map((message) => ({
epochMilliSeconds: dayjs(message.receivedDateTime).valueOf(),
data: message,
}));
try {
const client = await createGraphClient(auth.access_token);

const messages = await fetchMessages(
client,
propsValue['mailBox'] as string,
lastFetchEpochMS,
);

const filteredMessages = messages.filter((message) =>
applyClientSideFilters(message, propsValue),
);
return filteredMessages.map((message) => ({
epochMilliSeconds: dayjs(message.receivedDateTime).valueOf(),
data: message,
}));
} catch (e) {
logger.error(e, 'THE NEW EMAIL ERROR');
throw e;
}
},
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export async function extractPayloads(
handleFailureFlow(flowVersion, projectId, engineToken, true);
return result.output as unknown[];
} else {
logger.error('THE RESULT IS:', JSON.stringify(result));
logger.error(
{
result,
Expand Down
Loading