Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ Acquire::https::updates.rakuensoftware.com::SslKey "<key>";
`conf/sources` lists the projects. Every hour `smoothapt-ingest`:

1. lists each project's GitHub releases, prereleases included, so every
build the pipeline publishes from `main` reaches the archive unattended;
build the pipeline publishes from `main` reaches the archive unattended.
A project marked `stable` (SmoothNAS) takes only full releases; its
prereleases are skipped without being downloaded;
2. downloads every `.deb` of a release it has not seen (debug-symbol packages
excepted);
3. verifies it. For a public project (`attestation`), its attestation is
Expand Down
18 changes: 11 additions & 7 deletions bin/smoothapt-ingest
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,12 @@ def read_sources():
line = line.split("#", 1)[0].split()
if not line:
continue
if len(line) != 5 or line[4] not in ("attestation", "actions-upload"):
sys.exit(f"{SOURCES}:{n}: expected <repo> <archive> <suite> <workflow> attestation|actions-upload")
repo, archive, suite, workflow, check = line
if (len(line) not in (5, 6) or line[4] not in ("attestation", "actions-upload")
or line[5:] not in ([], ["stable"])):
sys.exit(f"{SOURCES}:{n}: expected <repo> <archive> <suite> <workflow> attestation|actions-upload [stable]")
repo, archive, suite, workflow, check = line[:5]
sources.append(dict(repo=repo, archive=archive, suite=suite,
workflow=workflow, check=check))
workflow=workflow, check=check, stable=line[5:] == ["stable"]))
return sources


Expand Down Expand Up @@ -267,12 +268,15 @@ def run(src):
hint = "token in " + TOKEN_FILE + " has no access" if github_token() else "no token in " + TOKEN_FILE
raise RuntimeError(f"repository not found or private ({hint})") from None
raise
releases = sorted((r for r in releases if not r["draft"]), key=lambda r: r["published_at"] or "")
# A "stable" project serves only its full releases: its prereleases (e.g.
# SmoothNAS's testing builds) are never meant for the archive, so they are
# not downloaded, verified or reported as rejected.
releases = sorted((r for r in releases if not r["draft"] and not (src["stable"] and r["prerelease"])),
key=lambda r: r["published_at"] or "")
# A project's first ingest starts from its newest release it can take:
# the archive only ever serves the newest anyway, and older builds would
# each be downloaded and verified only to be pruned. It walks back past
# releases that are refused (e.g. SmoothNAS's testing prereleases, signed
# by a run on the testing branch) until one is ingested.
# releases that are refused until one is ingested.
if not state["ingested"]:
releases = releases[::-1]
for rel in releases:
Expand Down
11 changes: 7 additions & 4 deletions conf/sources
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Projects smoothapt ingests, one per line:
#
# <github-repo> <archive> <suite> <workflow> <check>
# <github-repo> <archive> <suite> <workflow> <check> [stable]
#
# archive reprepro archive under /var/lib/smoothapt/archives (served as
# /<archive>/): "public", or "smoothrouter" for the per-user one.
Expand All @@ -13,9 +13,12 @@
# GitHub Actions, with the digest GitHub recorded. Needs the token in
# /etc/smoothapt/github-token.
#
# Every release the workflow publishes is ingested, prereleases included:
# a build from main reaches the archive with no manual step.
# stable optional: take only full releases and skip prereleases without
# downloading them (SmoothNAS's testing builds are prereleases).
#
# Otherwise every release the workflow publishes is ingested, prereleases
# included: a build from main reaches the archive with no manual step.
RakuenSoftware/smoothkernel public common release.yml attestation
RakuenSoftware/smoothrouter smoothrouter smoothrouter release.yml actions-upload
RakuenSoftware/smoothfs public smoothnas release-please.yml attestation
RakuenSoftware/smoothnas public smoothnas release.yml attestation
RakuenSoftware/smoothnas public smoothnas release.yml attestation stable
Loading