Skip to content

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 Apache Answer.

Merge branch 'feat/1.0.4/comment' into feat/plugin/connector/github

LinkinStar6a8d5e5984a1
diff --cc Makefile
index 1914a49d,90ce5bc1..1decc473
--- a/Makefile
+++ b/Makefile
@@@ -5,16 -5,16 +5,16 @@@ BIN=answe
DIR_SRC=./cmd/answer
DOCKER_CMD=docker
- #GO_ENV=CGO_ENABLED=0
+ GO_ENV=CGO_ENABLED=0 GO111MODULE=on
Revision=$(shell git rev-parse --short HEAD)
-GO_FLAGS=-ldflags="-X main.Version=$(VERSION) -X 'main.Revision=$(Revision)' -X 'main.Time=`date`' -extldflags -static"
+GO_FLAGS=-ldflags="-X answercmd.Version=$(VERSION) -X 'answercmd.Revision=$(Revision)' -X 'answercmd.Time=`date`' -extldflags -static"
GO=$(GO_ENV) $(shell which go)
- build:
- @$(GO_ENV) $(GO) build $(GO_FLAGS) -o $(BIN) $(DIR_SRC)
+ build: generate
+ @$(GO) build $(GO_FLAGS) -o $(BIN) $(DIR_SRC)
# https://dev.to/thewraven/universal-macos-binaries-with-go-1-16-3mm3
- universal:
+ universal: generate
@GOOS=darwin GOARCH=amd64 $(GO_ENV) $(GO) build $(GO_FLAGS) -o ${BIN}_amd64 $(DIR_SRC)
@GOOS=darwin GOARCH=arm64 $(GO_ENV) $(GO) build $(GO_FLAGS) -o ${BIN}_arm64 $(DIR_SRC)
@lipo -create -output ${BIN} ${BIN}_amd64 ${BIN}_arm64
diff --cc go.mod
index 8e98cca2,1db48ddb..16b4b896
--- a/go.mod
+++ b/go.mod
@@@ -22,10 -23,9 +23,10 @@@ require
github.com/jinzhu/copier v0.3.5
github.com/jinzhu/now v1.1.5
github.com/lib/pq v1.10.7
- github.com/mattn/go-sqlite3 v1.14.16
+ github.com/microcosm-cc/bluemonday v1.0.21
github.com/mojocn/base64Captcha v1.3.5
github.com/ory/dockertest/v3 v3.9.1
+ github.com/otiai10/copy v1.7.0
github.com/robfig/cron/v3 v3.0.1
github.com/segmentfault/pacman v1.0.2
github.com/segmentfault/pacman/contrib/cache/memory v0.0.0-20221219081300-f734f4a16aa0
@@@ -70,8 -72,8 +73,9 @@@ require
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect
github.com/golang/snappy v0.0.4 // indirect
+ github.com/google/go-cmp v0.5.9 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
+ github.com/gorilla/css v1.0.0 // indirect
github.com/gosimple/unidecode v1.0.1 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/imdario/mergo v0.3.12 // indirect
diff --cc internal/migrations/migrations.go
index b67bd77d,7b53293e..67c42e96
--- a/internal/migrations/migrations.go
+++ b/internal/migrations/migrations.go
@@@ -55,7 -55,7 +55,8 @@@ var migrations = []Migration
NewMigration("add activity timeline", addActivityTimeline, false),
NewMigration("add user role", addRoleFeatures, false),
NewMigration("add theme and private mode", addThemeAndPrivateMode, true),
+ NewMigration("add new answer notification", addNewAnswerNotification, true),
+ NewMigration("add plugin", addPlugin, false),
}
// GetCurrentDBVersion returns the current db version
diff --cc internal/service/user_common/user.go
index 8d84f288,da66f4ce..724d0b94
--- a/internal/service/user_common/user.go
+++ b/internal/service/user_common/user.go
@@@ -2,7 -2,8 +2,6 @@@ package usercommo
import (
"context"
- "regexp"
- "encoding/hex"
- "math/rand"
"strings"
"github.com/Chain-Zhang/pinyin"
diff --cc internal/service/user_service.go
index c50778df,e7bd4374..48c6355f
--- a/internal/service/user_service.go
+++ b/internal/service/user_service.go
@@@ -20,7 -20,7 +20,8 @@@ import
"github.com/answerdev/answer/internal/service/service_config"
"github.com/answerdev/answer/internal/service/siteinfo_common"
usercommon "github.com/answerdev/answer/internal/service/user_common"
+ "github.com/answerdev/answer/internal/service/user_external_login"
+ "github.com/answerdev/answer/pkg/checker"
"github.com/google/uuid"
"github.com/segmentfault/pacman/errors"
"github.com/segmentfault/pacman/log"