privacy: Set vendor as FreedomBox for dpkg and popularity-contest

- This changes sets the default dpkg vendor as FreedomBox. 'Debian' is still the
parent of the vendor.

- This results in popcon setting the Vendor as FreedomBox. This allows measuring
the popular of FreedomBox distribution itself as against other Debian
derivatives in the section 'Statistics per distributions reporting to Debian' of
https://popcon.debian.org

Tests:

- Run `sudo ./setup.py install` and freedombox service. Privacy app will be
setup for the first time. In /etc/dpkg/origins/ the file default is a symlink
pointing to /etc/dpkg/origins/fredombox. Running 'sudo sh +x
/etc/cron.daily/popularity' runs successfully. Remove files
/var/lib/popularity-contest/lastsub /var/log/popularity-contest* if necessary.
The file /etc/log/popularity-contest shows VENDOR:FreedomBox in the first line.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa 2022-10-10 17:57:32 -07:00 committed by James Valleroy
parent 7e2ebcb743
commit 236ad3771a
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808
2 changed files with 11 additions and 0 deletions

View File

@ -0,0 +1,4 @@
Vendor: FreedomBox
Vendor-URL: https://freedombox.org/
Bugs: https://salsa.debian.org/freedombox-team/freedombox/-/issues/new
Parent: Debian

View File

@ -21,6 +21,13 @@ def setup():
aug.set('ENCRYPT', 'yes')
aug.save()
# Set the vendor to 'FreedomBox' with 'Debian' as parent
default_link = pathlib.Path('/etc/dpkg/origins/default')
debian_link = pathlib.Path('/etc/dpkg/origins/debian')
if default_link.is_symlink() and default_link.resolve() == debian_link:
default_link.unlink()
default_link.symlink_to('freedombox')
@privileged
def set_configuration(enable_popcon: Optional[bool] = None):