From 62a825439f92af0461764cef4af6057bfcbf522c Mon Sep 17 00:00:00 2001 From: MaysWind Date: Sun, 11 Apr 2021 22:51:22 +0800 Subject: [PATCH] modify project name --- Dockerfile | 26 +++++++------- README.md | 34 +++++++++--------- build-docker.sh | 2 +- cmd/database.go | 8 ++--- cmd/initializer.go | 12 +++---- cmd/user_data.go | 8 ++--- cmd/webserver.go | 22 ++++++------ conf/{lab.ini => ezbookkeeping.ini} | 14 ++++---- docker/docker-entrypoint.sh | 6 ++-- etc/systemd/ezbookkeeping.service | 16 +++++++++ etc/systemd/labapp.service | 16 --------- lab.go => ezbookkeeping.go | 10 +++--- go.mod | 2 +- package-lock.json | 8 ++--- package.json | 11 +++++- pkg/api/accounts.go | 12 +++---- pkg/api/authorizations.go | 10 +++--- pkg/api/data_managements.go | 16 ++++----- pkg/api/default.go | 4 +-- pkg/api/exchange_rates.go | 12 +++---- pkg/api/tokens.go | 12 +++---- pkg/api/transaction_categories.go | 10 +++--- pkg/api/transaction_tags.go | 10 +++--- pkg/api/transactions.go | 12 +++---- pkg/api/twofactor_authorizations.go | 10 +++--- pkg/api/users.go | 14 ++++---- pkg/cli/user_data.go | 12 +++---- pkg/core/context.go | 2 +- pkg/core/handler.go | 2 +- pkg/datastore/datastore.go | 2 +- pkg/datastore/datastore_container.go | 4 +-- pkg/datastore/query_log.go | 4 +-- .../bank_of_canada_datasource.go | 12 +++---- .../bank_of_canada_datasource_test.go | 4 +-- .../czech_national_bank_datasource.go | 12 +++---- .../czech_national_bank_datasource_test.go | 4 +-- .../euro_central_bank_datasource.go | 12 +++---- .../euro_central_bank_datasource_test.go | 4 +-- .../exchange_rates_datasource.go | 4 +-- .../exchange_rates_datasource_container.go | 4 +-- .../national_bank_of_poland_datasource.go | 12 +++---- ...national_bank_of_poland_datasource_test.go | 4 +-- .../reserve_bank_of_australia_datasource.go | 12 +++---- ...serve_bank_of_australia_datasource_test.go | 4 +-- pkg/exporters/csv_file.go | 4 +-- pkg/exporters/data_exporter.go | 2 +- pkg/log/formatter.go | 2 +- pkg/log/logger.go | 4 +-- pkg/middlewares/authorization.go | 10 +++--- pkg/middlewares/header_in_query_string.go | 2 +- pkg/middlewares/recovery.go | 8 ++--- pkg/middlewares/request_id.go | 6 ++-- pkg/middlewares/request_log.go | 4 +-- pkg/middlewares/server_settings_cookie.go | 6 ++-- pkg/models/token_record.go | 2 +- pkg/models/transaction.go | 4 +-- pkg/models/user.go | 2 +- pkg/requestid/default_request_id_generator.go | 8 ++--- .../default_request_id_generator_test.go | 10 +++--- pkg/requestid/request_id_container.go | 2 +- pkg/services/accounts.go | 10 +++--- pkg/services/base.go | 6 ++-- pkg/services/tokens.go | 14 ++++---- pkg/services/transaction_categories.go | 8 ++--- pkg/services/transaction_tags.go | 8 ++--- pkg/services/transactions.go | 10 +++--- pkg/services/twofactor_authorizations.go | 12 +++---- pkg/services/users.go | 10 +++--- pkg/settings/setting.go | 18 +++++----- pkg/utils/api.go | 4 +-- pkg/utils/network.go | 2 +- pkg/utils/object_test.go | 7 ++-- pkg/utils/strings.go | 2 +- pkg/uuid/internal_generator.go | 2 +- pkg/uuid/internal_generator_test.go | 2 +- pkg/uuid/uuid_container.go | 4 +-- pkg/validators/email.go | 2 +- pkg/validators/hex_rgb_color.go | 2 +- pkg/validators/username.go | 2 +- pkg/version/version.go | 2 +- .../{lab-192.png => ezbookkeeping-192.png} | Bin .../{lab-512.png => ezbookkeeping-512.png} | Bin src/Mobile.vue | 6 ++-- src/lib/logger.js | 16 ++++----- src/lib/settings.js | 4 +-- src/lib/userstate.js | 12 +++---- src/lib/utils.js | 2 +- src/locales/en.js | 2 +- src/locales/zh_Hans.js | 2 +- src/public/desktop.html | 6 ++-- src/public/mobile.html | 8 ++--- src/store/exchangeRates.js | 2 +- src/views/mobile/About.vue | 5 ++- src/views/mobile/Home.vue | 4 +-- src/views/mobile/Login.vue | 4 +-- src/views/mobile/Signup.vue | 2 +- src/views/mobile/users/UserProfile.vue | 2 +- vue.config.js | 8 ++--- 98 files changed, 364 insertions(+), 355 deletions(-) rename conf/{lab.ini => ezbookkeeping.ini} (91%) create mode 100644 etc/systemd/ezbookkeeping.service delete mode 100644 etc/systemd/labapp.service rename lab.go => ezbookkeeping.go (59%) rename public/img/{lab-192.png => ezbookkeeping-192.png} (100%) rename public/img/{lab-512.png => ezbookkeeping-512.png} (100%) diff --git a/Dockerfile b/Dockerfile index 5fb4763f..f5b84f36 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 " -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"] diff --git a/README.md b/README.md index 374e1e19..a6d3b3dd 100644 --- a/README.md +++ b/README.md @@ -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://:8080/ . +ezBookkeeping will listen at port 8080 as default. Then you can visit http://: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 /lab + $ cp ezbookkeeping /ezbookkeeping $ cp -R dist /public $ cp -R conf /conf All the files will be placed in `` 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) diff --git a/build-docker.sh b/build-docker.sh index e9b60d28..80d539ea 100755 --- a/build-docker.sh +++ b/build-docker.sh @@ -8,4 +8,4 @@ if [ "$mode" == "--snapshot" ]; then fi echo "Building docker image..."; -docker build -t lab:${version} . +docker build -t ezbookkeeping:${version} . diff --git a/cmd/database.go b/cmd/database.go index 6bef1089..d198f865 100644 --- a/cmd/database.go +++ b/cmd/database.go @@ -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", diff --git a/cmd/initializer.go b/cmd/initializer.go index 6a155860..d9ad7951 100644 --- a/cmd/initializer.go +++ b/cmd/initializer.go @@ -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) { diff --git a/cmd/user_data.go b/cmd/user_data.go index 7ec61898..8846e622 100644 --- a/cmd/user_data.go +++ b/cmd/user_data.go @@ -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", diff --git a/cmd/webserver.go b/cmd/webserver.go index 2b8fa6d3..f8796779 100644 --- a/cmd/webserver.go +++ b/cmd/webserver.go @@ -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, }, }, diff --git a/conf/lab.ini b/conf/ezbookkeeping.ini similarity index 91% rename from conf/lab.ini rename to conf/ezbookkeeping.ini index 3b22a3b4..c8b18b80 100644 --- a/conf/lab.ini +++ b/conf/ezbookkeeping.ini @@ -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 diff --git a/docker/docker-entrypoint.sh b/docker/docker-entrypoint.sh index a9c5bda0..7d0e10b1 100755 --- a/docker/docker-entrypoint.sh +++ b/docker/docker-entrypoint.sh @@ -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 diff --git a/etc/systemd/ezbookkeeping.service b/etc/systemd/ezbookkeeping.service new file mode 100644 index 00000000..0dcf1218 --- /dev/null +++ b/etc/systemd/ezbookkeeping.service @@ -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 diff --git a/etc/systemd/labapp.service b/etc/systemd/labapp.service deleted file mode 100644 index 399cde9e..00000000 --- a/etc/systemd/labapp.service +++ /dev/null @@ -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 diff --git a/lab.go b/ezbookkeeping.go similarity index 59% rename from lab.go rename to ezbookkeeping.go index 588b144f..65a973b0 100644 --- a/lab.go +++ b/ezbookkeeping.go @@ -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) } } diff --git a/go.mod b/go.mod index a32129f9..7f8146d4 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/mayswind/lab +module github.com/mayswind/ezbookkeeping go 1.14 diff --git a/package-lock.json b/package-lock.json index eb1d8409..1792f446 100644 --- a/package-lock.json +++ b/package-lock.json @@ -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": { diff --git a/package.json b/package.json index baada957..7990d6f0 100644 --- a/package.json +++ b/package.json @@ -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 ", + "license": "MIT", + "bugs": { + "url": "https://github.com/mayswind/ezbookkeeping/issues" + }, "scripts": { "serve": "vue-cli-service serve", "build": "vue-cli-service build", diff --git a/pkg/api/accounts.go b/pkg/api/accounts.go index 4dc9a8c1..e473acc5 100644 --- a/pkg/api/accounts.go +++ b/pkg/api/accounts.go @@ -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 diff --git a/pkg/api/authorizations.go b/pkg/api/authorizations.go index 529ade05..3c474dd3 100644 --- a/pkg/api/authorizations.go +++ b/pkg/api/authorizations.go @@ -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 diff --git a/pkg/api/data_managements.go b/pkg/api/data_managements.go index 6be70bc0..37334fe0 100644 --- a/pkg/api/data_managements.go +++ b/pkg/api/data_managements.go @@ -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 diff --git a/pkg/api/default.go b/pkg/api/default.go index a40da522..66d73d10 100644 --- a/pkg/api/default.go +++ b/pkg/api/default.go @@ -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 diff --git a/pkg/api/exchange_rates.go b/pkg/api/exchange_rates.go index d3a25a63..019341ca 100644 --- a/pkg/api/exchange_rates.go +++ b/pkg/api/exchange_rates.go @@ -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 diff --git a/pkg/api/tokens.go b/pkg/api/tokens.go index d4c01ef0..d02a578e 100644 --- a/pkg/api/tokens.go +++ b/pkg/api/tokens.go @@ -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 diff --git a/pkg/api/transaction_categories.go b/pkg/api/transaction_categories.go index 396e313b..450695c7 100644 --- a/pkg/api/transaction_categories.go +++ b/pkg/api/transaction_categories.go @@ -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 diff --git a/pkg/api/transaction_tags.go b/pkg/api/transaction_tags.go index b41f6cb9..99dc9b14 100644 --- a/pkg/api/transaction_tags.go +++ b/pkg/api/transaction_tags.go @@ -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 diff --git a/pkg/api/transactions.go b/pkg/api/transactions.go index 096458be..30612a46 100644 --- a/pkg/api/transactions.go +++ b/pkg/api/transactions.go @@ -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 diff --git a/pkg/api/twofactor_authorizations.go b/pkg/api/twofactor_authorizations.go index d6fddae7..9fa159c8 100644 --- a/pkg/api/twofactor_authorizations.go +++ b/pkg/api/twofactor_authorizations.go @@ -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 diff --git a/pkg/api/users.go b/pkg/api/users.go index 76803709..44479cc7 100644 --- a/pkg/api/users.go +++ b/pkg/api/users.go @@ -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 diff --git a/pkg/cli/user_data.go b/pkg/cli/user_data.go index bafcde10..509ee9b1 100644 --- a/pkg/cli/user_data.go +++ b/pkg/cli/user_data.go @@ -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 diff --git a/pkg/core/context.go b/pkg/core/context.go index 5a679f58..0621fc74 100644 --- a/pkg/core/context.go +++ b/pkg/core/context.go @@ -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" diff --git a/pkg/core/handler.go b/pkg/core/handler.go index a82ecd2d..e6804c04 100644 --- a/pkg/core/handler.go +++ b/pkg/core/handler.go @@ -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) diff --git a/pkg/datastore/datastore.go b/pkg/datastore/datastore.go index a9a18ea4..f7f7e61b 100644 --- a/pkg/datastore/datastore.go +++ b/pkg/datastore/datastore.go @@ -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 diff --git a/pkg/datastore/datastore_container.go b/pkg/datastore/datastore_container.go index 58388b5b..a4536374 100644 --- a/pkg/datastore/datastore_container.go +++ b/pkg/datastore/datastore_container.go @@ -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 diff --git a/pkg/datastore/query_log.go b/pkg/datastore/query_log.go index 954fbeb2..cee670b4 100644 --- a/pkg/datastore/query_log.go +++ b/pkg/datastore/query_log.go @@ -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 diff --git a/pkg/exchangerates/bank_of_canada_datasource.go b/pkg/exchangerates/bank_of_canada_datasource.go index 7d0566a2..e67ea8f7 100644 --- a/pkg/exchangerates/bank_of_canada_datasource.go +++ b/pkg/exchangerates/bank_of_canada_datasource.go @@ -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" diff --git a/pkg/exchangerates/bank_of_canada_datasource_test.go b/pkg/exchangerates/bank_of_canada_datasource_test.go index bbc5318b..ddc1d201 100644 --- a/pkg/exchangerates/bank_of_canada_datasource_test.go +++ b/pkg/exchangerates/bank_of_canada_datasource_test.go @@ -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" + diff --git a/pkg/exchangerates/czech_national_bank_datasource.go b/pkg/exchangerates/czech_national_bank_datasource.go index 435978c0..ee52366f 100644 --- a/pkg/exchangerates/czech_national_bank_datasource.go +++ b/pkg/exchangerates/czech_national_bank_datasource.go @@ -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" diff --git a/pkg/exchangerates/czech_national_bank_datasource_test.go b/pkg/exchangerates/czech_national_bank_datasource_test.go index 64d908f2..ebefb530 100644 --- a/pkg/exchangerates/czech_national_bank_datasource_test.go +++ b/pkg/exchangerates/czech_national_bank_datasource_test.go @@ -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" + diff --git a/pkg/exchangerates/euro_central_bank_datasource.go b/pkg/exchangerates/euro_central_bank_datasource.go index 1b18f1ab..3a81e388 100644 --- a/pkg/exchangerates/euro_central_bank_datasource.go +++ b/pkg/exchangerates/euro_central_bank_datasource.go @@ -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" diff --git a/pkg/exchangerates/euro_central_bank_datasource_test.go b/pkg/exchangerates/euro_central_bank_datasource_test.go index eb4143fd..ef61e910 100644 --- a/pkg/exchangerates/euro_central_bank_datasource_test.go +++ b/pkg/exchangerates/euro_central_bank_datasource_test.go @@ -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 = "\n" + diff --git a/pkg/exchangerates/exchange_rates_datasource.go b/pkg/exchangerates/exchange_rates_datasource.go index f78f19de..db8e54d8 100644 --- a/pkg/exchangerates/exchange_rates_datasource.go +++ b/pkg/exchangerates/exchange_rates_datasource.go @@ -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 diff --git a/pkg/exchangerates/exchange_rates_datasource_container.go b/pkg/exchangerates/exchange_rates_datasource_container.go index 717c2e34..fd26323f 100644 --- a/pkg/exchangerates/exchange_rates_datasource_container.go +++ b/pkg/exchangerates/exchange_rates_datasource_container.go @@ -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 diff --git a/pkg/exchangerates/national_bank_of_poland_datasource.go b/pkg/exchangerates/national_bank_of_poland_datasource.go index 17061efe..d3b7cb41 100644 --- a/pkg/exchangerates/national_bank_of_poland_datasource.go +++ b/pkg/exchangerates/national_bank_of_poland_datasource.go @@ -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" diff --git a/pkg/exchangerates/national_bank_of_poland_datasource_test.go b/pkg/exchangerates/national_bank_of_poland_datasource_test.go index 776fdda4..128a8117 100644 --- a/pkg/exchangerates/national_bank_of_poland_datasource_test.go +++ b/pkg/exchangerates/national_bank_of_poland_datasource_test.go @@ -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 = "\n" + diff --git a/pkg/exchangerates/reserve_bank_of_australia_datasource.go b/pkg/exchangerates/reserve_bank_of_australia_datasource.go index ec114cd7..472fa42e 100644 --- a/pkg/exchangerates/reserve_bank_of_australia_datasource.go +++ b/pkg/exchangerates/reserve_bank_of_australia_datasource.go @@ -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" diff --git a/pkg/exchangerates/reserve_bank_of_australia_datasource_test.go b/pkg/exchangerates/reserve_bank_of_australia_datasource_test.go index 96cb7132..dc110308 100644 --- a/pkg/exchangerates/reserve_bank_of_australia_datasource_test.go +++ b/pkg/exchangerates/reserve_bank_of_australia_datasource_test.go @@ -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 = "\n" + diff --git a/pkg/exporters/csv_file.go b/pkg/exporters/csv_file.go index a844e458..a3d907a7 100644 --- a/pkg/exporters/csv_file.go +++ b/pkg/exporters/csv_file.go @@ -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 diff --git a/pkg/exporters/data_exporter.go b/pkg/exporters/data_exporter.go index a22838d5..254efbd5 100644 --- a/pkg/exporters/data_exporter.go +++ b/pkg/exporters/data_exporter.go @@ -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 diff --git a/pkg/log/formatter.go b/pkg/log/formatter.go index f988ad64..9654a09f 100644 --- a/pkg/log/formatter.go +++ b/pkg/log/formatter.go @@ -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 diff --git a/pkg/log/logger.go b/pkg/log/logger.go index 365291e8..61cab4a9 100644 --- a/pkg/log/logger.go +++ b/pkg/log/logger.go @@ -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" diff --git a/pkg/middlewares/authorization.go b/pkg/middlewares/authorization.go index 0b578e69..6161bc95 100644 --- a/pkg/middlewares/authorization.go +++ b/pkg/middlewares/authorization.go @@ -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" diff --git a/pkg/middlewares/header_in_query_string.go b/pkg/middlewares/header_in_query_string.go index 8fe84459..fdd7fe77 100644 --- a/pkg/middlewares/header_in_query_string.go +++ b/pkg/middlewares/header_in_query_string.go @@ -1,7 +1,7 @@ package middlewares import ( - "github.com/mayswind/lab/pkg/core" + "github.com/mayswind/ezbookkeeping/pkg/core" ) const utcOffsetQueryStringParam = "utc_offset" diff --git a/pkg/middlewares/recovery.go b/pkg/middlewares/recovery.go index 383046af..ad17ba06 100644 --- a/pkg/middlewares/recovery.go +++ b/pkg/middlewares/recovery.go @@ -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 ( diff --git a/pkg/middlewares/request_id.go b/pkg/middlewares/request_id.go index 38ceedad..98f825ae 100644 --- a/pkg/middlewares/request_id.go +++ b/pkg/middlewares/request_id.go @@ -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" diff --git a/pkg/middlewares/request_log.go b/pkg/middlewares/request_log.go index dd99719a..7c573edc 100644 --- a/pkg/middlewares/request_log.go +++ b/pkg/middlewares/request_log.go @@ -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 diff --git a/pkg/middlewares/server_settings_cookie.go b/pkg/middlewares/server_settings_cookie.go index 372b464e..75e2571b 100644 --- a/pkg/middlewares/server_settings_cookie.go +++ b/pkg/middlewares/server_settings_cookie.go @@ -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 { diff --git a/pkg/models/token_record.go b/pkg/models/token_record.go index eba3faef..79112bd9 100644 --- a/pkg/models/token_record.go +++ b/pkg/models/token_record.go @@ -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 diff --git a/pkg/models/transaction.go b/pkg/models/transaction.go index 2533e86c..a6ff91f3 100644 --- a/pkg/models/transaction.go +++ b/pkg/models/transaction.go @@ -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 diff --git a/pkg/models/user.go b/pkg/models/user.go index 96457cdc..e9015cd3 100644 --- a/pkg/models/user.go +++ b/pkg/models/user.go @@ -3,7 +3,7 @@ package models import ( "time" - "github.com/mayswind/lab/pkg/utils" + "github.com/mayswind/ezbookkeeping/pkg/utils" ) // WeekDay represents week day diff --git a/pkg/requestid/default_request_id_generator.go b/pkg/requestid/default_request_id_generator.go index 9f44c76b..ca67d6ad 100644 --- a/pkg/requestid/default_request_id_generator.go +++ b/pkg/requestid/default_request_id_generator.go @@ -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 diff --git a/pkg/requestid/default_request_id_generator_test.go b/pkg/requestid/default_request_id_generator_test.go index da203bf5..70ec1dfb 100644 --- a/pkg/requestid/default_request_id_generator_test.go +++ b/pkg/requestid/default_request_id_generator_test.go @@ -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)) diff --git a/pkg/requestid/request_id_container.go b/pkg/requestid/request_id_container.go index f7c9535d..3ea0b4b0 100644 --- a/pkg/requestid/request_id_container.go +++ b/pkg/requestid/request_id_container.go @@ -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 diff --git a/pkg/services/accounts.go b/pkg/services/accounts.go index 33a73e72..0e3880a4 100644 --- a/pkg/services/accounts.go +++ b/pkg/services/accounts.go @@ -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 diff --git a/pkg/services/base.go b/pkg/services/base.go index f754d3de..691310c5 100644 --- a/pkg/services/base.go +++ b/pkg/services/base.go @@ -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 diff --git a/pkg/services/tokens.go b/pkg/services/tokens.go index dfea2195..a92ce177 100644 --- a/pkg/services/tokens.go +++ b/pkg/services/tokens.go @@ -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 diff --git a/pkg/services/transaction_categories.go b/pkg/services/transaction_categories.go index 3add5160..d28ddc00 100644 --- a/pkg/services/transaction_categories.go +++ b/pkg/services/transaction_categories.go @@ -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 diff --git a/pkg/services/transaction_tags.go b/pkg/services/transaction_tags.go index a6b8ae7d..d1ff3095 100644 --- a/pkg/services/transaction_tags.go +++ b/pkg/services/transaction_tags.go @@ -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 diff --git a/pkg/services/transactions.go b/pkg/services/transactions.go index 4aa5ea93..3ca9943b 100644 --- a/pkg/services/transactions.go +++ b/pkg/services/transactions.go @@ -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 diff --git a/pkg/services/twofactor_authorizations.go b/pkg/services/twofactor_authorizations.go index d623d00c..8ba72815 100644 --- a/pkg/services/twofactor_authorizations.go +++ b/pkg/services/twofactor_authorizations.go @@ -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 ( diff --git a/pkg/services/users.go b/pkg/services/users.go index 90b84c14..e3a68385 100644 --- a/pkg/services/users.go +++ b/pkg/services/users.go @@ -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 diff --git a/pkg/settings/setting.go b/pkg/settings/setting.go index ffca5739..049ca2f7 100644 --- a/pkg/settings/setting.go +++ b/pkg/settings/setting.go @@ -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 { diff --git a/pkg/utils/api.go b/pkg/utils/api.go index e53b1ae4..cf342784 100644 --- a/pkg/utils/api.go +++ b/pkg/utils/api.go @@ -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 diff --git a/pkg/utils/network.go b/pkg/utils/network.go index 62c44140..56566ad1 100644 --- a/pkg/utils/network.go +++ b/pkg/utils/network.go @@ -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 diff --git a/pkg/utils/object_test.go b/pkg/utils/object_test.go index ad4ac60c..a8e7f1d3 100644 --- a/pkg/utils/object_test.go +++ b/pkg/utils/object_test.go @@ -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, diff --git a/pkg/utils/strings.go b/pkg/utils/strings.go index 8d70f238..22d6d688 100644 --- a/pkg/utils/strings.go +++ b/pkg/utils/strings.go @@ -12,7 +12,7 @@ import ( "golang.org/x/crypto/pbkdf2" - "github.com/mayswind/lab/pkg/errs" + "github.com/mayswind/ezbookkeeping/pkg/errs" ) const ( diff --git a/pkg/uuid/internal_generator.go b/pkg/uuid/internal_generator.go index c9d99c34..c01c974e 100644 --- a/pkg/uuid/internal_generator.go +++ b/pkg/uuid/internal_generator.go @@ -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 diff --git a/pkg/uuid/internal_generator_test.go b/pkg/uuid/internal_generator_test.go index 4d0986ea..26e9229d 100644 --- a/pkg/uuid/internal_generator_test.go +++ b/pkg/uuid/internal_generator_test.go @@ -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) { diff --git a/pkg/uuid/uuid_container.go b/pkg/uuid/uuid_container.go index 5bdbb625..e442d65f 100644 --- a/pkg/uuid/uuid_container.go +++ b/pkg/uuid/uuid_container.go @@ -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 diff --git a/pkg/validators/email.go b/pkg/validators/email.go index 43c11c2e..9264e950 100644 --- a/pkg/validators/email.go +++ b/pkg/validators/email.go @@ -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 diff --git a/pkg/validators/hex_rgb_color.go b/pkg/validators/hex_rgb_color.go index 90a25d1b..f0118d63 100644 --- a/pkg/validators/hex_rgb_color.go +++ b/pkg/validators/hex_rgb_color.go @@ -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 diff --git a/pkg/validators/username.go b/pkg/validators/username.go index 729f165e..9a4f81a4 100644 --- a/pkg/validators/username.go +++ b/pkg/validators/username.go @@ -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 diff --git a/pkg/version/version.go b/pkg/version/version.go index 12042a18..7270f854 100644 --- a/pkg/version/version.go +++ b/pkg/version/version.go @@ -4,7 +4,7 @@ import ( "fmt" "strings" - "github.com/mayswind/lab/pkg/utils" + "github.com/mayswind/ezbookkeeping/pkg/utils" ) var ( diff --git a/public/img/lab-192.png b/public/img/ezbookkeeping-192.png similarity index 100% rename from public/img/lab-192.png rename to public/img/ezbookkeeping-192.png diff --git a/public/img/lab-512.png b/public/img/ezbookkeeping-512.png similarity index 100% rename from public/img/lab-512.png rename to public/img/ezbookkeeping-512.png diff --git a/src/Mobile.vue b/src/Mobile.vue index 44a5f006..9e6e793d 100644 --- a/src/Mobile.vue +++ b/src/Mobile.vue @@ -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) } diff --git a/src/lib/logger.js b/src/lib/logger.js index 34d50ae4..0467e38c 100644 --- a/src/lib/logger.js +++ b/src/lib/logger.js @@ -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); } } diff --git a/src/lib/settings.js b/src/lib/settings.js index b6613834..fcba5dab 100644 --- a/src/lib/settings.js +++ b/src/lib/settings.js @@ -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', diff --git a/src/lib/userstate.js b/src/lib/userstate.js index 0c8e5076..2ede1b0b 100644 --- a/src/lib/userstate.js +++ b/src/lib/userstate.js @@ -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(); diff --git a/src/lib/utils.js b/src/lib/utils.js index 28277e45..7318cdea 100644 --- a/src/lib/utils.js +++ b/src/lib/utils.js @@ -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(); } diff --git a/src/locales/en.js b/src/locales/en.js index 551f6632..16bd270e 100644 --- a/src/locales/en.js +++ b/src/locales/en.js @@ -1,7 +1,7 @@ export default { 'global': { 'app': { - 'title': 'lab account book', + 'title': 'ezBookkeeping', } }, 'default': { diff --git a/src/locales/zh_Hans.js b/src/locales/zh_Hans.js index 19ba3d65..0f86b25a 100644 --- a/src/locales/zh_Hans.js +++ b/src/locales/zh_Hans.js @@ -1,7 +1,7 @@ export default { 'global': { 'app': { - 'title': 'lab 轻记账', + 'title': 'ezBookkeeping', } }, 'default': { diff --git a/src/public/desktop.html b/src/public/desktop.html index faf26c92..c88b7bdf 100644 --- a/src/public/desktop.html +++ b/src/public/desktop.html @@ -6,12 +6,12 @@ - - lab + + ezBookkeeping
diff --git a/src/public/mobile.html b/src/public/mobile.html index 0b24af88..c5637f6d 100644 --- a/src/public/mobile.html +++ b/src/public/mobile.html @@ -7,19 +7,19 @@ - + - - lab + + ezBookkeeping
diff --git a/src/store/exchangeRates.js b/src/store/exchangeRates.js index 37583a8c..2b2541e0 100644 --- a/src/store/exchangeRates.js +++ b/src/store/exchangeRates.js @@ -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; diff --git a/src/views/mobile/About.vue b/src/views/mobile/About.vue index da3d23dc..37b7f800 100644 --- a/src/views/mobile/About.vue +++ b/src/views/mobile/About.vue @@ -7,8 +7,7 @@ - + @@ -31,7 +30,7 @@


- lab also contains additional third party software.
+ ezBookkeeping also contains additional third party software.
All the third party software included or linked is redistributed under the terms and conditions of their original licenses.

diff --git a/src/views/mobile/Home.vue b/src/views/mobile/Home.vue index 215e8199..462e0ec5 100644 --- a/src/views/mobile/Home.vue +++ b/src/views/mobile/Home.vue @@ -153,7 +153,7 @@ {{ $t('Accounts') }} - + @@ -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; diff --git a/src/views/mobile/Login.vue b/src/views/mobile/Login.vue index 02d1936e..7fa2c614 100644 --- a/src/views/mobile/Login.vue +++ b/src/views/mobile/Login.vue @@ -1,7 +1,7 @@