mirror of
https://github.com/muety/wakapi.git
synced 2023-08-10 21:12:56 +03:00
Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
ed35e7b82d | |||
b672859021 | |||
d3713017e3 | |||
dca736752e | |||
337b39481b | |||
b9ea6530f9 | |||
a9739a6db0 |
4
.gitignore
vendored
4
.gitignore
vendored
@ -8,3 +8,7 @@ build
|
||||
config*.yml
|
||||
!config.default.yml
|
||||
pkged.go
|
||||
package.json
|
||||
yarn.lock
|
||||
package-lock.json
|
||||
node_modules
|
13
README.md
13
README.md
@ -256,13 +256,22 @@ However, if you want to expose your wakapi instance to the public anyway, you ne
|
||||
CGO_FLAGS="-g -O2 -Wno-return-local-addr" go test -json -coverprofile=coverage/coverage.out ./... -run ./...
|
||||
```
|
||||
|
||||
### Building Tailwind
|
||||
To keep things minimal, Wakapi does not contain a `package.json`, `node_modules` or any sort of frontend build step. Instead, all JS and CSS assets are included as static files and checked in to Git. This way we can avoid requiring NodeJS to build Wakapi. However, for [TailwindCSS](https://tailwindcss.com/docs/installation#building-for-production) it makes sense to run it through a "build" step to benefit from purging and significantly reduce it in size. To only require this at the time of development, the compiled asset is checked in to Git as well.
|
||||
### Building web assets
|
||||
To keep things minimal, Wakapi does not contain a `package.json`, `node_modules` or any sort of frontend build step. Instead, all JS and CSS assets are included as static files and checked in to Git. This way we can avoid requiring NodeJS to build Wakapi. However, for [TailwindCSS](https://tailwindcss.com/docs/installation#building-for-production) it makes sense to run it through a "build" step to benefit from purging and significantly reduce it in size. To only require this at the time of development, the compiled asset is checked in to Git as well. Similarly, [Iconify](https://iconify.design/docs/icon-bundles/) bundles are also created at development time and checked in to the repo.
|
||||
|
||||
#### TailwindCSS
|
||||
```bash
|
||||
$ tailwindcss-cli build static/assets/vendor/tailwind.css -o static/assets/vendor/tailwind.dist.css
|
||||
```
|
||||
|
||||
#### Iconify
|
||||
```bash
|
||||
$ yarn add -D @iconify/json-tools @iconify/json
|
||||
$ node scripts/bundle_icons.js
|
||||
```
|
||||
|
||||
New icons can be added by editing the `icons` array in [scripts/bundle_icons.js](scripts/bundle_icons.js).
|
||||
|
||||
## 🙏 Support
|
||||
If you like this project, please consider supporting it 🙂. You can donate either through [buying me a coffee](https://buymeacoff.ee/n1try) or becoming a GitHub sponsor. Every little donation is highly appreciated and boosts the developers' motivation to keep improving Wakapi!
|
||||
|
||||
|
@ -4,6 +4,7 @@ import (
|
||||
"encoding/json"
|
||||
"flag"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"os"
|
||||
"strings"
|
||||
@ -59,6 +60,7 @@ var emailProviders = []string{
|
||||
|
||||
var cfg *Config
|
||||
var cFlag = flag.String("config", defaultConfigPath, "config file location")
|
||||
var env string
|
||||
|
||||
type appConfig struct {
|
||||
AggregationTime string `yaml:"aggregation_time" default:"02:15" env:"WAKAPI_AGGREGATION_TIME"`
|
||||
@ -287,8 +289,14 @@ func readColors() map[string]map[string]string {
|
||||
// Extracted from Wakatime website with XPath (see below) and did a bit of regex magic after.
|
||||
// – $x('//span[@class="editor-icon tip"]/@data-original-title').map(e => e.nodeValue)
|
||||
// – $x('//span[@class="editor-icon tip"]/div[1]/text()').map(e => e.nodeValue)
|
||||
|
||||
raw := data.ColorsFile
|
||||
if IsDev(env) {
|
||||
raw, _ = ioutil.ReadFile("data/colors.json")
|
||||
}
|
||||
|
||||
var colors = make(map[string]map[string]string)
|
||||
if err := json.Unmarshal(data.ColorsFile, &colors); err != nil {
|
||||
if err := json.Unmarshal(raw, &colors); err != nil {
|
||||
logbuch.Fatal(err.Error())
|
||||
}
|
||||
|
||||
@ -335,6 +343,7 @@ func Load(version string) *Config {
|
||||
logbuch.Fatal("failed to read config: %v", err)
|
||||
}
|
||||
|
||||
env = config.Env
|
||||
config.Version = strings.TrimSpace(version)
|
||||
config.App.Colors = readColors()
|
||||
config.Db.Dialect = resolveDbDialect(config.Db.Type)
|
||||
|
14
config/fs.go
Normal file
14
config/fs.go
Normal file
@ -0,0 +1,14 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"io/fs"
|
||||
"os"
|
||||
)
|
||||
|
||||
// ChooseFS returns a local (DirFS) file system when on 'dev' environment and the given go-embed file system otherwise
|
||||
func ChooseFS(localDir string, embeddedFS fs.FS) fs.FS {
|
||||
if Get().IsDev() {
|
||||
return os.DirFS(localDir)
|
||||
}
|
||||
return embeddedFS
|
||||
}
|
111
config/sentry.go
111
config/sentry.go
@ -4,22 +4,100 @@ import (
|
||||
"github.com/emvi/logbuch"
|
||||
"github.com/getsentry/sentry-go"
|
||||
"github.com/muety/wakapi/models"
|
||||
"io"
|
||||
"net/http"
|
||||
"os"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type SentryErrorWriter struct{}
|
||||
// How to: Logging
|
||||
// Use logbuch.[Debug|Info|Warn|Error|Fatal]() by default
|
||||
// Use config.Log().[Debug|Info|Warn|Error|Fatal]() when wanting the log to appear in Sentry as well
|
||||
|
||||
// TODO: extend sentry error logging to include context and stacktrace
|
||||
// see https://github.com/muety/wakapi/issues/169
|
||||
func (s *SentryErrorWriter) Write(p []byte) (n int, err error) {
|
||||
sentry.CaptureMessage(string(p))
|
||||
return os.Stderr.Write(p)
|
||||
type capturingWriter struct {
|
||||
Writer io.Writer
|
||||
Message string
|
||||
}
|
||||
|
||||
func init() {
|
||||
logbuch.SetOutput(os.Stdout, &SentryErrorWriter{})
|
||||
func (c *capturingWriter) Clear() {
|
||||
c.Message = ""
|
||||
}
|
||||
|
||||
func (c *capturingWriter) Write(p []byte) (n int, err error) {
|
||||
c.Message = string(p)
|
||||
return c.Writer.Write(p)
|
||||
}
|
||||
|
||||
// SentryWrapperLogger is a wrapper around a logbuch.Logger that forwards events to Sentry in addition and optionally allows to attach a request context
|
||||
type SentryWrapperLogger struct {
|
||||
*logbuch.Logger
|
||||
req *http.Request
|
||||
outWriter *capturingWriter
|
||||
errWriter *capturingWriter
|
||||
}
|
||||
|
||||
func Log() *SentryWrapperLogger {
|
||||
ow, ew := &capturingWriter{Writer: os.Stdout}, &capturingWriter{Writer: os.Stderr}
|
||||
return &SentryWrapperLogger{
|
||||
Logger: logbuch.NewLogger(ow, ew),
|
||||
outWriter: ow,
|
||||
errWriter: ew,
|
||||
}
|
||||
}
|
||||
|
||||
func (l *SentryWrapperLogger) Request(req *http.Request) *SentryWrapperLogger {
|
||||
l.req = req
|
||||
return l
|
||||
}
|
||||
|
||||
func (l *SentryWrapperLogger) Debug(msg string, params ...interface{}) {
|
||||
l.outWriter.Clear()
|
||||
l.Logger.Debug(msg, params...)
|
||||
l.log(l.errWriter.Message, sentry.LevelDebug)
|
||||
}
|
||||
|
||||
func (l *SentryWrapperLogger) Info(msg string, params ...interface{}) {
|
||||
l.outWriter.Clear()
|
||||
l.Logger.Info(msg, params...)
|
||||
l.log(l.errWriter.Message, sentry.LevelInfo)
|
||||
}
|
||||
|
||||
func (l *SentryWrapperLogger) Warn(msg string, params ...interface{}) {
|
||||
l.outWriter.Clear()
|
||||
l.Logger.Warn(msg, params...)
|
||||
l.log(l.errWriter.Message, sentry.LevelWarning)
|
||||
}
|
||||
|
||||
func (l *SentryWrapperLogger) Error(msg string, params ...interface{}) {
|
||||
l.errWriter.Clear()
|
||||
l.Logger.Error(msg, params...)
|
||||
l.log(l.errWriter.Message, sentry.LevelError)
|
||||
}
|
||||
|
||||
func (l *SentryWrapperLogger) Fatal(msg string, params ...interface{}) {
|
||||
l.errWriter.Clear()
|
||||
l.Logger.Fatal(msg, params...)
|
||||
l.log(l.errWriter.Message, sentry.LevelFatal)
|
||||
}
|
||||
|
||||
func (l *SentryWrapperLogger) log(msg string, level sentry.Level) {
|
||||
event := sentry.NewEvent()
|
||||
event.Level = level
|
||||
event.Message = msg
|
||||
|
||||
if l.req != nil {
|
||||
if h := l.req.Context().Value(sentry.HubContextKey); h != nil {
|
||||
hub := h.(*sentry.Hub)
|
||||
hub.Scope().SetRequest(l.req)
|
||||
if u := getPrincipal(l.req); u != nil {
|
||||
hub.Scope().SetUser(sentry.User{ID: u.ID})
|
||||
}
|
||||
hub.CaptureEvent(event)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
sentry.CaptureEvent(event)
|
||||
}
|
||||
|
||||
func initSentry(config sentryConfig, debug bool) {
|
||||
@ -43,13 +121,10 @@ func initSentry(config sentryConfig, debug bool) {
|
||||
return sentry.UniformTracesSampler(config.SampleRate).Sample(ctx)
|
||||
}),
|
||||
BeforeSend: func(event *sentry.Event, hint *sentry.EventHint) *sentry.Event {
|
||||
type principalGetter interface {
|
||||
GetPrincipal() *models.User
|
||||
}
|
||||
if hint.Context != nil {
|
||||
if req, ok := hint.Context.Value(sentry.RequestContextKey).(*http.Request); ok {
|
||||
if p := req.Context().Value("principal"); p != nil {
|
||||
event.User.ID = p.(principalGetter).GetPrincipal().ID
|
||||
if u := getPrincipal(req); u != nil {
|
||||
event.User.ID = u.ID
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -59,3 +134,13 @@ func initSentry(config sentryConfig, debug bool) {
|
||||
logbuch.Fatal("failed to initialized sentry – %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func getPrincipal(r *http.Request) *models.User {
|
||||
type principalGetter interface {
|
||||
GetPrincipal() *models.User
|
||||
}
|
||||
if p := r.Context().Value("principal"); p != nil {
|
||||
return p.(principalGetter).GetPrincipal()
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
@ -16,16 +16,6 @@ github.com/muety/wakapi/models/heartbeat.go:67.37,83.2 1 0
|
||||
github.com/muety/wakapi/models/heartbeat.go:91.41,93.16 2 0
|
||||
github.com/muety/wakapi/models/heartbeat.go:96.2,97.10 2 0
|
||||
github.com/muety/wakapi/models/heartbeat.go:93.16,95.3 1 0
|
||||
github.com/muety/wakapi/models/heartbeats.go:7.31,9.2 1 0
|
||||
github.com/muety/wakapi/models/heartbeats.go:11.41,13.2 1 0
|
||||
github.com/muety/wakapi/models/heartbeats.go:15.36,17.2 1 0
|
||||
github.com/muety/wakapi/models/heartbeats.go:19.43,22.2 2 0
|
||||
github.com/muety/wakapi/models/heartbeats.go:24.41,26.18 1 0
|
||||
github.com/muety/wakapi/models/heartbeats.go:29.2,29.16 1 0
|
||||
github.com/muety/wakapi/models/heartbeats.go:26.18,28.3 1 0
|
||||
github.com/muety/wakapi/models/heartbeats.go:32.40,34.18 1 0
|
||||
github.com/muety/wakapi/models/heartbeats.go:37.2,37.24 1 0
|
||||
github.com/muety/wakapi/models/heartbeats.go:34.18,36.3 1 0
|
||||
github.com/muety/wakapi/models/interval.go:39.47,40.23 1 0
|
||||
github.com/muety/wakapi/models/interval.go:45.2,45.14 1 0
|
||||
github.com/muety/wakapi/models/interval.go:40.23,41.13 1 0
|
||||
@ -33,10 +23,6 @@ github.com/muety/wakapi/models/interval.go:41.13,43.4 1 0
|
||||
github.com/muety/wakapi/models/language_mapping.go:11.42,13.2 1 0
|
||||
github.com/muety/wakapi/models/language_mapping.go:15.51,17.2 1 0
|
||||
github.com/muety/wakapi/models/language_mapping.go:19.52,21.2 1 0
|
||||
github.com/muety/wakapi/models/mail.go:16.44,20.2 3 0
|
||||
github.com/muety/wakapi/models/mail.go:22.44,26.2 3 0
|
||||
github.com/muety/wakapi/models/mail.go:28.32,41.2 1 0
|
||||
github.com/muety/wakapi/models/mail.go:43.41,45.2 1 0
|
||||
github.com/muety/wakapi/models/models.go:3.14,5.2 0 1
|
||||
github.com/muety/wakapi/models/shared.go:35.52,37.2 1 0
|
||||
github.com/muety/wakapi/models/shared.go:39.52,42.16 3 0
|
||||
@ -54,6 +40,56 @@ github.com/muety/wakapi/models/shared.go:83.51,86.2 2 0
|
||||
github.com/muety/wakapi/models/shared.go:88.37,91.2 2 0
|
||||
github.com/muety/wakapi/models/shared.go:93.35,95.2 1 0
|
||||
github.com/muety/wakapi/models/shared.go:97.34,99.2 1 0
|
||||
github.com/muety/wakapi/models/summary.go:70.29,72.2 1 1
|
||||
github.com/muety/wakapi/models/summary.go:74.37,81.2 6 1
|
||||
github.com/muety/wakapi/models/summary.go:83.35,85.2 1 1
|
||||
github.com/muety/wakapi/models/summary.go:87.57,95.2 1 1
|
||||
github.com/muety/wakapi/models/summary.go:97.64,99.2 1 0
|
||||
github.com/muety/wakapi/models/summary.go:112.33,117.26 4 1
|
||||
github.com/muety/wakapi/models/summary.go:124.2,124.37 1 1
|
||||
github.com/muety/wakapi/models/summary.go:128.2,131.33 2 1
|
||||
github.com/muety/wakapi/models/summary.go:117.26,118.30 1 1
|
||||
github.com/muety/wakapi/models/summary.go:118.30,120.4 1 1
|
||||
github.com/muety/wakapi/models/summary.go:124.37,126.3 1 0
|
||||
github.com/muety/wakapi/models/summary.go:131.33,137.3 1 1
|
||||
github.com/muety/wakapi/models/summary.go:140.45,145.30 3 1
|
||||
github.com/muety/wakapi/models/summary.go:154.2,154.30 1 1
|
||||
github.com/muety/wakapi/models/summary.go:145.30,146.47 1 1
|
||||
github.com/muety/wakapi/models/summary.go:146.47,147.32 1 1
|
||||
github.com/muety/wakapi/models/summary.go:150.4,150.9 1 1
|
||||
github.com/muety/wakapi/models/summary.go:147.32,149.5 1 1
|
||||
github.com/muety/wakapi/models/summary.go:157.73,159.55 2 1
|
||||
github.com/muety/wakapi/models/summary.go:164.2,164.16 1 1
|
||||
github.com/muety/wakapi/models/summary.go:159.55,160.31 1 1
|
||||
github.com/muety/wakapi/models/summary.go:160.31,162.4 1 1
|
||||
github.com/muety/wakapi/models/summary.go:167.88,169.55 2 1
|
||||
github.com/muety/wakapi/models/summary.go:177.2,177.16 1 1
|
||||
github.com/muety/wakapi/models/summary.go:169.55,170.31 1 1
|
||||
github.com/muety/wakapi/models/summary.go:170.31,171.23 1 1
|
||||
github.com/muety/wakapi/models/summary.go:174.4,174.46 1 1
|
||||
github.com/muety/wakapi/models/summary.go:171.23,172.13 1 1
|
||||
github.com/muety/wakapi/models/summary.go:180.70,182.8 2 1
|
||||
github.com/muety/wakapi/models/summary.go:185.2,185.10 1 1
|
||||
github.com/muety/wakapi/models/summary.go:182.8,184.3 1 1
|
||||
github.com/muety/wakapi/models/summary.go:188.71,189.63 1 1
|
||||
github.com/muety/wakapi/models/summary.go:229.2,235.10 6 1
|
||||
github.com/muety/wakapi/models/summary.go:189.63,192.45 2 1
|
||||
github.com/muety/wakapi/models/summary.go:201.3,201.31 1 1
|
||||
github.com/muety/wakapi/models/summary.go:208.3,208.31 1 1
|
||||
github.com/muety/wakapi/models/summary.go:225.3,225.16 1 1
|
||||
github.com/muety/wakapi/models/summary.go:192.45,193.32 1 1
|
||||
github.com/muety/wakapi/models/summary.go:198.4,198.14 1 1
|
||||
github.com/muety/wakapi/models/summary.go:193.32,194.24 1 1
|
||||
github.com/muety/wakapi/models/summary.go:194.24,196.6 1 1
|
||||
github.com/muety/wakapi/models/summary.go:201.31,203.60 1 1
|
||||
github.com/muety/wakapi/models/summary.go:203.60,205.5 1 1
|
||||
github.com/muety/wakapi/models/summary.go:208.31,210.60 1 1
|
||||
github.com/muety/wakapi/models/summary.go:210.60,211.55 1 1
|
||||
github.com/muety/wakapi/models/summary.go:211.55,213.6 1 1
|
||||
github.com/muety/wakapi/models/summary.go:213.11,221.6 1 1
|
||||
github.com/muety/wakapi/models/summary.go:238.33,240.2 1 1
|
||||
github.com/muety/wakapi/models/summary.go:242.43,244.2 1 1
|
||||
github.com/muety/wakapi/models/summary.go:246.38,248.2 1 1
|
||||
github.com/muety/wakapi/models/user.go:5.13,7.2 1 1
|
||||
github.com/muety/wakapi/models/user.go:70.43,73.2 1 0
|
||||
github.com/muety/wakapi/models/user.go:75.45,78.2 1 0
|
||||
@ -85,90 +121,38 @@ github.com/muety/wakapi/models/filters.go:39.8,39.27 1 1
|
||||
github.com/muety/wakapi/models/filters.go:39.27,41.3 1 0
|
||||
github.com/muety/wakapi/models/filters.go:41.8,41.28 1 1
|
||||
github.com/muety/wakapi/models/filters.go:41.28,43.3 1 0
|
||||
github.com/muety/wakapi/models/heartbeats.go:7.31,9.2 1 0
|
||||
github.com/muety/wakapi/models/heartbeats.go:11.41,13.2 1 0
|
||||
github.com/muety/wakapi/models/heartbeats.go:15.36,17.2 1 0
|
||||
github.com/muety/wakapi/models/heartbeats.go:19.43,22.2 2 0
|
||||
github.com/muety/wakapi/models/heartbeats.go:24.41,26.18 1 0
|
||||
github.com/muety/wakapi/models/heartbeats.go:29.2,29.16 1 0
|
||||
github.com/muety/wakapi/models/heartbeats.go:26.18,28.3 1 0
|
||||
github.com/muety/wakapi/models/heartbeats.go:32.40,34.18 1 0
|
||||
github.com/muety/wakapi/models/heartbeats.go:37.2,37.24 1 0
|
||||
github.com/muety/wakapi/models/heartbeats.go:34.18,36.3 1 0
|
||||
github.com/muety/wakapi/models/mail.go:16.44,20.2 3 0
|
||||
github.com/muety/wakapi/models/mail.go:22.44,26.2 3 0
|
||||
github.com/muety/wakapi/models/mail.go:28.32,41.2 1 0
|
||||
github.com/muety/wakapi/models/mail.go:43.41,45.2 1 0
|
||||
github.com/muety/wakapi/models/mail_address.go:15.13,18.2 2 1
|
||||
github.com/muety/wakapi/models/mail_address.go:24.38,26.2 1 0
|
||||
github.com/muety/wakapi/models/mail_address.go:28.35,30.21 2 0
|
||||
github.com/muety/wakapi/models/mail_address.go:36.2,36.11 1 0
|
||||
github.com/muety/wakapi/models/mail_address.go:30.21,31.21 1 0
|
||||
github.com/muety/wakapi/models/mail_address.go:34.3,34.18 1 0
|
||||
github.com/muety/wakapi/models/mail_address.go:31.21,33.4 1 0
|
||||
github.com/muety/wakapi/models/mail_address.go:39.35,41.2 1 0
|
||||
github.com/muety/wakapi/models/mail_address.go:28.35,30.21 2 1
|
||||
github.com/muety/wakapi/models/mail_address.go:36.2,36.11 1 1
|
||||
github.com/muety/wakapi/models/mail_address.go:30.21,31.21 1 1
|
||||
github.com/muety/wakapi/models/mail_address.go:34.3,34.18 1 1
|
||||
github.com/muety/wakapi/models/mail_address.go:31.21,33.4 1 1
|
||||
github.com/muety/wakapi/models/mail_address.go:39.35,41.2 1 1
|
||||
github.com/muety/wakapi/models/mail_address.go:43.43,45.22 2 0
|
||||
github.com/muety/wakapi/models/mail_address.go:48.2,48.12 1 0
|
||||
github.com/muety/wakapi/models/mail_address.go:45.22,47.3 1 0
|
||||
github.com/muety/wakapi/models/mail_address.go:51.46,53.22 2 0
|
||||
github.com/muety/wakapi/models/mail_address.go:56.2,56.12 1 0
|
||||
github.com/muety/wakapi/models/mail_address.go:53.22,55.3 1 0
|
||||
github.com/muety/wakapi/models/mail_address.go:59.40,60.22 1 0
|
||||
github.com/muety/wakapi/models/mail_address.go:65.2,65.13 1 0
|
||||
github.com/muety/wakapi/models/mail_address.go:60.22,61.17 1 0
|
||||
github.com/muety/wakapi/models/mail_address.go:61.17,63.4 1 0
|
||||
github.com/muety/wakapi/models/summary.go:69.29,71.2 1 1
|
||||
github.com/muety/wakapi/models/summary.go:73.37,80.2 6 1
|
||||
github.com/muety/wakapi/models/summary.go:82.35,84.2 1 1
|
||||
github.com/muety/wakapi/models/summary.go:86.57,94.2 1 1
|
||||
github.com/muety/wakapi/models/summary.go:96.64,98.2 1 0
|
||||
github.com/muety/wakapi/models/summary.go:111.33,116.26 4 1
|
||||
github.com/muety/wakapi/models/summary.go:123.2,123.37 1 1
|
||||
github.com/muety/wakapi/models/summary.go:127.2,130.33 2 1
|
||||
github.com/muety/wakapi/models/summary.go:116.26,117.30 1 1
|
||||
github.com/muety/wakapi/models/summary.go:117.30,119.4 1 1
|
||||
github.com/muety/wakapi/models/summary.go:123.37,125.3 1 0
|
||||
github.com/muety/wakapi/models/summary.go:130.33,136.3 1 1
|
||||
github.com/muety/wakapi/models/summary.go:139.45,144.30 3 1
|
||||
github.com/muety/wakapi/models/summary.go:153.2,153.30 1 1
|
||||
github.com/muety/wakapi/models/summary.go:144.30,145.47 1 1
|
||||
github.com/muety/wakapi/models/summary.go:145.47,146.32 1 1
|
||||
github.com/muety/wakapi/models/summary.go:149.4,149.9 1 1
|
||||
github.com/muety/wakapi/models/summary.go:146.32,148.5 1 1
|
||||
github.com/muety/wakapi/models/summary.go:156.73,158.55 2 1
|
||||
github.com/muety/wakapi/models/summary.go:163.2,163.16 1 1
|
||||
github.com/muety/wakapi/models/summary.go:158.55,159.31 1 1
|
||||
github.com/muety/wakapi/models/summary.go:159.31,161.4 1 1
|
||||
github.com/muety/wakapi/models/summary.go:166.88,168.55 2 1
|
||||
github.com/muety/wakapi/models/summary.go:176.2,176.16 1 1
|
||||
github.com/muety/wakapi/models/summary.go:168.55,169.31 1 1
|
||||
github.com/muety/wakapi/models/summary.go:169.31,170.23 1 1
|
||||
github.com/muety/wakapi/models/summary.go:173.4,173.46 1 1
|
||||
github.com/muety/wakapi/models/summary.go:170.23,171.13 1 1
|
||||
github.com/muety/wakapi/models/summary.go:179.70,181.8 2 1
|
||||
github.com/muety/wakapi/models/summary.go:184.2,184.10 1 1
|
||||
github.com/muety/wakapi/models/summary.go:181.8,183.3 1 1
|
||||
github.com/muety/wakapi/models/summary.go:187.71,188.63 1 1
|
||||
github.com/muety/wakapi/models/summary.go:228.2,234.10 6 1
|
||||
github.com/muety/wakapi/models/summary.go:188.63,191.45 2 1
|
||||
github.com/muety/wakapi/models/summary.go:200.3,200.31 1 1
|
||||
github.com/muety/wakapi/models/summary.go:207.3,207.31 1 1
|
||||
github.com/muety/wakapi/models/summary.go:224.3,224.16 1 1
|
||||
github.com/muety/wakapi/models/summary.go:191.45,192.32 1 1
|
||||
github.com/muety/wakapi/models/summary.go:197.4,197.14 1 1
|
||||
github.com/muety/wakapi/models/summary.go:192.32,193.24 1 1
|
||||
github.com/muety/wakapi/models/summary.go:193.24,195.6 1 1
|
||||
github.com/muety/wakapi/models/summary.go:200.31,202.60 1 1
|
||||
github.com/muety/wakapi/models/summary.go:202.60,204.5 1 1
|
||||
github.com/muety/wakapi/models/summary.go:207.31,209.60 1 1
|
||||
github.com/muety/wakapi/models/summary.go:209.60,210.55 1 1
|
||||
github.com/muety/wakapi/models/summary.go:210.55,212.6 1 1
|
||||
github.com/muety/wakapi/models/summary.go:212.11,220.6 1 1
|
||||
github.com/muety/wakapi/models/summary.go:237.33,239.2 1 1
|
||||
github.com/muety/wakapi/models/summary.go:241.43,243.2 1 1
|
||||
github.com/muety/wakapi/models/summary.go:245.38,247.2 1 1
|
||||
github.com/muety/wakapi/config/sentry.go:16.64,19.2 2 0
|
||||
github.com/muety/wakapi/config/sentry.go:21.13,23.2 1 1
|
||||
github.com/muety/wakapi/config/sentry.go:25.50,29.91 1 0
|
||||
github.com/muety/wakapi/config/sentry.go:29.91,30.29 1 0
|
||||
github.com/muety/wakapi/config/sentry.go:34.4,37.96 3 0
|
||||
github.com/muety/wakapi/config/sentry.go:40.4,40.39 1 0
|
||||
github.com/muety/wakapi/config/sentry.go:43.4,43.69 1 0
|
||||
github.com/muety/wakapi/config/sentry.go:30.29,32.5 1 0
|
||||
github.com/muety/wakapi/config/sentry.go:37.96,39.5 1 0
|
||||
github.com/muety/wakapi/config/sentry.go:40.39,42.5 1 0
|
||||
github.com/muety/wakapi/config/sentry.go:45.79,49.27 2 0
|
||||
github.com/muety/wakapi/config/sentry.go:56.4,56.16 1 0
|
||||
github.com/muety/wakapi/config/sentry.go:49.27,50.84 1 0
|
||||
github.com/muety/wakapi/config/sentry.go:50.84,51.57 1 0
|
||||
github.com/muety/wakapi/config/sentry.go:51.57,53.7 1 0
|
||||
github.com/muety/wakapi/config/sentry.go:58.17,60.3 1 0
|
||||
github.com/muety/wakapi/models/mail_address.go:51.46,53.22 2 1
|
||||
github.com/muety/wakapi/models/mail_address.go:56.2,56.12 1 1
|
||||
github.com/muety/wakapi/models/mail_address.go:53.22,55.3 1 1
|
||||
github.com/muety/wakapi/models/mail_address.go:59.40,60.22 1 1
|
||||
github.com/muety/wakapi/models/mail_address.go:65.2,65.13 1 1
|
||||
github.com/muety/wakapi/models/mail_address.go:60.22,61.17 1 1
|
||||
github.com/muety/wakapi/models/mail_address.go:61.17,63.4 1 1
|
||||
github.com/muety/wakapi/config/utils.go:5.78,7.22 2 0
|
||||
github.com/muety/wakapi/config/utils.go:13.2,13.11 1 0
|
||||
github.com/muety/wakapi/config/utils.go:7.22,8.18 1 0
|
||||
@ -244,16 +228,22 @@ github.com/muety/wakapi/config/config.go:356.70,358.3 1 0
|
||||
github.com/muety/wakapi/config/config.go:360.28,362.3 1 0
|
||||
github.com/muety/wakapi/config/config.go:364.29,367.3 2 0
|
||||
github.com/muety/wakapi/config/config.go:369.94,371.3 1 0
|
||||
github.com/muety/wakapi/utils/template.go:8.41,10.16 2 0
|
||||
github.com/muety/wakapi/utils/template.go:13.2,13.23 1 0
|
||||
github.com/muety/wakapi/utils/template.go:10.16,12.3 1 0
|
||||
github.com/muety/wakapi/utils/template.go:16.37,17.30 1 0
|
||||
github.com/muety/wakapi/utils/template.go:20.2,20.10 1 0
|
||||
github.com/muety/wakapi/utils/template.go:17.30,19.3 1 0
|
||||
github.com/muety/wakapi/utils/color.go:8.90,10.32 2 0
|
||||
github.com/muety/wakapi/utils/color.go:15.2,15.15 1 0
|
||||
github.com/muety/wakapi/utils/color.go:10.32,11.50 1 0
|
||||
github.com/muety/wakapi/utils/color.go:11.50,13.4 1 0
|
||||
github.com/muety/wakapi/config/sentry.go:16.64,19.2 2 0
|
||||
github.com/muety/wakapi/config/sentry.go:21.13,23.2 1 1
|
||||
github.com/muety/wakapi/config/sentry.go:25.50,29.91 1 0
|
||||
github.com/muety/wakapi/config/sentry.go:29.91,30.29 1 0
|
||||
github.com/muety/wakapi/config/sentry.go:34.4,37.96 3 0
|
||||
github.com/muety/wakapi/config/sentry.go:40.4,40.39 1 0
|
||||
github.com/muety/wakapi/config/sentry.go:43.4,43.69 1 0
|
||||
github.com/muety/wakapi/config/sentry.go:30.29,32.5 1 0
|
||||
github.com/muety/wakapi/config/sentry.go:37.96,39.5 1 0
|
||||
github.com/muety/wakapi/config/sentry.go:40.39,42.5 1 0
|
||||
github.com/muety/wakapi/config/sentry.go:45.79,49.27 2 0
|
||||
github.com/muety/wakapi/config/sentry.go:56.4,56.16 1 0
|
||||
github.com/muety/wakapi/config/sentry.go:49.27,50.84 1 0
|
||||
github.com/muety/wakapi/config/sentry.go:50.84,51.57 1 0
|
||||
github.com/muety/wakapi/config/sentry.go:51.57,53.7 1 0
|
||||
github.com/muety/wakapi/config/sentry.go:58.17,60.3 1 0
|
||||
github.com/muety/wakapi/utils/common.go:10.48,12.2 1 0
|
||||
github.com/muety/wakapi/utils/common.go:14.52,16.2 1 0
|
||||
github.com/muety/wakapi/utils/common.go:18.40,20.2 1 0
|
||||
@ -263,56 +253,28 @@ github.com/muety/wakapi/utils/common.go:30.24,32.2 1 0
|
||||
github.com/muety/wakapi/utils/common.go:34.56,37.45 3 1
|
||||
github.com/muety/wakapi/utils/common.go:40.2,40.40 1 1
|
||||
github.com/muety/wakapi/utils/common.go:37.45,39.3 1 1
|
||||
github.com/muety/wakapi/utils/filesystem.go:14.68,16.16 2 0
|
||||
github.com/muety/wakapi/utils/filesystem.go:20.2,21.15 2 0
|
||||
github.com/muety/wakapi/utils/filesystem.go:33.2,33.15 1 0
|
||||
github.com/muety/wakapi/utils/filesystem.go:16.16,18.3 1 0
|
||||
github.com/muety/wakapi/utils/filesystem.go:21.15,23.47 2 0
|
||||
github.com/muety/wakapi/utils/filesystem.go:23.47,25.23 2 0
|
||||
github.com/muety/wakapi/utils/filesystem.go:29.4,29.19 1 0
|
||||
github.com/muety/wakapi/utils/filesystem.go:25.23,27.5 1 0
|
||||
github.com/muety/wakapi/utils/strings.go:8.34,10.2 1 0
|
||||
github.com/muety/wakapi/utils/strings.go:12.77,13.29 1 0
|
||||
github.com/muety/wakapi/utils/strings.go:18.2,18.19 1 0
|
||||
github.com/muety/wakapi/utils/strings.go:13.29,14.18 1 0
|
||||
github.com/muety/wakapi/utils/strings.go:14.18,16.4 1 0
|
||||
github.com/muety/wakapi/utils/auth.go:16.79,18.54 2 0
|
||||
github.com/muety/wakapi/utils/auth.go:22.2,24.16 3 0
|
||||
github.com/muety/wakapi/utils/auth.go:28.2,30.45 3 0
|
||||
github.com/muety/wakapi/utils/auth.go:33.2,34.32 2 0
|
||||
github.com/muety/wakapi/utils/auth.go:18.54,20.3 1 0
|
||||
github.com/muety/wakapi/utils/auth.go:24.16,26.3 1 0
|
||||
github.com/muety/wakapi/utils/auth.go:30.45,32.3 1 0
|
||||
github.com/muety/wakapi/utils/auth.go:37.65,39.85 2 0
|
||||
github.com/muety/wakapi/utils/auth.go:43.2,44.30 2 0
|
||||
github.com/muety/wakapi/utils/auth.go:39.85,41.3 1 0
|
||||
github.com/muety/wakapi/utils/auth.go:47.94,49.16 2 0
|
||||
github.com/muety/wakapi/utils/auth.go:53.2,53.107 1 0
|
||||
github.com/muety/wakapi/utils/auth.go:57.2,57.22 1 0
|
||||
github.com/muety/wakapi/utils/auth.go:49.16,51.3 1 0
|
||||
github.com/muety/wakapi/utils/auth.go:53.107,55.3 1 0
|
||||
github.com/muety/wakapi/utils/auth.go:60.56,64.2 3 0
|
||||
github.com/muety/wakapi/utils/auth.go:66.55,69.16 3 0
|
||||
github.com/muety/wakapi/utils/auth.go:72.2,72.16 1 0
|
||||
github.com/muety/wakapi/utils/auth.go:69.16,71.3 1 0
|
||||
github.com/muety/wakapi/utils/date.go:8.31,10.2 1 0
|
||||
github.com/muety/wakapi/utils/date.go:12.43,14.2 1 0
|
||||
github.com/muety/wakapi/utils/date.go:16.30,20.2 3 0
|
||||
github.com/muety/wakapi/utils/date.go:22.31,25.2 2 0
|
||||
github.com/muety/wakapi/utils/date.go:27.30,30.2 2 0
|
||||
github.com/muety/wakapi/utils/date.go:32.67,35.33 2 0
|
||||
github.com/muety/wakapi/utils/date.go:44.2,44.18 1 0
|
||||
github.com/muety/wakapi/utils/date.go:35.33,37.19 2 0
|
||||
github.com/muety/wakapi/utils/date.go:40.3,41.10 2 0
|
||||
github.com/muety/wakapi/utils/date.go:37.19,39.4 1 0
|
||||
github.com/muety/wakapi/utils/date.go:47.50,53.2 5 0
|
||||
github.com/muety/wakapi/utils/date.go:56.79,59.36 3 0
|
||||
github.com/muety/wakapi/utils/date.go:63.2,63.21 1 0
|
||||
github.com/muety/wakapi/utils/date.go:67.2,67.21 1 0
|
||||
github.com/muety/wakapi/utils/date.go:71.2,71.13 1 0
|
||||
github.com/muety/wakapi/utils/date.go:59.36,62.3 2 0
|
||||
github.com/muety/wakapi/utils/date.go:63.21,66.3 2 0
|
||||
github.com/muety/wakapi/utils/date.go:67.21,70.3 2 0
|
||||
github.com/muety/wakapi/utils/date.go:33.42,35.2 1 1
|
||||
github.com/muety/wakapi/utils/date.go:38.41,40.21 2 1
|
||||
github.com/muety/wakapi/utils/date.go:43.2,43.34 1 1
|
||||
github.com/muety/wakapi/utils/date.go:40.21,42.3 1 1
|
||||
github.com/muety/wakapi/utils/date.go:46.67,49.33 2 0
|
||||
github.com/muety/wakapi/utils/date.go:58.2,58.18 1 0
|
||||
github.com/muety/wakapi/utils/date.go:49.33,51.19 2 0
|
||||
github.com/muety/wakapi/utils/date.go:54.3,55.10 2 0
|
||||
github.com/muety/wakapi/utils/date.go:51.19,53.4 1 0
|
||||
github.com/muety/wakapi/utils/date.go:61.50,67.2 5 0
|
||||
github.com/muety/wakapi/utils/date.go:70.79,73.36 3 0
|
||||
github.com/muety/wakapi/utils/date.go:77.2,77.21 1 0
|
||||
github.com/muety/wakapi/utils/date.go:81.2,81.21 1 0
|
||||
github.com/muety/wakapi/utils/date.go:85.2,85.13 1 0
|
||||
github.com/muety/wakapi/utils/date.go:73.36,76.3 2 0
|
||||
github.com/muety/wakapi/utils/date.go:77.21,80.3 2 0
|
||||
github.com/muety/wakapi/utils/date.go:81.21,84.3 2 0
|
||||
github.com/muety/wakapi/utils/http.go:9.73,12.58 3 0
|
||||
github.com/muety/wakapi/utils/http.go:12.58,14.3 1 0
|
||||
github.com/muety/wakapi/utils/summary.go:10.66,11.40 1 0
|
||||
@ -353,103 +315,48 @@ github.com/muety/wakapi/utils/summary.go:96.18,98.5 1 0
|
||||
github.com/muety/wakapi/utils/summary.go:112.48,116.51 2 0
|
||||
github.com/muety/wakapi/utils/summary.go:119.2,119.12 1 0
|
||||
github.com/muety/wakapi/utils/summary.go:116.51,118.3 1 0
|
||||
github.com/muety/wakapi/middlewares/filetype.go:13.83,14.43 1 0
|
||||
github.com/muety/wakapi/middlewares/filetype.go:14.43,19.3 1 0
|
||||
github.com/muety/wakapi/middlewares/filetype.go:22.84,24.34 2 0
|
||||
github.com/muety/wakapi/middlewares/filetype.go:31.2,31.27 1 0
|
||||
github.com/muety/wakapi/middlewares/filetype.go:24.34,25.50 1 0
|
||||
github.com/muety/wakapi/middlewares/filetype.go:25.50,29.4 3 0
|
||||
github.com/muety/wakapi/middlewares/logging.go:20.102,21.43 1 0
|
||||
github.com/muety/wakapi/middlewares/logging.go:21.43,27.3 1 0
|
||||
github.com/muety/wakapi/middlewares/logging.go:30.80,39.44 7 0
|
||||
github.com/muety/wakapi/middlewares/logging.go:45.2,54.3 1 0
|
||||
github.com/muety/wakapi/middlewares/logging.go:39.44,40.38 1 0
|
||||
github.com/muety/wakapi/middlewares/logging.go:40.38,42.4 1 0
|
||||
github.com/muety/wakapi/middlewares/logging.go:57.41,59.14 2 0
|
||||
github.com/muety/wakapi/middlewares/logging.go:62.2,62.14 1 0
|
||||
github.com/muety/wakapi/middlewares/logging.go:65.2,65.11 1 0
|
||||
github.com/muety/wakapi/middlewares/logging.go:59.14,61.3 1 0
|
||||
github.com/muety/wakapi/middlewares/logging.go:62.14,64.3 1 0
|
||||
github.com/muety/wakapi/middlewares/logging.go:68.41,69.42 1 0
|
||||
github.com/muety/wakapi/middlewares/logging.go:72.2,72.12 1 0
|
||||
github.com/muety/wakapi/middlewares/logging.go:69.42,71.3 1 0
|
||||
github.com/muety/wakapi/middlewares/logging.go:103.52,105.2 1 0
|
||||
github.com/muety/wakapi/middlewares/logging.go:117.45,118.20 1 0
|
||||
github.com/muety/wakapi/middlewares/logging.go:118.20,122.3 3 0
|
||||
github.com/muety/wakapi/middlewares/logging.go:124.54,127.18 3 0
|
||||
github.com/muety/wakapi/middlewares/logging.go:134.2,135.15 2 0
|
||||
github.com/muety/wakapi/middlewares/logging.go:127.18,130.17 2 0
|
||||
github.com/muety/wakapi/middlewares/logging.go:130.17,132.4 1 0
|
||||
github.com/muety/wakapi/middlewares/logging.go:137.42,138.20 1 0
|
||||
github.com/muety/wakapi/middlewares/logging.go:138.20,140.3 1 0
|
||||
github.com/muety/wakapi/middlewares/logging.go:142.36,144.2 1 0
|
||||
github.com/muety/wakapi/middlewares/logging.go:145.42,147.2 1 0
|
||||
github.com/muety/wakapi/middlewares/logging.go:148.40,150.2 1 0
|
||||
github.com/muety/wakapi/middlewares/logging.go:151.52,153.2 1 0
|
||||
github.com/muety/wakapi/middlewares/principal.go:15.62,17.2 1 0
|
||||
github.com/muety/wakapi/middlewares/principal.go:19.58,21.2 1 0
|
||||
github.com/muety/wakapi/middlewares/principal.go:42.71,43.43 1 0
|
||||
github.com/muety/wakapi/middlewares/principal.go:43.43,45.3 1 0
|
||||
github.com/muety/wakapi/middlewares/principal.go:48.81,51.2 2 0
|
||||
github.com/muety/wakapi/middlewares/principal.go:53.55,54.52 1 0
|
||||
github.com/muety/wakapi/middlewares/principal.go:54.52,56.3 1 0
|
||||
github.com/muety/wakapi/middlewares/principal.go:59.49,60.52 1 0
|
||||
github.com/muety/wakapi/middlewares/principal.go:63.2,63.12 1 0
|
||||
github.com/muety/wakapi/middlewares/principal.go:60.52,62.3 1 0
|
||||
github.com/muety/wakapi/middlewares/sentry.go:14.60,15.43 1 0
|
||||
github.com/muety/wakapi/middlewares/sentry.go:15.43,19.3 1 0
|
||||
github.com/muety/wakapi/middlewares/sentry.go:22.78,25.54 3 0
|
||||
github.com/muety/wakapi/middlewares/sentry.go:25.54,26.43 1 0
|
||||
github.com/muety/wakapi/middlewares/sentry.go:26.43,28.4 1 0
|
||||
github.com/muety/wakapi/middlewares/authenticate.go:19.91,25.2 1 1
|
||||
github.com/muety/wakapi/middlewares/authenticate.go:27.90,30.2 2 0
|
||||
github.com/muety/wakapi/middlewares/authenticate.go:32.90,35.2 2 0
|
||||
github.com/muety/wakapi/middlewares/authenticate.go:37.71,38.71 1 0
|
||||
github.com/muety/wakapi/middlewares/authenticate.go:38.71,40.3 1 0
|
||||
github.com/muety/wakapi/middlewares/authenticate.go:43.107,47.16 3 0
|
||||
github.com/muety/wakapi/middlewares/authenticate.go:51.2,51.31 1 0
|
||||
github.com/muety/wakapi/middlewares/authenticate.go:67.2,68.12 2 0
|
||||
github.com/muety/wakapi/middlewares/authenticate.go:47.16,49.3 1 0
|
||||
github.com/muety/wakapi/middlewares/authenticate.go:51.31,52.31 1 0
|
||||
github.com/muety/wakapi/middlewares/authenticate.go:57.3,57.29 1 0
|
||||
github.com/muety/wakapi/middlewares/authenticate.go:64.3,64.9 1 0
|
||||
github.com/muety/wakapi/middlewares/authenticate.go:52.31,55.4 2 0
|
||||
github.com/muety/wakapi/middlewares/authenticate.go:57.29,60.4 2 0
|
||||
github.com/muety/wakapi/middlewares/authenticate.go:60.9,63.4 2 0
|
||||
github.com/muety/wakapi/middlewares/authenticate.go:71.70,72.39 1 0
|
||||
github.com/muety/wakapi/middlewares/authenticate.go:77.2,77.14 1 0
|
||||
github.com/muety/wakapi/middlewares/authenticate.go:72.39,73.60 1 0
|
||||
github.com/muety/wakapi/middlewares/authenticate.go:73.60,75.4 1 0
|
||||
github.com/muety/wakapi/middlewares/authenticate.go:80.92,82.16 2 1
|
||||
github.com/muety/wakapi/middlewares/authenticate.go:86.2,89.16 4 1
|
||||
github.com/muety/wakapi/middlewares/authenticate.go:92.2,92.18 1 1
|
||||
github.com/muety/wakapi/middlewares/authenticate.go:82.16,84.3 1 1
|
||||
github.com/muety/wakapi/middlewares/authenticate.go:89.16,91.3 1 0
|
||||
github.com/muety/wakapi/middlewares/authenticate.go:95.92,97.16 2 0
|
||||
github.com/muety/wakapi/middlewares/authenticate.go:101.2,102.16 2 0
|
||||
github.com/muety/wakapi/middlewares/authenticate.go:109.2,109.18 1 0
|
||||
github.com/muety/wakapi/middlewares/authenticate.go:97.16,99.3 1 0
|
||||
github.com/muety/wakapi/middlewares/authenticate.go:102.16,104.3 1 0
|
||||
github.com/muety/wakapi/services/heartbeat.go:17.141,23.2 1 0
|
||||
github.com/muety/wakapi/services/heartbeat.go:25.72,27.2 1 0
|
||||
github.com/muety/wakapi/services/heartbeat.go:29.80,34.32 3 0
|
||||
github.com/muety/wakapi/services/heartbeat.go:41.2,41.55 1 0
|
||||
github.com/muety/wakapi/services/heartbeat.go:34.32,35.36 1 0
|
||||
github.com/muety/wakapi/services/heartbeat.go:35.36,38.4 2 0
|
||||
github.com/muety/wakapi/services/heartbeat.go:44.53,46.2 1 0
|
||||
github.com/muety/wakapi/services/heartbeat.go:48.76,50.2 1 0
|
||||
github.com/muety/wakapi/services/heartbeat.go:52.96,54.2 1 0
|
||||
github.com/muety/wakapi/services/heartbeat.go:56.111,58.16 2 0
|
||||
github.com/muety/wakapi/services/heartbeat.go:61.2,61.43 1 0
|
||||
github.com/muety/wakapi/services/heartbeat.go:58.16,60.3 1 0
|
||||
github.com/muety/wakapi/services/heartbeat.go:64.116,66.2 1 0
|
||||
github.com/muety/wakapi/services/heartbeat.go:68.78,70.2 1 0
|
||||
github.com/muety/wakapi/services/heartbeat.go:72.62,74.2 1 0
|
||||
github.com/muety/wakapi/services/heartbeat.go:76.116,78.16 2 0
|
||||
github.com/muety/wakapi/services/heartbeat.go:82.2,82.28 1 0
|
||||
github.com/muety/wakapi/services/heartbeat.go:86.2,86.24 1 0
|
||||
github.com/muety/wakapi/services/heartbeat.go:78.16,80.3 1 0
|
||||
github.com/muety/wakapi/services/heartbeat.go:82.28,84.3 1 0
|
||||
github.com/muety/wakapi/utils/template.go:8.41,10.16 2 0
|
||||
github.com/muety/wakapi/utils/template.go:13.2,13.23 1 0
|
||||
github.com/muety/wakapi/utils/template.go:10.16,12.3 1 0
|
||||
github.com/muety/wakapi/utils/template.go:16.37,17.30 1 0
|
||||
github.com/muety/wakapi/utils/template.go:20.2,20.10 1 0
|
||||
github.com/muety/wakapi/utils/template.go:17.30,19.3 1 0
|
||||
github.com/muety/wakapi/utils/auth.go:16.79,18.54 2 0
|
||||
github.com/muety/wakapi/utils/auth.go:22.2,24.16 3 0
|
||||
github.com/muety/wakapi/utils/auth.go:28.2,30.45 3 0
|
||||
github.com/muety/wakapi/utils/auth.go:33.2,34.32 2 0
|
||||
github.com/muety/wakapi/utils/auth.go:18.54,20.3 1 0
|
||||
github.com/muety/wakapi/utils/auth.go:24.16,26.3 1 0
|
||||
github.com/muety/wakapi/utils/auth.go:30.45,32.3 1 0
|
||||
github.com/muety/wakapi/utils/auth.go:37.65,39.85 2 0
|
||||
github.com/muety/wakapi/utils/auth.go:43.2,44.30 2 0
|
||||
github.com/muety/wakapi/utils/auth.go:39.85,41.3 1 0
|
||||
github.com/muety/wakapi/utils/auth.go:47.94,49.16 2 0
|
||||
github.com/muety/wakapi/utils/auth.go:53.2,53.107 1 0
|
||||
github.com/muety/wakapi/utils/auth.go:57.2,57.22 1 0
|
||||
github.com/muety/wakapi/utils/auth.go:49.16,51.3 1 0
|
||||
github.com/muety/wakapi/utils/auth.go:53.107,55.3 1 0
|
||||
github.com/muety/wakapi/utils/auth.go:60.56,64.2 3 0
|
||||
github.com/muety/wakapi/utils/auth.go:66.55,69.16 3 0
|
||||
github.com/muety/wakapi/utils/auth.go:72.2,72.16 1 0
|
||||
github.com/muety/wakapi/utils/auth.go:69.16,71.3 1 0
|
||||
github.com/muety/wakapi/utils/color.go:8.90,10.32 2 0
|
||||
github.com/muety/wakapi/utils/color.go:15.2,15.15 1 0
|
||||
github.com/muety/wakapi/utils/color.go:10.32,11.50 1 0
|
||||
github.com/muety/wakapi/utils/color.go:11.50,13.4 1 0
|
||||
github.com/muety/wakapi/utils/filesystem.go:14.68,16.16 2 0
|
||||
github.com/muety/wakapi/utils/filesystem.go:20.2,21.15 2 0
|
||||
github.com/muety/wakapi/utils/filesystem.go:33.2,33.15 1 0
|
||||
github.com/muety/wakapi/utils/filesystem.go:16.16,18.3 1 0
|
||||
github.com/muety/wakapi/utils/filesystem.go:21.15,23.47 2 0
|
||||
github.com/muety/wakapi/utils/filesystem.go:23.47,25.23 2 0
|
||||
github.com/muety/wakapi/utils/filesystem.go:29.4,29.19 1 0
|
||||
github.com/muety/wakapi/utils/filesystem.go:25.23,27.5 1 0
|
||||
github.com/muety/wakapi/utils/strings.go:8.34,10.2 1 0
|
||||
github.com/muety/wakapi/utils/strings.go:12.77,13.29 1 0
|
||||
github.com/muety/wakapi/utils/strings.go:18.2,18.19 1 0
|
||||
github.com/muety/wakapi/utils/strings.go:13.29,14.18 1 0
|
||||
github.com/muety/wakapi/utils/strings.go:14.18,16.4 1 0
|
||||
github.com/muety/wakapi/services/key_value.go:14.89,19.2 1 0
|
||||
github.com/muety/wakapi/services/key_value.go:21.83,23.2 1 0
|
||||
github.com/muety/wakapi/services/key_value.go:25.78,27.16 2 0
|
||||
@ -499,6 +406,91 @@ github.com/muety/wakapi/services/misc.go:113.2,116.17 1 0
|
||||
github.com/muety/wakapi/services/misc.go:101.30,104.3 2 0
|
||||
github.com/muety/wakapi/services/misc.go:109.17,111.3 1 0
|
||||
github.com/muety/wakapi/services/misc.go:116.17,118.3 1 0
|
||||
github.com/muety/wakapi/services/user.go:19.73,25.2 1 0
|
||||
github.com/muety/wakapi/services/user.go:27.74,28.40 1 0
|
||||
github.com/muety/wakapi/services/user.go:32.2,33.16 2 0
|
||||
github.com/muety/wakapi/services/user.go:37.2,38.15 2 0
|
||||
github.com/muety/wakapi/services/user.go:28.40,30.3 1 0
|
||||
github.com/muety/wakapi/services/user.go:33.16,35.3 1 0
|
||||
github.com/muety/wakapi/services/user.go:41.72,42.37 1 0
|
||||
github.com/muety/wakapi/services/user.go:46.2,47.16 2 0
|
||||
github.com/muety/wakapi/services/user.go:51.2,52.15 2 0
|
||||
github.com/muety/wakapi/services/user.go:42.37,44.3 1 0
|
||||
github.com/muety/wakapi/services/user.go:47.16,49.3 1 0
|
||||
github.com/muety/wakapi/services/user.go:55.76,57.2 1 0
|
||||
github.com/muety/wakapi/services/user.go:59.86,61.2 1 0
|
||||
github.com/muety/wakapi/services/user.go:63.58,65.2 1 0
|
||||
github.com/muety/wakapi/services/user.go:67.61,70.2 2 0
|
||||
github.com/muety/wakapi/services/user.go:72.48,74.2 1 0
|
||||
github.com/muety/wakapi/services/user.go:76.102,85.93 2 0
|
||||
github.com/muety/wakapi/services/user.go:91.2,91.38 1 0
|
||||
github.com/muety/wakapi/services/user.go:85.93,87.3 1 0
|
||||
github.com/muety/wakapi/services/user.go:87.8,89.3 1 0
|
||||
github.com/muety/wakapi/services/user.go:94.73,97.2 2 0
|
||||
github.com/muety/wakapi/services/user.go:99.78,103.2 3 0
|
||||
github.com/muety/wakapi/services/user.go:105.99,108.2 2 0
|
||||
github.com/muety/wakapi/services/user.go:110.106,113.96 3 0
|
||||
github.com/muety/wakapi/services/user.go:118.2,118.68 1 0
|
||||
github.com/muety/wakapi/services/user.go:113.96,115.3 1 0
|
||||
github.com/muety/wakapi/services/user.go:115.8,117.3 1 0
|
||||
github.com/muety/wakapi/services/user.go:121.85,123.2 1 0
|
||||
github.com/muety/wakapi/services/user.go:125.57,128.2 2 0
|
||||
github.com/muety/wakapi/services/user.go:130.38,132.2 1 0
|
||||
github.com/muety/wakapi/services/alias.go:17.77,22.2 1 1
|
||||
github.com/muety/wakapi/services/alias.go:26.60,27.43 1 1
|
||||
github.com/muety/wakapi/services/alias.go:30.2,30.14 1 1
|
||||
github.com/muety/wakapi/services/alias.go:27.43,29.3 1 1
|
||||
github.com/muety/wakapi/services/alias.go:33.62,35.16 2 1
|
||||
github.com/muety/wakapi/services/alias.go:38.2,38.12 1 1
|
||||
github.com/muety/wakapi/services/alias.go:35.16,37.3 1 1
|
||||
github.com/muety/wakapi/services/alias.go:41.76,43.16 2 0
|
||||
github.com/muety/wakapi/services/alias.go:46.2,46.21 1 0
|
||||
github.com/muety/wakapi/services/alias.go:43.16,45.3 1 0
|
||||
github.com/muety/wakapi/services/alias.go:49.113,51.16 2 0
|
||||
github.com/muety/wakapi/services/alias.go:54.2,54.21 1 0
|
||||
github.com/muety/wakapi/services/alias.go:51.16,53.3 1 0
|
||||
github.com/muety/wakapi/services/alias.go:57.108,58.32 1 1
|
||||
github.com/muety/wakapi/services/alias.go:64.2,65.46 2 1
|
||||
github.com/muety/wakapi/services/alias.go:70.2,70.19 1 1
|
||||
github.com/muety/wakapi/services/alias.go:58.32,59.52 1 1
|
||||
github.com/muety/wakapi/services/alias.go:59.52,61.4 1 1
|
||||
github.com/muety/wakapi/services/alias.go:65.46,66.48 1 1
|
||||
github.com/muety/wakapi/services/alias.go:66.48,68.4 1 1
|
||||
github.com/muety/wakapi/services/alias.go:73.77,75.16 2 0
|
||||
github.com/muety/wakapi/services/alias.go:78.2,79.20 2 0
|
||||
github.com/muety/wakapi/services/alias.go:75.16,77.3 1 0
|
||||
github.com/muety/wakapi/services/alias.go:82.60,83.24 1 0
|
||||
github.com/muety/wakapi/services/alias.go:86.2,88.12 3 0
|
||||
github.com/muety/wakapi/services/alias.go:83.24,85.3 1 0
|
||||
github.com/muety/wakapi/services/alias.go:91.69,94.28 3 0
|
||||
github.com/muety/wakapi/services/alias.go:102.2,104.31 2 0
|
||||
github.com/muety/wakapi/services/alias.go:108.2,108.12 1 0
|
||||
github.com/muety/wakapi/services/alias.go:94.28,95.21 1 0
|
||||
github.com/muety/wakapi/services/alias.go:98.3,99.16 2 0
|
||||
github.com/muety/wakapi/services/alias.go:95.21,97.4 1 0
|
||||
github.com/muety/wakapi/services/alias.go:104.31,106.3 1 0
|
||||
github.com/muety/wakapi/services/alias.go:111.52,112.51 1 0
|
||||
github.com/muety/wakapi/services/alias.go:112.51,114.3 1 0
|
||||
github.com/muety/wakapi/services/heartbeat.go:17.141,23.2 1 0
|
||||
github.com/muety/wakapi/services/heartbeat.go:25.72,27.2 1 0
|
||||
github.com/muety/wakapi/services/heartbeat.go:29.80,34.32 3 0
|
||||
github.com/muety/wakapi/services/heartbeat.go:41.2,41.55 1 0
|
||||
github.com/muety/wakapi/services/heartbeat.go:34.32,35.36 1 0
|
||||
github.com/muety/wakapi/services/heartbeat.go:35.36,38.4 2 0
|
||||
github.com/muety/wakapi/services/heartbeat.go:44.53,46.2 1 0
|
||||
github.com/muety/wakapi/services/heartbeat.go:48.76,50.2 1 0
|
||||
github.com/muety/wakapi/services/heartbeat.go:52.96,54.2 1 0
|
||||
github.com/muety/wakapi/services/heartbeat.go:56.111,58.16 2 0
|
||||
github.com/muety/wakapi/services/heartbeat.go:61.2,61.43 1 0
|
||||
github.com/muety/wakapi/services/heartbeat.go:58.16,60.3 1 0
|
||||
github.com/muety/wakapi/services/heartbeat.go:64.116,66.2 1 0
|
||||
github.com/muety/wakapi/services/heartbeat.go:68.78,70.2 1 0
|
||||
github.com/muety/wakapi/services/heartbeat.go:72.62,74.2 1 0
|
||||
github.com/muety/wakapi/services/heartbeat.go:76.116,78.16 2 0
|
||||
github.com/muety/wakapi/services/heartbeat.go:82.2,82.28 1 0
|
||||
github.com/muety/wakapi/services/heartbeat.go:86.2,86.24 1 0
|
||||
github.com/muety/wakapi/services/heartbeat.go:78.16,80.3 1 0
|
||||
github.com/muety/wakapi/services/heartbeat.go:82.28,84.3 1 0
|
||||
github.com/muety/wakapi/services/summary.go:27.149,35.2 1 1
|
||||
github.com/muety/wakapi/services/summary.go:39.136,42.66 2 1
|
||||
github.com/muety/wakapi/services/summary.go:47.2,47.44 1 1
|
||||
@ -630,68 +622,80 @@ github.com/muety/wakapi/services/aggregation.go:136.62,140.4 1 0
|
||||
github.com/muety/wakapi/services/aggregation.go:148.83,163.41 5 0
|
||||
github.com/muety/wakapi/services/aggregation.go:163.41,173.3 3 0
|
||||
github.com/muety/wakapi/services/aggregation.go:176.34,179.2 2 0
|
||||
github.com/muety/wakapi/services/alias.go:17.77,22.2 1 1
|
||||
github.com/muety/wakapi/services/alias.go:26.60,27.43 1 1
|
||||
github.com/muety/wakapi/services/alias.go:30.2,30.14 1 1
|
||||
github.com/muety/wakapi/services/alias.go:27.43,29.3 1 1
|
||||
github.com/muety/wakapi/services/alias.go:33.62,35.16 2 1
|
||||
github.com/muety/wakapi/services/alias.go:38.2,38.12 1 1
|
||||
github.com/muety/wakapi/services/alias.go:35.16,37.3 1 1
|
||||
github.com/muety/wakapi/services/alias.go:41.76,43.16 2 0
|
||||
github.com/muety/wakapi/services/alias.go:46.2,46.21 1 0
|
||||
github.com/muety/wakapi/services/alias.go:43.16,45.3 1 0
|
||||
github.com/muety/wakapi/services/alias.go:49.113,51.16 2 0
|
||||
github.com/muety/wakapi/services/alias.go:54.2,54.21 1 0
|
||||
github.com/muety/wakapi/services/alias.go:51.16,53.3 1 0
|
||||
github.com/muety/wakapi/services/alias.go:57.108,58.32 1 1
|
||||
github.com/muety/wakapi/services/alias.go:64.2,65.46 2 1
|
||||
github.com/muety/wakapi/services/alias.go:70.2,70.19 1 1
|
||||
github.com/muety/wakapi/services/alias.go:58.32,59.52 1 1
|
||||
github.com/muety/wakapi/services/alias.go:59.52,61.4 1 1
|
||||
github.com/muety/wakapi/services/alias.go:65.46,66.48 1 1
|
||||
github.com/muety/wakapi/services/alias.go:66.48,68.4 1 1
|
||||
github.com/muety/wakapi/services/alias.go:73.77,75.16 2 0
|
||||
github.com/muety/wakapi/services/alias.go:78.2,79.20 2 0
|
||||
github.com/muety/wakapi/services/alias.go:75.16,77.3 1 0
|
||||
github.com/muety/wakapi/services/alias.go:82.60,83.24 1 0
|
||||
github.com/muety/wakapi/services/alias.go:86.2,88.12 3 0
|
||||
github.com/muety/wakapi/services/alias.go:83.24,85.3 1 0
|
||||
github.com/muety/wakapi/services/alias.go:91.69,94.28 3 0
|
||||
github.com/muety/wakapi/services/alias.go:102.2,104.31 2 0
|
||||
github.com/muety/wakapi/services/alias.go:108.2,108.12 1 0
|
||||
github.com/muety/wakapi/services/alias.go:94.28,95.21 1 0
|
||||
github.com/muety/wakapi/services/alias.go:98.3,99.16 2 0
|
||||
github.com/muety/wakapi/services/alias.go:95.21,97.4 1 0
|
||||
github.com/muety/wakapi/services/alias.go:104.31,106.3 1 0
|
||||
github.com/muety/wakapi/services/alias.go:111.52,112.51 1 0
|
||||
github.com/muety/wakapi/services/alias.go:112.51,114.3 1 0
|
||||
github.com/muety/wakapi/services/user.go:19.73,25.2 1 0
|
||||
github.com/muety/wakapi/services/user.go:27.74,28.40 1 0
|
||||
github.com/muety/wakapi/services/user.go:32.2,33.16 2 0
|
||||
github.com/muety/wakapi/services/user.go:37.2,38.15 2 0
|
||||
github.com/muety/wakapi/services/user.go:28.40,30.3 1 0
|
||||
github.com/muety/wakapi/services/user.go:33.16,35.3 1 0
|
||||
github.com/muety/wakapi/services/user.go:41.72,42.37 1 0
|
||||
github.com/muety/wakapi/services/user.go:46.2,47.16 2 0
|
||||
github.com/muety/wakapi/services/user.go:51.2,52.15 2 0
|
||||
github.com/muety/wakapi/services/user.go:42.37,44.3 1 0
|
||||
github.com/muety/wakapi/services/user.go:47.16,49.3 1 0
|
||||
github.com/muety/wakapi/services/user.go:55.76,57.2 1 0
|
||||
github.com/muety/wakapi/services/user.go:59.86,61.2 1 0
|
||||
github.com/muety/wakapi/services/user.go:63.58,65.2 1 0
|
||||
github.com/muety/wakapi/services/user.go:67.61,70.2 2 0
|
||||
github.com/muety/wakapi/services/user.go:72.48,74.2 1 0
|
||||
github.com/muety/wakapi/services/user.go:76.102,85.93 2 0
|
||||
github.com/muety/wakapi/services/user.go:91.2,91.38 1 0
|
||||
github.com/muety/wakapi/services/user.go:85.93,87.3 1 0
|
||||
github.com/muety/wakapi/services/user.go:87.8,89.3 1 0
|
||||
github.com/muety/wakapi/services/user.go:94.73,97.2 2 0
|
||||
github.com/muety/wakapi/services/user.go:99.78,103.2 3 0
|
||||
github.com/muety/wakapi/services/user.go:105.99,108.2 2 0
|
||||
github.com/muety/wakapi/services/user.go:110.106,113.96 3 0
|
||||
github.com/muety/wakapi/services/user.go:118.2,118.68 1 0
|
||||
github.com/muety/wakapi/services/user.go:113.96,115.3 1 0
|
||||
github.com/muety/wakapi/services/user.go:115.8,117.3 1 0
|
||||
github.com/muety/wakapi/services/user.go:121.85,123.2 1 0
|
||||
github.com/muety/wakapi/services/user.go:125.57,128.2 2 0
|
||||
github.com/muety/wakapi/services/user.go:130.38,132.2 1 0
|
||||
github.com/muety/wakapi/middlewares/authenticate.go:19.91,25.2 1 1
|
||||
github.com/muety/wakapi/middlewares/authenticate.go:27.90,30.2 2 0
|
||||
github.com/muety/wakapi/middlewares/authenticate.go:32.90,35.2 2 0
|
||||
github.com/muety/wakapi/middlewares/authenticate.go:37.71,38.71 1 0
|
||||
github.com/muety/wakapi/middlewares/authenticate.go:38.71,40.3 1 0
|
||||
github.com/muety/wakapi/middlewares/authenticate.go:43.107,47.16 3 0
|
||||
github.com/muety/wakapi/middlewares/authenticate.go:51.2,51.31 1 0
|
||||
github.com/muety/wakapi/middlewares/authenticate.go:67.2,68.12 2 0
|
||||
github.com/muety/wakapi/middlewares/authenticate.go:47.16,49.3 1 0
|
||||
github.com/muety/wakapi/middlewares/authenticate.go:51.31,52.31 1 0
|
||||
github.com/muety/wakapi/middlewares/authenticate.go:57.3,57.29 1 0
|
||||
github.com/muety/wakapi/middlewares/authenticate.go:64.3,64.9 1 0
|
||||
github.com/muety/wakapi/middlewares/authenticate.go:52.31,55.4 2 0
|
||||
github.com/muety/wakapi/middlewares/authenticate.go:57.29,60.4 2 0
|
||||
github.com/muety/wakapi/middlewares/authenticate.go:60.9,63.4 2 0
|
||||
github.com/muety/wakapi/middlewares/authenticate.go:71.70,72.39 1 0
|
||||
github.com/muety/wakapi/middlewares/authenticate.go:77.2,77.14 1 0
|
||||
github.com/muety/wakapi/middlewares/authenticate.go:72.39,73.60 1 0
|
||||
github.com/muety/wakapi/middlewares/authenticate.go:73.60,75.4 1 0
|
||||
github.com/muety/wakapi/middlewares/authenticate.go:80.92,82.16 2 1
|
||||
github.com/muety/wakapi/middlewares/authenticate.go:86.2,89.16 4 1
|
||||
github.com/muety/wakapi/middlewares/authenticate.go:92.2,92.18 1 1
|
||||
github.com/muety/wakapi/middlewares/authenticate.go:82.16,84.3 1 1
|
||||
github.com/muety/wakapi/middlewares/authenticate.go:89.16,91.3 1 0
|
||||
github.com/muety/wakapi/middlewares/authenticate.go:95.92,97.16 2 0
|
||||
github.com/muety/wakapi/middlewares/authenticate.go:101.2,102.16 2 0
|
||||
github.com/muety/wakapi/middlewares/authenticate.go:109.2,109.18 1 0
|
||||
github.com/muety/wakapi/middlewares/authenticate.go:97.16,99.3 1 0
|
||||
github.com/muety/wakapi/middlewares/authenticate.go:102.16,104.3 1 0
|
||||
github.com/muety/wakapi/middlewares/filetype.go:13.83,14.43 1 0
|
||||
github.com/muety/wakapi/middlewares/filetype.go:14.43,19.3 1 0
|
||||
github.com/muety/wakapi/middlewares/filetype.go:22.84,24.34 2 0
|
||||
github.com/muety/wakapi/middlewares/filetype.go:31.2,31.27 1 0
|
||||
github.com/muety/wakapi/middlewares/filetype.go:24.34,25.50 1 0
|
||||
github.com/muety/wakapi/middlewares/filetype.go:25.50,29.4 3 0
|
||||
github.com/muety/wakapi/middlewares/logging.go:20.102,21.43 1 0
|
||||
github.com/muety/wakapi/middlewares/logging.go:21.43,27.3 1 0
|
||||
github.com/muety/wakapi/middlewares/logging.go:30.80,39.44 7 0
|
||||
github.com/muety/wakapi/middlewares/logging.go:45.2,54.3 1 0
|
||||
github.com/muety/wakapi/middlewares/logging.go:39.44,40.38 1 0
|
||||
github.com/muety/wakapi/middlewares/logging.go:40.38,42.4 1 0
|
||||
github.com/muety/wakapi/middlewares/logging.go:57.41,59.14 2 0
|
||||
github.com/muety/wakapi/middlewares/logging.go:62.2,62.14 1 0
|
||||
github.com/muety/wakapi/middlewares/logging.go:65.2,65.11 1 0
|
||||
github.com/muety/wakapi/middlewares/logging.go:59.14,61.3 1 0
|
||||
github.com/muety/wakapi/middlewares/logging.go:62.14,64.3 1 0
|
||||
github.com/muety/wakapi/middlewares/logging.go:68.41,69.42 1 0
|
||||
github.com/muety/wakapi/middlewares/logging.go:72.2,72.12 1 0
|
||||
github.com/muety/wakapi/middlewares/logging.go:69.42,71.3 1 0
|
||||
github.com/muety/wakapi/middlewares/logging.go:103.52,105.2 1 0
|
||||
github.com/muety/wakapi/middlewares/logging.go:117.45,118.20 1 0
|
||||
github.com/muety/wakapi/middlewares/logging.go:118.20,122.3 3 0
|
||||
github.com/muety/wakapi/middlewares/logging.go:124.54,127.18 3 0
|
||||
github.com/muety/wakapi/middlewares/logging.go:134.2,135.15 2 0
|
||||
github.com/muety/wakapi/middlewares/logging.go:127.18,130.17 2 0
|
||||
github.com/muety/wakapi/middlewares/logging.go:130.17,132.4 1 0
|
||||
github.com/muety/wakapi/middlewares/logging.go:137.42,138.20 1 0
|
||||
github.com/muety/wakapi/middlewares/logging.go:138.20,140.3 1 0
|
||||
github.com/muety/wakapi/middlewares/logging.go:142.36,144.2 1 0
|
||||
github.com/muety/wakapi/middlewares/logging.go:145.42,147.2 1 0
|
||||
github.com/muety/wakapi/middlewares/logging.go:148.40,150.2 1 0
|
||||
github.com/muety/wakapi/middlewares/logging.go:151.52,153.2 1 0
|
||||
github.com/muety/wakapi/middlewares/principal.go:15.62,17.2 1 0
|
||||
github.com/muety/wakapi/middlewares/principal.go:19.58,21.2 1 0
|
||||
github.com/muety/wakapi/middlewares/principal.go:42.71,43.43 1 0
|
||||
github.com/muety/wakapi/middlewares/principal.go:43.43,45.3 1 0
|
||||
github.com/muety/wakapi/middlewares/principal.go:48.81,51.2 2 0
|
||||
github.com/muety/wakapi/middlewares/principal.go:53.55,54.52 1 0
|
||||
github.com/muety/wakapi/middlewares/principal.go:54.52,56.3 1 0
|
||||
github.com/muety/wakapi/middlewares/principal.go:59.49,60.52 1 0
|
||||
github.com/muety/wakapi/middlewares/principal.go:63.2,63.12 1 0
|
||||
github.com/muety/wakapi/middlewares/principal.go:60.52,62.3 1 0
|
||||
github.com/muety/wakapi/middlewares/sentry.go:14.60,15.43 1 0
|
||||
github.com/muety/wakapi/middlewares/sentry.go:15.43,19.3 1 0
|
||||
github.com/muety/wakapi/middlewares/sentry.go:22.78,25.54 3 0
|
||||
github.com/muety/wakapi/middlewares/sentry.go:25.54,26.43 1 0
|
||||
github.com/muety/wakapi/middlewares/sentry.go:26.43,28.4 1 0
|
||||
|
7
main.go
7
main.go
@ -2,6 +2,7 @@ package main
|
||||
|
||||
import (
|
||||
"embed"
|
||||
sentryhttp "github.com/getsentry/sentry-go/http"
|
||||
"io/fs"
|
||||
"log"
|
||||
"net/http"
|
||||
@ -183,8 +184,9 @@ func main() {
|
||||
router.Use(middlewares.NewLoggingMiddleware(logbuch.Info, []string{"/assets"}))
|
||||
router.Use(handlers.RecoveryHandler())
|
||||
if config.Sentry.Dsn != "" {
|
||||
router.Use(middlewares.NewSentryMiddleware())
|
||||
router.Use(sentryhttp.New(sentryhttp.Options{Repanic: true}).Handle)
|
||||
}
|
||||
rootRouter.Use(middlewares.NewSecurityMiddleware())
|
||||
|
||||
// Route registrations
|
||||
homeHandler.RegisterRoutes(rootRouter)
|
||||
@ -205,7 +207,8 @@ func main() {
|
||||
|
||||
// Static Routes
|
||||
// https://github.com/golang/go/issues/43431
|
||||
static, _ := fs.Sub(staticFiles, "static")
|
||||
embeddedStatic, _ := fs.Sub(staticFiles, "static")
|
||||
static := conf.ChooseFS("static", embeddedStatic)
|
||||
fileServer := http.FileServer(utils.NeuteredFileSystem{Fs: http.FS(static)})
|
||||
router.PathPrefix("/contribute.json").Handler(fileServer)
|
||||
router.PathPrefix("/assets").Handler(fileServer)
|
||||
|
32
middlewares/security.go
Normal file
32
middlewares/security.go
Normal file
@ -0,0 +1,32 @@
|
||||
package middlewares
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
var securityHeaders = map[string]string{
|
||||
"Cross-Origin-Opener-Policy": "same-origin",
|
||||
"Content-Security-Policy": "default-src 'self' 'unsafe-inline'; img-src 'self' https: data:; form-action 'self'; block-all-mixed-content;",
|
||||
"X-Frame-Options": "DENY",
|
||||
"X-Content-Type-Options": "nosniff",
|
||||
}
|
||||
|
||||
// SecurityMiddleware is a handler to add some basic security headers to responses
|
||||
type SecurityMiddleware struct {
|
||||
handler http.Handler
|
||||
}
|
||||
|
||||
func NewSecurityMiddleware() func(http.Handler) http.Handler {
|
||||
return func(h http.Handler) http.Handler {
|
||||
return &SecurityMiddleware{h}
|
||||
}
|
||||
}
|
||||
|
||||
func (f *SecurityMiddleware) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
for k, v := range securityHeaders {
|
||||
if w.Header().Get(k) == "" {
|
||||
w.Header().Set(k, v)
|
||||
}
|
||||
}
|
||||
f.handler.ServeHTTP(w, r)
|
||||
}
|
@ -1,30 +0,0 @@
|
||||
package middlewares
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/getsentry/sentry-go"
|
||||
sentryhttp "github.com/getsentry/sentry-go/http"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
type SentryMiddleware struct {
|
||||
handler http.Handler
|
||||
}
|
||||
|
||||
func NewSentryMiddleware() func(http.Handler) http.Handler {
|
||||
return func(h http.Handler) http.Handler {
|
||||
return sentryhttp.New(sentryhttp.Options{
|
||||
Repanic: true,
|
||||
}).Handle(&SentryMiddleware{handler: h})
|
||||
}
|
||||
}
|
||||
|
||||
func (h *SentryMiddleware) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
ctx := context.WithValue(r.Context(), "-", "-")
|
||||
h.handler.ServeHTTP(w, r.WithContext(ctx))
|
||||
if hub := sentry.GetHubFromContext(ctx); hub != nil {
|
||||
if user := GetPrincipal(r); user != nil {
|
||||
hub.Scope().SetUser(sentry.User{ID: user.ID})
|
||||
}
|
||||
}
|
||||
}
|
88
models/mail_address_test.go
Normal file
88
models/mail_address_test.go
Normal file
@ -0,0 +1,88 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestMailAddress_SingleRaw(t *testing.T) {
|
||||
tests := []struct {
|
||||
in string
|
||||
out string
|
||||
}{
|
||||
{
|
||||
"john.doe@example.org",
|
||||
"john.doe@example.org",
|
||||
},
|
||||
{
|
||||
"John Doe <john.doe@example.org>",
|
||||
"john.doe@example.org",
|
||||
},
|
||||
{
|
||||
"invalid",
|
||||
"",
|
||||
},
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
out := MailAddress(test.in).Raw()
|
||||
assert.Equal(t, test.out, out)
|
||||
}
|
||||
}
|
||||
|
||||
func TestMailAddress_AllRaw(t *testing.T) {
|
||||
tests := []struct {
|
||||
in []string
|
||||
out []string
|
||||
}{
|
||||
{
|
||||
[]string{"john.doe@example.org", "foo@bar.com"},
|
||||
[]string{"john.doe@example.org", "foo@bar.com"},
|
||||
},
|
||||
{
|
||||
[]string{"John Doe <john.doe@example.org>", "foo@bar.com"},
|
||||
[]string{"john.doe@example.org", "foo@bar.com"},
|
||||
},
|
||||
{
|
||||
[]string{"john.doe@example.org", "invalid"},
|
||||
[]string{"john.doe@example.org", ""},
|
||||
},
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
out := castAddresses(test.in).RawStrings()
|
||||
assert.EqualValues(t, test.out, out)
|
||||
}
|
||||
}
|
||||
|
||||
func TestMailAddress_AllValid(t *testing.T) {
|
||||
tests := []struct {
|
||||
in []string
|
||||
out bool
|
||||
}{
|
||||
{
|
||||
[]string{"john.doe@example.org", "foo@bar.com"},
|
||||
true,
|
||||
},
|
||||
{
|
||||
[]string{"John Doe <john.doe@example.org>", "ínvalid"},
|
||||
false,
|
||||
},
|
||||
{
|
||||
[]string{"", "invalid"},
|
||||
false,
|
||||
},
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
out := castAddresses(test.in).AllValid()
|
||||
assert.EqualValues(t, test.out, out)
|
||||
}
|
||||
}
|
||||
|
||||
func castAddresses(addresses []string) (m MailAddresses) {
|
||||
for _, a := range addresses {
|
||||
m = append(m, MailAddress(a))
|
||||
}
|
||||
return m
|
||||
}
|
@ -47,6 +47,7 @@ type SummaryItemContainer struct {
|
||||
|
||||
type SummaryViewModel struct {
|
||||
*Summary
|
||||
*SummaryParams
|
||||
User *User
|
||||
LanguageColors map[string]string
|
||||
EditorColors map[string]string
|
||||
|
@ -2,7 +2,6 @@ package api
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"github.com/emvi/logbuch"
|
||||
"github.com/gorilla/mux"
|
||||
conf "github.com/muety/wakapi/config"
|
||||
"github.com/muety/wakapi/middlewares"
|
||||
@ -83,7 +82,7 @@ func (h *HeartbeatApiHandler) Post(w http.ResponseWriter, r *http.Request) {
|
||||
if err := h.heartbeatSrvc.InsertBatch(heartbeats); err != nil {
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
w.Write([]byte(conf.ErrInternalServerError))
|
||||
logbuch.Error("failed to batch-insert heartbeats – %v", err)
|
||||
conf.Log().Request(r).Error("failed to batch-insert heartbeats – %v", err)
|
||||
return
|
||||
}
|
||||
|
||||
@ -92,7 +91,7 @@ func (h *HeartbeatApiHandler) Post(w http.ResponseWriter, r *http.Request) {
|
||||
if _, err := h.userSrvc.Update(user); err != nil {
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
w.Write([]byte(conf.ErrInternalServerError))
|
||||
logbuch.Error("failed to update user – %v", err)
|
||||
conf.Log().Request(r).Error("failed to update user – %v", err)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
@ -78,6 +78,7 @@ func (h *MetricsHandler) Get(w http.ResponseWriter, r *http.Request) {
|
||||
var metrics mm.Metrics
|
||||
|
||||
if userMetrics, err := h.getUserMetrics(reqUser); err != nil {
|
||||
conf.Log().Request(r).Error("%v", err)
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
w.Write([]byte(conf.ErrInternalServerError))
|
||||
return
|
||||
@ -89,6 +90,7 @@ func (h *MetricsHandler) Get(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
if reqUser.IsAdmin {
|
||||
if adminMetrics, err := h.getAdminMetrics(reqUser); err != nil {
|
||||
conf.Log().Request(r).Error("%v", err)
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
w.Write([]byte(conf.ErrInternalServerError))
|
||||
return
|
||||
|
@ -284,14 +284,14 @@ func (h *LoginHandler) PostResetPassword(w http.ResponseWriter, r *http.Request)
|
||||
go func(user *models.User) {
|
||||
link := fmt.Sprintf("%s/set-password?token=%s", h.config.Server.GetPublicUrl(), user.ResetToken)
|
||||
if err := h.mailSrvc.SendPasswordReset(user, link); err != nil {
|
||||
logbuch.Error("failed to send password reset mail to %s – %v", user.ID, err)
|
||||
conf.Log().Request(r).Error("failed to send password reset mail to %s – %v", user.ID, err)
|
||||
} else {
|
||||
logbuch.Info("sent password reset mail to %s", user.ID)
|
||||
}
|
||||
}(u)
|
||||
}
|
||||
} else {
|
||||
logbuch.Warn("password reset requested for unregistered address '%s'", resetRequest.Email)
|
||||
conf.Log().Request(r).Warn("password reset requested for unregistered address '%s'", resetRequest.Email)
|
||||
}
|
||||
|
||||
http.Redirect(w, r, fmt.Sprintf("%s/?success=%s", h.config.Server.BasePath, "an e-mail was sent to you in case your e-mail address was registered"), http.StatusFound)
|
||||
|
@ -24,12 +24,13 @@ type action func(w http.ResponseWriter, r *http.Request) (int, string, string)
|
||||
var templates map[string]*template.Template
|
||||
|
||||
func loadTemplates() {
|
||||
const tplPath = "/views"
|
||||
tpls := template.New("").Funcs(template.FuncMap{
|
||||
"json": utils.Json,
|
||||
"date": utils.FormatDateHuman,
|
||||
"simpledate": utils.FormatDate,
|
||||
"simpledatetime": utils.FormatDateTime,
|
||||
"floordate": utils.FloorDate,
|
||||
"ceildate": utils.CeilDate,
|
||||
"title": strings.Title,
|
||||
"join": strings.Join,
|
||||
"add": utils.Add,
|
||||
@ -55,7 +56,10 @@ func loadTemplates() {
|
||||
})
|
||||
templates = make(map[string]*template.Template)
|
||||
|
||||
files, err := fs.ReadDir(views.TemplateFiles, ".")
|
||||
// Use local file system when in 'dev' environment, go embed file system otherwise
|
||||
templateFs := config.ChooseFS("views", views.TemplateFiles)
|
||||
|
||||
files, err := fs.ReadDir(templateFs, ".")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
@ -66,7 +70,7 @@ func loadTemplates() {
|
||||
continue
|
||||
}
|
||||
|
||||
templateFile, err := views.TemplateFiles.Open(tplName)
|
||||
templateFile, err := templateFs.Open(tplName)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
@ -450,7 +450,7 @@ func (h *SettingsHandler) actionImportWaktime(w http.ResponseWriter, r *http.Req
|
||||
|
||||
if user.Email != "" {
|
||||
if err := h.mailSrvc.SendImportNotification(user, time.Now().Sub(start), int(countAfter-countBefore)); err != nil {
|
||||
logbuch.Error("failed to send import notification mail to %s – %v", user.ID, err)
|
||||
conf.Log().Request(r).Error("failed to send import notification mail to %s – %v", user.ID, err)
|
||||
} else {
|
||||
logbuch.Info("sent import notification mail to %s", user.ID)
|
||||
}
|
||||
@ -472,7 +472,7 @@ func (h *SettingsHandler) actionRegenerateSummaries(w http.ResponseWriter, r *ht
|
||||
|
||||
go func(user *models.User) {
|
||||
if err := h.regenerateSummaries(user); err != nil {
|
||||
logbuch.Error("failed to regenerate summaries for user '%s' – %v", user.ID, err)
|
||||
conf.Log().Request(r).Error("failed to regenerate summaries for user '%s' – %v", user.ID, err)
|
||||
}
|
||||
}(middlewares.GetPrincipal(r))
|
||||
|
||||
@ -489,7 +489,7 @@ func (h *SettingsHandler) actionDeleteUser(w http.ResponseWriter, r *http.Reques
|
||||
logbuch.Info("deleting user '%s' shortly", user.ID)
|
||||
time.Sleep(5 * time.Minute)
|
||||
if err := h.userSrvc.Delete(user); err != nil {
|
||||
logbuch.Error("failed to delete user '%s' – %v", user.ID, err)
|
||||
conf.Log().Request(r).Error("failed to delete user '%s' – %v", user.ID, err)
|
||||
} else {
|
||||
logbuch.Info("successfully deleted user '%s'", user.ID)
|
||||
}
|
||||
|
@ -46,6 +46,7 @@ func (h *SummaryHandler) GetIndex(w http.ResponseWriter, r *http.Request) {
|
||||
r.URL.RawQuery = q.Encode()
|
||||
}
|
||||
|
||||
summaryParams, _ := utils.ParseSummaryParams(r)
|
||||
summary, err, status := su.LoadUserSummary(h.summarySrvc, r)
|
||||
if err != nil {
|
||||
w.WriteHeader(status)
|
||||
@ -62,6 +63,7 @@ func (h *SummaryHandler) GetIndex(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
vm := models.SummaryViewModel{
|
||||
Summary: summary,
|
||||
SummaryParams: summaryParams,
|
||||
User: user,
|
||||
LanguageColors: utils.FilterColors(h.config.App.GetLanguageColors(), summary.Languages),
|
||||
EditorColors: utils.FilterColors(h.config.App.GetEditorColors(), summary.Editors),
|
||||
|
80
scripts/bundle_icons.js
Executable file
80
scripts/bundle_icons.js
Executable file
@ -0,0 +1,80 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
'use strict'
|
||||
|
||||
// Usage:
|
||||
// yarn add -D @iconify/json-tools @iconify/json
|
||||
// node bundle_icons.js
|
||||
// https://iconify.design/docs/icon-bundles/
|
||||
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const { Collection } = require('@iconify/json-tools')
|
||||
|
||||
let icons = [
|
||||
'fxemoji:key',
|
||||
'fxemoji:rocket',
|
||||
'fxemoji:satelliteantenna',
|
||||
'fxemoji:lockandkey',
|
||||
'fxemoji:clipboard',
|
||||
'flat-color-icons:donate',
|
||||
'flat-color-icons:clock',
|
||||
'codicon:github-inverted',
|
||||
'ant-design:check-square-filled',
|
||||
'emojione-v1:white-heavy-check-mark',
|
||||
'emojione-v1:alarm-clock',
|
||||
'emojione-v1:warning',
|
||||
'emojione-v1:backhand-index-pointing-right',
|
||||
'twemoji:light-bulb',
|
||||
'noto:play-button',
|
||||
'noto:stop-button',
|
||||
'noto:lock',
|
||||
'twemoji:gear',
|
||||
'eva:corner-right-down-fill',
|
||||
'bi:heart-fill',
|
||||
]
|
||||
|
||||
const output = path.normalize(path.join(__dirname, '../static/assets/icons.js'))
|
||||
const pretty = false
|
||||
|
||||
// Sort icons by collections: filtered[prefix][array of icons]
|
||||
let filtered = {}
|
||||
icons.forEach(icon => {
|
||||
let parts = icon.split(':'),
|
||||
prefix
|
||||
|
||||
if (parts.length > 1) {
|
||||
prefix = parts.shift()
|
||||
icon = parts.join(':')
|
||||
} else {
|
||||
parts = icon.split('-')
|
||||
prefix = parts.shift()
|
||||
icon = parts.join('-')
|
||||
}
|
||||
if (filtered[prefix] === void 0) {
|
||||
filtered[prefix] = []
|
||||
}
|
||||
if (filtered[prefix].indexOf(icon) === -1) {
|
||||
filtered[prefix].push(icon)
|
||||
}
|
||||
})
|
||||
|
||||
// Parse each collection
|
||||
let code = ''
|
||||
Object.keys(filtered).forEach(prefix => {
|
||||
let collection = new Collection()
|
||||
if (!collection.loadIconifyCollection(prefix)) {
|
||||
console.error('Error loading collection', prefix)
|
||||
return
|
||||
}
|
||||
|
||||
code += collection.scriptify({
|
||||
icons: filtered[prefix],
|
||||
optimize: true,
|
||||
pretty: pretty
|
||||
})
|
||||
})
|
||||
|
||||
// Save code
|
||||
fs.writeFileSync(output, code, 'utf8')
|
||||
console.log('Saved bundle to', output, ' (' + code.length + ' bytes)')
|
@ -73,7 +73,7 @@ func (srv *AggregationService) Run(userIds map[string]bool) error {
|
||||
func (srv *AggregationService) summaryWorker(jobs <-chan *AggregationJob, summaries chan<- *models.Summary) {
|
||||
for job := range jobs {
|
||||
if summary, err := srv.summaryService.Summarize(job.From, job.To, &models.User{ID: job.UserID}); err != nil {
|
||||
logbuch.Error("failed to generate summary (%v, %v, %s) – %v", job.From, job.To, job.UserID, err)
|
||||
config.Log().Error("failed to generate summary (%v, %v, %s) – %v", job.From, job.To, job.UserID, err)
|
||||
} else {
|
||||
logbuch.Info("successfully generated summary (%v, %v, %s)", job.From, job.To, job.UserID)
|
||||
summaries <- summary
|
||||
@ -84,7 +84,7 @@ func (srv *AggregationService) summaryWorker(jobs <-chan *AggregationJob, summar
|
||||
func (srv *AggregationService) persistWorker(summaries <-chan *models.Summary) {
|
||||
for summary := range summaries {
|
||||
if err := srv.summaryService.Insert(summary); err != nil {
|
||||
logbuch.Error("failed to save summary (%v, %v, %s) – %v", summary.UserID, summary.FromTime, summary.ToTime, err)
|
||||
config.Log().Error("failed to save summary (%v, %v, %s) – %v", summary.UserID, summary.FromTime, summary.ToTime, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -94,7 +94,7 @@ func (srv *AggregationService) trigger(jobs chan<- *AggregationJob, userIds map[
|
||||
|
||||
var users []*models.User
|
||||
if allUsers, err := srv.userService.GetAll(); err != nil {
|
||||
logbuch.Error(err.Error())
|
||||
config.Log().Error(err.Error())
|
||||
return err
|
||||
} else if userIds != nil && len(userIds) > 0 {
|
||||
users = make([]*models.User, 0)
|
||||
@ -110,14 +110,14 @@ func (srv *AggregationService) trigger(jobs chan<- *AggregationJob, userIds map[
|
||||
// Get a map from user ids to the time of their latest summary or nil if none exists yet
|
||||
lastUserSummaryTimes, err := srv.summaryService.GetLatestByUser()
|
||||
if err != nil {
|
||||
logbuch.Error(err.Error())
|
||||
config.Log().Error(err.Error())
|
||||
return err
|
||||
}
|
||||
|
||||
// Get a map from user ids to the time of their earliest heartbeats or nil if none exists yet
|
||||
firstUserHeartbeatTimes, err := srv.heartbeatService.GetFirstByUsers()
|
||||
if err != nil {
|
||||
logbuch.Error(err.Error())
|
||||
config.Log().Error(err.Error())
|
||||
return err
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,7 @@ func (w *WakatimeHeartbeatImporter) Import(user *models.User, minFrom time.Time,
|
||||
go func(user *models.User, out chan *models.Heartbeat) {
|
||||
startDate, endDate, err := w.fetchRange()
|
||||
if err != nil {
|
||||
logbuch.Error("failed to fetch date range while importing wakatime heartbeats for user '%s' – %v", user.ID, err)
|
||||
config.Log().Error("failed to fetch date range while importing wakatime heartbeats for user '%s' – %v", user.ID, err)
|
||||
return
|
||||
}
|
||||
|
||||
@ -55,13 +55,13 @@ func (w *WakatimeHeartbeatImporter) Import(user *models.User, minFrom time.Time,
|
||||
|
||||
userAgents, err := w.fetchUserAgents()
|
||||
if err != nil {
|
||||
logbuch.Error("failed to fetch user agents while importing wakatime heartbeats for user '%s' – %v", user.ID, err)
|
||||
config.Log().Error("failed to fetch user agents while importing wakatime heartbeats for user '%s' – %v", user.ID, err)
|
||||
return
|
||||
}
|
||||
|
||||
machinesNames, err := w.fetchMachineNames()
|
||||
if err != nil {
|
||||
logbuch.Error("failed to fetch machine names while importing wakatime heartbeats for user '%s' – %v", user.ID, err)
|
||||
config.Log().Error("failed to fetch machine names while importing wakatime heartbeats for user '%s' – %v", user.ID, err)
|
||||
return
|
||||
}
|
||||
|
||||
@ -84,7 +84,7 @@ func (w *WakatimeHeartbeatImporter) Import(user *models.User, minFrom time.Time,
|
||||
d := day.Format(config.SimpleDateFormat)
|
||||
heartbeats, err := w.fetchHeartbeats(d)
|
||||
if err != nil {
|
||||
logbuch.Error("failed to fetch heartbeats for day '%s' and user '%s' – &v", d, user.ID, err)
|
||||
config.Log().Error("failed to fetch heartbeats for day '%s' and user '%s' – &v", d, user.ID, err)
|
||||
}
|
||||
|
||||
for _, h := range heartbeats {
|
||||
|
@ -42,7 +42,7 @@ type CountTotalTimeResult struct {
|
||||
func (srv *MiscService) ScheduleCountTotalTime() {
|
||||
// Run once initially
|
||||
if err := srv.runCountTotalTime(); err != nil {
|
||||
logbuch.Error("failed to run CountTotalTimeJob: %v", err)
|
||||
logbuch.Fatal("failed to run CountTotalTimeJob: %v", err)
|
||||
}
|
||||
|
||||
s := gocron.NewScheduler(time.Local)
|
||||
@ -80,7 +80,7 @@ func (srv *MiscService) runCountTotalTime() error {
|
||||
func (srv *MiscService) countTotalTimeWorker(jobs <-chan *CountTotalTimeJob, results chan<- *CountTotalTimeResult) {
|
||||
for job := range jobs {
|
||||
if result, err := srv.summaryService.Aliased(time.Time{}, time.Now(), &models.User{ID: job.UserID}, srv.summaryService.Retrieve, false); err != nil {
|
||||
logbuch.Error("failed to count total for user %s: %v", job.UserID, err)
|
||||
config.Log().Error("failed to count total for user %s: %v", job.UserID, err)
|
||||
} else {
|
||||
logbuch.Info("successfully counted total for user %s", job.UserID)
|
||||
results <- &CountTotalTimeResult{
|
||||
|
9
static/assets/icons.js
Normal file
9
static/assets/icons.js
Normal file
File diff suppressed because one or more lines are too long
@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128"><g fill="#eee"><path fill-rule="evenodd" clip-rule="evenodd" d="M64 5.103c-33.347 0-60.388 27.035-60.388 60.388 0 26.682 17.303 49.317 41.297 57.303 3.017.56 4.125-1.31 4.125-2.905 0-1.44-.056-6.197-.082-11.243-16.8 3.653-20.345-7.125-20.345-7.125-2.747-6.98-6.705-8.836-6.705-8.836-5.48-3.748.413-3.67.413-3.67 6.063.425 9.257 6.223 9.257 6.223 5.386 9.23 14.127 6.562 17.573 5.02.542-3.903 2.107-6.568 3.834-8.076-13.413-1.525-27.514-6.704-27.514-29.843 0-6.593 2.36-11.98 6.223-16.21-.628-1.52-2.695-7.662.584-15.98 0 0 5.07-1.623 16.61 6.19C53.7 35 58.867 34.327 64 34.304c5.13.023 10.3.694 15.127 2.033 11.526-7.813 16.59-6.19 16.59-6.19 3.287 8.317 1.22 14.46.593 15.98 3.872 4.23 6.215 9.617 6.215 16.21 0 23.194-14.127 28.3-27.574 29.796 2.167 1.874 4.097 5.55 4.097 11.183 0 8.08-.07 14.583-.07 16.572 0 1.607 1.088 3.49 4.148 2.897 23.98-7.994 41.263-30.622 41.263-57.294C124.388 32.14 97.35 5.104 64 5.104z"/><path d="M26.484 91.806c-.133.3-.605.39-1.035.185-.44-.196-.685-.605-.543-.906.13-.31.603-.395 1.04-.188.44.197.69.61.537.91zm-.743-.55M28.93 94.535c-.287.267-.85.143-1.232-.28-.396-.42-.47-.983-.177-1.254.298-.266.844-.14 1.24.28.394.426.472.984.17 1.255zm-.575-.618M31.312 98.012c-.37.258-.976.017-1.35-.52-.37-.538-.37-1.183.01-1.44.373-.258.97-.025 1.35.507.368.545.368 1.19-.01 1.452zm0 0M34.573 101.373c-.33.365-1.036.267-1.552-.23-.527-.487-.674-1.18-.343-1.544.336-.366 1.045-.264 1.564.23.527.486.686 1.18.333 1.543zm0 0M39.073 103.324c-.147.473-.825.688-1.51.486-.683-.207-1.13-.76-.99-1.238.14-.477.823-.7 1.512-.485.683.206 1.13.756.988 1.237zm0 0M44.016 103.685c.017.498-.563.91-1.28.92-.723.017-1.308-.387-1.315-.877 0-.503.568-.91 1.29-.924.717-.013 1.306.387 1.306.88zm0 0M48.614 102.903c.086.485-.413.984-1.126 1.117-.7.13-1.35-.172-1.44-.653-.086-.498.422-.997 1.122-1.126.714-.123 1.354.17 1.444.663zm0 0"/></g></svg>
|
Before Width: | Height: | Size: 1.9 KiB |
13
static/assets/vendor/iconify.basic.min.js
vendored
Normal file
13
static/assets/vendor/iconify.basic.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
4
static/assets/vendor/tailwind.dist.css
vendored
4
static/assets/vendor/tailwind.dist.css
vendored
@ -745,6 +745,10 @@ video {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.inline {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.flex {
|
||||
display: flex;
|
||||
}
|
||||
|
2
static/assets/vendor/twemoji.min.js
vendored
Normal file
2
static/assets/vendor/twemoji.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@ -10,7 +10,7 @@ func StartOfToday() time.Time {
|
||||
}
|
||||
|
||||
func StartOfDay(date time.Time) time.Time {
|
||||
return time.Date(date.Year(), date.Month(), date.Day(), 0, 0, 0, 0, date.Location())
|
||||
return FloorDate(date)
|
||||
}
|
||||
|
||||
func StartOfWeek() time.Time {
|
||||
@ -29,6 +29,20 @@ func StartOfYear() time.Time {
|
||||
return time.Date(ref.Year(), time.January, 1, 0, 0, 0, 0, ref.Location())
|
||||
}
|
||||
|
||||
// FloorDate rounds date down to the start of the day
|
||||
func FloorDate(date time.Time) time.Time {
|
||||
return date.Truncate(24 * time.Hour)
|
||||
}
|
||||
|
||||
// CeilDate rounds date up to the start of next day if date is not already a start (00:00:00)
|
||||
func CeilDate(date time.Time) time.Time {
|
||||
floored := FloorDate(date)
|
||||
if floored == date {
|
||||
return floored
|
||||
}
|
||||
return floored.Add(24 * time.Hour)
|
||||
}
|
||||
|
||||
func SplitRangeByDays(from time.Time, to time.Time) [][]time.Time {
|
||||
intervals := make([][]time.Time, 0)
|
||||
|
||||
|
30
utils/date_test.go
Normal file
30
utils/date_test.go
Normal file
@ -0,0 +1,30 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestDate_Ceil(t *testing.T) {
|
||||
tests := []struct {
|
||||
in string
|
||||
out string
|
||||
}{
|
||||
{
|
||||
"02 Jan 06 15:04 MST",
|
||||
"03 Jan 06 00:00 MST",
|
||||
},
|
||||
{
|
||||
"03 Jan 06 00:00 MST",
|
||||
"03 Jan 06 00:00 MST",
|
||||
},
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
inDate, _ := time.Parse(time.RFC822, test.in)
|
||||
outDate, _ := time.Parse(time.RFC822, test.out)
|
||||
out := CeilDate(inDate)
|
||||
assert.Equal(t, outDate, out)
|
||||
}
|
||||
}
|
@ -2,7 +2,7 @@ package utils
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"github.com/emvi/logbuch"
|
||||
"github.com/muety/wakapi/config"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
@ -10,6 +10,6 @@ func RespondJSON(w http.ResponseWriter, status int, object interface{}) {
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
w.WriteHeader(status)
|
||||
if err := json.NewEncoder(w).Encode(object); err != nil {
|
||||
logbuch.Error("error while writing json response: %v", err)
|
||||
config.Log().Error("error while writing json response: %v", err)
|
||||
}
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
1.26.4
|
||||
1.26.5
|
||||
|
@ -1,2 +1,4 @@
|
||||
<script src="assets/vendor/iconify.basic.min.js"></script>
|
||||
<script src="assets/vendor/seedrandom.min.js"></script>
|
||||
<script src="assets/vendor/Chart.bundle.min.js"></script>
|
||||
<script src="assets/vendor/Chart.bundle.min.js"></script>
|
||||
<script src="assets/icons.js"></script>
|
@ -3,7 +3,7 @@
|
||||
v{{ getVersion }} @ {{ getDbType }}
|
||||
</div>
|
||||
<div>
|
||||
Made with 🤍 by <a href="https://muetsch.io" class="border-b border-green-700">Ferdinand Mütsch</a> as <a
|
||||
Made with <span class="iconify inline" data-icon="bi:heart-fill"></span> by <a href="https://muetsch.io" class="border-b border-green-700">Ferdinand Mütsch</a> as <a
|
||||
href="https://github.com/muety/wakapi" class="border-b border-green-700">open-source</a> software
|
||||
</div>
|
||||
<div>
|
||||
|
@ -11,21 +11,21 @@
|
||||
|
||||
<div class="absolute flex top-0 right-0 mr-8 mt-10 py-2">
|
||||
<div class="mx-1">
|
||||
<a href="login" class="py-1 px-3 h-8 block rounded border border-green-700 text-white text-sm">🔑
|
||||
Login️</a>
|
||||
<a href="login" class="py-1 px-3 h-8 block rounded border border-green-700 text-white text-sm">
|
||||
<span class="iconify inline" data-icon="fxemoji:key"></span> Login️</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<main class="mt-10 flex-grow flex justify-center w-full">
|
||||
<div class="flex flex-col text-white">
|
||||
<h1 class="text-4xl font-semibold antialiased text-center mb-2">Keep Track of <span
|
||||
class="text-green-700">Your</span> Coding Time 🕓</h1>
|
||||
class="text-green-700">Your</span> Coding Time <span class="iconify inline" data-icon="flat-color-icons:clock"></span></h1>
|
||||
<p class="text-center text-gray-500 text-xl my-2">Wakapi is an open-source tool that helps you keep track of the
|
||||
time you have spent coding on different projects in different programming languages and more. Ideal for
|
||||
statistics freaks and anyone else.</p>
|
||||
|
||||
<p class="text-center text-gray-500 text-xl my-4">
|
||||
<span class="mr-1">💡 The system has tracked a total of </span>
|
||||
<span class="mr-1"><span class="iconify inline" data-icon="twemoji:light-bulb"></span> The system has tracked a total of </span>
|
||||
{{ range $d := .TotalHours | printf "%d" | toRunes }}
|
||||
<span class="bg-gray-900 rounded-sm p-1 border border-gray-700 font-mono" style="margin: auto -2px;" title="{{ $.TotalHours }} hours (updated every hour)">{{ $d }}</span>
|
||||
{{ end }}
|
||||
@ -39,20 +39,20 @@
|
||||
<div class="flex justify-center mt-4 mb-8 space-x-2">
|
||||
<a href="login">
|
||||
<button type="button"
|
||||
class="py-1 px-3 rounded bg-green-700 hover:bg-green-800 text-white font-semibold">🚀 Try it!
|
||||
class="py-1 px-3 rounded bg-green-700 hover:bg-green-800 text-white font-semibold"><span class="iconify inline" data-icon="fxemoji:rocket"></span> Try it!
|
||||
</button>
|
||||
</a>
|
||||
<a href="https://github.com/muety/wakapi#%EF%B8%8F-how-to-use" target="_blank" rel="noopener noreferrer">
|
||||
<button type="button" class="py-1 px-3 h-8 rounded border border-green-700 text-white">📡 Host it
|
||||
<button type="button" class="py-1 px-3 h-8 rounded border border-green-700 text-white"><span class="iconify inline" data-icon="fxemoji:satelliteantenna"></span> Host it
|
||||
</button>
|
||||
</a>
|
||||
<a href="https://liberapay.com/muety" target="_blank" rel="noopener noreferrer">
|
||||
<button type="button" class="py-1 px-3 h-8 rounded border border-green-700 text-white">🙏 Support it
|
||||
<button type="button" class="py-1 px-3 h-8 rounded border border-green-700 text-white"><span class="iconify inline" data-icon="flat-color-icons:donate"></span> Support it
|
||||
</button>
|
||||
</a>
|
||||
<a href="https://github.com/muety/wakapi" target="_blank" rel="noopener noreferrer">
|
||||
<button type="button" class="py-1 px-3 h-8 rounded border border-green-700 text-white">
|
||||
<img alt="GitHub Icon" src="assets/images/ghicon.svg" width="22px">
|
||||
<span class="iconify inline text-white" data-icon="codicon:github-inverted"></span>
|
||||
</button>
|
||||
</a>
|
||||
</div>
|
||||
@ -65,19 +65,19 @@
|
||||
<h1 class="font-semibold text-xl text-white m-0 border-b-4 border-green-700">Features</h1>
|
||||
<div class="mt-4 text-lg">
|
||||
<ul>
|
||||
<li>✅ 100 % free and open-source</li>
|
||||
<li>✅ Built by developers for developers</li>
|
||||
<li>✅ Fancy statistics and plots</li>
|
||||
<li>✅ Cool badges for readmes</li>
|
||||
<li>✅ Intuitive REST API</li>
|
||||
<li>✅ Compatible with <a href="https://wakatime.com" target="_blank"
|
||||
<li><span class="iconify inline text-green-700" data-icon="ant-design:check-square-filled"></span> 100 % free and open-source</li>
|
||||
<li><span class="iconify inline text-green-700" data-icon="ant-design:check-square-filled"></span> Built by developers for developers</li>
|
||||
<li><span class="iconify inline text-green-700" data-icon="ant-design:check-square-filled"></span> Fancy statistics and plots</li>
|
||||
<li><span class="iconify inline text-green-700" data-icon="ant-design:check-square-filled"></span> Cool badges for readmes</li>
|
||||
<li><span class="iconify inline text-green-700" data-icon="ant-design:check-square-filled"></span> Intuitive REST API</li>
|
||||
<li><span class="iconify inline text-green-700" data-icon="ant-design:check-square-filled"></span> Compatible with <a href="https://wakatime.com" target="_blank"
|
||||
rel="noopener noreferrer" class="underline">Wakatime</a></li>
|
||||
<li>✅ <a href="https://prometheus.io" target="_blank" rel="noopener noreferrer"
|
||||
<li><span class="iconify inline text-green-700" data-icon="ant-design:check-square-filled"></span> <a href="https://prometheus.io" target="_blank" rel="noopener noreferrer"
|
||||
class="underline">Prometheus</a> metrics via <a
|
||||
href="https://github.com/MacroPower/wakatime_exporter" target="_blank"
|
||||
rel="noopener noreferrer" class="underline">exporter</a></li>
|
||||
<li>✅ Lightning fast</li>
|
||||
<li>✅ Self-hosted</li>
|
||||
<li><span class="iconify inline text-green-700" data-icon="ant-design:check-square-filled"></span> Lightning fast</li>
|
||||
<li><span class="iconify inline text-green-700" data-icon="ant-design:check-square-filled"></span> Self-hosted</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -383,7 +383,7 @@
|
||||
<div class="flex justify-end">
|
||||
<button id="btn-import-wakatime" type="button" style="width: 130px"
|
||||
class="py-1 px-3 my-3 rounded bg-green-700 hover:bg-green-800 text-white text-sm">
|
||||
⤵ Import Data
|
||||
<span class="iconify inline" data-icon="eva:corner-right-down-fill"></span> Import Data
|
||||
</button>
|
||||
</div>
|
||||
{{ end }}
|
||||
@ -394,7 +394,7 @@
|
||||
</form>
|
||||
|
||||
<p class="mt-6">
|
||||
<span class="font-semibold">👉 Please note:</span>
|
||||
<span class="font-semibold"><span class="iconify inline" data-icon="emojione-v1:backhand-index-pointing-right"></span> Please note:</span>
|
||||
<span>When enabling this feature, the operators of this server will, in theory (!), have unlimited access to your data stored in WakaTime. If you are concerned about your privacy, please do not enable this integration or wait for OAuth 2 authentication (<a
|
||||
class="underline" target="_blank" href="https://github.com/muety/wakapi/issues/94"
|
||||
rel="noopener noreferrer">#94</a>) to be implemented.</span>
|
||||
@ -474,7 +474,7 @@
|
||||
<details class="mb-8 pb-8">
|
||||
<summary class="cursor-pointer">
|
||||
<h2 class="font-semibold text-lg text-white m-0 border-b-2 border-green-700 inline-block" id="danger">
|
||||
⚠️ Danger Zone
|
||||
<span class="iconify inline" data-icon="emojione-v1:warning"></span> Danger Zone
|
||||
</h2>
|
||||
</summary>
|
||||
<div class="w-full">
|
||||
|
@ -15,18 +15,20 @@
|
||||
value="{{ .ApiKey }}" style="min-width: 330px">
|
||||
</div>
|
||||
<div class="flex items-center px-2 border-l border-gray-700">
|
||||
<button title="Copy to clipboard" onclick="copyApiKey(event)">📋</button>
|
||||
<button title="Copy to clipboard" onclick="copyApiKey(event)"><span class="iconify inline" data-icon="fxemoji:clipboard"></span></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="absolute flex top-0 right-0 mr-8 mt-10 py-2">
|
||||
<div class="mx-1">
|
||||
<button type="button" class="py-1 px-3 h-8 rounded border border-green-700 text-white text-sm"
|
||||
onclick="showApiKeyPopup(event)">🔐
|
||||
onclick="showApiKeyPopup(event)"><span class="iconify inline" data-icon="fxemoji:lockandkey"></span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="mx-1">
|
||||
<a href="settings" class="py-1 px-3 h-8 block rounded border border-green-700 text-white text-sm">⚙️</a>
|
||||
<a href="settings" class="py-1 px-3 h-8 block rounded border border-green-700 text-white text-sm">
|
||||
<span class="iconify inline" data-icon="twemoji:gear"></span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="mx-1">
|
||||
<form action="logout" method="post">
|
||||
@ -44,14 +46,14 @@
|
||||
<div class="self-center border border-gray-700 shadow mt-8 rounded-md p-4 bg-gray-900">
|
||||
<form class="text-white flex flex-nowrap items-center justify-center self-center max-w-xl flex-wrap space-x-8">
|
||||
<div class="flex space-x-1">
|
||||
<label for="from-date-picker" class="text-gray-300 pl-1">▶️ Start:</label>
|
||||
<label for="from-date-picker" class="text-gray-300 pl-1"><span class="iconify inline" data-icon="noto:play-button"></span> Start:</label>
|
||||
<input id="from-date-picker" type="date" name="from" max="{{ .ToTime.T | simpledate }}" class="text-sm text-gray-300 bg-gray-800 rounded-md text-center cursor-pointer"
|
||||
value="{{ .FromTime.T | simpledate }}" required>
|
||||
value="{{ .From | simpledate }}" required>
|
||||
</div>
|
||||
<div class="flex space-x-1">
|
||||
<label for="to-date-picker" class="text-gray-300 pl-1">⏹️ End:</label>
|
||||
<label for="to-date-picker" class="text-gray-300 pl-1"><span class="iconify inline" data-icon="noto:stop-button"></span> End:</label>
|
||||
<input id="to-date-picker" type="date" name="to" min="{{ .FromTime.T | simpledate }}" class="text-sm text-gray-300 bg-gray-800 rounded-md text-center cursor-pointer"
|
||||
value="{{ .ToTime.T | simpledate }}" required>
|
||||
value="{{ .To | ceildate | simpledate }}" required>
|
||||
</div>
|
||||
<div>
|
||||
<button type="submit" class="py-1 px-3 rounded bg-green-700 hover:bg-green-800 text-white text-sm">Show</button>
|
||||
@ -80,7 +82,7 @@
|
||||
{{ if .User.HasData }}
|
||||
|
||||
<span class="text-white text-lg text-gray-300 text-center mb-4">
|
||||
<span class="text-xl">⏱️ </span>
|
||||
<span class="text-xl"><span class="iconify inline" data-icon="emojione-v1:alarm-clock"></span>️ </span>
|
||||
Showing a total of <span id="total-span" title="Total Hours" class="text-white text-xl font-semibold border-b-2 border-green-700"></span>
|
||||
<span class="text-sm my-2">
|
||||
(from <span title="Start Time" class="border-b border-gray-700">{{ .FromTime.T | date }}</span> to <span title="End Time" class="border-b border-gray-700">{{ .ToTime.T | date }}</span>)
|
||||
|
Reference in New Issue
Block a user