gostudentubl

gostudentubl

Automated attendance runner for Moodle-based courses with scheduled execution.

auto-imported
View Source

gostudentubl

Automated attendance runner for Moodle-based courses with scheduled execution.

Local run

  1. Copy environment template:
cp .env.example .env
  1. Fill required values in .env.
  2. Run locally:
make run

Docker agent deployment

This project can run as a long-lived Docker service (attendance-agent) that executes scheduled jobs internally.

Deploy

make docker-deploy

Equivalent command:

docker compose up -d --build

Cross-project WhatsApp integration (same host)

If wa-bot-notif runs as a separate Docker project on the same machine, use a shared external network.

  1. Create shared network once:
docker network create homelab_integration
  1. Set in .env:
INTEGRATION_NETWORK=homelab_integration
WA_ENDPOINT=http://wa-bot-notif-api:5000/send

If wa-bot-notif uses a non-default PORT (for example 5001), match it in WA_ENDPOINT.

  1. Start wa-bot-notif stack first, then this stack.

Do not use localhost for cross-container calls; use service/container DNS on the shared network.

Operate

  • Tail logs:
make docker-logs
  • Restart:
make docker-restart
  • Stop:
make docker-down

Trigger manual run in container

The app listens to SIGUSR1 and executes a direct attendance run.

make docker-signal-run

Equivalent command:

docker compose kill -s SIGUSR1 attendance-agent

Notes

  • Scheduler timezone is controlled by TIMEZONE.
  • App logs go to stdout and rotating app.log inside container workdir (/app).
  • Keep secrets only in .env (already ignored by git).
  • Run a single agent instance unless you add distributed locking, otherwise duplicate attendance jobs can occur.

Quiz and Assignment Tracking

The runner now tracks richer assignment/quiz metadata and sends smarter notifications:

  • Assignment list parsing: due date, submission status, grade.
  • Quiz list parsing: close date, grade.
  • Detail page fetch pipeline for assignments/quizzes (limited per run).
  • Deadline reminders (24h and 12h windows) for unfinished items.
  • Optional AI suggestion pipeline via OpenRouter for pending tasks.

Relevant environment variables:

  • DETAIL_FETCH_ENABLED (default true)
  • DETAIL_FETCH_LIMIT (default 10)
  • OPENROUTER_ENDPOINT (default https://openrouter.ai/api/v1/chat/completions)
  • OPENROUTER_API_KEY (required when SUGGESTION_ENABLED=true)
  • OPENROUTER_MODEL (default anthropic/claude-sonnet-4-20250514)
  • SUGGESTION_ENABLED (default false)
  • SUGGESTION_LIMIT (default 5)

Periode Mode

This project supports dynamic period filtering so monthly manual config updates are optional.

  • PERIODE_MODE=auto (recommended): accepts current month and next month (MMYY) automatically.
    • Example in Feb 2026: 0226 and 0326 are accepted.
  • PERIODE_MODE=manual: accepts only values in ALLOWED_PERIODES (comma separated).
  • PERIODE_MODE=legacy: keeps strict CURRENT_PERIODE equality behavior.

Additional safety setting:

  • MAX_COURSES_PER_RUN: hard cap to prevent accidental over-selection.
    • 0 disables the cap (default behavior).