From de8d2a5d79daca79ecd5dc6a71068c440a3e8b14 Mon Sep 17 00:00:00 2001 From: eduveks Date: Thu, 13 May 2021 18:14:02 +0000 Subject: [PATCH] =?UTF-8?q?Sess=C3=A3o=2024?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/_production.json | 72 ++++++++++++++--- config/sample.json | 95 +++++++++++++++++++++++ ui/src/components/TabelaPessoas/index.jsx | 2 +- website/build.sh | 8 ++ website/src/config-dev.json | 5 ++ website/src/config-prod.json | 5 ++ website/src/config.json | 5 ++ website/src/index.js | 4 +- 8 files changed, 184 insertions(+), 12 deletions(-) create mode 100644 config/sample.json create mode 100755 website/build.sh create mode 100644 website/src/config-dev.json create mode 100644 website/src/config-prod.json create mode 100644 website/src/config.json diff --git a/config/_production.json b/config/_production.json index 7f4dee4..4a0e688 100644 --- a/config/_production.json +++ b/config/_production.json @@ -1,7 +1,31 @@ { - "cron": {"jobs": []}, + "url": { + "admin": "/backoffice/", + "public": "/public/", + "services": "/api/" + }, + "cron": { + "secret": "VLgL7EJZ4yXPAjce", + "jobs": [ + { + "name": "daily-summary", + "config": "0 0/1 * * * ?", + "url": "/api/jobs/daily-summary" + } + ] + }, "settings": {"public": {}}, - "smtp": {}, + "smtp": { + "default": { + "enabled": true, + "host": "serua.veks.net", + "port": 465, + "ssl": true, + "from": "academy-test@netuno.org", + "username": "academy-test@netuno.org", + "password": "gDj1pwQ5T#0#" + } + }, "name": "social_ma", "setup": { "schema": { @@ -20,12 +44,40 @@ }, "locale": "pt_PT", "remote": {}, - "db": {"default": { - "password": "", - "engine": "h2", - "port": "", - "host": "", - "name": "social_ma", - "username": "" - }} + "db": { + "default": { + "password": "S3cR3t", + "engine": "pg", + "port": "5432", + "host": "localhost", + "name": "social_ma", + "username": "social_ma" + }, + "antiga": { + "password": "", + "engine": "h2", + "port": "", + "host": "", + "name": "social_ma", + "username": "" + } + }, + "jwt": { + "enabled": true, + "secret": "@X{DC5#9cuM#qG?d", + "access_expires": 60, + "refresh_expires": 1440, + "algorithm": "HS512" + }, + "openapi": { + "host": "http://social-ma.eduardo-velasques.dev.netuno.org:10080", + "basePath": "/api", + "schemes": [ "http" ], + "servers": [ + { + "url": "http://social-ma.eduardo-velasques.dev.netuno.org:10080/api", + "description": "Produção" + } + ] + } } diff --git a/config/sample.json b/config/sample.json new file mode 100644 index 0000000..1d65fd8 --- /dev/null +++ b/config/sample.json @@ -0,0 +1,95 @@ +{ + "cron": { + "secret": "VLgL7EJZ4yXPAjce", + "jobs": [ + { + "name": "daily-summary", + "config": "0 0/1 * * * ?", + "url": "/services/jobs/daily-summary" + } + ] + }, + "settings": {"public": {}}, + "smtp": { + "default": { + "enabled": true, + "host": "serua.veks.net", + "port": 465, + "ssl": true, + "from": "academy-test@netuno.org", + "username": "academy-test@netuno.org", + "password": "********" + } + }, + "name": "social_ma", + "setup": { + "schema": { + "execution": true, + "auto_create": true + }, + "scripts": {"execution": true}, + "enabled": true + }, + "language": "pt_PT", + "firebase": { + "app_name": "", + "database_url": "", + "key_file": "", + "listener_secret": "" + }, + "locale": "pt_PT", + "remote": {}, + "commands": [ + { + "path": "ui", + "command": "npm run watch", + "enabled": true + },{ + "path": "website", + "command": "npm run start", + "enabled": true + } + ], + "db": { + "default": { + "password": "S3cR3t", + "engine": "pg", + "port": "5432", + "host": "localhost", + "name": "social_ma", + "username": "social_ma" + }, + "antiga": { + "password": "", + "engine": "h2", + "port": "", + "host": "", + "name": "social_ma", + "username": "" + } + }, + "cors": [ + { + "enabled": true, + "origins": [ "http://eduardo-velasques.dev.netuno.org:10030", "http://localhost:3000", "http://127.0.0.1:3000" ] + } + ], + "jwt": { + "enabled": true, + "secret": "@X{DC5#9cuM#qG?d", + "access_expires": 60, + "refresh_expires": 1440, + "algorithm": "HS512" + }, + "openapi": { + "host": "http://eduardo-velasques.dev.netuno.org:10090", + "basePath": "/services", + "schemes": [ "http" ], + "servers": [ + { + "url": "http://eduardo-velasques.dev.netuno.org:10090/services", + "description": "Desenvolvimento Remoto" + } + ] + } +} diff --git a/ui/src/components/TabelaPessoas/index.jsx b/ui/src/components/TabelaPessoas/index.jsx index 054c11c..9fdb91b 100644 --- a/ui/src/components/TabelaPessoas/index.jsx +++ b/ui/src/components/TabelaPessoas/index.jsx @@ -23,7 +23,7 @@ const TabelaPessoas = () => { }); }; netuno.service({ - url: '/services/pessoas', + url: netuno.config.urlServices +'pessoas', method: 'GET', credentials: 'include', headers: { diff --git a/website/build.sh b/website/build.sh new file mode 100755 index 0000000..608b7ab --- /dev/null +++ b/website/build.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +cp src/config-prod.json src/config.json + +npm run build + +cp src/config-dev.json src/config.json + diff --git a/website/src/config-dev.json b/website/src/config-dev.json new file mode 100644 index 0000000..f0c00e1 --- /dev/null +++ b/website/src/config-dev.json @@ -0,0 +1,5 @@ +{ + "services": { + "url": "http://eduardo-velasques.dev.netuno.org:10090/services" + } +} \ No newline at end of file diff --git a/website/src/config-prod.json b/website/src/config-prod.json new file mode 100644 index 0000000..8ac7bf3 --- /dev/null +++ b/website/src/config-prod.json @@ -0,0 +1,5 @@ +{ + "services": { + "url": "/api" + } +} \ No newline at end of file diff --git a/website/src/config.json b/website/src/config.json new file mode 100644 index 0000000..f0c00e1 --- /dev/null +++ b/website/src/config.json @@ -0,0 +1,5 @@ +{ + "services": { + "url": "http://eduardo-velasques.dev.netuno.org:10090/services" + } +} \ No newline at end of file diff --git a/website/src/index.js b/website/src/index.js index e5db33e..b91887c 100644 --- a/website/src/index.js +++ b/website/src/index.js @@ -6,8 +6,10 @@ import reportWebVitals from './reportWebVitals'; import _service from '@netuno/service-client'; +import config from "./config.json"; + _service.config({ - prefix: 'http://eduardo-velasques.dev.netuno.org:10090/services' + prefix: config.services.url }); ReactDOM.render(