Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
7e4edb1
fix: remove question detail page pinned icon
shuashuai Aug 4, 2025
fbd5a55
fix: failed to build plugins in windows
hgaol Aug 5, 2025
af80380
fix: failed to build plugins in windows
hgaol Aug 5, 2025
19aed9f
feat: schemeForm support tagSelector component
shuashuai Aug 8, 2025
bfa48a8
fix: footer remove background color
shuashuai Aug 8, 2025
dc582ee
style: question details page UI optimization
shuashuai Aug 12, 2025
a6d95ae
feat: add sidebar plugin
kumfo Aug 13, 2025
c2c7ea8
feat: support quick-links plugin
shuashuai Aug 14, 2025
1aeea01
style: ui optimization
shuashuai Aug 15, 2025
6389c3b
Merge branch 'feat/1.7.0/quicklinks' into test
shuashuai Aug 15, 2025
0376a00
fix: responsive layout adjustment
shuashuai Aug 19, 2025
7ffd86e
fix: add page-main-wrap class
shuashuai Aug 19, 2025
6d2dd57
fix: delete page-main-wrap class
shuashuai Aug 19, 2025
e9ea91d
fix: add data-bs-theme attribute for dropdown component
shuashuai Aug 20, 2025
1b97952
fix: update add_user modal's class
shuashuai Aug 21, 2025
df3b1a1
fix: the route of the question page is adjusted to /questions/add, an…
shuashuai Aug 28, 2025
81837c9
update new question message tag
light-white Aug 28, 2025
f73641e
fix: optimization askRedirect function
shuashuai Aug 28, 2025
413c391
fix: delete comments
shuashuai Aug 28, 2025
7a8afbb
add new question notification trigger user
light-white Aug 29, 2025
235c69e
fix: update search type
shuashuai Sep 2, 2025
7f9af84
fix: Fix username verification prompt
shuashuai Sep 8, 2025
f709968
fix: fixed the incorrect link of the user who was replied in the comment
shuashuai Sep 9, 2025
d738ec2
feat: add /tags/:tagName/questions route
shuashuai Sep 9, 2025
44beb6d
fix: Optimize list type judgment logic
shuashuai Sep 10, 2025
6a0f9f1
fix: rename linked page route
shuashuai Sep 10, 2025
e071f3e
fix: Filter out parameters of linked list unanswered
shuashuai Sep 10, 2025
aeb7b08
update: timeline page need logged
shuashuai Sep 22, 2025
5ad9780
fix: Optimize the export method of internal components
shuashuai Sep 23, 2025
bec3e35
feat: Add user comment moderation
sy-records Sep 19, 2025
4c2564e
update: update html templates
shuashuai Sep 30, 2025
bca8273
fix: edit_time display condition optimization
shuashuai Sep 30, 2025
78df776
fix: Details page editing time value adjustment
shuashuai Sep 30, 2025
f93ab41
fix(i18n): sync username character
sy-records Sep 29, 2025
aa75f44
feat(ui):hide related questions card when there is no content
Dinesht04 Oct 1, 2025
dc47e1a
fix(ui): change background color for code block to (--an-pre)
Dinesht04 Oct 10, 2025
a63fe5b
feat(internal,ui): add minimum tags property
Dinesht04 Oct 10, 2025
3ae38a1
feat(UI): Add error for minimum_tag count and translation for Min tag…
Dinesht04 Oct 10, 2025
c78cadb
add migration for min_tags
Dinesht04 Oct 13, 2025
a678946
fix(ui): Adjust tag input label for quantity
Dinesht04 Oct 14, 2025
9b65fed
refactor(tags): remove redundant param from GetMinimumTags and apply …
Dinesht04 Oct 14, 2025
403dec5
feat(internal,ui): add minimum tags error and label while editing
Dinesht04 Oct 15, 2025
4fa1d0f
fix: Fix the layout confusion caused by too long code #1404
shuashuai Oct 20, 2025
433b8d5
fix: i18n parameter passing optimization
shuashuai Oct 21, 2025
52e1b8b
fix: merge dev
shuashuai Oct 21, 2025
f238aa5
feat(ui,internal): add min_content property in site info
Dinesht04 Oct 16, 2025
9154b9b
feat(ui,internal): add optional question body
Dinesht04 Oct 17, 2025
2d2451f
fix(ui,internal): correct i18n implementation for variables and add m…
Dinesht04 Oct 21, 2025
e3151c1
fix: conflict
shuashuai Oct 23, 2025
e1ff073
fix: conflict
shuashuai Oct 23, 2025
4fca0c4
feat(plugins): add quick-links plugin and ensure captcha-basic is inc…
LinkinStars Oct 27, 2025
63e2fb9
fix(internal):add gte,lte bounds for min_content and min_tags
Dinesht04 Oct 23, 2025
b33e9fc
fix: Add time parameter when updating user status
sosyz Oct 5, 2025
93e183b
feat: Add resetPassword cli tool
sosyz Oct 27, 2025
b79fb38
docs(Makefile): upgrade version to 1.7.0
LinkinStars Oct 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.PHONY: build clean ui

