Skip to content

Commit

Permalink
docs: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
songquanpeng committed Nov 11, 2022
1 parent eb9200c commit eeba2f5
Showing 1 changed file with 24 additions and 8 deletions.
32 changes: 24 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
+ Example`SQL_DSN=root:123456@tcp(localhost:3306)/gofile`

### Command line Arguments
1. `--port <port_number>`: specify the port number, if not set, will use `3000`.
1. Example: `--port 3000`
2. `--log-dir <log_dir>`: specify the log dir, if not set, won't save log.
+ Example: `--log-dir ./logs`
3. `--version`: print version and exit.

0 comments on commit eeba2f5

Please sign in to comment.