├── app-vue ├── src │ ├── boot │ │ ├── .gitkeep │ │ └── axios.js │ ├── components │ │ ├── .gitkeep │ │ ├── Runner.vue │ │ └── Servers.vue │ ├── css │ │ ├── app.styl │ │ └── quasar.variables.styl │ ├── statics │ │ ├── quasar-logo.png │ │ └── icons │ │ │ ├── icon-128x128.png │ │ │ ├── icon-192x192.png │ │ │ ├── icon-256x256.png │ │ │ ├── icon-384x384.png │ │ │ ├── icon-512x512.png │ │ │ ├── favicon-16x16.png │ │ │ ├── favicon-32x32.png │ │ │ ├── ms-icon-144x144.png │ │ │ └── apple-icon-152x152.png │ ├── App.vue │ ├── router │ │ ├── routes.js │ │ └── index.js │ ├── pages │ │ ├── Error404.vue │ │ └── Index.vue │ ├── index.template.html │ ├── layouts │ │ └── MyLayout.vue │ └── assets │ │ ├── sad.svg │ │ └── quasar-logo-full.svg ├── README.md ├── babel.config.js ├── .editorconfig ├── .postcssrc.js ├── .gitignore ├── package.json └── quasar.conf.js ├── logs └── .gitignore ├── temp └── .gitignore ├── nginx ├── logs │ └── .gitignore ├── temp │ └── .gitignore ├── contrib │ ├── vim │ │ ├── ftplugin │ │ │ └── nginx.vim │ │ ├── ftdetect │ │ │ └── nginx.vim │ │ └── indent │ │ │ └── nginx.vim │ ├── README │ ├── unicode2nginx │ │ ├── unicode-to-nginx.pl │ │ ├── win-utf │ │ └── koi-utf │ └── geo2nginx.pl ├── docs │ ├── README │ ├── zlib.LICENSE │ ├── LICENSE │ ├── PCRE.LICENCE │ └── OpenSSL.LICENSE ├── nginx.exe ├── html │ ├── 50x.html │ └── index.html └── conf │ ├── scgi_params │ ├── uwsgi_params │ ├── fastcgi_params │ ├── fastcgi.conf │ ├── koi-win │ ├── koi-utf │ ├── win-utf │ └── mime.types ├── server ├── logs │ └── .gitignore ├── db │ ├── .gitignore │ └── data.init.json ├── utils │ └── logger.js ├── main.js ├── DeployDB.js └── services │ └── NginxService.js ├── demo └── Capture.PNG ├── .gitignore ├── .npmignore ├── README.md ├── tsconfig.json ├── app-common └── EditServerCommon.js ├── package.json └── LICENSE /app-vue/src/boot/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app-vue/src/components/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /logs/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /temp/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /nginx/logs/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /nginx/temp/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /server/logs/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /app-vue/src/css/app.styl: -------------------------------------------------------------------------------- 1 | // app global css 2 | -------------------------------------------------------------------------------- /app-vue/README.md: -------------------------------------------------------------------------------- 1 | # Quasar App 2 | 3 | > WIP 4 | -------------------------------------------------------------------------------- /server/db/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | !data.init.json -------------------------------------------------------------------------------- /nginx/contrib/vim/ftplugin/nginx.vim: -------------------------------------------------------------------------------- 1 | setlocal commentstring=#\ %s 2 | -------------------------------------------------------------------------------- /nginx/docs/README: -------------------------------------------------------------------------------- 1 | 2 | Documentation is available at http://nginx.org 3 | 4 | -------------------------------------------------------------------------------- /demo/Capture.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThibaudL/nginx-gui/HEAD/demo/Capture.PNG -------------------------------------------------------------------------------- /nginx/nginx.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThibaudL/nginx-gui/HEAD/nginx/nginx.exe -------------------------------------------------------------------------------- /app-vue/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@quasar/babel-preset-app' 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /app-vue/src/statics/quasar-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThibaudL/nginx-gui/HEAD/app-vue/src/statics/quasar-logo.png -------------------------------------------------------------------------------- /app-vue/src/statics/icons/icon-128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThibaudL/nginx-gui/HEAD/app-vue/src/statics/icons/icon-128x128.png -------------------------------------------------------------------------------- /app-vue/src/statics/icons/icon-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThibaudL/nginx-gui/HEAD/app-vue/src/statics/icons/icon-192x192.png -------------------------------------------------------------------------------- /app-vue/src/statics/icons/icon-256x256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThibaudL/nginx-gui/HEAD/app-vue/src/statics/icons/icon-256x256.png -------------------------------------------------------------------------------- /app-vue/src/statics/icons/icon-384x384.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThibaudL/nginx-gui/HEAD/app-vue/src/statics/icons/icon-384x384.png -------------------------------------------------------------------------------- /app-vue/src/statics/icons/icon-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThibaudL/nginx-gui/HEAD/app-vue/src/statics/icons/icon-512x512.png -------------------------------------------------------------------------------- /app-vue/src/boot/axios.js: -------------------------------------------------------------------------------- 1 | import axios from 'axios' 2 | 3 | export default async ({ Vue }) => { 4 | Vue.prototype.$axios = axios 5 | } 6 | -------------------------------------------------------------------------------- /app-vue/src/statics/icons/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThibaudL/nginx-gui/HEAD/app-vue/src/statics/icons/favicon-16x16.png -------------------------------------------------------------------------------- /app-vue/src/statics/icons/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThibaudL/nginx-gui/HEAD/app-vue/src/statics/icons/favicon-32x32.png -------------------------------------------------------------------------------- /app-vue/src/statics/icons/ms-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThibaudL/nginx-gui/HEAD/app-vue/src/statics/icons/ms-icon-144x144.png -------------------------------------------------------------------------------- /app-vue/src/statics/icons/apple-icon-152x152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThibaudL/nginx-gui/HEAD/app-vue/src/statics/icons/apple-icon-152x152.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .idea 3 | logs/** 4 | server/logs/** 5 | nginx/logs/** 6 | server/db/data.json 7 | public/dist/** 8 | nginx/conf/nginx.conf 9 | nginx/conf/nginx.tmp.conf 10 | .npmrc -------------------------------------------------------------------------------- /app-vue/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | logs/access.log 2 | logs/error.log 3 | logs/nginx.pid 4 | server/db/data.json 5 | server/logs/logs.log 6 | node_modules 7 | .idea 8 | .iml 9 | app 10 | webpacl.config.js 11 | tsconfig.json 12 | .npmrc -------------------------------------------------------------------------------- /app-vue/src/App.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 12 | 13 | 15 | -------------------------------------------------------------------------------- /app-vue/.postcssrc.js: -------------------------------------------------------------------------------- 1 | // https://github.com/michael-ciniawsky/postcss-load-config 2 | 3 | module.exports = { 4 | plugins: [ 5 | // to edit target browsers: use "browserslist" field in package.json 6 | require('autoprefixer') 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /nginx/contrib/vim/ftdetect/nginx.vim: -------------------------------------------------------------------------------- 1 | au BufRead,BufNewFile *.nginx set ft=nginx 2 | au BufRead,BufNewFile */etc/nginx/* set ft=nginx 3 | au BufRead,BufNewFile */usr/local/nginx/conf/* set ft=nginx 4 | au BufRead,BufNewFile nginx.conf set ft=nginx 5 | -------------------------------------------------------------------------------- /nginx/contrib/vim/indent/nginx.vim: -------------------------------------------------------------------------------- 1 | if exists("b:did_indent") 2 | finish 3 | endif 4 | let b:did_indent = 1 5 | 6 | setlocal indentexpr= 7 | 8 | " cindent actually works for nginx' simple file structure 9 | setlocal cindent 10 | " Just make sure that the comments are not reset as defs would be. 11 | setlocal cinkeys-=0# 12 | -------------------------------------------------------------------------------- /app-vue/.gitignore: -------------------------------------------------------------------------------- 1 | .quasar 2 | .DS_Store 3 | .thumbs.db 4 | node_modules 5 | /dist 6 | /src-cordova/node_modules 7 | /src-cordova/platforms 8 | /src-cordova/plugins 9 | /src-cordova/www 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | 14 | # Editor directories and files 15 | .idea 16 | .vscode 17 | *.suo 18 | *.ntvs* 19 | *.njsproj 20 | *.sln 21 | -------------------------------------------------------------------------------- /app-vue/src/router/routes.js: -------------------------------------------------------------------------------- 1 | 2 | const routes = [ 3 | { 4 | path: '/', 5 | component: () => import('layouts/MyLayout.vue'), 6 | children: [ 7 | { path: '', component: () => import('pages/Index.vue') } 8 | ] 9 | } 10 | ] 11 | 12 | // Always leave this as last one 13 | if (process.env.MODE !== 'ssr') { 14 | routes.push({ 15 | path: '*', 16 | component: () => import('pages/Error404.vue') 17 | }) 18 | } 19 | 20 | export default routes 21 | -------------------------------------------------------------------------------- /app-vue/src/pages/Error404.vue: -------------------------------------------------------------------------------- 1 | 17 | 18 | 23 | -------------------------------------------------------------------------------- /nginx/html/50x.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Error 5 | 12 | 13 | 14 |

An error occurred.

15 |

Sorry, the page you are looking for is currently unavailable.
16 | Please try again later.

17 |

If you are the system administrator of this resource then you should check 18 | the error log for details.

19 |

Faithfully yours, nginx.

