Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
20d7e4b
feat(plugin): add key-value storage support for plugins
sosyz Feb 25, 2025
42cc068
refactor(plugin): improved initialization of the KV storage plugin
sosyz Mar 1, 2025
9f8cab5
perf(plugin): remove unnecessary KV storage checks
sosyz Mar 1, 2025
42d6ad6
fix(plugin): rename 'close' to avoid builtin collision
sosyz Mar 1, 2025
56f36ec
refactor(plugin): improve KV storage with better caching and param ha…
sosyz Mar 9, 2025
beac023
docs(plugin): Add comments to KVOperator methods to improve code read…
sosyz Apr 3, 2025
15ef815
feat(migrations): Add v26 migration file to support plugin KV storage
sosyz Apr 3, 2025
d866ca7
fix(plugin): set params.Value in Get method to ensure correct value r…
sosyz May 7, 2025
aac1532
chore(migrations): update migration version
sosyz May 7, 2025
757e894
docs(command): remove redundant comments
Octobug May 6, 2025
4182d9f
docs(command): unify style of usage statements
Octobug May 6, 2025
9368da2
fix: code snippet caused the layout to break #1329
shuashuai May 12, 2025
50bed82
feat: Supports separate setting of navigation background color
shuashuai May 19, 2025
4ae8d8a
fix: reset navbar_style default color
shuashuai May 19, 2025
95f5de5
fix: customize renamed to apperance and move branding below apprance
shuashuai May 19, 2025
17b88b6
fix: reanme css/html page title and fix some zh_cn translations
shuashuai May 20, 2025
cde3ef9
fix: admin gravatar base URL is empty should use placehoder for defau…
shuashuai May 20, 2025
c7ab853
feat(plugin): add key-value storage support for plugins
sosyz Feb 25, 2025
8579bde
refactor(plugin): improved initialization of the KV storage plugin
sosyz Mar 1, 2025
d12ac86
perf(plugin): remove unnecessary KV storage checks
sosyz Mar 1, 2025
d90810a
fix(plugin): rename 'close' to avoid builtin collision
sosyz Mar 1, 2025
9ea153b
refactor(plugin): improve KV storage with better caching and param ha…
sosyz Mar 9, 2025
c7646bd
docs(plugin): Add comments to KVOperator methods to improve code read…
sosyz Apr 3, 2025
aa0493e
feat(migrations): Add v26 migration file to support plugin KV storage
sosyz Apr 3, 2025
ed543e8
fix(plugin): set params.Value in Get method to ensure correct value r…
sosyz May 7, 2025
1baa3f0
chore(migrations): update migration version
sosyz May 7, 2025
54f7682
docs(command): remove redundant comments
Octobug May 6, 2025
c6189e5
docs(command): unify style of usage statements
Octobug May 6, 2025
9331690
fix: When copying text and images, can the images only appear at the …
shuashuai May 20, 2025
89df65c
fix: Copy content avoids multiple consecutive newlines
shuashuai May 20, 2025
84cc97d
fix: pre tag background color adjustment, remove the background color…
shuashuai May 23, 2025
def0559
Fix file record and delete files (branding and avatar) (#1335)
DanielAuerX May 23, 2025
afdf6ce
fix: Unified display name and username length checks
sy-records May 22, 2025
b691e14
Merge remote-tracking branch 'origin/dev' into test
LinkinStars May 23, 2025
6381a21
fix: update the visit cookie if it does not match the visit token
Giorgio-Bonvicini-R4P May 23, 2025
5fc25ab
Merge remote-tracking branch 'origin/dev' into test
LinkinStars May 26, 2025
503e1cf
fix: dropdown header use h6
shuashuai May 27, 2025
b20f3a8
fix: dropdown header use h6
shuashuai May 27, 2025
6df436c
feat(tests): add comprehensive tests for KV storage plugin
sosyz May 25, 2025
4175b06
perf(tests): replace panic with os.Exit in TestMain for graceful test…
sosyz May 25, 2025
e859e47
Merge remote-tracking branch 'origin/dev' into test
LinkinStars May 28, 2025
bd032df
upgrade(docs): upgrade to 1.5.1
LinkinStars May 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.5.0
VERSION=1.5.1
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.5.0
docker run -d -p 9080:80 -v answer-data:/data --name answer apache/answer:1.5.1
```

For more information, see [Installation](https://answer.apache.org/docs/installation).
Expand Down
40 changes: 15 additions & 25 deletions cmd/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ func init() {
}

var (
// rootCmd represents the base command when called without any subcommands
rootCmd = &cobra.Command{
Use: "answer",
Short: "Answer is a minimalist open source Q&A community.",
Expand All @@ -92,11 +91,10 @@ To run answer, use:
- 'answer run' to launch application.`,
}

// runCmd represents the run command
runCmd = &cobra.Command{
Use: "run",
Short: "Run the application",
Long: `Run the application`,
Short: "Run Answer",
Long: `Start running Answer`,
Run: func(_ *cobra.Command, _ []string) {
cli.FormatAllPath(dataDirPath)
fmt.Println("config file path: ", cli.GetConfigFilePath())
Expand All @@ -105,11 +103,10 @@ To run answer, use:
},
}

