From eeba2f5f4bf6324b1a457871f2841410ff337f76 Mon Sep 17 00:00:00 2001 From: JustSong Date: Fri, 11 Nov 2022 15:09:12 +0800 Subject: [PATCH] docs: update readme --- README.md | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 6d91f85..03e8ed7 100644 --- a/README.md +++ b/README.md @@ -18,27 +18,43 @@ ## Features + [x] Built-in user management. -+ [x] [GitHub OAuth login](https://github.com/settings/applications/new). -+ [x] WeChat Official Account login. ++ [x] [GitHub OAuth](https://github.com/settings/applications/new). ++ [x] WeChat official account authorization (need [wechat-server](https://github.com/songquanpeng/wechat-server)). + [x] Email verification & password reset. -+ [x] Request rate limitation. ++ [x] Request rate limit. + [x] Use GitHub Actions to build releases & Docker images. + [x] Mobile friendly UI. ## Usage -1. Download built binaries from [GitHub Releases](https://github.com/songquanpeng/gin-template/releases/latest). +1. Download built binaries from [GitHub Releases](https://github.com/songquanpeng/gin-template/releases/latest) or build from source: + 1. `git clone https://github.com/songquanpeng/gin-template.git` + 2. `go mod download` + 3. `go build -ldflags "-s -w" -o gin-template` 2. Run it: 1. `chmod u+x gin-template` - 2. `./gin-template --port 3000` -3. The username for the initial account is `root` and the password is `123456`. + 2. `./gin-template --port 3000 --log-dir ./logs` +3. Command line arguments: + +4. The username for the initial account is `root` and the password is `123456`. ## Basic Configurations The system works out of the box. -There are several environment variables used to configure the system: +You can configure the system by set environment variables or specify command line arguments. + +After the system is up, you can use the dashboard for further configuration. + +### Environment Variables 1. `REDIS_CONN_STRING`: if set, will use Redis as the store of rate limitation instead of memory. + Example: `REDIS_CONN_STRING=redis://default:redispw@localhost:49153` 2. `SESSION_SECRET`: if set, will fix session secret. + Example: `SESSION_SECRET=random_string` 3. `SQL_DSN`: if set, will use target SQL database instead of SQLite. - + Example`SQL_DSN=root:123456@tcp(localhost:3306)/gofile` \ No newline at end of file + + Example`SQL_DSN=root:123456@tcp(localhost:3306)/gofile` + +### Command line Arguments +1. `--port `: specify the port number, if not set, will use `3000`. + 1. Example: `--port 3000` +2. `--log-dir `: specify the log dir, if not set, won't save log. + + Example: `--log-dir ./logs` +3. `--version`: print version and exit. \ No newline at end of file