20 | 21 | 22 | -------------------------------------------------------------------------------- /nginx/contrib/README: -------------------------------------------------------------------------------- 1 | 2 | geo2nginx.pl by Andrei Nigmatulin 3 | 4 | The perl script to convert CSV geoip database ( free download 5 | at http://www.maxmind.com/app/geoip_country ) to format, suitable 6 | for use by the ngx_http_geo_module. 7 | 8 | 9 | unicode2nginx by Maxim Dounin 10 | 11 | The perl script to convert unicode mappings ( available 12 | at http://www.unicode.org/Public/MAPPINGS/ ) to the nginx 13 | configuration file format. 14 | Two generated full maps for windows-1251 and koi8-r. 15 | 16 | 17 | vim by Evan Miller 18 | 19 | Syntax highlighting of nginx configuration for vim, to be 20 | placed into ~/.vim/. 21 | 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![version](https://img.shields.io/npm/v/nginx-gui.svg) 2 | 3 | ## Requirings : 4 | - node 10 or more 5 | - Windows only for now 6 | 7 | ## How to use : 8 | **With npm :** 9 | ``npm i -g nginx-gui`` 10 | 11 | Then run : 12 | ``nginx-gui`` and access http://localhost:9004/vue 13 | 14 | Or : 15 | 16 | ``nginx-gui --start-nginx`` for an auto start of nginx 17 | ## DEV MODE : 18 | 19 | - run ``npm start`` 20 | - run ``npm run server:dev`` 21 | 22 | - open [http://localhost:8080/webpack-dev-server/](http://localhost:8080/webpack-dev-server/) 23 | 24 | ## Example : 25 | 26 | ![capture](https://raw.githubusercontent.com/ThibaudL/nginx-gui/master/demo/Capture.PNG) 27 | -------------------------------------------------------------------------------- /app-vue/src/css/quasar.variables.styl: -------------------------------------------------------------------------------- 1 | // Quasar Stylus Variables 2 | // -------------------------------------------------- 3 | // To customize the look and feel of this app, you can override 4 | // the Stylus variables found in Quasar's source Stylus files. 5 | 6 | // Check documentation for full list of Quasar variables 7 | 8 | // It's highly recommended to change the default colors 9 | // to match your app's branding. 10 | // Tip: Use the "Theme Builder" on Quasar's documentation website. 11 | 12 | $primary = #027BE3 13 | $secondary = #26A69A 14 | $accent = #9C27B0 15 | 16 | $positive = #21BA45 17 | $negative = #C10015 18 | $info = #31CCEC 19 | $warning = #F2C037 20 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "moduleResolution": "node", 6 | "sourceMap": true, 7 | "experimentalDecorators": true, 8 | "emitDecoratorMetadata": true, 9 | "removeComments": false, 10 | "noImplicitAny": false, 11 | "allowJs": true, 12 | "lib": [ 13 | "es2016", 14 | "dom" 15 | ], 16 | "types": [ 17 | "node" 18 | ] 19 | }, 20 | "exclude": [ 21 | "node_modules", 22 | "dist" 23 | ], 24 | "include": [ 25 | "/src/**/*" 26 | ], 27 | "awesomeTypescriptLoaderOptions": { 28 | "forkChecker": true, 29 | "useWebpackText": true 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /nginx/conf/scgi_params: -------------------------------------------------------------------------------- 1 | 2 | scgi_param REQUEST_METHOD $request_method; 3 | scgi_param REQUEST_URI $request_uri; 4 | scgi_param QUERY_STRING $query_string; 5 | scgi_param CONTENT_TYPE $content_type; 6 | 7 | scgi_param DOCUMENT_URI $document_uri; 8 | scgi_param DOCUMENT_ROOT $document_root; 9 | scgi_param SCGI 1; 10 | scgi_param SERVER_PROTOCOL $server_protocol; 11 | scgi_param REQUEST_SCHEME $scheme; 12 | scgi_param HTTPS $https if_not_empty; 13 | 14 | scgi_param REMOTE_ADDR $remote_addr; 15 | scgi_param REMOTE_PORT $remote_port; 16 | scgi_param SERVER_PORT $server_port; 17 | scgi_param SERVER_NAME $server_name; 18 | -------------------------------------------------------------------------------- /nginx/html/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Welcome to nginx! 5 | 12 | 13 | 14 |

Welcome to nginx!

15 |

If you see this page, the nginx web server is successfully installed and 16 | working. Further configuration is required.

17 | 18 |

For online documentation and support please refer to 19 | nginx.org.
20 | Commercial support is available at 21 | nginx.com.

22 | 23 |

Thank you for using nginx.

24 | 25 | 26 | -------------------------------------------------------------------------------- /app-vue/src/router/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import VueRouter from 'vue-router' 3 | 4 | import routes from './routes' 5 | 6 | Vue.use(VueRouter) 7 | 8 | /* 9 | * If not building with SSR mode, you can 10 | * directly export the Router instantiation 11 | */ 12 | 13 | export default function (/* { store, ssrContext } */) { 14 | const Router = new VueRouter({ 15 | scrollBehavior: () => ({ x: 0, y: 0 }), 16 | routes, 17 | 18 | // Leave these as is and change from quasar.conf.js instead! 19 | // quasar.conf.js -> build -> vueRouterMode 20 | // quasar.conf.js -> build -> publicPath 21 | mode: process.env.VUE_ROUTER_MODE, 22 | base: process.env.VUE_ROUTER_BASE 23 | }) 24 | 25 | return Router 26 | } 27 | -------------------------------------------------------------------------------- /nginx/conf/uwsgi_params: -------------------------------------------------------------------------------- 1 | 2 | uwsgi_param QUERY_STRING $query_string; 3 | uwsgi_param REQUEST_METHOD $request_method; 4 | uwsgi_param CONTENT_TYPE $content_type; 5 | uwsgi_param CONTENT_LENGTH $content_length; 6 | 7 | uwsgi_param REQUEST_URI $request_uri; 8 | uwsgi_param PATH_INFO $document_uri; 9 | uwsgi_param DOCUMENT_ROOT $document_root; 10 | uwsgi_param SERVER_PROTOCOL $server_protocol; 11 | uwsgi_param REQUEST_SCHEME $scheme; 12 | uwsgi_param HTTPS $https if_not_empty; 13 | 14 | uwsgi_param REMOTE_ADDR $remote_addr; 15 | uwsgi_param REMOTE_PORT $remote_port; 16 | uwsgi_param SERVER_PORT $server_port; 17 | uwsgi_param SERVER_NAME $server_name; 18 | -------------------------------------------------------------------------------- /app-common/EditServerCommon.js: -------------------------------------------------------------------------------- 1 | export default class EditServerCommon { 2 | static sample(server) { 3 | return `server { 4 | listen ${server.port}; 5 | server_name ${server.name}; 6 | 7 | access_log ./logs/json.log json_logs; 8 | ${(server.extraConf || '# No additionnal server configuration')} 9 | 10 | ${server.locations.filter(location => location.enable).map(this.sampleLocation).join('\r\n')} 11 | }`; 12 | 13 | 14 | } 15 | 16 | static sampleLocation(location) { 17 | return ` 18 | location ${location.location || ''} { 19 | ${location.proxyPass ? 'proxy_pass '+location.proxyPass+';' : '# No proxy_pass parametred'} 20 | ${(location.extraConf || '# No additionnal location configuration')} 21 | }`; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /app-vue/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nginx-gui-vue", 3 | "version": "0.0.1", 4 | "description": "A Quasar Framework app", 5 | "productName": "nginx-gui-vue", 6 | "cordovaId": "org.cordova.quasar.app", 7 | "author": "thibaud.lamarche@gmail.com", 8 | "private": true, 9 | "scripts": { 10 | "test": "echo \"No test specified\" && exit 0", 11 | "dev": "quasar dev", 12 | "build": "quasar build" 13 | }, 14 | "dependencies": { 15 | "@quasar/extras": "^1.3.1", 16 | "axios": "^0.19.0", 17 | "es-abstract": "^1.19.1", 18 | "quasar": "1.1.0" 19 | }, 20 | "devDependencies": { 21 | "@quasar/app": "^1.0.6", 22 | "strip-ansi": "=3.0.1" 23 | }, 24 | "engines": { 25 | "node": ">= 8.9.0", 26 | "npm": ">= 5.6.0", 27 | "yarn": ">= 1.6.0" 28 | }, 29 | "browserslist": [ 30 | "last 1 version, not dead, ie >= 11" 31 | ], 32 | "resolutions": { 33 | "ajv": "6.8.1" 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /app-vue/src/index.template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | <%= htmlWebpackPlugin.options.productName %> 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /server/utils/logger.js: -------------------------------------------------------------------------------- 1 | const winston = require('winston'); 2 | const path = require('path'); 3 | 4 | winston.emitErrs = true; 5 | 6 | var logger = new winston.Logger({ 7 | transports: [ 8 | new winston.transports.File({ 9 | level: 'debug', 10 | filename: path.join(__dirname, '../logs/logs.log'), 11 | handleExceptions: true, 12 | json: true, 13 | maxsize: 5242880, //5MB 14 | maxFiles: 5, 15 | colorize: false 16 | }), 17 | new winston.transports.Console({ 18 | level: 'debug', 19 | handleExceptions: true, 20 | json: false, 21 | colorize: true 22 | }) 23 | ], 24 | exitOnError: false 25 | }); 26 | 27 | module.exports = logger; 28 | module.exports.stream = { 29 | info: function (message, encoding) { 30 | logger.info(message); 31 | }, 32 | debug: function (message, encoding) { 33 | logger.debug(message); 34 | } 35 | }; 36 | -------------------------------------------------------------------------------- /nginx/docs/zlib.LICENSE: -------------------------------------------------------------------------------- 1 | (C) 1995-2017 Jean-loup Gailly and Mark Adler 2 | 3 | This software is provided 'as-is', without any express or implied 4 | warranty. In no event will the authors be held liable for any damages 5 | arising from the use of this software. 6 | 7 | Permission is granted to anyone to use this software for any purpose, 8 | including commercial applications, and to alter it and redistribute it 9 | freely, subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must not 12 | claim that you wrote the original software. If you use this software 13 | in a product, an acknowledgment in the product documentation would be 14 | appreciated but is not required. 15 | 2. Altered source versions must be plainly marked as such, and must not be 16 | misrepresented as being the original software. 17 | 3. This notice may not be removed or altered from any source distribution. 18 | 19 | Jean-loup Gailly Mark Adler 20 | jloup@gzip.org madler@alumni.caltech.edu 21 | -------------------------------------------------------------------------------- /nginx/conf/fastcgi_params: -------------------------------------------------------------------------------- 1 | 2 | fastcgi_param QUERY_STRING $query_string; 3 | fastcgi_param REQUEST_METHOD $request_method; 4 | fastcgi_param CONTENT_TYPE $content_type; 5 | fastcgi_param CONTENT_LENGTH $content_length; 6 | 7 | fastcgi_param SCRIPT_NAME $fastcgi_script_name; 8 | fastcgi_param REQUEST_URI $request_uri; 9 | fastcgi_param DOCUMENT_URI $document_uri; 10 | fastcgi_param DOCUMENT_ROOT $document_root; 11 | fastcgi_param SERVER_PROTOCOL $server_protocol; 12 | fastcgi_param REQUEST_SCHEME $scheme; 13 | fastcgi_param HTTPS $https if_not_empty; 14 | 15 | fastcgi_param GATEWAY_INTERFACE CGI/1.1; 16 | fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; 17 | 18 | fastcgi_param REMOTE_ADDR $remote_addr; 19 | fastcgi_param REMOTE_PORT $remote_port; 20 | fastcgi_param SERVER_ADDR $server_addr; 21 | fastcgi_param SERVER_PORT $server_port; 22 | fastcgi_param SERVER_NAME $server_name; 23 | 24 | # PHP only, required if PHP was built with --enable-force-cgi-redirect 25 | fastcgi_param REDIRECT_STATUS 200; 26 | -------------------------------------------------------------------------------- /nginx/conf/fastcgi.conf: -------------------------------------------------------------------------------- 1 | 2 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 3 | fastcgi_param QUERY_STRING $query_string; 4 | fastcgi_param REQUEST_METHOD $request_method; 5 | fastcgi_param CONTENT_TYPE $content_type; 6 | fastcgi_param CONTENT_LENGTH $content_length; 7 | 8 | fastcgi_param SCRIPT_NAME $fastcgi_script_name; 9 | fastcgi_param REQUEST_URI $request_uri; 10 | fastcgi_param DOCUMENT_URI $document_uri; 11 | fastcgi_param DOCUMENT_ROOT $document_root; 12 | fastcgi_param SERVER_PROTOCOL $server_protocol; 13 | fastcgi_param REQUEST_SCHEME $scheme; 14 | fastcgi_param HTTPS $https if_not_empty; 15 | 16 | fastcgi_param GATEWAY_INTERFACE CGI/1.1; 17 | fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; 18 | 19 | fastcgi_param REMOTE_ADDR $remote_addr; 20 | fastcgi_param REMOTE_PORT $remote_port; 21 | fastcgi_param SERVER_ADDR $server_addr; 22 | fastcgi_param SERVER_PORT $server_port; 23 | fastcgi_param SERVER_NAME $server_name; 24 | 25 | # PHP only, required if PHP was built with --enable-force-cgi-redirect 26 | fastcgi_param REDIRECT_STATUS 200; 27 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nginx-gui", 3 | "version": "2.0.3-0", 4 | "description": "", 5 | "keywords": [ 6 | "nginx", 7 | "gui" 8 | ], 9 | "author": "Thibaud Lamarche (thibaud.lamarche@gmail.com)", 10 | "homepage": "https://github.com/ThibaudL/nginx-gui", 11 | "bin": { 12 | "nginx-gui": "./server/main.js" 13 | }, 14 | "scripts": { 15 | "server:dev": "node server/main.js" 16 | }, 17 | "dependencies": { 18 | "body-parser": "^1.18.2", 19 | "bootstrap": "3.4.1", 20 | "bootstrap-toggle": "2.2.2", 21 | "debug": "^3.0.1", 22 | "express": "^4.16.2", 23 | "fkill": "5.3.0", 24 | "lokijs": "^1.5.1", 25 | "node-fetch": "^1.7.3", 26 | "opn": "^6.0.0", 27 | "request": "^2.83.0", 28 | "winston": "^2.4.0", 29 | "ws": "^3.3.2" 30 | }, 31 | "devDependencies": { 32 | "@types/core-js": "0.9.41", 33 | "@types/node": "7.0.13", 34 | "awesome-typescript-loader": "5.2.1", 35 | "css-loader": "2.1.1", 36 | "json-loader": "0.5.4", 37 | "raw-loader": "0.5.1", 38 | "url-loader": "1.1.2", 39 | "expose-loader": "0.7.5", 40 | "file-loader": "3.0.1", 41 | "source-map-loader": "^0.2.1", 42 | "style-loader": "0.16.1", 43 | "typescript": "3.3.3333" 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /nginx/contrib/unicode2nginx/unicode-to-nginx.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | # Convert unicode mappings to nginx configuration file format. 4 | 5 | # You may find useful mappings in various places, including 6 | # unicode.org official site: 7 | # 8 | # http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1251.TXT 9 | # http://www.unicode.org/Public/MAPPINGS/VENDORS/MISC/KOI8-R.TXT 10 | 11 | # Needs perl 5.6 or later. 12 | 13 | # Written by Maxim Dounin, mdounin@mdounin.ru 14 | 15 | ############################################################################### 16 | 17 | require 5.006; 18 | 19 | while (<>) { 20 | # Skip comments and empty lines 21 | 22 | next if /^#/; 23 | next if /^\s*$/; 24 | chomp; 25 | 26 | # Convert mappings 27 | 28 | if (/^\s*0x(..)\s*0x(....)\s*(#.*)/) { 29 | # Mapping "#" 30 | my $cs_code = $1; 31 | my $un_code = $2; 32 | my $un_name = $3; 33 | 34 | # Produce UTF-8 sequence from character code; 35 | 36 | my $un_utf8 = join('', 37 | map { sprintf("%02X", $_) } 38 | unpack("U0C*", pack("U", hex($un_code))) 39 | ); 40 | 41 | print " $cs_code $un_utf8 ; $un_name\n"; 42 | 43 | } else { 44 | warn "Unrecognized line: '$_'"; 45 | } 46 | } 47 | 48 | ############################################################################### 49 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 2-Clause License 2 | 3 | Copyright (c) 2019, ThibaudL 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | -------------------------------------------------------------------------------- /nginx/contrib/geo2nginx.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | # (c) Andrei Nigmatulin, 2005 4 | # 5 | # this script provided "as is", without any warranties. use it at your own risk. 6 | # 7 | # special thanx to Andrew Sitnikov for perl port 8 | # 9 | # this script converts CSV geoip database (free download at http://www.maxmind.com/app/geoip_country) 10 | # to format, suitable for use with nginx_http_geo module (http://sysoev.ru/nginx) 11 | # 12 | # for example, line with ip range 13 | # 14 | # "62.16.68.0","62.16.127.255","1041253376","1041268735","RU","Russian Federation" 15 | # 16 | # will be converted to four subnetworks: 17 | # 18 | # 62.16.68.0/22 RU; 19 | # 62.16.72.0/21 RU; 20 | # 62.16.80.0/20 RU; 21 | # 62.16.96.0/19 RU; 22 | 23 | 24 | use warnings; 25 | use strict; 26 | 27 | while( ){ 28 | if (/"[^"]+","[^"]+","([^"]+)","([^"]+)","([^"]+)"/){ 29 | print_subnets($1, $2, $3); 30 | } 31 | } 32 | 33 | sub print_subnets { 34 | my ($a1, $a2, $c) = @_; 35 | my $l; 36 | while ($a1 <= $a2) { 37 | for ($l = 0; ($a1 & (1 << $l)) == 0 && ($a1 + ((1 << ($l + 1)) - 1)) <= $a2; $l++){}; 38 | print long2ip($a1) . "/" . (32 - $l) . " " . $c . ";\n"; 39 | $a1 += (1 << $l); 40 | } 41 | } 42 | 43 | sub long2ip { 44 | my $ip = shift; 45 | 46 | my $str = 0; 47 | 48 | $str = ($ip & 255); 49 | 50 | $ip >>= 8; 51 | $str = ($ip & 255).".$str"; 52 | 53 | $ip >>= 8; 54 | $str = ($ip & 255).".$str"; 55 | 56 | $ip >>= 8; 57 | $str = ($ip & 255).".$str"; 58 | } 59 | -------------------------------------------------------------------------------- /nginx/docs/LICENSE: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2017 Igor Sysoev 3 | * Copyright (C) 2011-2017 Nginx, Inc. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 16 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 19 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 | * SUCH DAMAGE. 26 | */ 27 | -------------------------------------------------------------------------------- /server/db/data.init.json: -------------------------------------------------------------------------------- 1 | {"filename":"D:\\Intellij workspace\\Nginx-gui-try-github\\nginx-gui\\server\\db\\data.json","collections":[{"name":"nginx","data":[{"locations":[{"location":"/api","proxyPass":"http://google.fr"}],"meta":{"revision":4,"created":1551631751874,"version":0,"updated":1551633419035},"$loki":1,"displayName":"test","port":"8082","name":"localhost","conf":"server {\n listen 8082;\n server_name localhost;\n \n \n \n \n location /api {\n proxy_pass http://google.fr; \n \n }\n}","enable":true}],"idIndex":[1],"binaryIndices":{},"constraints":null,"uniqueNames":[],"transforms":{},"objType":"nginx","dirty":false,"cachedIndex":null,"cachedBinaryIndex":null,"cachedData":null,"adaptiveBinaryIndices":true,"transactional":false,"cloneObjects":false,"cloneMethod":"parse-stringify","asyncListeners":false,"disableMeta":false,"disableChangesApi":true,"disableDeltaChangesApi":true,"autoupdate":false,"serializableIndices":true,"ttl":null,"maxId":1,"DynamicViews":[],"events":{"insert":[],"update":[],"pre-insert":[],"pre-update":[],"close":[],"flushbuffer":[],"error":[],"delete":[null],"warning":[null]},"changes":[]}],"databaseVersion":1.5,"engineVersion":1.5,"autosave":false,"autosaveInterval":5000,"autosaveHandle":null,"throttledSaves":true,"options":{"serializationMethod":"normal","destructureDelimiter":"$<\n"},"persistenceMethod":"fs","persistenceAdapter":null,"verbose":false,"events":{"init":[null],"loaded":[],"flushChanges":[],"close":[],"changes":[],"warning":[]},"ENV":"NODEJS"} -------------------------------------------------------------------------------- /server/main.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | 4 | const fs = require('fs'); 5 | const express = require('express'), 6 | app = express(), 7 | port = 9004; 8 | const DeployDb = require('./DeployDB'); 9 | 10 | const LOGGER = require('./utils/logger'); 11 | const path = require('path'); 12 | const WebSocket = require('ws'); 13 | const http = require('http'); 14 | const server = http.createServer(app); 15 | const NginxService = require('./services/NginxService').NginxService; 16 | const opn = require('opn'); 17 | const bodyParser = require('body-parser'); 18 | 19 | app.use(bodyParser.json()); // for parsing application/json 20 | 21 | app.use('/', express.static(path.join(__dirname, '../public'))); 22 | app.use('/vue', express.static(path.join(__dirname, '../public'))); 23 | 24 | //We need the temp folder for nginx 25 | let tempPath = path.join(__dirname, '../temp'); 26 | fs.exists(tempPath, (exists) => { 27 | if (!exists) { 28 | LOGGER.debug('Creating temp folder : '+tempPath); 29 | fs.mkdirSync(tempPath); 30 | } 31 | }); 32 | 33 | 34 | let wsServer = new WebSocket.Server({server}); 35 | DeployDb.init().then(() => { 36 | LOGGER.info("db initialized"); 37 | 38 | new NginxService(app, DeployDb, wsServer,process.argv[2] === '--start-nginx'); 39 | 40 | LOGGER.info("Service started on port : " + port); 41 | let url = "http://localhost:" + port+'/'; 42 | LOGGER.info(url); 43 | opn(url) 44 | }); 45 | server.listen(port, () => console.log('server listening on', server.address().port)); 46 | -------------------------------------------------------------------------------- /nginx/conf/koi-win: -------------------------------------------------------------------------------- 1 | 2 | charset_map koi8-r windows-1251 { 3 | 4 | 80 88 ; # euro 5 | 6 | 95 95 ; # bullet 7 | 8 | 9A A0 ; #   9 | 10 | 9E B7 ; # · 11 | 12 | A3 B8 ; # small yo 13 | A4 BA ; # small Ukrainian ye 14 | 15 | A6 B3 ; # small Ukrainian i 16 | A7 BF ; # small Ukrainian yi 17 | 18 | AD B4 ; # small Ukrainian soft g 19 | AE A2 ; # small Byelorussian short u 20 | 21 | B0 B0 ; # ° 22 | 23 | B3 A8 ; # capital YO 24 | B4 AA ; # capital Ukrainian YE 25 | 26 | B6 B2 ; # capital Ukrainian I 27 | B7 AF ; # capital Ukrainian YI 28 | 29 | B9 B9 ; # numero sign 30 | 31 | BD A5 ; # capital Ukrainian soft G 32 | BE A1 ; # capital Byelorussian short U 33 | 34 | BF A9 ; # (C) 35 | 36 | C0 FE ; # small yu 37 | C1 E0 ; # small a 38 | C2 E1 ; # small b 39 | C3 F6 ; # small ts 40 | C4 E4 ; # small d 41 | C5 E5 ; # small ye 42 | C6 F4 ; # small f 43 | C7 E3 ; # small g 44 | C8 F5 ; # small kh 45 | C9 E8 ; # small i 46 | CA E9 ; # small j 47 | CB EA ; # small k 48 | CC EB ; # small l 49 | CD EC ; # small m 50 | CE ED ; # small n 51 | CF EE ; # small o 52 | 53 | D0 EF ; # small p 54 | D1 FF ; # small ya 55 | D2 F0 ; # small r 56 | D3 F1 ; # small s 57 | D4 F2 ; # small t 58 | D5 F3 ; # small u 59 | D6 E6 ; # small zh 60 | D7 E2 ; # small v 61 | D8 FC ; # small soft sign 62 | D9 FB ; # small y 63 | DA E7 ; # small z 64 | DB F8 ; # small sh 65 | DC FD ; # small e 66 | DD F9 ; # small shch 67 | DE F7 ; # small ch 68 | DF FA ; # small hard sign 69 | 70 | E0 DE ; # capital YU 71 | E1 C0 ; # capital A 72 | E2 C1 ; # capital B 73 | E3 D6 ; # capital TS 74 | E4 C4 ; # capital D 75 | E5 C5 ; # capital YE 76 | E6 D4 ; # capital F 77 | E7 C3 ; # capital G 78 | E8 D5 ; # capital KH 79 | E9 C8 ; # capital I 80 | EA C9 ; # capital J 81 | EB CA ; # capital K 82 | EC CB ; # capital L 83 | ED CC ; # capital M 84 | EE CD ; # capital N 85 | EF CE ; # capital O 86 | 87 | F0 CF ; # capital P 88 | F1 DF ; # capital YA 89 | F2 D0 ; # capital R 90 | F3 D1 ; # capital S 91 | F4 D2 ; # capital T 92 | F5 D3 ; # capital U 93 | F6 C6 ; # capital ZH 94 | F7 C2 ; # capital V 95 | F8 DC ; # capital soft sign 96 | F9 DB ; # capital Y 97 | FA C7 ; # capital Z 98 | FB D8 ; # capital SH 99 | FC DD ; # capital E 100 | FD D9 ; # capital SHCH 101 | FE D7 ; # capital CH 102 | FF DA ; # capital hard sign 103 | } 104 | -------------------------------------------------------------------------------- /nginx/conf/koi-utf: -------------------------------------------------------------------------------- 1 | 2 | # This map is not a full koi8-r <> utf8 map: it does not contain 3 | # box-drawing and some other characters. Besides this map contains 4 | # several koi8-u and Byelorussian letters which are not in koi8-r. 5 | # If you need a full and standard map, use contrib/unicode2nginx/koi-utf 6 | # map instead. 7 | 8 | charset_map koi8-r utf-8 { 9 | 10 | 80 E282AC ; # euro 11 | 12 | 95 E280A2 ; # bullet 13 | 14 | 9A C2A0 ; #   15 | 16 | 9E C2B7 ; # · 17 | 18 | A3 D191 ; # small yo 19 | A4 D194 ; # small Ukrainian ye 20 | 21 | A6 D196 ; # small Ukrainian i 22 | A7 D197 ; # small Ukrainian yi 23 | 24 | AD D291 ; # small Ukrainian soft g 25 | AE D19E ; # small Byelorussian short u 26 | 27 | B0 C2B0 ; # ° 28 | 29 | B3 D081 ; # capital YO 30 | B4 D084 ; # capital Ukrainian YE 31 | 32 | B6 D086 ; # capital Ukrainian I 33 | B7 D087 ; # capital Ukrainian YI 34 | 35 | B9 E28496 ; # numero sign 36 | 37 | BD D290 ; # capital Ukrainian soft G 38 | BE D18E ; # capital Byelorussian short U 39 | 40 | BF C2A9 ; # (C) 41 | 42 | C0 D18E ; # small yu 43 | C1 D0B0 ; # small a 44 | C2 D0B1 ; # small b 45 | C3 D186 ; # small ts 46 | C4 D0B4 ; # small d 47 | C5 D0B5 ; # small ye 48 | C6 D184 ; # small f 49 | C7 D0B3 ; # small g 50 | C8 D185 ; # small kh 51 | C9 D0B8 ; # small i 52 | CA D0B9 ; # small j 53 | CB D0BA ; # small k 54 | CC D0BB ; # small l 55 | CD D0BC ; # small m 56 | CE D0BD ; # small n 57 | CF D0BE ; # small o 58 | 59 | D0 D0BF ; # small p 60 | D1 D18F ; # small ya 61 | D2 D180 ; # small r 62 | D3 D181 ; # small s 63 | D4 D182 ; # small t 64 | D5 D183 ; # small u 65 | D6 D0B6 ; # small zh 66 | D7 D0B2 ; # small v 67 | D8 D18C ; # small soft sign 68 | D9 D18B ; # small y 69 | DA D0B7 ; # small z 70 | DB D188 ; # small sh 71 | DC D18D ; # small e 72 | DD D189 ; # small shch 73 | DE D187 ; # small ch 74 | DF D18A ; # small hard sign 75 | 76 | E0 D0AE ; # capital YU 77 | E1 D090 ; # capital A 78 | E2 D091 ; # capital B 79 | E3 D0A6 ; # capital TS 80 | E4 D094 ; # capital D 81 | E5 D095 ; # capital YE 82 | E6 D0A4 ; # capital F 83 | E7 D093 ; # capital G 84 | E8 D0A5 ; # capital KH 85 | E9 D098 ; # capital I 86 | EA D099 ; # capital J 87 | EB D09A ; # capital K 88 | EC D09B ; # capital L 89 | ED D09C ; # capital M 90 | EE D09D ; # capital N 91 | EF D09E ; # capital O 92 | 93 | F0 D09F ; # capital P 94 | F1 D0AF ; # capital YA 95 | F2 D0A0 ; # capital R 96 | F3 D0A1 ; # capital S 97 | F4 D0A2 ; # capital T 98 | F5 D0A3 ; # capital U 99 | F6 D096 ; # capital ZH 100 | F7 D092 ; # capital V 101 | F8 D0AC ; # capital soft sign 102 | F9 D0AB ; # capital Y 103 | FA D097 ; # capital Z 104 | FB D0A8 ; # capital SH 105 | FC D0AD ; # capital E 106 | FD D0A9 ; # capital SHCH 107 | FE D0A7 ; # capital CH 108 | FF D0AA ; # capital hard sign 109 | } 110 | -------------------------------------------------------------------------------- /app-vue/src/layouts/MyLayout.vue: -------------------------------------------------------------------------------- 1 | 81 | 82 | 97 | 98 | 100 | -------------------------------------------------------------------------------- /nginx/docs/PCRE.LICENCE: -------------------------------------------------------------------------------- 1 | PCRE LICENCE 2 | ------------ 3 | 4 | PCRE is a library of functions to support regular expressions whose syntax 5 | and semantics are as close as possible to those of the Perl 5 language. 6 | 7 | Release 8 of PCRE is distributed under the terms of the "BSD" licence, as 8 | specified below. The documentation for PCRE, supplied in the "doc" 9 | directory, is distributed under the same terms as the software itself. The data 10 | in the testdata directory is not copyrighted and is in the public domain. 11 | 12 | The basic library functions are written in C and are freestanding. Also 13 | included in the distribution is a set of C++ wrapper functions, and a 14 | just-in-time compiler that can be used to optimize pattern matching. These 15 | are both optional features that can be omitted when the library is built. 16 | 17 | 18 | THE BASIC LIBRARY FUNCTIONS 19 | --------------------------- 20 | 21 | Written by: Philip Hazel 22 | Email local part: ph10 23 | Email domain: cam.ac.uk 24 | 25 | University of Cambridge Computing Service, 26 | Cambridge, England. 27 | 28 | Copyright (c) 1997-2017 University of Cambridge 29 | All rights reserved. 30 | 31 | 32 | PCRE JUST-IN-TIME COMPILATION SUPPORT 33 | ------------------------------------- 34 | 35 | Written by: Zoltan Herczeg 36 | Email local part: hzmester 37 | Emain domain: freemail.hu 38 | 39 | Copyright(c) 2010-2017 Zoltan Herczeg 40 | All rights reserved. 41 | 42 | 43 | STACK-LESS JUST-IN-TIME COMPILER 44 | -------------------------------- 45 | 46 | Written by: Zoltan Herczeg 47 | Email local part: hzmester 48 | Emain domain: freemail.hu 49 | 50 | Copyright(c) 2009-2017 Zoltan Herczeg 51 | All rights reserved. 52 | 53 | 54 | THE C++ WRAPPER FUNCTIONS 55 | ------------------------- 56 | 57 | Contributed by: Google Inc. 58 | 59 | Copyright (c) 2007-2012, Google Inc. 60 | All rights reserved. 61 | 62 | 63 | THE "BSD" LICENCE 64 | ----------------- 65 | 66 | Redistribution and use in source and binary forms, with or without 67 | modification, are permitted provided that the following conditions are met: 68 | 69 | * Redistributions of source code must retain the above copyright notice, 70 | this list of conditions and the following disclaimer. 71 | 72 | * Redistributions in binary form must reproduce the above copyright 73 | notice, this list of conditions and the following disclaimer in the 74 | documentation and/or other materials provided with the distribution. 75 | 76 | * Neither the name of the University of Cambridge nor the name of Google 77 | Inc. nor the names of their contributors may be used to endorse or 78 | promote products derived from this software without specific prior 79 | written permission. 80 | 81 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 82 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 83 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 84 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 85 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 86 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 87 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 88 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 89 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 90 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 91 | POSSIBILITY OF SUCH DAMAGE. 92 | 93 | End 94 | -------------------------------------------------------------------------------- /server/DeployDB.js: -------------------------------------------------------------------------------- 1 | //Thanks to Christophe Genin : https://github.com/cgenin/tomcat-deploy-web/blob/master/server/deploydb.js 2 | const LOGGER = require('./utils/logger'); 3 | const path = require('path'); 4 | const fs = require('fs'); 5 | const homedir = require('os').homedir(); 6 | 7 | const DeployDB = function DeployDB() { 8 | 9 | //Collections 10 | const nginxCollection = 'nginx'; 11 | const nginxHttpConf = 'nginxHttpConf'; 12 | 13 | const loki = require('lokijs'); 14 | let dbPath = path.join(homedir, 'nginx-gui'); 15 | 16 | if(!fs.existsSync(dbPath)) { 17 | LOGGER.debug('Creating data folder : '+dbPath); 18 | fs.mkdirSync(dbPath); 19 | } 20 | 21 | if(!fs.existsSync(dbPath+'/data.json')){ 22 | LOGGER.debug('Copying init database because none where found.'); 23 | const dbInitPath = path.join(__dirname, 'db/data.init.json'); 24 | fs.createReadStream(dbInitPath).pipe(fs.createWriteStream(dbPath+'/data.json')); 25 | } 26 | 27 | const db = new loki(dbPath+'/data.json'); 28 | LOGGER.debug(`DB path : ${dbPath+'/data.json'}`); 29 | const createIfNotExist = function (name) { 30 | LOGGER.debug(`DB : createIfNotExist : ${name}`); 31 | if (!db.getCollection(name)) { 32 | db.addCollection(name); 33 | db.saveDatabase(); 34 | } 35 | }; 36 | 37 | this.init = function () { 38 | return new Promise((success) => { 39 | db.loadDatabase({}, () => { 40 | createIfNotExist(nginxCollection); 41 | createIfNotExist(nginxHttpConf); 42 | success(db); 43 | }); 44 | }); 45 | }; 46 | 47 | this.getNginx = function () { 48 | return db.getCollection(nginxCollection); 49 | }; 50 | 51 | this.getNginxHttpConf = function () { 52 | return db.getCollection(nginxHttpConf); 53 | }; 54 | 55 | this.insert = function (collection, item) { 56 | collection.insert(item); 57 | db.saveDatabase(); 58 | }; 59 | 60 | this.save = function (collection, item) { 61 | if (item.$loki) { 62 | collection.update(item); 63 | } else { 64 | collection.insert(item); 65 | } 66 | db.saveDatabase(); 67 | }; 68 | 69 | this.updateStatus = function (collection, item, state, host) { 70 | if (item.$loki) { 71 | const filter = collection.data.filter((i) => i.$loki === item.$loki); 72 | if (filter && filter.length > 0) { 73 | const selected = filter[0]; 74 | selected.deployStates = selected.deployStates || {}; 75 | selected.deployStates[host] = { 76 | state, dt: new Date() 77 | }; 78 | collection.update(selected); 79 | db.saveDatabase(); 80 | return selected; 81 | } 82 | } 83 | return item; 84 | }; 85 | 86 | this.remove = function (collection, item) { 87 | collection.remove(item); 88 | db.saveDatabase(); 89 | }; 90 | this.close = function () { 91 | db.close(); 92 | }; 93 | if (DeployDB.caller !== DeployDB.getInstance) { 94 | throw new Error('This object cannot be instanciated'); 95 | } 96 | }; 97 | 98 | /* ************************************************************************ 99 | SINGLETON CLASS DEFINITION 100 | ************************************************************************ */ 101 | DeployDB.instance = null; 102 | 103 | /** 104 | * Singleton getInstance definition 105 | * @return DeployDB class 106 | */ 107 | DeployDB.getInstance = function () { 108 | if (this.instance === null) { 109 | this.instance = new DeployDB(); 110 | } 111 | return this.instance; 112 | }; 113 | 114 | module.exports = DeployDB.getInstance(); 115 | -------------------------------------------------------------------------------- /nginx/conf/win-utf: -------------------------------------------------------------------------------- 1 | 2 | # This map is not a full windows-1251 <> utf8 map: it does not 3 | # contain Serbian and Macedonian letters. If you need a full map, 4 | # use contrib/unicode2nginx/win-utf map instead. 5 | 6 | charset_map windows-1251 utf-8 { 7 | 8 | 82 E2809A ; # single low-9 quotation mark 9 | 10 | 84 E2809E ; # double low-9 quotation mark 11 | 85 E280A6 ; # ellipsis 12 | 86 E280A0 ; # dagger 13 | 87 E280A1 ; # double dagger 14 | 88 E282AC ; # euro 15 | 89 E280B0 ; # per mille 16 | 17 | 91 E28098 ; # left single quotation mark 18 | 92 E28099 ; # right single quotation mark 19 | 93 E2809C ; # left double quotation mark 20 | 94 E2809D ; # right double quotation mark 21 | 95 E280A2 ; # bullet 22 | 96 E28093 ; # en dash 23 | 97 E28094 ; # em dash 24 | 25 | 99 E284A2 ; # trade mark sign 26 | 27 | A0 C2A0 ; #   28 | A1 D18E ; # capital Byelorussian short U 29 | A2 D19E ; # small Byelorussian short u 30 | 31 | A4 C2A4 ; # currency sign 32 | A5 D290 ; # capital Ukrainian soft G 33 | A6 C2A6 ; # borken bar 34 | A7 C2A7 ; # section sign 35 | A8 D081 ; # capital YO 36 | A9 C2A9 ; # (C) 37 | AA D084 ; # capital Ukrainian YE 38 | AB C2AB ; # left-pointing double angle quotation mark 39 | AC C2AC ; # not sign 40 | AD C2AD ; # soft hypen 41 | AE C2AE ; # (R) 42 | AF D087 ; # capital Ukrainian YI 43 | 44 | B0 C2B0 ; # ° 45 | B1 C2B1 ; # plus-minus sign 46 | B2 D086 ; # capital Ukrainian I 47 | B3 D196 ; # small Ukrainian i 48 | B4 D291 ; # small Ukrainian soft g 49 | B5 C2B5 ; # micro sign 50 | B6 C2B6 ; # pilcrow sign 51 | B7 C2B7 ; # · 52 | B8 D191 ; # small yo 53 | B9 E28496 ; # numero sign 54 | BA D194 ; # small Ukrainian ye 55 | BB C2BB ; # right-pointing double angle quotation mark 56 | 57 | BF D197 ; # small Ukrainian yi 58 | 59 | C0 D090 ; # capital A 60 | C1 D091 ; # capital B 61 | C2 D092 ; # capital V 62 | C3 D093 ; # capital G 63 | C4 D094 ; # capital D 64 | C5 D095 ; # capital YE 65 | C6 D096 ; # capital ZH 66 | C7 D097 ; # capital Z 67 | C8 D098 ; # capital I 68 | C9 D099 ; # capital J 69 | CA D09A ; # capital K 70 | CB D09B ; # capital L 71 | CC D09C ; # capital M 72 | CD D09D ; # capital N 73 | CE D09E ; # capital O 74 | CF D09F ; # capital P 75 | 76 | D0 D0A0 ; # capital R 77 | D1 D0A1 ; # capital S 78 | D2 D0A2 ; # capital T 79 | D3 D0A3 ; # capital U 80 | D4 D0A4 ; # capital F 81 | D5 D0A5 ; # capital KH 82 | D6 D0A6 ; # capital TS 83 | D7 D0A7 ; # capital CH 84 | D8 D0A8 ; # capital SH 85 | D9 D0A9 ; # capital SHCH 86 | DA D0AA ; # capital hard sign 87 | DB D0AB ; # capital Y 88 | DC D0AC ; # capital soft sign 89 | DD D0AD ; # capital E 90 | DE D0AE ; # capital YU 91 | DF D0AF ; # capital YA 92 | 93 | E0 D0B0 ; # small a 94 | E1 D0B1 ; # small b 95 | E2 D0B2 ; # small v 96 | E3 D0B3 ; # small g 97 | E4 D0B4 ; # small d 98 | E5 D0B5 ; # small ye 99 | E6 D0B6 ; # small zh 100 | E7 D0B7 ; # small z 101 | E8 D0B8 ; # small i 102 | E9 D0B9 ; # small j 103 | EA D0BA ; # small k 104 | EB D0BB ; # small l 105 | EC D0BC ; # small m 106 | ED D0BD ; # small n 107 | EE D0BE ; # small o 108 | EF D0BF ; # small p 109 | 110 | F0 D180 ; # small r 111 | F1 D181 ; # small s 112 | F2 D182 ; # small t 113 | F3 D183 ; # small u 114 | F4 D184 ; # small f 115 | F5 D185 ; # small kh 116 | F6 D186 ; # small ts 117 | F7 D187 ; # small ch 118 | F8 D188 ; # small sh 119 | F9 D189 ; # small shch 120 | FA D18A ; # small hard sign 121 | FB D18B ; # small y 122 | FC D18C ; # small soft sign 123 | FD D18D ; # small e 124 | FE D18E ; # small yu 125 | FF D18F ; # small ya 126 | } 127 | -------------------------------------------------------------------------------- /nginx/conf/mime.types: -------------------------------------------------------------------------------- 1 | 2 | types { 3 | text/html html htm shtml; 4 | text/css css; 5 | text/xml xml; 6 | image/gif gif; 7 | image/jpeg jpeg jpg; 8 | application/javascript js; 9 | application/atom+xml atom; 10 | application/rss+xml rss; 11 | 12 | text/mathml mml; 13 | text/plain txt; 14 | text/vnd.sun.j2me.app-descriptor jad; 15 | text/vnd.wap.wml wml; 16 | text/x-component htc; 17 | 18 | image/png png; 19 | image/tiff tif tiff; 20 | image/vnd.wap.wbmp wbmp; 21 | image/x-icon ico; 22 | image/x-jng jng; 23 | image/x-ms-bmp bmp; 24 | image/svg+xml svg svgz; 25 | image/webp webp; 26 | 27 | application/font-woff woff; 28 | application/java-archive jar war ear; 29 | application/json json; 30 | application/mac-binhex40 hqx; 31 | application/msword doc; 32 | application/pdf pdf; 33 | application/postscript ps eps ai; 34 | application/rtf rtf; 35 | application/vnd.apple.mpegurl m3u8; 36 | application/vnd.ms-excel xls; 37 | application/vnd.ms-fontobject eot; 38 | application/vnd.ms-powerpoint ppt; 39 | application/vnd.wap.wmlc wmlc; 40 | application/vnd.google-earth.kml+xml kml; 41 | application/vnd.google-earth.kmz kmz; 42 | application/x-7z-compressed 7z; 43 | application/x-cocoa cco; 44 | application/x-java-archive-diff jardiff; 45 | application/x-java-jnlp-file jnlp; 46 | application/x-makeself run; 47 | application/x-perl pl pm; 48 | application/x-pilot prc pdb; 49 | application/x-rar-compressed rar; 50 | application/x-redhat-package-manager rpm; 51 | application/x-sea sea; 52 | application/x-shockwave-flash swf; 53 | application/x-stuffit sit; 54 | application/x-tcl tcl tk; 55 | application/x-x509-ca-cert der pem crt; 56 | application/x-xpinstall xpi; 57 | application/xhtml+xml xhtml; 58 | application/xspf+xml xspf; 59 | application/zip zip; 60 | 61 | application/octet-stream bin exe dll; 62 | application/octet-stream deb; 63 | application/octet-stream dmg; 64 | application/octet-stream iso img; 65 | application/octet-stream msi msp msm; 66 | 67 | application/vnd.openxmlformats-officedocument.wordprocessingml.document docx; 68 | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx; 69 | application/vnd.openxmlformats-officedocument.presentationml.presentation pptx; 70 | 71 | audio/midi mid midi kar; 72 | audio/mpeg mp3; 73 | audio/ogg ogg; 74 | audio/x-m4a m4a; 75 | audio/x-realaudio ra; 76 | 77 | video/3gpp 3gpp 3gp; 78 | video/mp2t ts; 79 | video/mp4 mp4; 80 | video/mpeg mpeg mpg; 81 | video/quicktime mov; 82 | video/webm webm; 83 | video/x-flv flv; 84 | video/x-m4v m4v; 85 | video/x-mng mng; 86 | video/x-ms-asf asx asf; 87 | video/x-ms-wmv wmv; 88 | video/x-msvideo avi; 89 | } 90 | -------------------------------------------------------------------------------- /app-vue/quasar.conf.js: -------------------------------------------------------------------------------- 1 | // Configuration for your app 2 | 3 | module.exports = function (ctx) { 4 | return { 5 | // app boot file (/src/boot) 6 | // --> boot files are part of "main.js" 7 | boot: [ 8 | 'axios' 9 | ], 10 | 11 | css: [ 12 | 'app.styl' 13 | ], 14 | 15 | extras: [ 16 | 'roboto-font', 17 | 'material-icons' // optional, you are not bound to it 18 | // 'ionicons-v4', 19 | // 'mdi-v3', 20 | // 'fontawesome-v5', 21 | // 'eva-icons' 22 | ], 23 | 24 | framework: { 25 | // all: true, // --- includes everything; for dev only! 26 | 27 | components: [ 28 | 'QLayout', 29 | 'QHeader', 30 | 'QDrawer', 31 | 'QDialog', 32 | 'QPageContainer', 33 | 'QPage', 34 | 'QToolbar', 35 | 'QToolbarTitle', 36 | 'QBtn', 37 | 'QBtnGroup', 38 | 'QIcon', 39 | 'QList', 40 | 'QItem', 41 | 'QItemSection', 42 | 'QToggle', 43 | 'QSeparator', 44 | 'QTable', 45 | 'QTh', 46 | 'QTr', 47 | 'QTd', 48 | 'QInput', 49 | 'QPopupEdit', 50 | 'QTooltip', 51 | 'QMenu', 52 | 'QItemLabel', 53 | 'QCard', 54 | 'QCardSection', 55 | 'QCardActions' 56 | ], 57 | 58 | directives: [ 59 | 'Ripple', 60 | 'ClosePopup' 61 | ], 62 | 63 | // Quasar plugins 64 | plugins: [ 65 | 'Notify' 66 | ,'Dialog' 67 | ] 68 | 69 | // iconSet: 'ionicons-v4' 70 | // lang: 'de' // Quasar language 71 | }, 72 | 73 | supportIE: false, 74 | 75 | build: { 76 | scopeHoisting: true, 77 | // vueRouterMode: 'history', 78 | // vueCompiler: true, 79 | // gzip: true, 80 | // analyze: true, 81 | // extractCSS: false, 82 | extendWebpack (cfg) { 83 | }, 84 | distDir : '../public' 85 | }, 86 | 87 | devServer: { 88 | // https: true, 89 | port: 8881, 90 | open: true, // opens browser window automatically 91 | proxy: { 92 | '/api': { 93 | target: 'http://localhost:9004' 94 | } 95 | } 96 | }, 97 | 98 | // animations: 'all' --- includes all animations 99 | animations: [], 100 | 101 | ssr: { 102 | pwa: false 103 | }, 104 | 105 | pwa: { 106 | // workboxPluginMode: 'InjectManifest', 107 | // workboxOptions: {}, 108 | manifest: { 109 | // name: 'Quasar App', 110 | // short_name: 'Quasar-PWA', 111 | // description: 'Best PWA App in town!', 112 | display: 'standalone', 113 | orientation: 'portrait', 114 | background_color: '#ffffff', 115 | theme_color: '#027be3', 116 | icons: [ 117 | { 118 | 'src': 'statics/icons/icon-128x128.png', 119 | 'sizes': '128x128', 120 | 'type': 'image/png' 121 | }, 122 | { 123 | 'src': 'statics/icons/icon-192x192.png', 124 | 'sizes': '192x192', 125 | 'type': 'image/png' 126 | }, 127 | { 128 | 'src': 'statics/icons/icon-256x256.png', 129 | 'sizes': '256x256', 130 | 'type': 'image/png' 131 | }, 132 | { 133 | 'src': 'statics/icons/icon-384x384.png', 134 | 'sizes': '384x384', 135 | 'type': 'image/png' 136 | }, 137 | { 138 | 'src': 'statics/icons/icon-512x512.png', 139 | 'sizes': '512x512', 140 | 'type': 'image/png' 141 | } 142 | ] 143 | } 144 | }, 145 | 146 | cordova: { 147 | // id: 'org.cordova.quasar.app' 148 | }, 149 | 150 | electron: { 151 | // bundler: 'builder', // or 'packager' 152 | 153 | extendWebpack (cfg) { 154 | // do something with Electron main process Webpack cfg 155 | // chainWebpack also available besides this extendWebpack 156 | }, 157 | 158 | packager: { 159 | // https://github.com/electron-userland/electron-packager/blob/master/docs/api.md#options 160 | 161 | // OS X / Mac App Store 162 | // appBundleId: '', 163 | // appCategoryType: '', 164 | // osxSign: '', 165 | // protocol: 'myapp://path', 166 | 167 | // Window only 168 | // win32metadata: { ... } 169 | }, 170 | 171 | builder: { 172 | // https://www.electron.build/configuration/configuration 173 | 174 | // appId: 'quasar-app' 175 | } 176 | } 177 | } 178 | } 179 | -------------------------------------------------------------------------------- /app-vue/src/components/Runner.vue: -------------------------------------------------------------------------------- 1 | 48 | 53 | 139 | 148 | -------------------------------------------------------------------------------- /app-vue/src/pages/Index.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 30 | 31 | 32 | 172 | -------------------------------------------------------------------------------- /nginx/contrib/unicode2nginx/win-utf: -------------------------------------------------------------------------------- 1 | charset_map windows-1251 utf-8 { 2 | 3 | 80 D082 ; #CYRILLIC CAPITAL LETTER DJE 4 | 81 D083 ; #CYRILLIC CAPITAL LETTER GJE 5 | 82 E2809A ; #SINGLE LOW-9 QUOTATION MARK 6 | 83 D193 ; #CYRILLIC SMALL LETTER GJE 7 | 84 E2809E ; #DOUBLE LOW-9 QUOTATION MARK 8 | 85 E280A6 ; #HORIZONTAL ELLIPSIS 9 | 86 E280A0 ; #DAGGER 10 | 87 E280A1 ; #DOUBLE DAGGER 11 | 88 E282AC ; #EURO SIGN 12 | 89 E280B0 ; #PER MILLE SIGN 13 | 8A D089 ; #CYRILLIC CAPITAL LETTER LJE 14 | 8B E280B9 ; #SINGLE LEFT-POINTING ANGLE QUOTATION MARK 15 | 8C D08A ; #CYRILLIC CAPITAL LETTER NJE 16 | 8D D08C ; #CYRILLIC CAPITAL LETTER KJE 17 | 8E D08B ; #CYRILLIC CAPITAL LETTER TSHE 18 | 8F D08F ; #CYRILLIC CAPITAL LETTER DZHE 19 | 90 D192 ; #CYRILLIC SMALL LETTER DJE 20 | 91 E28098 ; #LEFT SINGLE QUOTATION MARK 21 | 92 E28099 ; #RIGHT SINGLE QUOTATION MARK 22 | 93 E2809C ; #LEFT DOUBLE QUOTATION MARK 23 | 94 E2809D ; #RIGHT DOUBLE QUOTATION MARK 24 | 95 E280A2 ; #BULLET 25 | 96 E28093 ; #EN DASH 26 | 97 E28094 ; #EM DASH 27 | 99 E284A2 ; #TRADE MARK SIGN 28 | 9A D199 ; #CYRILLIC SMALL LETTER LJE 29 | 9B E280BA ; #SINGLE RIGHT-POINTING ANGLE QUOTATION MARK 30 | 9C D19A ; #CYRILLIC SMALL LETTER NJE 31 | 9D D19C ; #CYRILLIC SMALL LETTER KJE 32 | 9E D19B ; #CYRILLIC SMALL LETTER TSHE 33 | 9F D19F ; #CYRILLIC SMALL LETTER DZHE 34 | A0 C2A0 ; #NO-BREAK SPACE 35 | A1 D08E ; #CYRILLIC CAPITAL LETTER SHORT U 36 | A2 D19E ; #CYRILLIC SMALL LETTER SHORT U 37 | A3 D088 ; #CYRILLIC CAPITAL LETTER JE 38 | A4 C2A4 ; #CURRENCY SIGN 39 | A5 D290 ; #CYRILLIC CAPITAL LETTER GHE WITH UPTURN 40 | A6 C2A6 ; #BROKEN BAR 41 | A7 C2A7 ; #SECTION SIGN 42 | A8 D081 ; #CYRILLIC CAPITAL LETTER IO 43 | A9 C2A9 ; #COPYRIGHT SIGN 44 | AA D084 ; #CYRILLIC CAPITAL LETTER UKRAINIAN IE 45 | AB C2AB ; #LEFT-POINTING DOUBLE ANGLE QUOTATION MARK 46 | AC C2AC ; #NOT SIGN 47 | AD C2AD ; #SOFT HYPHEN 48 | AE C2AE ; #REGISTERED SIGN 49 | AF D087 ; #CYRILLIC CAPITAL LETTER YI 50 | B0 C2B0 ; #DEGREE SIGN 51 | B1 C2B1 ; #PLUS-MINUS SIGN 52 | B2 D086 ; #CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I 53 | B3 D196 ; #CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I 54 | B4 D291 ; #CYRILLIC SMALL LETTER GHE WITH UPTURN 55 | B5 C2B5 ; #MICRO SIGN 56 | B6 C2B6 ; #PILCROW SIGN 57 | B7 C2B7 ; #MIDDLE DOT 58 | B8 D191 ; #CYRILLIC SMALL LETTER IO 59 | B9 E28496 ; #NUMERO SIGN 60 | BA D194 ; #CYRILLIC SMALL LETTER UKRAINIAN IE 61 | BB C2BB ; #RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK 62 | BC D198 ; #CYRILLIC SMALL LETTER JE 63 | BD D085 ; #CYRILLIC CAPITAL LETTER DZE 64 | BE D195 ; #CYRILLIC SMALL LETTER DZE 65 | BF D197 ; #CYRILLIC SMALL LETTER YI 66 | C0 D090 ; #CYRILLIC CAPITAL LETTER A 67 | C1 D091 ; #CYRILLIC CAPITAL LETTER BE 68 | C2 D092 ; #CYRILLIC CAPITAL LETTER VE 69 | C3 D093 ; #CYRILLIC CAPITAL LETTER GHE 70 | C4 D094 ; #CYRILLIC CAPITAL LETTER DE 71 | C5 D095 ; #CYRILLIC CAPITAL LETTER IE 72 | C6 D096 ; #CYRILLIC CAPITAL LETTER ZHE 73 | C7 D097 ; #CYRILLIC CAPITAL LETTER ZE 74 | C8 D098 ; #CYRILLIC CAPITAL LETTER I 75 | C9 D099 ; #CYRILLIC CAPITAL LETTER SHORT I 76 | CA D09A ; #CYRILLIC CAPITAL LETTER KA 77 | CB D09B ; #CYRILLIC CAPITAL LETTER EL 78 | CC D09C ; #CYRILLIC CAPITAL LETTER EM 79 | CD D09D ; #CYRILLIC CAPITAL LETTER EN 80 | CE D09E ; #CYRILLIC CAPITAL LETTER O 81 | CF D09F ; #CYRILLIC CAPITAL LETTER PE 82 | D0 D0A0 ; #CYRILLIC CAPITAL LETTER ER 83 | D1 D0A1 ; #CYRILLIC CAPITAL LETTER ES 84 | D2 D0A2 ; #CYRILLIC CAPITAL LETTER TE 85 | D3 D0A3 ; #CYRILLIC CAPITAL LETTER U 86 | D4 D0A4 ; #CYRILLIC CAPITAL LETTER EF 87 | D5 D0A5 ; #CYRILLIC CAPITAL LETTER HA 88 | D6 D0A6 ; #CYRILLIC CAPITAL LETTER TSE 89 | D7 D0A7 ; #CYRILLIC CAPITAL LETTER CHE 90 | D8 D0A8 ; #CYRILLIC CAPITAL LETTER SHA 91 | D9 D0A9 ; #CYRILLIC CAPITAL LETTER SHCHA 92 | DA D0AA ; #CYRILLIC CAPITAL LETTER HARD SIGN 93 | DB D0AB ; #CYRILLIC CAPITAL LETTER YERU 94 | DC D0AC ; #CYRILLIC CAPITAL LETTER SOFT SIGN 95 | DD D0AD ; #CYRILLIC CAPITAL LETTER E 96 | DE D0AE ; #CYRILLIC CAPITAL LETTER YU 97 | DF D0AF ; #CYRILLIC CAPITAL LETTER YA 98 | E0 D0B0 ; #CYRILLIC SMALL LETTER A 99 | E1 D0B1 ; #CYRILLIC SMALL LETTER BE 100 | E2 D0B2 ; #CYRILLIC SMALL LETTER VE 101 | E3 D0B3 ; #CYRILLIC SMALL LETTER GHE 102 | E4 D0B4 ; #CYRILLIC SMALL LETTER DE 103 | E5 D0B5 ; #CYRILLIC SMALL LETTER IE 104 | E6 D0B6 ; #CYRILLIC SMALL LETTER ZHE 105 | E7 D0B7 ; #CYRILLIC SMALL LETTER ZE 106 | E8 D0B8 ; #CYRILLIC SMALL LETTER I 107 | E9 D0B9 ; #CYRILLIC SMALL LETTER SHORT I 108 | EA D0BA ; #CYRILLIC SMALL LETTER KA 109 | EB D0BB ; #CYRILLIC SMALL LETTER EL 110 | EC D0BC ; #CYRILLIC SMALL LETTER EM 111 | ED D0BD ; #CYRILLIC SMALL LETTER EN 112 | EE D0BE ; #CYRILLIC SMALL LETTER O 113 | EF D0BF ; #CYRILLIC SMALL LETTER PE 114 | F0 D180 ; #CYRILLIC SMALL LETTER ER 115 | F1 D181 ; #CYRILLIC SMALL LETTER ES 116 | F2 D182 ; #CYRILLIC SMALL LETTER TE 117 | F3 D183 ; #CYRILLIC SMALL LETTER U 118 | F4 D184 ; #CYRILLIC SMALL LETTER EF 119 | F5 D185 ; #CYRILLIC SMALL LETTER HA 120 | F6 D186 ; #CYRILLIC SMALL LETTER TSE 121 | F7 D187 ; #CYRILLIC SMALL LETTER CHE 122 | F8 D188 ; #CYRILLIC SMALL LETTER SHA 123 | F9 D189 ; #CYRILLIC SMALL LETTER SHCHA 124 | FA D18A ; #CYRILLIC SMALL LETTER HARD SIGN 125 | FB D18B ; #CYRILLIC SMALL LETTER YERU 126 | FC D18C ; #CYRILLIC SMALL LETTER SOFT SIGN 127 | FD D18D ; #CYRILLIC SMALL LETTER E 128 | FE D18E ; #CYRILLIC SMALL LETTER YU 129 | FF D18F ; #CYRILLIC SMALL LETTER YA 130 | } 131 | -------------------------------------------------------------------------------- /nginx/contrib/unicode2nginx/koi-utf: -------------------------------------------------------------------------------- 1 | charset_map koi8-r utf-8 { 2 | 3 | 80 E29480 ; # BOX DRAWINGS LIGHT HORIZONTAL 4 | 81 E29482 ; # BOX DRAWINGS LIGHT VERTICAL 5 | 82 E2948C ; # BOX DRAWINGS LIGHT DOWN AND RIGHT 6 | 83 E29490 ; # BOX DRAWINGS LIGHT DOWN AND LEFT 7 | 84 E29494 ; # BOX DRAWINGS LIGHT UP AND RIGHT 8 | 85 E29498 ; # BOX DRAWINGS LIGHT UP AND LEFT 9 | 86 E2949C ; # BOX DRAWINGS LIGHT VERTICAL AND RIGHT 10 | 87 E294A4 ; # BOX DRAWINGS LIGHT VERTICAL AND LEFT 11 | 88 E294AC ; # BOX DRAWINGS LIGHT DOWN AND HORIZONTAL 12 | 89 E294B4 ; # BOX DRAWINGS LIGHT UP AND HORIZONTAL 13 | 8A E294BC ; # BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL 14 | 8B E29680 ; # UPPER HALF BLOCK 15 | 8C E29684 ; # LOWER HALF BLOCK 16 | 8D E29688 ; # FULL BLOCK 17 | 8E E2968C ; # LEFT HALF BLOCK 18 | 8F E29690 ; # RIGHT HALF BLOCK 19 | 90 E29691 ; # LIGHT SHADE 20 | 91 E29692 ; # MEDIUM SHADE 21 | 92 E29693 ; # DARK SHADE 22 | 93 E28CA0 ; # TOP HALF INTEGRAL 23 | 94 E296A0 ; # BLACK SQUARE 24 | 95 E28899 ; # BULLET OPERATOR 25 | 96 E2889A ; # SQUARE ROOT 26 | 97 E28988 ; # ALMOST EQUAL TO 27 | 98 E289A4 ; # LESS-THAN OR EQUAL TO 28 | 99 E289A5 ; # GREATER-THAN OR EQUAL TO 29 | 9A C2A0 ; # NO-BREAK SPACE 30 | 9B E28CA1 ; # BOTTOM HALF INTEGRAL 31 | 9C C2B0 ; # DEGREE SIGN 32 | 9D C2B2 ; # SUPERSCRIPT TWO 33 | 9E C2B7 ; # MIDDLE DOT 34 | 9F C3B7 ; # DIVISION SIGN 35 | A0 E29590 ; # BOX DRAWINGS DOUBLE HORIZONTAL 36 | A1 E29591 ; # BOX DRAWINGS DOUBLE VERTICAL 37 | A2 E29592 ; # BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE 38 | A3 D191 ; # CYRILLIC SMALL LETTER IO 39 | A4 E29593 ; # BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE 40 | A5 E29594 ; # BOX DRAWINGS DOUBLE DOWN AND RIGHT 41 | A6 E29595 ; # BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE 42 | A7 E29596 ; # BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE 43 | A8 E29597 ; # BOX DRAWINGS DOUBLE DOWN AND LEFT 44 | A9 E29598 ; # BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE 45 | AA E29599 ; # BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE 46 | AB E2959A ; # BOX DRAWINGS DOUBLE UP AND RIGHT 47 | AC E2959B ; # BOX DRAWINGS UP SINGLE AND LEFT DOUBLE 48 | AD E2959C ; # BOX DRAWINGS UP DOUBLE AND LEFT SINGLE 49 | AE E2959D ; # BOX DRAWINGS DOUBLE UP AND LEFT 50 | AF E2959E ; # BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE 51 | B0 E2959F ; # BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE 52 | B1 E295A0 ; # BOX DRAWINGS DOUBLE VERTICAL AND RIGHT 53 | B2 E295A1 ; # BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE 54 | B3 D081 ; # CYRILLIC CAPITAL LETTER IO 55 | B4 E295A2 ; # BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE 56 | B5 E295A3 ; # BOX DRAWINGS DOUBLE VERTICAL AND LEFT 57 | B6 E295A4 ; # BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE 58 | B7 E295A5 ; # BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE 59 | B8 E295A6 ; # BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL 60 | B9 E295A7 ; # BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE 61 | BA E295A8 ; # BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE 62 | BB E295A9 ; # BOX DRAWINGS DOUBLE UP AND HORIZONTAL 63 | BC E295AA ; # BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE 64 | BD E295AB ; # BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE 65 | BE E295AC ; # BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL 66 | BF C2A9 ; # COPYRIGHT SIGN 67 | C0 D18E ; # CYRILLIC SMALL LETTER YU 68 | C1 D0B0 ; # CYRILLIC SMALL LETTER A 69 | C2 D0B1 ; # CYRILLIC SMALL LETTER BE 70 | C3 D186 ; # CYRILLIC SMALL LETTER TSE 71 | C4 D0B4 ; # CYRILLIC SMALL LETTER DE 72 | C5 D0B5 ; # CYRILLIC SMALL LETTER IE 73 | C6 D184 ; # CYRILLIC SMALL LETTER EF 74 | C7 D0B3 ; # CYRILLIC SMALL LETTER GHE 75 | C8 D185 ; # CYRILLIC SMALL LETTER HA 76 | C9 D0B8 ; # CYRILLIC SMALL LETTER I 77 | CA D0B9 ; # CYRILLIC SMALL LETTER SHORT I 78 | CB D0BA ; # CYRILLIC SMALL LETTER KA 79 | CC D0BB ; # CYRILLIC SMALL LETTER EL 80 | CD D0BC ; # CYRILLIC SMALL LETTER EM 81 | CE D0BD ; # CYRILLIC SMALL LETTER EN 82 | CF D0BE ; # CYRILLIC SMALL LETTER O 83 | D0 D0BF ; # CYRILLIC SMALL LETTER PE 84 | D1 D18F ; # CYRILLIC SMALL LETTER YA 85 | D2 D180 ; # CYRILLIC SMALL LETTER ER 86 | D3 D181 ; # CYRILLIC SMALL LETTER ES 87 | D4 D182 ; # CYRILLIC SMALL LETTER TE 88 | D5 D183 ; # CYRILLIC SMALL LETTER U 89 | D6 D0B6 ; # CYRILLIC SMALL LETTER ZHE 90 | D7 D0B2 ; # CYRILLIC SMALL LETTER VE 91 | D8 D18C ; # CYRILLIC SMALL LETTER SOFT SIGN 92 | D9 D18B ; # CYRILLIC SMALL LETTER YERU 93 | DA D0B7 ; # CYRILLIC SMALL LETTER ZE 94 | DB D188 ; # CYRILLIC SMALL LETTER SHA 95 | DC D18D ; # CYRILLIC SMALL LETTER E 96 | DD D189 ; # CYRILLIC SMALL LETTER SHCHA 97 | DE D187 ; # CYRILLIC SMALL LETTER CHE 98 | DF D18A ; # CYRILLIC SMALL LETTER HARD SIGN 99 | E0 D0AE ; # CYRILLIC CAPITAL LETTER YU 100 | E1 D090 ; # CYRILLIC CAPITAL LETTER A 101 | E2 D091 ; # CYRILLIC CAPITAL LETTER BE 102 | E3 D0A6 ; # CYRILLIC CAPITAL LETTER TSE 103 | E4 D094 ; # CYRILLIC CAPITAL LETTER DE 104 | E5 D095 ; # CYRILLIC CAPITAL LETTER IE 105 | E6 D0A4 ; # CYRILLIC CAPITAL LETTER EF 106 | E7 D093 ; # CYRILLIC CAPITAL LETTER GHE 107 | E8 D0A5 ; # CYRILLIC CAPITAL LETTER HA 108 | E9 D098 ; # CYRILLIC CAPITAL LETTER I 109 | EA D099 ; # CYRILLIC CAPITAL LETTER SHORT I 110 | EB D09A ; # CYRILLIC CAPITAL LETTER KA 111 | EC D09B ; # CYRILLIC CAPITAL LETTER EL 112 | ED D09C ; # CYRILLIC CAPITAL LETTER EM 113 | EE D09D ; # CYRILLIC CAPITAL LETTER EN 114 | EF D09E ; # CYRILLIC CAPITAL LETTER O 115 | F0 D09F ; # CYRILLIC CAPITAL LETTER PE 116 | F1 D0AF ; # CYRILLIC CAPITAL LETTER YA 117 | F2 D0A0 ; # CYRILLIC CAPITAL LETTER ER 118 | F3 D0A1 ; # CYRILLIC CAPITAL LETTER ES 119 | F4 D0A2 ; # CYRILLIC CAPITAL LETTER TE 120 | F5 D0A3 ; # CYRILLIC CAPITAL LETTER U 121 | F6 D096 ; # CYRILLIC CAPITAL LETTER ZHE 122 | F7 D092 ; # CYRILLIC CAPITAL LETTER VE 123 | F8 D0AC ; # CYRILLIC CAPITAL LETTER SOFT SIGN 124 | F9 D0AB ; # CYRILLIC CAPITAL LETTER YERU 125 | FA D097 ; # CYRILLIC CAPITAL LETTER ZE 126 | FB D0A8 ; # CYRILLIC CAPITAL LETTER SHA 127 | FC D0AD ; # CYRILLIC CAPITAL LETTER E 128 | FD D0A9 ; # CYRILLIC CAPITAL LETTER SHCHA 129 | FE D0A7 ; # CYRILLIC CAPITAL LETTER CHE 130 | FF D0AA ; # CYRILLIC CAPITAL LETTER HARD SIGN 131 | } 132 | -------------------------------------------------------------------------------- /nginx/docs/OpenSSL.LICENSE: -------------------------------------------------------------------------------- 1 | 2 | LICENSE ISSUES 3 | ============== 4 | 5 | The OpenSSL toolkit stays under a double license, i.e. both the conditions of 6 | the OpenSSL License and the original SSLeay license apply to the toolkit. 7 | See below for the actual license texts. Actually both licenses are BSD-style 8 | Open Source licenses. In case of any license issues related to OpenSSL 9 | please contact openssl-core@openssl.org. 10 | 11 | OpenSSL License 12 | --------------- 13 | 14 | /* ==================================================================== 15 | * Copyright (c) 1998-2017 The OpenSSL Project. All rights reserved. 16 | * 17 | * Redistribution and use in source and binary forms, with or without 18 | * modification, are permitted provided that the following conditions 19 | * are met: 20 | * 21 | * 1. Redistributions of source code must retain the above copyright 22 | * notice, this list of conditions and the following disclaimer. 23 | * 24 | * 2. Redistributions in binary form must reproduce the above copyright 25 | * notice, this list of conditions and the following disclaimer in 26 | * the documentation and/or other materials provided with the 27 | * distribution. 28 | * 29 | * 3. All advertising materials mentioning features or use of this 30 | * software must display the following acknowledgment: 31 | * "This product includes software developed by the OpenSSL Project 32 | * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" 33 | * 34 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to 35 | * endorse or promote products derived from this software without 36 | * prior written permission. For written permission, please contact 37 | * openssl-core@openssl.org. 38 | * 39 | * 5. Products derived from this software may not be called "OpenSSL" 40 | * nor may "OpenSSL" appear in their names without prior written 41 | * permission of the OpenSSL Project. 42 | * 43 | * 6. Redistributions of any form whatsoever must retain the following 44 | * acknowledgment: 45 | * "This product includes software developed by the OpenSSL Project 46 | * for use in the OpenSSL Toolkit (http://www.openssl.org/)" 47 | * 48 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY 49 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 50 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 51 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR 52 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 53 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 54 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 55 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 56 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 57 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 58 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 59 | * OF THE POSSIBILITY OF SUCH DAMAGE. 60 | * ==================================================================== 61 | * 62 | * This product includes cryptographic software written by Eric Young 63 | * (eay@cryptsoft.com). This product includes software written by Tim 64 | * Hudson (tjh@cryptsoft.com). 65 | * 66 | */ 67 | 68 | Original SSLeay License 69 | ----------------------- 70 | 71 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 72 | * All rights reserved. 73 | * 74 | * This package is an SSL implementation written 75 | * by Eric Young (eay@cryptsoft.com). 76 | * The implementation was written so as to conform with Netscapes SSL. 77 | * 78 | * This library is free for commercial and non-commercial use as long as 79 | * the following conditions are aheared to. The following conditions 80 | * apply to all code found in this distribution, be it the RC4, RSA, 81 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 82 | * included with this distribution is covered by the same copyright terms 83 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 84 | * 85 | * Copyright remains Eric Young's, and as such any Copyright notices in 86 | * the code are not to be removed. 87 | * If this package is used in a product, Eric Young should be given attribution 88 | * as the author of the parts of the library used. 89 | * This can be in the form of a textual message at program startup or 90 | * in documentation (online or textual) provided with the package. 91 | * 92 | * Redistribution and use in source and binary forms, with or without 93 | * modification, are permitted provided that the following conditions 94 | * are met: 95 | * 1. Redistributions of source code must retain the copyright 96 | * notice, this list of conditions and the following disclaimer. 97 | * 2. Redistributions in binary form must reproduce the above copyright 98 | * notice, this list of conditions and the following disclaimer in the 99 | * documentation and/or other materials provided with the distribution. 100 | * 3. All advertising materials mentioning features or use of this software 101 | * must display the following acknowledgement: 102 | * "This product includes cryptographic software written by 103 | * Eric Young (eay@cryptsoft.com)" 104 | * The word 'cryptographic' can be left out if the rouines from the library 105 | * being used are not cryptographic related :-). 106 | * 4. If you include any Windows specific code (or a derivative thereof) from 107 | * the apps directory (application code) you must include an acknowledgement: 108 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 109 | * 110 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 111 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 112 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 113 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 114 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 115 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 116 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 117 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 118 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 119 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 120 | * SUCH DAMAGE. 121 | * 122 | * The licence and distribution terms for any publically available version or 123 | * derivative of this code cannot be changed. i.e. this code cannot simply be 124 | * copied and put under another distribution licence 125 | * [including the GNU Public Licence.] 126 | */ 127 | 128 | -------------------------------------------------------------------------------- /app-vue/src/assets/sad.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /server/services/NginxService.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const path = require('path'); 3 | const LOGGER = require('../utils/logger'); 4 | const childProcess = require('child_process'); 5 | const fkill = require('fkill'); 6 | 7 | class NginxService { 8 | 9 | constructor(app, db, ws, startNginx) { 10 | this.db = db; 11 | this.nginx = null; 12 | 13 | app.route('/api/nginx/logs/access') 14 | .get(this.getAccessLog.bind(this)) 15 | ; 16 | 17 | app.route('/api/nginx/conf') 18 | .get(this.getConfFile.bind(this)) 19 | ; 20 | 21 | app.route('/api/nginx/servers') 22 | .get(this.getServers.bind(this)) 23 | .post(this.postServers.bind(this)) 24 | ; 25 | 26 | app.route('/api/nginx/servers/:id') 27 | .get(this.getServer.bind(this)) 28 | .post(this.postServer.bind(this)) 29 | .delete(this.deleteServer.bind(this)) 30 | ; 31 | 32 | app.route('/api/nginx/http') 33 | .get(this.getHttpConf.bind(this)) 34 | .post(this.postHttpConf.bind(this)) 35 | ; 36 | 37 | app.route('/api/nginx/run') 38 | .post(this.runNginx.bind(this)) 39 | ; 40 | 41 | app.route('/api/nginx/running') 42 | .get(this.isRunning.bind(this)) 43 | ; 44 | 45 | app.route('/api/nginx/kill') 46 | .post(this.killNginx.bind(this)) 47 | ; 48 | 49 | if (startNginx) { 50 | this.runNginx(); 51 | } 52 | 53 | } 54 | 55 | getAccessLog(req, res) { 56 | let accessLogs = fs.readFileSync(path.join(__dirname, '../../logs/json.log')).toString().split('\r\n').reverse(); 57 | res.send(accessLogs.splice(0, accessLogs.length > 1000 ? 1000 : accessLogs.length)); 58 | } 59 | 60 | postServers(req, res) { 61 | (req.body || []).forEach((server) => { 62 | this.db.save(this.db.getNginx(), server); 63 | }); 64 | res.send(this.db.getNginx().data) 65 | } 66 | 67 | postServer(req, res) { 68 | if (Number.parseInt(req.params.id, 10) === req.body.$loki) { 69 | this.db.save(this.db.getNginx(), req.body); 70 | res.sendStatus(200); 71 | } else { 72 | res.sendStatus(400); 73 | } 74 | } 75 | 76 | getHttpConf(req, res) { 77 | res.send(this.db.getNginxHttpConf().data); 78 | } 79 | 80 | postHttpConf(req, res) { 81 | this.db.save(this.db.getNginxHttpConf(), req.body); 82 | res.sendStatus(200); 83 | } 84 | 85 | deleteServer(req, res) { 86 | const serverToRemove = this.db.getNginx().data.find((server) => server.$loki === Number.parseInt(req.params.id, 10)); 87 | this.db.remove(this.db.getNginx(), serverToRemove); 88 | res.send(this.db.getNginx().data) 89 | } 90 | 91 | getServers(req, res) { 92 | res.send(this.db.getNginx().data) 93 | } 94 | 95 | getServer(req, res) { 96 | res.send(this.db.getNginx().data.find((server) => server.$loki === Number.parseInt(req.params.id, 10))); 97 | } 98 | 99 | getConfFile(req, res) { 100 | const httpConf = (this.db.getNginxHttpConf().data && this.db.getNginxHttpConf().data.length > 0) 101 | ? this.db.getNginxHttpConf().data : [{additionnalHttpConf : ''}]; 102 | const serversToStart = this.db.getNginx().data 103 | .filter((server) => server.enable); 104 | res.send(this.generateConfFile(httpConf[0], serversToStart)); 105 | } 106 | 107 | runNginx(req, res) { 108 | let messageSent = false; 109 | try { 110 | if (this.nginx) { 111 | LOGGER.error('Nginx is already running'); 112 | if (res) { 113 | res.send({ 114 | date: new Date(), 115 | log: 'Nginx is already running', 116 | status: 'error' 117 | }); 118 | } 119 | return; 120 | } 121 | const confFile = path.join(__dirname, '../../nginx/conf/nginx.tmp.conf'); 122 | const httpConf = (this.db.getNginxHttpConf().data && this.db.getNginxHttpConf().data.length > 0) 123 | ? this.db.getNginxHttpConf().data : [{additionnalHttpConf : ''}]; 124 | const serversToStart = this.db.getNginx().data 125 | .filter((server) => server.enable); 126 | fs.writeFileSync(confFile, this.generateConfFile(httpConf[0], serversToStart)); 127 | this.nginx = childProcess.spawn(path.join(__dirname, '../../nginx/nginx.exe'), ['-c', confFile], { 128 | cwd: path.join(__dirname, '../../') 129 | }); 130 | LOGGER.debug('Running nginx with PID : ', this.nginx.pid); 131 | this.nginx.stdout.on('data', (d) => LOGGER.debug('stdout', d.toString())); 132 | this.nginx.stderr.on('data', (d) => { 133 | LOGGER.debug('stderr', d.toString()); 134 | this.nginx = null; 135 | try { 136 | res.send({ 137 | date: new Date(), 138 | log: 'Error starting server : ' + d.toString(), 139 | status: 'error' 140 | }); 141 | messageSent = true; 142 | } catch(e){ 143 | console.error("Too late, we already sent an OK message...") 144 | } 145 | }); 146 | this.nginx.on('message', (d) => LOGGER.debug('message', (d || '').toString())); 147 | 148 | setTimeout(() => { 149 | if (res && !messageSent) { 150 | res.send({ 151 | date: new Date(), 152 | log: 'Started servers : ' + serversToStart.map((server) => server.displayName).join(','), 153 | status: 'success' 154 | }); 155 | } 156 | },2000); 157 | } catch (e) { 158 | this.nginx = null; 159 | if (res) { 160 | res.send({ 161 | date: new Date(), 162 | log: 'Error starting server : ' + e, 163 | status: 'error' 164 | }); 165 | } 166 | } 167 | } 168 | 169 | generateConfFile(httpConf, serversToStart) { 170 | return ` 171 | events { 172 | worker_connections 1024; 173 | } 174 | 175 | 176 | http { 177 | include mime.types; 178 | default_type application/octet-stream; 179 | 180 | sendfile on; 181 | 182 | keepalive_timeout 65; 183 | log_format json_logs '{"remote_addr":"$remote_addr" , "remote_user" : "$remote_user", "time_local" : "$time_local", ' 184 | '"proxy_host":"$proxy_host", "request": "$request", "status": "$status", "body_bytes_sent": "$body_bytes_sent", ' 185 | ' "http_referrer" : "$http_referer", "http_user_agent" : "$http_user_agent"}'; 186 | 187 | ${httpConf.additionnalHttpConf || '# No additionnal http configuration'} 188 | 189 | ${serversToStart 190 | .map((server) => server.conf) 191 | .reduce((a, b) => a + '\r\n' + b)} 192 | }`; 193 | } 194 | 195 | killNginx(req, res) { 196 | try { 197 | if (this.nginx) { 198 | this.nginx.on('close', (d) => { 199 | LOGGER.debug('closed', this.nginx.pid, 'with result =>', (d || '').toString()); 200 | this.nginx = null; 201 | res.send({ 202 | date: new Date(), 203 | log: 'Killed nginx', 204 | status: 'success' 205 | }); 206 | }); 207 | fkill(this.nginx.pid, {tree: true, force: true}); 208 | } else { 209 | res.sendStatus(204); 210 | } 211 | } catch (e) { 212 | res.send({ 213 | date: new Date(), 214 | log: 'Nginx isn\'t running', 215 | status: 'error' 216 | }) 217 | } 218 | } 219 | 220 | isRunning(req, res) { 221 | setTimeout(() => { 222 | if (this.nginx) { 223 | res.send(true); 224 | } else { 225 | res.send(false) 226 | } 227 | }, 1000); 228 | } 229 | } 230 | 231 | module.exports = { 232 | NginxService 233 | }; 234 | -------------------------------------------------------------------------------- /app-vue/src/assets/quasar-logo-full.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 21 | 43 | 45 | 46 | 48 | image/svg+xml 49 | 51 | 52 | 53 | 54 | 55 | 60 | 63 | 66 | 69 | 75 | 79 | 83 | 87 | 91 | 95 | 99 | 103 | 104 | 105 | 106 | 107 | 113 | 118 | 126 | 133 | 142 | 151 | 160 | 169 | 178 | 187 | 188 | 189 | 190 | 191 | 192 | -------------------------------------------------------------------------------- /app-vue/src/components/Servers.vue: -------------------------------------------------------------------------------- 1 | 184 | 185 | 212 | 213 | 214 | 459 | --------------------------------------------------------------------------------