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 # Build backend binary file
FROM golang:1.14.10-alpine3.12 AS be-builder 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 . . COPY . .
RUN docker/backend-build-pre-setup.sh RUN docker/backend-build-pre-setup.sh
RUN apk add git gcc g++ libc-dev RUN apk add git gcc g++ libc-dev
RUN VERSION=`grep '"version": ' package.json | awk -F ':' '{print $2}' | tr -d ' ' | tr -d ',' | tr -d '"'` \ RUN VERSION=`grep '"version": ' package.json | awk -F ':' '{print $2}' | tr -d ' ' | tr -d ',' | tr -d '"'` \
&& COMMIT_HASH=$(git rev-parse --short HEAD) \ && COMMIT_HASH=$(git rev-parse --short HEAD) \
&& BUILD_UNIXTIME="$(date '+%s')" \ && 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 \ && GOOS=linux \
&& GOARCH=amd64 \ && GOARCH=amd64 \
&& CGO_ENABLED=1 \ && CGO_ENABLED=1 \
&& go build -a -v -i -trimpath -ldflags "-w -linkmode external -extldflags '-static' ${VERSION_FLAGS}" -o lab lab.go && go build -a -v -i -trimpath -ldflags "-w -linkmode external -extldflags '-static' ${VERSION_FLAGS}" -o ezbookkeeping ezbookkeeping.go
RUN chmod +x lab RUN chmod +x ezbookkeeping
# Build frontend files # Build frontend files
FROM node:12.19.0-alpine3.12 AS fe-builder 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 . . COPY . .
RUN docker/frontend-build-pre-setup.sh RUN docker/frontend-build-pre-setup.sh
RUN apk add git RUN apk add git
@@ -25,17 +25,17 @@ RUN npm install && npm run build
# Package docker image # Package docker image
FROM alpine:3.12.0 FROM alpine:3.12.0
LABEL maintainer="MaysWind <i@mayswind.net>" 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 RUN apk --no-cache add tzdata
COPY docker/docker-entrypoint.sh /docker-entrypoint.sh COPY docker/docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh RUN chmod +x /docker-entrypoint.sh
RUN mkdir -p /usr/local/bin/labapp && chown 1000:1000 /usr/local/bin/labapp \ RUN mkdir -p /usr/local/bin/ezbookkeeping && chown 1000:1000 /usr/local/bin/ezbookkeeping \
&& mkdir -p /usr/local/bin/labapp/data && chown 1000:1000 /usr/local/bin/labapp/data \ && mkdir -p /usr/local/bin/ezbookkeeping/data && chown 1000:1000 /usr/local/bin/ezbookkeeping/data \
&& mkdir -p /var/log/labapp && chown 1000:1000 /var/log/labapp && mkdir -p /var/log/ezbookkeeping && chown 1000:1000 /var/log/ezbookkeeping
WORKDIR /usr/local/bin/labapp WORKDIR /usr/local/bin/ezbookkeeping
COPY --from=be-builder --chown=1000:1000 /go/src/github.com/mayswind/lab/lab /usr/local/bin/labapp/lab 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/lab/dist /usr/local/bin/labapp/public 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/labapp/conf COPY --chown=1000:1000 conf /usr/local/bin/ezbookkeeping/conf
USER 1000:1000 USER 1000:1000
EXPOSE 8080 EXPOSE 8080
ENTRYPOINT ["/docker-entrypoint.sh"] ENTRYPOINT ["/docker-entrypoint.sh"]
+17 -17
View File
@@ -1,12 +1,12 @@
# lab # ezBookkeeping
[![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/mayswind/lab/blob/master/LICENSE) [![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/lab.svg?style=flat)](https://hub.docker.com/r/mayswind/lab/builds) [![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/lab)](https://goreportcard.com/report/github.com/mayswind/lab) [![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/lab.svg?style=flat)](https://hub.docker.com/r/mayswind/lab) [![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/lab.svg?style=flat)](https://github.com/mayswind/lab/releases) [![Latest Release](https://img.shields.io/github/release/mayswind/ezbookkeeping.svg?style=flat)](https://github.com/mayswind/ezbookkeeping/releases)
## Introduction ## 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 ## Features
1. Open source & Self-hosted 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 ## Installation
### Ship with docker ### 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: Latest Release:
$ docker run -p8080:8080 mayswind/lab $ docker run -p8080:8080 mayswind/ezbookkeeping
Latest Daily Build: Latest Daily Build:
$ docker run -p8080:8080 mayswind/lab:latest-snapshot $ docker run -p8080:8080 mayswind/ezbookkeeping:latest-snapshot
### Install from binary ### 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 ### 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. 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 # 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 # Build frontend static files
$ npm install $ npm install
$ npm run build $ npm run build
# Copy files to target path # Copy files to target path
$ cp lab <target>/lab $ cp ezbookkeeping <target>/ezbookkeeping
$ cp -R dist <target>/public $ cp -R dist <target>/public
$ cp -R conf <target>/conf $ cp -R conf <target>/conf
All the files will be placed in `<target>` directory. 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 ## 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 fi
echo "Building docker image..."; 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 ( import (
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
"github.com/mayswind/lab/pkg/datastore" "github.com/mayswind/ezbookkeeping/pkg/datastore"
"github.com/mayswind/lab/pkg/log" "github.com/mayswind/ezbookkeeping/pkg/log"
"github.com/mayswind/lab/pkg/models" "github.com/mayswind/ezbookkeeping/pkg/models"
) )
// Database represents the database command // Database represents the database command
var Database = &cli.Command{ var Database = &cli.Command{
Name: "database", Name: "database",
Usage: "lab database maintenance", Usage: "ezBookkeeping database maintenance",
Subcommands: []*cli.Command{ Subcommands: []*cli.Command{
{ {
Name: "update", Name: "update",
+6 -6
View File
@@ -6,12 +6,12 @@ import (
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
"github.com/mayswind/lab/pkg/datastore" "github.com/mayswind/ezbookkeeping/pkg/datastore"
"github.com/mayswind/lab/pkg/exchangerates" "github.com/mayswind/ezbookkeeping/pkg/exchangerates"
"github.com/mayswind/lab/pkg/log" "github.com/mayswind/ezbookkeeping/pkg/log"
"github.com/mayswind/lab/pkg/settings" "github.com/mayswind/ezbookkeeping/pkg/settings"
"github.com/mayswind/lab/pkg/utils" "github.com/mayswind/ezbookkeeping/pkg/utils"
"github.com/mayswind/lab/pkg/uuid" "github.com/mayswind/ezbookkeeping/pkg/uuid"
) )
func initializeSystem(c *cli.Context) (*settings.Config, error) { func initializeSystem(c *cli.Context) (*settings.Config, error) {
+4 -4
View File
@@ -5,15 +5,15 @@ import (
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
clis "github.com/mayswind/lab/pkg/cli" clis "github.com/mayswind/ezbookkeeping/pkg/cli"
"github.com/mayswind/lab/pkg/log" "github.com/mayswind/ezbookkeeping/pkg/log"
"github.com/mayswind/lab/pkg/utils" "github.com/mayswind/ezbookkeeping/pkg/utils"
) )
// UserData represents the data command // UserData represents the data command
var UserData = &cli.Command{ var UserData = &cli.Command{
Name: "userdata", Name: "userdata",
Usage: "lab user data maintenance", Usage: "ezBookkeeping user data maintenance",
Subcommands: []*cli.Command{ Subcommands: []*cli.Command{
{ {
Name: "user-add", Name: "user-add",
+11 -11
View File
@@ -12,25 +12,25 @@ import (
"github.com/mssola/user_agent" "github.com/mssola/user_agent"
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
"github.com/mayswind/lab/pkg/api" "github.com/mayswind/ezbookkeeping/pkg/api"
"github.com/mayswind/lab/pkg/core" "github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/lab/pkg/errs" "github.com/mayswind/ezbookkeeping/pkg/errs"
"github.com/mayswind/lab/pkg/log" "github.com/mayswind/ezbookkeeping/pkg/log"
"github.com/mayswind/lab/pkg/middlewares" "github.com/mayswind/ezbookkeeping/pkg/middlewares"
"github.com/mayswind/lab/pkg/requestid" "github.com/mayswind/ezbookkeeping/pkg/requestid"
"github.com/mayswind/lab/pkg/settings" "github.com/mayswind/ezbookkeeping/pkg/settings"
"github.com/mayswind/lab/pkg/utils" "github.com/mayswind/ezbookkeeping/pkg/utils"
"github.com/mayswind/lab/pkg/validators" "github.com/mayswind/ezbookkeeping/pkg/validators"
) )
// WebServer represents the server command // WebServer represents the server command
var WebServer = &cli.Command{ var WebServer = &cli.Command{
Name: "server", Name: "server",
Usage: "lab web server operation", Usage: "ezBookkeeping web server operation",
Subcommands: []*cli.Command{ Subcommands: []*cli.Command{
{ {
Name: "run", Name: "run",
Usage: "Run lab web server", Usage: "Run ezBookkeeping web server",
Action: startWebServer, Action: startWebServer,
}, },
}, },
+7 -7
View File
@@ -1,6 +1,6 @@
[global] [global]
# Application instance name # Application instance name
app_name = lab app_name = ezBookkeeping
# Either "production", "development" # Either "production", "development"
mode = production mode = production
@@ -15,10 +15,10 @@ http_addr = 0.0.0.0
# The http port to bind to # The http port to bind to
http_port = 8080 http_port = 8080
# The domain name used to access lab # The domain name used to access ezBookkeeping
domain = localhost 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/ root_url = %(protocol)s://%(domain)s:%(http_port)s/
# https certification and its key file # https certification and its key file
@@ -43,7 +43,7 @@ type = sqlite3
# Database connection configuration, for "mysql" and "postgres" # Database connection configuration, for "mysql" and "postgres"
host = 127.0.0.1:3306 host = 127.0.0.1:3306
name = lab name = ezbookkeeping
user = root user = root
passwd = passwd =
@@ -51,7 +51,7 @@ passwd =
ssl_mode = disable ssl_mode = disable
# For "sqlite3" only, absolute path of db file # 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 connection number, default is 2
max_idle_conn = 2 max_idle_conn = 2
@@ -77,7 +77,7 @@ mode = console file
level = info level = info
# For "file" only, absolute path of log file # For "file" only, absolute path of log file
log_path = /var/log/labapp/lab.log log_path = /var/log/ezbookkeeping/ezbookkeeping.log
[uuid] [uuid]
# Uuid generator type, supports "internal" currently # Uuid generator type, supports "internal" currently
@@ -87,7 +87,7 @@ generator_type = internal
server_id = 0 server_id = 0
[security] [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 = secret_key =
# Set to true to enable two factor authorization # Set to true to enable two factor authorization
+3 -3
View File
@@ -4,12 +4,12 @@ set -e;
conf_path_param=""; conf_path_param="";
if [ "${LAB_CONF_PATH}" != "" ]; then if [ "${EBK_CONF_PATH}" != "" ]; then
conf_path_param="--conf-path=${LAB_CONF_PATH}"; conf_path_param="--conf-path=${EBK_CONF_PATH}";
fi fi
if [ $# -gt 0 ]; then if [ $# -gt 0 ]; then
exec "$@" exec "$@"
else else
exec /usr/local/bin/labapp/lab server run ${conf_path_param}; exec /usr/local/bin/ezbookkeeping/ezbookkeeping server run ${conf_path_param};
fi 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/urfave/cli/v2"
"github.com/mayswind/lab/cmd" "github.com/mayswind/ezbookkeeping/cmd"
"github.com/mayswind/lab/pkg/version" "github.com/mayswind/ezbookkeeping/pkg/version"
) )
func main() { func main() {
app := &cli.App{ app := &cli.App{
Name: "lab", Name: "ezBookkeeping",
Usage: "A lightweight account book app hosted by yourself.", Usage: "A lightweight personal bookkeeping app hosted by yourself.",
Version: version.GetFullVersion(), Version: version.GetFullVersion(),
Commands: []*cli.Command{ Commands: []*cli.Command{
cmd.WebServer, cmd.WebServer,
@@ -31,6 +31,6 @@ func main() {
err := app.Run(os.Args) err := app.Run(os.Args)
if err != nil { 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 go 1.14
+4 -4
View File
@@ -1,5 +1,5 @@
{ {
"name": "lab", "name": "ezbookkeeping",
"version": "0.1.0", "version": "0.1.0",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
@@ -12619,9 +12619,9 @@
} }
}, },
"vue-loader-v16": { "vue-loader-v16": {
"version": "npm:vue-loader@16.1.2", "version": "npm:vue-loader@16.2.0",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.1.2.tgz", "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.2.0.tgz",
"integrity": "sha512-8QTxh+Fd+HB6fiL52iEVLKqE9N1JSlMXLR92Ijm6g8PZrwIxckgpqjPDWRP5TWxdiPaHR+alUWsnu1ShQOwt+Q==", "integrity": "sha512-TitGhqSQ61RJljMmhIGvfWzJ2zk9m1Qug049Ugml6QP3t0e95o0XJjk29roNEiPKJQBEi8Ord5hFuSuELzSp8Q==",
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
+10 -1
View File
@@ -1,7 +1,16 @@
{ {
"name": "lab", "name": "ezbookkeeping",
"version": "0.1.0", "version": "0.1.0",
"private": true, "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": { "scripts": {
"serve": "vue-cli-service serve", "serve": "vue-cli-service serve",
"build": "vue-cli-service build", "build": "vue-cli-service build",
+6 -6
View File
@@ -3,12 +3,12 @@ package api
import ( import (
"sort" "sort"
"github.com/mayswind/lab/pkg/core" "github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/lab/pkg/errs" "github.com/mayswind/ezbookkeeping/pkg/errs"
"github.com/mayswind/lab/pkg/log" "github.com/mayswind/ezbookkeeping/pkg/log"
"github.com/mayswind/lab/pkg/models" "github.com/mayswind/ezbookkeeping/pkg/models"
"github.com/mayswind/lab/pkg/services" "github.com/mayswind/ezbookkeeping/pkg/services"
"github.com/mayswind/lab/pkg/validators" "github.com/mayswind/ezbookkeeping/pkg/validators"
) )
// AccountsApi represents account api // AccountsApi represents account api
+5 -5
View File
@@ -3,11 +3,11 @@ package api
import ( import (
"github.com/pquerna/otp/totp" "github.com/pquerna/otp/totp"
"github.com/mayswind/lab/pkg/core" "github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/lab/pkg/errs" "github.com/mayswind/ezbookkeeping/pkg/errs"
"github.com/mayswind/lab/pkg/log" "github.com/mayswind/ezbookkeeping/pkg/log"
"github.com/mayswind/lab/pkg/models" "github.com/mayswind/ezbookkeeping/pkg/models"
"github.com/mayswind/lab/pkg/services" "github.com/mayswind/ezbookkeeping/pkg/services"
) )
// AuthorizationsApi represents authorization api // AuthorizationsApi represents authorization api
+8 -8
View File
@@ -5,14 +5,14 @@ import (
"strings" "strings"
"time" "time"
"github.com/mayswind/lab/pkg/core" "github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/lab/pkg/errs" "github.com/mayswind/ezbookkeeping/pkg/errs"
"github.com/mayswind/lab/pkg/exporters" "github.com/mayswind/ezbookkeeping/pkg/exporters"
"github.com/mayswind/lab/pkg/log" "github.com/mayswind/ezbookkeeping/pkg/log"
"github.com/mayswind/lab/pkg/models" "github.com/mayswind/ezbookkeeping/pkg/models"
"github.com/mayswind/lab/pkg/services" "github.com/mayswind/ezbookkeeping/pkg/services"
"github.com/mayswind/lab/pkg/settings" "github.com/mayswind/ezbookkeeping/pkg/settings"
"github.com/mayswind/lab/pkg/utils" "github.com/mayswind/ezbookkeeping/pkg/utils"
) )
const pageCountForDataExport = 1000 const pageCountForDataExport = 1000
+2 -2
View File
@@ -1,8 +1,8 @@
package api package api
import ( import (
"github.com/mayswind/lab/pkg/core" "github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/lab/pkg/errs" "github.com/mayswind/ezbookkeeping/pkg/errs"
) )
// DefaultApi represents default api // DefaultApi represents default api
+6 -6
View File
@@ -6,12 +6,12 @@ import (
"sort" "sort"
"time" "time"
"github.com/mayswind/lab/pkg/core" "github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/lab/pkg/errs" "github.com/mayswind/ezbookkeeping/pkg/errs"
"github.com/mayswind/lab/pkg/exchangerates" "github.com/mayswind/ezbookkeeping/pkg/exchangerates"
"github.com/mayswind/lab/pkg/log" "github.com/mayswind/ezbookkeeping/pkg/log"
"github.com/mayswind/lab/pkg/models" "github.com/mayswind/ezbookkeeping/pkg/models"
"github.com/mayswind/lab/pkg/settings" "github.com/mayswind/ezbookkeeping/pkg/settings"
) )
// ExchangeRatesApi represents exchange rate api // ExchangeRatesApi represents exchange rate api
+6 -6
View File
@@ -3,12 +3,12 @@ package api
import ( import (
"sort" "sort"
"github.com/mayswind/lab/pkg/core" "github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/lab/pkg/errs" "github.com/mayswind/ezbookkeeping/pkg/errs"
"github.com/mayswind/lab/pkg/log" "github.com/mayswind/ezbookkeeping/pkg/log"
"github.com/mayswind/lab/pkg/models" "github.com/mayswind/ezbookkeeping/pkg/models"
"github.com/mayswind/lab/pkg/services" "github.com/mayswind/ezbookkeeping/pkg/services"
"github.com/mayswind/lab/pkg/utils" "github.com/mayswind/ezbookkeeping/pkg/utils"
) )
// TokensApi represents token api // TokensApi represents token api
+5 -5
View File
@@ -3,11 +3,11 @@ package api
import ( import (
"sort" "sort"
"github.com/mayswind/lab/pkg/core" "github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/lab/pkg/errs" "github.com/mayswind/ezbookkeeping/pkg/errs"
"github.com/mayswind/lab/pkg/log" "github.com/mayswind/ezbookkeeping/pkg/log"
"github.com/mayswind/lab/pkg/models" "github.com/mayswind/ezbookkeeping/pkg/models"
"github.com/mayswind/lab/pkg/services" "github.com/mayswind/ezbookkeeping/pkg/services"
) )
// TransactionCategoriesApi represents transaction category api // TransactionCategoriesApi represents transaction category api
+5 -5
View File
@@ -3,11 +3,11 @@ package api
import ( import (
"sort" "sort"
"github.com/mayswind/lab/pkg/core" "github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/lab/pkg/errs" "github.com/mayswind/ezbookkeeping/pkg/errs"
"github.com/mayswind/lab/pkg/log" "github.com/mayswind/ezbookkeeping/pkg/log"
"github.com/mayswind/lab/pkg/models" "github.com/mayswind/ezbookkeeping/pkg/models"
"github.com/mayswind/lab/pkg/services" "github.com/mayswind/ezbookkeeping/pkg/services"
) )
// TransactionTagsApi represents transaction tag api // TransactionTagsApi represents transaction tag api
+6 -6
View File
@@ -4,12 +4,12 @@ import (
"sort" "sort"
"strings" "strings"
"github.com/mayswind/lab/pkg/core" "github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/lab/pkg/errs" "github.com/mayswind/ezbookkeeping/pkg/errs"
"github.com/mayswind/lab/pkg/log" "github.com/mayswind/ezbookkeeping/pkg/log"
"github.com/mayswind/lab/pkg/models" "github.com/mayswind/ezbookkeeping/pkg/models"
"github.com/mayswind/lab/pkg/services" "github.com/mayswind/ezbookkeeping/pkg/services"
"github.com/mayswind/lab/pkg/utils" "github.com/mayswind/ezbookkeeping/pkg/utils"
) )
const pageCountForLoadTransactionAmounts = 1000 const pageCountForLoadTransactionAmounts = 1000
+5 -5
View File
@@ -8,11 +8,11 @@ import (
"github.com/pquerna/otp/totp" "github.com/pquerna/otp/totp"
"github.com/mayswind/lab/pkg/core" "github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/lab/pkg/errs" "github.com/mayswind/ezbookkeeping/pkg/errs"
"github.com/mayswind/lab/pkg/log" "github.com/mayswind/ezbookkeeping/pkg/log"
"github.com/mayswind/lab/pkg/models" "github.com/mayswind/ezbookkeeping/pkg/models"
"github.com/mayswind/lab/pkg/services" "github.com/mayswind/ezbookkeeping/pkg/services"
) )
// TwoFactorAuthorizationsApi represents 2fa api // TwoFactorAuthorizationsApi represents 2fa api
+7 -7
View File
@@ -4,13 +4,13 @@ import (
"strings" "strings"
"time" "time"
"github.com/mayswind/lab/pkg/core" "github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/lab/pkg/errs" "github.com/mayswind/ezbookkeeping/pkg/errs"
"github.com/mayswind/lab/pkg/log" "github.com/mayswind/ezbookkeeping/pkg/log"
"github.com/mayswind/lab/pkg/models" "github.com/mayswind/ezbookkeeping/pkg/models"
"github.com/mayswind/lab/pkg/services" "github.com/mayswind/ezbookkeeping/pkg/services"
"github.com/mayswind/lab/pkg/settings" "github.com/mayswind/ezbookkeeping/pkg/settings"
"github.com/mayswind/lab/pkg/validators" "github.com/mayswind/ezbookkeeping/pkg/validators"
) )
// UsersApi represents user api // UsersApi represents user api
+6 -6
View File
@@ -5,12 +5,12 @@ import (
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
"github.com/mayswind/lab/pkg/errs" "github.com/mayswind/ezbookkeeping/pkg/errs"
"github.com/mayswind/lab/pkg/exporters" "github.com/mayswind/ezbookkeeping/pkg/exporters"
"github.com/mayswind/lab/pkg/log" "github.com/mayswind/ezbookkeeping/pkg/log"
"github.com/mayswind/lab/pkg/models" "github.com/mayswind/ezbookkeeping/pkg/models"
"github.com/mayswind/lab/pkg/services" "github.com/mayswind/ezbookkeeping/pkg/services"
"github.com/mayswind/lab/pkg/validators" "github.com/mayswind/ezbookkeeping/pkg/validators"
) )
const pageCountForGettingTransactions = 1000 const pageCountForGettingTransactions = 1000
+1 -1
View File
@@ -5,7 +5,7 @@ import (
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/mayswind/lab/pkg/errs" "github.com/mayswind/ezbookkeeping/pkg/errs"
) )
const requestIdFieldKey = "REQUEST_ID" const requestIdFieldKey = "REQUEST_ID"
+1 -1
View File
@@ -1,6 +1,6 @@
package core package core
import "github.com/mayswind/lab/pkg/errs" import "github.com/mayswind/ezbookkeeping/pkg/errs"
// MiddlewareHandlerFunc represents the middleware handler function // MiddlewareHandlerFunc represents the middleware handler function
type MiddlewareHandlerFunc func(*Context) type MiddlewareHandlerFunc func(*Context)
+1 -1
View File
@@ -3,7 +3,7 @@ package datastore
import ( import (
"xorm.io/xorm" "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 // 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" _ "github.com/mattn/go-sqlite3"
"xorm.io/xorm" "xorm.io/xorm"
"github.com/mayswind/lab/pkg/errs" "github.com/mayswind/ezbookkeeping/pkg/errs"
"github.com/mayswind/lab/pkg/settings" "github.com/mayswind/ezbookkeeping/pkg/settings"
) )
// DataStoreContainer contains all data storages // DataStoreContainer contains all data storages
+2 -2
View File
@@ -3,8 +3,8 @@ package datastore
import ( import (
xorm "xorm.io/xorm/log" xorm "xorm.io/xorm/log"
"github.com/mayswind/lab/pkg/log" "github.com/mayswind/ezbookkeeping/pkg/log"
"github.com/mayswind/lab/pkg/settings" "github.com/mayswind/ezbookkeeping/pkg/settings"
) )
// XOrmLoggerAdapter represents the logger adapter for xorm // XOrmLoggerAdapter represents the logger adapter for xorm
@@ -6,12 +6,12 @@ import (
"strings" "strings"
"time" "time"
"github.com/mayswind/lab/pkg/core" "github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/lab/pkg/errs" "github.com/mayswind/ezbookkeeping/pkg/errs"
"github.com/mayswind/lab/pkg/log" "github.com/mayswind/ezbookkeeping/pkg/log"
"github.com/mayswind/lab/pkg/models" "github.com/mayswind/ezbookkeeping/pkg/models"
"github.com/mayswind/lab/pkg/utils" "github.com/mayswind/ezbookkeeping/pkg/utils"
"github.com/mayswind/lab/pkg/validators" "github.com/mayswind/ezbookkeeping/pkg/validators"
) )
const bankOfCanadaExchangeRateUrl = "https://www.bankofcanada.ca/valet/observations/group/FX_RATES_DAILY/json?recent=1" 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/gin-gonic/gin"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/mayswind/lab/pkg/core" "github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/lab/pkg/models" "github.com/mayswind/ezbookkeeping/pkg/models"
) )
const bankOfCanadaMinimumRequiredContent = "{\n" + const bankOfCanadaMinimumRequiredContent = "{\n" +
@@ -5,12 +5,12 @@ import (
"strings" "strings"
"time" "time"
"github.com/mayswind/lab/pkg/core" "github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/lab/pkg/errs" "github.com/mayswind/ezbookkeeping/pkg/errs"
"github.com/mayswind/lab/pkg/log" "github.com/mayswind/ezbookkeeping/pkg/log"
"github.com/mayswind/lab/pkg/models" "github.com/mayswind/ezbookkeeping/pkg/models"
"github.com/mayswind/lab/pkg/utils" "github.com/mayswind/ezbookkeeping/pkg/utils"
"github.com/mayswind/lab/pkg/validators" "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" 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/gin-gonic/gin"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/mayswind/lab/pkg/core" "github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/lab/pkg/models" "github.com/mayswind/ezbookkeeping/pkg/models"
) )
const czechNationalBankMinimumRequiredContent = "01 Apr 2021 #64\n" + const czechNationalBankMinimumRequiredContent = "01 Apr 2021 #64\n" +
@@ -4,12 +4,12 @@ import (
"encoding/xml" "encoding/xml"
"time" "time"
"github.com/mayswind/lab/pkg/core" "github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/lab/pkg/errs" "github.com/mayswind/ezbookkeeping/pkg/errs"
"github.com/mayswind/lab/pkg/log" "github.com/mayswind/ezbookkeeping/pkg/log"
"github.com/mayswind/lab/pkg/models" "github.com/mayswind/ezbookkeeping/pkg/models"
"github.com/mayswind/lab/pkg/utils" "github.com/mayswind/ezbookkeeping/pkg/utils"
"github.com/mayswind/lab/pkg/validators" "github.com/mayswind/ezbookkeeping/pkg/validators"
) )
const euroCentralBankExchangeRateUrl = "https://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml" const euroCentralBankExchangeRateUrl = "https://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml"
@@ -6,8 +6,8 @@ import (
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/mayswind/lab/pkg/core" "github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/lab/pkg/models" "github.com/mayswind/ezbookkeeping/pkg/models"
) )
const euroCentralBankMinimumRequiredContent = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + const euroCentralBankMinimumRequiredContent = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
@@ -1,8 +1,8 @@
package exchangerates package exchangerates
import ( import (
"github.com/mayswind/lab/pkg/core" "github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/lab/pkg/models" "github.com/mayswind/ezbookkeeping/pkg/models"
) )
// ExchangeRatesDataSource defines the structure of exchange rates data source // ExchangeRatesDataSource defines the structure of exchange rates data source
@@ -1,8 +1,8 @@
package exchangerates package exchangerates
import ( import (
"github.com/mayswind/lab/pkg/errs" "github.com/mayswind/ezbookkeeping/pkg/errs"
"github.com/mayswind/lab/pkg/settings" "github.com/mayswind/ezbookkeeping/pkg/settings"
) )
// ExchangeRatesDataSourceContainer contains the current exchange rates data source // ExchangeRatesDataSourceContainer contains the current exchange rates data source
@@ -6,12 +6,12 @@ import (
"math" "math"
"time" "time"
"github.com/mayswind/lab/pkg/core" "github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/lab/pkg/errs" "github.com/mayswind/ezbookkeeping/pkg/errs"
"github.com/mayswind/lab/pkg/log" "github.com/mayswind/ezbookkeeping/pkg/log"
"github.com/mayswind/lab/pkg/models" "github.com/mayswind/ezbookkeeping/pkg/models"
"github.com/mayswind/lab/pkg/utils" "github.com/mayswind/ezbookkeeping/pkg/utils"
"github.com/mayswind/lab/pkg/validators" "github.com/mayswind/ezbookkeeping/pkg/validators"
) )
const nationalBankOfPolandDailyExchangeRateUrl = "https://www.nbp.pl/kursy/xml/en/lastaen.xml" const nationalBankOfPolandDailyExchangeRateUrl = "https://www.nbp.pl/kursy/xml/en/lastaen.xml"
@@ -6,8 +6,8 @@ import (
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/mayswind/lab/pkg/core" "github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/lab/pkg/models" "github.com/mayswind/ezbookkeeping/pkg/models"
) )
const nationalBankOfPolandMinimumRequiredContent = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n" + const nationalBankOfPolandMinimumRequiredContent = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n" +
@@ -4,12 +4,12 @@ import (
"encoding/xml" "encoding/xml"
"time" "time"
"github.com/mayswind/lab/pkg/core" "github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/lab/pkg/errs" "github.com/mayswind/ezbookkeeping/pkg/errs"
"github.com/mayswind/lab/pkg/log" "github.com/mayswind/ezbookkeeping/pkg/log"
"github.com/mayswind/lab/pkg/models" "github.com/mayswind/ezbookkeeping/pkg/models"
"github.com/mayswind/lab/pkg/utils" "github.com/mayswind/ezbookkeeping/pkg/utils"
"github.com/mayswind/lab/pkg/validators" "github.com/mayswind/ezbookkeeping/pkg/validators"
) )
const reserveBankOfAustraliaExchangeRateUrl = "https://www.rba.gov.au/rss/rss-cb-exchange-rates.xml" 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/gin-gonic/gin"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/mayswind/lab/pkg/core" "github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/lab/pkg/models" "github.com/mayswind/ezbookkeeping/pkg/models"
) )
const reserveBankOfAustraliaMinimumRequiredContent = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + const reserveBankOfAustraliaMinimumRequiredContent = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
+2 -2
View File
@@ -5,8 +5,8 @@ import (
"strings" "strings"
"time" "time"
"github.com/mayswind/lab/pkg/models" "github.com/mayswind/ezbookkeeping/pkg/models"
"github.com/mayswind/lab/pkg/utils" "github.com/mayswind/ezbookkeeping/pkg/utils"
) )
// CSVFileExporter defines the structure of csv file exporter // CSVFileExporter defines the structure of csv file exporter
+1 -1
View File
@@ -3,7 +3,7 @@ package exporters
import ( import (
"time" "time"
"github.com/mayswind/lab/pkg/models" "github.com/mayswind/ezbookkeeping/pkg/models"
) )
// DataExporter defines the structure of data exporter // DataExporter defines the structure of data exporter
+1 -1
View File
@@ -8,7 +8,7 @@ import (
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
"github.com/mayswind/lab/pkg/utils" "github.com/mayswind/ezbookkeeping/pkg/utils"
) )
// LogFormatter represents a log formatter // LogFormatter represents a log formatter
+2 -2
View File
@@ -8,8 +8,8 @@ import (
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
"github.com/mayswind/lab/pkg/core" "github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/lab/pkg/settings" "github.com/mayswind/ezbookkeeping/pkg/settings"
) )
const logFieldRequestId = "REQUEST_ID" const logFieldRequestId = "REQUEST_ID"
+5 -5
View File
@@ -3,11 +3,11 @@ package middlewares
import ( import (
"time" "time"
"github.com/mayswind/lab/pkg/core" "github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/lab/pkg/errs" "github.com/mayswind/ezbookkeeping/pkg/errs"
"github.com/mayswind/lab/pkg/log" "github.com/mayswind/ezbookkeeping/pkg/log"
"github.com/mayswind/lab/pkg/services" "github.com/mayswind/ezbookkeeping/pkg/services"
"github.com/mayswind/lab/pkg/utils" "github.com/mayswind/ezbookkeeping/pkg/utils"
) )
const tokenQueryStringParam = "token" const tokenQueryStringParam = "token"
+1 -1
View File
@@ -1,7 +1,7 @@
package middlewares package middlewares
import ( import (
"github.com/mayswind/lab/pkg/core" "github.com/mayswind/ezbookkeeping/pkg/core"
) )
const utcOffsetQueryStringParam = "utc_offset" const utcOffsetQueryStringParam = "utc_offset"
+4 -4
View File
@@ -6,10 +6,10 @@ import (
"io/ioutil" "io/ioutil"
"runtime" "runtime"
"github.com/mayswind/lab/pkg/core" "github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/lab/pkg/errs" "github.com/mayswind/ezbookkeeping/pkg/errs"
"github.com/mayswind/lab/pkg/log" "github.com/mayswind/ezbookkeeping/pkg/log"
"github.com/mayswind/lab/pkg/utils" "github.com/mayswind/ezbookkeeping/pkg/utils"
) )
var ( var (
+3 -3
View File
@@ -1,9 +1,9 @@
package middlewares package middlewares
import ( import (
"github.com/mayswind/lab/pkg/core" "github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/lab/pkg/requestid" "github.com/mayswind/ezbookkeeping/pkg/requestid"
"github.com/mayswind/lab/pkg/settings" "github.com/mayswind/ezbookkeeping/pkg/settings"
) )
const requestIdHeader = "X-Request-ID" const requestIdHeader = "X-Request-ID"
+2 -2
View File
@@ -3,8 +3,8 @@ package middlewares
import ( import (
"time" "time"
"github.com/mayswind/lab/pkg/core" "github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/lab/pkg/log" "github.com/mayswind/ezbookkeeping/pkg/log"
) )
// RequestLog logs the http request log // RequestLog logs the http request log
+3 -3
View File
@@ -4,11 +4,11 @@ import (
"fmt" "fmt"
"strings" "strings"
"github.com/mayswind/lab/pkg/core" "github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/lab/pkg/settings" "github.com/mayswind/ezbookkeeping/pkg/settings"
) )
const settingsCookieName = "lab_server_settings" const settingsCookieName = "ebk_server_settings"
// ServerSettingsCookie adds server settings to cookies in response // ServerSettingsCookie adds server settings to cookies in response
func ServerSettingsCookie(config *settings.Config) core.MiddlewareHandlerFunc { func ServerSettingsCookie(config *settings.Config) core.MiddlewareHandlerFunc {
+1 -1
View File
@@ -1,6 +1,6 @@
package models 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 // TokenMaxUserAgentLength represents the maximum size of user agent stored in database
const TokenMaxUserAgentLength = 255 const TokenMaxUserAgentLength = 255
+2 -2
View File
@@ -5,8 +5,8 @@ import (
"strings" "strings"
"time" "time"
"github.com/mayswind/lab/pkg/errs" "github.com/mayswind/ezbookkeeping/pkg/errs"
"github.com/mayswind/lab/pkg/utils" "github.com/mayswind/ezbookkeeping/pkg/utils"
) )
// TransactionType represents transaction type // TransactionType represents transaction type
+1 -1
View File
@@ -3,7 +3,7 @@ package models
import ( import (
"time" "time"
"github.com/mayswind/lab/pkg/utils" "github.com/mayswind/ezbookkeeping/pkg/utils"
) )
// WeekDay represents week day // WeekDay represents week day
@@ -11,10 +11,10 @@ import (
"sync/atomic" "sync/atomic"
"time" "time"
"github.com/mayswind/lab/pkg/errs" "github.com/mayswind/ezbookkeeping/pkg/errs"
"github.com/mayswind/lab/pkg/log" "github.com/mayswind/ezbookkeeping/pkg/log"
"github.com/mayswind/lab/pkg/settings" "github.com/mayswind/ezbookkeeping/pkg/settings"
"github.com/mayswind/lab/pkg/utils" "github.com/mayswind/ezbookkeeping/pkg/utils"
) )
// Length and mask of all information in request id // Length and mask of all information in request id
@@ -5,7 +5,7 @@ import (
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/mayswind/lab/pkg/settings" "github.com/mayswind/ezbookkeeping/pkg/settings"
) )
func TestNewDefaultRequestIdGenerator_Http(t *testing.T) { func TestNewDefaultRequestIdGenerator_Http(t *testing.T) {
@@ -23,7 +23,7 @@ func TestNewDefaultRequestIdGenerator_Http(t *testing.T) {
} }
func TestNewDefaultRequestIdGenerator_UnixSocket(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") requestId := generator.GenerateRequestId("127.0.0.1")
requestIdInfo := generator.parseRequestIdInfo(generator.parseRequestIdFromUuid(requestId)) requestIdInfo := generator.parseRequestIdInfo(generator.parseRequestIdFromUuid(requestId))
@@ -31,13 +31,13 @@ func TestNewDefaultRequestIdGenerator_UnixSocket(t *testing.T) {
actualServerUniqId := requestIdInfo.ServerUniqId actualServerUniqId := requestIdInfo.ServerUniqId
assert.Equal(t, expectedServerUniqId, actualServerUniqId) 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 actualInstanceUniqId := requestIdInfo.InstanceUniqId
assert.Equal(t, expectedInstanceUniqId, actualInstanceUniqId) assert.Equal(t, expectedInstanceUniqId, actualInstanceUniqId)
} }
func TestNewDefaultRequestIdGenerator_ClientIpv4(t *testing.T) { 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") requestId := generator.GenerateRequestId("127.0.0.1")
requestIdInfo := generator.parseRequestIdInfo(generator.parseRequestIdFromUuid(requestId)) requestIdInfo := generator.parseRequestIdInfo(generator.parseRequestIdFromUuid(requestId))
@@ -62,7 +62,7 @@ func TestNewDefaultRequestIdGenerator_ClientIpv4(t *testing.T) {
} }
func TestNewDefaultRequestIdGenerator_ClientIpv6(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") requestId := generator.GenerateRequestId("2001:abc:def:1234::1")
requestIdInfo := generator.parseRequestIdInfo(generator.parseRequestIdFromUuid(requestId)) requestIdInfo := generator.parseRequestIdInfo(generator.parseRequestIdFromUuid(requestId))
+1 -1
View File
@@ -1,7 +1,7 @@
package requestid package requestid
import ( import (
"github.com/mayswind/lab/pkg/settings" "github.com/mayswind/ezbookkeeping/pkg/settings"
) )
// RequestIdContainer contains the current request id generator // RequestIdContainer contains the current request id generator
+5 -5
View File
@@ -1,15 +1,15 @@
package services package services
import ( import (
"github.com/mayswind/lab/pkg/utils"
"time" "time"
"xorm.io/xorm" "xorm.io/xorm"
"github.com/mayswind/lab/pkg/datastore" "github.com/mayswind/ezbookkeeping/pkg/datastore"
"github.com/mayswind/lab/pkg/errs" "github.com/mayswind/ezbookkeeping/pkg/errs"
"github.com/mayswind/lab/pkg/models" "github.com/mayswind/ezbookkeeping/pkg/models"
"github.com/mayswind/lab/pkg/uuid" "github.com/mayswind/ezbookkeeping/pkg/utils"
"github.com/mayswind/ezbookkeeping/pkg/uuid"
) )
// AccountService represents account service // AccountService represents account service
+3 -3
View File
@@ -1,9 +1,9 @@
package services package services
import ( import (
"github.com/mayswind/lab/pkg/datastore" "github.com/mayswind/ezbookkeeping/pkg/datastore"
"github.com/mayswind/lab/pkg/settings" "github.com/mayswind/ezbookkeeping/pkg/settings"
"github.com/mayswind/lab/pkg/uuid" "github.com/mayswind/ezbookkeeping/pkg/uuid"
) )
// ServiceUsingDB represents a service that need to use db // ServiceUsingDB represents a service that need to use db
+7 -7
View File
@@ -10,13 +10,13 @@ import (
"github.com/dgrijalva/jwt-go/request" "github.com/dgrijalva/jwt-go/request"
"xorm.io/xorm" "xorm.io/xorm"
"github.com/mayswind/lab/pkg/core" "github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/lab/pkg/datastore" "github.com/mayswind/ezbookkeeping/pkg/datastore"
"github.com/mayswind/lab/pkg/errs" "github.com/mayswind/ezbookkeeping/pkg/errs"
"github.com/mayswind/lab/pkg/log" "github.com/mayswind/ezbookkeeping/pkg/log"
"github.com/mayswind/lab/pkg/models" "github.com/mayswind/ezbookkeeping/pkg/models"
"github.com/mayswind/lab/pkg/settings" "github.com/mayswind/ezbookkeeping/pkg/settings"
"github.com/mayswind/lab/pkg/utils" "github.com/mayswind/ezbookkeeping/pkg/utils"
) )
// TokenService represents user token service // TokenService represents user token service
+4 -4
View File
@@ -5,10 +5,10 @@ import (
"xorm.io/xorm" "xorm.io/xorm"
"github.com/mayswind/lab/pkg/datastore" "github.com/mayswind/ezbookkeeping/pkg/datastore"
"github.com/mayswind/lab/pkg/errs" "github.com/mayswind/ezbookkeeping/pkg/errs"
"github.com/mayswind/lab/pkg/models" "github.com/mayswind/ezbookkeeping/pkg/models"
"github.com/mayswind/lab/pkg/uuid" "github.com/mayswind/ezbookkeeping/pkg/uuid"
) )
// TransactionCategoryService represents transaction category service // TransactionCategoryService represents transaction category service
+4 -4
View File
@@ -5,10 +5,10 @@ import (
"xorm.io/xorm" "xorm.io/xorm"
"github.com/mayswind/lab/pkg/datastore" "github.com/mayswind/ezbookkeeping/pkg/datastore"
"github.com/mayswind/lab/pkg/errs" "github.com/mayswind/ezbookkeeping/pkg/errs"
"github.com/mayswind/lab/pkg/models" "github.com/mayswind/ezbookkeeping/pkg/models"
"github.com/mayswind/lab/pkg/uuid" "github.com/mayswind/ezbookkeeping/pkg/uuid"
) )
// TransactionTagService represents transaction tag service // TransactionTagService represents transaction tag service
+5 -5
View File
@@ -7,11 +7,11 @@ import (
"xorm.io/xorm" "xorm.io/xorm"
"github.com/mayswind/lab/pkg/datastore" "github.com/mayswind/ezbookkeeping/pkg/datastore"
"github.com/mayswind/lab/pkg/errs" "github.com/mayswind/ezbookkeeping/pkg/errs"
"github.com/mayswind/lab/pkg/models" "github.com/mayswind/ezbookkeeping/pkg/models"
"github.com/mayswind/lab/pkg/utils" "github.com/mayswind/ezbookkeeping/pkg/utils"
"github.com/mayswind/lab/pkg/uuid" "github.com/mayswind/ezbookkeeping/pkg/uuid"
) )
// TransactionService represents transaction service // TransactionService represents transaction service
+6 -6
View File
@@ -7,12 +7,12 @@ import (
"github.com/pquerna/otp/totp" "github.com/pquerna/otp/totp"
"xorm.io/xorm" "xorm.io/xorm"
"github.com/mayswind/lab/pkg/datastore" "github.com/mayswind/ezbookkeeping/pkg/datastore"
"github.com/mayswind/lab/pkg/errs" "github.com/mayswind/ezbookkeeping/pkg/errs"
"github.com/mayswind/lab/pkg/models" "github.com/mayswind/ezbookkeeping/pkg/models"
"github.com/mayswind/lab/pkg/settings" "github.com/mayswind/ezbookkeeping/pkg/settings"
"github.com/mayswind/lab/pkg/utils" "github.com/mayswind/ezbookkeeping/pkg/utils"
"github.com/mayswind/lab/pkg/uuid" "github.com/mayswind/ezbookkeeping/pkg/uuid"
) )
const ( const (
+5 -5
View File
@@ -5,11 +5,11 @@ import (
"xorm.io/xorm" "xorm.io/xorm"
"github.com/mayswind/lab/pkg/datastore" "github.com/mayswind/ezbookkeeping/pkg/datastore"
"github.com/mayswind/lab/pkg/errs" "github.com/mayswind/ezbookkeeping/pkg/errs"
"github.com/mayswind/lab/pkg/models" "github.com/mayswind/ezbookkeeping/pkg/models"
"github.com/mayswind/lab/pkg/utils" "github.com/mayswind/ezbookkeeping/pkg/utils"
"github.com/mayswind/lab/pkg/uuid" "github.com/mayswind/ezbookkeeping/pkg/uuid"
) )
// UserService represents user service // UserService represents user service
+9 -9
View File
@@ -10,13 +10,13 @@ import (
"gopkg.in/ini.v1" "gopkg.in/ini.v1"
"github.com/mayswind/lab/pkg/errs" "github.com/mayswind/ezbookkeeping/pkg/errs"
) )
const ( const (
labWorkDirEnvName = "LAB_WORK_DIR" ebkWorkDirEnvName = "EBK_WORK_DIR"
labEnvNamePrefix = "LAB" ebkEnvNamePrefix = "EBK"
defaultConfigPath = "/conf/lab.ini" defaultConfigPath = "/conf/ezbookkeeping.ini"
defaultStaticRootPath = "public" defaultStaticRootPath = "public"
) )
@@ -72,14 +72,14 @@ const (
) )
const ( const (
defaultAppName string = "lab" defaultAppName string = "ezBookkeeping"
defaultHttpAddr string = "0.0.0.0" defaultHttpAddr string = "0.0.0.0"
defaultHttpPort int = 8080 defaultHttpPort int = 8080
defaultDomain string = "localhost" defaultDomain string = "localhost"
defaultDatabaseHost string = "127.0.0.1:3306" defaultDatabaseHost string = "127.0.0.1:3306"
defaultDatabaseName string = "lab" defaultDatabaseName string = "ezbookkeeping"
defaultDatabaseMaxIdleConn int = 2 defaultDatabaseMaxIdleConn int = 2
defaultDatabaseMaxOpenConn int = 0 defaultDatabaseMaxOpenConn int = 0
defaultDatabaseConnMaxLifetime int = 14400 defaultDatabaseConnMaxLifetime int = 14400
@@ -87,7 +87,7 @@ const (
defaultLogMode string = "console" defaultLogMode string = "console"
defaultLoglevel Level = LOGLEVEL_INFO defaultLoglevel Level = LOGLEVEL_INFO
defaultSecretKey string = "lab" defaultSecretKey string = "ezbookkeeping"
defaultTokenExpiredTime int = 604800 // 7 days defaultTokenExpiredTime int = 604800 // 7 days
defaultTemporaryTokenExpiredTime int = 300 // 5 minutes defaultTemporaryTokenExpiredTime int = 300 // 5 minutes
@@ -434,7 +434,7 @@ func loadExchangeRatesConfiguration(config *Config, configFile *ini.File, sectio
} }
func getWorkingPath() (string, error) { func getWorkingPath() (string, error) {
workingPath := os.Getenv(labWorkDirEnvName) workingPath := os.Getenv(ebkWorkDirEnvName)
if workingPath != "" { if workingPath != "" {
return workingPath, nil return workingPath, nil
@@ -513,7 +513,7 @@ func getConfigItemBoolValue(configFile *ini.File, sectionName string, itemName s
} }
func getEnvironmentKey(sectionName string, itemName string) string { 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 { func getLogLevel(logLevelStr string, defaultLogLevel Level) Level {
+2 -2
View File
@@ -7,8 +7,8 @@ import (
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/go-playground/validator/v10" "github.com/go-playground/validator/v10"
"github.com/mayswind/lab/pkg/core" "github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/lab/pkg/errs" "github.com/mayswind/ezbookkeeping/pkg/errs"
) )
// PrintJsonSuccessResult writes success response in json format to current http context // PrintJsonSuccessResult writes success response in json format to current http context
+1 -1
View File
@@ -4,7 +4,7 @@ import (
"bytes" "bytes"
"net" "net"
"github.com/mayswind/lab/pkg/errs" "github.com/mayswind/ezbookkeeping/pkg/errs"
) )
// GetLocalIPAddressesString returns all local ip address, every ip split by comma // GetLocalIPAddressesString returns all local ip address, every ip split by comma
+4 -3
View File
@@ -1,15 +1,16 @@
package utils package utils
import ( import (
"github.com/stretchr/testify/assert"
"testing" "testing"
"github.com/mayswind/lab/pkg/settings" "github.com/stretchr/testify/assert"
"github.com/mayswind/ezbookkeeping/pkg/settings"
) )
func TestClone(t *testing.T) { func TestClone(t *testing.T) {
expectedObject := &settings.Config{ expectedObject := &settings.Config{
AppName: "lab", AppName: "ezbookkeeping",
Mode: settings.MODE_PRODUCTION, Mode: settings.MODE_PRODUCTION,
DatabaseConfig: &settings.DatabaseConfig{ DatabaseConfig: &settings.DatabaseConfig{
DatabaseType: settings.MySqlDbType, DatabaseType: settings.MySqlDbType,
+1 -1
View File
@@ -12,7 +12,7 @@ import (
"golang.org/x/crypto/pbkdf2" "golang.org/x/crypto/pbkdf2"
"github.com/mayswind/lab/pkg/errs" "github.com/mayswind/ezbookkeeping/pkg/errs"
) )
const ( const (
+1 -1
View File
@@ -4,7 +4,7 @@ import (
"sync/atomic" "sync/atomic"
"time" "time"
"github.com/mayswind/lab/pkg/settings" "github.com/mayswind/ezbookkeeping/pkg/settings"
) )
// Length and mask of all information in uuid // Length and mask of all information in uuid
+1 -1
View File
@@ -8,7 +8,7 @@ import (
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/mayswind/lab/pkg/settings" "github.com/mayswind/ezbookkeeping/pkg/settings"
) )
func TestGenerateUuid(t *testing.T) { func TestGenerateUuid(t *testing.T) {
+2 -2
View File
@@ -1,8 +1,8 @@
package uuid package uuid
import ( import (
"github.com/mayswind/lab/pkg/errs" "github.com/mayswind/ezbookkeeping/pkg/errs"
"github.com/mayswind/lab/pkg/settings" "github.com/mayswind/ezbookkeeping/pkg/settings"
) )
// UuidContainer contains the current uuid generator // UuidContainer contains the current uuid generator
+1 -1
View File
@@ -3,7 +3,7 @@ package validators
import ( import (
"github.com/go-playground/validator/v10" "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 // ValidEmail returns whether the given email is valid
+1 -1
View File
@@ -3,7 +3,7 @@ package validators
import ( import (
"github.com/go-playground/validator/v10" "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 // ValidHexRGBColor returns whether the given hex reb color is valid
+1 -1
View File
@@ -3,7 +3,7 @@ package validators
import ( import (
"github.com/go-playground/validator/v10" "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 // ValidUsername returns whether the given user name is valid
+1 -1
View File
@@ -4,7 +4,7 @@ import (
"fmt" "fmt"
"strings" "strings"
"github.com/mayswind/lab/pkg/utils" "github.com/mayswind/ezbookkeeping/pkg/utils"
) )
var ( 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 { return {
f7params: { f7params: {
name: 'lab', name: 'ezBookkeeping',
id: 'net.mayswind.lab', id: 'net.mayswind.ezbookkeeping',
theme: 'ios', theme: 'ios',
autoDarkTheme: self.$settings.isEnableAutoDarkMode(), autoDarkTheme: self.$settings.isEnableAutoDarkMode(),
routes: routes, 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)); 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) color: var(--f7-input-error-text-color)
} }
</style> </style>
+8 -8
View File
@@ -3,34 +3,34 @@ import settings from './settings.js';
function logDebug(msg, obj) { function logDebug(msg, obj) {
if (settings.isEnableDebug()) { if (settings.isEnableDebug()) {
if (obj) { if (obj) {
console.debug('[lab Debug] ' + msg, obj); console.debug('[ezBookkeeping Debug] ' + msg, obj);
} else { } else {
console.debug('[lab Debug] ' + msg); console.debug('[ezBookkeeping Debug] ' + msg);
} }
} }
} }
function logInfo(msg, obj) { function logInfo(msg, obj) {
if (obj) { if (obj) {
console.info('[lab Info] ' + msg, obj); console.info('[ezBookkeeping Info] ' + msg, obj);
} else { } else {
console.info('[lab Info] ' + msg); console.info('[ezBookkeeping Info] ' + msg);
} }
} }
function logWarn(msg, obj) { function logWarn(msg, obj) {
if (obj) { if (obj) {
console.warn('[lab Warn] ' + msg, obj); console.warn('[ezBookkeeping Warn] ' + msg, obj);
} else { } else {
console.warn('[lab Warn] ' + msg); console.warn('[ezBookkeeping Warn] ' + msg);
} }
} }
function logError(msg, obj) { function logError(msg, obj) {
if (obj) { if (obj) {
console.error('[lab Error] ' + msg, obj); console.error('[ezBookkeeping Error] ' + msg, obj);
} else { } 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 currencyConstants from '../consts/currency.js';
import statisticsConstants from '../consts/statistics.js'; import statisticsConstants from '../consts/statistics.js';
const settingsLocalStorageKey = 'lab_app_settings'; const settingsLocalStorageKey = 'ebk_app_settings';
const serverSettingsCookieKey = 'lab_server_settings'; const serverSettingsCookieKey = 'ebk_server_settings';
const defaultSettings = { const defaultSettings = {
lang: 'en', lang: 'en',
+6 -6
View File
@@ -3,14 +3,14 @@ import CryptoJS from 'crypto-js';
import settings from './settings.js'; import settings from './settings.js';
import utils from './utils.js'; import utils from './utils.js';
const appLockSecretBaseStringPrefix = 'LAB_LOCK_SECRET_'; const appLockSecretBaseStringPrefix = 'EBK_LOCK_SECRET_';
const tokenLocalStorageKey = 'lab_user_token'; const tokenLocalStorageKey = 'ebk_user_token';
const webauthnConfigLocalStorageKey = 'lab_user_webauthn_config'; const webauthnConfigLocalStorageKey = 'ebk_user_webauthn_config';
const userInfoLocalStorageKey = 'lab_user_info'; const userInfoLocalStorageKey = 'ebk_user_info';
const tokenSessionStorageKey = 'lab_user_session_token'; const tokenSessionStorageKey = 'ebk_user_session_token';
const appLockStateSessionStorageKey = 'lab_user_app_lock_state'; // { 'username': '', secret: '' } const appLockStateSessionStorageKey = 'ebk_user_app_lock_state'; // { 'username': '', secret: '' }
function getAppLockSecret(pinCode) { function getAppLockSecret(pinCode) {
const hashedPinCode = CryptoJS.SHA256(appLockSecretBaseStringPrefix + pinCode).toString(); const hashedPinCode = CryptoJS.SHA256(appLockSecretBaseStringPrefix + pinCode).toString();
+1 -1
View File
@@ -512,7 +512,7 @@ function stringToArrayBuffer(str){
} }
function generateRandomString() { 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(); return CryptoJS.SHA256(baseString).toString();
} }
+1 -1
View File
@@ -1,7 +1,7 @@
export default { export default {
'global': { 'global': {
'app': { 'app': {
'title': 'lab account book', 'title': 'ezBookkeeping',
} }
}, },
'default': { 'default': {
+1 -1
View File
@@ -1,7 +1,7 @@
export default { export default {
'global': { 'global': {
'app': { 'app': {
'title': 'lab 轻记账', 'title': 'ezBookkeeping',
} }
}, },
'default': { 'default': {
+3 -3
View File
@@ -6,12 +6,12 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <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="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="format-detection" content="telephone=no"/>
<meta name="description" content="lab is a lightweight account book app hosted by yourself."> <meta name="description" content="ezBookkeeping is a lightweight personal bookkeeping app hosted by yourself.">
<title>lab</title> <title>ezBookkeeping</title>
</head> </head>
<body> <body>
<noscript> <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> </noscript>
<div id="app"></div> <div id="app"></div>
</body> </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="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="mobile-web-app-capable" content="yes">
<meta name="apple-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="apple-mobile-web-app-status-bar-style" content="default"/>
<meta name="theme-color" content="#c67e48"> <meta name="theme-color" content="#c67e48">
<meta name="format-detection" content="telephone=no"/> <meta name="format-detection" content="telephone=no"/>
<meta name="description" content="lab is a lightweight account book app hosted by yourself."> <meta name="description" content="ezBookkeeping is a lightweight personal bookkeeping app hosted by yourself.">
<title>lab</title> <title>ezBookkeeping</title>
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico"> <link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
<link rel="apple-touch-icon" href="touchicon.png"> <link rel="apple-touch-icon" href="touchicon.png">
<link rel="manifest" href="manifest.json"> <link rel="manifest" href="manifest.json">
</head> </head>
<body> <body>
<noscript> <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> </noscript>
<div id="app"></div> <div id="app"></div>
</body> </body>
+1 -1
View File
@@ -6,7 +6,7 @@ import {
STORE_LATEST_EXCHANGE_RATES STORE_LATEST_EXCHANGE_RATES
} from './mutations.js'; } from './mutations.js';
const exchangeRatesLocalStorageKey = 'lab_app_exchange_rates'; const exchangeRatesLocalStorageKey = 'ebk_app_exchange_rates';
export function getLatestExchangeRates(context, { silent, force }) { export function getLatestExchangeRates(context, { silent, force }) {
const currentExchangeRateData = context.state.latestExchangeRates; const currentExchangeRateData = context.state.latestExchangeRates;
+2 -3
View File
@@ -7,8 +7,7 @@
<f7-list> <f7-list>
<f7-list-item :title="$t('Version')" :after="version"></f7-list-item> <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 :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" <f7-list-item external :title="$t('Official Website')" link="https://github.com/mayswind/ezbookkeeping" target="_blank"></f7-list-item>
link="https://github.com/mayswind/lab" target="_blank"></f7-list-item>
<f7-list-item :title="$t('License')" link="#" popup-open=".license-popup"></f7-list-item> <f7-list-item :title="$t('License')" link="#" popup-open=".license-popup"></f7-list-item>
</f7-list> </f7-list>
</f7-card-content> </f7-card-content>
@@ -31,7 +30,7 @@
</p> </p>
<hr/> <hr/>
<p> <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> <span>All the third party software included or linked is redistributed under the terms and conditions of their original licenses.</span>
</p> </p>
<p></p> <p></p>
+2 -2
View File
@@ -153,7 +153,7 @@
<span class="tabbar-label">{{ $t('Accounts') }}</span> <span class="tabbar-label">{{ $t('Accounts') }}</span>
</f7-link> </f7-link>
<f7-link href="/transaction/add"> <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>
<f7-link href="/statistic/transaction"> <f7-link href="/statistic/transaction">
<f7-icon f7="chart_pie"></f7-icon> <f7-icon f7="chart_pie"></f7-icon>
@@ -352,7 +352,7 @@ export default {
margin-right: 4px; margin-right: 4px;
} }
.tabbar-labels i.lab-tarbar-big-icon { .tabbar-labels i.ebk-tarbar-big-icon {
font-size: 42px; font-size: 42px;
width: 42px; width: 42px;
height: 42px; height: 42px;
+2 -2
View File
@@ -1,7 +1,7 @@
<template> <template>
<f7-page no-toolbar no-navbar no-swipeback login-screen> <f7-page no-toolbar no-navbar no-swipeback login-screen>
<f7-login-screen-title> <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-block class="margin-vertical-half">{{ $t('global.app.title') }}</f7-block>
</f7-login-screen-title> </f7-login-screen-title>
<f7-list form> <f7-list form>
@@ -40,7 +40,7 @@
<f7-list> <f7-list>
<f7-block-footer> <f7-block-footer>
<span>Powered by </span> <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> <span>{{ version }}</span>
</f7-block-footer> </f7-block-footer>
<f7-block-footer> <f7-block-footer>
+1 -1
View File
@@ -61,7 +61,7 @@
@input="user.nickname = $event.target.value" @input="user.nickname = $event.target.value"
></f7-list-input> ></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-list>
</f7-card-content> </f7-card-content>
</f7-card> </f7-card>
+1 -1
View File
@@ -101,7 +101,7 @@
</select> </select>
</f7-list-item> </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-list>
</f7-card-content> </f7-card-content>
</f7-card> </f7-card>
+4 -4
View File
@@ -71,22 +71,22 @@ module.exports = {
}); });
}, },
pwa: { pwa: {
name: 'lab account book', name: 'ezBookkeeping',
themeColor: '#C67E48', themeColor: '#C67E48',
appleMobileWebAppCapable: 'yes', appleMobileWebAppCapable: 'yes',
appleMobileWebAppStatusBarStyle: 'default', appleMobileWebAppStatusBarStyle: 'default',
workboxPluginMode: 'GenerateSW', workboxPluginMode: 'GenerateSW',
manifestPath: 'manifest.json', manifestPath: 'manifest.json',
manifestOptions: { manifestOptions: {
short_name: 'lab', short_name: 'ezBookkeeping',
icons: [ icons: [
{ {
src: "img/lab-192.png", src: "img/ezbookkeeping-192.png",
sizes: "192x192", sizes: "192x192",
type: "image/png" type: "image/png"
}, },
{ {
src: "img/lab-512.png", src: "img/ezbookkeeping-512.png",
sizes: "512x512", sizes: "512x512",
type: "image/png" type: "image/png"
} }