From aa5176a04c27e17dbec111947b8120b7dfb614da Mon Sep 17 00:00:00 2001 From: Raphix Date: Sun, 29 Dec 2024 16:03:49 +0100 Subject: [PATCH] Premier commit --- .gitignore | 137 ++ LICENSE | 9 + README.md | 3 + bin/auth.js | 113 ++ bin/config.js | 43 + bin/global-variables.js | 17 + bin/keygen.js | 29 + bin/users.js | 430 +++++++ bin/www | 105 ++ main.js | 85 ++ package-lock.json | 2314 ++++++++++++++++++++++++++++++++++ package.json | 38 + public/favicon.ico | Bin 0 -> 10380 bytes public/stylesheets/style.css | 0 routes/index.js | 25 + routes/login.js | 61 + routes/stylepage.js | 9 + views/index.ejs | 12 + views/login.ejs | 14 + views/utils/error.ejs | 32 + views/utils/stylepage.ejs | 75 ++ 21 files changed, 3551 insertions(+) create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 README.md create mode 100644 bin/auth.js create mode 100644 bin/config.js create mode 100644 bin/global-variables.js create mode 100644 bin/keygen.js create mode 100644 bin/users.js create mode 100644 bin/www create mode 100644 main.js create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 public/favicon.ico create mode 100644 public/stylesheets/style.css create mode 100644 routes/index.js create mode 100644 routes/login.js create mode 100644 routes/stylepage.js create mode 100644 views/index.ejs create mode 100644 views/login.ejs create mode 100644 views/utils/error.ejs create mode 100644 views/utils/stylepage.ejs diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..65654f3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,137 @@ +# ---> Node +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* +.pnpm-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# Snowpack dependency directory (https://snowpack.dev/) +web_modules/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional stylelint cache +.stylelintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variable files +.env +.env.development.local +.env.test.local +.env.production.local +.env.local + +# parcel-bundler cache (https://parceljs.org/) +.cache +.parcel-cache + +# Next.js build output +.next +out + +# Nuxt.js build / generate output +.nuxt +dist + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and not Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + +# vuepress build output +.vuepress/dist + +# vuepress v2.x temp and cache directory +.temp +.cache + +# Docusaurus cache and generated files +.docusaurus + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port + +# Stores VSCode versions used for testing VSCode extensions +.vscode-test + +# yarn v2 +.yarn/cache +.yarn/unplugged +.yarn/build-state.yml +.yarn/install-state.gz +.pnp.* + +#data +data +data/* + +private \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..8706731 --- /dev/null +++ b/LICENSE @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) 2023 infrastructure + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..9ac835e --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# neutral + +Panel d'administration de Raphix diff --git a/bin/auth.js b/bin/auth.js new file mode 100644 index 0000000..85560cf --- /dev/null +++ b/bin/auth.js @@ -0,0 +1,113 @@ +const { LogType } = require("loguix") +const fs = require("fs") +const path = require("path") +const { __glob } = require("./global-variables") +const alog = new LogType("Authentification") +const keygen = require("./keygen") +const users = require("./users") + +/** + * Vérifie si le token est présent et appartient à un utilisateur + * @param {string} token + */ + +module.exports.check = function(token) { + var isApproved = false; + var username = null + users.fetchUsers().forEach((fetchUser) => { + if(fetchUser.tokens.includes(token)) { + isApproved = true + username = fetchUser.username + } + + }) + + if(isApproved) { + return true + } else { + if(token) { + + alog.warn("Erreur d'authentification - Token n'existe pas : " + token) + } + return false + } +} + +/** + * Permet de se connecter à Inventory + * @param {object} data + * @returns Token or AUTH_FAILED + */ +module.exports.login = function(data) { + var username = data.username + var password = data.password + + if(users.fetchUsers().has(username)) { + const user = users.fetchUsers().get(username) + if(password == user.getPassword()) { + const token = user.generateToken() + alog.log("Connexion approuvé de l'utilisateur : " + username) + return token + } else { + alog.warn("Echec de connexion de l'utilisateur : " + username + " - Mot de passe incorrect") + return "AUTH_FAILED" + } + + } else { + alog.warn("Echec de connexion de l'utilisateur : " + username + " - Utilisateur non-inscrit dans la base de donnée") + return "AUTH_FAILED" + } +} + +/** + * Remove the token + * @param {string} token + * @returns + */ +module.exports.signout = function(token) { + var isDone = false; + var username = null + users.fetchUsers().forEach((fetchUser) => { + if(fetchUser.tokens.includes(token)) { + isDone = true + username = fetchUser.username + fetchUser.removeToken(token) + } + + }) + + if(isDone) { + alog.log("Suppression du Token '" + token + "' de l'utilisateur : " + username) + return true + } else { + if(token) { + + alog.warn("Erreur d'opération lors de la déconnexion - Token n'existe pas : " + token) + } + return false + } + +} + +module.exports.getUserByToken = function(token) { + var isApproved = false; + var userGetted = null + users.fetchUsers().forEach((fetchUser) => { + if(fetchUser.tokens.includes(token)) { + userGetted = fetchUser + } + + }) + + if(userGetted) { + return userGetted + + } else { + if(token) { + + alog.warn("Erreur d'authentification - Token n'existe pas : " + token) + } + return false + } + +} \ No newline at end of file diff --git a/bin/config.js b/bin/config.js new file mode 100644 index 0000000..9aff90c --- /dev/null +++ b/bin/config.js @@ -0,0 +1,43 @@ +const { LogType } = require("loguix") +const fs = require("fs") +const path = require("path") +const { __glob } = require("./global-variables") +const clog = new LogType("Configuration") + +setup() + +function setup() { + if(!fs.existsSync(__glob.CONFIG)) { + clog.log("Création du fichier de configuration dans : " + __glob.CONFIG) + fs.writeFileSync(__glob.CONFIG, JSON.stringify({ + ENCRYPTION_KEY: "1", + }, null, 2)) + } +} + +/** + * + * @returns Config File + */ +module.exports.getFile = function () { + const file = JSON.parse(fs.readFileSync(__glob.CONFIG)) + return file +} + +/** + * Update le fichier configuration avec un object + * @param {Array} file + */ +module.exports.updateFile = function (file) { + if(fs.existsSync(__glob.CONFIG)) { + clog.log("Mise à jour du fichier configuration dans : " + __glob.CONFIG) + fs.writeFileSync(__glob.CONFIG, JSON.stringify(file, null, 2)) + } +} + +module.exports.saveSettings = function (settings) { + const file = this.getFile() + file.JENKINS_TOKEN = settings.jenkins_token + file.OMEGA_KEY = settings.omega_token + this.updateFile(file) +} diff --git a/bin/global-variables.js b/bin/global-variables.js new file mode 100644 index 0000000..5a99b29 --- /dev/null +++ b/bin/global-variables.js @@ -0,0 +1,17 @@ +const path = require("path"); +const root = path.resolve(__dirname, '../') + +const __glob = { + ROUTES: root + path.sep + "routes" + path.sep, + ROOT: root, + LOGS: root + path.sep + "logs", + DATA: root + path.sep + "data", + USERS: root + path.sep + "data" + path.sep + "users.json", + CONFIG: root + path.sep + "data" + path.sep + "config.json", + PACKAGE_JSON: root + path.sep + "package.json", +}; + + + +module.exports = { __glob }; + diff --git a/bin/keygen.js b/bin/keygen.js new file mode 100644 index 0000000..9f7a0a0 --- /dev/null +++ b/bin/keygen.js @@ -0,0 +1,29 @@ +const { LogType } = require("loguix") +const fs = require("fs") +const path = require("path") +var CryptoJS = require("crypto-js") +const { __glob } = require("./global-variables") +const clog = new LogType("KeyGen") +const config = require("./config") + +const keypass = config.getFile().ENCRYPTION_KEY + +setup() + +function setup() { + if(keypass) { + clog.log("Clé de chiffrement trouvé et importé") + } else { + clog.error("Clé de chiffrement inconnu : Passage en mode par défaut") + } +} + +module.exports.encrypt = function (text) { + let encryptedText = CryptoJS.AES.encrypt(text, keypass).toString(); + return encryptedText; + } + +module.exports.decrypt = function(text) { + let decryptedText = CryptoJS.AES.decrypt(text, keypass).toString(CryptoJS.enc.Utf8); + return decryptedText; + } \ No newline at end of file diff --git a/bin/users.js b/bin/users.js new file mode 100644 index 0000000..65f22bc --- /dev/null +++ b/bin/users.js @@ -0,0 +1,430 @@ +const { LogType } = require("loguix") +const fs = require("fs") +const path = require("path") +const { __glob } = require("./global-variables") +const ulog = new LogType("Users") +const keygen = require("./keygen") +const uuid = require("uuid") + +var usersList = new Map() + +setup() + +function setup() { + + if(!fs.existsSync(__glob.USERS)) { + ulog.log("Création du fichier utilisateur dans : " + __glob.USERS) + fs.writeFileSync(__glob.USERS, JSON.stringify([], null, 2)) + } +} + +module.exports.getAllUsers = async function() { + return new Promise(async (resolve, reject) => { + const users = await this.fetchUsers() + + // Remove for every people the password & the tokens + + for(var user of users) { + user = user[1] + user.password = null + user.tokens = null + } + + + resolve(JSON.stringify(Array.from(users))) + }) + + +} + +/** + * Get all users from Users Data Base + */ +module.exports.fetchUsers = function () { + + ulog.step.init("fetch_user", "Récupération de tous les utilisateurs inscrit dans la base de donnée") + const userFile = getFile() + usersList = new Map() + for(var userFetched of userFile) { + const user = new this.User({ + username: userFetched.username, + password: userFetched.password, + display_name: userFetched.display_name, + tokens: userFetched.tokens, + lastLogin: userFetched.lastLogin, + + }) + + usersList.set(user.username, user) + } + + if(usersList.size == 0) { + const adminUser = new this.User({ + "username": "admin", + "password": "inventory", + "display_name": "Administrateur", + "tokens": [], + "lastLogin": "DEFAULT ACCOUNT", + }) + + + adminUser.register() + + + } + + + ulog.step.end("fetch_user") + + return usersList +} + +/** + * User Class is used to access to default user's properties and methods + * @param {object} properties User properties with : username, password, display_name + */ +module.exports.User = class { + username = null + password = null; + display_name = null + tokens = [] + lastLogin = new Date() + + constructor(properties) { + + if(properties) { + + this.username = properties.username + this.password = keygen.encrypt(properties.password) + this.display_name = properties.display_name + this.tokens = properties.tokens + this.lastLogin = properties.lastLogin + + const userFile = getFile() + + for(var userFetched of userFile) { + if(properties.username == userFetched.username) { + ulog.log("Récupération dans la base de donnée, de l'utilisateur : " + userFetched.username) + this.username = userFetched.username + this.password = userFetched.password + this.display_name = userFetched.display_name + this.tokens = userFetched.tokens + this.lastLogin = userFetched.lastLogin + } + } + + + + + + } + + + if(this.username == null) { + ulog.error("One of user is without username ! [IMPORANT_FIELD_IS_MISSING]") + this.username = Math.random() + } + if(this.password == null) { + ulog.error("'" + this.username + "' is without password ! Password reset to 'default' [IMPORANT_FIELD_IS_MISSING]") + this.password = keygen.encrypt("default") + } + if(this.display_name == null) { + ulog.warn("'" + this.username + "' is without display name !") + this.display_name = this.username + } + + if(this.tokens == null) { + this.tokens = [] + } + if(this.lastLogin == null) { + this.lastLogin = new Date() + } + + + + } + + register() { + + var alreadyExist = false + const userFile = getFile() + + for(var userFetched of userFile) { + if(userFetched.username == this.username) { + userFile.splice(userFile.indexOf(userFetched), 1) + ulog.log("Mise à jour dans la base de donnée, de l'utilisateur : " + this.username) + alreadyExist = true + } + } + if(!alreadyExist) { + ulog.log("Création dans la base de donnée de l'utilisateur : " + this.username) + } + userFile.push(this) + updateFile(userFile) + + usersList.set(this.username, this) + } + + unregister() { + + var alreadyExist = false + const userFile = getFile() + + for(var userFetched of userFile) { + if(userFetched.username == this.username) { + userFile.splice(userFile.indexOf(userFetched), 1) + ulog.log("Mise à jour dans la base de donnée, de l'utilisateur : " + this.username) + alreadyExist = true + } + } + if(!alreadyExist) { + ulog.log("L'utilisateur n'est pas enregistré dans la base de donnée : " + this.username) + } + + updateFile(userFile) + usersList.delete(this.username) + } + + + + setPassword(newPassword) { + this.#sync() + this.password = keygen.encrypt(newPassword) + this.register() + ulog.log("Le mot de passe de l'utilisateur a été modifié : " + this.username) + + } + getPassword() { + this.#sync() + return keygen.decrypt(this.password) + } + + generateToken() { + this.#sync() + const gToken = uuid.v4().toString() + this.tokens.push(gToken) + this.register() + return gToken + + } + + removeToken(token) { + this.#sync() + var haveToken = false + for(var aToken of this.tokens) { + if(token == aToken) { + haveToken = true + } + } + if(haveToken) { + this.tokens.splice(this.tokens.indexOf(token), 1) + this.register() + } else { + + ulog.warn("'" + this.username + "' n'a pas le token : " + token) + return false + } + + } + + setDisplayName(text) { + this.#sync() + this.display_name = text + this.register() + ulog.log("Le nom d'affichage de l'utilisateur a été modifié : " + this.username) + + } + + setNewUsername(text) { + this.#sync() + module.exports.deleteUser(this.username) + this.username = text + this.register() + + ulog.log("Le nom d'utilisateur de l'utilisateur a été modifié : " + this.username) + + } + + setLastLogin(text) { + this.#sync() + this.lastLogin = text + this.register() + } + + clearTokens() { + this.#sync() + this.tokens = [] + this.register() + } + + #sync() { + + for(var userGet of usersList.keys()) { + const userFetched = usersList.get(userGet) + if(this.username == userFetched.username) { + this.username = userFetched.username + this.password = userFetched.password + this.display_name = userFetched.display_name + this.tokens = userFetched.tokens + this.lastLogin = userFetched.lastLogin + } + } + + } +} + +module.exports.addUser = function(settings) { + + if(settings.username == '') { + ulog.error("Le nom d'utilisateur est manquant") + return "USERNAME_MISSING" + } else if(settings.password == '') { + ulog.error("Le mot de passe est manquant") + return "PASSWORD_MISSING" + } else if(settings.display_name == '') { + ulog.error("Le nom d'affichage est manquant") + return "DISPLAY_NAME_MISSING" + } else if(this.getUser(settings.username)) { + ulog.error("L'utilisateur existe déjà : " + settings.username) + return "ALREADY_EXIST" + } else { + ulog.step.init("add_user", "Ajout d'un utilisateur dans la base de donnée : " + settings.username) + + const user = new this.User({ + username: settings.username, + display_name: settings.display_name + + }) + + user.setPassword(settings.password) + user.register() + ulog.step.end("add_user") + } + +} + +module.exports.deleteUser = function(username) { + ulog.step.init("delete_user", "Suppression d'un utilisateur dans la base de donnée : " + username) + const user = this.getUser(username) + user.unregister() + ulog.step.end("delete_user") + return "OK" +} + + +module.exports.getUser = function(username) { + return usersList.get(username) +} + +module.exports.editUser = function(settings) { + if(settings.username == '') { + ulog.error("Le nom d'utilisateur est manquant") + return "USERNAME_MISSING" + } else if(settings.display_name == '') { + ulog.error("Le nom d'affichage est manquant") + return "DISPLAY_NAME_MISSING" + } else { + ulog.step.init("edit_user", "Modification d'un utilisateur dans la base de donnée : " + settings.username) + const user = this.fetchUsers().get(settings.username) + if(user) { + + if(settings.newusername && settings.newusername != settings.username) { + if(this.getUser(settings.newusername)) { + ulog.error("L'utilisateur existe déjà : " + settings.username) + return "ALREADY_EXIST" + } else { + + user.setNewUsername(settings.newusername) + } + } + if(settings.display_name) { + user.setDisplayName(settings.display_name) + } + + if(settings.password) { + user.setPassword(settings.password) + } + + + + ulog.step.end("edit_user") + return "OK" + } else { + ulog.step.end("edit_user") + return "NOT_EXIST" + } + + } +} + +module.exports.editMySelf = function (settings, user) { + if(user.username == settings.username) { + if(settings.username == '') { + ulog.error("Le nom d'utilisateur est manquant") + return "USERNAME_MISSING" + } else if(settings.display_name == '') { + ulog.error("Le nom d'affichage est manquant") + return "DISPLAY_NAME_MISSING" + } else { + ulog.step.init("edit_user", "Modification d'un utilisateur dans la base de donnée : " + settings.username) + const user = this.fetchUsers().get(settings.username) + if(user) { + console.log(settings) + if(settings.newusername && settings.newusername != settings.username) { + if(this.getUser(settings.newusername)) { + ulog.error("L'utilisateur existe déjà : " + settings.username) + return "ALREADY_EXIST" + } else { + + user.setNewUsername(settings.newusername) + } + } + if(settings.display_name) { + user.setDisplayName(settings.display_name) + } + + if(settings.password) { + user.setPassword(settings.password) + } + + ulog.step.end("edit_user") + return "OK" + } else { + ulog.step.end("edit_user") + return "NOT_EXIST" + } + + } + } else { + ulog.error("Vous ne pouvez pas modifier les informations d'un autre utilisateur !") + return "NOT_ALLOWED" + } +} + +module.exports.clearTokens = function(username) { + + const user = this.fetchUsers().get(username) + user.clearTokens() +} + + +/** + * + * @returns User File + */ +function getFile() { + const file = JSON.parse(fs.readFileSync(__glob.USERS)) + return file +} + +/** + * Update le fichier utilisateur avec un object + * @param {Array} file + */ +function updateFile(file) { + if(fs.existsSync(__glob.USERS)) { + ulog.log("Mise à jour du fichier utilisateur dans : " + __glob.USERS) + fs.writeFileSync(__glob.USERS, JSON.stringify(file, null, 2)) + } +} + diff --git a/bin/www b/bin/www new file mode 100644 index 0000000..2e472b8 --- /dev/null +++ b/bin/www @@ -0,0 +1,105 @@ +#!/usr/bin/env node + +/** + * Module dependencies. + */ +var log = require("loguix") +var {LogType} = require("loguix") +var { __glob } = require("./global-variables") +log.setup(__glob.LOGS, __glob.PACKAGE_JSON) + +const wlog = new LogType("Serveur") + +if(process.env.DEV ) { + + wlog.log("MODE DEVELOPEMENT ACTIF") +} + +wlog.step.init("start_server", "Démarrage du serveur Express JS") + +var app = require('../main'); +var http = require('http'); +var config = require("./config") + +/** + * Get port from environment and store in Express. + */ + +var port = normalizePort(process.env.PORT || '5005'); +app.set('port', port); + +/** + * Create HTTP server. + */ + +var server = http.createServer(app); + +/** + * Listen on provided port, on all network interfaces. + */ + + +server.listen(port); +server.on('error', onError); +server.on('listening', onListening); + +/** + * Normalize a port into a number, string, or false. + */ + +function normalizePort(val) { + var port = parseInt(val, 10); + + if (isNaN(port)) { + // named pipe + return val; + } + + if (port >= 0) { + // port number + return port; + } + + return false; +} + +/** + * Event listener for HTTP server "error" event. + */ + +function onError(error) { + if (error.syscall !== 'listen') { + throw error; + } + + var bind = typeof port === 'string' + ? 'Pipe ' + port + : 'Port ' + port; + + // handle specific listen errors with friendly messages + switch (error.code) { + case 'EACCES': + wlog.step.error("start_server", bind + ' requires elevated privileges'); + process.exit(1); + break; + case 'EADDRINUSE': + wlog.step.error("start_server" , bind + ' is already in use'); + process.exit(1); + break; + default: + throw error; + } +} + +/** + * Event listener for HTTP server "listening" event. + */ + +function onListening() { + wlog.log("Serveur entrain d'écouter sur le port : " + server.address().port) + var addr = server.address(); + var bind = typeof addr === 'string' + ? 'pipe ' + addr + : 'port ' + addr.port; + wlog.step.end("start_server") +} diff --git a/main.js b/main.js new file mode 100644 index 0000000..4ed962d --- /dev/null +++ b/main.js @@ -0,0 +1,85 @@ +const createError = require('http-errors'); +const express = require('express'); +const path = require('path'); +const cookieParser = require('cookie-parser'); +var favicon = require('express-favicon'); +const app = express(); +const fs = require("fs"); +const log = require("loguix") + +const { __glob } = require('./bin/global-variables'); +const users = require("./bin/users") +const {User} = require("./bin/users") + + + +var wlog = log.getInstance("Serveur") + + + +setup() + + +function getRouters() { + + wlog.log("Récupération de " + fs.readdirSync(__glob.ROUTES).length + " routeurs depuis : " + __glob.ROUTES) + for(var route of fs.readdirSync(__glob.ROUTES)) { + + if(route == "index.js") { + + app.use("/", require(__glob.ROUTES + "index")) + } else { + + app.use("/" + route.replace(".js", ""), require(__glob.ROUTES + route)) + } + + } + +} + +function setup() { + + app.set('views', path.join(__dirname, 'views')); + app.set('view engine', 'ejs'); + + app.use(express.json()); + app.use(express.urlencoded({ extended: false })); + app.use(cookieParser()); + app.use(express.static(path.join(__dirname, 'public'))); + app.use(favicon(path.join(__dirname, 'public', 'favicon.ico'))) + + + getRouters() + users.fetchUsers() + + // catch 404 and forward to error handler + app.use(function(req, res, next) { + res.locals.message = "Page non trouvé"; + res.locals.error = { + "status": "404", + "stack": "" + } + + // render the error page + res.status(404 || 404); + res.render('utils/error'); + }); + + // error handler + app.use(function(err, req, res, next) { + // set locals, only providing error in development + res.locals.message = err.message; + res.locals.error = req.app.get('env') === 'development' ? err : {}; + + // render the error page + res.status(err.status || 500); + res.render('utils/error'); + }); + + + +} + + + +module.exports = app; diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..ccc8599 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,2314 @@ +{ + "name": "inventory", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "inventory", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "cookie-parser": "~1.4.4", + "crypto-js": "^4.2.0", + "debug": "~2.6.9", + "ejs": "~2.6.1", + "express": "~4.16.1", + "express-favicon": "^2.0.4", + "http-errors": "~1.6.3", + "loguix": "^1.4.2", + "nodemon": "^3.0.1", + "os-utils": "^0.0.14", + "pm2": "^5.3.0", + "uuid": "^9.0.1" + } + }, + "node_modules/@opencensus/core": { + "version": "0.0.9", + "license": "Apache-2.0", + "dependencies": { + "continuation-local-storage": "^3.2.1", + "log-driver": "^1.2.7", + "semver": "^5.5.0", + "shimmer": "^1.2.0", + "uuid": "^3.2.1" + }, + "engines": { + "node": ">=6.0" + } + }, + "node_modules/@opencensus/core/node_modules/semver": { + "version": "5.7.2", + "license": "ISC", + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/@opencensus/core/node_modules/uuid": { + "version": "3.4.0", + "license": "MIT", + "bin": { + "uuid": "bin/uuid" + } + }, + "node_modules/@opencensus/propagation-b3": { + "version": "0.0.8", + "license": "Apache-2.0", + "dependencies": { + "@opencensus/core": "^0.0.8", + "uuid": "^3.2.1" + }, + "engines": { + "node": ">=6.0" + } + }, + "node_modules/@opencensus/propagation-b3/node_modules/@opencensus/core": { + "version": "0.0.8", + "license": "Apache-2.0", + "dependencies": { + "continuation-local-storage": "^3.2.1", + "log-driver": "^1.2.7", + "semver": "^5.5.0", + "shimmer": "^1.2.0", + "uuid": "^3.2.1" + }, + "engines": { + "node": ">=6.0" + } + }, + "node_modules/@opencensus/propagation-b3/node_modules/semver": { + "version": "5.7.2", + "license": "ISC", + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/@opencensus/propagation-b3/node_modules/uuid": { + "version": "3.4.0", + "license": "MIT", + "bin": { + "uuid": "bin/uuid" + } + }, + "node_modules/@pm2/agent": { + "version": "2.0.3", + "license": "AGPL-3.0", + "dependencies": { + "async": "~3.2.0", + "chalk": "~3.0.0", + "dayjs": "~1.8.24", + "debug": "~4.3.1", + "eventemitter2": "~5.0.1", + "fast-json-patch": "^3.0.0-1", + "fclone": "~1.0.11", + "nssocket": "0.6.0", + "pm2-axon": "~4.0.1", + "pm2-axon-rpc": "~0.7.0", + "proxy-agent": "~6.3.0", + "semver": "~7.5.0", + "ws": "~7.4.0" + } + }, + "node_modules/@pm2/agent/node_modules/dayjs": { + "version": "1.8.36", + "license": "MIT" + }, + "node_modules/@pm2/agent/node_modules/debug": { + "version": "4.3.4", + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@pm2/agent/node_modules/ms": { + "version": "2.1.2", + "license": "MIT" + }, + "node_modules/@pm2/agent/node_modules/ws": { + "version": "7.4.6", + "license": "MIT", + "engines": { + "node": ">=8.3.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/@pm2/io": { + "version": "5.0.2", + "license": "Apache-2", + "dependencies": { + "@opencensus/core": "0.0.9", + "@opencensus/propagation-b3": "0.0.8", + "async": "~2.6.1", + "debug": "~4.3.1", + "eventemitter2": "^6.3.1", + "require-in-the-middle": "^5.0.0", + "semver": "~7.5.4", + "shimmer": "^1.2.0", + "signal-exit": "^3.0.3", + "tslib": "1.9.3" + }, + "engines": { + "node": ">=6.0" + } + }, + "node_modules/@pm2/io/node_modules/async": { + "version": "2.6.4", + "license": "MIT", + "dependencies": { + "lodash": "^4.17.14" + } + }, + "node_modules/@pm2/io/node_modules/debug": { + "version": "4.3.4", + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@pm2/io/node_modules/eventemitter2": { + "version": "6.4.9", + "license": "MIT" + }, + "node_modules/@pm2/io/node_modules/ms": { + "version": "2.1.2", + "license": "MIT" + }, + "node_modules/@pm2/js-api": { + "version": "0.6.7", + "license": "Apache-2", + "dependencies": { + "async": "^2.6.3", + "axios": "^0.21.0", + "debug": "~4.3.1", + "eventemitter2": "^6.3.1", + "ws": "^7.0.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/@pm2/js-api/node_modules/async": { + "version": "2.6.4", + "license": "MIT", + "dependencies": { + "lodash": "^4.17.14" + } + }, + "node_modules/@pm2/js-api/node_modules/debug": { + "version": "4.3.4", + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@pm2/js-api/node_modules/eventemitter2": { + "version": "6.4.9", + "license": "MIT" + }, + "node_modules/@pm2/js-api/node_modules/ms": { + "version": "2.1.2", + "license": "MIT" + }, + "node_modules/@pm2/js-api/node_modules/ws": { + "version": "7.5.9", + "license": "MIT", + "engines": { + "node": ">=8.3.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/@pm2/pm2-version-check": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@pm2/pm2-version-check/-/pm2-version-check-1.0.4.tgz", + "integrity": "sha512-SXsM27SGH3yTWKc2fKR4SYNxsmnvuBQ9dd6QHtEWmiZ/VqaOYPAIlS8+vMcn27YLtAEBGvNRSh3TPNvtjZgfqA==", + "dependencies": { + "debug": "^4.3.1" + } + }, + "node_modules/@pm2/pm2-version-check/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@pm2/pm2-version-check/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "node_modules/@tootallnate/quickjs-emscripten": { + "version": "0.23.0", + "license": "MIT" + }, + "node_modules/abbrev": { + "version": "1.1.1", + "license": "ISC" + }, + "node_modules/accepts": { + "version": "1.3.8", + "license": "MIT", + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/agent-base": { + "version": "7.1.0", + "license": "MIT", + "dependencies": { + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/agent-base/node_modules/debug": { + "version": "4.3.4", + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/agent-base/node_modules/ms": { + "version": "2.1.2", + "license": "MIT" + }, + "node_modules/amp": { + "version": "0.3.1", + "license": "MIT" + }, + "node_modules/amp-message": { + "version": "0.1.2", + "license": "MIT", + "dependencies": { + "amp": "0.3.1" + } + }, + "node_modules/ansi-colors": { + "version": "4.1.3", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/anymatch": { + "version": "3.1.3", + "license": "ISC", + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/argparse": { + "version": "1.0.10", + "license": "MIT", + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/argparse/node_modules/sprintf-js": { + "version": "1.0.3", + "license": "BSD-3-Clause" + }, + "node_modules/array-flatten": { + "version": "1.1.1", + "license": "MIT" + }, + "node_modules/ast-types": { + "version": "0.13.4", + "license": "MIT", + "dependencies": { + "tslib": "^2.0.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/ast-types/node_modules/tslib": { + "version": "2.6.2", + "license": "0BSD" + }, + "node_modules/async": { + "version": "3.2.5", + "license": "MIT" + }, + "node_modules/async-listener": { + "version": "0.6.10", + "license": "BSD-2-Clause", + "dependencies": { + "semver": "^5.3.0", + "shimmer": "^1.1.0" + }, + "engines": { + "node": "<=0.11.8 || >0.11.10" + } + }, + "node_modules/async-listener/node_modules/semver": { + "version": "5.7.2", + "license": "ISC", + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/axios": { + "version": "0.21.4", + "license": "MIT", + "dependencies": { + "follow-redirects": "^1.14.0" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "license": "MIT" + }, + "node_modules/basic-ftp": { + "version": "5.0.4", + "license": "MIT", + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/binary-extensions": { + "version": "2.2.0", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/blessed": { + "version": "0.1.81", + "license": "MIT", + "bin": { + "blessed": "bin/tput.js" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/bodec": { + "version": "0.1.0", + "license": "MIT" + }, + "node_modules/body-parser": { + "version": "1.18.3", + "license": "MIT", + "dependencies": { + "bytes": "3.0.0", + "content-type": "~1.0.4", + "debug": "2.6.9", + "depd": "~1.1.2", + "http-errors": "~1.6.3", + "iconv-lite": "0.4.23", + "on-finished": "~2.3.0", + "qs": "6.5.2", + "raw-body": "2.3.3", + "type-is": "~1.6.16" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.2", + "license": "MIT", + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "license": "MIT" + }, + "node_modules/bytes": { + "version": "3.0.0", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/chalk": { + "version": "3.0.0", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/chalk/node_modules/has-flag": { + "version": "4.0.0", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/chalk/node_modules/supports-color": { + "version": "7.2.0", + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/charm": { + "version": "0.1.2", + "license": "MIT/X11" + }, + "node_modules/chokidar": { + "version": "3.5.3", + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "license": "MIT", + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/cli-tableau": { + "version": "2.0.1", + "dependencies": { + "chalk": "3.0.0" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "license": "MIT" + }, + "node_modules/commander": { + "version": "2.15.1", + "license": "MIT" + }, + "node_modules/concat-map": { + "version": "0.0.1", + "license": "MIT" + }, + "node_modules/content-disposition": { + "version": "0.5.2", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/continuation-local-storage": { + "version": "3.2.1", + "license": "BSD-2-Clause", + "dependencies": { + "async-listener": "^0.6.0", + "emitter-listener": "^1.1.1" + } + }, + "node_modules/cookie": { + "version": "0.4.1", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-parser": { + "version": "1.4.6", + "license": "MIT", + "dependencies": { + "cookie": "0.4.1", + "cookie-signature": "1.0.6" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/cookie-signature": { + "version": "1.0.6", + "license": "MIT" + }, + "node_modules/croner": { + "version": "4.1.97", + "license": "MIT" + }, + "node_modules/crypto-js": { + "version": "4.2.0", + "license": "MIT" + }, + "node_modules/culvert": { + "version": "0.1.2", + "license": "MIT" + }, + "node_modules/data-uri-to-buffer": { + "version": "6.0.1", + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, + "node_modules/dayjs": { + "version": "1.11.10", + "license": "MIT" + }, + "node_modules/debug": { + "version": "2.6.9", + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/degenerator": { + "version": "5.0.1", + "license": "MIT", + "dependencies": { + "ast-types": "^0.13.4", + "escodegen": "^2.1.0", + "esprima": "^4.0.1" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/depd": { + "version": "1.1.2", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/destroy": { + "version": "1.0.4", + "license": "MIT" + }, + "node_modules/ee-first": { + "version": "1.1.1", + "license": "MIT" + }, + "node_modules/ejs": { + "version": "2.6.2", + "license": "Apache-2.0", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/emitter-listener": { + "version": "1.1.2", + "license": "BSD-2-Clause", + "dependencies": { + "shimmer": "^1.2.0" + } + }, + "node_modules/encodeurl": { + "version": "1.0.2", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/enquirer": { + "version": "2.3.6", + "license": "MIT", + "dependencies": { + "ansi-colors": "^4.1.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "license": "MIT" + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/escodegen": { + "version": "2.1.0", + "license": "BSD-2-Clause", + "dependencies": { + "esprima": "^4.0.1", + "estraverse": "^5.2.0", + "esutils": "^2.0.2" + }, + "bin": { + "escodegen": "bin/escodegen.js", + "esgenerate": "bin/esgenerate.js" + }, + "engines": { + "node": ">=6.0" + }, + "optionalDependencies": { + "source-map": "~0.6.1" + } + }, + "node_modules/esprima": { + "version": "4.0.1", + "license": "BSD-2-Clause", + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/etag": { + "version": "1.8.1", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/eventemitter2": { + "version": "5.0.1", + "license": "MIT" + }, + "node_modules/express": { + "version": "4.16.4", + "license": "MIT", + "dependencies": { + "accepts": "~1.3.5", + "array-flatten": "1.1.1", + "body-parser": "1.18.3", + "content-disposition": "0.5.2", + "content-type": "~1.0.4", + "cookie": "0.3.1", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "~1.1.2", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "1.1.1", + "fresh": "0.5.2", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "~2.3.0", + "parseurl": "~1.3.2", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.4", + "qs": "6.5.2", + "range-parser": "~1.2.0", + "safe-buffer": "5.1.2", + "send": "0.16.2", + "serve-static": "1.13.2", + "setprototypeof": "1.1.0", + "statuses": "~1.4.0", + "type-is": "~1.6.16", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/express-favicon": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/express-favicon/-/express-favicon-2.0.4.tgz", + "integrity": "sha512-JDGzumJdwF+WcJf+qwyhdpF1yzducuMCxZa+G6hxR3hor7ae/1CqpAPj8FXCGaGtqBA6ExDMfeszjuYRw5GUuQ==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/express/node_modules/cookie": { + "version": "0.3.1", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fast-json-patch": { + "version": "3.1.1", + "license": "MIT" + }, + "node_modules/fclone": { + "version": "1.0.11", + "license": "MIT" + }, + "node_modules/fill-range": { + "version": "7.0.1", + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/finalhandler": { + "version": "1.1.1", + "license": "MIT", + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "~2.3.0", + "parseurl": "~1.3.2", + "statuses": "~1.4.0", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/follow-redirects": { + "version": "1.15.4", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "license": "MIT", + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "0.5.2", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fs-extra": { + "version": "8.1.0", + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + }, + "engines": { + "node": ">=6 <7 || >=8" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "license": "ISC" + }, + "node_modules/function-bind": { + "version": "1.1.2", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-uri": { + "version": "6.0.2", + "license": "MIT", + "dependencies": { + "basic-ftp": "^5.0.2", + "data-uri-to-buffer": "^6.0.0", + "debug": "^4.3.4", + "fs-extra": "^8.1.0" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/get-uri/node_modules/debug": { + "version": "4.3.4", + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/get-uri/node_modules/ms": { + "version": "2.1.2", + "license": "MIT" + }, + "node_modules/git-node-fs": { + "version": "1.0.0", + "license": "MIT" + }, + "node_modules/git-sha1": { + "version": "0.1.2", + "license": "MIT" + }, + "node_modules/glob": { + "version": "7.2.3", + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "license": "ISC" + }, + "node_modules/has-flag": { + "version": "3.0.0", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/hasown": { + "version": "2.0.0", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/http-errors": { + "version": "1.6.3", + "license": "MIT", + "dependencies": { + "depd": "~1.1.2", + "inherits": "2.0.3", + "setprototypeof": "1.1.0", + "statuses": ">= 1.4.0 < 2" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/http-proxy-agent": { + "version": "7.0.0", + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.0", + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/http-proxy-agent/node_modules/debug": { + "version": "4.3.4", + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/http-proxy-agent/node_modules/ms": { + "version": "2.1.2", + "license": "MIT" + }, + "node_modules/https-proxy-agent": { + "version": "7.0.2", + "license": "MIT", + "dependencies": { + "agent-base": "^7.0.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/https-proxy-agent/node_modules/debug": { + "version": "4.3.4", + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/https-proxy-agent/node_modules/ms": { + "version": "2.1.2", + "license": "MIT" + }, + "node_modules/iconv-lite": { + "version": "0.4.23", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ignore-by-default": { + "version": "1.0.1", + "license": "ISC" + }, + "node_modules/inflight": { + "version": "1.0.6", + "license": "ISC", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.3", + "license": "ISC" + }, + "node_modules/ini": { + "version": "1.3.8", + "license": "ISC" + }, + "node_modules/ip": { + "version": "1.1.8", + "license": "MIT" + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "license": "MIT", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "license": "MIT", + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-core-module": { + "version": "2.13.1", + "license": "MIT", + "dependencies": { + "hasown": "^2.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/js-git": { + "version": "0.7.8", + "license": "MIT", + "dependencies": { + "bodec": "^0.1.0", + "culvert": "^0.1.2", + "git-sha1": "^0.1.2", + "pako": "^0.2.5" + } + }, + "node_modules/json-stringify-safe": { + "version": "5.0.1", + "license": "ISC", + "optional": true + }, + "node_modules/jsonfile": { + "version": "4.0.0", + "license": "MIT", + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/lazy": { + "version": "1.0.11", + "license": "MIT", + "engines": { + "node": ">=0.2.0" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "license": "MIT" + }, + "node_modules/log-driver": { + "version": "1.2.7", + "license": "ISC", + "engines": { + "node": ">=0.8.6" + } + }, + "node_modules/loguix": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/loguix/-/loguix-1.4.2.tgz", + "integrity": "sha512-fWp699F5Dqszpnriwotr3XvsaPXYAjmV3X2L4tmqUXgwHggvx1Fak1z3Ac7CeuVdIdYY5l85UQrEYPmhAb+IUw==" + }, + "node_modules/lru-cache": { + "version": "6.0.0", + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/media-typer": { + "version": "0.3.0", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/merge-descriptors": { + "version": "1.0.1", + "license": "MIT" + }, + "node_modules/methods": { + "version": "1.1.2", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime": { + "version": "1.4.1", + "license": "MIT", + "bin": { + "mime": "cli.js" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/mkdirp": { + "version": "1.0.4", + "license": "MIT", + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/module-details-from-path": { + "version": "1.0.3", + "license": "MIT" + }, + "node_modules/ms": { + "version": "2.0.0", + "license": "MIT" + }, + "node_modules/mute-stream": { + "version": "0.0.8", + "license": "ISC" + }, + "node_modules/needle": { + "version": "2.4.0", + "license": "MIT", + "dependencies": { + "debug": "^3.2.6", + "iconv-lite": "^0.4.4", + "sax": "^1.2.4" + }, + "bin": { + "needle": "bin/needle" + }, + "engines": { + "node": ">= 4.4.x" + } + }, + "node_modules/needle/node_modules/debug": { + "version": "3.2.7", + "license": "MIT", + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/needle/node_modules/ms": { + "version": "2.1.3", + "license": "MIT" + }, + "node_modules/negotiator": { + "version": "0.6.3", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/netmask": { + "version": "2.0.2", + "license": "MIT", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/nodemon": { + "version": "3.0.1", + "license": "MIT", + "dependencies": { + "chokidar": "^3.5.2", + "debug": "^3.2.7", + "ignore-by-default": "^1.0.1", + "minimatch": "^3.1.2", + "pstree.remy": "^1.1.8", + "semver": "^7.5.3", + "simple-update-notifier": "^2.0.0", + "supports-color": "^5.5.0", + "touch": "^3.1.0", + "undefsafe": "^2.0.5" + }, + "bin": { + "nodemon": "bin/nodemon.js" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/nodemon" + } + }, + "node_modules/nodemon/node_modules/debug": { + "version": "3.2.7", + "license": "MIT", + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/nodemon/node_modules/ms": { + "version": "2.1.3", + "license": "MIT" + }, + "node_modules/nopt": { + "version": "1.0.10", + "license": "MIT", + "dependencies": { + "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/nssocket": { + "version": "0.6.0", + "license": "MIT", + "dependencies": { + "eventemitter2": "~0.4.14", + "lazy": "~1.0.11" + }, + "engines": { + "node": ">= 0.10.x" + } + }, + "node_modules/nssocket/node_modules/eventemitter2": { + "version": "0.4.14", + "license": "MIT" + }, + "node_modules/on-finished": { + "version": "2.3.0", + "license": "MIT", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/once": { + "version": "1.4.0", + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/os-utils": { + "version": "0.0.14", + "license": "MIT" + }, + "node_modules/pac-proxy-agent": { + "version": "7.0.1", + "license": "MIT", + "dependencies": { + "@tootallnate/quickjs-emscripten": "^0.23.0", + "agent-base": "^7.0.2", + "debug": "^4.3.4", + "get-uri": "^6.0.1", + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.2", + "pac-resolver": "^7.0.0", + "socks-proxy-agent": "^8.0.2" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/pac-proxy-agent/node_modules/debug": { + "version": "4.3.4", + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/pac-proxy-agent/node_modules/ms": { + "version": "2.1.2", + "license": "MIT" + }, + "node_modules/pac-resolver": { + "version": "7.0.0", + "license": "MIT", + "dependencies": { + "degenerator": "^5.0.0", + "ip": "^1.1.8", + "netmask": "^2.0.2" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/pako": { + "version": "0.2.9", + "license": "MIT" + }, + "node_modules/parseurl": { + "version": "1.3.3", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "license": "MIT" + }, + "node_modules/path-to-regexp": { + "version": "0.1.7", + "license": "MIT" + }, + "node_modules/picomatch": { + "version": "2.3.1", + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pidusage": { + "version": "3.0.2", + "license": "MIT", + "dependencies": { + "safe-buffer": "^5.2.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/pidusage/node_modules/safe-buffer": { + "version": "5.2.1", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/pm2": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/pm2/-/pm2-5.3.0.tgz", + "integrity": "sha512-xscmQiAAf6ArVmKhjKTeeN8+Td7ZKnuZFFPw1DGkdFPR/0Iyx+m+1+OpCdf9+HQopX3VPc9/wqPQHqVOfHum9w==", + "dependencies": { + "@pm2/agent": "~2.0.0", + "@pm2/io": "~5.0.0", + "@pm2/js-api": "~0.6.7", + "@pm2/pm2-version-check": "latest", + "async": "~3.2.0", + "blessed": "0.1.81", + "chalk": "3.0.0", + "chokidar": "^3.5.3", + "cli-tableau": "^2.0.0", + "commander": "2.15.1", + "croner": "~4.1.92", + "dayjs": "~1.11.5", + "debug": "^4.3.1", + "enquirer": "2.3.6", + "eventemitter2": "5.0.1", + "fclone": "1.0.11", + "mkdirp": "1.0.4", + "needle": "2.4.0", + "pidusage": "~3.0", + "pm2-axon": "~4.0.1", + "pm2-axon-rpc": "~0.7.1", + "pm2-deploy": "~1.0.2", + "pm2-multimeter": "^0.1.2", + "promptly": "^2", + "semver": "^7.2", + "source-map-support": "0.5.21", + "sprintf-js": "1.1.2", + "vizion": "~2.2.1", + "yamljs": "0.3.0" + }, + "bin": { + "pm2": "bin/pm2", + "pm2-dev": "bin/pm2-dev", + "pm2-docker": "bin/pm2-docker", + "pm2-runtime": "bin/pm2-runtime" + }, + "engines": { + "node": ">=10.0.0" + }, + "optionalDependencies": { + "pm2-sysmonit": "^1.2.8" + } + }, + "node_modules/pm2-axon": { + "version": "4.0.1", + "license": "MIT", + "dependencies": { + "amp": "~0.3.1", + "amp-message": "~0.1.1", + "debug": "^4.3.1", + "escape-string-regexp": "^4.0.0" + }, + "engines": { + "node": ">=5" + } + }, + "node_modules/pm2-axon-rpc": { + "version": "0.7.1", + "license": "MIT", + "dependencies": { + "debug": "^4.3.1" + }, + "engines": { + "node": ">=5" + } + }, + "node_modules/pm2-axon-rpc/node_modules/debug": { + "version": "4.3.4", + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/pm2-axon-rpc/node_modules/ms": { + "version": "2.1.2", + "license": "MIT" + }, + "node_modules/pm2-axon/node_modules/debug": { + "version": "4.3.4", + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/pm2-axon/node_modules/ms": { + "version": "2.1.2", + "license": "MIT" + }, + "node_modules/pm2-deploy": { + "version": "1.0.2", + "license": "MIT", + "dependencies": { + "run-series": "^1.1.8", + "tv4": "^1.3.0" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/pm2-multimeter": { + "version": "0.1.2", + "license": "MIT/X11", + "dependencies": { + "charm": "~0.1.1" + } + }, + "node_modules/pm2-sysmonit": { + "version": "1.2.8", + "license": "Apache", + "optional": true, + "dependencies": { + "async": "^3.2.0", + "debug": "^4.3.1", + "pidusage": "^2.0.21", + "systeminformation": "^5.7", + "tx2": "~1.0.4" + } + }, + "node_modules/pm2-sysmonit/node_modules/debug": { + "version": "4.3.4", + "license": "MIT", + "optional": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/pm2-sysmonit/node_modules/ms": { + "version": "2.1.2", + "license": "MIT", + "optional": true + }, + "node_modules/pm2-sysmonit/node_modules/pidusage": { + "version": "2.0.21", + "license": "MIT", + "optional": true, + "dependencies": { + "safe-buffer": "^5.2.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/pm2-sysmonit/node_modules/safe-buffer": { + "version": "5.2.1", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "optional": true + }, + "node_modules/pm2/node_modules/debug": { + "version": "4.3.4", + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/pm2/node_modules/ms": { + "version": "2.1.2", + "license": "MIT" + }, + "node_modules/promptly": { + "version": "2.2.0", + "license": "MIT", + "dependencies": { + "read": "^1.0.4" + } + }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "license": "MIT", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/proxy-agent": { + "version": "6.3.1", + "license": "MIT", + "dependencies": { + "agent-base": "^7.0.2", + "debug": "^4.3.4", + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.2", + "lru-cache": "^7.14.1", + "pac-proxy-agent": "^7.0.1", + "proxy-from-env": "^1.1.0", + "socks-proxy-agent": "^8.0.2" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/proxy-agent/node_modules/debug": { + "version": "4.3.4", + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/proxy-agent/node_modules/lru-cache": { + "version": "7.18.3", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/proxy-agent/node_modules/ms": { + "version": "2.1.2", + "license": "MIT" + }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "license": "MIT" + }, + "node_modules/pstree.remy": { + "version": "1.1.8", + "license": "MIT" + }, + "node_modules/qs": { + "version": "6.5.2", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "2.3.3", + "license": "MIT", + "dependencies": { + "bytes": "3.0.0", + "http-errors": "1.6.3", + "iconv-lite": "0.4.23", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/read": { + "version": "1.0.7", + "license": "ISC", + "dependencies": { + "mute-stream": "~0.0.4" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/readdirp": { + "version": "3.6.0", + "license": "MIT", + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/require-in-the-middle": { + "version": "5.2.0", + "license": "MIT", + "dependencies": { + "debug": "^4.1.1", + "module-details-from-path": "^1.0.3", + "resolve": "^1.22.1" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/require-in-the-middle/node_modules/debug": { + "version": "4.3.4", + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/require-in-the-middle/node_modules/ms": { + "version": "2.1.2", + "license": "MIT" + }, + "node_modules/resolve": { + "version": "1.22.8", + "license": "MIT", + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/run-series": { + "version": "1.1.9", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/safe-buffer": { + "version": "5.1.2", + "license": "MIT" + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "license": "MIT" + }, + "node_modules/sax": { + "version": "1.3.0", + "license": "ISC" + }, + "node_modules/semver": { + "version": "7.5.4", + "license": "ISC", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/send": { + "version": "0.16.2", + "license": "MIT", + "dependencies": { + "debug": "2.6.9", + "depd": "~1.1.2", + "destroy": "~1.0.4", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "~1.6.2", + "mime": "1.4.1", + "ms": "2.0.0", + "on-finished": "~2.3.0", + "range-parser": "~1.2.0", + "statuses": "~1.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/serve-static": { + "version": "1.13.2", + "license": "MIT", + "dependencies": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.2", + "send": "0.16.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/setprototypeof": { + "version": "1.1.0", + "license": "ISC" + }, + "node_modules/shimmer": { + "version": "1.2.1", + "license": "BSD-2-Clause" + }, + "node_modules/signal-exit": { + "version": "3.0.7", + "license": "ISC" + }, + "node_modules/simple-update-notifier": { + "version": "2.0.0", + "license": "MIT", + "dependencies": { + "semver": "^7.5.3" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/smart-buffer": { + "version": "4.2.0", + "license": "MIT", + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks": { + "version": "2.7.1", + "license": "MIT", + "dependencies": { + "ip": "^2.0.0", + "smart-buffer": "^4.2.0" + }, + "engines": { + "node": ">= 10.13.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks-proxy-agent": { + "version": "8.0.2", + "license": "MIT", + "dependencies": { + "agent-base": "^7.0.2", + "debug": "^4.3.4", + "socks": "^2.7.1" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/socks-proxy-agent/node_modules/debug": { + "version": "4.3.4", + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/socks-proxy-agent/node_modules/ms": { + "version": "2.1.2", + "license": "MIT" + }, + "node_modules/socks/node_modules/ip": { + "version": "2.0.0", + "license": "MIT" + }, + "node_modules/source-map": { + "version": "0.6.1", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-support": { + "version": "0.5.21", + "license": "MIT", + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/sprintf-js": { + "version": "1.1.2", + "license": "BSD-3-Clause" + }, + "node_modules/statuses": { + "version": "1.4.0", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/supports-color": { + "version": "5.5.0", + "license": "MIT", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/systeminformation": { + "version": "5.21.22", + "license": "MIT", + "optional": true, + "os": [ + "darwin", + "linux", + "win32", + "freebsd", + "openbsd", + "netbsd", + "sunos", + "android" + ], + "bin": { + "systeminformation": "lib/cli.js" + }, + "engines": { + "node": ">=8.0.0" + }, + "funding": { + "type": "Buy me a coffee", + "url": "https://www.buymeacoffee.com/systeminfo" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/touch": { + "version": "3.1.0", + "license": "ISC", + "dependencies": { + "nopt": "~1.0.10" + }, + "bin": { + "nodetouch": "bin/nodetouch.js" + } + }, + "node_modules/tslib": { + "version": "1.9.3", + "license": "Apache-2.0" + }, + "node_modules/tv4": { + "version": "1.3.0", + "license": [ + { + "type": "Public Domain", + "url": "http://geraintluff.github.io/tv4/LICENSE.txt" + }, + { + "type": "MIT", + "url": "http://jsonary.com/LICENSE.txt" + } + ], + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/tx2": { + "version": "1.0.5", + "license": "MIT", + "optional": true, + "dependencies": { + "json-stringify-safe": "^5.0.1" + } + }, + "node_modules/type-is": { + "version": "1.6.18", + "license": "MIT", + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/undefsafe": { + "version": "2.0.5", + "license": "MIT" + }, + "node_modules/universalify": { + "version": "0.1.2", + "license": "MIT", + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/unpipe": { + "version": "1.0.0", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/utils-merge": { + "version": "1.0.1", + "license": "MIT", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/uuid": { + "version": "9.0.1", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "license": "MIT", + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/vizion": { + "version": "2.2.1", + "license": "Apache-2.0", + "dependencies": { + "async": "^2.6.3", + "git-node-fs": "^1.0.0", + "ini": "^1.3.5", + "js-git": "^0.7.8" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/vizion/node_modules/async": { + "version": "2.6.4", + "license": "MIT", + "dependencies": { + "lodash": "^4.17.14" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "license": "ISC" + }, + "node_modules/yallist": { + "version": "4.0.0", + "license": "ISC" + }, + "node_modules/yamljs": { + "version": "0.3.0", + "license": "MIT", + "dependencies": { + "argparse": "^1.0.7", + "glob": "^7.0.5" + }, + "bin": { + "json2yaml": "bin/json2yaml", + "yaml2json": "bin/yaml2json" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..4543f1f --- /dev/null +++ b/package.json @@ -0,0 +1,38 @@ +{ + "name": "inventory", + "version": "1.0.0", + "description": "Gestion de veteements", + "main": "index.js", + "scripts": { + "start": "nodemon ./bin/www", + "dev": "set DEV=true & nodemon ./bin/www" + }, + "repository": { + "type": "git", + "url": "https://git.raphix.fr/raphix/inventory.git" + }, + "nodemonConfig": { + "ext": "js, html", + "ignore": [ + "*.json" + ], + "delay": "10000000" + }, + "keywords": [], + "dependencies": { + "cookie-parser": "~1.4.4", + "crypto-js": "^4.2.0", + "debug": "~2.6.9", + "ejs": "~2.6.1", + "express": "~4.16.1", + "http-errors": "~1.6.3", + "loguix": "^1.4.2", + "nodemon": "^3.0.1", + "os-utils": "^0.0.14", + "pm2": "^5.3.0", + "express-favicon": "^2.0.4", + "uuid": "^9.0.1" + }, + "author": "Raphix", + "license": "ISC" +} diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..87d1dc962b3b305f7ff0d402df0ea603e9c47a7c GIT binary patch literal 10380 zcmV;7D09~U00962000000096X0Cp$<02TlM0EtjeM-2)Z3IG5A4M|8uQUCw}00001 z00;yC008!TVC?_^00D1uPE-NUqIa4A04Oj?L_t(|+U;EloR#AmpJ|y%>ur&wMU)n| zB2l(PT$RYu;^K(8@zoRue z<3T))k@ygq$dA6lM2x{;vJq}a8#F~tls7X42~mh8wilyQejcvH{TPm!_yRxU5YqEe z`}t80GVnWgkVt%pQFsXL&=8eKoD!noVb+(%xx}a^Fb(UlhZv}nGO-`u;(gK~9nk<~ z6Jp>c#+Rb=-WemX6uSyg@46@pd$9`Ra2L);nS>xjm-SU}HJ!=D*o{*tY|0^>una@d z7H1+kAqIub{4+@vzk&@oj%ZT`e!$!4irRiBG9d<$WPKI1$7}c=C*dVJg>9IGP9&HK zA&40BQ*jA~V7+GZPOp8ig&fURe%l~Hy3TzyGP>sB55xi;#S(HsYbSJp9_A;b5uU*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#R(#tu5e)fH;MHqQ=4#emqdy0paFD!<;C2A`Cr5}~O1d^5HKqRk} zUeZa778&g-{4M>o3&2Qi-)4Zx4^(I_{oX_t_MQM3SUD=aeRHf4tvbG?Jrk}yJayN0 z`m5t@g_84w81Xnt##z}xLen3n0v2X|DZ2IND@8-xc2M(}WPgAyut<|4&ctF8g7RWQz#e*;KYbN`^pfl3 zx5I1&%+p}g?}C_Re}G5ufwtQ?lQh9Swm)3Z*7*MKGg{vHTG;p4fZCn#k;d+&Wie#= zhuNMgcw1w^RyNrL1IWH8R*(?*{?9)YBX4H-^^OAHVe7evu||{4VbWYX4ie+!z%0I` zIX|}x6VSdOKuBNkHBI?Fdqa(NfEzltHO46-oaPm}w|NtbV?hK;qPO-s{&c#Z2cw1E zj}y3Mz97tW<##MG>V88o-Z1u>qCb{vyYc<28Y0(W6u|T~G7tvu5ankEQD%3ywPW)Kh!pO%b>Rs}UJGf-f-=x8NLqn+E+{ATgIPFeh;h z++7H@=-L^I6%ngG-fTlj7cus`M4%?#(G0=prY!u5g``4nAq%fr_qBExK(_DZ9`d|$&N%KQKkD2>My&!tG(Gaf3NMEx~?K zAxI%1m{JIsKar-Rm_y7jonXG4CTNM*uq$Sne*lw7?I%vYk`N@LAqJ7-bSkD;pNp;d zFPhnReuDXGLSRe_xD)eY^# zI1T5bEgr`de1$z4n!?1UhB|hG8 z=MoeT0#F-2=3)QuXpuPk@go8Q^9aB@o`zvgkY)imCkRLMFs@9nKfXjD5I|}gN+tv# zz679-3&rzrlqYZ|C@K!&Q;q;kPMrUE6oFdUV%h(fCD q!+tR&-~<&-5qJ>e%yN!+rT+s|l!mN0yRBgW0000DÉVELOPEMENT

