You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@answer.apache.org by li...@apache.org on 2023/11/01 04:12:48 UTC

(incubator-answer) 01/01: refactor(rename): rename all link to answer.apache.org

This is an automated email from the ASF dual-hosted git repository.

linkinstar pushed a commit to branch podling
in repository https://gitbox.apache.org/repos/asf/incubator-answer.git

commit 5f2cf4d3377bf7effbd1878af61df6db0634c83c
Author: LinkinStars <li...@foxmail.com>
AuthorDate: Wed Nov 1 11:33:23 2023 +0800

    refactor(rename): rename all link to answer.apache.org
---
 README.md                                       | 10 +++++-----
 README_CN.md                                    |  8 ++++----
 charts/README.md                                |  2 +-
 charts/values.yaml                              |  2 +-
 internal/controller/siteinfo_controller.go      |  2 +-
 internal/service/dashboard/dashboard_service.go | 16 ++++++++--------
 6 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/README.md b/README.md
index 3708ce5c..1edf06cb 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-<a href="https://answer.dev">
+<a href="https://answer.apache.org">
     <img alt="logo" src="docs/img/logo.svg" height="99px">
 </a>
 
@@ -6,7 +6,7 @@
 
 A Q&A platform software for teams at any scales. Whether it’s a community forum, help center, or knowledge management platform, you can always count on Answer.
 
