vasyaod / parental-control

Allows to control user login time and calculate consumed time in Windows and Linux
MIT License
15 stars 3 forks source link
linux-os parental-control time-control

Parental control

Allows to control user login time and calculate consumed time in Windows and Linux. Basically this app is advantaged version of this script

#!/bin/bash

# Add this script to Crone
# */1 0-7,10-17,19-23 * * * parental-control

USER=vasyaod
IS_USER_LOGINED=$(who | grep $USER)

if [ ! -z "$IS_USER_LOGINED" ]
then
  # echo "vasyaod is here"
  skill -KILL -u $USER
fi

but with more features

Installation

Windows Pro

Windows Home (beta)

Debian/Ubuntu

CentOS/Redhat/Fedora

The OS was not tested

Configs

There are two type for configs

Examples of the config files with parameter description is available in the repo config.yml and user-sconfig.yml

HTTP interface

By default HTTP interface is available on http://localhost:8090 where following things can be find

Screenshot

Screenshot

HTTP API

Maintenance

Build of schedule and web daemons

cd schedule-daemon
stack build --test --copy-bins

Output files:

Build of web UI

cd web-ui
npm install
npm rub build

Linux

Run as daemon

start-stop-daemon -S -b -u root --exec /root/parental-control -- -c /etc/parental-control/config.yml

Stop daemon

start-stop-daemon -K --exec /root/parental-control

Windows

Windows Service Wrapper https://github.com/winsw/winsw

License

MIT License

Copyright (c) 2020-2022 Vasilii Vazhesov

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.