Skip to content

Commit

Permalink
Merge pull request #106 from eolinker/release/v0.12.7
Browse files Browse the repository at this point in the history
Release/v0.12.7
  • Loading branch information
Dot-Liu authored May 10, 2023
2 parents 81f2e4d + 35f125e commit fe8fbda
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 20 deletions.
26 changes: 13 additions & 13 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
stages:
- notice
- check
# - check
- build
- deploy
- publish
Expand Down Expand Up @@ -30,23 +30,23 @@ merge-informer: # 飞书回调
curl -X POST -H "Content-Type: application/json" \
-d "{\"msg_type\":\"text\",\"content\":{\"text\":\"项目:${CI_PROJECT_NAME}\\n提交人:${GITLAB_USER_NAME}\\n提交信息:${CI_MERGE_REQUEST_TITLE}\\n合并分支信息:${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME} -> ${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}\\n差异性地址:${DIFF_URL}\\n请及时review代码\"}}" \
https://open.feishu.cn/open-apis/bot/v2/hook/1c334752-2874-41a1-8f1b-3060f2d46b6c
checker:
stage: check
rules:
- if: $CI_COMMIT_BRANCH=="develop"
script:
- set +e
- go mod tidy
- go test -covermode=atomic -coverpkg=./... -coverprofile=coverage.data -timeout=1m ./...
- golangci-lint run --timeout=3m --out-format checkstyle --issues-exit-code 0 ./... > report.xml
- sonar-scanner
# checker:
# stage: check
# rules:
# - if: $CI_COMMIT_BRANCH=="develop"
# script:
# - set +e
# - go mod tidy
# - go test -covermode=atomic -coverpkg=./... -coverprofile=coverage.data -timeout=1m ./...
# - golangci-lint run --timeout=3m --out-format checkstyle --issues-exit-code 0 ./... > report.xml
# - sonar-scanner
builder:
stage: build
rules:
- if: $CI_COMMIT_BRANCH=="develop"
when: on_success
# when: on_success
- if: $CI_COMMIT_BRANCH=="test"
when: on_success
# when: on_success
script:
- sed -i '/replace github.com\/eolinker\/eosc => */d' go.mod
- go mod tidy
Expand Down
2 changes: 1 addition & 1 deletion drivers/certs/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
)

func Register(register eosc.IExtenderDriverRegister) {
register.RegisterExtenderDriver("ssl-server", newFactory())
_ = register.RegisterExtenderDriver("ssl-server", newFactory())
//setting.RegisterSetting("ssl-server", controller)
}

Expand Down
23 changes: 18 additions & 5 deletions drivers/certs/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package certs
import (
"crypto/tls"
"crypto/x509"

"github.com/eolinker/apinto/certs"
"github.com/eolinker/apinto/drivers"
"github.com/eolinker/apinto/utils"
Expand All @@ -20,6 +19,18 @@ type Worker struct {
config *Config
}

func (w *Worker) Check(conf interface{}, _ map[eosc.RequireId]eosc.IWorker) error {
config, ok := conf.(*Config)
if !ok {
return eosc.ErrorConfigIsNil
}
_, err := parseCert(config.Key, config.Pem)
if err != nil {
return err
}
return nil
}

func (w *Worker) Destroy() error {

controller.Del(w.Id())
Expand Down Expand Up @@ -77,11 +88,13 @@ func genCert(key, pem []byte) (*tls.Certificate, error) {
if err != nil {
return nil, err
}
if certificate.Leaf == nil {

x509Cert, err := x509.ParseCertificate(certificate.Certificate[0])
if err != nil {
return nil, err
x509Cert, err := x509.ParseCertificate(certificate.Certificate[0])
if err != nil {
return nil, err
}
certificate.Leaf = x509Cert
}
certificate.Leaf = x509Cert
return &certificate, nil
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
github.com/brianvoe/gofakeit/v6 v6.20.1
github.com/coocood/freecache v1.2.2
github.com/dubbogo/gost v1.13.1
github.com/eolinker/eosc v0.12.1
github.com/eolinker/eosc v0.12.2
github.com/fasthttp/websocket v1.5.0
github.com/fullstorydev/grpcurl v1.8.7
github.com/go-redis/redis/v8 v8.11.5
Expand Down

0 comments on commit fe8fbda

Please sign in to comment.