From 788754252dfddfd8afec3a22a6a274885106d0ff Mon Sep 17 00:00:00 2001 From: BatAmar Battulga Date: Sat, 4 Apr 2020 22:53:31 +0800 Subject: [PATCH 1/3] increase elksyncer bulk size --- elkSyncer/mongo-connector-config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elkSyncer/mongo-connector-config.json b/elkSyncer/mongo-connector-config.json index b31740525..c58652cea 100644 --- a/elkSyncer/mongo-connector-config.json +++ b/elkSyncer/mongo-connector-config.json @@ -1,7 +1,7 @@ { "oplogFile": "oplog.timestamp", "noDump": false, - "batchSize": 50, + "batchSize": 5000, "verbosity": 3, "continueOnError": true, "logging": { From e62b58fa8672e0c2c5d0fa6eea32cfe5cee4fb92 Mon Sep 17 00:00:00 2001 From: BatAmar Battulga Date: Sun, 5 Apr 2020 01:50:25 +0800 Subject: [PATCH 2/3] added mongo connector docker volume --- elkSyncer/Dockerfile | 7 +++++-- elkSyncer/mongo-connector-config.json | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/elkSyncer/Dockerfile b/elkSyncer/Dockerfile index 2e38c176a..1eda3d163 100644 --- a/elkSyncer/Dockerfile +++ b/elkSyncer/Dockerfile @@ -7,6 +7,9 @@ RUN pip install mongo-connector==3.1.1 \ && pip install elastic2-doc-manager==1.0.0 \ && pip install python-dotenv==0.11.0 -COPY . . +RUN mkdir /var/log/mongo-connector -CMD ["python", "main.py"] +COPY mongo-connector-config.json . +COPY main.py . + +CMD ["python", "main.py"] \ No newline at end of file diff --git a/elkSyncer/mongo-connector-config.json b/elkSyncer/mongo-connector-config.json index c58652cea..5559a15be 100644 --- a/elkSyncer/mongo-connector-config.json +++ b/elkSyncer/mongo-connector-config.json @@ -1,5 +1,5 @@ { - "oplogFile": "oplog.timestamp", + "oplogFile": "/var/log/mongo-connector/oplog.timestamp", "noDump": false, "batchSize": 5000, "verbosity": 3, From e408dcec12053231d4fe64d29cda5c4c6186ddfd Mon Sep 17 00:00:00 2001 From: Jonatan Rinckus Date: Sat, 4 Apr 2020 17:01:53 -0300 Subject: [PATCH 3/3] fix issue when no file type is specified --- src/data/utils.ts | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/data/utils.ts b/src/data/utils.ts index 86e344aa2..e659e1417 100644 --- a/src/data/utils.ts +++ b/src/data/utils.ts @@ -40,21 +40,11 @@ export const checkFile = async (file, source?: string) => { return 'Invalid file type'; } - const defaultMimeTypes = [ - 'image/png', - 'image/jpeg', - 'image/jpg', - 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', - 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', - 'application/pdf', - 'image/gif', - ]; - const UPLOAD_FILE_TYPES = await getConfig(source === 'widgets' ? 'WIDGETS_UPLOAD_FILE_TYPES' : 'UPLOAD_FILE_TYPES'); const { mime } = ft; - if (!((UPLOAD_FILE_TYPES && UPLOAD_FILE_TYPES.split(',')) || defaultMimeTypes).includes(mime)) { + if (UPLOAD_FILE_TYPES && !UPLOAD_FILE_TYPES.split(',').includes(mime)) { return 'Invalid configured file type'; }