Skip to content

Commit eba56db

Browse files
committed
Merge remote-tracking branch 'origin/main' into meta
# Conflicts: # i18n/pl_PL.yaml
2 parents bcbae25 + 7dfb8b3 commit eba56db

249 files changed

Lines changed: 20269 additions & 4660 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.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=

.github/workflows/lint.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
name: Lint
19+
20+
on:
21+
push:
22+
pull_request:
23+
24+
concurrency:
25+
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.number || github.run_id }}
26+
cancel-in-progress: true
27+
28+
jobs:
29+
lint:
30+
name: Lint (${{ matrix.os }})
31+
runs-on: ${{ matrix.os }}
32+
timeout-minutes: 15
33+
strategy:
34+
fail-fast: false
35+
matrix:
36+
os: [ubuntu-latest]
37+
38+
steps:
39+
- name: Checkout
40+
uses: actions/checkout@v4
41+
42+
- name: Setup Go
43+
uses: actions/setup-go@v5
44+
with:
45+
go-version: "1.23"
46+
cache: true
47+
48+
- name: Run go mod tidy
49+
run: go mod tidy
50+
51+
- name: Run golangci-lint
52+
run: make lint
53+
54+
- name: Check for uncommitted changes
55+
shell: bash
56+
run: |
57+
if [ -n "$(git status --porcelain)" ]; then
58+
echo "::error::Uncommitted changes detected"
59+
git status
60+
git diff
61+
exit 1
62+
fi

.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

Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
.PHONY: build clean ui
22

3-
VERSION=1.7.1
4-
BIN=answer
3+
VERSION=2.0.0
54
DIR_SRC=./cmd/answer
65
DOCKER_CMD=docker
76

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ To learn more about the project, visit [answer.apache.org](https://answer.apache
2323
### Running with docker
2424

2525
```bash
26-
docker run -d -p 9080:80 -v answer-data:/data --name answer apache/answer:1.7.1
26+
docker run -d -p 9080:80 -v answer-data:/data --name answer apache/answer:2.0.0
2727
```
2828

2929
For more information, see [Installation](https://answer.apache.org/docs/installation).

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: 43 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)