Skip to content

Cron service

/cron exposes recurring maintenance work as HTTP endpoints, so the schedule lives outside the API server — a crond, a Kubernetes CronJob, or an operator's shell hits them periodically. The self-hosted deployments wire this up for you: the compose stack runs a cronjobs container, the Helm chart creates native CronJobs.

Like healthz and callbacks, the endpoints are guarded by HTTP Basic auth as saadmin with the PANTAHUB_SA_ADMIN_SECRET — if the endpoints return 401, that secret is not set on the server.

Process public devices

Recomputes which devices — and their steps — are visible publicly (the public flag of the devices service):

sh
curl -s -X PUT -u "saadmin:$PANTAHUB_SA_ADMIN_SECRET" \
  https://api.pantahub.com/cron/public/devices
json
[
  {"device_id": "5e9ef0ce…", "steps_marked_as_public": 2,
   "steps_marked_as_non_public": 0}
]

Process public steps

Synchronizes the public/garbage bookkeeping of individual trail steps (ids, owner, referenced object shas):

sh
curl -s -X PUT -u "saadmin:$PANTAHUB_SA_ADMIN_SECRET" \
  https://api.pantahub.com/cron/steps

To run one job immediately instead of waiting for the schedule, just call the endpoint by hand — on the Helm deployment, kubectl create job --from=cronjob/… does the same (see Day-2 operations).

Endpoint reference

EndpointReference
PUT /cron/public/devicesProcess public devices
PUT /cron/stepsProcess public steps