-To learn more about the project, visit [answer.dev](https://answer.dev).
+To learn more about the project, visit [answer.apache.org](https://answer.apache.org).
 
 [![LICENSE](https://img.shields.io/github/license/answerdev/answer)](https://github.com/answerdev/answer/blob/main/LICENSE)
 [![Language](https://img.shields.io/badge/language-go-blue.svg)](https://golang.org/)
@@ -26,11 +26,11 @@ To learn more about the project, visit [answer.dev](https://answer.dev).
 docker run -d -p 9080:80 -v answer-data:/data --name answer answerdev/answer:latest
 ```
 
-For more information, see [Installation](https://answer.dev/docs/installation)
+For more information, see [Installation](https://answer.apache.org/docs/installation)
 
 ### Plugins
 
-Answer provides a plugin system for developers to create custom plugins and expand Answer’s features. You can find the [plugin documentation here](https://answer.dev/docs/development/extending/).
+Answer provides a plugin system for developers to create custom plugins and expand Answer’s features. You can find the [plugin documentation here](https://answer.apache.org/docs/development/extending/).
 
 We value your feedback and suggestions to improve our documentation. If you have any comments or questions, please feel free to contact us. We’re excited to see what you can create using our plugin system!
 
@@ -41,7 +41,7 @@ You can also check out the [plugins here](https://github.com/answerdev/plugins).
 
 Contributions are always welcome!
 
-See [CONTRIBUTING](https://answer.dev/docs/development/contributing/) for ways to get started.
+See [CONTRIBUTING](https://answer.apache.org/docs/development/contributing/) for ways to get started.
 
 ## License
 
diff --git a/README_CN.md b/README_CN.md
index 6e947167..015d34b1 100644
--- a/README_CN.md
+++ b/README_CN.md
@@ -1,4 +1,4 @@
-<a href="https://answer.dev">
+<a href="https://answer.apache.org">
     <img alt="logo" src="docs/img/logo.svg" height="99px">
 </a>
 
@@ -6,7 +6,7 @@
 
 一款问答形式的知识社区开源软件,你可以使用它快速建立你的问答社区,用于产品技术支持、客户支持、用户交流等。
 
-了解更多关于该项目的内容,请访问 [answer.dev](https://answer.dev).
+了解更多关于该项目的内容,请访问 [answer.apache.org](https://answer.apache.org).
 
 [![LICENSE](https://img.shields.io/github/license/answerdev/answer)](https://github.com/answerdev/answer/blob/main/LICENSE)
 [![Language](https://img.shields.io/badge/language-go-blue.svg)](https://golang.org/)
@@ -26,13 +26,13 @@
 docker run -d -p 9080:80 -v answer-data:/data --name answer answerdev/answer:latest
 ```
 
-其他安装配置细节请参考 [Installation](https://answer.dev/docs/installation)
+其他安装配置细节请参考 [Installation](https://answer.apache.org/docs/installation)
 
 ## 贡献
 
 我们随时欢迎你的贡献!
 
-参考 [CONTRIBUTING](https://answer.dev/docs/development/contributing/) 开始贡献。
+参考 [CONTRIBUTING](https://answer.apache.org/docs/development/contributing/) 开始贡献。
 
 ## License
 
diff --git a/charts/README.md b/charts/README.md
index f47b7028..eeb49d35 100644
--- a/charts/README.md
+++ b/charts/README.md
@@ -69,7 +69,7 @@ Publish the chart to Artifacthub and add proper installation instructions. E.G.
 > **NOTE**: This is not currently a valid installation option.
 
 ```console
-$ helm repo add answerdev https://charts.answer.dev/
+$ helm repo add answerdev https://charts.answer.apache.org/
 $ helm repo update
 $ helm install answerdev/answer -n mynamespace
 ```
\ No newline at end of file
diff --git a/charts/values.yaml b/charts/values.yaml
index f0d0af4b..8b6fe999 100644
--- a/charts/values.yaml
+++ b/charts/values.yaml
@@ -29,7 +29,7 @@ image:
 
 # Environment variables
 # Configure environment variables below
-# https://answer.dev/docs/env
+# https://answer.apache.org/docs/env
 env:
   - name: LOG_LEVEL
     # [DEBUG INFO WARN ERROR]
diff --git a/internal/controller/siteinfo_controller.go b/internal/controller/siteinfo_controller.go
index e3db9dee..f51d7df7 100644
--- a/internal/controller/siteinfo_controller.go
+++ b/internal/controller/siteinfo_controller.go
@@ -128,7 +128,7 @@ func (sc *SiteInfoController) GetManifestJson(ctx *gin.Context) {
 		Version:         constant.Version,
 		Revision:        constant.Revision,
 		ShortName:       "Answer",
-		Name:            "Answer.dev",
+		Name:            "answer.apache.org",
 		Icons: map[string]string{
 			"16":  favicon,
 			"32":  favicon,
diff --git a/internal/service/dashboard/dashboard_service.go b/internal/service/dashboard/dashboard_service.go
index 90582c98..dbee54d8 100644
--- a/internal/service/dashboard/dashboard_service.go
+++ b/internal/service/dashboard/dashboard_service.go
@@ -202,25 +202,25 @@ func (ds *dashboardService) voteCount(ctx context.Context) int64 {
 }
 
 func (ds *dashboardService) remoteVersion(ctx context.Context) string {
-	url := "https://answer.dev/getlatest"
-	req, _ := http.NewRequest("GET", url, nil)
+	req, _ := http.NewRequest("GET", "https://getlatest.answer.dev/", nil)
 	req.Header.Set("User-Agent", "Answer/"+constant.Version)
-	resp, err := (&http.Client{}).Do(req)
+	httpClient := &http.Client{}
+	httpClient.Timeout = 15 * time.Second
+	resp, err := httpClient.Do(req)
 	if err != nil {
-		log.Error("http.Client error", err)
+		log.Errorf("request remote version failed: %s", err)
 		return ""
 	}
 	defer resp.Body.Close()
 
 	respByte, err := io.ReadAll(resp.Body)
 	if err != nil {
-		log.Error("http.Client error", err)
+		log.Errorf("read response body failed: %s", err)
 		return ""
 	}
 	remoteVersion := &schema.RemoteVersion{}
-	err = json.Unmarshal(respByte, remoteVersion)
-	if err != nil {
-		log.Error("json.Unmarshal error", err)
+	if err := json.Unmarshal(respByte, remoteVersion); err != nil {
+		log.Errorf("parsing response body failed: %s", err)
 		return ""
 	}
 	return remoteVersion.Release.Version