Skip to content

Commit

Permalink
🎨 社区端域名变更 #44
Browse files Browse the repository at this point in the history
  • Loading branch information
88250 committed Sep 3, 2020
1 parent 6e82549 commit a55266b
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 149 deletions.
2 changes: 1 addition & 1 deletion controller/b3logctl.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"github.com/gin-gonic/gin"
)

// addSymArticleAction adds an article come from Sym. Sees https://hacpai.com/article/1457158841475 for more details.
// addSymArticleAction adds an article come from Sym. Sees https://ld246.com/article/1457158841475 for more details.
func addSymArticleAction(c *gin.Context) {
result := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, result)
Expand Down
2 changes: 1 addition & 1 deletion controller/commentctl.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func addCommentAction(c *gin.Context) {

dataModel := getDataModel(c)

commentAuthorURL := util.HacPaiURL + "/member/" + session.UName
commentAuthorURL := util.CommunityURL + "/member/" + session.UName
blogURLSetting := service.Setting.GetSetting(model.SettingCategoryBasic, model.SettingNameBasicBlogURL, session.BID)
if nil != blogURLSetting {
commentAuthorURL = blogURLSetting.Value + util.PathAuthors + "/" + session.UName
Expand Down
2 changes: 1 addition & 1 deletion controller/console/articlectl.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func UploadTokenAction(c *gin.Context) {

requestResult := gulu.Ret.NewResult()
_, _, errs := gorequest.New().TLSClientConfig(&tls.Config{InsecureSkipVerify: true}).
Post(util.HacPaiURL+"/apis/upload/token").
Post(util.CommunityURL+"/apis/upload/token").
SendStruct(requestJSON).Set("user-agent", model.UserAgent).Timeout(10 * time.Second).EndStruct(requestResult)
uploadTokenCheckTime = now
if nil != errs {
Expand Down
2 changes: 1 addition & 1 deletion controller/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func MapRoutes() *gin.Engine {

api := ret.Group(util.PathAPI)
api.POST("/logout", logoutAction)
api.Any("/hp/*apis", util.HacPaiAPI())
api.Any("/hp/*apis", util.CommunityAPI())
api.GET("/status", getStatusAction)
api.GET("/check-version", console.CheckVersionAction)
api.GET("/blogs/top", showTopBlogsAction)
Expand Down
6 changes: 3 additions & 3 deletions service/initsrv.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,12 +203,12 @@ func initBlogAdmin(tx *gorm.DB, admin *model.User, blogID uint64) error {
func helloWorld(tx *gorm.DB, admin *model.User, blogID uint64) error {
content := `![Hello](` + util.ImageSize(util.RandImage(), 768, 432) + `)
Pipe 博客平台已经初始化完毕,可在管理后台 - 设置 - 基础设置中调整更多细节。如果需要导入已有博客文章,请参考文档 [Hexo/Jekyll/Markdown 文件导入](https://hacpai.com/article/1498490209748)。
Pipe 博客平台已经初始化完毕,可在管理后台 - 设置 - 基础设置中调整更多细节。如果需要导入已有博客文章,请参考文档 [Hexo/Jekyll/Markdown 文件导入](https://ld246.com/article/1498490209748)。
另外,出于安全考虑请尽快完成如下操作:
1. 登录[社区](https://hacpai.com)
2. 在社区[个人设置 - B3](https://hacpai.com/settings/b3) 中更新 B3 Key
1. 登录[社区](https://ld246.com)
2. 在社区[个人设置 - B3](https://ld246.com/settings/b3) 中更新 B3 Key
3. 在 Pipe 管理后台 - 设置 - 账号中也进行同样的 B3 Key 更新
最后,如果你觉得 Pipe 很赞,请到[项目主页](https://github.com/88250/pipe)给颗星鼓励一下 :heart:`
Expand Down
10 changes: 5 additions & 5 deletions util/hacpais.go → util/liandis.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ import (
// Logger
var logger = gulu.Log.NewLogger(os.Stdout)

// HacPaiURL is the URL of HacPai community.
const HacPaiURL = "https://hacpai.com"
// CommunityURL is the URL of LianDi community.
const CommunityURL = "https://hacpai.com"

// HacPaiAPI is a reverse proxy for https://hacpai.com.
func HacPaiAPI() gin.HandlerFunc {
// CommunityAPI is a reverse proxy for https://ld246.com.
func CommunityAPI() gin.HandlerFunc {
return func(c *gin.Context) {
proxy := httputil.NewSingleHostReverseProxy(&url.URL{
Scheme: "https",
Expand Down Expand Up @@ -80,7 +80,7 @@ func dialTLS(network, addr string) (net.Conn, error) {
func HacPaiUserInfo(accessToken string) (ret map[string]interface{}) {
result := map[string]interface{}{}
response, data, errors := gorequest.New().TLSClientConfig(&tls.Config{InsecureSkipVerify: true}).
Post(HacPaiURL+"/user/ak").SendString("access_token="+accessToken).Timeout(7*time.Second).
Post(CommunityURL+"/user/ak").SendString("access_token="+accessToken).Timeout(7*time.Second).
Set("User-Agent", "Pipe; +https://github.com/88250/pipe").EndStruct(&result)
if nil != errors || http.StatusOK != response.StatusCode {
logger.Errorf("get community user info failed: %+v, %s", errors, data)
Expand Down
137 changes: 0 additions & 137 deletions util/markdowns_test.go

This file was deleted.

0 comments on commit a55266b

Please sign in to comment.