feat(analytics): remove setting for collection analytics [BE-12402] (#1559)
This commit is contained in:
@@ -17,7 +17,7 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
jsonobject = `{"LogoURL":"","BlackListedLabels":[],"AuthenticationMethod":1,"InternalAuthSettings": {"RequiredPasswordLength": 12}"LDAPSettings":{"AnonymousMode":true,"ReaderDN":"","URL":"","TLSConfig":{"TLS":false,"TLSSkipVerify":false},"StartTLS":false,"SearchSettings":[{"BaseDN":"","Filter":"","UserNameAttribute":""}],"GroupSearchSettings":[{"GroupBaseDN":"","GroupFilter":"","GroupAttribute":""}],"AutoCreateUsers":true},"OAuthSettings":{"ClientID":"","AccessTokenURI":"","AuthorizationURI":"","ResourceURI":"","RedirectURI":"","UserIdentifier":"","Scopes":"","OAuthAutoCreateUsers":false,"DefaultTeamID":0,"SSO":true,"LogoutURI":"","KubeSecretKey":"j0zLVtY/lAWBk62ByyF0uP80SOXaitsABP0TTJX8MhI="},"OpenAMTConfiguration":{"Enabled":false,"MPSServer":"","MPSUser":"","MPSPassword":"","MPSToken":"","CertFileContent":"","CertFileName":"","CertFilePassword":"","DomainName":""},"FeatureFlagSettings":{},"SnapshotInterval":"5m","TemplatesURL":"https://raw.githubusercontent.com/portainer/templates/master/templates-2.0.json","EdgeAgentCheckinInterval":5,"EnableEdgeComputeFeatures":false,"UserSessionTimeout":"8h","KubeconfigExpiry":"0","EnableTelemetry":true,"HelmRepositoryURL":"https://charts.bitnami.com/bitnami","KubectlShellImage":"portainer/kubectl-shell","DisplayDonationHeader":false,"DisplayExternalContributors":false,"EnableHostManagementFeatures":false,"AllowVolumeBrowserForRegularUsers":false,"AllowBindMountsForRegularUsers":false,"AllowPrivilegedModeForRegularUsers":false,"AllowHostNamespaceForRegularUsers":false,"AllowStackManagementForRegularUsers":false,"AllowDeviceMappingForRegularUsers":false,"AllowContainerCapabilitiesForRegularUsers":false}`
|
||||
jsonobject = `{"LogoURL":"","BlackListedLabels":[],"AuthenticationMethod":1,"InternalAuthSettings": {"RequiredPasswordLength": 12}"LDAPSettings":{"AnonymousMode":true,"ReaderDN":"","URL":"","TLSConfig":{"TLS":false,"TLSSkipVerify":false},"StartTLS":false,"SearchSettings":[{"BaseDN":"","Filter":"","UserNameAttribute":""}],"GroupSearchSettings":[{"GroupBaseDN":"","GroupFilter":"","GroupAttribute":""}],"AutoCreateUsers":true},"OAuthSettings":{"ClientID":"","AccessTokenURI":"","AuthorizationURI":"","ResourceURI":"","RedirectURI":"","UserIdentifier":"","Scopes":"","OAuthAutoCreateUsers":false,"DefaultTeamID":0,"SSO":true,"LogoutURI":"","KubeSecretKey":"j0zLVtY/lAWBk62ByyF0uP80SOXaitsABP0TTJX8MhI="},"OpenAMTConfiguration":{"Enabled":false,"MPSServer":"","MPSUser":"","MPSPassword":"","MPSToken":"","CertFileContent":"","CertFileName":"","CertFilePassword":"","DomainName":""},"FeatureFlagSettings":{},"SnapshotInterval":"5m","TemplatesURL":"https://raw.githubusercontent.com/portainer/templates/master/templates-2.0.json","EdgeAgentCheckinInterval":5,"EnableEdgeComputeFeatures":false,"UserSessionTimeout":"8h","KubeconfigExpiry":"0","HelmRepositoryURL":"https://charts.bitnami.com/bitnami","KubectlShellImage":"portainer/kubectl-shell","DisplayDonationHeader":false,"DisplayExternalContributors":false,"EnableHostManagementFeatures":false,"AllowVolumeBrowserForRegularUsers":false,"AllowBindMountsForRegularUsers":false,"AllowPrivilegedModeForRegularUsers":false,"AllowHostNamespaceForRegularUsers":false,"AllowStackManagementForRegularUsers":false,"AllowDeviceMappingForRegularUsers":false,"AllowContainerCapabilitiesForRegularUsers":false}`
|
||||
passphrase = "my secret key"
|
||||
)
|
||||
|
||||
|
||||
@@ -31,7 +31,6 @@ func (store *Store) checkOrCreateDefaultSettings() error {
|
||||
settings, err := store.SettingsService.Settings()
|
||||
if store.IsErrObjectNotFound(err) {
|
||||
defaultSettings := &portainer.Settings{
|
||||
EnableTelemetry: false,
|
||||
AuthenticationMethod: portainer.AuthenticationInternal,
|
||||
BlackListedLabels: make([]portainer.Pair, 0),
|
||||
InternalAuthSettings: portainer.InternalAuthSettings{
|
||||
|
||||
@@ -21,7 +21,6 @@ func (m *Migrator) updateSettingsToDB25() error {
|
||||
}
|
||||
|
||||
legacySettings.UserSessionTimeout = portainer.DefaultUserSessionTimeout
|
||||
legacySettings.EnableTelemetry = true
|
||||
|
||||
legacySettings.AllowContainerCapabilitiesForRegularUsers = true
|
||||
|
||||
|
||||
@@ -603,7 +603,6 @@
|
||||
"EdgeAgentCheckinInterval": 5,
|
||||
"EdgePortainerUrl": "",
|
||||
"EnableEdgeComputeFeatures": false,
|
||||
"EnableTelemetry": true,
|
||||
"EnforceEdgeID": false,
|
||||
"FeatureFlagSettings": null,
|
||||
"GlobalDeploymentOptions": {
|
||||
|
||||
@@ -27,8 +27,6 @@ type publicSettingsResponse struct {
|
||||
OAuthLoginURI string `json:"OAuthLoginURI" example:"https://gitlab.com/oauth"`
|
||||
// The URL used for oauth logout
|
||||
OAuthLogoutURI string `json:"OAuthLogoutURI" example:"https://gitlab.com/oauth/logout"`
|
||||
// Whether telemetry is enabled
|
||||
EnableTelemetry bool `json:"EnableTelemetry" example:"true"`
|
||||
// The expiry of a Kubeconfig
|
||||
KubeconfigExpiry string `example:"24h" default:"0"`
|
||||
// Whether team sync is enabled
|
||||
@@ -78,7 +76,6 @@ func generatePublicSettings(appSettings *portainer.Settings) *publicSettingsResp
|
||||
RequiredPasswordLength: appSettings.InternalAuthSettings.RequiredPasswordLength,
|
||||
EnableEdgeComputeFeatures: appSettings.EnableEdgeComputeFeatures,
|
||||
GlobalDeploymentOptions: appSettings.GlobalDeploymentOptions,
|
||||
EnableTelemetry: appSettings.EnableTelemetry,
|
||||
KubeconfigExpiry: appSettings.KubeconfigExpiry,
|
||||
Features: featureflags.FeatureFlags(),
|
||||
IsAMTEnabled: appSettings.EnableEdgeComputeFeatures && appSettings.OpenAMTConfiguration.Enabled,
|
||||
|
||||
@@ -43,8 +43,6 @@ type settingsUpdatePayload struct {
|
||||
UserSessionTimeout *string `example:"5m"`
|
||||
// The expiry of a Kubeconfig
|
||||
KubeconfigExpiry *string `example:"24h" default:"0"`
|
||||
// Whether telemetry is enabled
|
||||
EnableTelemetry *bool `example:"false"`
|
||||
// Helm repository URL
|
||||
HelmRepositoryURL *string `example:"https://charts.bitnami.com/bitnami"`
|
||||
// Kubectl Shell Image
|
||||
@@ -222,8 +220,6 @@ func (handler *Handler) updateSettings(tx dataservices.DataStoreTx, payload sett
|
||||
handler.JWTService.SetUserSessionDuration(userSessionDuration)
|
||||
}
|
||||
|
||||
settings.EnableTelemetry = *cmp.Or(payload.EnableTelemetry, &settings.EnableTelemetry)
|
||||
|
||||
if err := handler.updateTLS(settings); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -1091,8 +1091,6 @@ type (
|
||||
UserSessionTimeout string `json:"UserSessionTimeout" example:"5m"`
|
||||
// The expiry of a Kubeconfig
|
||||
KubeconfigExpiry string `json:"KubeconfigExpiry" example:"24h"`
|
||||
// Whether telemetry is enabled
|
||||
EnableTelemetry bool `json:"EnableTelemetry" example:"false"`
|
||||
// Helm repository URL, defaults to "https://charts.bitnami.com/bitnami"
|
||||
HelmRepositoryURL string `json:"HelmRepositoryURL" example:"https://charts.bitnami.com/bitnami"`
|
||||
// KubectlImage, defaults to portainer/kubectl-shell
|
||||
|
||||
@@ -12,7 +12,6 @@ export function SettingsViewModel(data) {
|
||||
this.EnableEdgeComputeFeatures = data.EnableEdgeComputeFeatures;
|
||||
this.FeatureFlagSettings = data.FeatureFlagSettings;
|
||||
this.UserSessionTimeout = data.UserSessionTimeout;
|
||||
this.EnableTelemetry = data.EnableTelemetry;
|
||||
this.KubeconfigExpiry = data.KubeconfigExpiry;
|
||||
this.HelmRepositoryURL = data.HelmRepositoryURL;
|
||||
this.TrustOnFirstConnect = data.TrustOnFirstConnect;
|
||||
@@ -29,7 +28,6 @@ export function PublicSettingsViewModel(settings) {
|
||||
this.EnforceEdgeID = settings.EnforceEdgeID;
|
||||
this.LogoURL = settings.LogoURL;
|
||||
this.OAuthLoginURI = settings.OAuthLoginURI;
|
||||
this.EnableTelemetry = settings.EnableTelemetry;
|
||||
this.OAuthLogoutURI = settings.OAuthLogoutURI;
|
||||
this.KubeconfigExpiry = settings.KubeconfigExpiry;
|
||||
this.Features = settings.Features;
|
||||
|
||||
@@ -87,17 +87,11 @@ function StateManagerFactory($async, $q, SystemService, InfoHelper, LocalStorage
|
||||
LocalStorage.storeApplicationState(state.application);
|
||||
};
|
||||
|
||||
manager.updateEnableTelemetry = function updateEnableTelemetry(enableTelemetry) {
|
||||
state.application.enableTelemetry = enableTelemetry;
|
||||
LocalStorage.storeApplicationState(state.application);
|
||||
};
|
||||
|
||||
function assignStateFromStatusAndSettings(status, settings) {
|
||||
state.application.version = status.Version;
|
||||
state.application.edition = status.Edition;
|
||||
state.application.instanceId = status.InstanceID;
|
||||
|
||||
state.application.enableTelemetry = settings.EnableTelemetry;
|
||||
state.application.logo = settings.LogoURL;
|
||||
state.application.snapshotInterval = settings.SnapshotInterval;
|
||||
state.application.enableEdgeComputeFeatures = settings.EnableEdgeComputeFeatures;
|
||||
|
||||
@@ -4,7 +4,6 @@ export interface StateManager {
|
||||
updateEndpointState(endpoint: Environment): Promise<void>;
|
||||
updateLogo(logo: string): void;
|
||||
updateSnapshotInterval(interval: string): void;
|
||||
updateEnableTelemetry(enable: boolean): void;
|
||||
}
|
||||
|
||||
export interface IAuthenticationService {
|
||||
|
||||
@@ -92,17 +92,6 @@
|
||||
</div>
|
||||
</div>
|
||||
<!-- !actions -->
|
||||
<!-- enableTelemetry-->
|
||||
<div class="form-group">
|
||||
<div class="col-sm-12 vertical-center">
|
||||
<input type="checkbox" name="toggle_enableTelemetry" ng-model="formValues.enableTelemetry" data-cy="init-enableTelemetry" />
|
||||
<span class="text-muted small"
|
||||
>Allow collection of anonymous statistics. You can find more information about this in our
|
||||
<a class="hyperlink" href="{{ privacyPolicyUrl }}" target="_blank">privacy policy</a>.</span
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
<!-- !enableTelemetry-->
|
||||
</form>
|
||||
<!-- !init password form -->
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { getEnvironments } from '@/react/portainer/environments/environment.service';
|
||||
import { restoreOptions } from '@/react/portainer/init/InitAdminView/restore-options';
|
||||
import { privacyPolicyUrl } from '@/react/portainer/settings/SettingsView/ApplicationSettingsPanel/EnableTelemetryField';
|
||||
|
||||
angular.module('portainer.app').controller('InitAdminController', [
|
||||
'$scope',
|
||||
@@ -15,8 +14,6 @@ angular.module('portainer.app').controller('InitAdminController', [
|
||||
function ($scope, $state, Notifications, Authentication, StateManager, SettingsService, UserService, BackupService, StatusService) {
|
||||
$scope.restoreOptions = restoreOptions;
|
||||
|
||||
$scope.privacyPolicyUrl = privacyPolicyUrl;
|
||||
|
||||
$scope.uploadBackup = uploadBackup;
|
||||
|
||||
$scope.logo = StateManager.getState().application.logo;
|
||||
@@ -26,7 +23,6 @@ angular.module('portainer.app').controller('InitAdminController', [
|
||||
Username: 'admin',
|
||||
Password: '',
|
||||
ConfirmPassword: '',
|
||||
enableTelemetry: process.env.NODE_ENV === 'production',
|
||||
restoreFormType: $scope.RESTORE_FORM_TYPES.FILE,
|
||||
};
|
||||
|
||||
@@ -59,9 +55,6 @@ angular.module('portainer.app').controller('InitAdminController', [
|
||||
.then(function success() {
|
||||
return Authentication.login(username, password);
|
||||
})
|
||||
.then(function success() {
|
||||
return SettingsService.update({ enableTelemetry: $scope.formValues.enableTelemetry });
|
||||
})
|
||||
.then(() => {
|
||||
return StateManager.initialize();
|
||||
})
|
||||
|
||||
@@ -17,7 +17,6 @@ import { Values } from './types';
|
||||
import { LogoFieldset } from './LogoFieldset';
|
||||
import { ScreenBannerFieldset } from './ScreenBannerFieldset';
|
||||
import { TemplatesUrlSection } from './TemplatesUrlSection';
|
||||
import { EnableTelemetryField } from './EnableTelemetryField';
|
||||
|
||||
export function ApplicationSettingsPanel({
|
||||
onSuccess,
|
||||
@@ -30,7 +29,6 @@ export function ApplicationSettingsPanel({
|
||||
|
||||
const initialValues: Values = {
|
||||
edgeAgentCheckinInterval: settings.EdgeAgentCheckinInterval,
|
||||
enableTelemetry: settings.EnableTelemetry,
|
||||
loginBannerEnabled: !!settings.CustomLoginBanner,
|
||||
loginBanner: settings.CustomLoginBanner,
|
||||
logoEnabled: !!settings.LogoURL,
|
||||
@@ -60,7 +58,6 @@ export function ApplicationSettingsPanel({
|
||||
{
|
||||
SnapshotInterval: values.snapshotInterval,
|
||||
LogoURL: values.logo,
|
||||
EnableTelemetry: values.enableTelemetry,
|
||||
CustomLoginBanner: values.loginBanner,
|
||||
TemplatesURL: values.templatesUrl,
|
||||
EdgeAgentCheckinInterval: values.edgeAgentCheckinInterval,
|
||||
@@ -103,8 +100,6 @@ function InnerForm({ isLoading }: { isLoading: boolean }) {
|
||||
|
||||
<LogoFieldset />
|
||||
|
||||
<EnableTelemetryField />
|
||||
|
||||
<ScreenBannerFieldset />
|
||||
|
||||
<TemplatesUrlSection />
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
import { useField } from 'formik';
|
||||
|
||||
import { SwitchField } from '@@/form-components/SwitchField';
|
||||
|
||||
export const privacyPolicyUrl = 'https://www.portainer.io/legal/privacy-policy';
|
||||
|
||||
export function EnableTelemetryField() {
|
||||
const [{ value }, , { setValue }] = useField<boolean>('enableTelemetry');
|
||||
|
||||
return (
|
||||
<div className="form-group">
|
||||
<div className="col-sm-12">
|
||||
<SwitchField
|
||||
labelClass="col-sm-3 col-lg-2"
|
||||
data-cy="settings-enable-telemetry-switch"
|
||||
label="Allow the collection of anonymous statistics"
|
||||
checked={value}
|
||||
name="toggle_enableTelemetry"
|
||||
onChange={(checked) => setValue(checked)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="col-sm-12 text-muted small mt-2">
|
||||
You can find more information about this in our{' '}
|
||||
<a href={privacyPolicyUrl} target="_blank" rel="noreferrer">
|
||||
privacy policy
|
||||
</a>
|
||||
.
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
export interface Values {
|
||||
snapshotInterval: string;
|
||||
edgeAgentCheckinInterval: number;
|
||||
enableTelemetry: boolean;
|
||||
loginBanner: string;
|
||||
loginBannerEnabled: boolean;
|
||||
logo: string;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { SchemaOf, bool, boolean, number, object, string } from 'yup';
|
||||
import { SchemaOf, boolean, number, object, string } from 'yup';
|
||||
|
||||
import { isValidUrl } from '@@/form-components/validate-url';
|
||||
|
||||
@@ -7,7 +7,6 @@ import { Values } from './types';
|
||||
export function validation(): SchemaOf<Values> {
|
||||
return object({
|
||||
edgeAgentCheckinInterval: number().required(),
|
||||
enableTelemetry: bool().default(false),
|
||||
loginBannerEnabled: boolean().default(false),
|
||||
loginBanner: string()
|
||||
.default('')
|
||||
|
||||
@@ -16,7 +16,6 @@ describe('SettingsView', () => {
|
||||
HttpResponse.json({
|
||||
LogoURL: '',
|
||||
SnapshotInterval: '5m',
|
||||
EnableTelemetry: false,
|
||||
})
|
||||
)
|
||||
);
|
||||
|
||||
@@ -69,7 +69,6 @@ function handleSuccess(settings: Settings) {
|
||||
/* @ngInject */ (StateManager: StateManager) => {
|
||||
StateManager?.updateLogo(settings.LogoURL);
|
||||
StateManager?.updateSnapshotInterval(settings.SnapshotInterval);
|
||||
StateManager?.updateEnableTelemetry(settings.EnableTelemetry);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@@ -116,7 +116,6 @@ export interface Settings {
|
||||
EnableEdgeComputeFeatures: boolean;
|
||||
UserSessionTimeout: string;
|
||||
KubeconfigExpiry: string;
|
||||
EnableTelemetry: boolean;
|
||||
HelmRepositoryURL: string;
|
||||
KubectlShellImage: string;
|
||||
TrustOnFirstConnect: boolean;
|
||||
@@ -185,8 +184,6 @@ export interface PublicSettingsResponse {
|
||||
OAuthLogoutURI: string;
|
||||
/** Whether portainer internal auth view will be hidden (only on BE) */
|
||||
OAuthHideInternalAuth: boolean;
|
||||
/** Whether telemetry is enabled */
|
||||
EnableTelemetry: boolean;
|
||||
/** The expiry of a Kubeconfig */
|
||||
KubeconfigExpiry: string;
|
||||
/** Whether team sync is enabled */
|
||||
|
||||
Reference in New Issue
Block a user