The Tor Project runs a public Debian package repository intended for the distribution of Tor experimental packages built from CI pipelines in project tpo/core/tor/debian.
The URL for this service is https://deb.torproject.org
Tutorial
How do I use packages from this repository?
See the tutorial instructions over at: https://support.torproject.org/apt/tor-deb-repo/
How-to
Adding one's PGP key to the keyring allowing uploads
Package releases will only be allowed for users with a pgp public key, in their
gitlab account, that is contained in the TOR_DEBIAN_RELEASE_KEYRING_DEBIAN
CI/CD file variable in the tpo/core/debian/tor project.
First, for all operations below, you'll need to be project maintainer in order
to read and modify the CI/CD variable. Make sure you are listed as a maintainer
in https://gitlab.torproject.org/groups/tpo/core/debian/-/group_members (note
that the tpo/core/debian/tor project will inherit the members from there)
To list who's keys are currently present in the keyring:
- Go to the variables page of the project
- copy the value of the variable from gitlab's web interface and save this to a file
- Now list the keys:
sq keyring list thisfile.asc- or with gpg:
gpg thisfile.asc
- or with gpg:
You'll need to add your key only once as long as you're still using the same key, and it isn't expired. To add your key to the keyring:
- Go to the variables page of the project
- copy the value of the variable from gitlab's web interface and save this to a file
- import public keys from that file, with
gpg --import thatfile.ascif you're missing some of them - produce a new file by exporting each of them again plus your own key:
gpg --export --armor $key1 $key2 $yourkey > newfile.asc - copy the contents of the new file and set that as the new value for the CI/CD variable
Setting up your local clone
These things are only needed once, when setting up:
- Make sure you have sufficient access
- Clone https://gitlab.torproject.org/tpo/core/debian/tor.git
- Add the "upstream" tor repository as a remote (https://gitlab.torproject.org/tpo/core/tor.git)
- Track the
debian-*branch for the version you need to release a package for:git switch debian-0.4.8 - Find the commit hash where the previous version was included: search for
"New upstream version:" in the commit history. Then, create a
debian-merge-*branch from the last upstream merge commit parent, eg.git branch debian-merge-0.4.8 ca1a6573b7df80f40da29a1713c15c4192a8d8f0 - Add a
tor-pristine-upstreamremote and fetch it:git remote add tor-pristine-upstream https://gitlab.torproject.org/tpo/core/debian/tor-pristine-upstream.git - Create a
pristine-tarbranch on the repository:git co -b pristine-tar tor-pristine-upstream/master - Create a
pristine-tar-signaturesbranch on the repository:git co -b pristine-tar-signatures tor-pristine-upstream/pristine-tar-signatures - Configure git (locally to this repository) for easier pushes. The
pristine-tarbranch we've created locally differs in name to the remote branch namedmaster. We want to tell git to push to the different name, the one tracked as upstream branch:git config set push.default upstream
New tor package release
If you didn't just follow setting up your local clone you'll need to get your local clone up to date:
git remote update- switch to
pristine-tarand fast-forward to the remote upstream branch - switch to
pristine-tar-signaturesand fast-forward to the remote upstream branch - switch to the current minor version branch, e.g.
debian-0.4.8, and fast-forward to the remote upstream branch - switch to your local
debian-merge-0.4.8branch. Find the commit hash where the previous version was included: search for "New upstream version:" in the commit history. If it's in a different place than your branch, move your branch to it:git reset --hard 85e3ba4bb3
To make the new deb package release:
- Switch to the
debian-merge-0.4.8branch - Verify the latest release tag's signature with
git verify-tag tor-0.4.8.15 - Extract the commit list with
git log --pretty=oneline tor-0.4.8.14...tor-0.4.8.15 - Merge the upstream tag with
git merge tor-0.4.8.15- Include the upstream commit list in the merge commit message
- Create a new
debian/changelogentry withdch --newversion 0.4.8.15-1 && dch -rand commit with commit message that lets us find where to placedebian-merge-0.4.8:git commit -m "New upstream version: 0.4.8.15 - Switch to the
debian-0.4.8branch and mergedebian-merge-0.4.8into it - Create and PGP-sign a new tag on the
debian-0.4.8branch:git tag -s -m'tag debian-tor-0.4.8.15-1' debian-tor-0.4.8.15-1 - Download the dist tarball including sha256sum and signature
- Verify the signature and sha256sum of the downloaded tarball
- Commit the tarball to
pristine-tar:pristine-tar commit -v tor-0.4.8.15.tar.gz debian-tor-0.4.8.15-1 - Switch to the
pristine-tar-signaturesbranch and commit the sha256sum and its detached signature - Push
pristine-tarandpristine-tar-signaturebranches upstreamgit push tor-pristine-upstream pristine-tar-signaturesgit push tor-pristine-upstream pristine-tar:masterthe strange syntax is needed here since the local branch is not named the same as the remote one.
- Switch back to the
debian-0.4.8branch, then push usinggit push --follow-tagsand wait for the CI pipeline run -- specifically, you want to watch the CI run for the commit that was tagged with the debian package version. - Promote the packages uploaded to
proposed-updates/<suite>to<suite>in reprepro:- Test with:
for i in $(list-suites | grep proposed-updates | grep -v tor-experimental); do echo " " reprepro -b /srv/deb.torproject.org/reprepro copysrc ${i#proposed-updates/} $i tor; done - If it looks good, remove
echo " "to actually run it
- Test with:
- Run
static-update-component deb.torproject.orgto update the mirrors
List all packages
The show-all-packages command will list packages hosted in the repository,
including information about the provided architectures:
tordeb@palmeri:/srv/deb.torproject.org$ bin/show-all-packages
Remove a package
tordeb@palmeri:/srv/deb.torproject.org$ bin/show-all-packages | grep $PACKAGETOREMOVE
tordeb@palmeri:/srv/deb.torproject.org$ reprepro -b /srv/deb.torproject.org/reprepro remove $RELEVANTSUITE $PACKCAGETOREMOVE
Packages are probably in more than one suite. Run show-all-packages again at the end to make sure you got them all.
Add a new suite
In the example below, modifications are pushed to the debian-main branch, from
which the latest nightly builds are made. The same modifications must be pushed
to all the maintenance branches for releases which are currently supported, such
as debian-0.4.8.
Commands run on palmeri must be executed as the tordeb user.
- Make sure you have sufficient access
- On the
debian-mainbranch, enable building a source package for the suite indebian/misc/build-tor-sourcesanddebian/misc/backport - If the new suite is a debian stable release, update the
# BPOsection indebian/misc/build-tor-sources. - On the
debian-cibranch, add the binary build job for the new suite in the job matrix indebian/.debian-ci.yml - On
palmeri, cd to/srv/deb.torproject.org/reprepro/conf, add the suite in thegen-suitesscript and run it - Merge the
debian-cibranch intodebian-mainand also mergedebian-ciinto the latest per-version branch (e.g.debian-0.4.8), then push the changes to the git repository (in thetpo/core/debian/torproject) and let the CI pipeline run. - From this point, nightlies will be built and uploaded to the new suite, but the latest stable release and keyring packages are still missing.
- On
palmeri:- Copy the packages from the previous suite:
reprepro -b /srv/deb.torproject.org/reprepro copysrc <target-suite> <source-suite> deb.torproject.org-keyringreprepro -b /srv/deb.torproject.org/reprepro copysrc <target-suite> <source-suite> tor
- Run
show-all-packagesto ensure the new package was added in the new suite. - Run
static-update-component deb.torproject.orgto update the mirrors.
- Copy the packages from the previous suite:
Add a new architecture
- Add the architecture in the job matrix in
debian/.debian-ci.yml(debian-cibranch) - Add the architecture in
/srv/deb.torproject.org/reprepro/conf/gen-suitesand run the script - Ensure your PGP key is present in the project's
TOR_DEBIAN_RELEASE_KEYRING_DEBIANCI/CD file variable - Merge the
debian-cibranch and run a CI pipeline in thetpo/core/debian/torproject - Run
show-all-packagesonpalmerito ensure the new package was added inproposed-updates - "Flood" the suites in reprepro to populate arch-all packages
- Test with:
for i in $(list-suites | grep -Po "proposed-updates/\K.*" | grep -v tor-experimental); do echo " " reprepro -b /srv/deb.torproject.org/reprepro flood $i; done - If it looks good, remove
echo " "to actually run it
- Test with:
- Run
static-update-component deb.torproject.orgto update the mirrors
Drop a suite
In the example below, modifications are pushed to the debian-main branch, from
which the latest nightly builds are made. The same modifications must be pushed
to all the maintenance branches for releases which are currently supported, such
as debian-0.4.8.
Commands run on palmeri must be executed as the tordeb user.
- On the
debian-mainbranch, disable building a source package for the suite indebian/misc/build-tor-sourcesanddebian/misc/backport - If the new suite is a debian stable release, update the
# BPOsection in - On the
debian-cibranch, add the binary build job for the new suite in the job matrix indebian/.debian-ci.ymland push - Merge the
debian-cibranch intodebian-mainand also mergedebian-ciinto the latest per-version branch (e.g.debian-0.4.8) and push - On
palmeri:- cd to
/srv/deb.torproject.org/reprepro/conf, drop the suite from thegen-suitesscript and run it - Run
reprepro -b /srv/deb.torproject.org/reprepro --delete clearvanishedto cleanup the archive - Run
static-update-component deb.torproject.orgto update the mirrors.
- cd to
Reference
- Host: palmeri.torproject.org
- All the stuff:
/srv/deb.torproject.org - LDAP group: tordeb
The repository is managed using reprepro.
The primary purpose of this repository is to provide a repository with experimental and nightly tor packages. Additionally, it provides up-to-date backports for Debian and Ubuntu suites.
Some backports have been maintained here for other packages, though it is preferred that this happens in Debian proper. Packages that are not at least available in Debian testing will not be considered for inclusion in this repository.
Design
Branches and their meanings
The tpo/core/debian/tor repository uses many branches with slightly different
meanings/usage. Here' what the branches are used for:
debian-ci: contains only changes to the CI configuration file. Changes to CI are then merged into per-version branches as needed.debian-main: packaging for the nightly seriesdebian-0.x.y: packaging for all versions that start with 0.x.y. For example, the package0.4.8.15is expected to be prepared in the branchdebian-0.4.8.debian-lenny*anddebian-squeeze*: legacy, we shouldn't use those branches anymore.
Maintainer, users, and upstream
Packages
The following packages are available in the repository:
deb.torproject.org-keyring
- Maintainer: weasel
- Suites: all regular non-experimental suites
It contains the archive signing key.
tor
- Maintainer: weasel
- Suites: all regular suites, including experimental suites
Builds two binary packages: tor and tor-geoipdb.
Discussion
Other alternatives
You do not need to use deb.torproject.org to be able to make Debian packages available for installation using apt! You could instead host a Debian repository in your people.torproject.org webspace, or alongside releases at dist.torproject.org.