mirror of
https://github.com/muety/wakapi.git
synced 2023-08-10 21:12:56 +03:00
Compare commits
15 Commits
Author | SHA1 | Date | |
---|---|---|---|
71d1b2177b | |||
b2a3579be9 | |||
42a6e9d923 | |||
1f44ccadba | |||
6ea72c6d02 | |||
d93348842a | |||
fb92747129 | |||
4e6e665e19 | |||
a3d8c4d464 | |||
e9eaa9da53 | |||
5adb795f59 | |||
a552073d18 | |||
de0401d4bb | |||
c39538db13 | |||
189a09d91f |
19
.github/workflows/linux-build-on-release.yml
vendored
19
.github/workflows/linux-build-on-release.yml
vendored
@ -1,13 +1,15 @@
|
|||||||
name: Build Wakapi on Linux
|
name: Build Wakapi on Linux
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
push:
|
||||||
|
pull_request:
|
||||||
release:
|
release:
|
||||||
types:
|
types:
|
||||||
- created
|
- created
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-release:
|
build-and-release:
|
||||||
name: Build and add to Release
|
name: Build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
@ -22,18 +24,21 @@ jobs:
|
|||||||
|
|
||||||
- name: Get dependencies
|
- name: Get dependencies
|
||||||
run: |
|
run: |
|
||||||
go get -v -t -d ./...
|
go get github.com/markbates/pkger/cmd/pkger
|
||||||
|
go get
|
||||||
|
go generate
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: GO111MODULE=on go build -v .
|
run: GO111MODULE=on go build -v .
|
||||||
|
|
||||||
- name: Zip Release
|
- name: Zip executable and sample config
|
||||||
uses: TheDoctor0/zip-release@v0.3.0
|
if: github.event_name == 'release'
|
||||||
with:
|
run: |
|
||||||
filename: release.zip
|
cp config.default.yml config.yml
|
||||||
exclusions: '*.git*'
|
zip -9 release.zip wakapi config.yml
|
||||||
|
|
||||||
- name: Upload built executable to Release
|
- name: Upload built executable to Release
|
||||||
|
if: github.event_name == 'release'
|
||||||
uses: actions/upload-release-asset@v1.0.2
|
uses: actions/upload-release-asset@v1.0.2
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
14
.github/workflows/win-build-on-release.yml
vendored
14
.github/workflows/win-build-on-release.yml
vendored
@ -1,13 +1,15 @@
|
|||||||
name: Build Wakapi on Windows
|
name: Build Wakapi on Windows
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
push:
|
||||||
|
pull_request:
|
||||||
release:
|
release:
|
||||||
types:
|
types:
|
||||||
- created
|
- created
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-release:
|
build-and-release:
|
||||||
name: Build and add to release
|
name: Build
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
@ -22,7 +24,9 @@ jobs:
|
|||||||
|
|
||||||
- name: Get dependencies
|
- name: Get dependencies
|
||||||
run: |
|
run: |
|
||||||
go get -v -t -d ./...
|
go get github.com/markbates/pkger/cmd/pkger
|
||||||
|
go get
|
||||||
|
go generate
|
||||||
|
|
||||||
- name: Enable Go 1.11 modules
|
- name: Enable Go 1.11 modules
|
||||||
run: cmd /c "set GO111MODULE=on"
|
run: cmd /c "set GO111MODULE=on"
|
||||||
@ -31,9 +35,13 @@ jobs:
|
|||||||
run: go build -v .
|
run: go build -v .
|
||||||
|
|
||||||
- name: Compress working folder
|
- name: Compress working folder
|
||||||
run: Compress-Archive -Path .\* -DestinationPath release.zip
|
if: github.event_name == 'release'
|
||||||
|
run: |
|
||||||
|
cp .\config.default.yml .\config.yml
|
||||||
|
Compress-Archive -Path .\wakapi.exe, .\config.yml -DestinationPath release.zip
|
||||||
|
|
||||||
- name: Upload built executable to Release
|
- name: Upload built executable to Release
|
||||||
|
if: github.event_name == 'release'
|
||||||
uses: actions/upload-release-asset@v1.0.2
|
uses: actions/upload-release-asset@v1.0.2
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -9,3 +9,4 @@ build
|
|||||||
config*.yml
|
config*.yml
|
||||||
!config.default.yml
|
!config.default.yml
|
||||||
config.ini
|
config.ini
|
||||||
|
pkged.go
|
||||||
|
@ -4,17 +4,15 @@ FROM golang:1.15 AS build-env
|
|||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
|
|
||||||
ADD ./go.mod .
|
ADD ./go.mod .
|
||||||
RUN go mod download
|
RUN go mod download && go get github.com/markbates/pkger/cmd/pkger
|
||||||
|
|
||||||
ADD . .
|
ADD . .
|
||||||
RUN go build -o wakapi
|
RUN go generate && go build -o wakapi
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
RUN cp /src/wakapi . && \
|
RUN cp /src/wakapi . && \
|
||||||
cp /src/config.default.yml config.yml && \
|
cp /src/config.default.yml config.yml && \
|
||||||
sed -i 's/listen_ipv6: ::1/listen_ipv6: /g' config.yml && \
|
sed -i 's/listen_ipv6: ::1/listen_ipv6: /g' config.yml && \
|
||||||
cp /src/version.txt . && \
|
|
||||||
cp -r /src/static /src/data /src/migrations /src/views . && \
|
|
||||||
cp /src/wait-for-it.sh .
|
cp /src/wait-for-it.sh .
|
||||||
|
|
||||||
# Run Stage
|
# Run Stage
|
||||||
@ -26,6 +24,9 @@ RUN cp /src/wakapi . && \
|
|||||||
FROM debian
|
FROM debian
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
RUN apt update && \
|
||||||
|
apt install -y ca-certificates
|
||||||
|
|
||||||
ENV ENVIRONMENT prod
|
ENV ENVIRONMENT prod
|
||||||
ENV WAKAPI_DB_TYPE sqlite3
|
ENV WAKAPI_DB_TYPE sqlite3
|
||||||
ENV WAKAPI_DB_USER ''
|
ENV WAKAPI_DB_USER ''
|
||||||
|
10
README.md
10
README.md
@ -36,16 +36,16 @@ To use the hosted version set `api_url = https://wakapi.dev/api/heartbeat`. Howe
|
|||||||
* Fedora / RHEL: `dnf install @development-tools`
|
* Fedora / RHEL: `dnf install @development-tools`
|
||||||
* Ubuntu / Debian: `apt install build-essential`
|
* Ubuntu / Debian: `apt install build-essential`
|
||||||
* Windows: See [here](https://github.com/mattn/go-sqlite3/issues/214#issuecomment-253216476)
|
* Windows: See [here](https://github.com/mattn/go-sqlite3/issues/214#issuecomment-253216476)
|
||||||
* _Optional_: A MySQL- or Postgres database
|
* _Optional_: One of the [supported databases](#supported-databases)
|
||||||
|
|
||||||
**On your local machine:**
|
**On your local machine:**
|
||||||
* [WakaTime plugin](https://wakatime.com/plugins) for your editor / IDE
|
* [WakaTime plugin](https://wakatime.com/plugins) for your editor / IDE
|
||||||
|
|
||||||
## ⌨️ Server Setup
|
## ⌨️ Server Setup
|
||||||
### Run from source
|
### Run from source
|
||||||
1. Clone the project
|
|
||||||
1. Copy `config.default.yml` to `config.yml` and adapt it to your needs
|
1. Copy `config.default.yml` to `config.yml` and adapt it to your needs
|
||||||
1. Build executable: `GO111MODULE=on go build`
|
1. Install packaging tool: `GO111MODULE=on go get github.com/markbates/pkger/cmd/pkger`
|
||||||
|
1. Build executable: `GO111MODULE=on go generate && go build -o wakapi`
|
||||||
1. Run server: `./wakapi`
|
1. Run server: `./wakapi`
|
||||||
|
|
||||||
**As an alternative** to building from source you can also grab a pre-built [release](https://github.com/muety/wakapi/releases). Steps 2, 3 and 5 apply analogously.
|
**As an alternative** to building from source you can also grab a pre-built [release](https://github.com/muety/wakapi/releases). Steps 2, 3 and 5 apply analogously.
|
||||||
@ -111,9 +111,11 @@ api_key = the_api_key_printed_to_the_console_after_starting_the_server`
|
|||||||
You can view your API Key after logging in to the web interface.
|
You can view your API Key after logging in to the web interface.
|
||||||
|
|
||||||
### Optional: Client-side proxy
|
### Optional: Client-side proxy
|
||||||
|
|
||||||
See the [advanced setup instructions](docs/advanced_setup.md).
|
See the [advanced setup instructions](docs/advanced_setup.md).
|
||||||
|
|
||||||
|
### Optional: WakaTime relay
|
||||||
|
You can connect Wakapi with WakaTime in a way that all heartbeats sent to Wakapi are relayed. This way, you can use both services at the same time. Go to the settings page of your instance to configure this integration.
|
||||||
|
|
||||||
## 🔧 API Endpoints
|
## 🔧 API Endpoints
|
||||||
The following API endpoints are available. A more detailed Swagger documentation is about to come ([#40](https://github.com/muety/wakapi/issues/40)).
|
The following API endpoints are available. A more detailed Swagger documentation is about to come ([#40](https://github.com/muety/wakapi/issues/40)).
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"github.com/gorilla/securecookie"
|
"github.com/gorilla/securecookie"
|
||||||
"github.com/jinzhu/configor"
|
"github.com/jinzhu/configor"
|
||||||
|
"github.com/markbates/pkger"
|
||||||
"github.com/muety/wakapi/models"
|
"github.com/muety/wakapi/models"
|
||||||
migrate "github.com/rubenv/sql-migrate"
|
migrate "github.com/rubenv/sql-migrate"
|
||||||
"gorm.io/driver/mysql"
|
"gorm.io/driver/mysql"
|
||||||
@ -126,8 +127,8 @@ func (c *Config) GetMigrationFunc(dbDialect string) models.MigrationFunc {
|
|||||||
|
|
||||||
func (c *Config) GetFixturesFunc(dbDialect string) models.MigrationFunc {
|
func (c *Config) GetFixturesFunc(dbDialect string) models.MigrationFunc {
|
||||||
return func(db *gorm.DB) error {
|
return func(db *gorm.DB) error {
|
||||||
migrations := &migrate.FileMigrationSource{
|
migrations := &migrate.HttpFileSystemMigrationSource {
|
||||||
Dir: "migrations/common/fixtures",
|
FileSystem: pkger.Dir("/migrations"),
|
||||||
}
|
}
|
||||||
|
|
||||||
migrate.SetIgnoreUnknown(true)
|
migrate.SetIgnoreUnknown(true)
|
||||||
@ -204,7 +205,7 @@ func IsDev(env string) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func readVersion() string {
|
func readVersion() string {
|
||||||
file, err := os.Open("version.txt")
|
file, err := pkger.Open("/version.txt")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
@ -215,7 +216,7 @@ func readVersion() string {
|
|||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return string(bytes)
|
return strings.TrimSpace(string(bytes))
|
||||||
}
|
}
|
||||||
|
|
||||||
func readLanguageColors() map[string]string {
|
func readLanguageColors() map[string]string {
|
||||||
@ -227,12 +228,17 @@ func readLanguageColors() map[string]string {
|
|||||||
Url string `json:"url"`
|
Url string `json:"url"`
|
||||||
}
|
}
|
||||||
|
|
||||||
data, err := ioutil.ReadFile("data/colors.json")
|
file, err := pkger.Open("/data/colors.json")
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
defer file.Close()
|
||||||
|
bytes, err := ioutil.ReadAll(file)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := json.Unmarshal(data, &rawColors); err != nil {
|
if err := json.Unmarshal(bytes, &rawColors); err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,9 @@
|
|||||||
mode: set
|
mode: set
|
||||||
|
github.com/muety/wakapi/models/alias.go:12.32,14.2 1 0
|
||||||
|
github.com/muety/wakapi/models/alias.go:16.37,17.35 1 0
|
||||||
|
github.com/muety/wakapi/models/alias.go:22.2,22.14 1 0
|
||||||
|
github.com/muety/wakapi/models/alias.go:17.35,18.18 1 0
|
||||||
|
github.com/muety/wakapi/models/alias.go:18.18,20.4 1 0
|
||||||
github.com/muety/wakapi/models/filters.go:16.56,17.16 1 0
|
github.com/muety/wakapi/models/filters.go:16.56,17.16 1 0
|
||||||
github.com/muety/wakapi/models/filters.go:29.2,29.19 1 0
|
github.com/muety/wakapi/models/filters.go:29.2,29.19 1 0
|
||||||
github.com/muety/wakapi/models/filters.go:18.22,19.32 1 0
|
github.com/muety/wakapi/models/filters.go:18.22,19.32 1 0
|
||||||
@ -81,15 +86,10 @@ github.com/muety/wakapi/models/summary.go:221.11,229.6 1 1
|
|||||||
github.com/muety/wakapi/models/summary.go:246.33,248.2 1 1
|
github.com/muety/wakapi/models/summary.go:246.33,248.2 1 1
|
||||||
github.com/muety/wakapi/models/summary.go:250.43,252.2 1 1
|
github.com/muety/wakapi/models/summary.go:250.43,252.2 1 1
|
||||||
github.com/muety/wakapi/models/summary.go:254.38,256.2 1 1
|
github.com/muety/wakapi/models/summary.go:254.38,256.2 1 1
|
||||||
github.com/muety/wakapi/models/user.go:34.43,37.2 1 0
|
github.com/muety/wakapi/models/user.go:35.43,38.2 1 0
|
||||||
github.com/muety/wakapi/models/user.go:39.33,43.2 1 0
|
github.com/muety/wakapi/models/user.go:40.33,44.2 1 0
|
||||||
github.com/muety/wakapi/models/user.go:45.45,47.2 1 0
|
github.com/muety/wakapi/models/user.go:46.45,48.2 1 0
|
||||||
github.com/muety/wakapi/models/user.go:49.45,51.2 1 0
|
github.com/muety/wakapi/models/user.go:50.45,52.2 1 0
|
||||||
github.com/muety/wakapi/models/alias.go:12.32,14.2 1 0
|
|
||||||
github.com/muety/wakapi/models/alias.go:16.37,17.35 1 0
|
|
||||||
github.com/muety/wakapi/models/alias.go:22.2,22.14 1 0
|
|
||||||
github.com/muety/wakapi/models/alias.go:17.35,18.18 1 0
|
|
||||||
github.com/muety/wakapi/models/alias.go:18.18,20.4 1 0
|
|
||||||
github.com/muety/wakapi/models/heartbeat.go:26.34,28.2 1 1
|
github.com/muety/wakapi/models/heartbeat.go:26.34,28.2 1 1
|
||||||
github.com/muety/wakapi/models/heartbeat.go:30.65,31.28 1 1
|
github.com/muety/wakapi/models/heartbeat.go:30.65,31.28 1 1
|
||||||
github.com/muety/wakapi/models/heartbeat.go:34.2,35.45 2 1
|
github.com/muety/wakapi/models/heartbeat.go:34.2,35.45 2 1
|
||||||
@ -132,12 +132,6 @@ github.com/muety/wakapi/models/shared.go:74.51,77.2 2 0
|
|||||||
github.com/muety/wakapi/models/shared.go:79.37,82.2 2 0
|
github.com/muety/wakapi/models/shared.go:79.37,82.2 2 0
|
||||||
github.com/muety/wakapi/models/shared.go:84.35,86.2 1 0
|
github.com/muety/wakapi/models/shared.go:84.35,86.2 1 0
|
||||||
github.com/muety/wakapi/models/shared.go:88.34,90.2 1 0
|
github.com/muety/wakapi/models/shared.go:88.34,90.2 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:18.79,20.54 2 0
|
github.com/muety/wakapi/utils/auth.go:18.79,20.54 2 0
|
||||||
github.com/muety/wakapi/utils/auth.go:24.2,26.16 3 0
|
github.com/muety/wakapi/utils/auth.go:24.2,26.16 3 0
|
||||||
github.com/muety/wakapi/utils/auth.go:30.2,32.45 3 0
|
github.com/muety/wakapi/utils/auth.go:30.2,32.45 3 0
|
||||||
@ -215,61 +209,12 @@ github.com/muety/wakapi/utils/summary.go:49.8,51.17 2 0
|
|||||||
github.com/muety/wakapi/utils/summary.go:55.3,56.17 2 0
|
github.com/muety/wakapi/utils/summary.go:55.3,56.17 2 0
|
||||||
github.com/muety/wakapi/utils/summary.go:51.17,53.4 1 0
|
github.com/muety/wakapi/utils/summary.go:51.17,53.4 1 0
|
||||||
github.com/muety/wakapi/utils/summary.go:56.17,58.4 1 0
|
github.com/muety/wakapi/utils/summary.go:56.17,58.4 1 0
|
||||||
github.com/muety/wakapi/config/config.go:83.70,85.2 1 0
|
github.com/muety/wakapi/utils/template.go:8.41,10.16 2 0
|
||||||
github.com/muety/wakapi/config/config.go:87.65,89.2 1 0
|
github.com/muety/wakapi/utils/template.go:13.2,13.23 1 0
|
||||||
github.com/muety/wakapi/config/config.go:91.82,101.2 1 0
|
github.com/muety/wakapi/utils/template.go:10.16,12.3 1 0
|
||||||
github.com/muety/wakapi/config/config.go:103.31,105.2 1 0
|
github.com/muety/wakapi/utils/template.go:16.37,17.30 1 0
|
||||||
github.com/muety/wakapi/config/config.go:107.32,109.2 1 0
|
github.com/muety/wakapi/utils/template.go:20.2,20.10 1 0
|
||||||
github.com/muety/wakapi/config/config.go:111.74,112.19 1 0
|
github.com/muety/wakapi/utils/template.go:17.30,19.3 1 0
|
||||||
github.com/muety/wakapi/config/config.go:113.10,114.34 1 0
|
|
||||||
github.com/muety/wakapi/config/config.go:114.34,123.4 8 0
|
|
||||||
github.com/muety/wakapi/config/config.go:127.73,128.33 1 0
|
|
||||||
github.com/muety/wakapi/config/config.go:128.33,136.17 5 0
|
|
||||||
github.com/muety/wakapi/config/config.go:140.3,141.13 2 0
|
|
||||||
github.com/muety/wakapi/config/config.go:136.17,138.4 1 0
|
|
||||||
github.com/muety/wakapi/config/config.go:145.50,146.19 1 0
|
|
||||||
github.com/muety/wakapi/config/config.go:159.2,159.12 1 0
|
|
||||||
github.com/muety/wakapi/config/config.go:147.23,151.5 1 0
|
|
||||||
github.com/muety/wakapi/config/config.go:152.26,155.5 1 0
|
|
||||||
github.com/muety/wakapi/config/config.go:156.24,157.48 1 0
|
|
||||||
github.com/muety/wakapi/config/config.go:162.53,172.2 1 1
|
|
||||||
github.com/muety/wakapi/config/config.go:174.56,176.16 2 1
|
|
||||||
github.com/muety/wakapi/config/config.go:180.2,187.3 1 1
|
|
||||||
github.com/muety/wakapi/config/config.go:176.16,178.3 1 0
|
|
||||||
github.com/muety/wakapi/config/config.go:190.54,192.2 1 1
|
|
||||||
github.com/muety/wakapi/config/config.go:194.60,196.2 1 0
|
|
||||||
github.com/muety/wakapi/config/config.go:198.59,200.2 1 0
|
|
||||||
github.com/muety/wakapi/config/config.go:202.29,204.2 1 1
|
|
||||||
github.com/muety/wakapi/config/config.go:206.27,208.16 2 0
|
|
||||||
github.com/muety/wakapi/config/config.go:211.2,214.16 3 0
|
|
||||||
github.com/muety/wakapi/config/config.go:218.2,218.22 1 0
|
|
||||||
github.com/muety/wakapi/config/config.go:208.16,210.3 1 0
|
|
||||||
github.com/muety/wakapi/config/config.go:214.16,216.3 1 0
|
|
||||||
github.com/muety/wakapi/config/config.go:221.45,231.16 4 0
|
|
||||||
github.com/muety/wakapi/config/config.go:235.2,235.57 1 0
|
|
||||||
github.com/muety/wakapi/config/config.go:239.2,239.30 1 0
|
|
||||||
github.com/muety/wakapi/config/config.go:243.2,243.15 1 0
|
|
||||||
github.com/muety/wakapi/config/config.go:231.16,233.3 1 0
|
|
||||||
github.com/muety/wakapi/config/config.go:235.57,237.3 1 0
|
|
||||||
github.com/muety/wakapi/config/config.go:239.30,241.3 1 0
|
|
||||||
github.com/muety/wakapi/config/config.go:246.38,247.43 1 0
|
|
||||||
github.com/muety/wakapi/config/config.go:251.2,251.15 1 0
|
|
||||||
github.com/muety/wakapi/config/config.go:247.43,249.3 1 0
|
|
||||||
github.com/muety/wakapi/config/config.go:254.45,255.27 1 0
|
|
||||||
github.com/muety/wakapi/config/config.go:258.2,258.15 1 0
|
|
||||||
github.com/muety/wakapi/config/config.go:255.27,257.3 1 0
|
|
||||||
github.com/muety/wakapi/config/config.go:261.26,263.2 1 0
|
|
||||||
github.com/muety/wakapi/config/config.go:265.20,267.2 1 0
|
|
||||||
github.com/muety/wakapi/config/config.go:269.21,276.96 4 0
|
|
||||||
github.com/muety/wakapi/config/config.go:280.2,288.52 5 0
|
|
||||||
github.com/muety/wakapi/config/config.go:292.2,292.47 1 0
|
|
||||||
github.com/muety/wakapi/config/config.go:298.2,298.70 1 0
|
|
||||||
github.com/muety/wakapi/config/config.go:302.2,303.14 2 0
|
|
||||||
github.com/muety/wakapi/config/config.go:276.96,278.3 1 0
|
|
||||||
github.com/muety/wakapi/config/config.go:288.52,290.3 1 0
|
|
||||||
github.com/muety/wakapi/config/config.go:292.47,293.14 1 0
|
|
||||||
github.com/muety/wakapi/config/config.go:293.14,295.4 1 0
|
|
||||||
github.com/muety/wakapi/config/config.go:298.70,300.3 1 0
|
|
||||||
github.com/muety/wakapi/config/legacy.go:13.33,14.57 1 0
|
github.com/muety/wakapi/config/legacy.go:13.33,14.57 1 0
|
||||||
github.com/muety/wakapi/config/legacy.go:14.57,16.3 1 0
|
github.com/muety/wakapi/config/legacy.go:14.57,16.3 1 0
|
||||||
github.com/muety/wakapi/config/legacy.go:16.8,16.16 1 0
|
github.com/muety/wakapi/config/legacy.go:16.8,16.16 1 0
|
||||||
@ -303,43 +248,96 @@ github.com/muety/wakapi/config/legacy.go:119.78,121.3 1 0
|
|||||||
github.com/muety/wakapi/config/utils.go:3.60,5.22 2 0
|
github.com/muety/wakapi/config/utils.go:3.60,5.22 2 0
|
||||||
github.com/muety/wakapi/config/utils.go:8.2,8.11 1 0
|
github.com/muety/wakapi/config/utils.go:8.2,8.11 1 0
|
||||||
github.com/muety/wakapi/config/utils.go:5.22,7.3 1 0
|
github.com/muety/wakapi/config/utils.go:5.22,7.3 1 0
|
||||||
|
github.com/muety/wakapi/config/config.go:84.70,86.2 1 0
|
||||||
|
github.com/muety/wakapi/config/config.go:88.65,90.2 1 0
|
||||||
|
github.com/muety/wakapi/config/config.go:92.82,102.2 1 0
|
||||||
|
github.com/muety/wakapi/config/config.go:104.31,106.2 1 0
|
||||||
|
github.com/muety/wakapi/config/config.go:108.32,110.2 1 0
|
||||||
|
github.com/muety/wakapi/config/config.go:112.74,113.19 1 0
|
||||||
|
github.com/muety/wakapi/config/config.go:114.10,115.34 1 0
|
||||||
|
github.com/muety/wakapi/config/config.go:115.34,124.4 8 0
|
||||||
|
github.com/muety/wakapi/config/config.go:128.73,129.33 1 0
|
||||||
|
github.com/muety/wakapi/config/config.go:129.33,137.17 5 0
|
||||||
|
github.com/muety/wakapi/config/config.go:141.3,142.13 2 0
|
||||||
|
github.com/muety/wakapi/config/config.go:137.17,139.4 1 0
|
||||||
|
github.com/muety/wakapi/config/config.go:146.50,147.19 1 0
|
||||||
|
github.com/muety/wakapi/config/config.go:160.2,160.12 1 0
|
||||||
|
github.com/muety/wakapi/config/config.go:148.23,152.5 1 0
|
||||||
|
github.com/muety/wakapi/config/config.go:153.26,156.5 1 0
|
||||||
|
github.com/muety/wakapi/config/config.go:157.24,158.48 1 0
|
||||||
|
github.com/muety/wakapi/config/config.go:163.53,173.2 1 1
|
||||||
|
github.com/muety/wakapi/config/config.go:175.56,177.16 2 1
|
||||||
|
github.com/muety/wakapi/config/config.go:181.2,188.3 1 1
|
||||||
|
github.com/muety/wakapi/config/config.go:177.16,179.3 1 0
|
||||||
|
github.com/muety/wakapi/config/config.go:191.54,193.2 1 1
|
||||||
|
github.com/muety/wakapi/config/config.go:195.60,197.2 1 0
|
||||||
|
github.com/muety/wakapi/config/config.go:199.59,201.2 1 0
|
||||||
|
github.com/muety/wakapi/config/config.go:203.29,205.2 1 1
|
||||||
|
github.com/muety/wakapi/config/config.go:207.27,209.16 2 0
|
||||||
|
github.com/muety/wakapi/config/config.go:212.2,215.16 3 0
|
||||||
|
github.com/muety/wakapi/config/config.go:219.2,219.41 1 0
|
||||||
|
github.com/muety/wakapi/config/config.go:209.16,211.3 1 0
|
||||||
|
github.com/muety/wakapi/config/config.go:215.16,217.3 1 0
|
||||||
|
github.com/muety/wakapi/config/config.go:222.45,232.16 4 0
|
||||||
|
github.com/muety/wakapi/config/config.go:235.2,237.16 3 0
|
||||||
|
github.com/muety/wakapi/config/config.go:241.2,241.58 1 0
|
||||||
|
github.com/muety/wakapi/config/config.go:245.2,245.30 1 0
|
||||||
|
github.com/muety/wakapi/config/config.go:249.2,249.15 1 0
|
||||||
|
github.com/muety/wakapi/config/config.go:232.16,234.3 1 0
|
||||||
|
github.com/muety/wakapi/config/config.go:237.16,239.3 1 0
|
||||||
|
github.com/muety/wakapi/config/config.go:241.58,243.3 1 0
|
||||||
|
github.com/muety/wakapi/config/config.go:245.30,247.3 1 0
|
||||||
|
github.com/muety/wakapi/config/config.go:252.38,253.43 1 0
|
||||||
|
github.com/muety/wakapi/config/config.go:257.2,257.15 1 0
|
||||||
|
github.com/muety/wakapi/config/config.go:253.43,255.3 1 0
|
||||||
|
github.com/muety/wakapi/config/config.go:260.45,261.27 1 0
|
||||||
|
github.com/muety/wakapi/config/config.go:264.2,264.15 1 0
|
||||||
|
github.com/muety/wakapi/config/config.go:261.27,263.3 1 0
|
||||||
|
github.com/muety/wakapi/config/config.go:267.26,269.2 1 0
|
||||||
|
github.com/muety/wakapi/config/config.go:271.20,273.2 1 0
|
||||||
|
github.com/muety/wakapi/config/config.go:275.21,282.96 4 0
|
||||||
|
github.com/muety/wakapi/config/config.go:286.2,294.52 5 0
|
||||||
|
github.com/muety/wakapi/config/config.go:298.2,298.47 1 0
|
||||||
|
github.com/muety/wakapi/config/config.go:304.2,304.70 1 0
|
||||||
|
github.com/muety/wakapi/config/config.go:308.2,309.14 2 0
|
||||||
|
github.com/muety/wakapi/config/config.go:282.96,284.3 1 0
|
||||||
|
github.com/muety/wakapi/config/config.go:294.52,296.3 1 0
|
||||||
|
github.com/muety/wakapi/config/config.go:298.47,299.14 1 0
|
||||||
|
github.com/muety/wakapi/config/config.go:299.14,301.4 1 0
|
||||||
|
github.com/muety/wakapi/config/config.go:304.70,306.3 1 0
|
||||||
|
github.com/muety/wakapi/middlewares/authenticate.go:22.116,28.2 1 1
|
||||||
|
github.com/muety/wakapi/middlewares/authenticate.go:30.71,31.71 1 0
|
||||||
|
github.com/muety/wakapi/middlewares/authenticate.go:31.71,33.3 1 0
|
||||||
|
github.com/muety/wakapi/middlewares/authenticate.go:36.107,37.37 1 0
|
||||||
|
github.com/muety/wakapi/middlewares/authenticate.go:44.2,47.16 3 0
|
||||||
|
github.com/muety/wakapi/middlewares/authenticate.go:51.2,51.16 1 0
|
||||||
|
github.com/muety/wakapi/middlewares/authenticate.go:61.2,62.29 2 0
|
||||||
|
github.com/muety/wakapi/middlewares/authenticate.go:37.37,38.58 1 0
|
||||||
|
github.com/muety/wakapi/middlewares/authenticate.go:38.58,41.4 2 0
|
||||||
|
github.com/muety/wakapi/middlewares/authenticate.go:47.16,49.3 1 0
|
||||||
|
github.com/muety/wakapi/middlewares/authenticate.go:51.16,52.44 1 0
|
||||||
|
github.com/muety/wakapi/middlewares/authenticate.go:58.3,58.9 1 0
|
||||||
|
github.com/muety/wakapi/middlewares/authenticate.go:52.44,54.4 1 0
|
||||||
|
github.com/muety/wakapi/middlewares/authenticate.go:54.9,57.4 2 0
|
||||||
|
github.com/muety/wakapi/middlewares/authenticate.go:65.92,67.16 2 1
|
||||||
|
github.com/muety/wakapi/middlewares/authenticate.go:71.2,74.16 4 1
|
||||||
|
github.com/muety/wakapi/middlewares/authenticate.go:77.2,77.18 1 1
|
||||||
|
github.com/muety/wakapi/middlewares/authenticate.go:67.16,69.3 1 1
|
||||||
|
github.com/muety/wakapi/middlewares/authenticate.go:74.16,76.3 1 0
|
||||||
|
github.com/muety/wakapi/middlewares/authenticate.go:80.92,82.16 2 0
|
||||||
|
github.com/muety/wakapi/middlewares/authenticate.go:86.2,87.16 2 0
|
||||||
|
github.com/muety/wakapi/middlewares/authenticate.go:91.2,91.88 1 0
|
||||||
|
github.com/muety/wakapi/middlewares/authenticate.go:95.2,95.18 1 0
|
||||||
|
github.com/muety/wakapi/middlewares/authenticate.go:82.16,84.3 1 0
|
||||||
|
github.com/muety/wakapi/middlewares/authenticate.go:87.16,89.3 1 0
|
||||||
|
github.com/muety/wakapi/middlewares/authenticate.go:91.88,93.3 1 0
|
||||||
|
github.com/muety/wakapi/middlewares/authenticate.go:99.127,100.32 1 0
|
||||||
|
github.com/muety/wakapi/middlewares/authenticate.go:108.2,108.65 1 0
|
||||||
|
github.com/muety/wakapi/middlewares/authenticate.go:100.32,101.58 1 0
|
||||||
|
github.com/muety/wakapi/middlewares/authenticate.go:106.3,106.15 1 0
|
||||||
|
github.com/muety/wakapi/middlewares/authenticate.go:101.58,105.4 3 0
|
||||||
github.com/muety/wakapi/middlewares/logging.go:11.48,13.2 1 0
|
github.com/muety/wakapi/middlewares/logging.go:11.48,13.2 1 0
|
||||||
github.com/muety/wakapi/middlewares/logging.go:15.66,17.2 1 0
|
github.com/muety/wakapi/middlewares/logging.go:15.66,17.2 1 0
|
||||||
github.com/muety/wakapi/middlewares/authenticate.go:27.116,34.2 1 1
|
|
||||||
github.com/muety/wakapi/middlewares/authenticate.go:36.71,37.71 1 0
|
|
||||||
github.com/muety/wakapi/middlewares/authenticate.go:37.71,39.3 1 0
|
|
||||||
github.com/muety/wakapi/middlewares/authenticate.go:42.107,43.37 1 0
|
|
||||||
github.com/muety/wakapi/middlewares/authenticate.go:50.2,53.16 3 0
|
|
||||||
github.com/muety/wakapi/middlewares/authenticate.go:57.2,57.16 1 0
|
|
||||||
github.com/muety/wakapi/middlewares/authenticate.go:67.2,70.29 3 0
|
|
||||||
github.com/muety/wakapi/middlewares/authenticate.go:43.37,44.58 1 0
|
|
||||||
github.com/muety/wakapi/middlewares/authenticate.go:44.58,47.4 2 0
|
|
||||||
github.com/muety/wakapi/middlewares/authenticate.go:53.16,55.3 1 0
|
|
||||||
github.com/muety/wakapi/middlewares/authenticate.go:57.16,58.44 1 0
|
|
||||||
github.com/muety/wakapi/middlewares/authenticate.go:64.3,64.9 1 0
|
|
||||||
github.com/muety/wakapi/middlewares/authenticate.go:58.44,60.4 1 0
|
|
||||||
github.com/muety/wakapi/middlewares/authenticate.go:60.9,63.4 2 0
|
|
||||||
github.com/muety/wakapi/middlewares/authenticate.go:73.92,75.16 2 1
|
|
||||||
github.com/muety/wakapi/middlewares/authenticate.go:79.2,82.9 4 1
|
|
||||||
github.com/muety/wakapi/middlewares/authenticate.go:90.2,90.18 1 1
|
|
||||||
github.com/muety/wakapi/middlewares/authenticate.go:75.16,77.3 1 1
|
|
||||||
github.com/muety/wakapi/middlewares/authenticate.go:82.9,84.17 2 1
|
|
||||||
github.com/muety/wakapi/middlewares/authenticate.go:84.17,86.4 1 0
|
|
||||||
github.com/muety/wakapi/middlewares/authenticate.go:87.8,89.3 1 1
|
|
||||||
github.com/muety/wakapi/middlewares/authenticate.go:93.92,95.16 2 0
|
|
||||||
github.com/muety/wakapi/middlewares/authenticate.go:99.2,101.8 2 0
|
|
||||||
github.com/muety/wakapi/middlewares/authenticate.go:105.2,106.16 2 0
|
|
||||||
github.com/muety/wakapi/middlewares/authenticate.go:110.2,110.88 1 0
|
|
||||||
github.com/muety/wakapi/middlewares/authenticate.go:114.2,114.18 1 0
|
|
||||||
github.com/muety/wakapi/middlewares/authenticate.go:95.16,97.3 1 0
|
|
||||||
github.com/muety/wakapi/middlewares/authenticate.go:101.8,103.3 1 0
|
|
||||||
github.com/muety/wakapi/middlewares/authenticate.go:106.16,108.3 1 0
|
|
||||||
github.com/muety/wakapi/middlewares/authenticate.go:110.88,112.3 1 0
|
|
||||||
github.com/muety/wakapi/middlewares/authenticate.go:118.127,119.32 1 0
|
|
||||||
github.com/muety/wakapi/middlewares/authenticate.go:127.2,127.65 1 0
|
|
||||||
github.com/muety/wakapi/middlewares/authenticate.go:119.32,120.58 1 0
|
|
||||||
github.com/muety/wakapi/middlewares/authenticate.go:125.3,125.15 1 0
|
|
||||||
github.com/muety/wakapi/middlewares/authenticate.go:120.58,124.4 3 0
|
|
||||||
github.com/muety/wakapi/services/misc.go:23.126,30.2 1 0
|
github.com/muety/wakapi/services/misc.go:23.126,30.2 1 0
|
||||||
github.com/muety/wakapi/services/misc.go:42.50,44.48 1 0
|
github.com/muety/wakapi/services/misc.go:42.50,44.48 1 0
|
||||||
github.com/muety/wakapi/services/misc.go:48.2,50.19 3 0
|
github.com/muety/wakapi/services/misc.go:48.2,50.19 3 0
|
||||||
@ -363,6 +361,77 @@ 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: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:109.17,111.3 1 0
|
||||||
github.com/muety/wakapi/services/misc.go:116.17,118.3 1 0
|
github.com/muety/wakapi/services/misc.go:116.17,118.3 1 0
|
||||||
|
github.com/muety/wakapi/services/aggregation.go:24.142,31.2 1 0
|
||||||
|
github.com/muety/wakapi/services/aggregation.go:40.43,42.37 1 0
|
||||||
|
github.com/muety/wakapi/services/aggregation.go:46.2,48.19 3 0
|
||||||
|
github.com/muety/wakapi/services/aggregation.go:42.37,44.3 1 0
|
||||||
|
github.com/muety/wakapi/services/aggregation.go:51.67,55.40 3 0
|
||||||
|
github.com/muety/wakapi/services/aggregation.go:59.2,59.50 1 0
|
||||||
|
github.com/muety/wakapi/services/aggregation.go:64.2,64.60 1 0
|
||||||
|
github.com/muety/wakapi/services/aggregation.go:70.2,70.35 1 0
|
||||||
|
github.com/muety/wakapi/services/aggregation.go:55.40,57.3 1 0
|
||||||
|
github.com/muety/wakapi/services/aggregation.go:59.50,61.3 1 0
|
||||||
|
github.com/muety/wakapi/services/aggregation.go:64.60,68.3 3 0
|
||||||
|
github.com/muety/wakapi/services/aggregation.go:73.109,74.24 1 0
|
||||||
|
github.com/muety/wakapi/services/aggregation.go:74.24,75.111 1 0
|
||||||
|
github.com/muety/wakapi/services/aggregation.go:75.111,77.4 1 0
|
||||||
|
github.com/muety/wakapi/services/aggregation.go:77.9,80.4 2 0
|
||||||
|
github.com/muety/wakapi/services/aggregation.go:84.80,85.33 1 0
|
||||||
|
github.com/muety/wakapi/services/aggregation.go:85.33,86.60 1 0
|
||||||
|
github.com/muety/wakapi/services/aggregation.go:86.60,88.4 1 0
|
||||||
|
github.com/muety/wakapi/services/aggregation.go:92.100,96.59 3 0
|
||||||
|
github.com/muety/wakapi/services/aggregation.go:111.2,112.16 2 0
|
||||||
|
github.com/muety/wakapi/services/aggregation.go:118.2,119.16 2 0
|
||||||
|
github.com/muety/wakapi/services/aggregation.go:125.2,126.44 2 0
|
||||||
|
github.com/muety/wakapi/services/aggregation.go:131.2,131.41 1 0
|
||||||
|
github.com/muety/wakapi/services/aggregation.go:145.2,145.12 1 0
|
||||||
|
github.com/muety/wakapi/services/aggregation.go:96.59,99.3 2 0
|
||||||
|
github.com/muety/wakapi/services/aggregation.go:99.8,99.47 1 0
|
||||||
|
github.com/muety/wakapi/services/aggregation.go:99.47,101.30 2 0
|
||||||
|
github.com/muety/wakapi/services/aggregation.go:101.30,102.43 1 0
|
||||||
|
github.com/muety/wakapi/services/aggregation.go:102.43,104.5 1 0
|
||||||
|
github.com/muety/wakapi/services/aggregation.go:106.8,108.3 1 0
|
||||||
|
github.com/muety/wakapi/services/aggregation.go:112.16,115.3 2 0
|
||||||
|
github.com/muety/wakapi/services/aggregation.go:119.16,122.3 2 0
|
||||||
|
github.com/muety/wakapi/services/aggregation.go:126.44,128.3 1 0
|
||||||
|
github.com/muety/wakapi/services/aggregation.go:131.41,132.21 1 0
|
||||||
|
github.com/muety/wakapi/services/aggregation.go:132.21,136.4 1 0
|
||||||
|
github.com/muety/wakapi/services/aggregation.go:136.9,136.62 1 0
|
||||||
|
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/heartbeat.go:17.141,23.2 1 0
|
||||||
|
github.com/muety/wakapi/services/heartbeat.go:25.80,27.2 1 0
|
||||||
|
github.com/muety/wakapi/services/heartbeat.go:29.111,31.16 2 0
|
||||||
|
github.com/muety/wakapi/services/heartbeat.go:34.2,34.43 1 0
|
||||||
|
github.com/muety/wakapi/services/heartbeat.go:31.16,33.3 1 0
|
||||||
|
github.com/muety/wakapi/services/heartbeat.go:37.78,39.2 1 0
|
||||||
|
github.com/muety/wakapi/services/heartbeat.go:41.62,43.2 1 0
|
||||||
|
github.com/muety/wakapi/services/heartbeat.go:45.116,47.16 2 0
|
||||||
|
github.com/muety/wakapi/services/heartbeat.go:51.2,51.28 1 0
|
||||||
|
github.com/muety/wakapi/services/heartbeat.go:55.2,55.24 1 0
|
||||||
|
github.com/muety/wakapi/services/heartbeat.go:47.16,49.3 1 0
|
||||||
|
github.com/muety/wakapi/services/heartbeat.go:51.28,53.3 1 0
|
||||||
|
github.com/muety/wakapi/services/language_mapping.go:18.118,24.2 1 0
|
||||||
|
github.com/muety/wakapi/services/language_mapping.go:26.86,28.2 1 0
|
||||||
|
github.com/muety/wakapi/services/language_mapping.go:30.96,31.53 1 0
|
||||||
|
github.com/muety/wakapi/services/language_mapping.go:35.2,36.16 2 0
|
||||||
|
github.com/muety/wakapi/services/language_mapping.go:39.2,40.22 2 0
|
||||||
|
github.com/muety/wakapi/services/language_mapping.go:31.53,33.3 1 0
|
||||||
|
github.com/muety/wakapi/services/language_mapping.go:36.16,38.3 1 0
|
||||||
|
github.com/muety/wakapi/services/language_mapping.go:43.92,46.16 3 0
|
||||||
|
github.com/muety/wakapi/services/language_mapping.go:50.2,50.33 1 0
|
||||||
|
github.com/muety/wakapi/services/language_mapping.go:53.2,53.22 1 0
|
||||||
|
github.com/muety/wakapi/services/language_mapping.go:46.16,48.3 1 0
|
||||||
|
github.com/muety/wakapi/services/language_mapping.go:50.33,52.3 1 0
|
||||||
|
github.com/muety/wakapi/services/language_mapping.go:56.109,58.16 2 0
|
||||||
|
github.com/muety/wakapi/services/language_mapping.go:62.2,63.20 2 0
|
||||||
|
github.com/muety/wakapi/services/language_mapping.go:58.16,60.3 1 0
|
||||||
|
github.com/muety/wakapi/services/language_mapping.go:66.82,67.26 1 0
|
||||||
|
github.com/muety/wakapi/services/language_mapping.go:70.2,72.12 3 0
|
||||||
|
github.com/muety/wakapi/services/language_mapping.go:67.26,69.3 1 0
|
||||||
|
github.com/muety/wakapi/services/language_mapping.go:75.74,78.2 1 0
|
||||||
github.com/muety/wakapi/services/summary.go:27.149,35.2 1 1
|
github.com/muety/wakapi/services/summary.go:27.149,35.2 1 1
|
||||||
github.com/muety/wakapi/services/summary.go:39.120,42.52 2 1
|
github.com/muety/wakapi/services/summary.go:39.120,42.52 2 1
|
||||||
github.com/muety/wakapi/services/summary.go:47.2,47.44 1 1
|
github.com/muety/wakapi/services/summary.go:47.2,47.44 1 1
|
||||||
@ -452,21 +521,30 @@ github.com/muety/wakapi/services/summary.go:324.54,326.3 1 1
|
|||||||
github.com/muety/wakapi/services/summary.go:331.59,333.25 2 1
|
github.com/muety/wakapi/services/summary.go:331.59,333.25 2 1
|
||||||
github.com/muety/wakapi/services/summary.go:336.2,336.32 1 1
|
github.com/muety/wakapi/services/summary.go:336.2,336.32 1 1
|
||||||
github.com/muety/wakapi/services/summary.go:333.25,335.3 1 1
|
github.com/muety/wakapi/services/summary.go:333.25,335.3 1 1
|
||||||
github.com/muety/wakapi/services/user.go:16.73,21.2 1 0
|
github.com/muety/wakapi/services/user.go:19.73,25.2 1 0
|
||||||
github.com/muety/wakapi/services/user.go:23.74,25.2 1 0
|
github.com/muety/wakapi/services/user.go:27.74,28.40 1 0
|
||||||
github.com/muety/wakapi/services/user.go:27.72,29.2 1 0
|
github.com/muety/wakapi/services/user.go:32.2,33.16 2 0
|
||||||
github.com/muety/wakapi/services/user.go:31.58,33.2 1 0
|
github.com/muety/wakapi/services/user.go:37.2,38.15 2 0
|
||||||
github.com/muety/wakapi/services/user.go:35.88,42.93 2 0
|
github.com/muety/wakapi/services/user.go:28.40,30.3 1 0
|
||||||
github.com/muety/wakapi/services/user.go:48.2,48.38 1 0
|
github.com/muety/wakapi/services/user.go:33.16,35.3 1 0
|
||||||
github.com/muety/wakapi/services/user.go:42.93,44.3 1 0
|
github.com/muety/wakapi/services/user.go:41.72,42.37 1 0
|
||||||
github.com/muety/wakapi/services/user.go:44.8,46.3 1 0
|
github.com/muety/wakapi/services/user.go:46.2,47.16 2 0
|
||||||
github.com/muety/wakapi/services/user.go:51.73,53.2 1 0
|
github.com/muety/wakapi/services/user.go:51.2,52.15 2 0
|
||||||
github.com/muety/wakapi/services/user.go:55.78,58.2 2 0
|
github.com/muety/wakapi/services/user.go:42.37,44.3 1 0
|
||||||
github.com/muety/wakapi/services/user.go:60.79,62.2 1 0
|
github.com/muety/wakapi/services/user.go:47.16,49.3 1 0
|
||||||
github.com/muety/wakapi/services/user.go:64.106,66.96 2 0
|
github.com/muety/wakapi/services/user.go:55.58,57.2 1 0
|
||||||
github.com/muety/wakapi/services/user.go:71.2,71.68 1 0
|
github.com/muety/wakapi/services/user.go:59.88,66.93 2 0
|
||||||
github.com/muety/wakapi/services/user.go:66.96,68.3 1 0
|
github.com/muety/wakapi/services/user.go:72.2,72.38 1 0
|
||||||
|
github.com/muety/wakapi/services/user.go:66.93,68.3 1 0
|
||||||
github.com/muety/wakapi/services/user.go:68.8,70.3 1 0
|
github.com/muety/wakapi/services/user.go:68.8,70.3 1 0
|
||||||
|
github.com/muety/wakapi/services/user.go:75.73,78.2 2 0
|
||||||
|
github.com/muety/wakapi/services/user.go:80.78,84.2 3 0
|
||||||
|
github.com/muety/wakapi/services/user.go:86.79,89.2 2 0
|
||||||
|
github.com/muety/wakapi/services/user.go:91.99,94.2 2 0
|
||||||
|
github.com/muety/wakapi/services/user.go:96.106,99.96 3 0
|
||||||
|
github.com/muety/wakapi/services/user.go:104.2,104.68 1 0
|
||||||
|
github.com/muety/wakapi/services/user.go:99.96,101.3 1 0
|
||||||
|
github.com/muety/wakapi/services/user.go:101.8,103.3 1 0
|
||||||
github.com/muety/wakapi/services/alias.go:17.77,22.2 1 1
|
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: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:30.2,30.14 1 1
|
||||||
@ -506,74 +584,3 @@ 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:21.83,23.2 1 0
|
||||||
github.com/muety/wakapi/services/key_value.go:25.72,27.2 1 0
|
github.com/muety/wakapi/services/key_value.go:25.72,27.2 1 0
|
||||||
github.com/muety/wakapi/services/key_value.go:29.60,31.2 1 0
|
github.com/muety/wakapi/services/key_value.go:29.60,31.2 1 0
|
||||||
github.com/muety/wakapi/services/language_mapping.go:18.118,24.2 1 0
|
|
||||||
github.com/muety/wakapi/services/language_mapping.go:26.86,28.2 1 0
|
|
||||||
github.com/muety/wakapi/services/language_mapping.go:30.96,31.53 1 0
|
|
||||||
github.com/muety/wakapi/services/language_mapping.go:35.2,36.16 2 0
|
|
||||||
github.com/muety/wakapi/services/language_mapping.go:39.2,40.22 2 0
|
|
||||||
github.com/muety/wakapi/services/language_mapping.go:31.53,33.3 1 0
|
|
||||||
github.com/muety/wakapi/services/language_mapping.go:36.16,38.3 1 0
|
|
||||||
github.com/muety/wakapi/services/language_mapping.go:43.92,46.16 3 0
|
|
||||||
github.com/muety/wakapi/services/language_mapping.go:50.2,50.33 1 0
|
|
||||||
github.com/muety/wakapi/services/language_mapping.go:53.2,53.22 1 0
|
|
||||||
github.com/muety/wakapi/services/language_mapping.go:46.16,48.3 1 0
|
|
||||||
github.com/muety/wakapi/services/language_mapping.go:50.33,52.3 1 0
|
|
||||||
github.com/muety/wakapi/services/language_mapping.go:56.109,58.16 2 0
|
|
||||||
github.com/muety/wakapi/services/language_mapping.go:62.2,63.20 2 0
|
|
||||||
github.com/muety/wakapi/services/language_mapping.go:58.16,60.3 1 0
|
|
||||||
github.com/muety/wakapi/services/language_mapping.go:66.82,67.26 1 0
|
|
||||||
github.com/muety/wakapi/services/language_mapping.go:70.2,72.12 3 0
|
|
||||||
github.com/muety/wakapi/services/language_mapping.go:67.26,69.3 1 0
|
|
||||||
github.com/muety/wakapi/services/language_mapping.go:75.74,78.2 1 0
|
|
||||||
github.com/muety/wakapi/services/aggregation.go:24.142,31.2 1 0
|
|
||||||
github.com/muety/wakapi/services/aggregation.go:40.43,42.37 1 0
|
|
||||||
github.com/muety/wakapi/services/aggregation.go:46.2,48.19 3 0
|
|
||||||
github.com/muety/wakapi/services/aggregation.go:42.37,44.3 1 0
|
|
||||||
github.com/muety/wakapi/services/aggregation.go:51.67,55.40 3 0
|
|
||||||
github.com/muety/wakapi/services/aggregation.go:59.2,59.50 1 0
|
|
||||||
github.com/muety/wakapi/services/aggregation.go:64.2,64.60 1 0
|
|
||||||
github.com/muety/wakapi/services/aggregation.go:70.2,70.35 1 0
|
|
||||||
github.com/muety/wakapi/services/aggregation.go:55.40,57.3 1 0
|
|
||||||
github.com/muety/wakapi/services/aggregation.go:59.50,61.3 1 0
|
|
||||||
github.com/muety/wakapi/services/aggregation.go:64.60,68.3 3 0
|
|
||||||
github.com/muety/wakapi/services/aggregation.go:73.109,74.24 1 0
|
|
||||||
github.com/muety/wakapi/services/aggregation.go:74.24,75.111 1 0
|
|
||||||
github.com/muety/wakapi/services/aggregation.go:75.111,77.4 1 0
|
|
||||||
github.com/muety/wakapi/services/aggregation.go:77.9,80.4 2 0
|
|
||||||
github.com/muety/wakapi/services/aggregation.go:84.80,85.33 1 0
|
|
||||||
github.com/muety/wakapi/services/aggregation.go:85.33,86.60 1 0
|
|
||||||
github.com/muety/wakapi/services/aggregation.go:86.60,88.4 1 0
|
|
||||||
github.com/muety/wakapi/services/aggregation.go:92.100,96.59 3 0
|
|
||||||
github.com/muety/wakapi/services/aggregation.go:111.2,112.16 2 0
|
|
||||||
github.com/muety/wakapi/services/aggregation.go:118.2,119.16 2 0
|
|
||||||
github.com/muety/wakapi/services/aggregation.go:125.2,126.44 2 0
|
|
||||||
github.com/muety/wakapi/services/aggregation.go:131.2,131.41 1 0
|
|
||||||
github.com/muety/wakapi/services/aggregation.go:145.2,145.12 1 0
|
|
||||||
github.com/muety/wakapi/services/aggregation.go:96.59,99.3 2 0
|
|
||||||
github.com/muety/wakapi/services/aggregation.go:99.8,99.47 1 0
|
|
||||||
github.com/muety/wakapi/services/aggregation.go:99.47,101.30 2 0
|
|
||||||
github.com/muety/wakapi/services/aggregation.go:101.30,102.43 1 0
|
|
||||||
github.com/muety/wakapi/services/aggregation.go:102.43,104.5 1 0
|
|
||||||
github.com/muety/wakapi/services/aggregation.go:106.8,108.3 1 0
|
|
||||||
github.com/muety/wakapi/services/aggregation.go:112.16,115.3 2 0
|
|
||||||
github.com/muety/wakapi/services/aggregation.go:119.16,122.3 2 0
|
|
||||||
github.com/muety/wakapi/services/aggregation.go:126.44,128.3 1 0
|
|
||||||
github.com/muety/wakapi/services/aggregation.go:131.41,132.21 1 0
|
|
||||||
github.com/muety/wakapi/services/aggregation.go:132.21,136.4 1 0
|
|
||||||
github.com/muety/wakapi/services/aggregation.go:136.9,136.62 1 0
|
|
||||||
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/heartbeat.go:17.141,23.2 1 0
|
|
||||||
github.com/muety/wakapi/services/heartbeat.go:25.80,27.2 1 0
|
|
||||||
github.com/muety/wakapi/services/heartbeat.go:29.111,31.16 2 0
|
|
||||||
github.com/muety/wakapi/services/heartbeat.go:34.2,34.43 1 0
|
|
||||||
github.com/muety/wakapi/services/heartbeat.go:31.16,33.3 1 0
|
|
||||||
github.com/muety/wakapi/services/heartbeat.go:37.78,39.2 1 0
|
|
||||||
github.com/muety/wakapi/services/heartbeat.go:41.62,43.2 1 0
|
|
||||||
github.com/muety/wakapi/services/heartbeat.go:45.116,47.16 2 0
|
|
||||||
github.com/muety/wakapi/services/heartbeat.go:51.2,51.28 1 0
|
|
||||||
github.com/muety/wakapi/services/heartbeat.go:55.2,55.24 1 0
|
|
||||||
github.com/muety/wakapi/services/heartbeat.go:47.16,49.3 1 0
|
|
||||||
github.com/muety/wakapi/services/heartbeat.go:51.28,53.3 1 0
|
|
||||||
|
1
go.mod
1
go.mod
@ -11,6 +11,7 @@ require (
|
|||||||
github.com/jinzhu/configor v1.2.0
|
github.com/jinzhu/configor v1.2.0
|
||||||
github.com/joho/godotenv v1.3.0
|
github.com/joho/godotenv v1.3.0
|
||||||
github.com/kr/text v0.2.0 // indirect
|
github.com/kr/text v0.2.0 // indirect
|
||||||
|
github.com/markbates/pkger v0.17.1
|
||||||
github.com/mattn/go-sqlite3 v2.0.3+incompatible // indirect
|
github.com/mattn/go-sqlite3 v2.0.3+incompatible // indirect
|
||||||
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
|
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
|
||||||
github.com/patrickmn/go-cache v2.1.0+incompatible
|
github.com/patrickmn/go-cache v2.1.0+incompatible
|
||||||
|
11
go.sum
11
go.sum
@ -81,6 +81,8 @@ github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/me
|
|||||||
github.com/gobuffalo/envy v1.7.0/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI=
|
github.com/gobuffalo/envy v1.7.0/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI=
|
||||||
github.com/gobuffalo/envy v1.7.1 h1:OQl5ys5MBea7OGCdvPbBJWRgnhC/fGona6QKfvFeau8=
|
github.com/gobuffalo/envy v1.7.1 h1:OQl5ys5MBea7OGCdvPbBJWRgnhC/fGona6QKfvFeau8=
|
||||||
github.com/gobuffalo/envy v1.7.1/go.mod h1:FurDp9+EDPE4aIUS3ZLyD+7/9fpx7YRt/ukY6jIHf0w=
|
github.com/gobuffalo/envy v1.7.1/go.mod h1:FurDp9+EDPE4aIUS3ZLyD+7/9fpx7YRt/ukY6jIHf0w=
|
||||||
|
github.com/gobuffalo/here v0.6.0 h1:hYrd0a6gDmWxBM4TnrGw8mQg24iSVoIkHEk7FodQcBI=
|
||||||
|
github.com/gobuffalo/here v0.6.0/go.mod h1:wAG085dHOYqUpf+Ap+WOdrPTp5IYcDAs/x7PLa8Y5fM=
|
||||||
github.com/gobuffalo/logger v1.0.1 h1:ZEgyRGgAm4ZAhAO45YXMs5Fp+bzGLESFewzAVBMKuTg=
|
github.com/gobuffalo/logger v1.0.1 h1:ZEgyRGgAm4ZAhAO45YXMs5Fp+bzGLESFewzAVBMKuTg=
|
||||||
github.com/gobuffalo/logger v1.0.1/go.mod h1:2zbswyIUa45I+c+FLXuWl9zSWEiVuthsk8ze5s8JvPs=
|
github.com/gobuffalo/logger v1.0.1/go.mod h1:2zbswyIUa45I+c+FLXuWl9zSWEiVuthsk8ze5s8JvPs=
|
||||||
github.com/gobuffalo/packd v0.3.0 h1:eMwymTkA1uXsqxS0Tpoop3Lc0u3kTfiMBE6nKtQU4g4=
|
github.com/gobuffalo/packd v0.3.0 h1:eMwymTkA1uXsqxS0Tpoop3Lc0u3kTfiMBE6nKtQU4g4=
|
||||||
@ -94,7 +96,6 @@ github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFG
|
|||||||
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
|
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
|
||||||
github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
|
github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
|
||||||
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
|
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
|
||||||
github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe h1:lXe2qZdvpiX5WZkZR4hgp4KJVfY3nMkvmwbVkpv1rVY=
|
|
||||||
github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0=
|
github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0=
|
||||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
|
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
|
||||||
github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||||
@ -243,6 +244,8 @@ github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-b
|
|||||||
github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4=
|
github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4=
|
||||||
github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ=
|
github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ=
|
||||||
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
|
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
|
||||||
|
github.com/markbates/pkger v0.17.1 h1:/MKEtWqtc0mZvu9OinB9UzVN9iYCwLWuyUv4Bw+PCno=
|
||||||
|
github.com/markbates/pkger v0.17.1/go.mod h1:0JoVlrol20BSywW79rN3kdFFsE5xYM+rSCQDXbLhiuI=
|
||||||
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
|
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
|
||||||
github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ=
|
github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ=
|
||||||
github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
|
github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
|
||||||
@ -387,7 +390,6 @@ github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoH
|
|||||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||||
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
||||||
github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4=
|
|
||||||
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
|
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
|
||||||
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
|
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
|
||||||
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||||
@ -437,6 +439,7 @@ golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTk
|
|||||||
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
|
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
|
||||||
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||||
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||||
|
golang.org/x/lint v0.0.0-20190930215403-16217165b5de h1:5hukYrvBGR8/eNkX5mdUezrA6JiaEZDtJb9Ei+1LlBs=
|
||||||
golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||||
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
|
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
|
||||||
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
|
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
|
||||||
@ -510,6 +513,7 @@ golang.org/x/tools v0.0.0-20190823170909-c4a336ef6a2f/go.mod h1:b+2E5dAYhXwXZwtn
|
|||||||
golang.org/x/tools v0.0.0-20191004055002-72853e10c5a3/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
golang.org/x/tools v0.0.0-20191004055002-72853e10c5a3/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||||
golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||||
golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||||
|
golang.org/x/tools v0.0.0-20200103221440-774c71fcf114 h1:DnSr2mCsxyCE6ZgIkmcWUQY2R5cH/6wL7eIxEmQOMSE=
|
||||||
golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||||
golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
@ -557,6 +561,7 @@ gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bl
|
|||||||
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
|
gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
|
gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
|
||||||
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
|
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
|
||||||
@ -569,8 +574,6 @@ gorm.io/driver/sqlite v1.1.3 h1:BYfdVuZB5He/u9dt4qDpZqiqDJ6KhPqs5QUqsr/Eeuc=
|
|||||||
gorm.io/driver/sqlite v1.1.3/go.mod h1:AKDgRWk8lcSQSw+9kxCJnX/yySj8G3rdwYlU57cB45c=
|
gorm.io/driver/sqlite v1.1.3/go.mod h1:AKDgRWk8lcSQSw+9kxCJnX/yySj8G3rdwYlU57cB45c=
|
||||||
gorm.io/gorm v1.20.1/go.mod h1:0HFTzE/SqkGTzK6TlDPPQbAYCluiVvhzoA1+aVyzenw=
|
gorm.io/gorm v1.20.1/go.mod h1:0HFTzE/SqkGTzK6TlDPPQbAYCluiVvhzoA1+aVyzenw=
|
||||||
gorm.io/gorm v1.20.4/go.mod h1:0HFTzE/SqkGTzK6TlDPPQbAYCluiVvhzoA1+aVyzenw=
|
gorm.io/gorm v1.20.4/go.mod h1:0HFTzE/SqkGTzK6TlDPPQbAYCluiVvhzoA1+aVyzenw=
|
||||||
gorm.io/gorm v1.20.5 h1:g3tpSF9kggASzReK+Z3dYei1IJODLqNUbOjSuCczY8g=
|
|
||||||
gorm.io/gorm v1.20.5/go.mod h1:0HFTzE/SqkGTzK6TlDPPQbAYCluiVvhzoA1+aVyzenw=
|
|
||||||
gorm.io/gorm v1.20.11 h1:jYHQ0LLUViV85V8dM1TP9VBBkfzKTnuTXDjYObkI6yc=
|
gorm.io/gorm v1.20.11 h1:jYHQ0LLUViV85V8dM1TP9VBBkfzKTnuTXDjYObkI6yc=
|
||||||
gorm.io/gorm v1.20.11/go.mod h1:0HFTzE/SqkGTzK6TlDPPQbAYCluiVvhzoA1+aVyzenw=
|
gorm.io/gorm v1.20.11/go.mod h1:0HFTzE/SqkGTzK6TlDPPQbAYCluiVvhzoA1+aVyzenw=
|
||||||
honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||||
|
13
main.go
13
main.go
@ -1,8 +1,11 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
|
//go:generate $GOPATH/bin/pkger
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/gorilla/handlers"
|
"github.com/gorilla/handlers"
|
||||||
|
"github.com/markbates/pkger"
|
||||||
conf "github.com/muety/wakapi/config"
|
conf "github.com/muety/wakapi/config"
|
||||||
"github.com/muety/wakapi/migrations/common"
|
"github.com/muety/wakapi/migrations/common"
|
||||||
"github.com/muety/wakapi/repositories"
|
"github.com/muety/wakapi/repositories"
|
||||||
@ -13,6 +16,7 @@ import (
|
|||||||
|
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
"github.com/muety/wakapi/middlewares"
|
"github.com/muety/wakapi/middlewares"
|
||||||
|
customMiddleware "github.com/muety/wakapi/middlewares/custom"
|
||||||
"github.com/muety/wakapi/routes"
|
"github.com/muety/wakapi/routes"
|
||||||
shieldsV1Routes "github.com/muety/wakapi/routes/compat/shields/v1"
|
shieldsV1Routes "github.com/muety/wakapi/routes/compat/shields/v1"
|
||||||
wtV1Routes "github.com/muety/wakapi/routes/compat/wakatime/v1"
|
wtV1Routes "github.com/muety/wakapi/routes/compat/wakatime/v1"
|
||||||
@ -138,6 +142,7 @@ func main() {
|
|||||||
userService,
|
userService,
|
||||||
[]string{"/api/health", "/api/compat/shields/v1"},
|
[]string{"/api/health", "/api/compat/shields/v1"},
|
||||||
).Handler
|
).Handler
|
||||||
|
wakatimeRelayMiddleware := customMiddleware.NewWakatimeRelayMiddleware().Handler
|
||||||
|
|
||||||
// Router configs
|
// Router configs
|
||||||
router.Use(loggingMiddleware, recoveryMiddleware)
|
router.Use(loggingMiddleware, recoveryMiddleware)
|
||||||
@ -166,13 +171,17 @@ func main() {
|
|||||||
settingsRouter.Path("/language_mappings/delete").Methods(http.MethodPost).HandlerFunc(settingsHandler.DeleteLanguageMapping)
|
settingsRouter.Path("/language_mappings/delete").Methods(http.MethodPost).HandlerFunc(settingsHandler.DeleteLanguageMapping)
|
||||||
settingsRouter.Path("/reset").Methods(http.MethodPost).HandlerFunc(settingsHandler.PostResetApiKey)
|
settingsRouter.Path("/reset").Methods(http.MethodPost).HandlerFunc(settingsHandler.PostResetApiKey)
|
||||||
settingsRouter.Path("/badges").Methods(http.MethodPost).HandlerFunc(settingsHandler.PostToggleBadges)
|
settingsRouter.Path("/badges").Methods(http.MethodPost).HandlerFunc(settingsHandler.PostToggleBadges)
|
||||||
|
settingsRouter.Path("/wakatime_integration").Methods(http.MethodPost).HandlerFunc(settingsHandler.PostSetWakatimeApiKey)
|
||||||
settingsRouter.Path("/regenerate").Methods(http.MethodPost).HandlerFunc(settingsHandler.PostRegenerateSummaries)
|
settingsRouter.Path("/regenerate").Methods(http.MethodPost).HandlerFunc(settingsHandler.PostRegenerateSummaries)
|
||||||
|
|
||||||
// API Routes
|
// API Routes
|
||||||
apiRouter.Path("/heartbeat").Methods(http.MethodPost).HandlerFunc(heartbeatHandler.ApiPost)
|
|
||||||
apiRouter.Path("/summary").Methods(http.MethodGet).HandlerFunc(summaryHandler.ApiGet)
|
apiRouter.Path("/summary").Methods(http.MethodGet).HandlerFunc(summaryHandler.ApiGet)
|
||||||
apiRouter.Path("/health").Methods(http.MethodGet).HandlerFunc(healthHandler.ApiGet)
|
apiRouter.Path("/health").Methods(http.MethodGet).HandlerFunc(healthHandler.ApiGet)
|
||||||
|
|
||||||
|
heartbeatsApiRouter := apiRouter.Path("/heartbeat").Methods(http.MethodPost).Subrouter()
|
||||||
|
heartbeatsApiRouter.Use(wakatimeRelayMiddleware)
|
||||||
|
heartbeatsApiRouter.Path("").HandlerFunc(heartbeatHandler.ApiPost)
|
||||||
|
|
||||||
// Wakatime compat V1 API Routes
|
// Wakatime compat V1 API Routes
|
||||||
wakatimeV1Router.Path("/users/{user}/all_time_since_today").Methods(http.MethodGet).HandlerFunc(wakatimeV1AllHandler.ApiGet)
|
wakatimeV1Router.Path("/users/{user}/all_time_since_today").Methods(http.MethodGet).HandlerFunc(wakatimeV1AllHandler.ApiGet)
|
||||||
wakatimeV1Router.Path("/users/{user}/summaries").Methods(http.MethodGet).HandlerFunc(wakatimeV1SummariesHandler.ApiGet)
|
wakatimeV1Router.Path("/users/{user}/summaries").Methods(http.MethodGet).HandlerFunc(wakatimeV1SummariesHandler.ApiGet)
|
||||||
@ -181,7 +190,7 @@ func main() {
|
|||||||
shieldsV1Router.PathPrefix("/{user}").Methods(http.MethodGet).HandlerFunc(shieldV1BadgeHandler.ApiGet)
|
shieldsV1Router.PathPrefix("/{user}").Methods(http.MethodGet).HandlerFunc(shieldV1BadgeHandler.ApiGet)
|
||||||
|
|
||||||
// Static Routes
|
// Static Routes
|
||||||
router.PathPrefix("/assets").Handler(http.FileServer(http.Dir("./static")))
|
router.PathPrefix("/assets").Handler(http.FileServer(pkger.Dir("/static")))
|
||||||
|
|
||||||
// Listen HTTP
|
// Listen HTTP
|
||||||
listen(router)
|
listen(router)
|
||||||
|
@ -5,21 +5,16 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
conf "github.com/muety/wakapi/config"
|
conf "github.com/muety/wakapi/config"
|
||||||
|
"github.com/muety/wakapi/models"
|
||||||
|
"github.com/muety/wakapi/services"
|
||||||
"github.com/muety/wakapi/utils"
|
"github.com/muety/wakapi/utils"
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/patrickmn/go-cache"
|
|
||||||
|
|
||||||
"github.com/muety/wakapi/models"
|
|
||||||
"github.com/muety/wakapi/services"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type AuthenticateMiddleware struct {
|
type AuthenticateMiddleware struct {
|
||||||
config *conf.Config
|
config *conf.Config
|
||||||
cache *cache.Cache
|
|
||||||
userSrvc services.IUserService
|
userSrvc services.IUserService
|
||||||
whitelistPaths []string
|
whitelistPaths []string
|
||||||
}
|
}
|
||||||
@ -28,7 +23,6 @@ func NewAuthenticateMiddleware(userService services.IUserService, whitelistPaths
|
|||||||
return &AuthenticateMiddleware{
|
return &AuthenticateMiddleware{
|
||||||
config: conf.Get(),
|
config: conf.Get(),
|
||||||
userSrvc: userService,
|
userSrvc: userService,
|
||||||
cache: cache.New(1*time.Hour, 2*time.Hour),
|
|
||||||
whitelistPaths: whitelistPaths,
|
whitelistPaths: whitelistPaths,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -64,8 +58,6 @@ func (m *AuthenticateMiddleware) ServeHTTP(w http.ResponseWriter, r *http.Reques
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
m.cache.Set(user.ID, user, cache.DefaultExpiration)
|
|
||||||
|
|
||||||
ctx := context.WithValue(r.Context(), models.UserKey, user)
|
ctx := context.WithValue(r.Context(), models.UserKey, user)
|
||||||
next(w, r.WithContext(ctx))
|
next(w, r.WithContext(ctx))
|
||||||
}
|
}
|
||||||
@ -78,15 +70,10 @@ func (m *AuthenticateMiddleware) tryGetUserByApiKey(r *http.Request) (*models.Us
|
|||||||
|
|
||||||
var user *models.User
|
var user *models.User
|
||||||
userKey := strings.TrimSpace(key)
|
userKey := strings.TrimSpace(key)
|
||||||
cachedUser, ok := m.cache.Get(userKey)
|
|
||||||
if !ok {
|
|
||||||
user, err = m.userSrvc.GetUserByKey(userKey)
|
user, err = m.userSrvc.GetUserByKey(userKey)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
user = cachedUser.(*models.User)
|
|
||||||
}
|
|
||||||
return user, nil
|
return user, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -96,12 +83,6 @@ func (m *AuthenticateMiddleware) tryGetUserByCookie(r *http.Request) (*models.Us
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
cachedUser, ok := m.cache.Get(login.Username)
|
|
||||||
|
|
||||||
if ok {
|
|
||||||
return cachedUser.(*models.User), nil
|
|
||||||
}
|
|
||||||
|
|
||||||
user, err := m.userSrvc.GetUserById(login.Username)
|
user, err := m.userSrvc.GetUserById(login.Username)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -6,7 +6,6 @@ import (
|
|||||||
"github.com/muety/wakapi/mocks"
|
"github.com/muety/wakapi/mocks"
|
||||||
"github.com/muety/wakapi/models"
|
"github.com/muety/wakapi/models"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/stretchr/testify/mock"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
@ -33,30 +32,6 @@ func TestAuthenticateMiddleware_tryGetUserByApiKey_Success(t *testing.T) {
|
|||||||
assert.Equal(t, testUser, result)
|
assert.Equal(t, testUser, result)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestAuthenticateMiddleware_tryGetUserByApiKey_GetFromCache(t *testing.T) {
|
|
||||||
testApiKey := "z5uig69cn9ut93n"
|
|
||||||
testToken := base64.StdEncoding.EncodeToString([]byte(testApiKey))
|
|
||||||
testUser := &models.User{ApiKey: testApiKey}
|
|
||||||
|
|
||||||
mockRequest := &http.Request{
|
|
||||||
Header: http.Header{
|
|
||||||
"Authorization": []string{fmt.Sprintf("Basic %s", testToken)},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
userServiceMock := new(mocks.UserServiceMock)
|
|
||||||
userServiceMock.On("GetUserByKey", testApiKey).Return(testUser, nil)
|
|
||||||
|
|
||||||
sut := NewAuthenticateMiddleware(userServiceMock, []string{})
|
|
||||||
sut.cache.SetDefault(testApiKey, testUser)
|
|
||||||
|
|
||||||
result, err := sut.tryGetUserByApiKey(mockRequest)
|
|
||||||
|
|
||||||
assert.Nil(t, err)
|
|
||||||
assert.Equal(t, testUser, result)
|
|
||||||
userServiceMock.AssertNotCalled(t, "GetUserByKey", mock.Anything)
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestAuthenticateMiddleware_tryGetUserByApiKey_InvalidHeader(t *testing.T) {
|
func TestAuthenticateMiddleware_tryGetUserByApiKey_InvalidHeader(t *testing.T) {
|
||||||
testApiKey := "z5uig69cn9ut93n"
|
testApiKey := "z5uig69cn9ut93n"
|
||||||
testToken := base64.StdEncoding.EncodeToString([]byte(testApiKey))
|
testToken := base64.StdEncoding.EncodeToString([]byte(testApiKey))
|
||||||
|
99
middlewares/custom/wakatime.go
Normal file
99
middlewares/custom/wakatime.go
Normal file
@ -0,0 +1,99 @@
|
|||||||
|
package relay
|
||||||
|
|
||||||
|
import (
|
||||||
|
"bytes"
|
||||||
|
"encoding/base64"
|
||||||
|
"fmt"
|
||||||
|
"github.com/muety/wakapi/config"
|
||||||
|
"github.com/muety/wakapi/models"
|
||||||
|
"io"
|
||||||
|
"io/ioutil"
|
||||||
|
"log"
|
||||||
|
"net/http"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
WakatimeApiUrl = "https://wakatime.com/api/v1"
|
||||||
|
WakatimeApiHeartbeatsEndpoint = "/users/current/heartbeats.bulk"
|
||||||
|
)
|
||||||
|
|
||||||
|
/* Middleware to conditionally relay heartbeats to Wakatime */
|
||||||
|
type WakatimeRelayMiddleware struct {
|
||||||
|
httpClient *http.Client
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewWakatimeRelayMiddleware() *WakatimeRelayMiddleware {
|
||||||
|
return &WakatimeRelayMiddleware{
|
||||||
|
httpClient: &http.Client{
|
||||||
|
Timeout: 10 * time.Second,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *WakatimeRelayMiddleware) Handler(h http.Handler) http.Handler {
|
||||||
|
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
m.ServeHTTP(w, r, h.ServeHTTP)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *WakatimeRelayMiddleware) ServeHTTP(w http.ResponseWriter, r *http.Request, next http.HandlerFunc) {
|
||||||
|
defer next(w, r)
|
||||||
|
|
||||||
|
if r.Method != http.MethodPost {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
user := r.Context().Value(models.UserKey).(*models.User)
|
||||||
|
if user == nil || user.WakatimeApiKey == "" {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
body, _ := ioutil.ReadAll(r.Body)
|
||||||
|
r.Body.Close()
|
||||||
|
r.Body = ioutil.NopCloser(bytes.NewBuffer(body))
|
||||||
|
|
||||||
|
headers := http.Header{
|
||||||
|
"X-Machine-Name": r.Header.Values("X-Machine-Name"),
|
||||||
|
"Content-Type": r.Header.Values("Content-Type"),
|
||||||
|
"Accept": r.Header.Values("Accept"),
|
||||||
|
"User-Agent": r.Header.Values("User-Agent"),
|
||||||
|
"X-Origin": []string{
|
||||||
|
fmt.Sprintf("wakapi v%s", config.Get().Version),
|
||||||
|
},
|
||||||
|
"Authorization": []string{
|
||||||
|
fmt.Sprintf("Basic %s", base64.StdEncoding.EncodeToString([]byte(user.WakatimeApiKey))),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
go m.send(
|
||||||
|
http.MethodPost,
|
||||||
|
WakatimeApiUrl+WakatimeApiHeartbeatsEndpoint,
|
||||||
|
bytes.NewReader(body),
|
||||||
|
headers,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *WakatimeRelayMiddleware) send(method, url string, body io.Reader, headers http.Header) {
|
||||||
|
request, err := http.NewRequest(method, url, body)
|
||||||
|
if err != nil {
|
||||||
|
log.Printf("error constructing relayed request – %v\n", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
for k, v := range headers {
|
||||||
|
for _, h := range v {
|
||||||
|
request.Header.Set(k, h)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
response, err := m.httpClient.Do(request)
|
||||||
|
if err != nil {
|
||||||
|
log.Printf("error executing relayed request – %v\n", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
||||||
|
log.Printf("failed to relay request, got status %d\n", response.StatusCode)
|
||||||
|
}
|
||||||
|
}
|
@ -44,6 +44,11 @@ func (m *UserServiceMock) ToggleBadges(user *models.User) (*models.User, error)
|
|||||||
return args.Get(0).(*models.User), args.Error(1)
|
return args.Get(0).(*models.User), args.Error(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *UserServiceMock) SetWakatimeApiKey(user *models.User, s string) (*models.User, error) {
|
||||||
|
args := m.Called(user, s)
|
||||||
|
return args.Get(0).(*models.User), args.Error(1)
|
||||||
|
}
|
||||||
|
|
||||||
func (m *UserServiceMock) MigrateMd5Password(user *models.User, login *models.Login) (*models.User, error) {
|
func (m *UserServiceMock) MigrateMd5Password(user *models.User, login *models.Login) (*models.User, error) {
|
||||||
args := m.Called(user, login)
|
args := m.Called(user, login)
|
||||||
return args.Get(0).(*models.User), args.Error(1)
|
return args.Get(0).(*models.User), args.Error(1)
|
||||||
|
@ -7,6 +7,7 @@ type User struct {
|
|||||||
CreatedAt CustomTime `gorm:"type:timestamp; default:CURRENT_TIMESTAMP"`
|
CreatedAt CustomTime `gorm:"type:timestamp; default:CURRENT_TIMESTAMP"`
|
||||||
LastLoggedInAt CustomTime `gorm:"type:timestamp; default:CURRENT_TIMESTAMP"`
|
LastLoggedInAt CustomTime `gorm:"type:timestamp; default:CURRENT_TIMESTAMP"`
|
||||||
BadgesEnabled bool `json:"-" gorm:"default:false; type:bool"`
|
BadgesEnabled bool `json:"-" gorm:"default:false; type:bool"`
|
||||||
|
WakatimeApiKey string `json:"-"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Login struct {
|
type Login struct {
|
||||||
|
@ -2,6 +2,7 @@ package routes
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"github.com/markbates/pkger"
|
||||||
"github.com/muety/wakapi/config"
|
"github.com/muety/wakapi/config"
|
||||||
"github.com/muety/wakapi/models"
|
"github.com/muety/wakapi/models"
|
||||||
"github.com/muety/wakapi/utils"
|
"github.com/muety/wakapi/utils"
|
||||||
@ -18,7 +19,7 @@ func Init() {
|
|||||||
var templates map[string]*template.Template
|
var templates map[string]*template.Template
|
||||||
|
|
||||||
func loadTemplates() {
|
func loadTemplates() {
|
||||||
tplPath := "views"
|
const tplPath = "/views"
|
||||||
tpls := template.New("").Funcs(template.FuncMap{
|
tpls := template.New("").Funcs(template.FuncMap{
|
||||||
"json": utils.Json,
|
"json": utils.Json,
|
||||||
"date": utils.FormatDateHuman,
|
"date": utils.FormatDateHuman,
|
||||||
@ -44,7 +45,12 @@ func loadTemplates() {
|
|||||||
})
|
})
|
||||||
templates = make(map[string]*template.Template)
|
templates = make(map[string]*template.Template)
|
||||||
|
|
||||||
files, err := ioutil.ReadDir(tplPath)
|
dir, err := pkger.Open(tplPath)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
defer dir.Close()
|
||||||
|
files, err := dir.Readdir(0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
@ -55,7 +61,18 @@ func loadTemplates() {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
tpl, err := tpls.New(tplName).ParseFiles(fmt.Sprintf("%s/%s", tplPath, tplName))
|
templateFile, err := pkger.Open(fmt.Sprintf("%s/%s", tplPath, tplName))
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
templateData, err := ioutil.ReadAll(templateFile)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
templateFile.Close()
|
||||||
|
|
||||||
|
tpl, err := tpls.New(tplName).Parse(string(templateData))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
@ -233,6 +233,21 @@ func (h *SettingsHandler) PostResetApiKey(w http.ResponseWriter, r *http.Request
|
|||||||
templates[conf.SettingsTemplate].Execute(w, h.buildViewModel(r).WithSuccess(msg))
|
templates[conf.SettingsTemplate].Execute(w, h.buildViewModel(r).WithSuccess(msg))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (h *SettingsHandler) PostSetWakatimeApiKey(w http.ResponseWriter, r *http.Request) {
|
||||||
|
if h.config.IsDev() {
|
||||||
|
loadTemplates()
|
||||||
|
}
|
||||||
|
|
||||||
|
user := r.Context().Value(models.UserKey).(*models.User)
|
||||||
|
if _, err := h.userSrvc.SetWakatimeApiKey(user, r.PostFormValue("api_key")); err != nil {
|
||||||
|
w.WriteHeader(http.StatusInternalServerError)
|
||||||
|
templates[conf.SettingsTemplate].Execute(w, h.buildViewModel(r).WithError("internal server error"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
templates[conf.SettingsTemplate].Execute(w, h.buildViewModel(r).WithSuccess("Wakatime API Key updated successfully"))
|
||||||
|
}
|
||||||
|
|
||||||
func (h *SettingsHandler) PostToggleBadges(w http.ResponseWriter, r *http.Request) {
|
func (h *SettingsHandler) PostToggleBadges(w http.ResponseWriter, r *http.Request) {
|
||||||
if h.config.IsDev() {
|
if h.config.IsDev() {
|
||||||
loadTemplates()
|
loadTemplates()
|
||||||
|
@ -11,6 +11,7 @@ from typing import List, Union
|
|||||||
import requests
|
import requests
|
||||||
from tqdm import tqdm
|
from tqdm import tqdm
|
||||||
|
|
||||||
|
MACHINE = "devmachine"
|
||||||
UA = 'wakatime/13.0.7 (Linux-4.15.0-91-generic-x86_64-with-glibc2.4) Python3.8.0.final.0 generator/1.42.1 generator-wakatime/4.0.0'
|
UA = 'wakatime/13.0.7 (Linux-4.15.0-91-generic-x86_64-with-glibc2.4) Python3.8.0.final.0 generator/1.42.1 generator-wakatime/4.0.0'
|
||||||
LANGUAGES = {
|
LANGUAGES = {
|
||||||
'Go': 'go',
|
'Go': 'go',
|
||||||
@ -75,7 +76,8 @@ def post_data_sync(data: List[Heartbeat], url: str, api_key: str):
|
|||||||
for h in tqdm(data):
|
for h in tqdm(data):
|
||||||
r = requests.post(url, json=[h.__dict__], headers={
|
r = requests.post(url, json=[h.__dict__], headers={
|
||||||
'User-Agent': UA,
|
'User-Agent': UA,
|
||||||
'Authorization': f'Basic {encoded_key}'
|
'Authorization': f'Basic {encoded_key}',
|
||||||
|
'X-Machine-Name': MACHINE,
|
||||||
})
|
})
|
||||||
if r.status_code != 201:
|
if r.status_code != 201:
|
||||||
print(r.text)
|
print(r.text)
|
||||||
|
@ -63,5 +63,6 @@ type IUserService interface {
|
|||||||
Update(*models.User) (*models.User, error)
|
Update(*models.User) (*models.User, error)
|
||||||
ResetApiKey(*models.User) (*models.User, error)
|
ResetApiKey(*models.User) (*models.User, error)
|
||||||
ToggleBadges(*models.User) (*models.User, error)
|
ToggleBadges(*models.User) (*models.User, error)
|
||||||
|
SetWakatimeApiKey(*models.User, string) (*models.User, error)
|
||||||
MigrateMd5Password(*models.User, *models.Login) (*models.User, error)
|
MigrateMd5Password(*models.User, *models.Login) (*models.User, error)
|
||||||
}
|
}
|
||||||
|
@ -5,11 +5,14 @@ import (
|
|||||||
"github.com/muety/wakapi/models"
|
"github.com/muety/wakapi/models"
|
||||||
"github.com/muety/wakapi/repositories"
|
"github.com/muety/wakapi/repositories"
|
||||||
"github.com/muety/wakapi/utils"
|
"github.com/muety/wakapi/utils"
|
||||||
|
"github.com/patrickmn/go-cache"
|
||||||
uuid "github.com/satori/go.uuid"
|
uuid "github.com/satori/go.uuid"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
type UserService struct {
|
type UserService struct {
|
||||||
Config *config.Config
|
Config *config.Config
|
||||||
|
cache *cache.Cache
|
||||||
repository repositories.IUserRepository
|
repository repositories.IUserRepository
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -17,15 +20,36 @@ func NewUserService(userRepo repositories.IUserRepository) *UserService {
|
|||||||
return &UserService{
|
return &UserService{
|
||||||
Config: config.Get(),
|
Config: config.Get(),
|
||||||
repository: userRepo,
|
repository: userRepo,
|
||||||
|
cache: cache.New(1*time.Hour, 2*time.Hour),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (srv *UserService) GetUserById(userId string) (*models.User, error) {
|
func (srv *UserService) GetUserById(userId string) (*models.User, error) {
|
||||||
return srv.repository.GetById(userId)
|
if u, ok := srv.cache.Get(userId); ok {
|
||||||
|
return u.(*models.User), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
u, err := srv.repository.GetById(userId)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
srv.cache.Set(u.ID, u, cache.DefaultExpiration)
|
||||||
|
return u, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (srv *UserService) GetUserByKey(key string) (*models.User, error) {
|
func (srv *UserService) GetUserByKey(key string) (*models.User, error) {
|
||||||
return srv.repository.GetByApiKey(key)
|
if u, ok := srv.cache.Get(key); ok {
|
||||||
|
return u.(*models.User), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
u, err := srv.repository.GetByApiKey(key)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
srv.cache.Set(u.ID, u, cache.DefaultExpiration)
|
||||||
|
return u, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (srv *UserService) GetAll() ([]*models.User, error) {
|
func (srv *UserService) GetAll() ([]*models.User, error) {
|
||||||
@ -49,19 +73,28 @@ func (srv *UserService) CreateOrGet(signup *models.Signup) (*models.User, bool,
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (srv *UserService) Update(user *models.User) (*models.User, error) {
|
func (srv *UserService) Update(user *models.User) (*models.User, error) {
|
||||||
|
srv.cache.Flush()
|
||||||
return srv.repository.Update(user)
|
return srv.repository.Update(user)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (srv *UserService) ResetApiKey(user *models.User) (*models.User, error) {
|
func (srv *UserService) ResetApiKey(user *models.User) (*models.User, error) {
|
||||||
|
srv.cache.Flush()
|
||||||
user.ApiKey = uuid.NewV4().String()
|
user.ApiKey = uuid.NewV4().String()
|
||||||
return srv.Update(user)
|
return srv.Update(user)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (srv *UserService) ToggleBadges(user *models.User) (*models.User, error) {
|
func (srv *UserService) ToggleBadges(user *models.User) (*models.User, error) {
|
||||||
|
srv.cache.Flush()
|
||||||
return srv.repository.UpdateField(user, "badges_enabled", !user.BadgesEnabled)
|
return srv.repository.UpdateField(user, "badges_enabled", !user.BadgesEnabled)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (srv *UserService) SetWakatimeApiKey(user *models.User, apiKey string) (*models.User, error) {
|
||||||
|
srv.cache.Flush()
|
||||||
|
return srv.repository.UpdateField(user, "wakatime_api_key", apiKey)
|
||||||
|
}
|
||||||
|
|
||||||
func (srv *UserService) MigrateMd5Password(user *models.User, login *models.Login) (*models.User, error) {
|
func (srv *UserService) MigrateMd5Password(user *models.User, login *models.Login) (*models.User, error) {
|
||||||
|
srv.cache.Flush()
|
||||||
user.Password = login.Password
|
user.Password = login.Password
|
||||||
if hash, err := utils.HashBcrypt(user.Password, srv.Config.Security.PasswordSalt); err != nil {
|
if hash, err := utils.HashBcrypt(user.Password, srv.Config.Security.PasswordSalt); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -1 +1 @@
|
|||||||
1.19.0
|
1.20.2
|
@ -1,2 +1,2 @@
|
|||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/seedrandom/3.0.5/seedrandom.min.js"></script>
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/seedrandom/3.0.5/seedrandom.min.js" integrity="sha384-bFS5CG904xYIgxBcrDF4KFNXuM7KeSGsSvS/QTaDqMTEdbaaxjg2Y2TSU3Ygs7wG" crossorigin="anonymous"></script>
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.4/Chart.bundle.min.js"></script>
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.4/Chart.bundle.min.js" integrity="sha384-mZ3q69BYmd4GxHp59G3RrsaFdWDxVSoqd7oVYuWRm2qiXrduT63lQtlhdD9lKbm3" crossorigin="anonymous"></script>
|
@ -7,6 +7,6 @@
|
|||||||
<link rel="icon" type="image/png" sizes="16x16" href="assets/images/favicon-16x16.png">
|
<link rel="icon" type="image/png" sizes="16x16" href="assets/images/favicon-16x16.png">
|
||||||
<link rel="manifest" href="assets/site.webmanifest">
|
<link rel="manifest" href="assets/site.webmanifest">
|
||||||
<link href="https://fonts.googleapis.com/css?family=Roboto&display=swap" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/css?family=Roboto&display=swap" rel="stylesheet">
|
||||||
<link href="https://unpkg.com/tailwindcss@^1.4.6/dist/tailwind.min.css" rel="stylesheet">
|
<link href="https://unpkg.com/tailwindcss@^1.4.6/dist/tailwind.min.css" rel="stylesheet" integrity="sha384-g+D4mP3VJaTdOzGhEGvSbCkMsmTWyibnPpolg6g7Xnw9Z5y6PbFl7W3CW6iA8Ybm" crossorigin="anonymous">
|
||||||
<link href="assets/app.css" rel="stylesheet">
|
<link href="assets/app.css" rel="stylesheet">
|
||||||
</head>
|
</head>
|
@ -9,9 +9,11 @@
|
|||||||
.inline-bullet-list li a {
|
.inline-bullet-list li a {
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
|
|
||||||
.inline-bullet-list li:after {
|
.inline-bullet-list li:after {
|
||||||
content: "•";
|
content: "•";
|
||||||
}
|
}
|
||||||
|
|
||||||
.inline-bullet-list li:last-child:after {
|
.inline-bullet-list li:last-child:after {
|
||||||
content: "";
|
content: "";
|
||||||
}
|
}
|
||||||
@ -32,7 +34,7 @@
|
|||||||
<main class="mt-4 flex-grow flex justify-center w-full">
|
<main class="mt-4 flex-grow flex justify-center w-full">
|
||||||
<div class="flex flex-col flex-grow max-w-xl mt-8">
|
<div class="flex flex-col flex-grow max-w-xl mt-8">
|
||||||
<div class="text-gray-500 text-xs mb-8">
|
<div class="text-gray-500 text-xs mb-8">
|
||||||
<ul class="flex justify-center flex-wrap space-x-1 inline-bullet-list">
|
<ul class="flex justify-center flex-wrap space-x-1 inline-bullet-list px-12">
|
||||||
<li class="hover:text-gray-400 mb-1">
|
<li class="hover:text-gray-400 mb-1">
|
||||||
<a href="settings#password">Change Password</a>
|
<a href="settings#password">Change Password</a>
|
||||||
</li>
|
</li>
|
||||||
@ -48,6 +50,9 @@
|
|||||||
<li class="hover:text-gray-400 mb-1">
|
<li class="hover:text-gray-400 mb-1">
|
||||||
<a href="settings#badges">Badges</a>
|
<a href="settings#badges">Badges</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="hover:text-gray-400 mb-1">
|
||||||
|
<a href="settings#integrations">Integrations</a>
|
||||||
|
</li>
|
||||||
<li class="hover:text-gray-400 mb-1">
|
<li class="hover:text-gray-400 mb-1">
|
||||||
<a href="settings#danger">Danger Zone</a>
|
<a href="settings#danger">Danger Zone</a>
|
||||||
</li>
|
</li>
|
||||||
@ -55,9 +60,9 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="w-full my-8 pb-8 border-b border-gray-700">
|
<div class="w-full my-8 pb-8 border-b border-gray-700">
|
||||||
<div class="font-semibold text-lg text-white m-0 border-b-2 border-green-700 inline-block" id="password">
|
<h2 class="font-semibold text-lg text-white m-0 border-b-2 border-green-700 inline-block" id="password">
|
||||||
Change Password
|
Change Password
|
||||||
</div>
|
</h2>
|
||||||
|
|
||||||
<form class="mt-10" action="settings/credentials" method="post">
|
<form class="mt-10" action="settings/credentials" method="post">
|
||||||
<div class="mb-8">
|
<div class="mb-8">
|
||||||
@ -87,9 +92,9 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="w-full mt-4 mb-8 pb-8 border-b border-gray-700">
|
<div class="w-full mt-4 mb-8 pb-8 border-b border-gray-700">
|
||||||
<div class="font-semibold text-lg text-white m-0 border-b-2 border-green-700 inline-block" id="apikey">
|
<h2 class="font-semibold text-lg text-white m-0 border-b-2 border-green-700 inline-block" id="apikey">
|
||||||
Reset API Key
|
Reset API Key
|
||||||
</div>
|
</h2>
|
||||||
|
|
||||||
<form class="mt-6" action="settings/reset" method="post">
|
<form class="mt-6" action="settings/reset" method="post">
|
||||||
<div class="text-gray-300 text-sm mb-4">
|
<div class="text-gray-300 text-sm mb-4">
|
||||||
@ -107,9 +112,9 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="w-full mt-4 mb-8 pb-8 border-b border-gray-700" id="aliases">
|
<div class="w-full mt-4 mb-8 pb-8 border-b border-gray-700" id="aliases">
|
||||||
<div class="font-semibold text-lg text-white m-0 border-b-2 border-green-700 inline-block">
|
<h2 class="font-semibold text-lg text-white m-0 border-b-2 border-green-700 inline-block">
|
||||||
Aliases
|
Aliases
|
||||||
</div>
|
</h2>
|
||||||
|
|
||||||
<div class="text-gray-300 text-sm mb-4 mt-6">
|
<div class="text-gray-300 text-sm mb-4 mt-6">
|
||||||
You can specify aliases for any type of entity. For instance, you can define a rule, that both <span
|
You can specify aliases for any type of entity. For instance, you can define a rule, that both <span
|
||||||
@ -119,7 +124,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{ if .Aliases }}
|
{{ if .Aliases }}
|
||||||
<h3 class="text-md font-semibold text-white">Rules</h3>
|
<h3 class="inline-block font-semibold text-md border-b border-green-700 text-white">Rules</h3>
|
||||||
{{ range $i, $alias := .Aliases }}
|
{{ range $i, $alias := .Aliases }}
|
||||||
<div class="flex items-center">
|
<div class="flex items-center">
|
||||||
<div class="text-gray-500 border-1 w-full border-green-700 inline-block my-1 py-1 text-align text-sm"
|
<div class="text-gray-500 border-1 w-full border-green-700 inline-block my-1 py-1 text-align text-sm"
|
||||||
@ -139,7 +144,8 @@
|
|||||||
<form class="float-right" action="settings/aliases/delete" method="post">
|
<form class="float-right" action="settings/aliases/delete" method="post">
|
||||||
<input type="hidden" id="delete_alias_key" name="key" required value="{{ $alias.Key }}">
|
<input type="hidden" id="delete_alias_key" name="key" required value="{{ $alias.Key }}">
|
||||||
<input type="hidden" id="delete_alias_type" name="type" required value="{{ $alias.Type }}">
|
<input type="hidden" id="delete_alias_type" name="type" required value="{{ $alias.Type }}">
|
||||||
<button type="submit" class="py-1 px-3 rounded border border-red-500 hover:border-red-600 text-gray-400 text-sm">
|
<button type="submit"
|
||||||
|
class="py-1 px-3 rounded border border-red-500 hover:border-red-600 text-gray-400 text-sm">
|
||||||
✕
|
✕
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
@ -148,7 +154,7 @@
|
|||||||
<div class="mb-8"></div>
|
<div class="mb-8"></div>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
<h3 class="text-md font-semibold text-white">Add Rule</h3>
|
<h3 class="inline-block font-semibold text-md border-b border-green-700 text-white mb-2">Add Rule</h3>
|
||||||
<form action="settings/aliases" method="post">
|
<form action="settings/aliases" method="post">
|
||||||
<div class="flex items-center mt-2 w-full text-gray-500 text-sm">
|
<div class="flex items-center mt-2 w-full text-gray-500 text-sm">
|
||||||
<span class="mr-2">Map</span>
|
<span class="mr-2">Map</span>
|
||||||
@ -188,7 +194,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{ if .LanguageMappings }}
|
{{ if .LanguageMappings }}
|
||||||
<h3 class="text-md font-semibold text-white">Rules</h3>
|
<h3 class="inline-block font-semibold text-md border-b border-green-700 text-white">Rules</h3>
|
||||||
{{ range $i, $mapping := .LanguageMappings }}
|
{{ range $i, $mapping := .LanguageMappings }}
|
||||||
<div class="flex items-center">
|
<div class="flex items-center">
|
||||||
<div class="text-gray-500 border-1 w-full border-green-700 inline-block my-1 py-1 text-align text-sm">
|
<div class="text-gray-500 border-1 w-full border-green-700 inline-block my-1 py-1 text-align text-sm">
|
||||||
@ -199,7 +205,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<form class="float-right" action="settings/language_mappings/delete" method="post">
|
<form class="float-right" action="settings/language_mappings/delete" method="post">
|
||||||
<input type="hidden" id="mapping_id" name="mapping_id" required value="{{ $mapping.ID }}">
|
<input type="hidden" id="mapping_id" name="mapping_id" required value="{{ $mapping.ID }}">
|
||||||
<button type="submit" class="py-1 px-3 rounded border border-red-500 hover:border-red-600 text-gray-400 text-sm">
|
<button type="submit"
|
||||||
|
class="py-1 px-3 rounded border border-red-500 hover:border-red-600 text-gray-400 text-sm">
|
||||||
✕
|
✕
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
@ -208,7 +215,7 @@
|
|||||||
<div class="mb-8"></div>
|
<div class="mb-8"></div>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
<h3 class="text-md font-semibold text-white">Add Rule</h3>
|
<h3 class="inline-block font-semibold text-md border-b border-green-700 text-white">Add Rule</h3>
|
||||||
<form action="settings/language_mappings" method="post">
|
<form action="settings/language_mappings" method="post">
|
||||||
<div class="flex items-center w-full text-gray-500 text-sm">
|
<div class="flex items-center w-full text-gray-500 text-sm">
|
||||||
<span class="mr-2">When filename ends in</span>
|
<span class="mr-2">When filename ends in</span>
|
||||||
@ -295,6 +302,68 @@
|
|||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="w-full mt-4 mb-8 pb-8 border-b border-gray-700">
|
||||||
|
<h2 class="font-semibold text-lg text-white m-0 border-b-2 border-green-700 inline-block" id="integrations">
|
||||||
|
Integrations
|
||||||
|
</h2>
|
||||||
|
|
||||||
|
<div class="mt-10 text-gray-300 text-sm">
|
||||||
|
<h3 class="inline-block font-semibold text-md mb-4 border-b border-green-700">
|
||||||
|
WakaTime
|
||||||
|
</h3>
|
||||||
|
|
||||||
|
<div class="flex space-x-4">
|
||||||
|
<img alt="WakaTime Logo"
|
||||||
|
width="55px"
|
||||||
|
src="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzQwIiBoZWlnaHQ9IjM0MCIgdmlld0JveD0iMCAwIDM0MCAzNDAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMTcwIDIwQzg3LjE1NiAyMCAyMCA4Ny4xNTYgMjAgMTcwQzIwIDI1Mi44NDQgODcuMTU2IDMyMCAxNzAgMzIwQzI1Mi44NDQgMzIwIDMyMCAyNTIuODQ0IDMyMCAxNzBDMzIwIDg3LjE1NiAyNTIuODQ0IDIwIDE3MCAyMFYyMFYyMFoiIHN0cm9rZT0id2hpdGUiIHN0cm9rZS13aWR0aD0iNDAiLz4KPHBhdGggZD0iTTE5MC4xODMgMjEzLjU0MUMxODguNzQgMjE1LjQ0MyAxODYuNTc2IDIxNi42NjcgMTg0LjE1MSAyMTYuNjY3QzE4My45MTMgMjE2LjY2NyAxODMuNjc3IDIxNi42NTEgMTgzLjQ0MyAyMTYuNjI3QzE4My4wNDIgMjE2LjU3OSAxODIuODIzIDIxNi41NDUgMTgyLjYwNiAyMTYuNDk3QzE4Mi4zMzcgMjE2LjQzNCAxODIuMTM3IDIxNi4zNzUgMTgxLjk0IDIxNi4zMDhDMTgxLjU2MSAyMTYuMTc2IDE4MS4zOTIgMjE2LjEwOSAxODEuMjI4IDIxNi4wMzVDMTgwLjg0MyAyMTUuODQ5IDE4MC43MDcgMjE1Ljc3OCAxODAuNTcyIDIxNS43MDFDMTgwLjIwNSAyMTUuNDc4IDE4MC4xMDkgMjE1LjQxMiAxODAuMDE0IDIxNS4zNDVDMTc5Ljg1NiAyMTUuMjMzIDE3OS42OTggMjE1LjExNyAxNzkuNTQ3IDIxNC45OTJDMTc5LjI1MSAyMTQuNzQ2IDE3OS4xNDcgMjE0LjY1IDE3OS4wNDQgMjE0LjU1MkMxNzguNzMxIDIxNC4yNDEgMTc4LjUzMSAyMTQuMDE4IDE3OC4zNDEgMjEzLjc4NUMxNzcuOTgyIDIxMy4zMzEgMTc3LjY5IDIxMi44ODggMTc3LjQzOCAyMTIuNDE1TDE2OC42IDE5OC4yMTRMMTU5Ljc2NiAyMTIuNDE1QzE1OC4zOCAyMTQuOTM5IDE1NS44NzQgMjE2LjY2NyAxNTIuOTk1IDIxNi42NjdDMTUwLjEwNiAyMTYuNjY3IDE0Ny41ODggMjE0LjkyNiAxNDYuMjQzIDIxMi4zNDZMMTA3LjYwNyAxNTYuMDYxQzEwNi4zMzcgMTU0LjUyOSAxMDUuNTU2IDE1Mi40OTkgMTA1LjU1NiAxNTAuMjU4QzEwNS41NTYgMTQ1LjUxNCAxMDkuMDQzIDE0MS42NjUgMTEzLjM0NCAxNDEuNjY1QzExNi4xMjcgMTQxLjY2NSAxMTguNTY0IDE0My4yODIgMTE5Ljk0MiAxNDUuNzA4TDE1Mi41NTUgMTkzLjlMMTYxLjczNSAxNzguOTUyQzE2My4wNTggMTc2LjI4OCAxNjUuNjI2IDE3NC40NzggMTY4LjU3NSAxNzQuNDc4QzE3MS4yNzMgMTc0LjQ3OCAxNzMuNjUyIDE3NS45OTYgMTc1LjA0OSAxNzguMjk4TDE4NC41MTcgMTkzLjgzOUwyMzUuNjg0IDEyMC41ODNDMjM3LjA3NSAxMTguMjI2IDIzOS40NzUgMTE2LjY2NyAyNDIuMjEzIDExNi42NjdDMjQ2LjUxNCAxMTYuNjY3IDI1MCAxMjAuNTE0IDI1MCAxMjUuMjU4QzI1MCAxMjcuMzMyIDI0OS4zMzcgMTI5LjIzMiAyNDguMjMgMTMwLjcxNUwxOTAuMTgzIDIxMy41NDFWMjEzLjU0MVoiIGZpbGw9IndoaXRlIiBzdHJva2U9IndoaXRlIiBzdHJva2Utd2lkdGg9IjEwIi8+Cjwvc3ZnPgo=">
|
||||||
|
<p class="text-sm">You can connect Wakapi with the official <a class="underline"
|
||||||
|
href="https://wakatime.com"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
target="_blank">WakaTime</a> in a way
|
||||||
|
that all heartbeats sent to Wakapi are relayed. This way, you can use both services
|
||||||
|
at
|
||||||
|
the same time. To get started, <a class="underline"
|
||||||
|
href="https://wakatime.com/developers#authentication"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
target="_blank">get your API key</a> and paste it here.</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<form action="settings/wakatime_integration" method="post">
|
||||||
|
|
||||||
|
{{ $placeholderText := "Paste your WakaTime API key here ..." }}
|
||||||
|
{{ if .User.WakatimeApiKey }}
|
||||||
|
{{ $placeholderText = "********" }}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
<div class="flex items-center mt-8 space-x-2">
|
||||||
|
<label class="text-gray-500 font-semibold">API Key:</label>
|
||||||
|
<input type="password" name="api_key" id="wakatime_api_key"
|
||||||
|
class="flex-grow shadow appearance-nonshadow appearance-none bg-gray-800 text-gray-300 border-green-700 border rounded py-1 px-3 {{ if not .User.WakatimeApiKey }}focus:bg-gray-700 focus:border-gray-500{{ end }}"
|
||||||
|
placeholder="{{ $placeholderText }}" {{ if .User.WakatimeApiKey }}readonly{{ end }}>
|
||||||
|
<div class="flex-grow flex justify-end">
|
||||||
|
{{ if not .User.WakatimeApiKey }}
|
||||||
|
<button type="submit"
|
||||||
|
class="py-1 px-3 my-3 rounded bg-green-700 hover:bg-green-800 text-white text-sm">
|
||||||
|
Connect
|
||||||
|
</button>
|
||||||
|
{{ else }}
|
||||||
|
<button type="submit"
|
||||||
|
class="py-1 px-3 rounded bg-red-500 hover:bg-red-600 text-white text-sm">Disconnect
|
||||||
|
</button>
|
||||||
|
{{ end }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<p class="mt-6">
|
||||||
|
<span class="font-semibold">👉 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>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="w-full mt-4 mb-8 pb-8">
|
<div class="w-full mt-4 mb-8 pb-8">
|
||||||
<div class="font-semibold text-lg text-white m-0 border-b-2 border-green-700 inline-block" id="danger">
|
<div class="font-semibold text-lg text-white m-0 border-b-2 border-green-700 inline-block" id="danger">
|
||||||
⚠️ Danger Zone
|
⚠️ Danger Zone
|
||||||
|
Reference in New Issue
Block a user