AuspeXeu / openvpn-status

A web-based application to monitor OpenVPN server client connections
MIT License
161 stars 48 forks source link

Cannot run in Debian 10 VPS #496

Closed PrzemekSkw closed 3 years ago

PrzemekSkw commented 3 years ago

Hello, I try to run openvpn-status on my Debian 10 VPS and cannot launch web interface. I run: npm run build

> openvpn-status@4.2.32 build
> vue-cli-service build

⠼  Building for production...

 WARNING  Compiled with 3 warnings                                                                                                                                                                       12:25:11

 warning  

asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
Assets: 
  css/chunk-vendors.1e7e1a87.css (586 KiB)
  js/chunk-vendors.449692e9.js (1.17 MiB)

 warning  

entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
Entrypoints:
  app (1.76 MiB)
      css/chunk-vendors.1e7e1a87.css
      js/chunk-vendors.449692e9.js
      css/app.746e770b.css
      js/app.3849619a.js

 warning  

webpack performance recommendations: 
You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application.
For more info visit https://webpack.js.org/guides/code-splitting/

  File                                   Size              Gzipped

  dist/js/chunk-vendors.449692e9.js      1196.60 KiB       282.27 KiB
  dist/js/app.3849619a.js                21.19 KiB         7.31 KiB
  dist/css/chunk-vendors.1e7e1a87.css    586.42 KiB        67.43 KiB
  dist/css/app.746e770b.css              1.02 KiB          0.25 KiB

  Images and other types of assets omitted.

 DONE  Build complete. The dist directory is ready to be deployed.
 INFO  Check out deployment instructions at https://cli.vuejs.org/guide/deployment.html

I add to my server.conf: management myserverIP [I try ports 3013, 7656, 1194]

I set in /openvpn-status/cfg.json

{
  "port": 3013,
  "bind": "my server IP",
  "servers": [
    {"id": 0, "name": "openVPN", "host": "myserverIP","man_port": _try 7656, 3013 and 1194 ports here_},
  ],
  "username": "my_username",
  "password": "mypassword",
  "web": {
    "dateFormat": "HH:mm - DD.MM.YY"
  }
}

I run npm run build every time after try different ports. I also try bind IP=127.0.0.1 and as server IP. Nothing works.

I have node --version: v15.5.1. I install openvpn-status with: git clone https://github.com/AuspeXeu/openvpn-status.git

When I run node server.js I get:

/home/przemek/openvpn-status/node_modules/nconf/lib/nconf/stores/file.js:170
    throw new Error("Error parsing your configuration file: [" + this.file + ']: ' + ex.message);
    ^

Error: Error parsing your configuration file: [/home/przemek/openvpn-status/cfg.json]: Unexpected token ] in JSON at position 132
    at exports.File.File.loadSync (/home/przemek/openvpn-status/node_modules/nconf/lib/nconf/stores/file.js:170:11)
    at exports.Provider.Provider.add (/home/przemek/openvpn-status/node_modules/nconf/lib/nconf/provider.js:136:23)
    at exports.Provider.Provider.file (/home/przemek/openvpn-status/node_modules/nconf/lib/nconf/provider.js:63:15)
    at Object.<anonymous> (/home/przemek/openvpn-status/utils.js:7:6)
    at Module._compile (node:internal/modules/cjs/loader:1108:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10)
    at Module.load (node:internal/modules/cjs/loader:973:32)
    at Function.Module._load (node:internal/modules/cjs/loader:813:14)
    at Module.require (node:internal/modules/cjs/loader:997:19)
    at require (node:internal/modules/cjs/helpers:92:18)

Regards, Przemek

AuspeXeu commented 3 years ago

It seems like your config file is not valid JSON. Try checking this using this website https://jsonlint.com/

PrzemekSkw commented 3 years ago

Hi, @AuspeXeu thank You very much for answer. It was something wrong with password line but after I change it now validator shows everything OK. I have another errors I don't understand. Sorry my lack of knowlege but I'm not programmer and I don't know npm installing and programming.

~/openvpn-status$ node server.js 
/home/przemek/openvpn-status/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:88
        throw new Error(`Please install ${moduleName} package manually`);
        ^

Error: Please install sqlite3 package manually
    at ConnectionManager._loadDialectModule (/home/przemek/openvpn-status/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:88:15)
    at new ConnectionManager (/home/przemek/openvpn-status/node_modules/sequelize/lib/dialects/sqlite/connection-manager.js:22:21)
    at new SqliteDialect (/home/przemek/openvpn-status/node_modules/sequelize/lib/dialects/sqlite/index.js:14:30)
    at new Sequelize (/home/przemek/openvpn-status/node_modules/sequelize/lib/sequelize.js:324:20)
    at Object.<anonymous> (/home/przemek/openvpn-status/database.js:3:19)
    at Module._compile (node:internal/modules/cjs/loader:1108:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10)
    at Module.load (node:internal/modules/cjs/loader:973:32)
    at Function.Module._load (node:internal/modules/cjs/loader:813:14)
    at Module.require (node:internal/modules/cjs/loader:997:19)
    at require (node:internal/modules/cjs/helpers:92:18)
    at Object.<anonymous> (/home/przemek/openvpn-status/server.js:11:12)
    at Module._compile (node:internal/modules/cjs/loader:1108:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10)
    at Module.load (node:internal/modules/cjs/loader:973:32)
    at Function.Module._load (node:internal/modules/cjs/loader:813:14)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12)
    at node:internal/main/run_main_module:17:47
