From 3cb34a226aa4d3d226e09175477f40add85ce4a0 Mon Sep 17 00:00:00 2001 From: ztimson Date: Mon, 6 Apr 2026 02:49:14 -0400 Subject: [PATCH] Added new codebook page --- .gitignore | 2 +- client/package-lock.json | 1170 ++++++++++ {code => client}/package.json | 2 + client/public/code-book-print.html | 284 +++ client/public/code-book.html | 669 ++++++ .../public/downloads/ATAK_5.4.0.16.apk | Bin {code => client}/public/downloads/Element.apk | Bin .../public/downloads/Meshtastic_2.7.1.apk | Bin .../downloads/Remote Desktop 8_8.1.82.445.apk | Bin .../public/downloads/SDRangel_7.21.3.1.apk | Bin client/public/encryption.js | 113 + {code => client}/public/favicon.png | Bin client/public/icons/cog.svg | 1 + client/public/icons/download.svg | 1 + client/public/icons/guage.svg | 1 + client/public/icons/open-sight.png | Bin 0 -> 25596 bytes {code => client}/public/index.html | 1879 ++++++++--------- {code => client}/public/index.js | 742 +++---- {public => client/public}/manifest.json | 38 +- {code => client}/src/config.json | 0 {code => client}/src/main.mjs | 102 +- {code => client}/src/services/environment.mjs | 76 +- {src => client/src}/services/status.mjs | 852 ++++---- code/package-lock.json | 370 ---- code/public/manifest.json | 19 - code/src/services/status.mjs | 426 ---- public/favicon.png | Bin 33248 -> 0 bytes public/index.html | 939 -------- public/index.js | 368 ---- src/main.mjs | 51 - src/services/environment.mjs | 38 - 31 files changed, 4076 insertions(+), 4067 deletions(-) create mode 100644 client/package-lock.json rename {code => client}/package.json (87%) mode change 100755 => 100644 create mode 100644 client/public/code-book-print.html create mode 100644 client/public/code-book.html rename {code => client}/public/downloads/ATAK_5.4.0.16.apk (100%) mode change 100755 => 100644 rename {code => client}/public/downloads/Element.apk (100%) mode change 100755 => 100644 rename {code => client}/public/downloads/Meshtastic_2.7.1.apk (100%) mode change 100755 => 100644 rename {code => client}/public/downloads/Remote Desktop 8_8.1.82.445.apk (100%) mode change 100755 => 100644 rename {code => client}/public/downloads/SDRangel_7.21.3.1.apk (100%) mode change 100755 => 100644 create mode 100644 client/public/encryption.js rename {code => client}/public/favicon.png (100%) mode change 100755 => 100644 create mode 100644 client/public/icons/cog.svg create mode 100644 client/public/icons/download.svg create mode 100644 client/public/icons/guage.svg create mode 100644 client/public/icons/open-sight.png rename {code => client}/public/index.html (87%) mode change 100755 => 100644 rename {code => client}/public/index.js (97%) mode change 100755 => 100644 rename {public => client/public}/manifest.json (94%) mode change 100755 => 100644 rename {code => client}/src/config.json (100%) rename {code => client}/src/main.mjs (96%) mode change 100755 => 100644 rename {code => client}/src/services/environment.mjs (96%) mode change 100755 => 100644 rename {src => client/src}/services/status.mjs (96%) mode change 100755 => 100644 delete mode 100755 code/package-lock.json delete mode 100755 code/public/manifest.json delete mode 100755 code/src/services/status.mjs delete mode 100755 public/favicon.png delete mode 100755 public/index.html delete mode 100755 public/index.js delete mode 100755 src/main.mjs delete mode 100755 src/services/environment.mjs diff --git a/.gitignore b/.gitignore index 7a1537b..a8dce37 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ .idea -node_modules +client/node_modules diff --git a/client/package-lock.json b/client/package-lock.json new file mode 100644 index 0000000..a77e10e --- /dev/null +++ b/client/package-lock.json @@ -0,0 +1,1170 @@ +{ + "name": "dashboard", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "dashboard", + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "dotenv": "^17.4.1", + "express": "^5.2.1", + "node-gpsd": "^0.3.4" + }, + "devDependencies": { + "nodemon": "^3.1.10" + } + }, + "node_modules/accepts": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz", + "integrity": "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==", + "license": "MIT", + "dependencies": { + "mime-types": "^3.0.0", + "negotiator": "^1.0.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "node_modules/binary-extensions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/body-parser": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.2.2.tgz", + "integrity": "sha512-oP5VkATKlNwcgvxi0vM0p/D3n2C3EReYVX+DNYs5TjZFn/oQt2j+4sVJtSMr18pdRr8wjTcBl6LoV+FUwzPmNA==", + "license": "MIT", + "dependencies": { + "bytes": "^3.1.2", + "content-type": "^1.0.5", + "debug": "^4.4.3", + "http-errors": "^2.0.0", + "iconv-lite": "^0.7.0", + "on-finished": "^2.4.1", + "qs": "^6.14.1", + "raw-body": "^3.0.1", + "type-is": "^2.0.1" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/chokidar": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "dev": true, + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, + "node_modules/content-disposition": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-1.0.1.tgz", + "integrity": "sha512-oIXISMynqSqm241k6kcQ5UwttDILMK4BiurCfGEREw6+X9jkkpEe5T9FZaApyLGGOnFuyMWZpdolTXMtvEJ08Q==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", + "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.2.2.tgz", + "integrity": "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==", + "license": "MIT", + "engines": { + "node": ">=6.6.0" + } + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/dotenv": { + "version": "17.4.1", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-17.4.1.tgz", + "integrity": "sha512-k8DaKGP6r1G30Lx8V4+pCsLzKr8vLmV2paqEj1Y55GdAgJuIqpRp5FfajGF8KtwMxCz9qJc6wUIJnm053d/WCw==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", + "license": "MIT" + }, + "node_modules/encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", + "license": "MIT" + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/express": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/express/-/express-5.2.1.tgz", + "integrity": "sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==", + "license": "MIT", + "dependencies": { + "accepts": "^2.0.0", + "body-parser": "^2.2.1", + "content-disposition": "^1.0.0", + "content-type": "^1.0.5", + "cookie": "^0.7.1", + "cookie-signature": "^1.2.1", + "debug": "^4.4.0", + "depd": "^2.0.0", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "etag": "^1.8.1", + "finalhandler": "^2.1.0", + "fresh": "^2.0.0", + "http-errors": "^2.0.0", + "merge-descriptors": "^2.0.0", + "mime-types": "^3.0.0", + "on-finished": "^2.4.1", + "once": "^1.4.0", + "parseurl": "^1.3.3", + "proxy-addr": "^2.0.7", + "qs": "^6.14.0", + "range-parser": "^1.2.1", + "router": "^2.2.0", + "send": "^1.1.0", + "serve-static": "^2.2.0", + "statuses": "^2.0.1", + "type-is": "^2.0.1", + "vary": "^1.1.2" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/finalhandler": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-2.1.1.tgz", + "integrity": "sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.0", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "on-finished": "^2.4.1", + "parseurl": "^1.3.3", + "statuses": "^2.0.1" + }, + "engines": { + "node": ">= 18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-2.0.0.tgz", + "integrity": "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/http-errors": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz", + "integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==", + "license": "MIT", + "dependencies": { + "depd": "~2.0.0", + "inherits": "~2.0.4", + "setprototypeof": "~1.2.0", + "statuses": "~2.0.2", + "toidentifier": "~1.0.1" + }, + "engines": { + "node": ">= 0.8" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/iconv-lite": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.2.tgz", + "integrity": "sha512-im9DjEDQ55s9fL4EYzOAv0yMqmMBSZp6G0VvFyTMPKWxiSBHUj9NW/qqLmXUwXrrM7AvqSlTCfvqRb0cM8yYqw==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/ignore-by-default": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", + "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==", + "dev": true + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "license": "MIT", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-promise": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz", + "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==", + "license": "MIT" + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/media-typer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.0.tgz", + "integrity": "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/merge-descriptors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-2.0.0.tgz", + "integrity": "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mime-db": { + "version": "1.54.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz", + "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.2.tgz", + "integrity": "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==", + "license": "MIT", + "dependencies": { + "mime-db": "^1.54.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/negotiator": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz", + "integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/node-gpsd": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/node-gpsd/-/node-gpsd-0.3.4.tgz", + "integrity": "sha512-sI9hPfHiaWDmhjE1oJZnhMo7UF2vQVGl3qk0K4HbN1L8BkS0I+rd6V687eHOj/6ervXiHrhwXzYYsWdXxGy0Qg==", + "engines": { + "node": ">=v0.8.0" + } + }, + "node_modules/nodemon": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.1.10.tgz", + "integrity": "sha512-WDjw3pJ0/0jMFmyNDp3gvY2YizjLmmOUQo6DEBY+JgdvW/yQ9mEeSw6H5ythl5Ny2ytb7f9C2nIbjSxMNzbJXw==", + "dev": true, + "dependencies": { + "chokidar": "^3.5.2", + "debug": "^4", + "ignore-by-default": "^1.0.1", + "minimatch": "^3.1.2", + "pstree.remy": "^1.1.8", + "semver": "^7.5.3", + "simple-update-notifier": "^2.0.0", + "supports-color": "^5.5.0", + "touch": "^3.1.0", + "undefsafe": "^2.0.5" + }, + "bin": { + "nodemon": "bin/nodemon.js" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/nodemon" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "license": "MIT", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-to-regexp": { + "version": "8.4.2", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.4.2.tgz", + "integrity": "sha512-qRcuIdP69NPm4qbACK+aDogI5CBDMi1jKe0ry5rSQJz8JVLsC7jV8XpiJjGRLLol3N+R5ihGYcrPLTno6pAdBA==", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "license": "MIT", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/pstree.remy": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", + "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==", + "dev": true + }, + "node_modules/qs": { + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.15.0.tgz", + "integrity": "sha512-mAZTtNCeetKMH+pSjrb76NAM8V9a05I9aBZOHztWy/UqcJdQYNsf59vrRKWnojAT9Y+GbIvoTBC++CPHqpDBhQ==", + "license": "BSD-3-Clause", + "dependencies": { + "side-channel": "^1.1.0" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-3.0.2.tgz", + "integrity": "sha512-K5zQjDllxWkf7Z5xJdV0/B0WTNqx6vxG70zJE4N0kBs4LovmEYWJzQGxC9bS9RAKu3bgM40lrd5zoLJ12MQ5BA==", + "license": "MIT", + "dependencies": { + "bytes": "~3.1.2", + "http-errors": "~2.0.1", + "iconv-lite": "~0.7.0", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/router": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/router/-/router-2.2.0.tgz", + "integrity": "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.0", + "depd": "^2.0.0", + "is-promise": "^4.0.0", + "parseurl": "^1.3.3", + "path-to-regexp": "^8.0.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "license": "MIT" + }, + "node_modules/semver": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", + "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/send": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/send/-/send-1.2.1.tgz", + "integrity": "sha512-1gnZf7DFcoIcajTjTwjwuDjzuz4PPcY2StKPlsGAQ1+YH20IRVrBaXSWmdjowTJ6u8Rc01PoYOGHXfP1mYcZNQ==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.3", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "etag": "^1.8.1", + "fresh": "^2.0.0", + "http-errors": "^2.0.1", + "mime-types": "^3.0.2", + "ms": "^2.1.3", + "on-finished": "^2.4.1", + "range-parser": "^1.2.1", + "statuses": "^2.0.2" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/serve-static": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-2.2.1.tgz", + "integrity": "sha512-xRXBn0pPqQTVQiC8wyQrKs2MOlX24zQ0POGaj0kultvoOCstBQM5yvOhAVSUwOMjQtTvsPWoNCHfPGwaaQJhTw==", + "license": "MIT", + "dependencies": { + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "parseurl": "^1.3.3", + "send": "^1.2.0" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "license": "ISC" + }, + "node_modules/side-channel": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/simple-update-notifier": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-2.0.0.tgz", + "integrity": "sha512-a2B9Y0KlNXl9u/vsW6sTIu9vGEpfKu2wRV6l1H3XEas/0gUIzGzBoP/IouTcUQbm9JWZLH3COxyn03TYlFax6w==", + "dev": true, + "dependencies": { + "semver": "^7.5.3" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/statuses": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz", + "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "license": "MIT", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/touch": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.1.tgz", + "integrity": "sha512-r0eojU4bI8MnHr8c5bNo7lJDdI2qXlWWJk6a9EAFG7vbhTjElYhBVS3/miuE0uOuoLdb8Mc/rVfsmm6eo5o9GA==", + "dev": true, + "bin": { + "nodetouch": "bin/nodetouch.js" + } + }, + "node_modules/type-is": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-2.0.1.tgz", + "integrity": "sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw==", + "license": "MIT", + "dependencies": { + "content-type": "^1.0.5", + "media-typer": "^1.1.0", + "mime-types": "^3.0.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/undefsafe": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz", + "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==", + "dev": true + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "license": "ISC" + } + } +} diff --git a/code/package.json b/client/package.json old mode 100755 new mode 100644 similarity index 87% rename from code/package.json rename to client/package.json index 6b47216..0b00fba --- a/code/package.json +++ b/client/package.json @@ -11,6 +11,8 @@ "license": "MIT", "description": "Dashboard", "dependencies": { + "dotenv": "^17.4.1", + "express": "^5.2.1", "node-gpsd": "^0.3.4" }, "devDependencies": { diff --git a/client/public/code-book-print.html b/client/public/code-book-print.html new file mode 100644 index 0000000..aa45674 --- /dev/null +++ b/client/public/code-book-print.html @@ -0,0 +1,284 @@ + + + + Code Book + + + + + +
+
+

Encryption Key

+ +
+ +

ASCII Reference Table

+
+
+ + +
+

ONE-TIME PASSWORDS (HOTP)

+
+
+ + +
+

AUTHENTICATION TABLES

+
+
+ + +
+

ONE-TIME PAD

+
+
+ + + + + + diff --git a/client/public/code-book.html b/client/public/code-book.html new file mode 100644 index 0000000..3f7a99b --- /dev/null +++ b/client/public/code-book.html @@ -0,0 +1,669 @@ + + + + Code Book + + + + + + + +
+
+
+ Logo + +
+
+
+ +
+
+
+ +
+ + + +
+
+
+ + +
+
One Time Password (HOTP)
+
+ Description + +
+

Use a 3-digit challenge to generate & verify a corresponding 3-letter response.

+

Provides higher entropy and security than authentication tables while being easier to use.

+ +
+ Pre-Authenticate: +
+

A->B: AUTH 123 ABC

+

B->A: ACK. AUTH 456 DEF

+
+
+ +
+ Challenge-Response: +
+

A->B: CONFIRM 123

+

B->A: ACK ABC. CONFIRM 456

+

A->B: ACK DEF

+
+
+
+
+
+ + +
---
+
+
+ + +
+
Authentication Tables
+
+ Description + +
+

Challenge-response tables for authentication.

+ +
+ Example: +
+

A->B: CONFIRM CEY (Table: Charlie, Column: E, Row: Y)

+

B->A: ACK 7. CONFIRM AIT (Table: Alpha, Column: I, Row: T)

+

A->B: ACK T

+
+
+
+
+
+ + +
+
+
+ + +
+
One-Time Pad
+
+ Description + +
+

Use a 5-digit key to generate a corresponding fixed (paper friendly) or streamed (more secure) cipher.

+

Cipher values are added to the ASCII encoded message to create encrypted message.

+ +
+ Encoding: +
+ Message: "HI"
+ Pad Key: 12345
+ Cipher: 42 85 28 71 14 ...

+ + H = ASCII 72 → 72 + 42 = 114 → Hex 72
+ I = ASCII 73 → 73 + 85 = 158 → Hex 9E

+ + Encoded: 729E +
+
+ +
+ Decoding: +
+ Encoded: 729E
+ Pad Key: 12345
+ Cipher: 42 85 28 71 14 ...

+ + 72 (Hex) = 114 → 114 - 42 = 72 → ASCII 'H'
+ 9E (Hex) = 158 → 158 - 85 = 73 → ASCII 'I'

+ + Decoded: "HI" +
+
+
+
+
+
+ + +
+ + +
+
+
+
+
+
+ +
+ + +
+ +
+
+ + +
+
ASCII Reference Table
+
+
+
+ + + + + + diff --git a/code/public/downloads/ATAK_5.4.0.16.apk b/client/public/downloads/ATAK_5.4.0.16.apk old mode 100755 new mode 100644 similarity index 100% rename from code/public/downloads/ATAK_5.4.0.16.apk rename to client/public/downloads/ATAK_5.4.0.16.apk diff --git a/code/public/downloads/Element.apk b/client/public/downloads/Element.apk old mode 100755 new mode 100644 similarity index 100% rename from code/public/downloads/Element.apk rename to client/public/downloads/Element.apk diff --git a/code/public/downloads/Meshtastic_2.7.1.apk b/client/public/downloads/Meshtastic_2.7.1.apk old mode 100755 new mode 100644 similarity index 100% rename from code/public/downloads/Meshtastic_2.7.1.apk rename to client/public/downloads/Meshtastic_2.7.1.apk diff --git a/code/public/downloads/Remote Desktop 8_8.1.82.445.apk b/client/public/downloads/Remote Desktop 8_8.1.82.445.apk old mode 100755 new mode 100644 similarity index 100% rename from code/public/downloads/Remote Desktop 8_8.1.82.445.apk rename to client/public/downloads/Remote Desktop 8_8.1.82.445.apk diff --git a/code/public/downloads/SDRangel_7.21.3.1.apk b/client/public/downloads/SDRangel_7.21.3.1.apk old mode 100755 new mode 100644 similarity index 100% rename from code/public/downloads/SDRangel_7.21.3.1.apk rename to client/public/downloads/SDRangel_7.21.3.1.apk diff --git a/client/public/encryption.js b/client/public/encryption.js new file mode 100644 index 0000000..288eec1 --- /dev/null +++ b/client/public/encryption.js @@ -0,0 +1,113 @@ +// encryption.js + +// Phonetic alphabet for table names +const PHONETIC = ['Alpha', 'Bravo', 'Charlie', 'Delta', 'Echo', 'Foxtrot', 'Golf', 'Hotel', + 'India', 'Juliet', 'Kilo', 'Lima', 'Mike', 'November', 'Oscar', 'Papa', + 'Quebec', 'Romeo', 'Sierra', 'Tango', 'Uniform', 'Victor', 'Whiskey', + 'Xray', 'Yankee', 'Zulu']; + +const CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'; +const LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; + +// Seeded RNG using SHA256 +class SeededRandom { + constructor(seed) { + this.seed = seed; + this.counter = 0; + } + + next() { + const hash = CryptoJS.SHA256(this.seed + ':' + this.counter); + this.counter++; + const hex = hash.toString(CryptoJS.enc.Hex); + return parseInt(hex.substring(0, 8), 16) / 0xFFFFFFFF; + } + + nextInt(min, max) { + return Math.floor(this.next() * (max - min)) + min; + } + + choice(arr) { + return arr[this.nextInt(0, arr.length)]; + } +} + +// HOTP Generation - 3 digit nonce -> 3 letter code +function generateHOTP(secret, nonce) { + const rng = new SeededRandom(secret + ':hotp:' + nonce); + let code = ''; + for (let i = 0; i < 3; i++) { + code += rng.choice(LETTERS.split('')); + } + return code; +} + +// Auth Tables +function generateAuthTable(seed, tableIndex) { + const rng = new SeededRandom(seed + ':table:' + tableIndex); + const rows = 'NOPQRSTUVWXYZ'.split(''); + const cols = 'ABCDEFGHIJKLM'.split(''); + + const table = []; + for (let row of rows) { + const rowData = []; + for (let col of cols) { + rowData.push(rng.choice(CHARS.split(''))); + } + table.push(rowData); + } + + return table; +} + +// One-Time Pad (for encode/decode) +function generatePad(seed, padKey, length = 60) { + const rng = new SeededRandom(seed + ':pad:' + padKey); + const pad = []; + for (let i = 0; i < length; i++) { + pad.push(rng.nextInt(0, 256)); + } + return pad; +} + +function generatePadDisplay(seed, padKey) { + const rng = new SeededRandom(seed + ':pad:' + padKey); + const groups = []; + for (let i = 0; i < 12; i++) { + const num = rng.nextInt(0, 100000).toString().padStart(5, '0'); + groups.push(num); + } + return groups.join(' '); +} + +function encodeMessage(message, key, padKey, useStream = true) { + const messageBytes = new TextEncoder().encode(message); + const padLength = useStream ? messageBytes.length : 60; + const pad = generatePad(key, padKey, padLength); + + const encoded = []; + for (let i = 0; i < messageBytes.length; i++) { + const padByte = pad[i % pad.length]; + encoded.push(messageBytes[i] ^ padByte); + } + + return Array.from(encoded).map(b => b.toString(16).padStart(2, '0')).join(''); +} + +function decodeMessage(encoded, key, padKey, useStream = true) { + const bytes = []; + for (let i = 0; i < encoded.length; i += 2) { + bytes.push(parseInt(encoded.substr(i, 2), 16)); + } + + const padLength = useStream ? bytes.length : 60; + const pad = generatePad(key, padKey, padLength); + + const decoded = []; + for (let i = 0; i < bytes.length; i++) { + const padByte = pad[i % pad.length]; + decoded.push(bytes[i] ^ padByte); + } + + return new TextDecoder().decode(new Uint8Array(decoded)); +} diff --git a/code/public/favicon.png b/client/public/favicon.png old mode 100755 new mode 100644 similarity index 100% rename from code/public/favicon.png rename to client/public/favicon.png diff --git a/client/public/icons/cog.svg b/client/public/icons/cog.svg new file mode 100644 index 0000000..d8bf436 --- /dev/null +++ b/client/public/icons/cog.svg @@ -0,0 +1 @@ + diff --git a/client/public/icons/download.svg b/client/public/icons/download.svg new file mode 100644 index 0000000..7077ced --- /dev/null +++ b/client/public/icons/download.svg @@ -0,0 +1 @@ + diff --git a/client/public/icons/guage.svg b/client/public/icons/guage.svg new file mode 100644 index 0000000..9137cff --- /dev/null +++ b/client/public/icons/guage.svg @@ -0,0 +1 @@ + diff --git a/client/public/icons/open-sight.png b/client/public/icons/open-sight.png new file mode 100644 index 0000000000000000000000000000000000000000..63671a76ec0fce209203a1f2b7da9888e65334de GIT binary patch literal 25596 zcmZ5{bzD?kxb+zt5l}#oMrl+)q(d43X%GbI?gnW_k&sS@ZlpoFOQfYc29S_0>HaqF zz4xDw-;8r+oH=Ko9nW6RTI>0$r0@p!9@#wzf^cP|B~-xc#oZGN1Nii zKuQJ{w$7{yl4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y&e zj6;TR@CCSwHLFZW6Cj(UaeOKUByGRSO1`+nMCl^+n_~6+TvV2*KKpmUM8*pZpR34F z<1KA5m<+WY3sFblY4Qtv3nD&fpqD5pjQjNsU_>f(JRF0d2(&`FV}6T~i3ug)wkxHl zM_*Z06&)3YKsYEOzl=Fd+tbc8)k%a7OvnM#)^hOKI&I8Ez{@qjPGU4c7ldy~RVcxK z1UB}DpFhd>0pkD%)q&T@hj=o7e>sICr`J{8eN(q0QwPNG=O>tDNj%^;E|XE;5E>pG zmWA7%7Vb(MPJg&`HNxK?AE<>)Xf!=k7I4P_{2qt@Uvb#eCxGA(q+{gsuJ~RaPmaY98Hv=30RO)6Vw*Yi(LcO>{w^iPdpXW`#`K)=gy+v_dMGb?9$gBp(Uy)AC&T=} zYA~QZGzlXaN(Riz&ylZ1YKyEn4Udjy*VWZE899ljG)rp~sqZ-hPkZLCOXgeIob&Cr zAH~)(qJE#S0_O{Y7b3wTaw?BMTOL&E?<3 - - - MRS Dashboard - - - - - - - -
-
-
- Logo -
- -
Hostname
-
-
-
-
-
-
Local
-
00:00:00
-
Jan 1, 2025
-
-
-
Zulu / UTC
-
00:00:00
-
Jan 1, 2025
-
-
-
-
-
-
- - - - - - - - - - - - - - - -
-
- - - - - -
-
- - - - - - - - - - - - - - - - -
-
- - - - - - -
-
- - - - -
-
- - - -
-
-
-
- -
-
-
-
- - - - - - - - -
System ?°C
-
-
-
-
CPU - Load
-
-
-
0%
-
-
-
-
Memory
-
-
-
0%
-
-
-
-
Disk
-
-
-
0%
-
-
-
-
- -
-
- - - - - - - - - - - - - - - -
GPS
-
-
-
39.2000, -49.0000
-
No Fix
-
-
- -
-
- - - - - -
LoRa
-
-
-
0 / 0 Online
-
Ch 0% Air 0%
-
-
- -
-
- - - - - - - - - - - - - - - - -
Mesh
-
-
-
Connected
-
900 Mhz -45 dBm
-
-
- -
-
- - - - - - -
WiFi
-
-
-
Access Point
-
SSID: Hostname
-
-
- -
-
- - - - -
Ethernet
-
-
-
Disconnected
-
No cable detected
-
-
- -
-
-
- - - - - - + + + + MRS Dashboard + + + + + + + +
+
+
+ Logo +
+ +
Hostname
+
+
+
+
+
+
Local
+
00:00:00
+
Jan 1, 2025
+
+
+
Zulu / UTC
+
00:00:00
+
Jan 1, 2025
+
+
+
+
+
+
+ + + + + + + + + + + + + + + +
+
+ + + + + +
+
+ + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
+ + + + +
+
+ + + +
+
+
+
+ +
+
+
+
+ + + + + + + + +
System ?°C
+
+
+
+
CPU - Load
+
+
+
0%
+
+
+
+
Memory
+
+
+
0%
+
+
+
+
Disk
+
+
+
0%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + +
GPS
+
+
+
39.2000, -49.0000
+
No Fix
+
+
+ +
+
+ + + + + +
LoRa
+
+
+
0 / 0 Online
+
Ch 0% Air 0%
+
+
+ +
+
+ + + + + + + + + + + + + + + + +
Mesh
+
+
+
Connected
+
900 Mhz -45 dBm
+
+
+ +
+
+ + + + + + +
WiFi
+
+
+
Access Point
+
SSID: Hostname
+
+
+ +
+
+ + + + +
Ethernet
+
+
+
Disconnected
+
No cable detected
+
+
+ +
+
+
+ + + + + + diff --git a/code/public/index.js b/client/public/index.js old mode 100755 new mode 100644 similarity index 97% rename from code/public/index.js rename to client/public/index.js index d07c59d..949deb0 --- a/code/public/index.js +++ b/client/public/index.js @@ -1,368 +1,374 @@ - -class Dashboard { - constructor() { - this.statusCache = null; - this.lastFetch = 0; - this.hostname = 'localhost'; - this.serverTimeOffset = null; // Track difference between server and client time - this.isTimeServerSynced = false; // Track if we're using server time - this.init(); - } - - async init() { - await this.fetchHostname(); - this.updateHostname(); - this.startTimeUpdates(); // Start with client time immediately - this.startStatusUpdates(); - this.initializeEventListeners(); - } - - async fetchHostname() { - try { - const response = await fetch('/api/hostname'); - const data = await response.json(); - this.hostname = data.hostname.toLowerCase(); - } catch (error) { - console.warn('Failed to fetch hostname:', error); - } - } - - updateHostname() { - const hostnameElement = document.querySelector('.hostname'); - if (hostnameElement) { - hostnameElement.textContent = this.hostname; - } - } - - async fetchStatus() { - try { - // Record start time for latency calculation - const requestStart = performance.now(); - const response = await fetch('/api/status'); - const requestEnd = performance.now(); - - if (!response.ok) throw new Error('Status fetch failed'); - - const status = await response.json(); - this.statusCache = status; - this.updateUI(status, requestStart, requestEnd); - } catch (error) { - console.error('Failed to fetch status:', error); - this.showOfflineStatus(); - } - } - - updateUI(status, requestStart, requestEnd) { - this.updateSystemMetrics(status.system); - this.updateGPSStatus(status.gps); - this.updateNetworkStatus(status.network); - this.updateLoRaStatus(status.lora); - this.updateTimeSync(status.time, requestStart, requestEnd); - } - - updateSystemMetrics(system) { - // Update temperature - const tempElement = document.getElementById('temp'); - if (tempElement && system.temperature) { - tempElement.textContent = `${system.temperature}°C`; - } - - // Update load average - const loadElement = document.getElementById('load'); - if (loadElement && system.load !== undefined) { - loadElement.textContent = `${system.load.toFixed(1)} Load`; - } - - // Update progress bars - this.updateProgressBar('cpu-usage', system.cpu); - this.updateProgressBar('memory-usage', system.memory); - this.updateProgressBar('disk-usage', system.storage); - } - - updateProgressBar(id, percentage) { - const fillElement = document.getElementById(`${id}-fill`); - const textElement = document.getElementById(`${id}-text`); - - if (fillElement && textElement) { - const value = Math.round(percentage); - fillElement.style.width = `${value}%`; - textElement.textContent = `${value}%`; - - // Update color based on usage - if (value > 80) { - fillElement.style.background = '#ef4444'; // Red - } else if (value > 60) { - fillElement.style.background = '#f59e0b'; // Orange - } else { - fillElement.style.background = '#10b981'; // Green - } - } - } - - updateGPSStatus(gps) { - const gpsStatus = document.getElementById('gps-status'); - const gpsTile = document.getElementById('gps-tile'); - - if (gpsStatus && gpsTile) { - const hasValidFix = gps.fix !== 'No Fix' && gps.latitude !== null; - - // Update status indicator - if (hasValidFix) { - gpsStatus.classList.remove('disconnected'); - gpsStatus.classList.add('connected'); - gpsTile.classList.remove('disconnected'); - gpsTile.classList.add('connected'); - } else { - gpsStatus.classList.remove('connected'); - gpsStatus.classList.add('disconnected'); - gpsTile.classList.remove('connected'); - gpsTile.classList.add('disconnected'); - } - - // Update GPS tile info - const gpsInfo = gpsTile.querySelector('.tile-info'); - const gpsDetail = gpsTile.querySelector('.tile-detail'); - - if (gpsInfo && gpsDetail) { - if (hasValidFix) { - gpsInfo.textContent = `${gps.latitude.toFixed(4)}, ${gps.longitude.toFixed(4)}`; - gpsDetail.textContent = `${gps.fix} • ${gps.satellites} sats • Alt: ${Math.round(gps.altitude)}m`; - } else { - gpsInfo.textContent = gps.satellites > 0 ? 'Acquiring Fix...' : 'No Signal'; - gpsDetail.textContent = `${gps.satellites} satellites`; - } - } - } - } - - updateNetworkStatus(network) { - // Update WiFi status - const wifiTile = document.getElementById('wifi-tile'); - if (wifiTile) { - const wifiInfo = wifiTile.querySelector('.tile-info'); - const wifiDetail = wifiTile.querySelector('.tile-detail'); - - if (wifiInfo && wifiDetail) { - if (network.wifi.mode === 'ap') { - wifiInfo.textContent = 'Access Point'; - wifiDetail.textContent = `SSID: ${network.wifi.ssid}`; - } else { - wifiInfo.textContent = 'Client Mode'; - wifiDetail.textContent = `SSID: ${network.wifi.ssid}`; - } - } - } - - // Update Ethernet status - const ethernetStatus = document.getElementById('ethernet-status'); - const ethernetTile = document.getElementById('ethernet-tile'); - - if (ethernetStatus && ethernetTile) { - if (network.ethernet.connected) { - ethernetStatus.classList.remove('disconnected'); - ethernetStatus.classList.add('connected'); - ethernetTile.classList.remove('disconnected'); - ethernetTile.classList.add('connected'); - - const ethernetInfo = ethernetTile.querySelector('.tile-info'); - const ethernetDetail = ethernetTile.querySelector('.tile-detail'); - if (ethernetInfo && ethernetDetail) { - ethernetInfo.textContent = 'Connected'; - ethernetDetail.textContent = 'Link detected'; - } - } else { - ethernetStatus.classList.remove('connected'); - ethernetStatus.classList.add('disconnected'); - ethernetTile.classList.remove('connected'); - ethernetTile.classList.add('disconnected'); - - const ethernetInfo = ethernetTile.querySelector('.tile-info'); - const ethernetDetail = ethernetTile.querySelector('.tile-detail'); - if (ethernetInfo && ethernetDetail) { - ethernetInfo.textContent = 'Disconnected'; - ethernetDetail.textContent = 'No cable detected'; - } - } - } - } - - updateLoRaStatus(lora) { - const loraStatus = document.getElementById('lora-status'); - const loraTile = document.getElementById('lora-tile'); - - if (loraStatus && loraTile) { - if (lora.connected) { - loraStatus.classList.remove('disconnected'); - loraStatus.classList.add('connected'); - loraTile.classList.remove('disconnected'); - loraTile.classList.add('connected'); - - const loraInfo = loraTile.querySelector('.tile-info'); - const loraDetail = loraTile.querySelector('.tile-detail'); - - if (loraInfo && loraDetail) { - loraInfo.textContent = `${lora.onlineNodes}/${lora.totalNodes} Online`; - loraDetail.textContent = `CH: ${lora.channelUtilization.toFixed(1)}% • Air: ${lora.airtimeUtilization.toFixed(1)}%`; - } - } else { - loraStatus.classList.remove('connected'); - loraStatus.classList.add('disconnected'); - loraTile.classList.remove('connected'); - loraTile.classList.add('disconnected'); - - const loraInfo = loraTile.querySelector('.tile-info'); - const loraDetail = loraTile.querySelector('.tile-detail'); - - if (loraInfo && loraDetail) { - loraInfo.textContent = 'Disconnected'; - loraDetail.textContent = 'No device found'; - } - } - } - } - - updateTimeSync(serverTimeString, requestStart, requestEnd) { - if (serverTimeString && requestStart && requestEnd) { - // Calculate network latency (round-trip time / 2) - const networkLatency = (requestEnd - requestStart) / 2; - - // Parse server time and adjust for network latency - const serverTime = new Date(serverTimeString); - const adjustedServerTime = new Date(serverTime.getTime() + networkLatency); - - // Calculate the offset between adjusted server time and client time - const clientTime = new Date(); - this.serverTimeOffset = adjustedServerTime.getTime() - clientTime.getTime(); - this.isTimeServerSynced = true; - - console.log(`Time synchronized with server (latency: ${networkLatency.toFixed(1)}ms, offset: ${this.serverTimeOffset.toFixed(1)}ms)`); - } - - // Update time displays - this.updateCurrentTime(); - } - - updateCurrentTime() { - const now = new Date(); - let displayTime; - - if (this.isTimeServerSynced && this.serverTimeOffset !== null) { - // Use server-synchronized time - displayTime = new Date(now.getTime() + this.serverTimeOffset); - } else { - // Use client time (default) - displayTime = now; - } - - this.updateTimeDisplay('local', displayTime, false); - this.updateTimeDisplay('zulu', displayTime, true); - } - - updateTimeDisplay(type, date, isUtc) { - const timeElement = document.getElementById(`${type}-time`); - const dateElement = document.getElementById(`${type}-date`); - - if (timeElement && dateElement) { - const displayDate = isUtc ? new Date(date.getTime()) : date; - - const timeStr = isUtc ? - displayDate.toUTCString().split(' ')[4] : - displayDate.toLocaleTimeString(); - - const dateStr = isUtc ? - displayDate.toUTCString().split(' ').slice(0, 4).join(' ') : - displayDate.toLocaleDateString('en-US', { - month: 'short', - day: 'numeric', - year: 'numeric' - }); - - timeElement.textContent = timeStr; - dateElement.textContent = dateStr; - - // Color time orange when using client time, white when server-synced - if (this.isTimeServerSynced) { - timeElement.style.color = '#fff'; - dateElement.style.color = '#64748b'; - } else { - timeElement.style.color = '#f59e0b'; - dateElement.style.color = '#f59e0b'; - } - } - } - - showOfflineStatus() { - // Reset to client time and show orange color - this.serverTimeOffset = null; - this.isTimeServerSynced = false; - console.warn('System appears offline - falling back to client time'); - } - - startStatusUpdates() { - // Initial fetch - this.fetchStatus(); - - // Update every 60 seconds - setInterval(() => { - this.fetchStatus(); - }, 60000); - } - - startTimeUpdates() { - // Start immediately with client time - this.updateCurrentTime(); - - // Update time every second - setInterval(() => { - this.updateCurrentTime(); - }, 1000); - } - - initializeEventListeners() { - // Expand/collapse status - const expandToggle = document.getElementById('expand-toggle'); - const expandedStatus = document.getElementById('expanded-status'); - const expandIcon = document.getElementById('expand-icon'); - - if (expandToggle && expandedStatus && expandIcon) { - expandToggle.addEventListener('click', () => { - expandedStatus.classList.toggle('visible'); - expandIcon.classList.toggle('expanded'); - }); - } - - // Search functionality - const searchInput = document.getElementById('search-input'); - const appsGrid = document.getElementById('apps-grid'); - - if (searchInput && appsGrid) { - searchInput.addEventListener('input', (e) => { - const query = e.target.value.toLowerCase(); - const apps = appsGrid.querySelectorAll('.app-item'); - - apps.forEach(app => { - const name = app.getAttribute('data-name')?.toLowerCase() || ''; - app.style.display = name.includes(query) ? 'flex' : 'none'; - }); - }); - } - } -} - -function openKiwixm(event) { - event.stopPropagation(); - event.preventDefault(); - window.location.href = window.location.origin.replace(/:\d+/g, '') + ':1300/admin'; -} - -// Initialize dashboard when DOM is ready -document.addEventListener('DOMContentLoaded', () => { - new Dashboard(); - - document.querySelectorAll('.app-item[href^=":"]').forEach(link => { - const port = link.getAttribute('href').substring(1); // Remove the ':' - const url = new URL(location.origin); - url.port = port; - link.href = url.toString(); - }); -}); + +class Dashboard { + constructor() { + this.statusCache = null; + this.lastFetch = 0; + this.hostname = 'localhost'; + this.serverTimeOffset = null; // Track difference between server and client time + this.isTimeServerSynced = false; // Track if we're using server time + this.init(); + } + + async init() { + await this.fetchHostname(); + this.updateHostname(); + this.startTimeUpdates(); // Start with client time immediately + this.startStatusUpdates(); + this.initializeEventListeners(); + } + + async fetchHostname() { + try { + const response = await fetch('/api/hostname'); + const data = await response.json(); + this.hostname = data.hostname.toLowerCase(); + } catch (error) { + console.warn('Failed to fetch hostname:', error); + } + } + + updateHostname() { + const hostnameElement = document.querySelector('.hostname'); + if (hostnameElement) { + hostnameElement.textContent = this.hostname; + } + } + + async fetchStatus() { + try { + // Record start time for latency calculation + const requestStart = performance.now(); + const response = await fetch('/api/status'); + const requestEnd = performance.now(); + + if (!response.ok) throw new Error('Status fetch failed'); + + const status = await response.json(); + this.statusCache = status; + this.updateUI(status, requestStart, requestEnd); + } catch (error) { + console.error('Failed to fetch status:', error); + this.showOfflineStatus(); + } + } + + updateUI(status, requestStart, requestEnd) { + this.updateSystemMetrics(status.system); + this.updateGPSStatus(status.gps); + this.updateNetworkStatus(status.network); + this.updateLoRaStatus(status.lora); + this.updateTimeSync(status.time, requestStart, requestEnd); + } + + updateSystemMetrics(system) { + // Update temperature + const tempElement = document.getElementById('temp'); + if (tempElement && system.temperature) { + tempElement.textContent = `${system.temperature}°C`; + } + + // Update load average + const loadElement = document.getElementById('load'); + if (loadElement && system.load !== undefined) { + loadElement.textContent = `${system.load.toFixed(1)} Load`; + } + + // Update progress bars + this.updateProgressBar('cpu-usage', system.cpu); + this.updateProgressBar('memory-usage', system.memory); + this.updateProgressBar('disk-usage', system.storage); + } + + updateProgressBar(id, percentage) { + const fillElement = document.getElementById(`${id}-fill`); + const textElement = document.getElementById(`${id}-text`); + + if (fillElement && textElement) { + const value = Math.round(percentage); + fillElement.style.width = `${value}%`; + textElement.textContent = `${value}%`; + + // Update color based on usage + if (value > 80) { + fillElement.style.background = '#ef4444'; // Red + } else if (value > 60) { + fillElement.style.background = '#f59e0b'; // Orange + } else { + fillElement.style.background = '#10b981'; // Green + } + } + } + + updateGPSStatus(gps) { + const gpsStatus = document.getElementById('gps-status'); + const gpsTile = document.getElementById('gps-tile'); + + if (gpsStatus && gpsTile) { + const hasValidFix = gps.fix !== 'No Fix' && gps.latitude !== null; + + // Update status indicator + if (hasValidFix) { + gpsStatus.classList.remove('disconnected'); + gpsStatus.classList.add('connected'); + gpsTile.classList.remove('disconnected'); + gpsTile.classList.add('connected'); + } else { + gpsStatus.classList.remove('connected'); + gpsStatus.classList.add('disconnected'); + gpsTile.classList.remove('connected'); + gpsTile.classList.add('disconnected'); + } + + // Update GPS tile info + const gpsInfo = gpsTile.querySelector('.tile-info'); + const gpsDetail = gpsTile.querySelector('.tile-detail'); + + if (gpsInfo && gpsDetail) { + if (hasValidFix) { + gpsInfo.textContent = `${gps.latitude.toFixed(4)}, ${gps.longitude.toFixed(4)}`; + gpsDetail.textContent = `${gps.fix} • ${gps.satellites} sats • Alt: ${Math.round(gps.altitude)}m`; + } else { + gpsInfo.textContent = gps.satellites > 0 ? 'Acquiring Fix...' : 'No Signal'; + gpsDetail.textContent = `${gps.satellites} satellites`; + } + } + } + } + + updateNetworkStatus(network) { + // Update WiFi status + const wifiTile = document.getElementById('wifi-tile'); + if (wifiTile) { + const wifiInfo = wifiTile.querySelector('.tile-info'); + const wifiDetail = wifiTile.querySelector('.tile-detail'); + + if (wifiInfo && wifiDetail) { + if (network.wifi.mode === 'ap') { + wifiInfo.textContent = 'Access Point'; + wifiDetail.textContent = `SSID: ${network.wifi.ssid}`; + } else { + wifiInfo.textContent = 'Client Mode'; + wifiDetail.textContent = `SSID: ${network.wifi.ssid}`; + } + } + } + + // Update Ethernet status + const ethernetStatus = document.getElementById('ethernet-status'); + const ethernetTile = document.getElementById('ethernet-tile'); + + if (ethernetStatus && ethernetTile) { + if (network.ethernet.connected) { + ethernetStatus.classList.remove('disconnected'); + ethernetStatus.classList.add('connected'); + ethernetTile.classList.remove('disconnected'); + ethernetTile.classList.add('connected'); + + const ethernetInfo = ethernetTile.querySelector('.tile-info'); + const ethernetDetail = ethernetTile.querySelector('.tile-detail'); + if (ethernetInfo && ethernetDetail) { + ethernetInfo.textContent = 'Connected'; + ethernetDetail.textContent = 'Link detected'; + } + } else { + ethernetStatus.classList.remove('connected'); + ethernetStatus.classList.add('disconnected'); + ethernetTile.classList.remove('connected'); + ethernetTile.classList.add('disconnected'); + + const ethernetInfo = ethernetTile.querySelector('.tile-info'); + const ethernetDetail = ethernetTile.querySelector('.tile-detail'); + if (ethernetInfo && ethernetDetail) { + ethernetInfo.textContent = 'Disconnected'; + ethernetDetail.textContent = 'No cable detected'; + } + } + } + } + + updateLoRaStatus(lora) { + const loraStatus = document.getElementById('lora-status'); + const loraTile = document.getElementById('lora-tile'); + + if (loraStatus && loraTile) { + if (lora.connected) { + loraStatus.classList.remove('disconnected'); + loraStatus.classList.add('connected'); + loraTile.classList.remove('disconnected'); + loraTile.classList.add('connected'); + + const loraInfo = loraTile.querySelector('.tile-info'); + const loraDetail = loraTile.querySelector('.tile-detail'); + + if (loraInfo && loraDetail) { + loraInfo.textContent = `${lora.onlineNodes}/${lora.totalNodes} Online`; + loraDetail.textContent = `CH: ${lora.channelUtilization.toFixed(1)}% • Air: ${lora.airtimeUtilization.toFixed(1)}%`; + } + } else { + loraStatus.classList.remove('connected'); + loraStatus.classList.add('disconnected'); + loraTile.classList.remove('connected'); + loraTile.classList.add('disconnected'); + + const loraInfo = loraTile.querySelector('.tile-info'); + const loraDetail = loraTile.querySelector('.tile-detail'); + + if (loraInfo && loraDetail) { + loraInfo.textContent = 'Disconnected'; + loraDetail.textContent = 'No device found'; + } + } + } + } + + updateTimeSync(serverTimeString, requestStart, requestEnd) { + if (serverTimeString && requestStart && requestEnd) { + // Calculate network latency (round-trip time / 2) + const networkLatency = (requestEnd - requestStart) / 2; + + // Parse server time and adjust for network latency + const serverTime = new Date(serverTimeString); + const adjustedServerTime = new Date(serverTime.getTime() + networkLatency); + + // Calculate the offset between adjusted server time and client time + const clientTime = new Date(); + this.serverTimeOffset = adjustedServerTime.getTime() - clientTime.getTime(); + this.isTimeServerSynced = true; + + console.log(`Time synchronized with server (latency: ${networkLatency.toFixed(1)}ms, offset: ${this.serverTimeOffset.toFixed(1)}ms)`); + } + + // Update time displays + this.updateCurrentTime(); + } + + updateCurrentTime() { + const now = new Date(); + let displayTime; + + if (this.isTimeServerSynced && this.serverTimeOffset !== null) { + // Use server-synchronized time + displayTime = new Date(now.getTime() + this.serverTimeOffset); + } else { + // Use client time (default) + displayTime = now; + } + + this.updateTimeDisplay('local', displayTime, false); + this.updateTimeDisplay('zulu', displayTime, true); + } + + updateTimeDisplay(type, date, isUtc) { + const timeElement = document.getElementById(`${type}-time`); + const dateElement = document.getElementById(`${type}-date`); + + if (timeElement && dateElement) { + const displayDate = isUtc ? new Date(date.getTime()) : date; + + const timeStr = isUtc ? + displayDate.toUTCString().split(' ')[4] : + displayDate.toLocaleTimeString(); + + const dateStr = isUtc ? + displayDate.toUTCString().split(' ').slice(0, 4).join(' ') : + displayDate.toLocaleDateString('en-US', { + month: 'short', + day: 'numeric', + year: 'numeric' + }); + + timeElement.textContent = timeStr; + dateElement.textContent = dateStr; + + // Color time orange when using client time, white when server-synced + if (this.isTimeServerSynced) { + timeElement.style.color = '#fff'; + dateElement.style.color = '#64748b'; + } else { + timeElement.style.color = '#f59e0b'; + dateElement.style.color = '#f59e0b'; + } + } + } + + showOfflineStatus() { + // Reset to client time and show orange color + this.serverTimeOffset = null; + this.isTimeServerSynced = false; + console.warn('System appears offline - falling back to client time'); + } + + startStatusUpdates() { + // Initial fetch + this.fetchStatus(); + + // Update every 60 seconds + setInterval(() => { + this.fetchStatus(); + }, 60000); + } + + startTimeUpdates() { + // Start immediately with client time + this.updateCurrentTime(); + + // Update time every second + setInterval(() => { + this.updateCurrentTime(); + }, 1000); + } + + initializeEventListeners() { + // Expand/collapse status + const expandToggle = document.getElementById('expand-toggle'); + const expandedStatus = document.getElementById('expanded-status'); + const expandIcon = document.getElementById('expand-icon'); + + if (expandToggle && expandedStatus && expandIcon) { + expandToggle.addEventListener('click', () => { + expandedStatus.classList.toggle('visible'); + expandIcon.classList.toggle('expanded'); + }); + } + + // Search functionality + const searchInput = document.getElementById('search-input'); + const appsGrid = document.getElementById('apps-grid'); + + if (searchInput && appsGrid) { + searchInput.addEventListener('input', (e) => { + const query = e.target.value.toLowerCase(); + const apps = appsGrid.querySelectorAll('.app-item'); + + apps.forEach(app => { + const name = app.getAttribute('data-name')?.toLowerCase() || ''; + app.style.display = name.includes(query) ? 'flex' : 'none'; + }); + }); + } + } +} + +function saveCodeBook() { + event.stopPropagation(); + event.preventDefault(); + window.location.href = '/code-book-print.html'; +} + +function openKiwixm(event) { + event.stopPropagation(); + event.preventDefault(); + window.location.href = window.location.origin.replace(/:\d+/g, '') + ':1400/admin'; +} + +// Initialize dashboard when DOM is ready +document.addEventListener('DOMContentLoaded', () => { + new Dashboard(); + + document.querySelectorAll('.app-item[href^=":"]').forEach(link => { + const port = link.getAttribute('href').substring(1); // Remove the ':' + const url = new URL(location.origin); + url.port = port; + link.href = url.toString(); + }); +}); diff --git a/public/manifest.json b/client/public/manifest.json old mode 100755 new mode 100644 similarity index 94% rename from public/manifest.json rename to client/public/manifest.json index 7b9f337..18263a2 --- a/public/manifest.json +++ b/client/public/manifest.json @@ -1,19 +1,19 @@ -{ - "name": "MRS", - "short_name": "MRS", - "description": "Multipurpose Radio Server", - "start_url": "/", - "display": "standalone", - "background_color": "#000000", - "theme_color": "#000000", - "orientation": "portrait-primary", - "icons": [ - { - "src": "/favicon.png", - "sizes": "512x512", - "type": "image/png" - } - ], - "lang": "en-US", - "scope": "/" -} +{ + "name": "MRS", + "short_name": "MRS", + "description": "Multipurpose Radio Server", + "start_url": "/", + "display": "standalone", + "background_color": "#000000", + "theme_color": "#000000", + "orientation": "portrait-primary", + "icons": [ + { + "src": "/favicon.png", + "sizes": "512x512", + "type": "image/png" + } + ], + "lang": "en-US", + "scope": "/" +} diff --git a/code/src/config.json b/client/src/config.json similarity index 100% rename from code/src/config.json rename to client/src/config.json diff --git a/code/src/main.mjs b/client/src/main.mjs old mode 100755 new mode 100644 similarity index 96% rename from code/src/main.mjs rename to client/src/main.mjs index ebecdb9..6877a30 --- a/code/src/main.mjs +++ b/client/src/main.mjs @@ -1,51 +1,51 @@ - -import express from "express"; -import { join } from 'path'; -import {environment} from './services/environment.mjs'; -import { statusRouter } from './services/status.mjs'; - -(async () => { - const app = express(); - - // Middleware - app.use(express.json()); - app.use((err, req, res, next) => { - console.error('Middleware error:', err); - res.status(500).json({ error: 'Internal server error' }); - }); - - // Routes - console.log(join(environment.root, '../public')); - app.use(express.static(join(environment.root, '../public'))); - - app.use('/api', statusRouter); - - // Error handler - app.use((err, req, res, next) => { - console.error('Unhandled error:', err); - res.status(500).json({ error: 'Internal server error' }); - }); - - // Startup - const server = app.listen(environment.port, () => { - console.log(`Dashboard running on http://localhost:${environment.port}`); - }).on('error', (err) => { - console.error('Server startup error:', err); - process.exit(1); - }); - - // Shutdown - const gracefulShutdown = (signal) => { - console.log(`Received ${signal}, shutting down gracefully`); - server.close((err) => { - if (err) { - console.error('Error during server shutdown:', err); - process.exit(1); - } - console.log('Server closed'); - process.exit(0); - }); - }; - process.on('SIGTERM', () => gracefulShutdown('SIGTERM')); - process.on('SIGINT', () => gracefulShutdown('SIGINT')); -})(); + +import express from "express"; +import { join } from 'path'; +import {environment} from './services/environment.mjs'; +import { statusRouter } from './services/status.mjs'; + +(async () => { + const app = express(); + + // Middleware + app.use(express.json()); + app.use((err, req, res, next) => { + console.error('Middleware error:', err); + res.status(500).json({ error: 'Internal server error' }); + }); + + // Routes + console.log(join(environment.root, '../public')); + app.use(express.static(join(environment.root, '../public'))); + + app.use('/api', statusRouter); + + // Error handler + app.use((err, req, res, next) => { + console.error('Unhandled error:', err); + res.status(500).json({ error: 'Internal server error' }); + }); + + // Startup + const server = app.listen(environment.port, () => { + console.log(`Dashboard running on http://localhost:${environment.port}`); + }).on('error', (err) => { + console.error('Server startup error:', err); + process.exit(1); + }); + + // Shutdown + const gracefulShutdown = (signal) => { + console.log(`Received ${signal}, shutting down gracefully`); + server.close((err) => { + if (err) { + console.error('Error during server shutdown:', err); + process.exit(1); + } + console.log('Server closed'); + process.exit(0); + }); + }; + process.on('SIGTERM', () => gracefulShutdown('SIGTERM')); + process.on('SIGINT', () => gracefulShutdown('SIGINT')); +})(); diff --git a/code/src/services/environment.mjs b/client/src/services/environment.mjs old mode 100755 new mode 100644 similarity index 96% rename from code/src/services/environment.mjs rename to client/src/services/environment.mjs index ca0ef1d..5a39e1c --- a/code/src/services/environment.mjs +++ b/client/src/services/environment.mjs @@ -1,38 +1,38 @@ -import dotenv from 'dotenv'; -import * as fs from 'node:fs'; -import { fileURLToPath } from 'url'; -import { dirname } from 'path'; -import { execSync } from "child_process"; - -dotenv.config(); - -export const environment = { - config: process.env.CONFIG || 'config.json', - hostname: process.env.HOSTNAME || execSync('hostname', { encoding: "utf-8" }) || 'localhost', - gpsd: process.env.GPSD || 2947, - port: process.env.PORT || 80, - root: dirname(dirname(fileURLToPath(import.meta.url))), - settings: {}, -} - -if(!environment.config.startsWith('/')) environment.config = `${environment.root}/${environment.config}`; - -export function loadSettings() { - if(!fs.existsSync(environment.config)) fs.writeFileSync(environment.config, '', { flag: 'a' }); - const value = fs.readFileSync(environment.config, 'utf-8'); - try { return JSON.parse(value); } - catch (e) { - return { - lora: { - mode: 'MESH', - telemetry: true, - } - }; - } -} - -export function saveSettings() { - fs.writeFileSync(environment.config, JSON.stringify(environment.settings, null, 4)); -} - -loadSettings(); +import dotenv from 'dotenv'; +import * as fs from 'node:fs'; +import { fileURLToPath } from 'url'; +import { dirname } from 'path'; +import { execSync } from "child_process"; + +dotenv.config(); + +export const environment = { + config: process.env.CONFIG || 'config.json', + hostname: process.env.HOSTNAME || execSync('hostname', { encoding: "utf-8" }) || 'localhost', + gpsd: process.env.GPSD || 2947, + port: process.env.PORT || 80, + root: dirname(dirname(fileURLToPath(import.meta.url))), + settings: {}, +} + +if(!environment.config.startsWith('/')) environment.config = `${environment.root}/${environment.config}`; + +export function loadSettings() { + if(!fs.existsSync(environment.config)) fs.writeFileSync(environment.config, '', { flag: 'a' }); + const value = fs.readFileSync(environment.config, 'utf-8'); + try { return JSON.parse(value); } + catch (e) { + return { + lora: { + mode: 'MESH', + telemetry: true, + } + }; + } +} + +export function saveSettings() { + fs.writeFileSync(environment.config, JSON.stringify(environment.settings, null, 4)); +} + +loadSettings(); diff --git a/src/services/status.mjs b/client/src/services/status.mjs old mode 100755 new mode 100644 similarity index 96% rename from src/services/status.mjs rename to client/src/services/status.mjs index 7d6f7ee..2fbb8c9 --- a/src/services/status.mjs +++ b/client/src/services/status.mjs @@ -1,426 +1,426 @@ - -import express from 'express'; -import { exec } from 'child_process'; -import { promisify } from 'util'; -import { readFileSync, existsSync } from 'fs'; -import pkg from 'node-gpsd'; -const { GPS } = pkg; -import {environment} from './environment.mjs'; - -const router = express.Router(); -const execAsync = promisify(exec); - -// Status cache with TTL -let statusCache = null; -let lastUpdate = 0; -const CACHE_TTL = 15 * 1000; // 15 seconds - -// GPS client setup -let gpsClient = null; -let gpsData = { - fix: 'No Fix', - latitude: null, - longitude: null, - altitude: null, - satellites: 0 -}; - -// Initialize GPS connection -async function initGPS() { - try { - gpsClient = new GPS({ hostname: 'localhost', port: 2947 }); - - gpsClient.on('TPV', (data) => { - gpsData.latitude = data.lat || null; - gpsData.longitude = data.lon || null; - gpsData.altitude = data.alt || null; - gpsData.fix = data.mode === 3 ? '3D Fix' : data.mode === 2 ? '2D Fix' : 'No Fix'; - }); - - gpsClient.on('SKY', (data) => { - gpsData.satellites = (data.satellites || []).length; - }); - - gpsClient.on('error', (err) => { - console.warn('GPS error:', err.message); - }); - - await gpsClient.watch(); - console.log('GPS client initialized'); - } catch (error) { - console.warn('GPS not available:', error.message); - } -} - -// CLI-based system information gathering -async function getSystemInfo() { - const info = { - temperature: 0, - load: 0, - cpu: 0, - memory: 0, - storage: 0 - }; - - try { - // CPU temperature (Raspberry Pi specific) - if (existsSync('/sys/class/thermal/thermal_zone0/temp')) { - const tempData = readFileSync('/sys/class/thermal/thermal_zone0/temp', 'utf8'); - info.temperature = Math.round(parseInt(tempData.trim()) / 1000); - } - - // Load average - const { stdout: loadAvg } = await execAsync("cat /proc/loadavg | awk '{print $1}'"); - info.load = parseFloat(loadAvg.trim()) || 0; - - // CPU usage - const { stdout: cpuUsage } = await execAsync("grep 'cpu ' /proc/stat | awk '{usage=($2+$4)*100/($2+$3+$4+$5)} END {print usage}'"); - info.cpu = parseFloat(cpuUsage.trim()) || 0; - - // Memory usage percentage - const { stdout: memUsage } = await execAsync("free | awk 'NR==2{printf \"%.1f\", $3*100/$2}'"); - info.memory = parseFloat(memUsage.trim()) || 0; - - // Disk usage percentage for root filesystem - const { stdout: diskUsage } = await execAsync("df / | awk 'NR==2{printf \"%.1f\", $5}' | sed 's/%//'"); - info.storage = parseFloat(diskUsage.trim()) || 0; - - } catch (error) { - console.warn('System info error:', error.message); - } - - return info; -} - -async function getGPSInfo() { - const gpsInfo = { - satellites: 0, - latitude: null, - longitude: null, - altitude: null - }; - - try { - // Check if gpsd is running - await execAsync('systemctl is-active gpsd'); - - // Try to get GPS data using gpspipe - const { stdout: gpsRaw } = await execAsync('timeout 3s gpspipe -w -n 5 | grep -E \'"class":"TPV"\' | head -1', { timeout: 4000 }); - - if (gpsRaw.trim()) { - const gpsJson = JSON.parse(gpsRaw.trim()); - gpsInfo.latitude = gpsJson.lat || null; - gpsInfo.longitude = gpsJson.lon || null; - gpsInfo.altitude = gpsJson.alt || null; - } - - // Get satellite count - try { - const { stdout: skyRaw } = await execAsync('timeout 2s gpspipe -w -n 3 | grep -E \'"class":"SKY"\' | head -1', { timeout: 3000 }); - if (skyRaw.trim()) { - const skyJson = JSON.parse(skyRaw.trim()); - gpsInfo.satellites = (skyJson.satellites || []).length; - } - } catch (skyError) { } - } catch (error) { - console.warn('GPS info error:', error.message); - // Use cached GPS data from node-gpsd if available - if (gpsData.latitude !== null) { - return gpsData; - } - } - - return gpsInfo; -} - -async function getNetworkInfo() { - const networkInfo = { - wifi: { - mode: 'client', - ssid: 'Unknown' - }, - ethernet: { - connected: false - } - }; - - try { - // Check if hostapd is running (AP mode) - try { - await execAsync('systemctl is-active hostapd'); - networkInfo.wifi.mode = 'ap'; - - // Get AP SSID from hostapd config or use hostname - try { - const { stdout: hostname } = await execAsync('hostname'); - networkInfo.wifi.ssid = process.env.AP_SSID || hostname.trim(); - } catch { - networkInfo.wifi.ssid = 'MRS-AP'; - } - } catch { - // Not in AP mode, check if connected to WiFi - try { - // First, try iwconfig directly since it's more reliable for ESSID - const { stdout: iwconfig } = await execAsync("iwconfig wlan0 2>/dev/null"); - const essidMatch = iwconfig.match(/ESSID:"([^"]+)"/); - - if (essidMatch && essidMatch[1] && essidMatch[1] !== 'off/any') { - networkInfo.wifi.mode = 'client'; - networkInfo.wifi.ssid = essidMatch[1]; - } else { - // Fallback to nmcli if iwconfig doesn't work - try { - const { stdout: activeWifi } = await execAsync("nmcli -t -f NAME,TYPE,DEVICE connection show --active | grep -E '(wifi|802-11-wireless)' | cut -d':' -f1 | head -1"); - if (activeWifi.trim()) { - networkInfo.wifi.mode = 'client'; - networkInfo.wifi.ssid = activeWifi.trim(); - } else { - // Try getting SSID from currently connected interface - const { stdout: connectedSSID } = await execAsync("nmcli -t -f active,ssid dev wifi | grep '^yes' | cut -d':' -f2 | head -1"); - if (connectedSSID.trim()) { - networkInfo.wifi.mode = 'client'; - networkInfo.wifi.ssid = connectedSSID.trim(); - } else { - throw new Error('No active WiFi connection found'); - } - } - } catch { - // Final fallback: check if wlan0 interface is up and get info via ip - const { stdout: wlanStatus } = await execAsync("ip addr show wlan0 2>/dev/null | grep 'inet ' | wc -l"); - if (parseInt(wlanStatus.trim()) > 0) { - // Interface has IP but we can't determine SSID - networkInfo.wifi.mode = 'client'; - networkInfo.wifi.ssid = 'Connected (Unknown SSID)'; - } else { - networkInfo.wifi.mode = 'disconnected'; - networkInfo.wifi.ssid = 'Not Connected'; - } - } - } - } catch (error) { - console.warn('WiFi detection error:', error.message); - networkInfo.wifi.mode = 'disconnected'; - networkInfo.wifi.ssid = 'Not Connected'; - } - } - - // Check Ethernet status - try { - const { stdout: ethStatus } = await execAsync("ip link show eth0 | grep 'state UP'"); - networkInfo.ethernet.connected = ethStatus.includes('state UP'); - } catch { - networkInfo.ethernet.connected = false; - } - - } catch (error) { - console.warn('Network info error:', error.message); - } - - return networkInfo; -} - -let loraInfo = null; -async function getLoRaInfo() { - if(loraInfo) return loraInfo; - - loraInfo = { - connected: false, - onlineNodes: 0, - totalNodes: 0, - channelUtilization: 0, - airtimeUtilization: 0 - }; - - try { - console.log('Getting LoRa/Meshtastic status...'); - - // Get node information first - const { stdout: nodeList } = await execAsync('timeout 10s meshtastic --nodes 2>/dev/null', { timeout: 15000 }); - - if (nodeList && nodeList.trim()) { - loraInfo.connected = true; - - // Parse node list - look for actual node entries - const lines = nodeList.split('\n'); - let totalNodes = 0; - let onlineNodes = 0; - - for (const line of lines) { - const trimmedLine = line.trim(); - - // Skip header lines and separators - if (trimmedLine.includes('│') && - !trimmedLine.includes('User') && - !trimmedLine.includes('───') && - !trimmedLine.includes('Node') && - trimmedLine.length > 10) { - - totalNodes++; - - // Check if node is online (has recent lastHeard or SNR data) - if (trimmedLine.includes('SNR') || - trimmedLine.match(/\d+[smh]/) || // Time indicators like 5m, 2h, 30s - trimmedLine.includes('now')) { - onlineNodes++; - } - } - } - - loraInfo.totalNodes = totalNodes; - loraInfo.onlineNodes = onlineNodes; - } - - // Get channel and airtime utilization from --info - try { - const { stdout: meshInfo } = await execAsync('timeout 10s meshtastic --info 2>/dev/null', { timeout: 15000 }); - - if (meshInfo && meshInfo.trim()) { - const lines = meshInfo.split('\n'); - - for (const line of lines) { - const trimmedLine = line.trim(); - - // Look for channel utilization (various formats) - if (trimmedLine.includes('channelUtilization') || trimmedLine.includes('Channel utilization')) { - const channelMatch = trimmedLine.match(/([\d.]+)%?/) || trimmedLine.match(/:\s*([\d.]+)/); - if (channelMatch) { - loraInfo.channelUtilization = parseFloat(channelMatch[1]); - } - } - - // Look for airtime utilization (various formats) - if (trimmedLine.includes('airUtilTx') || trimmedLine.includes('Air time') || trimmedLine.includes('Airtime')) { - const airtimeMatch = trimmedLine.match(/([\d.]+)%?/) || trimmedLine.match(/:\s*([\d.]+)/); - if (airtimeMatch) { - loraInfo.airtimeUtilization = parseFloat(airtimeMatch[1]); - } - } - } - } - } catch (infoError) { - console.warn('Failed to get mesh info:', infoError.message); - } - - } catch (error) { - console.warn('LoRa info error:', error.message); - loraInfo.connected = false; - } - - setTimeout(() => loraInfo = null, 60000) - return loraInfo; -} - -// Main status generation function - matches frontend expectations -async function generateStatus() { - try { - console.log('Generating fresh status...'); - - const [systemInfo, gpsInfo, networkInfo, loraInfo] = await Promise.all([ - getSystemInfo(), - getGPSInfo(), - getNetworkInfo(), - getLoRaInfo() - ]); - - // Format exactly as the frontend expects - const status = { - system: { - temperature: systemInfo.temperature, - load: systemInfo.load, - cpu: systemInfo.cpu, - memory: systemInfo.memory, - storage: systemInfo.storage - }, - gps: { - fix: gpsInfo.fix, - satellites: gpsInfo.satellites, - latitude: gpsInfo.latitude, - longitude: gpsInfo.longitude, - altitude: gpsInfo.altitude - }, - network: { - wifi: networkInfo.wifi, - ethernet: networkInfo.ethernet - }, - lora: loraInfo, - time: new Date().toISOString() - }; - - return status; - } catch (error) { - console.error('Status generation error:', error); - throw error; - } -} - -router.get('/hostname', (req, res) => res.json({ hostname: environment.hostname })); - -// Main status endpoint that matches frontend expectations -router.get('/status', async (req, res) => { - try { - const now = Date.now(); - - // Return cached status if within TTL - if (statusCache && (now - lastUpdate) < CACHE_TTL) { - console.log('Returning cached status'); - return res.json(statusCache); - } - - // Generate fresh status - statusCache = await generateStatus(); - lastUpdate = now; - - console.log('Status updated successfully'); - res.json(statusCache); - } catch (error) { - console.error('Status API error:', error); - res.status(500).json({ - error: 'Failed to get system status', - message: error.message, - timestamp: new Date().toISOString() - }); - } -}); - -// Individual debug endpoints -router.get('/system', async (req, res) => { - try { - const systemInfo = await getSystemInfo(); - res.json(systemInfo); - } catch (error) { - res.status(500).json({ error: error.message }); - } -}); - -router.get('/gps', async (req, res) => { - try { - const gpsInfo = await getGPSInfo(); - res.json(gpsInfo); - } catch (error) { - res.status(500).json({ error: error.message }); - } -}); - -router.get('/network', async (req, res) => { - try { - const networkInfo = await getNetworkInfo(); - res.json(networkInfo); - } catch (error) { - res.status(500).json({ error: error.message }); - } -}); - -// Add individual LoRa endpoint -router.get('/lora', async (req, res) => { - try { - const loraInfo = await getLoRaInfo(); - res.json(loraInfo); - } catch (error) { - res.status(500).json({ error: error.message }); - } -}); - -// Initialize GPS on startup -initGPS().catch(err => console.warn('GPS initialization failed:', err.message)); - -export { router as statusRouter }; + +import express from 'express'; +import { exec } from 'child_process'; +import { promisify } from 'util'; +import { readFileSync, existsSync } from 'fs'; +import pkg from 'node-gpsd'; +const { GPS } = pkg; +import {environment} from './environment.mjs'; + +const router = express.Router(); +const execAsync = promisify(exec); + +// Status cache with TTL +let statusCache = null; +let lastUpdate = 0; +const CACHE_TTL = 15 * 1000; // 15 seconds + +// GPS client setup +let gpsClient = null; +let gpsData = { + fix: 'No Fix', + latitude: null, + longitude: null, + altitude: null, + satellites: 0 +}; + +// Initialize GPS connection +async function initGPS() { + try { + gpsClient = new GPS({ hostname: 'localhost', port: 2947 }); + + gpsClient.on('TPV', (data) => { + gpsData.latitude = data.lat || null; + gpsData.longitude = data.lon || null; + gpsData.altitude = data.alt || null; + gpsData.fix = data.mode === 3 ? '3D Fix' : data.mode === 2 ? '2D Fix' : 'No Fix'; + }); + + gpsClient.on('SKY', (data) => { + gpsData.satellites = (data.satellites || []).length; + }); + + gpsClient.on('error', (err) => { + console.warn('GPS error:', err.message); + }); + + await gpsClient.watch(); + console.log('GPS client initialized'); + } catch (error) { + console.warn('GPS not available:', error.message); + } +} + +// CLI-based system information gathering +async function getSystemInfo() { + const info = { + temperature: 0, + load: 0, + cpu: 0, + memory: 0, + storage: 0 + }; + + try { + // CPU temperature (Raspberry Pi specific) + if (existsSync('/sys/class/thermal/thermal_zone0/temp')) { + const tempData = readFileSync('/sys/class/thermal/thermal_zone0/temp', 'utf8'); + info.temperature = Math.round(parseInt(tempData.trim()) / 1000); + } + + // Load average + const { stdout: loadAvg } = await execAsync("cat /proc/loadavg | awk '{print $1}'"); + info.load = parseFloat(loadAvg.trim()) || 0; + + // CPU usage + const { stdout: cpuUsage } = await execAsync("grep 'cpu ' /proc/stat | awk '{usage=($2+$4)*100/($2+$3+$4+$5)} END {print usage}'"); + info.cpu = parseFloat(cpuUsage.trim()) || 0; + + // Memory usage percentage + const { stdout: memUsage } = await execAsync("free | awk 'NR==2{printf \"%.1f\", $3*100/$2}'"); + info.memory = parseFloat(memUsage.trim()) || 0; + + // Disk usage percentage for root filesystem + const { stdout: diskUsage } = await execAsync("df / | awk 'NR==2{printf \"%.1f\", $5}' | sed 's/%//'"); + info.storage = parseFloat(diskUsage.trim()) || 0; + + } catch (error) { + console.warn('System info error:', error.message); + } + + return info; +} + +async function getGPSInfo() { + const gpsInfo = { + satellites: 0, + latitude: null, + longitude: null, + altitude: null + }; + + try { + // Check if gpsd is running + await execAsync('systemctl is-active gpsd'); + + // Try to get GPS data using gpspipe + const { stdout: gpsRaw } = await execAsync('timeout 3s gpspipe -w -n 5 | grep -E \'"class":"TPV"\' | head -1', { timeout: 4000 }); + + if (gpsRaw.trim()) { + const gpsJson = JSON.parse(gpsRaw.trim()); + gpsInfo.latitude = gpsJson.lat || null; + gpsInfo.longitude = gpsJson.lon || null; + gpsInfo.altitude = gpsJson.alt || null; + } + + // Get satellite count + try { + const { stdout: skyRaw } = await execAsync('timeout 2s gpspipe -w -n 3 | grep -E \'"class":"SKY"\' | head -1', { timeout: 3000 }); + if (skyRaw.trim()) { + const skyJson = JSON.parse(skyRaw.trim()); + gpsInfo.satellites = (skyJson.satellites || []).length; + } + } catch (skyError) { } + } catch (error) { + console.warn('GPS info error:', error.message); + // Use cached GPS data from node-gpsd if available + if (gpsData.latitude !== null) { + return gpsData; + } + } + + return gpsInfo; +} + +async function getNetworkInfo() { + const networkInfo = { + wifi: { + mode: 'client', + ssid: 'Unknown' + }, + ethernet: { + connected: false + } + }; + + try { + // Check if hostapd is running (AP mode) + try { + await execAsync('systemctl is-active hostapd'); + networkInfo.wifi.mode = 'ap'; + + // Get AP SSID from hostapd config or use hostname + try { + const { stdout: hostname } = await execAsync('hostname'); + networkInfo.wifi.ssid = process.env.AP_SSID || hostname.trim(); + } catch { + networkInfo.wifi.ssid = 'MRS-AP'; + } + } catch { + // Not in AP mode, check if connected to WiFi + try { + // First, try iwconfig directly since it's more reliable for ESSID + const { stdout: iwconfig } = await execAsync("iwconfig wlan0 2>/dev/null"); + const essidMatch = iwconfig.match(/ESSID:"([^"]+)"/); + + if (essidMatch && essidMatch[1] && essidMatch[1] !== 'off/any') { + networkInfo.wifi.mode = 'client'; + networkInfo.wifi.ssid = essidMatch[1]; + } else { + // Fallback to nmcli if iwconfig doesn't work + try { + const { stdout: activeWifi } = await execAsync("nmcli -t -f NAME,TYPE,DEVICE connection show --active | grep -E '(wifi|802-11-wireless)' | cut -d':' -f1 | head -1"); + if (activeWifi.trim()) { + networkInfo.wifi.mode = 'client'; + networkInfo.wifi.ssid = activeWifi.trim(); + } else { + // Try getting SSID from currently connected interface + const { stdout: connectedSSID } = await execAsync("nmcli -t -f active,ssid dev wifi | grep '^yes' | cut -d':' -f2 | head -1"); + if (connectedSSID.trim()) { + networkInfo.wifi.mode = 'client'; + networkInfo.wifi.ssid = connectedSSID.trim(); + } else { + throw new Error('No active WiFi connection found'); + } + } + } catch { + // Final fallback: check if wlan0 interface is up and get info via ip + const { stdout: wlanStatus } = await execAsync("ip addr show wlan0 2>/dev/null | grep 'inet ' | wc -l"); + if (parseInt(wlanStatus.trim()) > 0) { + // Interface has IP but we can't determine SSID + networkInfo.wifi.mode = 'client'; + networkInfo.wifi.ssid = 'Connected (Unknown SSID)'; + } else { + networkInfo.wifi.mode = 'disconnected'; + networkInfo.wifi.ssid = 'Not Connected'; + } + } + } + } catch (error) { + console.warn('WiFi detection error:', error.message); + networkInfo.wifi.mode = 'disconnected'; + networkInfo.wifi.ssid = 'Not Connected'; + } + } + + // Check Ethernet status + try { + const { stdout: ethStatus } = await execAsync("ip link show eth0 | grep 'state UP'"); + networkInfo.ethernet.connected = ethStatus.includes('state UP'); + } catch { + networkInfo.ethernet.connected = false; + } + + } catch (error) { + console.warn('Network info error:', error.message); + } + + return networkInfo; +} + +let loraInfo = null; +async function getLoRaInfo() { + if(loraInfo) return loraInfo; + + loraInfo = { + connected: false, + onlineNodes: 0, + totalNodes: 0, + channelUtilization: 0, + airtimeUtilization: 0 + }; + + try { + console.log('Getting LoRa/Meshtastic status...'); + + // Get node information first + const { stdout: nodeList } = await execAsync('timeout 10s meshtastic --nodes 2>/dev/null', { timeout: 15000 }); + + if (nodeList && nodeList.trim()) { + loraInfo.connected = true; + + // Parse node list - look for actual node entries + const lines = nodeList.split('\n'); + let totalNodes = 0; + let onlineNodes = 0; + + for (const line of lines) { + const trimmedLine = line.trim(); + + // Skip header lines and separators + if (trimmedLine.includes('│') && + !trimmedLine.includes('User') && + !trimmedLine.includes('───') && + !trimmedLine.includes('Node') && + trimmedLine.length > 10) { + + totalNodes++; + + // Check if node is online (has recent lastHeard or SNR data) + if (trimmedLine.includes('SNR') || + trimmedLine.match(/\d+[smh]/) || // Time indicators like 5m, 2h, 30s + trimmedLine.includes('now')) { + onlineNodes++; + } + } + } + + loraInfo.totalNodes = totalNodes; + loraInfo.onlineNodes = onlineNodes; + } + + // Get channel and airtime utilization from --info + try { + const { stdout: meshInfo } = await execAsync('timeout 10s meshtastic --info 2>/dev/null', { timeout: 15000 }); + + if (meshInfo && meshInfo.trim()) { + const lines = meshInfo.split('\n'); + + for (const line of lines) { + const trimmedLine = line.trim(); + + // Look for channel utilization (various formats) + if (trimmedLine.includes('channelUtilization') || trimmedLine.includes('Channel utilization')) { + const channelMatch = trimmedLine.match(/([\d.]+)%?/) || trimmedLine.match(/:\s*([\d.]+)/); + if (channelMatch) { + loraInfo.channelUtilization = parseFloat(channelMatch[1]); + } + } + + // Look for airtime utilization (various formats) + if (trimmedLine.includes('airUtilTx') || trimmedLine.includes('Air time') || trimmedLine.includes('Airtime')) { + const airtimeMatch = trimmedLine.match(/([\d.]+)%?/) || trimmedLine.match(/:\s*([\d.]+)/); + if (airtimeMatch) { + loraInfo.airtimeUtilization = parseFloat(airtimeMatch[1]); + } + } + } + } + } catch (infoError) { + console.warn('Failed to get mesh info:', infoError.message); + } + + } catch (error) { + console.warn('LoRa info error:', error.message); + loraInfo.connected = false; + } + + setTimeout(() => loraInfo = null, 60000) + return loraInfo; +} + +// Main status generation function - matches frontend expectations +async function generateStatus() { + try { + console.log('Generating fresh status...'); + + const [systemInfo, gpsInfo, networkInfo, loraInfo] = await Promise.all([ + getSystemInfo(), + getGPSInfo(), + getNetworkInfo(), + getLoRaInfo() + ]); + + // Format exactly as the frontend expects + const status = { + system: { + temperature: systemInfo.temperature, + load: systemInfo.load, + cpu: systemInfo.cpu, + memory: systemInfo.memory, + storage: systemInfo.storage + }, + gps: { + fix: gpsInfo.fix, + satellites: gpsInfo.satellites, + latitude: gpsInfo.latitude, + longitude: gpsInfo.longitude, + altitude: gpsInfo.altitude + }, + network: { + wifi: networkInfo.wifi, + ethernet: networkInfo.ethernet + }, + lora: loraInfo, + time: new Date().toISOString() + }; + + return status; + } catch (error) { + console.error('Status generation error:', error); + throw error; + } +} + +router.get('/hostname', (req, res) => res.json({ hostname: environment.hostname })); + +// Main status endpoint that matches frontend expectations +router.get('/status', async (req, res) => { + try { + const now = Date.now(); + + // Return cached status if within TTL + if (statusCache && (now - lastUpdate) < CACHE_TTL) { + console.log('Returning cached status'); + return res.json(statusCache); + } + + // Generate fresh status + statusCache = await generateStatus(); + lastUpdate = now; + + console.log('Status updated successfully'); + res.json(statusCache); + } catch (error) { + console.error('Status API error:', error); + res.status(500).json({ + error: 'Failed to get system status', + message: error.message, + timestamp: new Date().toISOString() + }); + } +}); + +// Individual debug endpoints +router.get('/system', async (req, res) => { + try { + const systemInfo = await getSystemInfo(); + res.json(systemInfo); + } catch (error) { + res.status(500).json({ error: error.message }); + } +}); + +router.get('/gps', async (req, res) => { + try { + const gpsInfo = await getGPSInfo(); + res.json(gpsInfo); + } catch (error) { + res.status(500).json({ error: error.message }); + } +}); + +router.get('/network', async (req, res) => { + try { + const networkInfo = await getNetworkInfo(); + res.json(networkInfo); + } catch (error) { + res.status(500).json({ error: error.message }); + } +}); + +// Add individual LoRa endpoint +router.get('/lora', async (req, res) => { + try { + const loraInfo = await getLoRaInfo(); + res.json(loraInfo); + } catch (error) { + res.status(500).json({ error: error.message }); + } +}); + +// Initialize GPS on startup +initGPS().catch(err => console.warn('GPS initialization failed:', err.message)); + +export { router as statusRouter }; diff --git a/code/package-lock.json b/code/package-lock.json deleted file mode 100755 index 0e95487..0000000 --- a/code/package-lock.json +++ /dev/null @@ -1,370 +0,0 @@ -{ - "name": "dashboard", - "version": "1.0.0", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "dashboard", - "version": "1.0.0", - "license": "MIT", - "dependencies": { - "node-gpsd": "^0.3.4" - }, - "devDependencies": { - "nodemon": "^3.1.10" - } - }, - "node_modules/anymatch": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", - "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", - "dev": true, - "dependencies": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true - }, - "node_modules/binary-extensions": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", - "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/brace-expansion": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", - "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/braces": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", - "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", - "dev": true, - "dependencies": { - "fill-range": "^7.1.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/chokidar": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", - "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", - "dev": true, - "dependencies": { - "anymatch": "~3.1.2", - "braces": "~3.0.2", - "glob-parent": "~5.1.2", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.6.0" - }, - "engines": { - "node": ">= 8.10.0" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - }, - "optionalDependencies": { - "fsevents": "~2.3.2" - } - }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true - }, - "node_modules/debug": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", - "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", - "dev": true, - "dependencies": { - "ms": "^2.1.3" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/fill-range": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", - "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", - "dev": true, - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/fsevents": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "dev": true, - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, - "node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/ignore-by-default": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", - "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==", - "dev": true - }, - "node_modules/is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dev": true, - "dependencies": { - "binary-extensions": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true - }, - "node_modules/node-gpsd": { - "version": "0.3.4", - "resolved": "https://registry.npmjs.org/node-gpsd/-/node-gpsd-0.3.4.tgz", - "integrity": "sha512-sI9hPfHiaWDmhjE1oJZnhMo7UF2vQVGl3qk0K4HbN1L8BkS0I+rd6V687eHOj/6ervXiHrhwXzYYsWdXxGy0Qg==", - "engines": { - "node": ">=v0.8.0" - } - }, - "node_modules/nodemon": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.1.10.tgz", - "integrity": "sha512-WDjw3pJ0/0jMFmyNDp3gvY2YizjLmmOUQo6DEBY+JgdvW/yQ9mEeSw6H5ythl5Ny2ytb7f9C2nIbjSxMNzbJXw==", - "dev": true, - "dependencies": { - "chokidar": "^3.5.2", - "debug": "^4", - "ignore-by-default": "^1.0.1", - "minimatch": "^3.1.2", - "pstree.remy": "^1.1.8", - "semver": "^7.5.3", - "simple-update-notifier": "^2.0.0", - "supports-color": "^5.5.0", - "touch": "^3.1.0", - "undefsafe": "^2.0.5" - }, - "bin": { - "nodemon": "bin/nodemon.js" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/nodemon" - } - }, - "node_modules/normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true, - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/pstree.remy": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", - "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==", - "dev": true - }, - "node_modules/readdirp": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", - "dev": true, - "dependencies": { - "picomatch": "^2.2.1" - }, - "engines": { - "node": ">=8.10.0" - } - }, - "node_modules/semver": { - "version": "7.7.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", - "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/simple-update-notifier": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-2.0.0.tgz", - "integrity": "sha512-a2B9Y0KlNXl9u/vsW6sTIu9vGEpfKu2wRV6l1H3XEas/0gUIzGzBoP/IouTcUQbm9JWZLH3COxyn03TYlFax6w==", - "dev": true, - "dependencies": { - "semver": "^7.5.3" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, - "node_modules/touch": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.1.tgz", - "integrity": "sha512-r0eojU4bI8MnHr8c5bNo7lJDdI2qXlWWJk6a9EAFG7vbhTjElYhBVS3/miuE0uOuoLdb8Mc/rVfsmm6eo5o9GA==", - "dev": true, - "bin": { - "nodetouch": "bin/nodetouch.js" - } - }, - "node_modules/undefsafe": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz", - "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==", - "dev": true - } - } -} diff --git a/code/public/manifest.json b/code/public/manifest.json deleted file mode 100755 index 7b9f337..0000000 --- a/code/public/manifest.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "MRS", - "short_name": "MRS", - "description": "Multipurpose Radio Server", - "start_url": "/", - "display": "standalone", - "background_color": "#000000", - "theme_color": "#000000", - "orientation": "portrait-primary", - "icons": [ - { - "src": "/favicon.png", - "sizes": "512x512", - "type": "image/png" - } - ], - "lang": "en-US", - "scope": "/" -} diff --git a/code/src/services/status.mjs b/code/src/services/status.mjs deleted file mode 100755 index 7d6f7ee..0000000 --- a/code/src/services/status.mjs +++ /dev/null @@ -1,426 +0,0 @@ - -import express from 'express'; -import { exec } from 'child_process'; -import { promisify } from 'util'; -import { readFileSync, existsSync } from 'fs'; -import pkg from 'node-gpsd'; -const { GPS } = pkg; -import {environment} from './environment.mjs'; - -const router = express.Router(); -const execAsync = promisify(exec); - -// Status cache with TTL -let statusCache = null; -let lastUpdate = 0; -const CACHE_TTL = 15 * 1000; // 15 seconds - -// GPS client setup -let gpsClient = null; -let gpsData = { - fix: 'No Fix', - latitude: null, - longitude: null, - altitude: null, - satellites: 0 -}; - -// Initialize GPS connection -async function initGPS() { - try { - gpsClient = new GPS({ hostname: 'localhost', port: 2947 }); - - gpsClient.on('TPV', (data) => { - gpsData.latitude = data.lat || null; - gpsData.longitude = data.lon || null; - gpsData.altitude = data.alt || null; - gpsData.fix = data.mode === 3 ? '3D Fix' : data.mode === 2 ? '2D Fix' : 'No Fix'; - }); - - gpsClient.on('SKY', (data) => { - gpsData.satellites = (data.satellites || []).length; - }); - - gpsClient.on('error', (err) => { - console.warn('GPS error:', err.message); - }); - - await gpsClient.watch(); - console.log('GPS client initialized'); - } catch (error) { - console.warn('GPS not available:', error.message); - } -} - -// CLI-based system information gathering -async function getSystemInfo() { - const info = { - temperature: 0, - load: 0, - cpu: 0, - memory: 0, - storage: 0 - }; - - try { - // CPU temperature (Raspberry Pi specific) - if (existsSync('/sys/class/thermal/thermal_zone0/temp')) { - const tempData = readFileSync('/sys/class/thermal/thermal_zone0/temp', 'utf8'); - info.temperature = Math.round(parseInt(tempData.trim()) / 1000); - } - - // Load average - const { stdout: loadAvg } = await execAsync("cat /proc/loadavg | awk '{print $1}'"); - info.load = parseFloat(loadAvg.trim()) || 0; - - // CPU usage - const { stdout: cpuUsage } = await execAsync("grep 'cpu ' /proc/stat | awk '{usage=($2+$4)*100/($2+$3+$4+$5)} END {print usage}'"); - info.cpu = parseFloat(cpuUsage.trim()) || 0; - - // Memory usage percentage - const { stdout: memUsage } = await execAsync("free | awk 'NR==2{printf \"%.1f\", $3*100/$2}'"); - info.memory = parseFloat(memUsage.trim()) || 0; - - // Disk usage percentage for root filesystem - const { stdout: diskUsage } = await execAsync("df / | awk 'NR==2{printf \"%.1f\", $5}' | sed 's/%//'"); - info.storage = parseFloat(diskUsage.trim()) || 0; - - } catch (error) { - console.warn('System info error:', error.message); - } - - return info; -} - -async function getGPSInfo() { - const gpsInfo = { - satellites: 0, - latitude: null, - longitude: null, - altitude: null - }; - - try { - // Check if gpsd is running - await execAsync('systemctl is-active gpsd'); - - // Try to get GPS data using gpspipe - const { stdout: gpsRaw } = await execAsync('timeout 3s gpspipe -w -n 5 | grep -E \'"class":"TPV"\' | head -1', { timeout: 4000 }); - - if (gpsRaw.trim()) { - const gpsJson = JSON.parse(gpsRaw.trim()); - gpsInfo.latitude = gpsJson.lat || null; - gpsInfo.longitude = gpsJson.lon || null; - gpsInfo.altitude = gpsJson.alt || null; - } - - // Get satellite count - try { - const { stdout: skyRaw } = await execAsync('timeout 2s gpspipe -w -n 3 | grep -E \'"class":"SKY"\' | head -1', { timeout: 3000 }); - if (skyRaw.trim()) { - const skyJson = JSON.parse(skyRaw.trim()); - gpsInfo.satellites = (skyJson.satellites || []).length; - } - } catch (skyError) { } - } catch (error) { - console.warn('GPS info error:', error.message); - // Use cached GPS data from node-gpsd if available - if (gpsData.latitude !== null) { - return gpsData; - } - } - - return gpsInfo; -} - -async function getNetworkInfo() { - const networkInfo = { - wifi: { - mode: 'client', - ssid: 'Unknown' - }, - ethernet: { - connected: false - } - }; - - try { - // Check if hostapd is running (AP mode) - try { - await execAsync('systemctl is-active hostapd'); - networkInfo.wifi.mode = 'ap'; - - // Get AP SSID from hostapd config or use hostname - try { - const { stdout: hostname } = await execAsync('hostname'); - networkInfo.wifi.ssid = process.env.AP_SSID || hostname.trim(); - } catch { - networkInfo.wifi.ssid = 'MRS-AP'; - } - } catch { - // Not in AP mode, check if connected to WiFi - try { - // First, try iwconfig directly since it's more reliable for ESSID - const { stdout: iwconfig } = await execAsync("iwconfig wlan0 2>/dev/null"); - const essidMatch = iwconfig.match(/ESSID:"([^"]+)"/); - - if (essidMatch && essidMatch[1] && essidMatch[1] !== 'off/any') { - networkInfo.wifi.mode = 'client'; - networkInfo.wifi.ssid = essidMatch[1]; - } else { - // Fallback to nmcli if iwconfig doesn't work - try { - const { stdout: activeWifi } = await execAsync("nmcli -t -f NAME,TYPE,DEVICE connection show --active | grep -E '(wifi|802-11-wireless)' | cut -d':' -f1 | head -1"); - if (activeWifi.trim()) { - networkInfo.wifi.mode = 'client'; - networkInfo.wifi.ssid = activeWifi.trim(); - } else { - // Try getting SSID from currently connected interface - const { stdout: connectedSSID } = await execAsync("nmcli -t -f active,ssid dev wifi | grep '^yes' | cut -d':' -f2 | head -1"); - if (connectedSSID.trim()) { - networkInfo.wifi.mode = 'client'; - networkInfo.wifi.ssid = connectedSSID.trim(); - } else { - throw new Error('No active WiFi connection found'); - } - } - } catch { - // Final fallback: check if wlan0 interface is up and get info via ip - const { stdout: wlanStatus } = await execAsync("ip addr show wlan0 2>/dev/null | grep 'inet ' | wc -l"); - if (parseInt(wlanStatus.trim()) > 0) { - // Interface has IP but we can't determine SSID - networkInfo.wifi.mode = 'client'; - networkInfo.wifi.ssid = 'Connected (Unknown SSID)'; - } else { - networkInfo.wifi.mode = 'disconnected'; - networkInfo.wifi.ssid = 'Not Connected'; - } - } - } - } catch (error) { - console.warn('WiFi detection error:', error.message); - networkInfo.wifi.mode = 'disconnected'; - networkInfo.wifi.ssid = 'Not Connected'; - } - } - - // Check Ethernet status - try { - const { stdout: ethStatus } = await execAsync("ip link show eth0 | grep 'state UP'"); - networkInfo.ethernet.connected = ethStatus.includes('state UP'); - } catch { - networkInfo.ethernet.connected = false; - } - - } catch (error) { - console.warn('Network info error:', error.message); - } - - return networkInfo; -} - -let loraInfo = null; -async function getLoRaInfo() { - if(loraInfo) return loraInfo; - - loraInfo = { - connected: false, - onlineNodes: 0, - totalNodes: 0, - channelUtilization: 0, - airtimeUtilization: 0 - }; - - try { - console.log('Getting LoRa/Meshtastic status...'); - - // Get node information first - const { stdout: nodeList } = await execAsync('timeout 10s meshtastic --nodes 2>/dev/null', { timeout: 15000 }); - - if (nodeList && nodeList.trim()) { - loraInfo.connected = true; - - // Parse node list - look for actual node entries - const lines = nodeList.split('\n'); - let totalNodes = 0; - let onlineNodes = 0; - - for (const line of lines) { - const trimmedLine = line.trim(); - - // Skip header lines and separators - if (trimmedLine.includes('│') && - !trimmedLine.includes('User') && - !trimmedLine.includes('───') && - !trimmedLine.includes('Node') && - trimmedLine.length > 10) { - - totalNodes++; - - // Check if node is online (has recent lastHeard or SNR data) - if (trimmedLine.includes('SNR') || - trimmedLine.match(/\d+[smh]/) || // Time indicators like 5m, 2h, 30s - trimmedLine.includes('now')) { - onlineNodes++; - } - } - } - - loraInfo.totalNodes = totalNodes; - loraInfo.onlineNodes = onlineNodes; - } - - // Get channel and airtime utilization from --info - try { - const { stdout: meshInfo } = await execAsync('timeout 10s meshtastic --info 2>/dev/null', { timeout: 15000 }); - - if (meshInfo && meshInfo.trim()) { - const lines = meshInfo.split('\n'); - - for (const line of lines) { - const trimmedLine = line.trim(); - - // Look for channel utilization (various formats) - if (trimmedLine.includes('channelUtilization') || trimmedLine.includes('Channel utilization')) { - const channelMatch = trimmedLine.match(/([\d.]+)%?/) || trimmedLine.match(/:\s*([\d.]+)/); - if (channelMatch) { - loraInfo.channelUtilization = parseFloat(channelMatch[1]); - } - } - - // Look for airtime utilization (various formats) - if (trimmedLine.includes('airUtilTx') || trimmedLine.includes('Air time') || trimmedLine.includes('Airtime')) { - const airtimeMatch = trimmedLine.match(/([\d.]+)%?/) || trimmedLine.match(/:\s*([\d.]+)/); - if (airtimeMatch) { - loraInfo.airtimeUtilization = parseFloat(airtimeMatch[1]); - } - } - } - } - } catch (infoError) { - console.warn('Failed to get mesh info:', infoError.message); - } - - } catch (error) { - console.warn('LoRa info error:', error.message); - loraInfo.connected = false; - } - - setTimeout(() => loraInfo = null, 60000) - return loraInfo; -} - -// Main status generation function - matches frontend expectations -async function generateStatus() { - try { - console.log('Generating fresh status...'); - - const [systemInfo, gpsInfo, networkInfo, loraInfo] = await Promise.all([ - getSystemInfo(), - getGPSInfo(), - getNetworkInfo(), - getLoRaInfo() - ]); - - // Format exactly as the frontend expects - const status = { - system: { - temperature: systemInfo.temperature, - load: systemInfo.load, - cpu: systemInfo.cpu, - memory: systemInfo.memory, - storage: systemInfo.storage - }, - gps: { - fix: gpsInfo.fix, - satellites: gpsInfo.satellites, - latitude: gpsInfo.latitude, - longitude: gpsInfo.longitude, - altitude: gpsInfo.altitude - }, - network: { - wifi: networkInfo.wifi, - ethernet: networkInfo.ethernet - }, - lora: loraInfo, - time: new Date().toISOString() - }; - - return status; - } catch (error) { - console.error('Status generation error:', error); - throw error; - } -} - -router.get('/hostname', (req, res) => res.json({ hostname: environment.hostname })); - -// Main status endpoint that matches frontend expectations -router.get('/status', async (req, res) => { - try { - const now = Date.now(); - - // Return cached status if within TTL - if (statusCache && (now - lastUpdate) < CACHE_TTL) { - console.log('Returning cached status'); - return res.json(statusCache); - } - - // Generate fresh status - statusCache = await generateStatus(); - lastUpdate = now; - - console.log('Status updated successfully'); - res.json(statusCache); - } catch (error) { - console.error('Status API error:', error); - res.status(500).json({ - error: 'Failed to get system status', - message: error.message, - timestamp: new Date().toISOString() - }); - } -}); - -// Individual debug endpoints -router.get('/system', async (req, res) => { - try { - const systemInfo = await getSystemInfo(); - res.json(systemInfo); - } catch (error) { - res.status(500).json({ error: error.message }); - } -}); - -router.get('/gps', async (req, res) => { - try { - const gpsInfo = await getGPSInfo(); - res.json(gpsInfo); - } catch (error) { - res.status(500).json({ error: error.message }); - } -}); - -router.get('/network', async (req, res) => { - try { - const networkInfo = await getNetworkInfo(); - res.json(networkInfo); - } catch (error) { - res.status(500).json({ error: error.message }); - } -}); - -// Add individual LoRa endpoint -router.get('/lora', async (req, res) => { - try { - const loraInfo = await getLoRaInfo(); - res.json(loraInfo); - } catch (error) { - res.status(500).json({ error: error.message }); - } -}); - -// Initialize GPS on startup -initGPS().catch(err => console.warn('GPS initialization failed:', err.message)); - -export { router as statusRouter }; diff --git a/public/favicon.png b/public/favicon.png deleted file mode 100755 index 4e81999d922da92ff5ff2364b485cc547967bacb..0000000000000000000000000000000000000000 GIT binary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- - - - - -
-
- - - - - - - - - - - - - - - - -
-
- - - - - - -
-
- - - - -
-
- - - -
-
-
-
- -
-
-
-
- - - - - - - - -
System ?°C
-
-
-
-
CPU - Load
-
-
-
0%
-
-
-
-
Memory
-
-
-
0%
-
-
-
-
Disk
-
-
-
0%
-
-
-
-
- -
-
- - - - - - - - - - - - - - - -
GPS
-
-
-
39.2000, -49.0000
-
No Fix
-
-
- -
-
- - - - - -
LoRa
-
-
-
0 / 0 Online
-
Ch 0% Air 0%
-
-
- -
-
- - - - - - - - - - - - - - - - -
Mesh
-
-
-
Connected
-
900 Mhz -45 dBm
-
-
- -
-
- - - - - - -
WiFi
-
-
-
Access Point
-
SSID: Hostname
-
-
- -
-
- - - - -
Ethernet
-
-
-
Disconnected
-
No cable detected
-
-
- -
-
-
- - - - - - diff --git a/public/index.js b/public/index.js deleted file mode 100755 index f30310f..0000000 --- a/public/index.js +++ /dev/null @@ -1,368 +0,0 @@ - -class Dashboard { - constructor() { - this.statusCache = null; - this.lastFetch = 0; - this.hostname = 'localhost'; - this.serverTimeOffset = null; // Track difference between server and client time - this.isTimeServerSynced = false; // Track if we're using server time - this.init(); - } - - async init() { - await this.fetchHostname(); - this.updateHostname(); - this.startTimeUpdates(); // Start with client time immediately - this.startStatusUpdates(); - this.initializeEventListeners(); - } - - async fetchHostname() { - try { - const response = await fetch('/api/hostname'); - const data = await response.json(); - this.hostname = data.hostname; - } catch (error) { - console.warn('Failed to fetch hostname:', error); - } - } - - updateHostname() { - const hostnameElement = document.querySelector('.hostname'); - if (hostnameElement) { - hostnameElement.textContent = this.hostname; - } - } - - async fetchStatus() { - try { - // Record start time for latency calculation - const requestStart = performance.now(); - const response = await fetch('/api/status'); - const requestEnd = performance.now(); - - if (!response.ok) throw new Error('Status fetch failed'); - - const status = await response.json(); - this.statusCache = status; - this.updateUI(status, requestStart, requestEnd); - } catch (error) { - console.error('Failed to fetch status:', error); - this.showOfflineStatus(); - } - } - - updateUI(status, requestStart, requestEnd) { - this.updateSystemMetrics(status.system); - this.updateGPSStatus(status.gps); - this.updateNetworkStatus(status.network); - this.updateLoRaStatus(status.lora); - this.updateTimeSync(status.time, requestStart, requestEnd); - } - - updateSystemMetrics(system) { - // Update temperature - const tempElement = document.getElementById('temp'); - if (tempElement && system.temperature) { - tempElement.textContent = `${system.temperature}°C`; - } - - // Update load average - const loadElement = document.getElementById('load'); - if (loadElement && system.load !== undefined) { - loadElement.textContent = `${system.load.toFixed(1)} Load`; - } - - // Update progress bars - this.updateProgressBar('cpu-usage', system.cpu); - this.updateProgressBar('memory-usage', system.memory); - this.updateProgressBar('disk-usage', system.storage); - } - - updateProgressBar(id, percentage) { - const fillElement = document.getElementById(`${id}-fill`); - const textElement = document.getElementById(`${id}-text`); - - if (fillElement && textElement) { - const value = Math.round(percentage); - fillElement.style.width = `${value}%`; - textElement.textContent = `${value}%`; - - // Update color based on usage - if (value > 80) { - fillElement.style.background = '#ef4444'; // Red - } else if (value > 60) { - fillElement.style.background = '#f59e0b'; // Orange - } else { - fillElement.style.background = '#10b981'; // Green - } - } - } - - updateGPSStatus(gps) { - const gpsStatus = document.getElementById('gps-status'); - const gpsTile = document.getElementById('gps-tile'); - - if (gpsStatus && gpsTile) { - const hasValidFix = gps.fix !== 'No Fix' && gps.latitude !== null; - - // Update status indicator - if (hasValidFix) { - gpsStatus.classList.remove('disconnected'); - gpsStatus.classList.add('connected'); - gpsTile.classList.remove('disconnected'); - gpsTile.classList.add('connected'); - } else { - gpsStatus.classList.remove('connected'); - gpsStatus.classList.add('disconnected'); - gpsTile.classList.remove('connected'); - gpsTile.classList.add('disconnected'); - } - - // Update GPS tile info - const gpsInfo = gpsTile.querySelector('.tile-info'); - const gpsDetail = gpsTile.querySelector('.tile-detail'); - - if (gpsInfo && gpsDetail) { - if (hasValidFix) { - gpsInfo.textContent = `${gps.latitude.toFixed(4)}, ${gps.longitude.toFixed(4)}`; - gpsDetail.textContent = `${gps.fix} • ${gps.satellites} sats • Alt: ${Math.round(gps.altitude)}m`; - } else { - gpsInfo.textContent = gps.satellites > 0 ? 'Acquiring Fix...' : 'No Signal'; - gpsDetail.textContent = `${gps.satellites} satellites`; - } - } - } - } - - updateNetworkStatus(network) { - // Update WiFi status - const wifiTile = document.getElementById('wifi-tile'); - if (wifiTile) { - const wifiInfo = wifiTile.querySelector('.tile-info'); - const wifiDetail = wifiTile.querySelector('.tile-detail'); - - if (wifiInfo && wifiDetail) { - if (network.wifi.mode === 'ap') { - wifiInfo.textContent = 'Access Point'; - wifiDetail.textContent = `SSID: ${network.wifi.ssid}`; - } else { - wifiInfo.textContent = 'Client Mode'; - wifiDetail.textContent = `SSID: ${network.wifi.ssid}`; - } - } - } - - // Update Ethernet status - const ethernetStatus = document.getElementById('ethernet-status'); - const ethernetTile = document.getElementById('ethernet-tile'); - - if (ethernetStatus && ethernetTile) { - if (network.ethernet.connected) { - ethernetStatus.classList.remove('disconnected'); - ethernetStatus.classList.add('connected'); - ethernetTile.classList.remove('disconnected'); - ethernetTile.classList.add('connected'); - - const ethernetInfo = ethernetTile.querySelector('.tile-info'); - const ethernetDetail = ethernetTile.querySelector('.tile-detail'); - if (ethernetInfo && ethernetDetail) { - ethernetInfo.textContent = 'Connected'; - ethernetDetail.textContent = 'Link detected'; - } - } else { - ethernetStatus.classList.remove('connected'); - ethernetStatus.classList.add('disconnected'); - ethernetTile.classList.remove('connected'); - ethernetTile.classList.add('disconnected'); - - const ethernetInfo = ethernetTile.querySelector('.tile-info'); - const ethernetDetail = ethernetTile.querySelector('.tile-detail'); - if (ethernetInfo && ethernetDetail) { - ethernetInfo.textContent = 'Disconnected'; - ethernetDetail.textContent = 'No cable detected'; - } - } - } - } - - updateLoRaStatus(lora) { - const loraStatus = document.getElementById('lora-status'); - const loraTile = document.getElementById('lora-tile'); - - if (loraStatus && loraTile) { - if (lora.connected) { - loraStatus.classList.remove('disconnected'); - loraStatus.classList.add('connected'); - loraTile.classList.remove('disconnected'); - loraTile.classList.add('connected'); - - const loraInfo = loraTile.querySelector('.tile-info'); - const loraDetail = loraTile.querySelector('.tile-detail'); - - if (loraInfo && loraDetail) { - loraInfo.textContent = `${lora.onlineNodes}/${lora.totalNodes} Online`; - loraDetail.textContent = `CH: ${lora.channelUtilization.toFixed(1)}% • Air: ${lora.airtimeUtilization.toFixed(1)}%`; - } - } else { - loraStatus.classList.remove('connected'); - loraStatus.classList.add('disconnected'); - loraTile.classList.remove('connected'); - loraTile.classList.add('disconnected'); - - const loraInfo = loraTile.querySelector('.tile-info'); - const loraDetail = loraTile.querySelector('.tile-detail'); - - if (loraInfo && loraDetail) { - loraInfo.textContent = 'Disconnected'; - loraDetail.textContent = 'No device found'; - } - } - } - } - - updateTimeSync(serverTimeString, requestStart, requestEnd) { - if (serverTimeString && requestStart && requestEnd) { - // Calculate network latency (round-trip time / 2) - const networkLatency = (requestEnd - requestStart) / 2; - - // Parse server time and adjust for network latency - const serverTime = new Date(serverTimeString); - const adjustedServerTime = new Date(serverTime.getTime() + networkLatency); - - // Calculate the offset between adjusted server time and client time - const clientTime = new Date(); - this.serverTimeOffset = adjustedServerTime.getTime() - clientTime.getTime(); - this.isTimeServerSynced = true; - - console.log(`Time synchronized with server (latency: ${networkLatency.toFixed(1)}ms, offset: ${this.serverTimeOffset.toFixed(1)}ms)`); - } - - // Update time displays - this.updateCurrentTime(); - } - - updateCurrentTime() { - const now = new Date(); - let displayTime; - - if (this.isTimeServerSynced && this.serverTimeOffset !== null) { - // Use server-synchronized time - displayTime = new Date(now.getTime() + this.serverTimeOffset); - } else { - // Use client time (default) - displayTime = now; - } - - this.updateTimeDisplay('local', displayTime, false); - this.updateTimeDisplay('zulu', displayTime, true); - } - - updateTimeDisplay(type, date, isUtc) { - const timeElement = document.getElementById(`${type}-time`); - const dateElement = document.getElementById(`${type}-date`); - - if (timeElement && dateElement) { - const displayDate = isUtc ? new Date(date.getTime()) : date; - - const timeStr = isUtc ? - displayDate.toUTCString().split(' ')[4] : - displayDate.toLocaleTimeString(); - - const dateStr = isUtc ? - displayDate.toUTCString().split(' ').slice(0, 4).join(' ') : - displayDate.toLocaleDateString('en-US', { - month: 'short', - day: 'numeric', - year: 'numeric' - }); - - timeElement.textContent = timeStr; - dateElement.textContent = dateStr; - - // Color time orange when using client time, white when server-synced - if (this.isTimeServerSynced) { - timeElement.style.color = '#fff'; - dateElement.style.color = '#64748b'; - } else { - timeElement.style.color = '#f59e0b'; - dateElement.style.color = '#f59e0b'; - } - } - } - - showOfflineStatus() { - // Reset to client time and show orange color - this.serverTimeOffset = null; - this.isTimeServerSynced = false; - console.warn('System appears offline - falling back to client time'); - } - - startStatusUpdates() { - // Initial fetch - this.fetchStatus(); - - // Update every 60 seconds - setInterval(() => { - this.fetchStatus(); - }, 60000); - } - - startTimeUpdates() { - // Start immediately with client time - this.updateCurrentTime(); - - // Update time every second - setInterval(() => { - this.updateCurrentTime(); - }, 1000); - } - - initializeEventListeners() { - // Expand/collapse status - const expandToggle = document.getElementById('expand-toggle'); - const expandedStatus = document.getElementById('expanded-status'); - const expandIcon = document.getElementById('expand-icon'); - - if (expandToggle && expandedStatus && expandIcon) { - expandToggle.addEventListener('click', () => { - expandedStatus.classList.toggle('visible'); - expandIcon.classList.toggle('expanded'); - }); - } - - // Search functionality - const searchInput = document.getElementById('search-input'); - const appsGrid = document.getElementById('apps-grid'); - - if (searchInput && appsGrid) { - searchInput.addEventListener('input', (e) => { - const query = e.target.value.toLowerCase(); - const apps = appsGrid.querySelectorAll('.app-item'); - - apps.forEach(app => { - const name = app.getAttribute('data-name')?.toLowerCase() || ''; - app.style.display = name.includes(query) ? 'flex' : 'none'; - }); - }); - } - } -} - -function openKiwixm(event) { - event.stopPropagation(); - event.preventDefault(); - window.location.href = window.location.origin.replace(/:\d+/g, '') + ':1300/admin'; -} - -// Initialize dashboard when DOM is ready -document.addEventListener('DOMContentLoaded', () => { - new Dashboard(); - - document.querySelectorAll('.app-item[href^=":"]').forEach(link => { - const port = link.getAttribute('href').substring(1); // Remove the ':' - const url = new URL(location.origin); - url.port = port; - link.href = url.toString(); - }); -}); diff --git a/src/main.mjs b/src/main.mjs deleted file mode 100755 index ebecdb9..0000000 --- a/src/main.mjs +++ /dev/null @@ -1,51 +0,0 @@ - -import express from "express"; -import { join } from 'path'; -import {environment} from './services/environment.mjs'; -import { statusRouter } from './services/status.mjs'; - -(async () => { - const app = express(); - - // Middleware - app.use(express.json()); - app.use((err, req, res, next) => { - console.error('Middleware error:', err); - res.status(500).json({ error: 'Internal server error' }); - }); - - // Routes - console.log(join(environment.root, '../public')); - app.use(express.static(join(environment.root, '../public'))); - - app.use('/api', statusRouter); - - // Error handler - app.use((err, req, res, next) => { - console.error('Unhandled error:', err); - res.status(500).json({ error: 'Internal server error' }); - }); - - // Startup - const server = app.listen(environment.port, () => { - console.log(`Dashboard running on http://localhost:${environment.port}`); - }).on('error', (err) => { - console.error('Server startup error:', err); - process.exit(1); - }); - - // Shutdown - const gracefulShutdown = (signal) => { - console.log(`Received ${signal}, shutting down gracefully`); - server.close((err) => { - if (err) { - console.error('Error during server shutdown:', err); - process.exit(1); - } - console.log('Server closed'); - process.exit(0); - }); - }; - process.on('SIGTERM', () => gracefulShutdown('SIGTERM')); - process.on('SIGINT', () => gracefulShutdown('SIGINT')); -})(); diff --git a/src/services/environment.mjs b/src/services/environment.mjs deleted file mode 100755 index 08590a2..0000000 --- a/src/services/environment.mjs +++ /dev/null @@ -1,38 +0,0 @@ -import dotenv from 'dotenv'; -import * as fs from 'node:fs'; -import { fileURLToPath } from 'url'; -import { dirname } from 'path'; -import { execSync } from "child_process"; - -dotenv.config(); - -export const environment = { - config: process.env.CONFIG || 'config.json', - hostname: process.env.HOSTNAME || execSync('hostname', { encoding: "utf-8" }) || 'localhost', - gpsd: process.env.GPSD || 2947, - port: process.env.PORT || 3000, - root: dirname(dirname(fileURLToPath(import.meta.url))), - settings: {}, -} - -if(!environment.config.startsWith('/')) environment.config = `${environment.root}/${environment.config}`; - -export function loadSettings() { - if(!fs.existsSync(environment.config)) fs.writeFileSync(environment.config, '', { flag: 'a' }); - const value = fs.readFileSync(environment.config, 'utf-8'); - try { return JSON.parse(value); } - catch (e) { - return { - lora: { - mode: 'MESH', - telemetry: true, - } - }; - } -} - -export function saveSettings() { - fs.writeFileSync(environment.config, JSON.stringify(environment.settings, null, 4)); -} - -loadSettings();