commit
5e44cb9a3d
7 changed files with 20 additions and 17 deletions
|
|
@ -34,7 +34,7 @@
|
|||
OpenReplay is a session replay stack that lets you see what users do on your web app, helping you troubleshoot issues faster. It's the only open-source alternative to products such as FullStory and LogRocket.
|
||||
|
||||
- **Session replay.** OpenReplay replays what users do, but not only. It also shows you what went under the hood, how your website or app behaves by capturing network activity, console logs, JS errors, store actions/state, page speed metrics, cpu/memory usage and much more.
|
||||
- **Low footprint**. With a ~16KB (.gz) tracker that asynchronously sends minimal data for a very limited impact on performance.
|
||||
- **Low footprint**. With a ~18KB (.gz) tracker that asynchronously sends minimal data for a very limited impact on performance.
|
||||
- **Self-hosted**. No more security compliance checks, 3rd-parties processing user data. Everything OpenReplay captures stays in your cloud for a complete control over your data.
|
||||
- **Privacy controls**. Fine-grained security features for sanitizing user data.
|
||||
- **Easy deploy**. With support of major public cloud providers (AWS, GCP, Azure, DigitalOcean).
|
||||
|
|
|
|||
|
|
@ -71,7 +71,8 @@ func ResolveCSS(baseURL string, css string) string {
|
|||
|
||||
func (r *Rewriter) RewriteCSS(sessionID uint64, baseurl string, css string) string {
|
||||
css = rewriteLinks(css, func(rawurl string) string {
|
||||
return r.RewriteURL(sessionID, baseurl, rawurl)
|
||||
url , _ := r.RewriteURL(sessionID, baseurl, rawurl)
|
||||
return url
|
||||
})
|
||||
return strings.Replace(css, ":hover", ".-asayer-hover", -1)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ func GetFullCachableURL(baseURL string, relativeURL string) (string, bool) {
|
|||
const OPENREPLAY_QUERY_START = "OPENREPLAY_QUERY"
|
||||
|
||||
func getCachePath(rawurl string) string {
|
||||
return strings.ReplaceAll(url.QueryEscape(rawurl), "%", "!") // s3 keys are ok with "!"
|
||||
return "/" + strings.ReplaceAll(url.QueryEscape(rawurl), "%", "!") // s3 keys are ok with "!"
|
||||
// u, _ := url.Parse(rawurl)
|
||||
// s := "/" + u.Scheme + "/" + u.Hostname() + u.Path
|
||||
// if u.RawQuery != "" {
|
||||
|
|
@ -82,14 +82,14 @@ func GetCachePathForAssets(sessionID uint64, rawurl string) string {
|
|||
}
|
||||
|
||||
|
||||
func (r *Rewriter) RewriteURL(sessionID uint64, baseURL string, relativeURL string) string {
|
||||
func (r *Rewriter) RewriteURL(sessionID uint64, baseURL string, relativeURL string) (string, bool) {
|
||||
// TODO: put it in one check within GetFullCachableURL
|
||||
if !isRelativeCachable(relativeURL) {
|
||||
return relativeURL
|
||||
return relativeURL, false
|
||||
}
|
||||
fullURL := ResolveURL(baseURL, relativeURL)
|
||||
if !isCachable(fullURL) {
|
||||
return relativeURL
|
||||
return relativeURL, false
|
||||
}
|
||||
|
||||
u := url.URL{
|
||||
|
|
@ -98,6 +98,6 @@ func (r *Rewriter) RewriteURL(sessionID uint64, baseURL string, relativeURL stri
|
|||
Scheme: r.assetsURL.Scheme,
|
||||
}
|
||||
|
||||
return u.String()
|
||||
return u.String(), true
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,8 +21,11 @@ func sendAssetsForCacheFromCSS(sessionID uint64, baseURL string, css string) {
|
|||
|
||||
func handleURL(sessionID uint64, baseURL string, url string) string {
|
||||
if cacheAssets {
|
||||
sendAssetForCache(sessionID, baseURL, url)
|
||||
return rewriter.RewriteURL(sessionID, baseURL, url)
|
||||
rewrittenURL, isCachable := rewriter.RewriteURL(sessionID, baseURL, url)
|
||||
if isCachable {
|
||||
sendAssetForCache(sessionID, baseURL, url)
|
||||
}
|
||||
return rewrittenURL
|
||||
}
|
||||
return assets.ResolveURL(baseURL, url)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -66,15 +66,15 @@ func startSessionHandlerWeb(w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
|
||||
dice := byte(rand.Intn(100)) // [0, 100)
|
||||
if dice >= p.SampleRate {
|
||||
responseWithError(w, http.StatusForbidden, errors.New("cancel"))
|
||||
return
|
||||
}
|
||||
|
||||
userUUID := getUUID(req.UserUUID)
|
||||
tokenData, err := tokenizer.Parse(req.Token)
|
||||
if err != nil || req.Reset { // Starting the new one
|
||||
dice := byte(rand.Intn(100)) // [0, 100)
|
||||
if dice >= p.SampleRate {
|
||||
responseWithError(w, http.StatusForbidden, errors.New("cancel"))
|
||||
return
|
||||
}
|
||||
|
||||
ua := uaParser.ParseFromHTTPRequest(r)
|
||||
if ua == nil {
|
||||
responseWithError(w, http.StatusForbidden, errors.New("browser not recognized"))
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ env:
|
|||
AWS_SECRET_ACCESS_KEY: "m1n10s3CretK3yPassw0rd"
|
||||
AWS_REGION: us-east-1
|
||||
POSTGRES_STRING: postgres://postgres:asayerPostgres@postgresql.db.svc.cluster.local:5432
|
||||
CACHE_ASSETS: true
|
||||
CACHE_ASSETS: false
|
||||
#
|
||||
REDIS_STRING: redis-master.db.svc.cluster.local:6379
|
||||
KAFKA_SERVERS: kafka.db.svc.cluster.local:9092
|
||||
|
|
|
|||
|
|
@ -43,4 +43,3 @@ env:
|
|||
KAFKA_SERVERS: kafka.db.svc.cluster.local:9092
|
||||
KAFKA_USE_SSL: false
|
||||
LICENSE_KEY: ""
|
||||
FS_CLEAN_HRS: 12
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue