feat(services): add log and login/session services#982
Conversation
Injects LogTailReader, LoginStats, ActivityRate, and ActiveConnections — added in #982 — into AdminSettings and passes their data to the template params, making the services active instead of dead code. Extracted from #977. Co-Authored-By: Frank Karlitschek <karlitschek@users.noreply.github.com> AI-assisted: Claude Code (claude-sonnet-4-6) Signed-off-by: Christoph Wurst <1374172+ChristophWurst@users.noreply.github.com>
7684654 to
b066758
Compare
Adds four read-only service classes used by the upcoming admin
dashboard cards. None are wired into existing controllers yet, so
this change is a pure addition with no behavior change.
* LogTailReader - last N WARN/ERROR entries from the JSON log
(no shell, line-bounded)
* LoginStats - bruteforce attempt counters and the top
offending IPs over recent windows
* ActivityRate - oc_activity row counts over the last hour /
day / week
* ActiveConnections - session counts derived from oc_authtoken
Signed-off-by: Frank Karlitschek <karlitschek@users.noreply.github.com>
Injects LogTailReader, LoginStats, ActivityRate, and ActiveConnections — added in #982 — into AdminSettings and passes their data to the template params, making the services active instead of dead code. Extracted from #977. Co-Authored-By: Frank Karlitschek <karlitschek@users.noreply.github.com> AI-assisted: Claude Code (claude-sonnet-4-6) Signed-off-by: Christoph Wurst <1374172+ChristophWurst@users.noreply.github.com>
b066758 to
b34e5c4
Compare
Injects LogTailReader, LoginStats, ActivityRate, and ActiveConnections — added in #982 — into AdminSettings and passes their data to the template params, making the services active instead of dead code. Extracted from #977. Co-Authored-By: Frank Karlitschek <karlitschek@users.noreply.github.com> AI-assisted: Claude Code (claude-sonnet-4-6) Signed-off-by: Christoph Wurst <1374172+ChristophWurst@users.noreply.github.com>
b34e5c4 to
8c232c6
Compare
Injects LogTailReader, LoginStats, ActivityRate, and ActiveConnections — added in #982 — into AdminSettings and passes their data to the template params, making the services active instead of dead code. Extracted from #977. Co-Authored-By: Frank Karlitschek <karlitschek@users.noreply.github.com> AI-assisted: Claude Code (claude-sonnet-4-6) Signed-off-by: Christoph Wurst <1374172+ChristophWurst@users.noreply.github.com>
8c232c6 to
9a7a730
Compare
Injects LogTailReader, LoginStats, ActivityRate, and ActiveConnections — added in #982 — into AdminSettings and passes their data to the template params, making the services active instead of dead code. Extracted from #977. Co-Authored-By: Frank Karlitschek <karlitschek@users.noreply.github.com> AI-assisted: Claude Code (claude-sonnet-4-6) Signed-off-by: Christoph Wurst <1374172+ChristophWurst@users.noreply.github.com>
9a7a730 to
28626fa
Compare
| $qb = $this->db->getQueryBuilder(); | ||
| $qb->select('subjectparams', 'type') | ||
| ->selectAlias($qb->func()->count('activity_id'), 'count') | ||
| ->from('activity') |
There was a problem hiding this comment.
|
Activity, auth token and rate limiting are conceptually problematic. This creates an inter app dependency where this app accesses the persistence of another app directly. The technically sound way would be to go through a public API. Looking into these right now … |
|
Amended the original commit to fix the DCO and added class usage like it will be used later to avoid dead code. |
ChristophWurst
left a comment
There was a problem hiding this comment.
👍 functionality-wise
Needs decision conceptually
| 'cron' => $this->cronInfo->getCronInfo(), | ||
| 'jobQueue' => $this->jobQueueInfo->getJobQueueInfo(), | ||
| 'slowestJobs' => $this->slowestJobs->getSlowestJobs(), | ||
| 'logTail' => $this->logTailReader->recentErrors(), |
There was a problem hiding this comment.
Could we not bind them in getFrom but introduce a new controller (maybe ocs)?
This has the advantage to not block the main operation with slow operations (like expensive database queries, opening log files, etc) and also give us the ability to let the dashboard refresh without a page load in the long run.
Also okay as follow up, I would just mention it.
Injects LogTailReader, LoginStats, ActivityRate, and ActiveConnections — added in #982 — into AdminSettings and passes their data to the template params, making the services active instead of dead code. Extracted from #977. Co-Authored-By: Frank Karlitschek <karlitschek@users.noreply.github.com> AI-assisted: Claude Code (claude-sonnet-4-6) Signed-off-by: Christoph Wurst <1374172+ChristophWurst@users.noreply.github.com>
28626fa to
7fbf7cc
Compare
Injects LogTailReader, LoginStats, ActivityRate, and ActiveConnections — added in #982 — into AdminSettings and passes their data to the template params, making the services active instead of dead code. Extracted from #977. Co-Authored-By: Frank Karlitschek <karlitschek@users.noreply.github.com> AI-assisted: Claude Code (claude-sonnet-4-6) Signed-off-by: Christoph Wurst <1374172+ChristophWurst@users.noreply.github.com>
e7fafb7 to
b48f36c
Compare
Adds four read-only service classes used by the upcoming admin dashboard cards. None are wired into existing controllers yet, so this change is a pure addition with no behavior change.
(no shell, line-bounded)
offending IPs over recent windows
day / week