// initCmd represents the init command
initCmd = &cobra.Command{
Use: "init",
Short: "init answer application",
Long: `init answer application`,
Short: "Initialize Answer",
Long: `Initialize Answer with specified configuration`,
Run: func(_ *cobra.Command, _ []string) {
// check config file and database. if config file exists and database is already created, init done
cli.InstallAllInitialEnvironment(dataDirPath)
Expand All @@ -135,11 +132,10 @@ To run answer, use:
},
}

// upgradeCmd represents the upgrade command
upgradeCmd = &cobra.Command{
Use: "upgrade",
Short: "upgrade Answer version",
Long: `upgrade Answer version`,
Short: "Upgrade Answer",
Long: `Upgrade Answer to the latest version`,
Run: func(_ *cobra.Command, _ []string) {
log.SetLogger(log.NewStdLogger(os.Stdout))
cli.FormatAllPath(dataDirPath)
Expand All @@ -157,11 +153,10 @@ To run answer, use:
},
}

// dumpCmd represents the dump command
dumpCmd = &cobra.Command{
Use: "dump",
Short: "back up data",
Long: `back up data`,
Short: "Back up data",
Long: `Back up database into an SQL file`,
Run: func(_ *cobra.Command, _ []string) {
fmt.Println("Answer is backing up data")
cli.FormatAllPath(dataDirPath)
Expand All @@ -179,10 +174,9 @@ To run answer, use:
},
}

// checkCmd represents the check command
checkCmd = &cobra.Command{
Use: "check",
Short: "checking the required environment",
Short: "Check the required environment",
Long: `Check if the current environment meets the startup requirements`,
Run: func(_ *cobra.Command, _ []string) {
cli.FormatAllPath(dataDirPath)
Expand Down Expand Up @@ -214,10 +208,9 @@ To run answer, use:
},
}

// buildCmd used to build another answer with plugins
buildCmd = &cobra.Command{
Use: "build",
Short: "used to build answer with plugins",
Short: "Build Answer with plugins",
Long: `Build a new Answer with plugins that you need`,
Run: func(_ *cobra.Command, _ []string) {
fmt.Printf("try to build a new answer with plugins:\n%s\n", strings.Join(buildWithPlugins, "\n"))
Expand All @@ -235,11 +228,10 @@ To run answer, use:
},
}

