From 236ad3771af40b6deb772c84e9dc8c1aa645356d Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Mon, 10 Oct 2022 17:57:32 -0700 Subject: [PATCH] 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 Reviewed-by: James Valleroy --- plinth/modules/privacy/data/etc/dpkg/origins/freedombox | 4 ++++ plinth/modules/privacy/privileged.py | 7 +++++++ 2 files changed, 11 insertions(+) create mode 100644 plinth/modules/privacy/data/etc/dpkg/origins/freedombox diff --git a/plinth/modules/privacy/data/etc/dpkg/origins/freedombox b/plinth/modules/privacy/data/etc/dpkg/origins/freedombox new file mode 100644 index 000000000..9f2810477 --- /dev/null +++ b/plinth/modules/privacy/data/etc/dpkg/origins/freedombox @@ -0,0 +1,4 @@ +Vendor: FreedomBox +Vendor-URL: https://freedombox.org/ +Bugs: https://salsa.debian.org/freedombox-team/freedombox/-/issues/new +Parent: Debian diff --git a/plinth/modules/privacy/privileged.py b/plinth/modules/privacy/privileged.py index e5a790276..04faff907 100644 --- a/plinth/modules/privacy/privileged.py +++ b/plinth/modules/privacy/privileged.py @@ -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):