Skip to content

Commit

Permalink
fix: remove analytics (xbapps#1081)
Browse files Browse the repository at this point in the history
Co-authored-by: crwxaj <crwxaj>
  • Loading branch information
crwxaj authored Jan 3, 2023
1 parent 6126355 commit 7664881
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 185 deletions.
2 changes: 1 addition & 1 deletion .air.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ tmp_dir = 'dist'

[build]
cmd = 'go build -o dist/xbvr -tags="json1" main.go'
full_bin = 'DISABLE_ANALYTICS=1 DEBUG=1 ./dist/xbvr'
full_bin = 'DEBUG=1 ./dist/xbvr'
include_ext = ['go']
exclude_dir = ['node_modules', 'cache', 'dist', 'ui', 'tmp']
3 changes: 0 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ require (
github.com/go-openapi/spec v0.20.7
github.com/go-test/deep v1.0.8
github.com/gocolly/colly v1.2.0
github.com/google/uuid v1.3.0
github.com/gorilla/mux v1.8.0
github.com/gowww/log v1.0.0
github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79
Expand All @@ -44,7 +43,6 @@ require (
github.com/nleeper/goment v1.4.4
github.com/peterbourgon/diskv v2.0.1+incompatible
github.com/pkg/errors v0.9.1
github.com/posthog/posthog-go v0.0.0-20221122145026-61d15c329e94
github.com/putdotio/go-putio v1.7.0
github.com/robertkrimen/otto v0.0.0-20221025135307-511d75fba9f8
github.com/robfig/cron/v3 v3.0.1
Expand Down Expand Up @@ -136,7 +134,6 @@ require (
github.com/ulikunitz/xz v0.5.6 // indirect
github.com/willf/bitset v1.1.10 // indirect
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect
github.com/xtgo/uuid v0.0.0-20140804021211-a0b114877d4c // indirect
go.etcd.io/bbolt v1.3.5 // indirect
golang.org/x/image v0.0.0-20201208152932-35266b937fa6 // indirect
golang.org/x/term v0.2.0 // indirect
Expand Down
96 changes: 0 additions & 96 deletions go.sum

Large diffs are not rendered by default.

71 changes: 0 additions & 71 deletions pkg/analytics/analytics.go

This file was deleted.

15 changes: 7 additions & 8 deletions pkg/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,13 @@ var (
)

type EnvConfigSpec struct {
Debug bool `envconfig:"DEBUG" default:"false"`
DebugRequests bool `envconfig:"DEBUG_REQUESTS" default:"false"`
DebugSQL bool `envconfig:"DEBUG_SQL" default:"false"`
DebugWS bool `envconfig:"DEBUG_WS" default:"false"`
UIUsername string `envconfig:"UI_USERNAME" required:"false"`
UIPassword string `envconfig:"UI_PASSWORD" required:"false"`
DisableAnalytics bool `envconfig:"DISABLE_ANALYTICS" default:"true"`
DatabaseURL string `envconfig:"DATABASE_URL" required:"false" default:""`
Debug bool `envconfig:"DEBUG" default:"false"`
DebugRequests bool `envconfig:"DEBUG_REQUESTS" default:"false"`
DebugSQL bool `envconfig:"DEBUG_SQL" default:"false"`
DebugWS bool `envconfig:"DEBUG_WS" default:"false"`
UIUsername string `envconfig:"UI_USERNAME" required:"false"`
UIPassword string `envconfig:"UI_PASSWORD" required:"false"`
DatabaseURL string `envconfig:"DATABASE_URL" required:"false" default:""`
}

var EnvConfig EnvConfigSpec
Expand Down
3 changes: 0 additions & 3 deletions pkg/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"github.com/koding/websocketproxy"
"github.com/peterbourgon/diskv"
"github.com/rs/cors"
"github.com/xbapps/xbvr/pkg/analytics"
"github.com/xbapps/xbvr/pkg/api"
"github.com/xbapps/xbvr/pkg/common"
"github.com/xbapps/xbvr/pkg/config"
Expand Down Expand Up @@ -55,8 +54,6 @@ func StartServer(version, commit, branch, date string) {

// First setup
migrations.Migrate()
analytics.GenerateID()
analytics.Event("app-start", nil)

// Remove old locks
models.RemoveAllLocks()
Expand Down
3 changes: 0 additions & 3 deletions pkg/session/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import (
"strings"
"time"

"github.com/posthog/posthog-go"
"github.com/xbapps/xbvr/pkg/analytics"
"github.com/xbapps/xbvr/pkg/common"
"github.com/xbapps/xbvr/pkg/models"
)
Expand Down Expand Up @@ -140,7 +138,6 @@ func newWatchSession(sceneID uint) {
lastSessionID = obj.ID
currentSceneID = scene.ID

analytics.Event("watchsession-new", posthog.NewProperties().Set("scene-id", scene.SceneID))
common.Log.Infof("New session #%v for scene #%v from %v", lastSessionID, lastSessionSceneID, sessionSource)
}

Expand Down

0 comments on commit 7664881

Please sign in to comment.