~/openvpn-status$ npm install sqlite3

added 3 packages, and audited 1580 packages in 6s

1 high severity vulnerability

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.
~/openvpn-status$ npm audit fix --force
npm WARN using --force Recommended protections disabled.
npm WARN audit Updating axios to 0.21.1,which is a SemVer major change.

added 1 package, changed 1 package, and audited 1581 packages in 4s

1 package is looking for funding
  run `npm fund` for details

found 0 vulnerabilities
~/openvpn-status$ node server.js 
/home/przemek/openvpn-status/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:88
        throw new Error(`Please install ${moduleName} package manually`);
        ^
Error: Please install sqlite3 package manually
    at ConnectionManager._loadDialectModule (/home/przemek/openvpn-status/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:88:15)
    at new ConnectionManager (/home/przemek/openvpn-status/node_modules/sequelize/lib/dialects/sqlite/connection-manager.js:22:21)
    at new SqliteDialect (/home/przemek/openvpn-status/node_modules/sequelize/lib/dialects/sqlite/index.js:14:30)
    at new Sequelize (/home/przemek/openvpn-status/node_modules/sequelize/lib/sequelize.js:324:20)
    at Object.<anonymous> (/home/przemek/openvpn-status/database.js:3:19)
    at Module._compile (node:internal/modules/cjs/loader:1108:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10)
    at Module.load (node:internal/modules/cjs/loader:973:32)
    at Function.Module._load (node:internal/modules/cjs/loader:813:14)
    at Module.require (node:internal/modules/cjs/loader:997:19)
    at require (node:internal/modules/cjs/helpers:92:18)
    at Object.<anonymous> (/home/przemek/openvpn-status/server.js:11:12)
    at Module._compile (node:internal/modules/cjs/loader:1108:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10)
    at Module.load (node:internal/modules/cjs/loader:973:32)
    at Function.Module._load (node:internal/modules/cjs/loader:813:14)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12)
    at node:internal/main/run_main_module:17:47

Regards.

PrzemekSkw commented 3 years ago

@AuspeXeu I read now about rebuild command and have that:

~/openvpn-status$ npm rebuild
npm ERR! code 1
npm ERR! path /home/przemek/openvpn-status/node_modules/sqlite3
npm ERR! command failed
npm ERR! command sh -c node-gyp rebuild
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@7.1.2
npm ERR! gyp info using node@15.5.1 | linux | x64
npm ERR! gyp info find Python using Python version 3.7.3 found at "/usr/bin/python3"
npm ERR! gyp http GET https://nodejs.org/download/release/v15.5.1/node-v15.5.1-headers.tar.gz
npm ERR! gyp http 200 https://nodejs.org/download/release/v15.5.1/node-v15.5.1-headers.tar.gz
npm ERR! gyp http GET https://nodejs.org/download/release/v15.5.1/SHASUMS256.txt
npm ERR! gyp http 200 https://nodejs.org/download/release/v15.5.1/SHASUMS256.txt
npm ERR! gyp info spawn /usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/home/przemek/openvpn-status/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'make',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/przemek/openvpn-status/node_modules/sqlite3/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/przemek/openvpn-status/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/przemek/.cache/node-gyp/15.5.1/include/node/common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=/home/przemek/.cache/node-gyp/15.5.1',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/home/przemek/openvpn-status/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/home/przemek/.cache/node-gyp/15.5.1/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/home/przemek/openvpn-status/node_modules/sqlite3',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp: Undefined variable module_name in binding.gyp while trying to load binding.gyp
npm ERR! gyp ERR! configure error 
npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
npm ERR! gyp ERR! stack     at ChildProcess.onCpExit (/home/przemek/openvpn-status/node_modules/node-gyp/lib/configure.js:351:16)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:376:20)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:284:12)
npm ERR! gyp ERR! System Linux 4.19.0-13-amd64
npm ERR! gyp ERR! command "/usr/bin/node" "/home/przemek/openvpn-status/node_modules/.bin/node-gyp" "rebuild"
npm ERR! gyp ERR! cwd /home/przemek/openvpn-status/node_modules/sqlite3
npm ERR! gyp ERR! node -v v15.5.1
npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/przemek/.npm/_logs/2021-01-13T12_07_50_881Z-debug.log

Regards.

AuspeXeu commented 3 years ago

This is an issue with the sqlite3 package, please contact them here for help https://github.com/mapbox/node-sqlite3