VERSION=1.6.0
VERSION=1.7.0
BIN=answer
DIR_SRC=./cmd/answer
DOCKER_CMD=docker
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ To learn more about the project, visit [answer.apache.org](https://answer.apache
### Running with docker

```bash
docker run -d -p 9080:80 -v answer-data:/data --name answer apache/answer:1.6.0
docker run -d -p 9080:80 -v answer-data:/data --name answer apache/answer:1.7.0
```

For more information, see [Installation](https://answer.apache.org/docs/installation).
Expand Down
65 changes: 50 additions & 15 deletions cmd/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@
package answercmd

import (
"context"
"fmt"
"os"
"strings"

"github.com/apache/answer/internal/base/conf"
"github.com/apache/answer/internal/base/path"
"github.com/apache/answer/internal/cli"
"github.com/apache/answer/internal/install"
"github.com/apache/answer/internal/migrations"
Expand Down Expand Up @@ -53,6 +55,10 @@ var (
i18nSourcePath string
// i18nTargetPath i18n to path
i18nTargetPath string
// resetPasswordEmail user email for password reset
resetPasswordEmail string
// resetPasswordPassword new password for password reset
resetPasswordPassword string
)

func init() {
Expand All @@ -76,7 +82,10 @@ func init() {

i18nCmd.Flags().StringVarP(&i18nTargetPath, "target", "t", "", "i18n target path, eg: -t ./i18n/target")

for _, cmd := range []*cobra.Command{initCmd, checkCmd, runCmd, dumpCmd, upgradeCmd, buildCmd, pluginCmd, configCmd, i18nCmd} {
resetPasswordCmd.Flags().StringVarP(&resetPasswordEmail, "email", "e", "", "user email address")
resetPasswordCmd.Flags().StringVarP(&resetPasswordPassword, "password", "p", "", "new password (not recommended, will be recorded in shell history)")

for _, cmd := range []*cobra.Command{initCmd, checkCmd, runCmd, dumpCmd, upgradeCmd, buildCmd, pluginCmd, configCmd, i18nCmd, resetPasswordCmd} {
rootCmd.AddCommand(cmd)
}
}
Expand All @@ -96,8 +105,8 @@ To run answer, use:
Short: "Run Answer",
Long: `Start running Answer`,
Run: func(_ *cobra.Command, _ []string) {
cli.FormatAllPath(dataDirPath)
fmt.Println("config file path: ", cli.GetConfigFilePath())
path.FormatAllPath(dataDirPath)
fmt.Println("config file path: ", path.GetConfigFilePath())
fmt.Println("Answer is starting..........................")
runApp()
},
Expand All @@ -111,10 +120,10 @@ To run answer, use:
// check config file and database. if config file exists and database is already created, init done
cli.InstallAllInitialEnvironment(dataDirPath)

configFileExist := cli.CheckConfigFile(cli.GetConfigFilePath())
configFileExist := cli.CheckConfigFile(path.GetConfigFilePath())
if configFileExist {
fmt.Println("config file exists, try to read the config...")
c, err := conf.ReadConfig(cli.GetConfigFilePath())
c, err := conf.ReadConfig(path.GetConfigFilePath())
if err != nil {
fmt.Println("read config failed: ", err.Error())
return
Expand All @@ -128,7 +137,7 @@ To run answer, use:
}

// start installation server to install
install.Run(cli.GetConfigFilePath())
install.Run(path.GetConfigFilePath())
},
}

Expand All @@ -138,9 +147,9 @@ To run answer, use:
Long: `Upgrade Answer to the latest version`,
Run: func(_ *cobra.Command, _ []string) {
log.SetLogger(log.NewStdLogger(os.Stdout))
cli.FormatAllPath(dataDirPath)
path.FormatAllPath(dataDirPath)
cli.InstallI18nBundle(true)
c, err := conf.ReadConfig(cli.GetConfigFilePath())
c, err := conf.ReadConfig(path.GetConfigFilePath())
if err != nil {
fmt.Println("read config failed: ", err.Error())
return
Expand All @@ -159,8 +168,8 @@ To run answer, use:
Long: `Back up database into an SQL file`,
Run: func(_ *cobra.Command, _ []string) {
fmt.Println("Answer is backing up data")
cli.FormatAllPath(dataDirPath)
c, err := conf.ReadConfig(cli.GetConfigFilePath())
path.FormatAllPath(dataDirPath)
c, err := conf.ReadConfig(path.GetConfigFilePath())
if err != nil {
fmt.Println("read config failed: ", err.Error())
return
Expand All @@ -179,9 +188,9 @@ To run answer, use:
Short: "Check the required environment",
Long: `Check if the current environment meets the startup requirements`,
Run: func(_ *cobra.Command, _ []string) {
cli.FormatAllPath(dataDirPath)
path.FormatAllPath(dataDirPath)
fmt.Println("Start checking the required environment...")
if cli.CheckConfigFile(cli.GetConfigFilePath()) {
if cli.CheckConfigFile(path.GetConfigFilePath()) {
fmt.Println("config file exists [✔]")
} else {
fmt.Println("config file not exists [x]")
Expand All @@ -193,7 +202,7 @@ To run answer, use:
fmt.Println("upload directory not exists [x]")
}

c, err := conf.ReadConfig(cli.GetConfigFilePath())
c, err := conf.ReadConfig(path.GetConfigFilePath())
if err != nil {
fmt.Println("read config failed: ", err.Error())
return
Expand Down Expand Up @@ -246,9 +255,9 @@ To run answer, use:
Short: "Set some config to default value",
Long: `Set some config to default value`,
Run: func(_ *cobra.Command, _ []string) {
cli.FormatAllPath(dataDirPath)
path.FormatAllPath(dataDirPath)

c, err := conf.ReadConfig(cli.GetConfigFilePath())
c, err := conf.ReadConfig(path.GetConfigFilePath())
if err != nil {
fmt.Println("read config failed: ", err.Error())
return
Expand Down Expand Up @@ -297,6 +306,32 @@ To run answer, use:
}
},
}

resetPasswordCmd = &cobra.Command{
Use: "passwd",
Aliases: []string{"password", "reset-password"},
Short: "Reset user password",
Long: "Reset user password by email address.",
Example: ` # Interactive mode (recommended, safest)
answer passwd -C ./answer-data

# Specify email only (will prompt for password securely)
answer passwd -C ./answer-data --email [email protected]
answer passwd -C ./answer-data -e [email protected]

# Specify email and password (NOT recommended, will be recorded in shell history)
answer passwd -C ./answer-data -e [email protected] -p newpassword123`,
Run: func(cmd *cobra.Command, args []string) {
opts := &cli.ResetPasswordOptions{
Email: resetPasswordEmail,
Password: resetPasswordPassword,
}
if err := cli.ResetPassword(context.Background(), dataDirPath, opts); err != nil {
fmt.Fprintf(os.Stderr, "Error: %v\n", err)
os.Exit(1)
}
},
}
)

// Execute adds all child commands to the root command and sets flags appropriately.
Expand Down
4 changes: 2 additions & 2 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"github.com/apache/answer/internal/base/conf"
"github.com/apache/answer/internal/base/constant"
"github.com/apache/answer/internal/base/cron"
"github.com/apache/answer/internal/cli"
"github.com/apache/answer/internal/base/path"
"github.com/apache/answer/internal/schema"
"github.com/gin-gonic/gin"
"github.com/segmentfault/pacman"
Expand Down Expand Up @@ -67,7 +67,7 @@ func Main() {
}

func runApp() {
c, err := conf.ReadConfig(cli.GetConfigFilePath())
c, err := conf.ReadConfig(path.GetConfigFilePath())
if err != nil {
panic(err)
}
Expand Down
33 changes: 7 additions & 26 deletions cmd/wire_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 0 additions & 19 deletions docs/docs.go
Original file line number Diff line number Diff line change
@@ -1,22 +1,3 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

// Package docs Code generated by swaggo/swag. DO NOT EDIT
package docs

Expand Down
17 changes: 0 additions & 17 deletions docs/swagger.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

basePath: /
definitions:
constant.NotificationChannelKey:
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ require (
golang.org/x/crypto v0.36.0
golang.org/x/image v0.20.0
golang.org/x/net v0.38.0
golang.org/x/term v0.30.0
golang.org/x/text v0.23.0
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df
gopkg.in/yaml.v3 v3.0.1
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -785,6 +785,8 @@ golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXR
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
golang.org/x/term v0.30.0 h1:PQ39fJZ+mfadBm0y5WlL4vlM7Sx1Hgf13sMIY2+QS9Y=
golang.org/x/term v0.30.0/go.mod h1:NYYFdzHoI5wRh/h5tDMdMqCqPJZEuNqVR5xJLd/n67g=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
Expand Down
2 changes: 1 addition & 1 deletion i18n/af_ZA.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ ui:
caption: People can mention you as "@username".
msg: Username cannot be empty.
msg_range: Username must be 2-30 characters in length.
character: 'Must use the character set "a-z", "0-9", " - . _"'
character: 'Must use the character set "a-z", "0-9", "- . _"'
avatar:
label: Profile Image
gravatar: Gravatar
Expand Down
2 changes: 1 addition & 1 deletion i18n/ar_SA.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ ui:
caption: People can mention you as "@username".
msg: Username cannot be empty.
msg_range: Username must be 2-30 characters in length.
character: 'Must use the character set "a-z", "0-9", " - . _"'
character: 'Must use the character set "a-z", "0-9", "- . _"'
avatar:
label: Profile Image
gravatar: Gravatar
Expand Down
2 changes: 1 addition & 1 deletion i18n/az_AZ.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ ui:
caption: People can mention you as "@username".
msg: Username cannot be empty.
msg_range: Username up to 30 characters
character: 'Must use the character set "a-z", "0-9", " - . _"'
character: 'Must use the character set "a-z", "0-9", "- . _"'
avatar:
label: Profile Image
gravatar: Gravatar
Expand Down
2 changes: 1 addition & 1 deletion i18n/bal_BA.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ ui:
caption: People can mention you as "@username".
msg: Username cannot be empty.
msg_range: Username up to 30 characters
character: 'Must use the character set "a-z", "0-9", " - . _"'
character: 'Must use the character set "a-z", "0-9", "- . _"'
avatar:
label: Profile Image
gravatar: Gravatar
Expand Down
2 changes: 1 addition & 1 deletion i18n/ban_ID.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ ui:
caption: People can mention you as "@username".
msg: Username cannot be empty.
msg_range: Username up to 30 characters
character: 'Must use the character set "a-z", "0-9", " - . _"'
character: 'Must use the character set "a-z", "0-9", "- . _"'
avatar:
label: Profile Image
gravatar: Gravatar
Expand Down
2 changes: 1 addition & 1 deletion i18n/bn_BD.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ ui:
caption: People can mention you as "@username".
msg: Username cannot be empty.
msg_range: Username up to 30 characters
character: 'Must use the character set "a-z", "0-9", " - . _"'
character: 'Must use the character set "a-z", "0-9", "- . _"'
avatar:
label: Profile Image
gravatar: Gravatar
Expand Down
2 changes: 1 addition & 1 deletion i18n/bs_BA.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ ui:
caption: People can mention you as "@username".
msg: Username cannot be empty.
msg_range: Username up to 30 characters
character: 'Must use the character set "a-z", "0-9", " - . _"'
character: 'Must use the character set "a-z", "0-9", "- . _"'
avatar:
label: Profile Image
gravatar: Gravatar
Expand Down
2 changes: 1 addition & 1 deletion i18n/ca_ES.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ ui:
caption: People can mention you as "@username".
msg: Username cannot be empty.
msg_range: Username must be 2-30 characters in length.
character: 'Must use the character set "a-z", "0-9", " - . _"'
character: 'Must use the character set "a-z", "0-9", "- . _"'
avatar:
label: Profile Image
gravatar: Gravatar
Expand Down
Loading
Loading