Skip to content

Commit 6b834c7

Browse files
committed
Merge remote-tracking branch 'origin/dev' into test
2 parents d7d692b + 5be6ec9 commit 6b834c7

38 files changed

Lines changed: 682 additions & 400 deletions

.env.example

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Installation
2+
INSTALL_PORT=80
3+
AUTO_INSTALL=false
4+
5+
# Database
6+
DB_TYPE=
7+
DB_USERNAME=
8+
DB_PASSWORD=
9+
DB_HOST=
10+
DB_NAME=
11+
DB_FILE=
12+
13+
# Site
14+
LANGUAGE=en-US
15+
SITE_NAME=Apache Answer
16+
SITE_URL=
17+
CONTACT_EMAIL=
18+
19+
# Admin
20+
ADMIN_NAME=
21+
ADMIN_PASSWORD=
22+
ADMIN_EMAIL=
23+
24+
# Content
25+
EXTERNAL_CONTENT_DISPLAY=ask_before_display
26+
27+
# Swagger
28+
SWAGGER_HOST=
29+
SWAGGER_ADDRESS_PORT=
30+
31+
# Server
32+
SITE_ADDR=0.0.0.0:3000
33+
34+
# Logging
35+
LOG_LEVEL=INFO
36+
LOG_PATH=

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,6 @@ dist/
3333

3434
# Lint setup generated file
3535
.husky/
36+
37+
# Environment variables
38+
.env

cmd/main.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,18 @@ import (
3131
"github.com/apache/answer/internal/base/path"
3232
"github.com/apache/answer/internal/schema"
3333
"github.com/gin-gonic/gin"
34+
"github.com/joho/godotenv"
3435
"github.com/segmentfault/pacman"
3536
"github.com/segmentfault/pacman/contrib/log/zap"
3637
"github.com/segmentfault/pacman/contrib/server/http"
3738
"github.com/segmentfault/pacman/log"
3839
)
3940

41+
func init() {
42+
// Load .env if present, ignore error to keep backward compatibility
43+
_ = godotenv.Load()
44+
}
45+
4046
// go build -ldflags "-X github.com/apache/answer/cmd.Version=x.y.z"
4147
var (
4248
// Name is the name of the project

cmd/wire_gen.go

Lines changed: 27 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Copyright (c) 2013 John Barton
2+
3+
MIT License
4+
5+
Permission is hereby granted, free of charge, to any person obtaining
6+
a copy of this software and associated documentation files (the
7+
"Software"), to deal in the Software without restriction, including
8+
without limitation the rights to use, copy, modify, merge, publish,
9+
distribute, sublicense, and/or sell copies of the Software, and to
10+
permit persons to whom the Software is furnished to do so, subject to
11+
the following conditions:
12+
13+
The above copyright notice and this permission notice shall be
14+
included in all copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ require (
117117
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
118118
github.com/hashicorp/hcl v1.0.0 // indirect
119119
github.com/inconshreveable/mousetrap v1.1.0 // indirect
120+
github.com/joho/godotenv v1.5.1 // indirect
120121
github.com/josharian/intern v1.0.0 // indirect
121122
github.com/json-iterator/go v1.1.12 // indirect
122123
github.com/klauspost/cpuid/v2 v2.2.8 // indirect

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,8 @@ github.com/jinzhu/copier v0.4.0/go.mod h1:DfbEm0FYsaqBcKcFuvmOZb218JkPGtvSHsKg8S
354354
github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ=
355355
github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
356356
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
357+
github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0=
358+
github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4=
357359
github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
358360
github.com/jonboulle/clockwork v0.3.0 h1:9BSCMi8C+0qdApAp4auwX0RkLGUjs956h0EkuQymUhg=
359361
github.com/jonboulle/clockwork v0.3.0/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8=

0 commit comments

Comments
 (0)