mirror of
https://github.com/dadosfera/maestro.git
synced 2026-09-17 07:04:47 +00:00
Compare commits
8
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cb98099a91 | ||
|
|
b2b7537fee | ||
|
|
01263017e7 | ||
|
|
8aded98a11 | ||
|
|
0b5a0d0d7e | ||
|
|
5a36762544 | ||
|
|
f579171024 | ||
|
|
885e5f4568 |
@@ -3,6 +3,7 @@ import { NestFactory } from '@nestjs/core';
|
|||||||
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';
|
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';
|
||||||
import helmet from 'helmet';
|
import helmet from 'helmet';
|
||||||
import { DadosferaLogger } from '@dadosfera/dadosfera-logs';
|
import { DadosferaLogger } from '@dadosfera/dadosfera-logs';
|
||||||
|
import { json, urlencoded } from 'express';
|
||||||
|
|
||||||
import { AppModule } from './app.module';
|
import { AppModule } from './app.module';
|
||||||
import { writeFileSync } from 'fs';
|
import { writeFileSync } from 'fs';
|
||||||
@@ -25,6 +26,8 @@ async function bootstrap() {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
app.use(helmet());
|
app.use(helmet());
|
||||||
|
app.use('/catalog/register-dataset', json({ limit: '10mb' }));
|
||||||
|
app.use('/catalog/register-dataset', urlencoded({ extended: true, limit: '10mb' }));
|
||||||
configureSwagger(app);
|
configureSwagger(app);
|
||||||
await app.listen(3333);
|
await app.listen(3333);
|
||||||
if (process.env.KILL_AFTER_START) await app.close();
|
if (process.env.KILL_AFTER_START) await app.close();
|
||||||
|
|||||||
@@ -45,11 +45,11 @@ export class OpenDataController {
|
|||||||
) {
|
) {
|
||||||
this.logger.info('createUser for open data' + JSON.stringify(request.headers));
|
this.logger.info('createUser for open data' + JSON.stringify(request.headers));
|
||||||
|
|
||||||
const corslist = ["https://devsbm.dadosfera.io", "https://sharingoceandata.com"];
|
// const corslist = ["https://devsbm.dadosfera.io", "https://sharingoceandata.com"];
|
||||||
if (!corslist.includes(origin)) {
|
// if (!corslist.includes(origin)) {
|
||||||
this.logger.info('block request by cors list: '+ origin);
|
// this.logger.info('block request by cors list: '+ origin);
|
||||||
throw new ForbiddenException();
|
// throw new ForbiddenException();
|
||||||
}
|
// }
|
||||||
|
|
||||||
const OPENDATA_CUSTOMER_ID = process.env.OPEN_CUSTOMER_ID;
|
const OPENDATA_CUSTOMER_ID = process.env.OPEN_CUSTOMER_ID;
|
||||||
const OPENDATA_GROUP_ID = process.env.OPEN_GROUP_ID;
|
const OPENDATA_GROUP_ID = process.env.OPEN_GROUP_ID;
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ export class PDFParser<T> implements Parser<T> {
|
|||||||
const html = await this.htmlParser.parse(data);
|
const html = await this.htmlParser.parse(data);
|
||||||
await page.setContent(html, {
|
await page.setContent(html, {
|
||||||
waitUntil: 'networkidle0',
|
waitUntil: 'networkidle0',
|
||||||
timeout: 30000,
|
timeout: 90000,
|
||||||
});
|
});
|
||||||
|
|
||||||
// Configurações adicionais para garantir um PDF válido
|
// Configurações adicionais para garantir um PDF válido
|
||||||
@@ -43,7 +43,7 @@ export class PDFParser<T> implements Parser<T> {
|
|||||||
pageRanges: '',
|
pageRanges: '',
|
||||||
tagged: true,
|
tagged: true,
|
||||||
outline: false,
|
outline: false,
|
||||||
timeout: 30000,
|
timeout: 90000,
|
||||||
});
|
});
|
||||||
|
|
||||||
await browser.close();
|
await browser.close();
|
||||||
|
|||||||
Reference in New Issue
Block a user