Telemetry stub.

This is experimental, off-by-default, code for developing a telemetry /
tracking configuration module. It is preliminary work for issue #628,
but also for KDE Neon configuration. Any telemetry should conform to
the KDE Telemetry Policy [1] or similar Free Software telemetry policy
(e.g. the Mozilla one).

[1] https://community.kde.org/Policies/Telemetry_Policy

Initial idea is to distinguish three kinds of tracking:
 - installs. This tracks that OS <foo> has been installed somewhere.
   It might send some machine information to a remote server.
 - machines. This enables some kind of machine tracking in the

   installed system, for instance it could enable popcon on
   Debian, or periodic phone-home-pings.
 - users. This enables some kind of telemetry / tracking on the
   installed user in the system.

A simple and transparent setting is to enable install-tracking and set
it to opt-in, and disable machine and user tracking. Explain to the
user that <foo> would like to know when <foo> is installed, and that
the following information <d1>, <d2> will be sent to <url> in accordance
to the <foo> telemetry policy at <url2>.

Work in this branch is subject to VDG review for the visuals, and
privacy oversight by whatever group is responsible for <foo> privacy.

Note that this module makes it *possible* for telemetry configuration
to be visible inside the installer; what distro's do with telemetry
already is entirely outside the scope of this configuration module.
This commit is contained in:
Adriaan de Groot 2017-08-29 08:00:37 -04:00
parent 3799a26b3c
commit 1926399378
7 changed files with 389 additions and 0 deletions

View file

@ -0,0 +1,13 @@
calamares_add_plugin( tracking
TYPE viewmodule
EXPORT_MACRO PLUGINDLLEXPORT_PRO
SOURCES
TrackingViewStep.cpp
TrackingPage.cpp
UI
page_trackingstep.ui
LINK_PRIVATE_LIBRARIES
calamaresui
SHARED_LIB
)

View file

@ -0,0 +1,44 @@
/* === This file is part of Calamares - <http://github.com/calamares> ===
*
* Copyright 2017, Adriaan de Groot <groot@kde.org>
*
* Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Calamares is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
*/
#include "TrackingPage.h"
#include "ui_page_trackingstep.h"
#include "JobQueue.h"
#include "GlobalStorage.h"
#include "utils/Logger.h"
#include "utils/CalamaresUtilsGui.h"
#include "utils/Retranslator.h"
#include "ViewManager.h"
#include <QApplication>
#include <QBoxLayout>
#include <QDesktopServices>
#include <QFocusEvent>
#include <QLabel>
#include <QComboBox>
#include <QMessageBox>
TrackingPage::TrackingPage(QWidget *parent)
: QWidget( parent )
, ui( new Ui::TrackingPage )
{
ui->setupUi( this );
}

View file

@ -0,0 +1,40 @@
/* === This file is part of Calamares - <http://github.com/calamares> ===
*
* Copyright 2017, Adriaan de Groot <groot@kde.org>
*
* Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Calamares is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TRACKINGPAGE_H
#define TRACKINGPAGE_H
#include <QWidget>
#include <QUrl>
namespace Ui
{
class TrackingPage;
}
class TrackingPage : public QWidget
{
Q_OBJECT
public:
explicit TrackingPage( QWidget* parent = nullptr );
private:
Ui::TrackingPage* ui;
};
#endif //TRACKINGPAGE_H

View file

@ -0,0 +1,109 @@
/* === This file is part of Calamares - <http://github.com/calamares> ===
*
* Copyright 2017, Adriaan de Groot <groot@kde.org>
*
* Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Calamares is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
*/
#include "JobQueue.h"
#include "GlobalStorage.h"
#include "utils/Logger.h"
#include "TrackingViewStep.h"
#include "TrackingPage.h"
#include <QVariantMap>
CALAMARES_PLUGIN_FACTORY_DEFINITION( TrackingViewStepFactory, registerPlugin<TrackingViewStep>(); )
TrackingViewStep::TrackingViewStep( QObject* parent )
: Calamares::ViewStep( parent )
, m_widget( new TrackingPage )
{
emit nextStatusChanged( false );
}
TrackingViewStep::~TrackingViewStep()
{
if ( m_widget && m_widget->parent() == nullptr )
m_widget->deleteLater();
}
QString
TrackingViewStep::prettyName() const
{
return tr( "Telemetry and Tracking" );
}
QWidget*
TrackingViewStep::widget()
{
return m_widget;
}
void
TrackingViewStep::next()
{
emit done();
}
void
TrackingViewStep::back()
{}
bool
TrackingViewStep::isNextEnabled() const
{
// return m_widget->isNextEnabled();
return false;
}
bool
TrackingViewStep::isBackEnabled() const
{
return true;
}
bool
TrackingViewStep::isAtBeginning() const
{
return true;
}
bool
TrackingViewStep::isAtEnd() const
{
return true;
}
QList< Calamares::job_ptr >
TrackingViewStep::jobs() const
{
return QList< Calamares::job_ptr >();
}
void
TrackingViewStep::setConfigurationMap( const QVariantMap& configurationMap )
{
}

View file

@ -0,0 +1,63 @@
/* === This file is part of Calamares - <http://github.com/calamares> ===
*
* Copyright 2017, Adriaan de Groot <groot@kde..org>
*
* Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Calamares is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TRACKINGVIEWSTEP_H
#define TRACKINGVIEWSTEP_H
#include <utils/PluginFactory.h>
#include <viewpages/ViewStep.h>
#include <PluginDllMacro.h>
#include <QObject>
#include <QUrl>
#include <QVariantMap>
class TrackingPage;
class PLUGINDLLEXPORT TrackingViewStep : public Calamares::ViewStep
{
Q_OBJECT
public:
explicit TrackingViewStep( QObject* parent = nullptr );
virtual ~TrackingViewStep();
QString prettyName() const override;
QWidget* widget() override;
void next() override;
void back() override;
bool isNextEnabled() const override;
bool isBackEnabled() const override;
bool isAtBeginning() const override;
bool isAtEnd() const override;
QList< Calamares::job_ptr > jobs() const override;
void setConfigurationMap( const QVariantMap& configurationMap ) override;
private:
TrackingPage* m_widget;
};
CALAMARES_PLUGIN_FACTORY_DECLARATION( TrackingViewStepFactory )
#endif // TRACKINGVIEWSTEP_H

View file

@ -0,0 +1,106 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>TrackingPage</class>
<widget class="QWidget" name="TrackingPage">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>799</width>
<height>400</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<layout class="QVBoxLayout" name="verticalLayout" stretch="0,0,0">
<item>
<widget class="QGroupBox" name="installTrackingBox">
<property name="title">
<string>Install Tracking</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Explanation of install-tracking.</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox">
<property name="text">
<string>Enable install-tracking</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="machineTrackingBox">
<property name="title">
<string>Machine Tracking</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_7">
<item>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Explanation of machine-tracking.</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_2">
<property name="text">
<string>Enable machine-tracking</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="UserTrackingBox">
<property name="title">
<string>User Tracking</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_6">
<item>
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>Explanation of user-tracking.</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_3">
<property name="text">
<string>Enable user-tracking</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View file

@ -0,0 +1,14 @@
---
machine:
- tracking: false
- style: neon
- path: /etc/machine-file
user:
- tracking: false
- style: neon
install:
- tracking: false
- style: neon