diff --git a/app.js b/app.js index 68d3e9442d8290a20f6bded553c389810031c0ac..3e4b3a6f53257678359370704206a1c14ebb9436 100644 --- a/app.js +++ b/app.js @@ -16,7 +16,7 @@ i18n.configure({ directory: './locales' }); -var env = process.env.NODE_ENV || 'development'; +var env = process.env.NODE_ENV || 'testing'; const config = require('./config/config')[env]; var app = express(); diff --git a/config/config.js b/config/config.js index b4c47761de28b53ca6532d256f34e203e9ea8e06..201291a1b012ff0452c9c660d81a96c050af8d53 100644 --- a/config/config.js +++ b/config/config.js @@ -2,14 +2,48 @@ module.exports = { development: { app: { name: 'User Account Management', - port: process.env.PORT || 9989 + port: process.env.PORT || 9989, + host: 'http://localhost:9989' + }, + passport: { + strategy: 'saml', + saml: { + path: process.env.SAML_PATH || '/saml/SSO', + entryPoint: process.env.SAML_ENTRY_POINT || 'https://m4lab.hft-stuttgart.de/idp/saml2/idp/SSOService.php', + issuer: 'sp-account.m4lab.hft-stuttgart.de', //local metadata + logoutUrl: 'https://m4lab.hft-stuttgart.de/idp/saml2/idp/SingleLogoutService.php' + } + }, + database: { + host: 'localhost', // DB host + user: 'DBManager', // DB username + password: 'Stuttgart2019', // DB password + port: 3306, // MySQL port + dbUser: 'userdb', // User DB + host_project: 'localhost', // DB host project db + dbProject: 'projectDB' // Project DB + }, + mailer: { + host: 'mail.hft-stuttgart.de', // hostname + secureConnection: false, // TLS requires secureConnection to be false + port: 587, // port for secure SMTP + authUser: 'ad\\support-transfer', + authPass: '6laumri2', + tlsCiphers: 'SSLv3', + from: 'support-transfer@hft-stuttgart.de', + } + }, + testing: { + app: { + name: 'User Account Management', + port: process.env.PORT || 9989, + host: 'https://m4lab.hft-stuttgart.de/account' }, passport: { strategy: 'saml', saml: { path: process.env.SAML_PATH || '/saml/SSO', entryPoint: process.env.SAML_ENTRY_POINT || 'https://m4lab.hft-stuttgart.de/idp/saml2/idp/SSOService.php', - //issuer: 'sp-account.m4lab.hft-stuttgart.de', //local metadata issuer: 'sp-account-testing.m4lab.hft-stuttgart.de', //testing metadata //issuer: 'sp-account-prod.m4lab.hft-stuttgart.de', //production metadata logoutUrl: 'https://m4lab.hft-stuttgart.de/idp/saml2/idp/SingleLogoutService.php' @@ -22,7 +56,6 @@ module.exports = { port: 3306, // MySQL port dbUser: 'userdb', // User DB host_project: 'm4lab.hft-stuttgart.de', // DB host project db - //host_project: 'localhost', // local dbProject: 'projectDB' // Project DB }, mailer: { @@ -35,4 +68,4 @@ module.exports = { from: 'support-transfer@hft-stuttgart.de', } } -} +} \ No newline at end of file diff --git a/routes/dbconn.js b/routes/dbconn.js index 834eb1aaa465674e73190ffc8d8809b2d28c3274..a39f7368e9872389db9b36555b87a92d40a6eb05 100644 --- a/routes/dbconn.js +++ b/routes/dbconn.js @@ -1,6 +1,6 @@ const mysql = require('mysql') -var env = process.env.NODE_ENV || 'development'; +var env = process.env.NODE_ENV || 'testing'; const config = require('../config/config')[env] // ==== USER ACOOUNT DB CONNECTION ==== diff --git a/routes/mailer.js b/routes/mailer.js index 510b5bb1d11e075f446cdf19b8a954411025ee38..2c51bd7d5ed5682bfdd9fa0c48788e1bd4affe19 100644 --- a/routes/mailer.js +++ b/routes/mailer.js @@ -1,6 +1,6 @@ const nodemailer = require('nodemailer') -var env = process.env.NODE_ENV || 'development'; +var env = process.env.NODE_ENV || 'testing'; const config = require('../config/config')[env] var smtpTransport = nodemailer.createTransport({