// pluginCmd prints all plugins packed in the binary
pluginCmd = &cobra.Command{
Use: "plugin",
Short: "prints all plugins packed in the binary",
Long: `prints all plugins packed in the binary`,
Short: "Print all plugins packed in the binary",
Long: `Print all plugins packed in the binary`,
Run: func(_ *cobra.Command, _ []string) {
_ = plugin.CallBase(func(base plugin.Base) error {
info := base.Info()
Expand All @@ -249,11 +241,10 @@ To run answer, use:
},
}

// configCmd set some config to default value
configCmd = &cobra.Command{
Use: "config",
Short: "set some config to default value",
Long: `set some config to default value`,
Short: "Set some config to default value",
Long: `Set some config to default value`,
Run: func(_ *cobra.Command, _ []string) {
cli.FormatAllPath(dataDirPath)

Expand Down Expand Up @@ -286,10 +277,9 @@ To run answer, use:
},
}

// i18nCmd used to merge i18n files
i18nCmd = &cobra.Command{
Use: "i18n",
Short: "overwrite i18n files",
Short: "Overwrite i18n files",
Long: `Merge i18n files from plugins to original i18n files. It will overwrite the original i18n files`,
Run: func(_ *cobra.Command, _ []string) {
if err := cli.ReplaceI18nFilesLocal(i18nTargetPath); err != nil {
Expand Down
8 changes: 4 additions & 4 deletions cmd/wire_gen.go

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

8 changes: 5 additions & 3 deletions docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -8263,7 +8263,7 @@ const docTemplate = `{
"display_name": {
"type": "string",
"maxLength": 30,
"minLength": 4
"minLength": 2
},
"email": {
"type": "string",
Expand All @@ -8274,7 +8274,8 @@ const docTemplate = `{
},
"username": {
"type": "string",
"maxLength": 30
"maxLength": 30,
"minLength": 2
}
}
},
Expand Down Expand Up @@ -11084,7 +11085,8 @@ const docTemplate = `{
},
"display_name": {
"type": "string",
"maxLength": 30
"maxLength": 30,
"minLength": 2
},
"location": {
"type": "string",
Expand Down
8 changes: 5 additions & 3 deletions docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -8236,7 +8236,7 @@
"display_name": {
"type": "string",
"maxLength": 30,
"minLength": 4
"minLength": 2
},
"email": {
"type": "string",
Expand All @@ -8247,7 +8247,8 @@
},
"username": {
"type": "string",
"maxLength": 30
"maxLength": 30,
"minLength": 2
}
}
},
Expand Down Expand Up @@ -11057,7 +11058,8 @@
},
"display_name": {
"type": "string",
"maxLength": 30
"maxLength": 30,
"minLength": 2
},
"location": {
"type": "string",
Expand Down
4 changes: 3 additions & 1 deletion docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ definitions:
properties:
display_name:
maxLength: 30
minLength: 4
minLength: 2
type: string
email:
maxLength: 500
Expand All @@ -536,6 +536,7 @@ definitions:
type: string
username:
maxLength: 30
minLength: 2
type: string
required:
- display_name
Expand Down Expand Up @@ -2485,6 +2486,7 @@ definitions:
type: string
display_name:
maxLength: 30
minLength: 2
type: string
location:
maxLength: 100
Expand Down
4 changes: 2 additions & 2 deletions i18n/af_ZA.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -678,12 +678,12 @@ ui:
display_name:
label: Display Name
msg: Display name cannot be empty.
msg_range: Display name up to 30 characters.
msg_range: Display name must be 2-30 characters in length.
username:
label: Username
caption: People can mention you as "@username".
msg: Username cannot be empty.
msg_range: Username up to 30 characters.
msg_range: Username must be 2-30 characters in length.
character: 'Must use the character set "a-z", "0-9", " - . _"'
avatar:
label: Profile Image
Expand Down
4 changes: 2 additions & 2 deletions i18n/ar_SA.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -678,12 +678,12 @@ ui:
display_name:
label: Display Name
msg: Display name cannot be empty.
msg_range: Display name up to 30 characters.
msg_range: Display name must be 2-30 characters in length.
username:
label: Username
caption: People can mention you as "@username".
msg: Username cannot be empty.
msg_range: Username up to 30 characters.
msg_range: Username must be 2-30 characters in length.
character: 'Must use the character set "a-z", "0-9", " - . _"'
avatar:
label: Profile Image
Expand Down
4 changes: 2 additions & 2 deletions i18n/ca_ES.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -678,12 +678,12 @@ ui:
display_name:
label: Display Name
msg: Display name cannot be empty.
msg_range: Display name up to 30 characters.
msg_range: Display name must be 2-30 characters in length.
username:
label: Username
caption: People can mention you as "@username".
msg: Username cannot be empty.
msg_range: Username up to 30 characters.
msg_range: Username must be 2-30 characters in length.
character: 'Must use the character set "a-z", "0-9", " - . _"'
avatar:
label: Profile Image
Expand Down
8 changes: 4 additions & 4 deletions i18n/cs_CZ.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1275,12 +1275,12 @@ ui:
display_name:
label: Display name
msg: Display name cannot be empty.
msg_range: Display name up to 30 characters.
msg_range: Display name must be 2-30 characters in length.
username:
label: Username
caption: People can mention you as "@username".
msg: Username cannot be empty.
msg_range: Username up to 30 characters.
msg_range: Username must be 2-30 characters in length.
character: 'Must use the character set "a-z", "0-9", " - . _"'
avatar:
label: Profile image
Expand Down Expand Up @@ -1852,10 +1852,10 @@ ui:
fields:
display_name:
label: Display name
msg_range: Display name up to 30 characters.
msg_range: Display name must be 2-30 characters in length.
username:
label: Username
msg_range: Username up to 30 characters.
msg_range: Username must be 2-30 characters in length.
email:
label: Email
msg_invalid: Invalid Email Address.
Expand Down
8 changes: 4 additions & 4 deletions i18n/cy_GB.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1275,12 +1275,12 @@ ui:
display_name:
label: Display name
msg: Display name cannot be empty.
msg_range: Display name up to 30 characters.
msg_range: Display name must be 2-30 characters in length.
username:
label: Username
caption: People can mention you as "@username".
msg: Username cannot be empty.
msg_range: Username up to 30 characters.
msg_range: Username must be 2-30 characters in length.
character: 'Must use the character set "a-z", "0-9", " - . _"'
avatar:
label: Profile image
Expand Down Expand Up @@ -1852,10 +1852,10 @@ ui:
fields:
display_name:
label: Display name
msg_range: Display name up to 30 characters.
msg_range: Display name must be 2-30 characters in length.
username:
label: Username
msg_range: Username up to 30 characters.
msg_range: Username must be 2-30 characters in length.
email:
label: Email
msg_invalid: Invalid Email Address.
Expand Down
4 changes: 2 additions & 2 deletions i18n/el_GR.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -678,12 +678,12 @@ ui:
display_name:
label: Display Name
msg: Display name cannot be empty.
msg_range: Display name up to 30 characters.
msg_range: Display name must be 2-30 characters in length.
username:
label: Username
caption: People can mention you as "@username".
msg: Username cannot be empty.
msg_range: Username up to 30 characters.
msg_range: Username must be 2-30 characters in length.
character: 'Must use the character set "a-z", "0-9", " - . _"'
avatar:
label: Profile Image
Expand Down
Loading