Libki / libki-client

Libki Client
GNU General Public License v3.0
32 stars 17 forks source link

Timer doesn't count down #117

Closed joeskeen closed 1 month ago

joeskeen commented 1 month ago

Describe the bug

During a libkiclient session, the timer window pops up with the remaining time of 45 minutes. If I use the computer for over 1 hour, I don't get logged out, and the window still shows 45 minutes remaining.

Some timer things are working:

But an active user is never forced out of a session.

To Reproduce Steps to reproduce the behavior:

  1. Log into libkiclient
  2. Don't log out or time out due to inactivity

Expected behavior User is logged out at the end of the amount of time displayed at the start of the session

Screenshots If applicable, add screenshots to help explain your problem.

2024-05-19-141539_1920x1200_scrot.png

This image was captured well over an hour after start of session (I know this since I watched an entire Arch Linux install video that was over 1 hour long btw). Notice it still shows 45 minutes remaining. Client config is in screenshot.

Desktop (please complete the following information):

I have been playing with Libki-Client on my Debian 12-based home computer lab. To keep things as restricted as possible, I have a low-privilege user auto-login on boot (configured in lightdm.conf), launching a vanilla OpenBox session (no gnome, kde, etc.). OpenBox's autostart script only launches libkiclient. When user logs into libkiclient, I am running a script that starts PCManFM desktop and tint2 taskbar. When user logs out another script kills all processes that were started since the log in.

Additional context

I peeked at the code and I don't see anything obviously wrong with it. I checked the logs and still not seeing problems...

joeskeen commented 1 month ago

I think the issue may be server side? I found this in the client logs after opening this issue:

2024-05-19T14:25:19 [Debug] Server Result:  "{\"status\":\"Logged in\",\"units\":\"45\",\"messages\":[]}"
2024-05-19T14:25:19 [Debug] STATUS:  "Logged in"
2024-05-19T14:25:19 [Debug] MESSAGE ARRAY SIZE:  0
2024-05-19T14:25:19 [Debug] UNITS JASON:  QJsonValue(string, "45")
2024-05-19T14:25:19 [Debug] UNITS VARIANT:  QVariant(QString, "45")
2024-05-19T14:25:19 [Debug] UNITS:  45
2024-05-19T14:25:19 [Debug] "ENTER TimerWindow::updateTimeLeft(45)"

I'm running the latest Libki server docker image with pretty minimal config changes.

joeskeen commented 1 month ago

I think the issue may be server side? I found this in the client logs after opening this issue:

2024-05-19T14:25:19 [Debug] Server Result:  "{\"status\":\"Logged in\",\"units\":\"45\",\"messages\":[]}"
2024-05-19T14:25:19 [Debug] STATUS:  "Logged in"
2024-05-19T14:25:19 [Debug] MESSAGE ARRAY SIZE:  0
2024-05-19T14:25:19 [Debug] UNITS JASON:  QJsonValue(string, "45")
2024-05-19T14:25:19 [Debug] UNITS VARIANT:  QVariant(QString, "45")
2024-05-19T14:25:19 [Debug] UNITS:  45
2024-05-19T14:25:19 [Debug] "ENTER TimerWindow::updateTimeLeft(45)"
joeskeen commented 1 month ago

Ok I think this is because the CRON isn't running.

This line of Code in libki.pl is supposed to run every minute:

        sessions.minutes = sessions.minutes - 1,
joeskeen commented 1 month ago

Yup. Running the libki.pl manually decrements the time.