modify project name

This commit is contained in:
MaysWind
2021-04-11 22:51:22 +08:00
parent f16eb8b28e
commit 62a825439f
98 changed files with 364 additions and 355 deletions
+13 -13
View File
@@ -1,22 +1,22 @@
# Build backend binary file
FROM golang:1.14.10-alpine3.12 AS be-builder
WORKDIR /go/src/github.com/mayswind/lab
WORKDIR /go/src/github.com/mayswind/ezbookkeeping
COPY . .
RUN docker/backend-build-pre-setup.sh
RUN apk add git gcc g++ libc-dev
RUN VERSION=`grep '"version": ' package.json | awk -F ':' '{print $2}' | tr -d ' ' | tr -d ',' | tr -d '"'` \
&& COMMIT_HASH=$(git rev-parse --short HEAD) \
&& BUILD_UNIXTIME="$(date '+%s')" \
&& VERSION_FLAGS="-X github.com/mayswind/lab/pkg/version.Version=${VERSION} -X github.com/mayswind/lab/pkg/version.CommitHash=${COMMIT_HASH} -X github.com/mayswind/lab/pkg/version.BuildUnixTime=${BUILD_UNIXTIME}" \
&& VERSION_FLAGS="-X github.com/mayswind/ezbookkeeping/pkg/version.Version=${VERSION} -X github.com/mayswind/ezbookkeeping/pkg/version.CommitHash=${COMMIT_HASH} -X github.com/mayswind/ezbookkeeping/pkg/version.BuildUnixTime=${BUILD_UNIXTIME}" \
&& GOOS=linux \
&& GOARCH=amd64 \
&& CGO_ENABLED=1 \
&& go build -a -v -i -trimpath -ldflags "-w -linkmode external -extldflags '-static' ${VERSION_FLAGS}" -o lab lab.go
RUN chmod +x lab
&& go build -a -v -i -trimpath -ldflags "-w -linkmode external -extldflags '-static' ${VERSION_FLAGS}" -o ezbookkeeping ezbookkeeping.go
RUN chmod +x ezbookkeeping
# Build frontend files
FROM node:12.19.0-alpine3.12 AS fe-builder
WORKDIR /go/src/github.com/mayswind/lab
WORKDIR /go/src/github.com/mayswind/ezbookkeeping
COPY . .
RUN docker/frontend-build-pre-setup.sh
RUN apk add git
@@ -25,17 +25,17 @@ RUN npm install && npm run build
# Package docker image
FROM alpine:3.12.0
LABEL maintainer="MaysWind <i@mayswind.net>"
RUN addgroup -S -g 1000 labapp && adduser -S -G labapp -u 1000 labapp
RUN addgroup -S -g 1000 ezbookkeeping && adduser -S -G ezbookkeeping -u 1000 ezbookkeeping
RUN apk --no-cache add tzdata
COPY docker/docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh
RUN mkdir -p /usr/local/bin/labapp && chown 1000:1000 /usr/local/bin/labapp \
&& mkdir -p /usr/local/bin/labapp/data && chown 1000:1000 /usr/local/bin/labapp/data \
&& mkdir -p /var/log/labapp && chown 1000:1000 /var/log/labapp
WORKDIR /usr/local/bin/labapp
COPY --from=be-builder --chown=1000:1000 /go/src/github.com/mayswind/lab/lab /usr/local/bin/labapp/lab
COPY --from=fe-builder --chown=1000:1000 /go/src/github.com/mayswind/lab/dist /usr/local/bin/labapp/public
COPY --chown=1000:1000 conf /usr/local/bin/labapp/conf
RUN mkdir -p /usr/local/bin/ezbookkeeping && chown 1000:1000 /usr/local/bin/ezbookkeeping \
&& mkdir -p /usr/local/bin/ezbookkeeping/data && chown 1000:1000 /usr/local/bin/ezbookkeeping/data \
&& mkdir -p /var/log/ezbookkeeping && chown 1000:1000 /var/log/ezbookkeeping
WORKDIR /usr/local/bin/ezbookkeeping
COPY --from=be-builder --chown=1000:1000 /go/src/github.com/mayswind/ezbookkeeping/ezbookkeeping /usr/local/bin/ezbookkeeping/ezbookkeeping
COPY --from=fe-builder --chown=1000:1000 /go/src/github.com/mayswind/ezbookkeeping/dist /usr/local/bin/ezbookkeeping/public
COPY --chown=1000:1000 conf /usr/local/bin/ezbookkeeping/conf
USER 1000:1000
EXPOSE 8080
ENTRYPOINT ["/docker-entrypoint.sh"]
+17 -17
View File
@@ -1,12 +1,12 @@
# lab
[![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/mayswind/lab/blob/master/LICENSE)
[![Latest Build](https://img.shields.io/docker/cloud/build/mayswind/lab.svg?style=flat)](https://hub.docker.com/r/mayswind/lab/builds)
[![Go Report](https://goreportcard.com/badge/github.com/mayswind/lab)](https://goreportcard.com/report/github.com/mayswind/lab)
[![Latest Docker Image Size](https://img.shields.io/docker/image-size/mayswind/lab.svg?style=flat)](https://hub.docker.com/r/mayswind/lab)
[![Latest Release](https://img.shields.io/github/release/mayswind/lab.svg?style=flat)](https://github.com/mayswind/lab/releases)
# ezBookkeeping
[![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/mayswind/ezbookkeeping/blob/master/LICENSE)
[![Latest Build](https://img.shields.io/docker/cloud/build/mayswind/ezbookkeeping.svg?style=flat)](https://hub.docker.com/r/mayswind/ezbookkeeping/builds)
[![Go Report](https://goreportcard.com/badge/github.com/mayswind/ezbookkeeping)](https://goreportcard.com/report/github.com/mayswind/ezbookkeeping)
[![Latest Docker Image Size](https://img.shields.io/docker/image-size/mayswind/ezbookkeeping.svg?style=flat)](https://hub.docker.com/r/mayswind/ezbookkeeping)
[![Latest Release](https://img.shields.io/github/release/mayswind/ezbookkeeping.svg?style=flat)](https://github.com/mayswind/ezbookkeeping/releases)
## Introduction
The lab is a lightweight account book app hosted by yourself. It can be deployed on almost all platforms, including Windows, macOS and Linux on x86, amd64 and ARM architectures. You can even deploy it on an raspberry device. It also supports many different databases, including sqlite and mysql. With docker, you can just deploy it via one command without complicated configuration.
ezBookkeeping is a lightweight personal bookkeeping app hosted by yourself. It can be deployed on almost all platforms, including Windows, macOS and Linux on x86, amd64 and ARM architectures. You can even deploy it on an raspberry device. It also supports many different databases, including sqlite and mysql. With docker, you can just deploy it via one command without complicated configuration.
## Features
1. Open source & Self-hosted
@@ -35,43 +35,43 @@ The lab is a lightweight account book app hosted by yourself. It can be deployed
## Installation
### Ship with docker
Visit [Docker Hub](https://hub.docker.com/r/mayswind/lab) to see all images and tags.
Visit [Docker Hub](https://hub.docker.com/r/mayswind/ezbookkeeping) to see all images and tags.
Latest Release:
$ docker run -p8080:8080 mayswind/lab
$ docker run -p8080:8080 mayswind/ezbookkeeping
Latest Daily Build:
$ docker run -p8080:8080 mayswind/lab:latest-snapshot
$ docker run -p8080:8080 mayswind/ezbookkeeping:latest-snapshot
### Install from binary
Latest release: [https://github.com/mayswind/lab/releases](https://github.com/mayswind/lab/releases)
Latest release: [https://github.com/mayswind/ezbookkeeping/releases](https://github.com/mayswind/ezbookkeeping/releases)
$ ./lab server run
$ ./ezbookkeeping server run
The lab will listen at port 8080 as default. Then you can visit http://<YOUR_HOST_ADDRESS>:8080/ .
ezBookkeeping will listen at port 8080 as default. Then you can visit http://<YOUR_HOST_ADDRESS>:8080/ .
### Build from source
Make sure you have [Golang](https://golang.org/), [GCC](http://gcc.gnu.org/), [Node.js](https://nodejs.org/) and [NPM](https://www.npmjs.com/) installed. Then download the source code, and follow these steps.
# Build backend binary file
$ GOOS=linux GOARCH=amd64 CGO_ENABLED=1 go build -a -v -i -trimpath -o lab lab.go
$ GOOS=linux GOARCH=amd64 CGO_ENABLED=1 go build -a -v -i -trimpath -o ezbookkeeping ezbookkeeping.go
# Build frontend static files
$ npm install
$ npm run build
# Copy files to target path
$ cp lab <target>/lab
$ cp ezbookkeeping <target>/ezbookkeeping
$ cp -R dist <target>/public
$ cp -R conf <target>/conf
All the files will be placed in `<target>` directory.
For more information about how to install lab, please visit our documentation.
For more information about how to install ezBookkeeping, please visit our documentation.
## License
[MIT](https://github.com/mayswind/lab/blob/master/LICENSE)
[MIT](https://github.com/mayswind/ezbookkeeping/blob/master/LICENSE)
+1 -1
View File
@@ -8,4 +8,4 @@ if [ "$mode" == "--snapshot" ]; then
fi
echo "Building docker image...";
docker build -t lab:${version} .
docker build -t ezbookkeeping:${version} .
+4 -4
View File
@@ -3,15 +3,15 @@ package cmd
import (
"github.com/urfave/cli/v2"
"github.com/mayswind/lab/pkg/datastore"
"github.com/mayswind/lab/pkg/log"
"github.com/mayswind/lab/pkg/models"
"github.com/mayswind/ezbookkeeping/pkg/datastore"
"github.com/mayswind/ezbookkeeping/pkg/log"
"github.com/mayswind/ezbookkeeping/pkg/models"
)
// Database represents the database command
var Database = &cli.Command{
Name: "database",
Usage: "lab database maintenance",
Usage: "ezBookkeeping database maintenance",
Subcommands: []*cli.Command{
{
Name: "update",
+6 -6
View File
@@ -6,12 +6,12 @@ import (
"github.com/urfave/cli/v2"
"github.com/mayswind/lab/pkg/datastore"
"github.com/mayswind/lab/pkg/exchangerates"
"github.com/mayswind/lab/pkg/log"
"github.com/mayswind/lab/pkg/settings"
"github.com/mayswind/lab/pkg/utils"
"github.com/mayswind/lab/pkg/uuid"
"github.com/mayswind/ezbookkeeping/pkg/datastore"
"github.com/mayswind/ezbookkeeping/pkg/exchangerates"
"github.com/mayswind/ezbookkeeping/pkg/log"
"github.com/mayswind/ezbookkeeping/pkg/settings"
"github.com/mayswind/ezbookkeeping/pkg/utils"
"github.com/mayswind/ezbookkeeping/pkg/uuid"
)
func initializeSystem(c *cli.Context) (*settings.Config, error) {
+4 -4
View File
@@ -5,15 +5,15 @@ import (
"github.com/urfave/cli/v2"
clis "github.com/mayswind/lab/pkg/cli"
"github.com/mayswind/lab/pkg/log"
"github.com/mayswind/lab/pkg/utils"
clis "github.com/mayswind/ezbookkeeping/pkg/cli"
"github.com/mayswind/ezbookkeeping/pkg/log"
"github.com/mayswind/ezbookkeeping/pkg/utils"
)
// UserData represents the data command
var UserData = &cli.Command{
Name: "userdata",
Usage: "lab user data maintenance",
Usage: "ezBookkeeping user data maintenance",
Subcommands: []*cli.Command{
{
Name: "user-add",
+11 -11
View File
@@ -12,25 +12,25 @@ import (
"github.com/mssola/user_agent"
"github.com/urfave/cli/v2"
"github.com/mayswind/lab/pkg/api"
"github.com/mayswind/lab/pkg/core"
"github.com/mayswind/lab/pkg/errs"
"github.com/mayswind/lab/pkg/log"
"github.com/mayswind/lab/pkg/middlewares"
"github.com/mayswind/lab/pkg/requestid"
"github.com/mayswind/lab/pkg/settings"
"github.com/mayswind/lab/pkg/utils"
"github.com/mayswind/lab/pkg/validators"
"github.com/mayswind/ezbookkeeping/pkg/api"
"github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/ezbookkeeping/pkg/errs"
"github.com/mayswind/ezbookkeeping/pkg/log"
"github.com/mayswind/ezbookkeeping/pkg/middlewares"
"github.com/mayswind/ezbookkeeping/pkg/requestid"
"github.com/mayswind/ezbookkeeping/pkg/settings"
"github.com/mayswind/ezbookkeeping/pkg/utils"
"github.com/mayswind/ezbookkeeping/pkg/validators"
)
// WebServer represents the server command
var WebServer = &cli.Command{
Name: "server",
Usage: "lab web server operation",
Usage: "ezBookkeeping web server operation",
Subcommands: []*cli.Command{
{
Name: "run",
Usage: "Run lab web server",
Usage: "Run ezBookkeeping web server",
Action: startWebServer,
},
},
+7 -7
View File
@@ -1,6 +1,6 @@
[global]
# Application instance name
app_name = lab
app_name = ezBookkeeping
# Either "production", "development"
mode = production
@@ -15,10 +15,10 @@ http_addr = 0.0.0.0
# The http port to bind to
http_port = 8080
# The domain name used to access lab
# The domain name used to access ezBookkeeping
domain = localhost
# The full url used to access lab in browser
# The full url used to access ezBookkeeping in browser
root_url = %(protocol)s://%(domain)s:%(http_port)s/
# https certification and its key file
@@ -43,7 +43,7 @@ type = sqlite3
# Database connection configuration, for "mysql" and "postgres"
host = 127.0.0.1:3306
name = lab
name = ezbookkeeping
user = root
passwd =
@@ -51,7 +51,7 @@ passwd =
ssl_mode = disable
# For "sqlite3" only, absolute path of db file
db_path = data/labapp.db
db_path = data/ezbookkeeping.db
# Max idle connection number, default is 2
max_idle_conn = 2
@@ -77,7 +77,7 @@ mode = console file
level = info
# For "file" only, absolute path of log file
log_path = /var/log/labapp/lab.log
log_path = /var/log/ezbookkeeping/ezbookkeeping.log
[uuid]
# Uuid generator type, supports "internal" currently
@@ -87,7 +87,7 @@ generator_type = internal
server_id = 0
[security]
# Used for signing, you must change it to keep your user data safe before you first run lab
# Used for signing, you must change it to keep your user data safe before you first run ezBookkeeping
secret_key =
# Set to true to enable two factor authorization
+3 -3
View File
@@ -4,12 +4,12 @@ set -e;
conf_path_param="";
if [ "${LAB_CONF_PATH}" != "" ]; then
conf_path_param="--conf-path=${LAB_CONF_PATH}";
if [ "${EBK_CONF_PATH}" != "" ]; then
conf_path_param="--conf-path=${EBK_CONF_PATH}";
fi
if [ $# -gt 0 ]; then
exec "$@"
else
exec /usr/local/bin/labapp/lab server run ${conf_path_param};
exec /usr/local/bin/ezbookkeeping/ezbookkeeping server run ${conf_path_param};
fi
+16
View File
@@ -0,0 +1,16 @@
[Unit]
Description=ezBookkeeping, a lightweight personal bookkeeping app hosted by yourself.
After=syslog.target
After=network.target
After=mariadb.service mysqld.service postgresql.service
[Service]
Type=simple
User=ezbookkeeping
Group=ezbookkeeping
WorkingDirectory=/usr/local/bin/ezbookkeeping
ExecStart=/usr/local/bin/ezbookkeeping/ezbookkeeping server run
Restart=on-failure
[Install]
WantedBy=multi-user.target
-16
View File
@@ -1,16 +0,0 @@
[Unit]
Description=lab (lightweight account book) application
After=syslog.target
After=network.target
After=mariadb.service mysqld.service postgresql.service
[Service]
Type=simple
User=labapp
Group=labapp
WorkingDirectory=/usr/local/bin/labapp
ExecStart=/usr/local/bin/labapp/lab server run
Restart=on-failure
[Install]
WantedBy=multi-user.target
+5 -5
View File
@@ -6,14 +6,14 @@ import (
"github.com/urfave/cli/v2"
"github.com/mayswind/lab/cmd"
"github.com/mayswind/lab/pkg/version"
"github.com/mayswind/ezbookkeeping/cmd"
"github.com/mayswind/ezbookkeeping/pkg/version"
)
func main() {
app := &cli.App{
Name: "lab",
Usage: "A lightweight account book app hosted by yourself.",
Name: "ezBookkeeping",
Usage: "A lightweight personal bookkeeping app hosted by yourself.",
Version: version.GetFullVersion(),
Commands: []*cli.Command{
cmd.WebServer,
@@ -31,6 +31,6 @@ func main() {
err := app.Run(os.Args)
if err != nil {
log.Fatalf("Failed to run lab app with %s: %v", os.Args, err)
log.Fatalf("Failed to run ezBookkeeping with %s: %v", os.Args, err)
}
}
+1 -1
View File
@@ -1,4 +1,4 @@
module github.com/mayswind/lab
module github.com/mayswind/ezbookkeeping
go 1.14
+4 -4
View File
@@ -1,5 +1,5 @@
{
"name": "lab",
"name": "ezbookkeeping",
"version": "0.1.0",
"lockfileVersion": 1,
"requires": true,
@@ -12619,9 +12619,9 @@
}
},
"vue-loader-v16": {
"version": "npm:vue-loader@16.1.2",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.1.2.tgz",
"integrity": "sha512-8QTxh+Fd+HB6fiL52iEVLKqE9N1JSlMXLR92Ijm6g8PZrwIxckgpqjPDWRP5TWxdiPaHR+alUWsnu1ShQOwt+Q==",
"version": "npm:vue-loader@16.2.0",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.2.0.tgz",
"integrity": "sha512-TitGhqSQ61RJljMmhIGvfWzJ2zk9m1Qug049Ugml6QP3t0e95o0XJjk29roNEiPKJQBEi8Ord5hFuSuELzSp8Q==",
"dev": true,
"optional": true,
"requires": {
+10 -1
View File
@@ -1,7 +1,16 @@
{
"name": "lab",
"name": "ezbookkeeping",
"version": "0.1.0",
"private": true,
"repository": {
"type": "git",
"url": "git+https://github.com/mayswind/ezbookkeeping.git"
},
"author": "MaysWind <i@mayswind.net>",
"license": "MIT",
"bugs": {
"url": "https://github.com/mayswind/ezbookkeeping/issues"
},
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
+6 -6
View File
@@ -3,12 +3,12 @@ package api
import (
"sort"
"github.com/mayswind/lab/pkg/core"
"github.com/mayswind/lab/pkg/errs"
"github.com/mayswind/lab/pkg/log"
"github.com/mayswind/lab/pkg/models"
"github.com/mayswind/lab/pkg/services"
"github.com/mayswind/lab/pkg/validators"
"github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/ezbookkeeping/pkg/errs"
"github.com/mayswind/ezbookkeeping/pkg/log"
"github.com/mayswind/ezbookkeeping/pkg/models"
"github.com/mayswind/ezbookkeeping/pkg/services"
"github.com/mayswind/ezbookkeeping/pkg/validators"
)
// AccountsApi represents account api
+5 -5
View File
@@ -3,11 +3,11 @@ package api
import (
"github.com/pquerna/otp/totp"
"github.com/mayswind/lab/pkg/core"
"github.com/mayswind/lab/pkg/errs"
"github.com/mayswind/lab/pkg/log"
"github.com/mayswind/lab/pkg/models"
"github.com/mayswind/lab/pkg/services"
"github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/ezbookkeeping/pkg/errs"
"github.com/mayswind/ezbookkeeping/pkg/log"
"github.com/mayswind/ezbookkeeping/pkg/models"
"github.com/mayswind/ezbookkeeping/pkg/services"
)
// AuthorizationsApi represents authorization api
+8 -8
View File
@@ -5,14 +5,14 @@ import (
"strings"
"time"
"github.com/mayswind/lab/pkg/core"
"github.com/mayswind/lab/pkg/errs"
"github.com/mayswind/lab/pkg/exporters"
"github.com/mayswind/lab/pkg/log"
"github.com/mayswind/lab/pkg/models"
"github.com/mayswind/lab/pkg/services"
"github.com/mayswind/lab/pkg/settings"
"github.com/mayswind/lab/pkg/utils"
"github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/ezbookkeeping/pkg/errs"
"github.com/mayswind/ezbookkeeping/pkg/exporters"
"github.com/mayswind/ezbookkeeping/pkg/log"
"github.com/mayswind/ezbookkeeping/pkg/models"
"github.com/mayswind/ezbookkeeping/pkg/services"
"github.com/mayswind/ezbookkeeping/pkg/settings"
"github.com/mayswind/ezbookkeeping/pkg/utils"
)
const pageCountForDataExport = 1000
+2 -2
View File
@@ -1,8 +1,8 @@
package api
import (
"github.com/mayswind/lab/pkg/core"
"github.com/mayswind/lab/pkg/errs"
"github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/ezbookkeeping/pkg/errs"
)
// DefaultApi represents default api
+6 -6
View File
@@ -6,12 +6,12 @@ import (
"sort"
"time"
"github.com/mayswind/lab/pkg/core"
"github.com/mayswind/lab/pkg/errs"
"github.com/mayswind/lab/pkg/exchangerates"
"github.com/mayswind/lab/pkg/log"
"github.com/mayswind/lab/pkg/models"
"github.com/mayswind/lab/pkg/settings"
"github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/ezbookkeeping/pkg/errs"
"github.com/mayswind/ezbookkeeping/pkg/exchangerates"
"github.com/mayswind/ezbookkeeping/pkg/log"
"github.com/mayswind/ezbookkeeping/pkg/models"
"github.com/mayswind/ezbookkeeping/pkg/settings"
)
// ExchangeRatesApi represents exchange rate api
+6 -6
View File
@@ -3,12 +3,12 @@ package api
import (
"sort"
"github.com/mayswind/lab/pkg/core"
"github.com/mayswind/lab/pkg/errs"
"github.com/mayswind/lab/pkg/log"
"github.com/mayswind/lab/pkg/models"
"github.com/mayswind/lab/pkg/services"
"github.com/mayswind/lab/pkg/utils"
"github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/ezbookkeeping/pkg/errs"
"github.com/mayswind/ezbookkeeping/pkg/log"
"github.com/mayswind/ezbookkeeping/pkg/models"
"github.com/mayswind/ezbookkeeping/pkg/services"
"github.com/mayswind/ezbookkeeping/pkg/utils"
)
// TokensApi represents token api
+5 -5
View File
@@ -3,11 +3,11 @@ package api
import (
"sort"
"github.com/mayswind/lab/pkg/core"
"github.com/mayswind/lab/pkg/errs"
"github.com/mayswind/lab/pkg/log"
"github.com/mayswind/lab/pkg/models"
"github.com/mayswind/lab/pkg/services"
"github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/ezbookkeeping/pkg/errs"
"github.com/mayswind/ezbookkeeping/pkg/log"
"github.com/mayswind/ezbookkeeping/pkg/models"
"github.com/mayswind/ezbookkeeping/pkg/services"
)
// TransactionCategoriesApi represents transaction category api
+5 -5
View File
@@ -3,11 +3,11 @@ package api
import (
"sort"
"github.com/mayswind/lab/pkg/core"
"github.com/mayswind/lab/pkg/errs"
"github.com/mayswind/lab/pkg/log"
"github.com/mayswind/lab/pkg/models"
"github.com/mayswind/lab/pkg/services"
"github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/ezbookkeeping/pkg/errs"
"github.com/mayswind/ezbookkeeping/pkg/log"
"github.com/mayswind/ezbookkeeping/pkg/models"
"github.com/mayswind/ezbookkeeping/pkg/services"
)
// TransactionTagsApi represents transaction tag api
+6 -6
View File
@@ -4,12 +4,12 @@ import (
"sort"
"strings"
"github.com/mayswind/lab/pkg/core"
"github.com/mayswind/lab/pkg/errs"
"github.com/mayswind/lab/pkg/log"
"github.com/mayswind/lab/pkg/models"
"github.com/mayswind/lab/pkg/services"
"github.com/mayswind/lab/pkg/utils"
"github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/ezbookkeeping/pkg/errs"
"github.com/mayswind/ezbookkeeping/pkg/log"
"github.com/mayswind/ezbookkeeping/pkg/models"
"github.com/mayswind/ezbookkeeping/pkg/services"
"github.com/mayswind/ezbookkeeping/pkg/utils"
)
const pageCountForLoadTransactionAmounts = 1000
+5 -5
View File
@@ -8,11 +8,11 @@ import (
"github.com/pquerna/otp/totp"
"github.com/mayswind/lab/pkg/core"
"github.com/mayswind/lab/pkg/errs"
"github.com/mayswind/lab/pkg/log"
"github.com/mayswind/lab/pkg/models"
"github.com/mayswind/lab/pkg/services"
"github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/ezbookkeeping/pkg/errs"
"github.com/mayswind/ezbookkeeping/pkg/log"
"github.com/mayswind/ezbookkeeping/pkg/models"
"github.com/mayswind/ezbookkeeping/pkg/services"
)
// TwoFactorAuthorizationsApi represents 2fa api
+7 -7
View File
@@ -4,13 +4,13 @@ import (
"strings"
"time"
"github.com/mayswind/lab/pkg/core"
"github.com/mayswind/lab/pkg/errs"
"github.com/mayswind/lab/pkg/log"
"github.com/mayswind/lab/pkg/models"
"github.com/mayswind/lab/pkg/services"
"github.com/mayswind/lab/pkg/settings"
"github.com/mayswind/lab/pkg/validators"
"github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/ezbookkeeping/pkg/errs"
"github.com/mayswind/ezbookkeeping/pkg/log"
"github.com/mayswind/ezbookkeeping/pkg/models"
"github.com/mayswind/ezbookkeeping/pkg/services"
"github.com/mayswind/ezbookkeeping/pkg/settings"
"github.com/mayswind/ezbookkeeping/pkg/validators"
)
// UsersApi represents user api
+6 -6
View File
@@ -5,12 +5,12 @@ import (
"github.com/urfave/cli/v2"
"github.com/mayswind/lab/pkg/errs"
"github.com/mayswind/lab/pkg/exporters"
"github.com/mayswind/lab/pkg/log"
"github.com/mayswind/lab/pkg/models"
"github.com/mayswind/lab/pkg/services"
"github.com/mayswind/lab/pkg/validators"
"github.com/mayswind/ezbookkeeping/pkg/errs"
"github.com/mayswind/ezbookkeeping/pkg/exporters"
"github.com/mayswind/ezbookkeeping/pkg/log"
"github.com/mayswind/ezbookkeeping/pkg/models"
"github.com/mayswind/ezbookkeeping/pkg/services"
"github.com/mayswind/ezbookkeeping/pkg/validators"
)
const pageCountForGettingTransactions = 1000
+1 -1
View File
@@ -5,7 +5,7 @@ import (
"github.com/gin-gonic/gin"
"github.com/mayswind/lab/pkg/errs"
"github.com/mayswind/ezbookkeeping/pkg/errs"
)
const requestIdFieldKey = "REQUEST_ID"
+1 -1
View File
@@ -1,6 +1,6 @@
package core
import "github.com/mayswind/lab/pkg/errs"
import "github.com/mayswind/ezbookkeeping/pkg/errs"
// MiddlewareHandlerFunc represents the middleware handler function
type MiddlewareHandlerFunc func(*Context)
+1 -1
View File
@@ -3,7 +3,7 @@ package datastore
import (
"xorm.io/xorm"
"github.com/mayswind/lab/pkg/errs"
"github.com/mayswind/ezbookkeeping/pkg/errs"
)
// DataStore represents a data storage containing a series of database shards
+2 -2
View File
@@ -12,8 +12,8 @@ import (
_ "github.com/mattn/go-sqlite3"
"xorm.io/xorm"
"github.com/mayswind/lab/pkg/errs"
"github.com/mayswind/lab/pkg/settings"
"github.com/mayswind/ezbookkeeping/pkg/errs"
"github.com/mayswind/ezbookkeeping/pkg/settings"
)
// DataStoreContainer contains all data storages
+2 -2
View File
@@ -3,8 +3,8 @@ package datastore
import (
xorm "xorm.io/xorm/log"
"github.com/mayswind/lab/pkg/log"
"github.com/mayswind/lab/pkg/settings"
"github.com/mayswind/ezbookkeeping/pkg/log"
"github.com/mayswind/ezbookkeeping/pkg/settings"
)
// XOrmLoggerAdapter represents the logger adapter for xorm
@@ -6,12 +6,12 @@ import (
"strings"
"time"
"github.com/mayswind/lab/pkg/core"
"github.com/mayswind/lab/pkg/errs"
"github.com/mayswind/lab/pkg/log"
"github.com/mayswind/lab/pkg/models"
"github.com/mayswind/lab/pkg/utils"
"github.com/mayswind/lab/pkg/validators"
"github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/ezbookkeeping/pkg/errs"
"github.com/mayswind/ezbookkeeping/pkg/log"
"github.com/mayswind/ezbookkeeping/pkg/models"
"github.com/mayswind/ezbookkeeping/pkg/utils"
"github.com/mayswind/ezbookkeeping/pkg/validators"
)
const bankOfCanadaExchangeRateUrl = "https://www.bankofcanada.ca/valet/observations/group/FX_RATES_DAILY/json?recent=1"
@@ -6,8 +6,8 @@ import (
"github.com/gin-gonic/gin"
"github.com/stretchr/testify/assert"
"github.com/mayswind/lab/pkg/core"
"github.com/mayswind/lab/pkg/models"
"github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/ezbookkeeping/pkg/models"
)
const bankOfCanadaMinimumRequiredContent = "{\n" +
@@ -5,12 +5,12 @@ import (
"strings"
"time"
"github.com/mayswind/lab/pkg/core"
"github.com/mayswind/lab/pkg/errs"
"github.com/mayswind/lab/pkg/log"
"github.com/mayswind/lab/pkg/models"
"github.com/mayswind/lab/pkg/utils"
"github.com/mayswind/lab/pkg/validators"
"github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/ezbookkeeping/pkg/errs"
"github.com/mayswind/ezbookkeeping/pkg/log"
"github.com/mayswind/ezbookkeeping/pkg/models"
"github.com/mayswind/ezbookkeeping/pkg/utils"
"github.com/mayswind/ezbookkeeping/pkg/validators"
)
const czechNationalBankDailyExchangeRateUrl = "https://www.cnb.cz/en/financial-markets/foreign-exchange-market/central-bank-exchange-rate-fixing/central-bank-exchange-rate-fixing/daily.txt"
@@ -6,8 +6,8 @@ import (
"github.com/gin-gonic/gin"
"github.com/stretchr/testify/assert"
"github.com/mayswind/lab/pkg/core"
"github.com/mayswind/lab/pkg/models"
"github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/ezbookkeeping/pkg/models"
)
const czechNationalBankMinimumRequiredContent = "01 Apr 2021 #64\n" +
@@ -4,12 +4,12 @@ import (
"encoding/xml"
"time"
"github.com/mayswind/lab/pkg/core"
"github.com/mayswind/lab/pkg/errs"
"github.com/mayswind/lab/pkg/log"
"github.com/mayswind/lab/pkg/models"
"github.com/mayswind/lab/pkg/utils"
"github.com/mayswind/lab/pkg/validators"
"github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/ezbookkeeping/pkg/errs"
"github.com/mayswind/ezbookkeeping/pkg/log"
"github.com/mayswind/ezbookkeeping/pkg/models"
"github.com/mayswind/ezbookkeeping/pkg/utils"
"github.com/mayswind/ezbookkeeping/pkg/validators"
)
const euroCentralBankExchangeRateUrl = "https://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml"
@@ -6,8 +6,8 @@ import (
"github.com/gin-gonic/gin"
"github.com/stretchr/testify/assert"
"github.com/mayswind/lab/pkg/core"
"github.com/mayswind/lab/pkg/models"
"github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/ezbookkeeping/pkg/models"
)
const euroCentralBankMinimumRequiredContent = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
@@ -1,8 +1,8 @@
package exchangerates
import (
"github.com/mayswind/lab/pkg/core"
"github.com/mayswind/lab/pkg/models"
"github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/ezbookkeeping/pkg/models"
)
// ExchangeRatesDataSource defines the structure of exchange rates data source
@@ -1,8 +1,8 @@
package exchangerates
import (
"github.com/mayswind/lab/pkg/errs"
"github.com/mayswind/lab/pkg/settings"
"github.com/mayswind/ezbookkeeping/pkg/errs"
"github.com/mayswind/ezbookkeeping/pkg/settings"
)
// ExchangeRatesDataSourceContainer contains the current exchange rates data source
@@ -6,12 +6,12 @@ import (
"math"
"time"
"github.com/mayswind/lab/pkg/core"
"github.com/mayswind/lab/pkg/errs"
"github.com/mayswind/lab/pkg/log"
"github.com/mayswind/lab/pkg/models"
"github.com/mayswind/lab/pkg/utils"
"github.com/mayswind/lab/pkg/validators"
"github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/ezbookkeeping/pkg/errs"
"github.com/mayswind/ezbookkeeping/pkg/log"
"github.com/mayswind/ezbookkeeping/pkg/models"
"github.com/mayswind/ezbookkeeping/pkg/utils"
"github.com/mayswind/ezbookkeeping/pkg/validators"
)
const nationalBankOfPolandDailyExchangeRateUrl = "https://www.nbp.pl/kursy/xml/en/lastaen.xml"
@@ -6,8 +6,8 @@ import (
"github.com/gin-gonic/gin"
"github.com/stretchr/testify/assert"
"github.com/mayswind/lab/pkg/core"
"github.com/mayswind/lab/pkg/models"
"github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/ezbookkeeping/pkg/models"
)
const nationalBankOfPolandMinimumRequiredContent = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n" +
@@ -4,12 +4,12 @@ import (
"encoding/xml"
"time"
"github.com/mayswind/lab/pkg/core"
"github.com/mayswind/lab/pkg/errs"
"github.com/mayswind/lab/pkg/log"
"github.com/mayswind/lab/pkg/models"
"github.com/mayswind/lab/pkg/utils"
"github.com/mayswind/lab/pkg/validators"
"github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/ezbookkeeping/pkg/errs"
"github.com/mayswind/ezbookkeeping/pkg/log"
"github.com/mayswind/ezbookkeeping/pkg/models"
"github.com/mayswind/ezbookkeeping/pkg/utils"
"github.com/mayswind/ezbookkeeping/pkg/validators"
)
const reserveBankOfAustraliaExchangeRateUrl = "https://www.rba.gov.au/rss/rss-cb-exchange-rates.xml"
@@ -6,8 +6,8 @@ import (
"github.com/gin-gonic/gin"
"github.com/stretchr/testify/assert"
"github.com/mayswind/lab/pkg/core"
"github.com/mayswind/lab/pkg/models"
"github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/ezbookkeeping/pkg/models"
)
const reserveBankOfAustraliaMinimumRequiredContent = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
+2 -2
View File
@@ -5,8 +5,8 @@ import (
"strings"
"time"
"github.com/mayswind/lab/pkg/models"
"github.com/mayswind/lab/pkg/utils"
"github.com/mayswind/ezbookkeeping/pkg/models"
"github.com/mayswind/ezbookkeeping/pkg/utils"
)
// CSVFileExporter defines the structure of csv file exporter
+1 -1
View File
@@ -3,7 +3,7 @@ package exporters
import (
"time"
"github.com/mayswind/lab/pkg/models"
"github.com/mayswind/ezbookkeeping/pkg/models"
)
// DataExporter defines the structure of data exporter
+1 -1
View File
@@ -8,7 +8,7 @@ import (
"github.com/sirupsen/logrus"
"github.com/mayswind/lab/pkg/utils"
"github.com/mayswind/ezbookkeeping/pkg/utils"
)
// LogFormatter represents a log formatter
+2 -2
View File
@@ -8,8 +8,8 @@ import (
"github.com/sirupsen/logrus"
"github.com/mayswind/lab/pkg/core"
"github.com/mayswind/lab/pkg/settings"
"github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/ezbookkeeping/pkg/settings"
)
const logFieldRequestId = "REQUEST_ID"
+5 -5
View File
@@ -3,11 +3,11 @@ package middlewares
import (
"time"
"github.com/mayswind/lab/pkg/core"
"github.com/mayswind/lab/pkg/errs"
"github.com/mayswind/lab/pkg/log"
"github.com/mayswind/lab/pkg/services"
"github.com/mayswind/lab/pkg/utils"
"github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/ezbookkeeping/pkg/errs"
"github.com/mayswind/ezbookkeeping/pkg/log"
"github.com/mayswind/ezbookkeeping/pkg/services"
"github.com/mayswind/ezbookkeeping/pkg/utils"
)
const tokenQueryStringParam = "token"
+1 -1
View File
@@ -1,7 +1,7 @@
package middlewares
import (
"github.com/mayswind/lab/pkg/core"
"github.com/mayswind/ezbookkeeping/pkg/core"
)
const utcOffsetQueryStringParam = "utc_offset"
+4 -4
View File
@@ -6,10 +6,10 @@ import (
"io/ioutil"
"runtime"
"github.com/mayswind/lab/pkg/core"
"github.com/mayswind/lab/pkg/errs"
"github.com/mayswind/lab/pkg/log"
"github.com/mayswind/lab/pkg/utils"
"github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/ezbookkeeping/pkg/errs"
"github.com/mayswind/ezbookkeeping/pkg/log"
"github.com/mayswind/ezbookkeeping/pkg/utils"
)
var (
+3 -3
View File
@@ -1,9 +1,9 @@
package middlewares
import (
"github.com/mayswind/lab/pkg/core"
"github.com/mayswind/lab/pkg/requestid"
"github.com/mayswind/lab/pkg/settings"
"github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/ezbookkeeping/pkg/requestid"
"github.com/mayswind/ezbookkeeping/pkg/settings"
)
const requestIdHeader = "X-Request-ID"
+2 -2
View File
@@ -3,8 +3,8 @@ package middlewares
import (
"time"
"github.com/mayswind/lab/pkg/core"
"github.com/mayswind/lab/pkg/log"
"github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/ezbookkeeping/pkg/log"
)
// RequestLog logs the http request log
+3 -3
View File
@@ -4,11 +4,11 @@ import (
"fmt"
"strings"
"github.com/mayswind/lab/pkg/core"
"github.com/mayswind/lab/pkg/settings"
"github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/ezbookkeeping/pkg/settings"
)
const settingsCookieName = "lab_server_settings"
const settingsCookieName = "ebk_server_settings"
// ServerSettingsCookie adds server settings to cookies in response
func ServerSettingsCookie(config *settings.Config) core.MiddlewareHandlerFunc {
+1 -1
View File
@@ -1,6 +1,6 @@
package models
import "github.com/mayswind/lab/pkg/core"
import "github.com/mayswind/ezbookkeeping/pkg/core"
// TokenMaxUserAgentLength represents the maximum size of user agent stored in database
const TokenMaxUserAgentLength = 255
+2 -2
View File
@@ -5,8 +5,8 @@ import (
"strings"
"time"
"github.com/mayswind/lab/pkg/errs"
"github.com/mayswind/lab/pkg/utils"
"github.com/mayswind/ezbookkeeping/pkg/errs"
"github.com/mayswind/ezbookkeeping/pkg/utils"
)
// TransactionType represents transaction type
+1 -1
View File
@@ -3,7 +3,7 @@ package models
import (
"time"
"github.com/mayswind/lab/pkg/utils"
"github.com/mayswind/ezbookkeeping/pkg/utils"
)
// WeekDay represents week day
@@ -11,10 +11,10 @@ import (
"sync/atomic"
"time"
"github.com/mayswind/lab/pkg/errs"
"github.com/mayswind/lab/pkg/log"
"github.com/mayswind/lab/pkg/settings"
"github.com/mayswind/lab/pkg/utils"
"github.com/mayswind/ezbookkeeping/pkg/errs"
"github.com/mayswind/ezbookkeeping/pkg/log"
"github.com/mayswind/ezbookkeeping/pkg/settings"
"github.com/mayswind/ezbookkeeping/pkg/utils"
)
// Length and mask of all information in request id
@@ -5,7 +5,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/mayswind/lab/pkg/settings"
"github.com/mayswind/ezbookkeeping/pkg/settings"
)
func TestNewDefaultRequestIdGenerator_Http(t *testing.T) {
@@ -23,7 +23,7 @@ func TestNewDefaultRequestIdGenerator_Http(t *testing.T) {
}
func TestNewDefaultRequestIdGenerator_UnixSocket(t *testing.T) {
generator, _ := NewDefaultRequestIdGenerator(&settings.Config{HttpAddr: "1.2.3.4", UnixSocketPath: "/var/lib/labapp/lab.sock", Protocol: "socket", SecretKey: "secretkey"})
generator, _ := NewDefaultRequestIdGenerator(&settings.Config{HttpAddr: "1.2.3.4", UnixSocketPath: "/var/lib/ezbookkeeping/ezbookkeeping.sock", Protocol: "socket", SecretKey: "secretkey"})
requestId := generator.GenerateRequestId("127.0.0.1")
requestIdInfo := generator.parseRequestIdInfo(generator.parseRequestIdFromUuid(requestId))
@@ -31,13 +31,13 @@ func TestNewDefaultRequestIdGenerator_UnixSocket(t *testing.T) {
actualServerUniqId := requestIdInfo.ServerUniqId
assert.Equal(t, expectedServerUniqId, actualServerUniqId)
expectedInstanceUniqId := uint16(0x694b) // crc32("/var/lib/labapp/lab.sock" + "_" + "secretkey") & 0xFFFF
expectedInstanceUniqId := uint16(0x2cc) // crc32("/var/lib/ezbookkeeping/ezbookkeeping.sock" + "_" + "secretkey") & 0xFFFF
actualInstanceUniqId := requestIdInfo.InstanceUniqId
assert.Equal(t, expectedInstanceUniqId, actualInstanceUniqId)
}
func TestNewDefaultRequestIdGenerator_ClientIpv4(t *testing.T) {
generator, _ := NewDefaultRequestIdGenerator(&settings.Config{HttpAddr: "1.2.3.4", UnixSocketPath: "/var/lib/labapp/lab.sock", Protocol: "socket", SecretKey: "secretkey"})
generator, _ := NewDefaultRequestIdGenerator(&settings.Config{HttpAddr: "1.2.3.4", UnixSocketPath: "/var/lib/ezbookkeeping/ezbookkeeping.sock", Protocol: "socket", SecretKey: "secretkey"})
requestId := generator.GenerateRequestId("127.0.0.1")
requestIdInfo := generator.parseRequestIdInfo(generator.parseRequestIdFromUuid(requestId))
@@ -62,7 +62,7 @@ func TestNewDefaultRequestIdGenerator_ClientIpv4(t *testing.T) {
}
func TestNewDefaultRequestIdGenerator_ClientIpv6(t *testing.T) {
generator, _ := NewDefaultRequestIdGenerator(&settings.Config{HttpAddr: "1.2.3.4", UnixSocketPath: "/var/lib/labapp/lab.sock", Protocol: "socket", SecretKey: "secretkey"})
generator, _ := NewDefaultRequestIdGenerator(&settings.Config{HttpAddr: "1.2.3.4", UnixSocketPath: "/var/lib/ezbookkeeping/ezbookkeeping.sock", Protocol: "socket", SecretKey: "secretkey"})
requestId := generator.GenerateRequestId("2001:abc:def:1234::1")
requestIdInfo := generator.parseRequestIdInfo(generator.parseRequestIdFromUuid(requestId))
+1 -1
View File
@@ -1,7 +1,7 @@
package requestid
import (
"github.com/mayswind/lab/pkg/settings"
"github.com/mayswind/ezbookkeeping/pkg/settings"
)
// RequestIdContainer contains the current request id generator
+5 -5
View File
@@ -1,15 +1,15 @@
package services
import (
"github.com/mayswind/lab/pkg/utils"
"time"
"xorm.io/xorm"
"github.com/mayswind/lab/pkg/datastore"
"github.com/mayswind/lab/pkg/errs"
"github.com/mayswind/lab/pkg/models"
"github.com/mayswind/lab/pkg/uuid"
"github.com/mayswind/ezbookkeeping/pkg/datastore"
"github.com/mayswind/ezbookkeeping/pkg/errs"
"github.com/mayswind/ezbookkeeping/pkg/models"
"github.com/mayswind/ezbookkeeping/pkg/utils"
"github.com/mayswind/ezbookkeeping/pkg/uuid"
)
// AccountService represents account service
+3 -3
View File
@@ -1,9 +1,9 @@
package services
import (
"github.com/mayswind/lab/pkg/datastore"
"github.com/mayswind/lab/pkg/settings"
"github.com/mayswind/lab/pkg/uuid"
"github.com/mayswind/ezbookkeeping/pkg/datastore"
"github.com/mayswind/ezbookkeeping/pkg/settings"
"github.com/mayswind/ezbookkeeping/pkg/uuid"
)
// ServiceUsingDB represents a service that need to use db
+7 -7
View File
@@ -10,13 +10,13 @@ import (
"github.com/dgrijalva/jwt-go/request"
"xorm.io/xorm"
"github.com/mayswind/lab/pkg/core"
"github.com/mayswind/lab/pkg/datastore"
"github.com/mayswind/lab/pkg/errs"
"github.com/mayswind/lab/pkg/log"
"github.com/mayswind/lab/pkg/models"
"github.com/mayswind/lab/pkg/settings"
"github.com/mayswind/lab/pkg/utils"
"github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/ezbookkeeping/pkg/datastore"
"github.com/mayswind/ezbookkeeping/pkg/errs"
"github.com/mayswind/ezbookkeeping/pkg/log"
"github.com/mayswind/ezbookkeeping/pkg/models"
"github.com/mayswind/ezbookkeeping/pkg/settings"
"github.com/mayswind/ezbookkeeping/pkg/utils"
)
// TokenService represents user token service
+4 -4
View File
@@ -5,10 +5,10 @@ import (
"xorm.io/xorm"
"github.com/mayswind/lab/pkg/datastore"
"github.com/mayswind/lab/pkg/errs"
"github.com/mayswind/lab/pkg/models"
"github.com/mayswind/lab/pkg/uuid"
"github.com/mayswind/ezbookkeeping/pkg/datastore"
"github.com/mayswind/ezbookkeeping/pkg/errs"
"github.com/mayswind/ezbookkeeping/pkg/models"
"github.com/mayswind/ezbookkeeping/pkg/uuid"
)
// TransactionCategoryService represents transaction category service
+4 -4
View File
@@ -5,10 +5,10 @@ import (
"xorm.io/xorm"
"github.com/mayswind/lab/pkg/datastore"
"github.com/mayswind/lab/pkg/errs"
"github.com/mayswind/lab/pkg/models"
"github.com/mayswind/lab/pkg/uuid"
"github.com/mayswind/ezbookkeeping/pkg/datastore"
"github.com/mayswind/ezbookkeeping/pkg/errs"
"github.com/mayswind/ezbookkeeping/pkg/models"
"github.com/mayswind/ezbookkeeping/pkg/uuid"
)
// TransactionTagService represents transaction tag service
+5 -5
View File
@@ -7,11 +7,11 @@ import (
"xorm.io/xorm"
"github.com/mayswind/lab/pkg/datastore"
"github.com/mayswind/lab/pkg/errs"
"github.com/mayswind/lab/pkg/models"
"github.com/mayswind/lab/pkg/utils"
"github.com/mayswind/lab/pkg/uuid"
"github.com/mayswind/ezbookkeeping/pkg/datastore"
"github.com/mayswind/ezbookkeeping/pkg/errs"
"github.com/mayswind/ezbookkeeping/pkg/models"
"github.com/mayswind/ezbookkeeping/pkg/utils"
"github.com/mayswind/ezbookkeeping/pkg/uuid"
)
// TransactionService represents transaction service
+6 -6
View File
@@ -7,12 +7,12 @@ import (
"github.com/pquerna/otp/totp"
"xorm.io/xorm"
"github.com/mayswind/lab/pkg/datastore"
"github.com/mayswind/lab/pkg/errs"
"github.com/mayswind/lab/pkg/models"
"github.com/mayswind/lab/pkg/settings"
"github.com/mayswind/lab/pkg/utils"
"github.com/mayswind/lab/pkg/uuid"
"github.com/mayswind/ezbookkeeping/pkg/datastore"
"github.com/mayswind/ezbookkeeping/pkg/errs"
"github.com/mayswind/ezbookkeeping/pkg/models"
"github.com/mayswind/ezbookkeeping/pkg/settings"
"github.com/mayswind/ezbookkeeping/pkg/utils"
"github.com/mayswind/ezbookkeeping/pkg/uuid"
)
const (
+5 -5
View File
@@ -5,11 +5,11 @@ import (
"xorm.io/xorm"
"github.com/mayswind/lab/pkg/datastore"
"github.com/mayswind/lab/pkg/errs"
"github.com/mayswind/lab/pkg/models"
"github.com/mayswind/lab/pkg/utils"
"github.com/mayswind/lab/pkg/uuid"
"github.com/mayswind/ezbookkeeping/pkg/datastore"
"github.com/mayswind/ezbookkeeping/pkg/errs"
"github.com/mayswind/ezbookkeeping/pkg/models"
"github.com/mayswind/ezbookkeeping/pkg/utils"
"github.com/mayswind/ezbookkeeping/pkg/uuid"
)
// UserService represents user service
+9 -9
View File
@@ -10,13 +10,13 @@ import (
"gopkg.in/ini.v1"
"github.com/mayswind/lab/pkg/errs"
"github.com/mayswind/ezbookkeeping/pkg/errs"
)
const (
labWorkDirEnvName = "LAB_WORK_DIR"
labEnvNamePrefix = "LAB"
defaultConfigPath = "/conf/lab.ini"
ebkWorkDirEnvName = "EBK_WORK_DIR"
ebkEnvNamePrefix = "EBK"
defaultConfigPath = "/conf/ezbookkeeping.ini"
defaultStaticRootPath = "public"
)
@@ -72,14 +72,14 @@ const (
)
const (
defaultAppName string = "lab"
defaultAppName string = "ezBookkeeping"
defaultHttpAddr string = "0.0.0.0"
defaultHttpPort int = 8080
defaultDomain string = "localhost"
defaultDatabaseHost string = "127.0.0.1:3306"
defaultDatabaseName string = "lab"
defaultDatabaseName string = "ezbookkeeping"
defaultDatabaseMaxIdleConn int = 2
defaultDatabaseMaxOpenConn int = 0
defaultDatabaseConnMaxLifetime int = 14400
@@ -87,7 +87,7 @@ const (
defaultLogMode string = "console"
defaultLoglevel Level = LOGLEVEL_INFO
defaultSecretKey string = "lab"
defaultSecretKey string = "ezbookkeeping"
defaultTokenExpiredTime int = 604800 // 7 days
defaultTemporaryTokenExpiredTime int = 300 // 5 minutes
@@ -434,7 +434,7 @@ func loadExchangeRatesConfiguration(config *Config, configFile *ini.File, sectio
}
func getWorkingPath() (string, error) {
workingPath := os.Getenv(labWorkDirEnvName)
workingPath := os.Getenv(ebkWorkDirEnvName)
if workingPath != "" {
return workingPath, nil
@@ -513,7 +513,7 @@ func getConfigItemBoolValue(configFile *ini.File, sectionName string, itemName s
}
func getEnvironmentKey(sectionName string, itemName string) string {
return fmt.Sprintf("%s_%s_%s", labEnvNamePrefix, strings.ToUpper(sectionName), strings.ToUpper(itemName))
return fmt.Sprintf("%s_%s_%s", ebkEnvNamePrefix, strings.ToUpper(sectionName), strings.ToUpper(itemName))
}
func getLogLevel(logLevelStr string, defaultLogLevel Level) Level {
+2 -2
View File
@@ -7,8 +7,8 @@ import (
"github.com/gin-gonic/gin"
"github.com/go-playground/validator/v10"
"github.com/mayswind/lab/pkg/core"
"github.com/mayswind/lab/pkg/errs"
"github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/ezbookkeeping/pkg/errs"
)
// PrintJsonSuccessResult writes success response in json format to current http context
+1 -1
View File
@@ -4,7 +4,7 @@ import (
"bytes"
"net"
"github.com/mayswind/lab/pkg/errs"
"github.com/mayswind/ezbookkeeping/pkg/errs"
)
// GetLocalIPAddressesString returns all local ip address, every ip split by comma
+4 -3
View File
@@ -1,15 +1,16 @@
package utils
import (
"github.com/stretchr/testify/assert"
"testing"
"github.com/mayswind/lab/pkg/settings"
"github.com/stretchr/testify/assert"
"github.com/mayswind/ezbookkeeping/pkg/settings"
)
func TestClone(t *testing.T) {
expectedObject := &settings.Config{
AppName: "lab",
AppName: "ezbookkeeping",
Mode: settings.MODE_PRODUCTION,
DatabaseConfig: &settings.DatabaseConfig{
DatabaseType: settings.MySqlDbType,
+1 -1
View File
@@ -12,7 +12,7 @@ import (
"golang.org/x/crypto/pbkdf2"
"github.com/mayswind/lab/pkg/errs"
"github.com/mayswind/ezbookkeeping/pkg/errs"
)
const (
+1 -1
View File
@@ -4,7 +4,7 @@ import (
"sync/atomic"
"time"
"github.com/mayswind/lab/pkg/settings"
"github.com/mayswind/ezbookkeeping/pkg/settings"
)
// Length and mask of all information in uuid
+1 -1
View File
@@ -8,7 +8,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/mayswind/lab/pkg/settings"
"github.com/mayswind/ezbookkeeping/pkg/settings"
)
func TestGenerateUuid(t *testing.T) {
+2 -2
View File
@@ -1,8 +1,8 @@
package uuid
import (
"github.com/mayswind/lab/pkg/errs"
"github.com/mayswind/lab/pkg/settings"
"github.com/mayswind/ezbookkeeping/pkg/errs"
"github.com/mayswind/ezbookkeeping/pkg/settings"
)
// UuidContainer contains the current uuid generator
+1 -1
View File
@@ -3,7 +3,7 @@ package validators
import (
"github.com/go-playground/validator/v10"
"github.com/mayswind/lab/pkg/utils"
"github.com/mayswind/ezbookkeeping/pkg/utils"
)
// ValidEmail returns whether the given email is valid
+1 -1
View File
@@ -3,7 +3,7 @@ package validators
import (
"github.com/go-playground/validator/v10"
"github.com/mayswind/lab/pkg/utils"
"github.com/mayswind/ezbookkeeping/pkg/utils"
)
// ValidHexRGBColor returns whether the given hex reb color is valid
+1 -1
View File
@@ -3,7 +3,7 @@ package validators
import (
"github.com/go-playground/validator/v10"
"github.com/mayswind/lab/pkg/utils"
"github.com/mayswind/ezbookkeeping/pkg/utils"
)
// ValidUsername returns whether the given user name is valid
+1 -1
View File
@@ -4,7 +4,7 @@ import (
"fmt"
"strings"
"github.com/mayswind/lab/pkg/utils"
"github.com/mayswind/ezbookkeeping/pkg/utils"
)
var (

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Before

Width:  |  Height:  |  Size: 99 KiB

After

Width:  |  Height:  |  Size: 99 KiB

+3 -3
View File
@@ -13,8 +13,8 @@ export default {
return {
f7params: {
name: 'lab',
id: 'net.mayswind.lab',
name: 'ezBookkeeping',
id: 'net.mayswind.ezbookkeeping',
theme: 'ios',
autoDarkTheme: self.$settings.isEnableAutoDarkMode(),
routes: routes,
@@ -268,7 +268,7 @@ i.icon.la, i.icon.las, i.icon.lab {
color: var(--f7-radio-active-color, var(--f7-theme-color));
}
.lab-list-item-error-info div.item-footer {
.ebk-list-item-error-info div.item-footer {
color: var(--f7-input-error-text-color)
}
</style>
+8 -8
View File
@@ -3,34 +3,34 @@ import settings from './settings.js';
function logDebug(msg, obj) {
if (settings.isEnableDebug()) {
if (obj) {
console.debug('[lab Debug] ' + msg, obj);
console.debug('[ezBookkeeping Debug] ' + msg, obj);
} else {
console.debug('[lab Debug] ' + msg);
console.debug('[ezBookkeeping Debug] ' + msg);
}
}
}
function logInfo(msg, obj) {
if (obj) {
console.info('[lab Info] ' + msg, obj);
console.info('[ezBookkeeping Info] ' + msg, obj);
} else {
console.info('[lab Info] ' + msg);
console.info('[ezBookkeeping Info] ' + msg);
}
}
function logWarn(msg, obj) {
if (obj) {
console.warn('[lab Warn] ' + msg, obj);
console.warn('[ezBookkeeping Warn] ' + msg, obj);
} else {
console.warn('[lab Warn] ' + msg);
console.warn('[ezBookkeeping Warn] ' + msg);
}
}
function logError(msg, obj) {
if (obj) {
console.error('[lab Error] ' + msg, obj);
console.error('[ezBookkeeping Error] ' + msg, obj);
} else {
console.error('[lab Error] ' + msg);
console.error('[ezBookkeeping Error] ' + msg);
}
}
+2 -2
View File
@@ -3,8 +3,8 @@ import Cookies from 'js-cookie';
import currencyConstants from '../consts/currency.js';
import statisticsConstants from '../consts/statistics.js';
const settingsLocalStorageKey = 'lab_app_settings';
const serverSettingsCookieKey = 'lab_server_settings';
const settingsLocalStorageKey = 'ebk_app_settings';
const serverSettingsCookieKey = 'ebk_server_settings';
const defaultSettings = {
lang: 'en',
+6 -6
View File
@@ -3,14 +3,14 @@ import CryptoJS from 'crypto-js';
import settings from './settings.js';
import utils from './utils.js';
const appLockSecretBaseStringPrefix = 'LAB_LOCK_SECRET_';
const appLockSecretBaseStringPrefix = 'EBK_LOCK_SECRET_';
const tokenLocalStorageKey = 'lab_user_token';
const webauthnConfigLocalStorageKey = 'lab_user_webauthn_config';
const userInfoLocalStorageKey = 'lab_user_info';
const tokenLocalStorageKey = 'ebk_user_token';
const webauthnConfigLocalStorageKey = 'ebk_user_webauthn_config';
const userInfoLocalStorageKey = 'ebk_user_info';
const tokenSessionStorageKey = 'lab_user_session_token';
const appLockStateSessionStorageKey = 'lab_user_app_lock_state'; // { 'username': '', secret: '' }
const tokenSessionStorageKey = 'ebk_user_session_token';
const appLockStateSessionStorageKey = 'ebk_user_app_lock_state'; // { 'username': '', secret: '' }
function getAppLockSecret(pinCode) {
const hashedPinCode = CryptoJS.SHA256(appLockSecretBaseStringPrefix + pinCode).toString();
+1 -1
View File
@@ -512,7 +512,7 @@ function stringToArrayBuffer(str){
}
function generateRandomString() {
const baseString = 'lab_' + Math.round(new Date().getTime() / 1000) + '_' + Math.random();
const baseString = 'ebk_' + Math.round(new Date().getTime() / 1000) + '_' + Math.random();
return CryptoJS.SHA256(baseString).toString();
}
+1 -1
View File
@@ -1,7 +1,7 @@
export default {
'global': {
'app': {
'title': 'lab account book',
'title': 'ezBookkeeping',
}
},
'default': {
+1 -1
View File
@@ -1,7 +1,7 @@
export default {
'global': {
'app': {
'title': 'lab 轻记账',
'title': 'ezBookkeeping',
}
},
'default': {
+3 -3
View File
@@ -6,12 +6,12 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui, viewport-fit=cover">
<meta name="format-detection" content="telephone=no"/>
<meta name="description" content="lab is a lightweight account book app hosted by yourself.">
<title>lab</title>
<meta name="description" content="ezBookkeeping is a lightweight personal bookkeeping app hosted by yourself.">
<title>ezBookkeeping</title>
</head>
<body>
<noscript>
<strong>We're sorry but lab doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
<strong>We're sorry but ezBookkeeping doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
</body>
+4 -4
View File
@@ -7,19 +7,19 @@
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui, viewport-fit=cover">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="apple-mobile-web-app-title" content="lab"/>
<meta name="apple-mobile-web-app-title" content="ezBookkeeping"/>
<meta name="apple-mobile-web-app-status-bar-style" content="default"/>
<meta name="theme-color" content="#c67e48">
<meta name="format-detection" content="telephone=no"/>
<meta name="description" content="lab is a lightweight account book app hosted by yourself.">
<title>lab</title>
<meta name="description" content="ezBookkeeping is a lightweight personal bookkeeping app hosted by yourself.">
<title>ezBookkeeping</title>
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
<link rel="apple-touch-icon" href="touchicon.png">
<link rel="manifest" href="manifest.json">
</head>
<body>
<noscript>
<strong>We're sorry but lab doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
<strong>We're sorry but ezBookkeeping doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
</body>
+1 -1
View File
@@ -6,7 +6,7 @@ import {
STORE_LATEST_EXCHANGE_RATES
} from './mutations.js';
const exchangeRatesLocalStorageKey = 'lab_app_exchange_rates';
const exchangeRatesLocalStorageKey = 'ebk_app_exchange_rates';
export function getLatestExchangeRates(context, { silent, force }) {
const currentExchangeRateData = context.state.latestExchangeRates;
+2 -3
View File
@@ -7,8 +7,7 @@
<f7-list>
<f7-list-item :title="$t('Version')" :after="version"></f7-list-item>
<f7-list-item :title="$t('Build Time')" :after="buildTime | moment($t('format.datetime.long'))"></f7-list-item>
<f7-list-item external :title="$t('Official Website')" after="https://github.com/mayswind/lab"
link="https://github.com/mayswind/lab" target="_blank"></f7-list-item>
<f7-list-item external :title="$t('Official Website')" link="https://github.com/mayswind/ezbookkeeping" target="_blank"></f7-list-item>
<f7-list-item :title="$t('License')" link="#" popup-open=".license-popup"></f7-list-item>
</f7-list>
</f7-card-content>
@@ -31,7 +30,7 @@
</p>
<hr/>
<p>
<span>lab also contains additional third party software.</span><br/>
<span>ezBookkeeping also contains additional third party software.</span><br/>
<span>All the third party software included or linked is redistributed under the terms and conditions of their original licenses.</span>
</p>
<p></p>
+2 -2
View File
@@ -153,7 +153,7 @@
<span class="tabbar-label">{{ $t('Accounts') }}</span>
</f7-link>
<f7-link href="/transaction/add">
<f7-icon f7="plus_square" class="lab-tarbar-big-icon"></f7-icon>
<f7-icon f7="plus_square" class="ebk-tarbar-big-icon"></f7-icon>
</f7-link>
<f7-link href="/statistic/transaction">
<f7-icon f7="chart_pie"></f7-icon>
@@ -352,7 +352,7 @@ export default {
margin-right: 4px;
}
.tabbar-labels i.lab-tarbar-big-icon {
.tabbar-labels i.ebk-tarbar-big-icon {
font-size: 42px;
width: 42px;
height: 42px;
+2 -2
View File
@@ -1,7 +1,7 @@
<template>
<f7-page no-toolbar no-navbar no-swipeback login-screen>
<f7-login-screen-title>
<img class="login-page-logo" src="img/lab-192.png" />
<img class="login-page-logo" src="img/ezbookkeeping-192.png" />
<f7-block class="margin-vertical-half">{{ $t('global.app.title') }}</f7-block>
</f7-login-screen-title>
<f7-list form>
@@ -40,7 +40,7 @@
<f7-list>
<f7-block-footer>
<span>Powered by </span>
<f7-link external href="https://github.com/mayswind/lab" target="_blank">lab</f7-link>&nbsp;
<f7-link external href="https://github.com/mayswind/ezbookkeeping" target="_blank">ezBookkeeping</f7-link>&nbsp;
<span>{{ version }}</span>
</f7-block-footer>
<f7-block-footer>
+1 -1
View File
@@ -61,7 +61,7 @@
@input="user.nickname = $event.target.value"
></f7-list-input>
<f7-list-item class="lab-list-item-error-info" v-if="inputIsInvalid" :footer="$t(inputInvalidProblemMessage)"></f7-list-item>
<f7-list-item class="ebk-list-item-error-info" v-if="inputIsInvalid" :footer="$t(inputInvalidProblemMessage)"></f7-list-item>
</f7-list>
</f7-card-content>
</f7-card>
+1 -1
View File
@@ -101,7 +101,7 @@
</select>
</f7-list-item>
<f7-list-item class="lab-list-item-error-info" v-if="inputIsInvalid" :footer="$t(inputInvalidProblemMessage)"></f7-list-item>
<f7-list-item class="ebk-list-item-error-info" v-if="inputIsInvalid" :footer="$t(inputInvalidProblemMessage)"></f7-list-item>
</f7-list>
</f7-card-content>
</f7-card>
+4 -4
View File
@@ -71,22 +71,22 @@ module.exports = {
});
},
pwa: {
name: 'lab account book',
name: 'ezBookkeeping',
themeColor: '#C67E48',
appleMobileWebAppCapable: 'yes',
appleMobileWebAppStatusBarStyle: 'default',
workboxPluginMode: 'GenerateSW',
manifestPath: 'manifest.json',
manifestOptions: {
short_name: 'lab',
short_name: 'ezBookkeeping',
icons: [
{
src: "img/lab-192.png",
src: "img/ezbookkeeping-192.png",
sizes: "192x192",
type: "image/png"
},
{
src: "img/lab-512.png",
src: "img/ezbookkeeping-512.png",
sizes: "512x512",
type: "image/png"
}