72 lines
2.8 KiB
YAML
72 lines
2.8 KiB
YAML
|
|
name: arti-watch
|
||
|
|
|
||
|
|
# Daily upstream check for the in-process Tor stack. Arti onion services are
|
||
|
|
# experimental (README) and tor-*/arti-* are the largest attack surface here,
|
||
|
|
# so when crates.io has a newer major.minor than the pins in Cargo.toml this
|
||
|
|
# files ONE Forgejo issue (deduped on the title — a second run is a no-op).
|
||
|
|
#
|
||
|
|
# Forgejo has no Dependabot: this workflow IS the dependency alert. It
|
||
|
|
# deliberately bumps nothing. A bump is a reviewed PR; the procedure, toolchain
|
||
|
|
# floor and the tests it must pass are in docs/ARTI_UPGRADE.md.
|
||
|
|
#
|
||
|
|
# NOT covered, by design: Tor Project security announcements (a fix that ships
|
||
|
|
# with no crates.io version bump is invisible here) and a yanked crate /
|
||
|
|
# vulnerability in a version that has not changed. Read
|
||
|
|
# https://blog.torproject.org/ yourself.
|
||
|
|
on:
|
||
|
|
schedule:
|
||
|
|
# 06:17 UTC daily. Forgejo cron is UTC; off the hour on purpose.
|
||
|
|
- cron: "17 6 * * *"
|
||
|
|
workflow_dispatch:
|
||
|
|
inputs:
|
||
|
|
dry_run:
|
||
|
|
description: Compare and log only, file no issue (true/false)
|
||
|
|
required: false
|
||
|
|
type: string
|
||
|
|
default: "false"
|
||
|
|
simulate_pin:
|
||
|
|
description: 'Test the alert path on real crates.io data, e.g. "arti-client=0.45,tor-hsservice=0.45". Empty = the real Cargo.toml pins.'
|
||
|
|
required: false
|
||
|
|
type: string
|
||
|
|
|
||
|
|
# Never two watchers at once: two simultaneous runs could both see "no issue
|
||
|
|
# with this title yet" and file twice.
|
||
|
|
concurrency:
|
||
|
|
group: onionwire-arti-watch
|
||
|
|
cancel-in-progress: false
|
||
|
|
|
||
|
|
jobs:
|
||
|
|
watch:
|
||
|
|
# Same Pi runner + `docker` job image as ci.yml / release.yml (which run
|
||
|
|
# python3 and curl there). No cargo, no docker: four crates.io GETs and at
|
||
|
|
# most one issue POST.
|
||
|
|
runs-on: docker
|
||
|
|
timeout-minutes: 10
|
||
|
|
steps:
|
||
|
|
- name: Checkout
|
||
|
|
uses: https://code.forgejo.org/actions/checkout@v4
|
||
|
|
|
||
|
|
- name: Compare pins against crates.io and file an issue on a bump
|
||
|
|
shell: bash
|
||
|
|
env:
|
||
|
|
FORGEJO_TOKEN: ${{ secrets.FORGEJO_TOKEN }}
|
||
|
|
REPO_API: ${{ github.server_url }}/api/v1/repos/${{ github.repository }}
|
||
|
|
INPUT_DRY_RUN: ${{ github.event.inputs.dry_run }}
|
||
|
|
INPUT_SIMULATE_PIN: ${{ github.event.inputs.simulate_pin }}
|
||
|
|
run: |
|
||
|
|
set -euo pipefail
|
||
|
|
args=(--cargo-toml Cargo.toml)
|
||
|
|
case "${INPUT_DRY_RUN:-false}" in
|
||
|
|
true|True|TRUE|1|yes|YES) args+=(--dry-run) ;;
|
||
|
|
esac
|
||
|
|
if [ -n "${INPUT_SIMULATE_PIN:-}" ]; then
|
||
|
|
IFS=',' read -ra pairs <<< "$INPUT_SIMULATE_PIN"
|
||
|
|
for pair in "${pairs[@]}"; do
|
||
|
|
pair="${pair// /}"
|
||
|
|
if [ -n "$pair" ]; then
|
||
|
|
args+=(--simulate-pin "$pair")
|
||
|
|
fi
|
||
|
|
done
|
||
|
|
fi
|
||
|
|
echo "run: python3 scripts/arti-watch.py ${args[*]}"
|
||
|
|
python3 scripts/arti-watch.py "${args[@]}"
|