mirror of
https://github.com/portainer/portainer.git
synced 2025-07-24 15:59:41 +02:00
feat(telemetry): replace GA with matomo (#4140)
* feat(core/telemetry): add posthog * feat(core/telemetry): add posthog * feat(core/telemetry): add matomo * feat(core/telemetry): update matomo * feat(core/telemetry): update matomo * feat(core/telemetry): update matomo * feat(telemetry): remove google analytics code * refactor(telemetry): move matomo code to bundle * refactor(telemetry): move matomo lib to assets * refactor(telemetry): depreciate --no-analytics * feat(settings): introduce a setting to enable telemetry * fix(cli): fix typo * feat(settings): allow toggle telemetry from settings * fix(settings): handle case where AuthenticationMethod is missing * feat(admin): set telemetry on admin init * refactor(app); revert file * refactor(state-manager): move optout to state manager * feat(telemetry): set matomo url * feat(core/settings): minor UI update * feat(core/telemetry): update custom URL * feat(core/telemetry): add placeholder for privacy policy * feat(core/telemetry): add privacy policy link Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com>
This commit is contained in:
parent
7aaf9d0eb7
commit
2158cc5157
26 changed files with 2879 additions and 2605 deletions
|
@ -33,10 +33,11 @@ type settingsUpdatePayload struct {
|
|||
EdgeAgentCheckinInterval *int
|
||||
EnableEdgeComputeFeatures *bool
|
||||
UserSessionTimeout *string
|
||||
EnableTelemetry *bool
|
||||
}
|
||||
|
||||
func (payload *settingsUpdatePayload) Validate(r *http.Request) error {
|
||||
if *payload.AuthenticationMethod != 1 && *payload.AuthenticationMethod != 2 && *payload.AuthenticationMethod != 3 {
|
||||
if payload.AuthenticationMethod != nil && *payload.AuthenticationMethod != 1 && *payload.AuthenticationMethod != 2 && *payload.AuthenticationMethod != 3 {
|
||||
return errors.New("Invalid authentication method value. Value must be one of: 1 (internal), 2 (LDAP/AD) or 3 (OAuth)")
|
||||
}
|
||||
if payload.LogoURL != nil && *payload.LogoURL != "" && !govalidator.IsURL(*payload.LogoURL) {
|
||||
|
@ -164,6 +165,10 @@ func (handler *Handler) settingsUpdate(w http.ResponseWriter, r *http.Request) *
|
|||
settings.AllowDeviceMappingForRegularUsers = *payload.AllowDeviceMappingForRegularUsers
|
||||
}
|
||||
|
||||
if payload.EnableTelemetry != nil {
|
||||
settings.EnableTelemetry = *payload.EnableTelemetry
|
||||
}
|
||||
|
||||
tlsError := handler.updateTLS(settings)
|
||||
if tlsError != nil {
|
||||
return tlsError
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue