mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-21 14:50:08 +03:00
* POST oneflow fireedge * schemas oneflow fireedge * http code accepted Signed-off-by: Jorge Lobo <jlobo@opennebula.io>
This commit is contained in:
parent
e0f5264bd4
commit
6ece4290cf
@ -8,13 +8,8 @@ LOG: prod
|
||||
# Enable cors (cross-origin resource sharing)
|
||||
CORS: true
|
||||
|
||||
# Webpack mode:
|
||||
# - development
|
||||
# - production
|
||||
MODE: production
|
||||
|
||||
# JWT user password encryption key (AUTH)
|
||||
TOKEN_SECRET: token_secreto
|
||||
TOKEN_SECRET: secret_token
|
||||
|
||||
# Flow Server
|
||||
# ONE_FLOW_SERVER:
|
||||
@ -22,7 +17,7 @@ TOKEN_SECRET: token_secreto
|
||||
# HOST: '0.0.0.0'
|
||||
# POST: 2474
|
||||
|
||||
# JWT life time
|
||||
# JWT life time (days)
|
||||
LIMIT_TOKEN:
|
||||
MIN: 14
|
||||
MAX: 30
|
@ -8,8 +8,9 @@
|
||||
"build-node": "webpack --mode=production --env=node",
|
||||
"build-front": "webpack --mode=production --env=front && concurrently \"npm run copy_static_assets\" \"npm run build:css\"",
|
||||
"build:css": "node-sass src/public/scss/main.scss dist/public/app.css --output-style compressed",
|
||||
"dev": "webpack --mode=development && npm run copy_static_assets && concurrently \"webpack --watch\" \"npm run build:css\" \"nodemon --inspect dist\"",
|
||||
"dev:front": "webpack --mode=development --env=front && npm run copy_static_assets && concurrently \"webpack --watch\" \"npm run build:css\" \"nodemon --inspect dist\"",
|
||||
"dev": "npm run copy_static_assets && concurrently \"npm run build:css\" \"nodemon --inspect dist\" \"webpack --mode=development --session=false --watch\"",
|
||||
"dev:front": "npm run copy_static_assets && concurrently \"npm run build:css\" \"nodemon --inspect dist\" \"webpack --mode=development --session=false --env=front --watch\"",
|
||||
|
||||
"start": "node dist/index",
|
||||
"cypress:open": "cypress open",
|
||||
"cypress:run": "cypress run --headless --browser chrome --spec \"cypress/integration/**/*.spec.js\"",
|
||||
@ -102,6 +103,7 @@
|
||||
"style-loader": "^1.0.0",
|
||||
"webpack": "^4.43.0",
|
||||
"webpack-cli": "^3.3.7",
|
||||
"webpack-livereload-plugin": "^2.3.0",
|
||||
"webpack-node-externals": "^1.7.2"
|
||||
}
|
||||
}
|
||||
|
@ -13,9 +13,9 @@
|
||||
/* limitations under the License. */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
const entrypoint404 = require('server-entrypoints/404');
|
||||
const entrypointApi = require('server-entrypoints/Api');
|
||||
const entrypointApp = require('server-entrypoints/App');
|
||||
const entrypoint404 = require('./404');
|
||||
const entrypointApi = require('./Api');
|
||||
const entrypointApp = require('./App');
|
||||
|
||||
module.exports = {
|
||||
entrypoint404,
|
||||
|
@ -59,13 +59,18 @@ const validateResource = (req, res, next) => {
|
||||
idUserOpennebula = session.iss;
|
||||
userOpennebula = session.aud;
|
||||
passOpennebula = session.jti;
|
||||
// deberia estar condicionado por la variable de entorno dev
|
||||
if (
|
||||
global &&
|
||||
global.users &&
|
||||
global.users[userOpennebula] &&
|
||||
global.users[userOpennebula] === passOpennebula
|
||||
) {
|
||||
|
||||
if (!process.env.session) {
|
||||
if (
|
||||
global &&
|
||||
global.users &&
|
||||
global.users[userOpennebula] &&
|
||||
global.users[userOpennebula] === passOpennebula
|
||||
) {
|
||||
next();
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
next();
|
||||
return;
|
||||
}
|
||||
|
@ -44,6 +44,7 @@ const defaults = {
|
||||
defaultConfigFile: `${__dirname}/../config.yml`,
|
||||
defaultTypeLog: 'prod',
|
||||
defaultWebpackMode: 'development',
|
||||
defaultWebpackDevTool: 'inline-source-map',
|
||||
defaultConfigLogPath: '/var/log/one/',
|
||||
defaultConfigLogFile: 'fireedge.log',
|
||||
defaultBaseURL: '',
|
||||
|
@ -13,15 +13,13 @@
|
||||
/* limitations under the License. */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
const webpack = require('webpack');
|
||||
const nodeExternals = require('webpack-node-externals');
|
||||
const path = require('path');
|
||||
const { getConfig } = require('./src/utils/');
|
||||
const { defaultWebpackMode } = require('./src/utils/constants');
|
||||
|
||||
// settings
|
||||
const appConfig = getConfig();
|
||||
const mode = appConfig.MODE || defaultWebpackMode;
|
||||
const devtool = mode === defaultWebpackMode ? 'inline-source-map' : '';
|
||||
const {
|
||||
defaultWebpackMode,
|
||||
defaultWebpackDevTool
|
||||
} = require('./src/utils/constants/defaults');
|
||||
|
||||
const js = {
|
||||
test: /\.js$/,
|
||||
@ -43,15 +41,13 @@ const js = {
|
||||
const alias = {
|
||||
alias: {
|
||||
server: path.resolve(__dirname, 'src/'),
|
||||
client: path.resolve(__dirname, 'src/public/'),
|
||||
'server-entrypoints': path.resolve(__dirname, 'src/routes/entrypoints/'),
|
||||
'server-api': path.resolve(__dirname, 'src/routes/api/')
|
||||
client: path.resolve(__dirname, 'src/public/')
|
||||
},
|
||||
extensions: ['.js']
|
||||
};
|
||||
|
||||
const serverConfig = {
|
||||
mode,
|
||||
mode: defaultWebpackMode,
|
||||
target: 'node',
|
||||
node: {
|
||||
__dirname: false
|
||||
@ -68,11 +64,11 @@ const serverConfig = {
|
||||
filename: '[name]'
|
||||
},
|
||||
resolve: alias,
|
||||
devtool
|
||||
devtool: defaultWebpackDevTool
|
||||
};
|
||||
|
||||
const clientConfig = {
|
||||
mode,
|
||||
mode: defaultWebpackMode,
|
||||
target: 'web',
|
||||
entry: {
|
||||
'app.js': path.resolve(__dirname, 'src/public/front-app.js')
|
||||
@ -90,10 +86,24 @@ const clientConfig = {
|
||||
filename: '[name]'
|
||||
},
|
||||
resolve: alias,
|
||||
devtool
|
||||
devtool: defaultWebpackDevTool
|
||||
};
|
||||
|
||||
module.exports = env => {
|
||||
module.exports = (env, argv) => {
|
||||
if (argv && argv.mode !== defaultWebpackMode) {
|
||||
[clientConfig.mode, serverConfig.mode] = Array(2).fill('production');
|
||||
[clientConfig.devtool, serverConfig.devtool] = Array(2).fill('');
|
||||
} else if (argv && argv.session && argv.session === 'false') {
|
||||
const pluginProcessEnv = [
|
||||
new webpack.DefinePlugin({
|
||||
'process.env': {
|
||||
session: JSON.stringify(argv.session)
|
||||
}
|
||||
})
|
||||
];
|
||||
clientConfig.plugins = pluginProcessEnv;
|
||||
serverConfig.plugins = pluginProcessEnv;
|
||||
}
|
||||
let build = [];
|
||||
if (env) {
|
||||
switch (env) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user