varios cambios

This commit is contained in:
Vicente Falco 2017-07-11 09:36:11 +02:00
parent bbd09b3d36
commit f1fda284cb
8 changed files with 78 additions and 9 deletions

View File

@ -0,0 +1,9 @@
{
"name": "MailServer",
"version": "1.0.0",
"port": 3003,
"debug": true,
"defaultLanguage": "es",
"senderMail": "noreply@localhost",
"senderName": ""
}

View File

@ -0,0 +1,7 @@
{
"host": "localhost",
"port": 3306,
"user": "reports",
"password": "",
"database": ""
}

View File

@ -0,0 +1,12 @@
{
"host": "localhost",
"port": 465,
"secure": true,
"auth": {
"user": "noreply",
"pass": ""
},
"tls": {
"rejectUnauthorized": false
}
}

View File

@ -1,5 +1,4 @@
var path = require('path'); var path = require('path');
/** /**
* Módulo de configuración * Módulo de configuración
*/ */
@ -18,7 +17,6 @@ module.exports = {
return require(path.join(__dirname, 'config', `${name}.${env}.json`)); return require(path.join(__dirname, 'config', `${name}.${env}.json`));
}, },
/** /**
* Configuración de la aplicación * Configuración de la aplicación
* @return {Object} Objeto de configuración app * @return {Object} Objeto de configuración app
@ -26,7 +24,6 @@ module.exports = {
app: function() { app: function() {
return this.getConfig('app'); return this.getConfig('app');
}, },
/** /**
* Configuración de smtp * Configuración de smtp
* @return {Object} Objeto de configuración smtp * @return {Object} Objeto de configuración smtp
@ -34,7 +31,6 @@ module.exports = {
smtp: function() { smtp: function() {
return this.getConfig('smtp'); return this.getConfig('smtp');
}, },
/** /**
* Configuración de mysql * Configuración de mysql
* @return {Object} Objeto de configuración MySQL * @return {Object} Objeto de configuración MySQL

View File

@ -0,0 +1,45 @@
var path = require('path');
/**
* Módulo de configuración
*/
module.exports = {
/**
* Obtiene la configuración en función del entorno en el que se está
* ejecutando la aplicación.
* @param {String} name Nombre del fichero
* @return {Object} Objeto de configuración
*/
getConfig: function(name) {
let env = process.env.NODE_ENV;
if (!env)
env = 'development';
return require(path.join(__dirname, 'config', `${name}.${env}.json`));
},
/**
* Configuración de la aplicación
* @return {Object} Objeto de configuración app
*/
app: function() {
return this.getConfig('app');
},
/**
* Configuración de smtp
* @return {Object} Objeto de configuración smtp
*/
smtp: function() {
return this.getConfig('smtp');
},
/**
* Configuración de mysql
* @return {Object} Objeto de configuración MySQL
*/
mysql: function() {
return this.getConfig('mysql');
}
};

View File

@ -21,7 +21,7 @@ module.exports = function(Ticket) {
Ticket.changeTime = function(ctx, time, cb) { Ticket.changeTime = function(ctx, time, cb) {
var tickets = ctx.req.body.tickets; var tickets = ctx.req.body.tickets;
var FakeProduction = Ticket.app.models.FakeProduction; var FakeProduction = Ticket.app.models.FakeProduction;
var hour = `${time}:00`; var hour = `${time}`;
var query = `update Ticket set date = CONCAT(DATE(date), ' ', ?) where id in (?)`; var query = `update Ticket set date = CONCAT(DATE(date), ' ', ?) where id in (?)`;
var params = [time, tickets]; var params = [time, tickets];

View File

@ -74,10 +74,10 @@
}, },
"acls": [ "acls": [
{ {
"accessType": "*", "accessType": "READ",
"principalType": "ROLE", "principalType": "ROLE",
"principalId": "$everyone", "principalId": "$everyone",
"permission": "DENY" "permission": "ALLOW"
}, },
{ {
"accessType": "*", "accessType": "*",

View File

@ -20,10 +20,10 @@
}, },
"acls": [ "acls": [
{ {
"accessType": "*", "accessType": "READ",
"principalType": "ROLE", "principalType": "ROLE",
"principalId": "$everyone", "principalId": "$everyone",
"permission": "DENY" "permission": "ALLOW"
}, },
{ {
"accessType": "*", "accessType": "*",