2.2 KiB
Alma Assignments Reporter
This service logs into Alma, reads the Missing / Revise assignments table, walks the schedule page to find each class, collects upcoming assignments from each class page, and emails a daily report.
Configuration
Required when SEND_EMAIL=true:
SMTP_HOSTEMAIL_FROMEMAIL_TO
Recommended settings:
ALMA_ASSIGNMENTS_URL=https://example.invalid/children/student-id/assignmentsALMA_SCHEDULE_URL=https://example.invalid/children/student-id/scheduleALMA_START_DATE=2026-01-20ALMA_UPCOMING_DAYS=14ALMA_CREDS_FILE=/config/alma.credsALMA_USERNAMEALMA_PASSWORDSMTP_PORT=587SMTP_STARTTLS=trueSMTP_HELO_NAME=mailer.example.invalidSMTP_TLS_SERVER_NAME=smtp.example.invalidSMTP_USERNAMESMTP_PASSWORDPRINT_REPORT=trueSEND_EMAIL=false
Any setting can also be supplied via a *_FILE variant such as SMTP_PASSWORD_FILE.
The Alma credentials can be supplied either by:
ALMA_USERNAMEandALMA_PASSWORDALMA_CREDS_FILEcontaining:
username: your-alma-username
password: your-alma-password
Local run
go test ./...
PRINT_REPORT=true SEND_EMAIL=false ALMA_CREDS_FILE=/path/to/alma.creds go run .
CI
This repo includes a Gitea Actions workflow in .gitea/workflows/ci.yaml.
It runs on pushes to main and pull requests, and currently:
- runs
go test ./... - runs
go build . - builds and pushes
:mainand:sha-<commit>container tags on pushes tomain
The workflow expects a runner with the ubuntu-latest label, a repository Actions secret named REGISTRY_PASSWORD, and a repository variable named REGISTRY_HOST for the registry hostname.
The cluster runner deployed for this repo provides the required runner label.
Container
Build:
docker build -t example.invalid/alma-assignments-reporter:latest .
The container image uses a static Go binary in scratch, with only the CA bundle copied in for HTTPS and SMTP TLS.
Kubernetes
Use a Secret for Alma and SMTP credentials. The example manifest in cronjob.example.yaml reads all runtime settings from Kubernetes secrets and does not require a credentials file mount.