mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-29 03:16:22 -05:00
repos: a clone is owned by a random token, not its URL
The ownership marker held the Repo's URL key, which anyone can write, so a copied clone, an extracted archive or a hand-made `.git` passed the check and was reset and cleaned. Each Repo now has a random clone_token (repository column and repos.yaml, so a Repo restored from the config still owns its clone); the marker holds it, and only a clone holding the Repo's token is updated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
a1d4c42eee
commit
d0ea6ab313
6 changed files with 116 additions and 20 deletions
|
|
@ -31,6 +31,9 @@ class Repository(ModelHelper, Base):
|
|||
mode = Column(String, nullable=False, default='full')
|
||||
# The branch to check out; None follows the remote's default branch.
|
||||
branch = Column(String)
|
||||
# Random; written in the clone's .git (see lib.mark_clone). Only a clone holding it is updated, so a clone which
|
||||
# WROLPi did not make for this Repo is never reset or cleaned.
|
||||
clone_token = Column(String)
|
||||
# Also download the repo's submodules.
|
||||
submodules = Column(Boolean, nullable=False, default=False, server_default=false())
|
||||
default_branch = Column(String)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue