- JavaScript 100%
| .env.example | ||
| .gitignore | ||
| .prettierrc | ||
| eslint.config.js | ||
| index.js | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
powerup - When multiple Kyiv addresses have DTEK electricity today.
Copyright (C) 2022, 2025-2026 Denys Nykula [email protected]
Prerequisites: uk_UA.UTF-8 locale and Europe/Kyiv time zone.
Usage on Debian GNU/Linux:
sudo apt-get install firefox npm tigervnc-standalone-server tigervnc-viewer
npm install
cp .env.example .env
echo PORT=8080 >>.env
echo ORIGIN=http://localhost:8080 >>.env
node --env-file=.env index.js --house 'Броварський,2|Імені+Прізвища,8Б'
node --env-file=.env index.js --listen
A web browser opens. Complete a captcha if it asks. The browser loads cookies and exits. Powerup loads outage tables for houses matching the query you pass as an argument. It shows you the path where the tables for your addresses are accessible. Express shows Powerup at http://localhost:8080.
Debug individual functions locally:
node --env-file=.env -p 'require("./index.js").startMarionette()' &
node --env-file=.env -p 'require("./index.js").fetchSession()'
node --env-file=.env -p 'require("./index.js").fetchHouse({ input: { house: [{ street: "Броварський", house: "2" }, { street: "Імені Прізвища", house: "8Б" }], lang: "uk" } })'
On server
Load houses using the --house option with the following format (if you installed Powerup as user www-data):
sudo su -s /bin/sh -c 'vncserver -fg -- /usr/bin/node --env-file=/var/www/powerup/.env /var/www/powerup/index.js --house \"Броварський,2|Імені+Прізвища,8Б\" - www-data
If Powerup does not respond for too long, tunnel to the server:
ssh [email protected] -L 5901:0.0.0.0:5901
and connect to the web browser from another terminal to enter a captcha:
vncviewer 0.0.0.0::5901
Schedule a refresh every 4 hours, starting at 00:05:
echo '5 */4 * * * www-data timeout -k 60 3600 vncserver -fg -- /usr/bin/node --env-file=/var/www/powerup/.env /var/www/powerup/index.js --house "Броварський,2|Імені+Прізвища,8Б"' |sudo tee /etc/cron.d/powerup
License
License AGPLv3+: GNU AGPL version 3 or later https://gnu.org/licenses/agpl-3.0.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.