"}); + } else { + + res.render('index', {dev: ""}); + } + + + } +}); + +module.exports = router; diff --git a/routes/login.js b/routes/login.js new file mode 100644 index 0000000..6bcdd0e --- /dev/null +++ b/routes/login.js @@ -0,0 +1,61 @@ +var express = require('express'); +var router = express.Router(); +var auth = require("../bin/auth") + +/* GET home page. */ +router.get('/', function(req, res, next) { + + if(auth.check(req.cookies.token)) { + + res.redirect(302, "/") + } else { + res.clearCookie('token') + res.render('login', {version: require("../package.json").version}); + } + + +}); + +module.exports = router; + +router.post("/", (req, res) => { + const body = req.body + + const token = auth.login({ + username: body.username, + password: body.password + }) + + if(token == "AUTH_FAILED") { + + setTimeout(() => { + res.status(403).send("AUTH_FAILED") + }, 1000) + + + + } else { + + res.cookie('token' , token, { maxAge: 900000000, httpOnly: true }) + res.status(200).send("AUTH_SUCCESS") + } + +}) + +router.get('/signout', function(req, res, next) { + + if(!auth.check(req.cookies.token)) { + + res.clearCookie('token') + res.redirect(302, "/") + + + } else { + + auth.signout(req.cookies.token) + res.clearCookie('token') + res.redirect(302, "/") + + } + +}); \ No newline at end of file diff --git a/routes/stylepage.js b/routes/stylepage.js new file mode 100644 index 0000000..6aaac1d --- /dev/null +++ b/routes/stylepage.js @@ -0,0 +1,9 @@ +var express = require('express'); +var router = express.Router(); + +/* GET home page. */ +router.get('/', function(req, res, next) { + res.render('utils/stylepage'); +}); + +module.exports = router; diff --git a/views/index.ejs b/views/index.ejs new file mode 100644 index 0000000..5097c40 --- /dev/null +++ b/views/index.ejs @@ -0,0 +1,12 @@ + + + + Inventory + + + + + + + + diff --git a/views/login.ejs b/views/login.ejs new file mode 100644 index 0000000..9b60209 --- /dev/null +++ b/views/login.ejs @@ -0,0 +1,14 @@ + + + + Inventory + + + + + + + + + + diff --git a/views/utils/error.ejs b/views/utils/error.ejs new file mode 100644 index 0000000..3996e99 --- /dev/null +++ b/views/utils/error.ejs @@ -0,0 +1,32 @@ + + + + Inventory - Erreur + + + + +
+

Erreur <%= error.status %>

+

<%= message %> - <%= error.status %>

+
<%= error.stack %>
+ +
+
+ + + + diff --git a/views/utils/stylepage.ejs b/views/utils/stylepage.ejs new file mode 100644 index 0000000..2331523 --- /dev/null +++ b/views/utils/stylepage.ejs @@ -0,0 +1,75 @@ + + + + Inventory + + + +

Inventory - Page de style

+

Cette page est dédiée au développement et n'est pas en relation avec Inventory.

+ +
+

Police : 'Roboto', sans-serif

+

Liens : https://inventory.raphix.fr/stylepage

+
+
+ + +
+

Classe : btn

+
+ + + + + +
+

Classe : btn min

+
+ + + +
+
+

#323031

+

#f10000

+

#605e5863

+
+

Classe : field

+ + + + + +