mirror of
https://github.com/muety/wakapi.git
synced 2023-08-10 21:12:56 +03:00
Compare commits
10 Commits
Author | SHA1 | Date | |
---|---|---|---|
91768cf927 | |||
8e6719f0b7 | |||
bcbd6236df | |||
d1cbabf662 | |||
ad4d251154 | |||
2bb3b886c2 | |||
4f183ed637 | |||
b66f9b5cf5 | |||
bf7f93fcd4 | |||
36c96dafca |
2
.github/workflows/docker.yml
vendored
2
.github/workflows/docker.yml
vendored
@ -45,6 +45,6 @@ jobs:
|
|||||||
ghcr.io/${{ github.repository }}:latest
|
ghcr.io/${{ github.repository }}:latest
|
||||||
ghcr.io/${{ github.repository }}:alpine
|
ghcr.io/${{ github.repository }}:alpine
|
||||||
ghcr.io/${{ github.repository }}:${{ env.GIT_TAG }}
|
ghcr.io/${{ github.repository }}:${{ env.GIT_TAG }}
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
||||||
cache-from: type=registry,ref=n1try/wakapi:buildcache-alpine
|
cache-from: type=registry,ref=n1try/wakapi:buildcache-alpine
|
||||||
cache-to: type=registry,ref=n1try/wakapi:buildcache-alpine,mode=max
|
cache-to: type=registry,ref=n1try/wakapi:buildcache-alpine,mode=max
|
||||||
|
23
Dockerfile
23
Dockerfile
@ -1,19 +1,26 @@
|
|||||||
# Build Stage
|
# To build locally: docker buildx build . -t wakapi --load
|
||||||
|
|
||||||
FROM golang:1.16-alpine AS build-env
|
# Preparation to save some time
|
||||||
|
FROM --platform=$BUILDPLATFORM golang:1.17-alpine AS prep-env
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
|
|
||||||
# Required for go-sqlite3
|
|
||||||
RUN apk add gcc musl-dev
|
|
||||||
|
|
||||||
ADD ./go.mod .
|
ADD ./go.mod .
|
||||||
RUN go mod download
|
RUN go mod download
|
||||||
|
ADD . .
|
||||||
|
|
||||||
RUN wget "https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh" -O wait-for-it.sh && \
|
RUN wget "https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh" -O wait-for-it.sh && \
|
||||||
chmod +x wait-for-it.sh
|
chmod +x wait-for-it.sh
|
||||||
|
|
||||||
ADD . .
|
# Build Stage
|
||||||
RUN go build -o wakapi
|
FROM golang:1.17-alpine AS build-env
|
||||||
|
|
||||||
|
# Required for go-sqlite3
|
||||||
|
RUN apk add --no-cache gcc musl-dev
|
||||||
|
|
||||||
|
WORKDIR /src
|
||||||
|
COPY --from=prep-env /src .
|
||||||
|
|
||||||
|
RUN go build -v -o wakapi
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
RUN cp /src/wakapi . && \
|
RUN cp /src/wakapi . && \
|
||||||
@ -31,7 +38,7 @@ RUN cp /src/wakapi . && \
|
|||||||
FROM alpine:3
|
FROM alpine:3
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
RUN apk update && apk add bash ca-certificates tzdata && rm -rf /var/cache/apk
|
RUN apk add --no-cache bash ca-certificates tzdata
|
||||||
|
|
||||||
# See README.md and config.default.yml for all config options
|
# See README.md and config.default.yml for all config options
|
||||||
ENV ENVIRONMENT prod
|
ENV ENVIRONMENT prod
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<img src="static/assets/images/screenshot.png" width="500px">
|
<img src="static/assets/images/screenshot.webp" width="500px">
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
Installation instructions can be found below and in the [Wiki](https://github.com/muety/wakapi/wiki).
|
Installation instructions can be found below and in the [Wiki](https://github.com/muety/wakapi/wiki).
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
if [ "$WAKAPI_DB_TYPE" == "sqlite3" ] || [ "$WAKAPI_DB_TYPE" == "" ]; then
|
if [ "$WAKAPI_DB_TYPE" == "sqlite3" ] || [ "$WAKAPI_DB_TYPE" == "" ]; then
|
||||||
./wakapi
|
exec ./wakapi
|
||||||
else
|
else
|
||||||
echo "Waiting for database to come up"
|
echo "Waiting for database to come up"
|
||||||
./wait-for-it.sh "$WAKAPI_DB_HOST:$WAKAPI_DB_PORT" -s -t 60 -- ./wakapi
|
exec ./wait-for-it.sh "$WAKAPI_DB_HOST:$WAKAPI_DB_PORT" -s -t 60 -- ./wakapi
|
||||||
fi
|
fi
|
||||||
|
@ -17,7 +17,7 @@ import (
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
intervalPattern = `interval:([a-z0-9_]+)`
|
intervalPattern = `interval:([a-z0-9_]+)`
|
||||||
entityFilterPattern = `(project|os|editor|language|machine):([_a-zA-Z0-9-\s]+)`
|
entityFilterPattern = `(project|os|editor|language|machine|label):([_a-zA-Z0-9-\s]+)`
|
||||||
)
|
)
|
||||||
|
|
||||||
type BadgeHandler struct {
|
type BadgeHandler struct {
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 34 KiB |
BIN
static/assets/images/screenshot.webp
Normal file
BIN
static/assets/images/screenshot.webp
Normal file
Binary file not shown.
After Width: | Height: | Size: 28 KiB |
@ -1 +1 @@
|
|||||||
2.0.0-RC1
|
2.0.0
|
@ -5,7 +5,7 @@
|
|||||||
<meta property="og:title" content="Wakapi - Coding Statistics" />
|
<meta property="og:title" content="Wakapi - Coding Statistics" />
|
||||||
<meta property="og:type" content="website" />
|
<meta property="og:type" content="website" />
|
||||||
<meta property="og:description" content="Wakapi is an open-source tool that helps you keep track of the time you have spent coding on different projects in different programming languages and more. Ideal for statistics freaks and anyone else.">
|
<meta property="og:description" content="Wakapi is an open-source tool that helps you keep track of the time you have spent coding on different projects in different programming languages and more. Ideal for statistics freaks and anyone else.">
|
||||||
<meta property="og:image" content="assets/images/screenshot.png" />
|
<meta property="og:image" content="assets/images/screenshot.webp" />
|
||||||
<link rel="apple-touch-icon" sizes="180x180" href="assets/images/apple-touch-icon.png">
|
<link rel="apple-touch-icon" sizes="180x180" href="assets/images/apple-touch-icon.png">
|
||||||
<link rel="icon" type="image/png" sizes="32x32" href="assets/images/favicon-32x32.png">
|
<link rel="icon" type="image/png" sizes="32x32" href="assets/images/favicon-32x32.png">
|
||||||
<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">
|
||||||
|
@ -58,7 +58,7 @@
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div class="flex justify-center my-8">
|
<div class="flex justify-center my-8">
|
||||||
<img alt="App screenshot" src="assets/images/screenshot.png">
|
<img alt="App screenshot" src="assets/images/screenshot.webp">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex flex-col items-center mt-10">
|
<div class="flex flex-col items-center mt-10">
|
||||||
|
@ -266,33 +266,33 @@
|
|||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
<div class="mb-8"></div>
|
<div class="mb-8"></div>
|
||||||
|
|
||||||
{{ if .Projects }}
|
|
||||||
<h3 class="inline-block font-semibold text-gray-300">Add Label</h3>
|
|
||||||
<form action="" method="post">
|
|
||||||
<input type="hidden" name="action" value="add_label">
|
|
||||||
<div class="flex flex-col space-y-4">
|
|
||||||
<div class="flex items-center mt-2 w-full text-gray-500 text-sm space-x-4">
|
|
||||||
<select name="key" id="select-project"
|
|
||||||
class="select-default flex-grow">
|
|
||||||
{{ range $i, $p := .Projects }}
|
|
||||||
<option value="{{ $p }}">{{ $p }}</option>
|
|
||||||
{{ end }}
|
|
||||||
</select>
|
|
||||||
<input class="input-default"
|
|
||||||
type="text" id="label-value"
|
|
||||||
name="value" placeholder="Label" minlength="1" required>
|
|
||||||
<button type="submit" class="btn-primary">
|
|
||||||
Add
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
{{ else }}
|
|
||||||
<div class="text-gray-300 text-sm mb-4 mt-6">You don't have any projects, yet. Start out by sending a few heartbeats before you can then assign labels.</div>
|
|
||||||
{{ end }}
|
|
||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
|
{{ if .Projects }}
|
||||||
|
<h3 class="inline-block font-semibold text-gray-300">Add Label</h3>
|
||||||
|
<form action="" method="post">
|
||||||
|
<input type="hidden" name="action" value="add_label">
|
||||||
|
<div class="flex flex-col space-y-4">
|
||||||
|
<div class="flex items-center mt-2 w-full text-gray-500 text-sm space-x-4">
|
||||||
|
<select name="key" id="select-project"
|
||||||
|
class="select-default flex-grow">
|
||||||
|
{{ range $i, $p := .Projects }}
|
||||||
|
<option value="{{ $p }}">{{ $p }}</option>
|
||||||
|
{{ end }}
|
||||||
|
</select>
|
||||||
|
<input class="input-default"
|
||||||
|
type="text" id="label-value"
|
||||||
|
name="value" placeholder="Label" minlength="1" required>
|
||||||
|
<button type="submit" class="btn-primary">
|
||||||
|
Add
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
{{ else }}
|
||||||
|
<div class="text-gray-300 text-sm mb-4 mt-6">You don't have any projects, yet. Start out by sending a few heartbeats before you can then assign labels.</div>
|
||||||
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -476,7 +476,7 @@
|
|||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-cloak id="integrations" class="tab flex flex-col space-y-4" v-if="isActive('integrations')">
|
<div v-cloak id="integrations" class="tab flex flex-col space-y-4" v-show="isActive('integrations')">
|
||||||
<form action="" method="post" class="w-full lg:w-3/4">
|
<form action="" method="post" class="w-full lg:w-3/4">
|
||||||
<input type="hidden" name="action" value="toggle_wakatime">
|
<input type="hidden" name="action" value="toggle_wakatime">
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user