Files
alma-assignments-reporter/README.md
T
Joe Julian 2ef915b37a
CI / test (push) Successful in 28s
CI / publish (push) Failing after 21s
Use Buildah for registry publishing
2026-03-28 16:46:56 -07:00

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_HOST
  • EMAIL_FROM
  • EMAIL_TO

Recommended settings:

  • ALMA_ASSIGNMENTS_URL=https://example.invalid/children/student-id/assignments
  • ALMA_SCHEDULE_URL=https://example.invalid/children/student-id/schedule
  • ALMA_START_DATE=2026-01-20
  • ALMA_UPCOMING_DAYS=14
  • ALMA_CREDS_FILE=/config/alma.creds
  • ALMA_USERNAME
  • ALMA_PASSWORD
  • SMTP_PORT=587
  • SMTP_STARTTLS=true
  • SMTP_HELO_NAME=mailer.example.invalid
  • SMTP_TLS_SERVER_NAME=smtp.example.invalid
  • SMTP_USERNAME
  • SMTP_PASSWORD
  • PRINT_REPORT=true
  • SEND_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_USERNAME and ALMA_PASSWORD
  • ALMA_CREDS_FILE containing:
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 :main and :sha-<commit> container tags on pushes to main

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.