Compare commits

..

15 Commits

Author SHA1 Message Date
henry.chen
6805afa759 chore(release): 2.1.5 2021-10-27 09:07:50 +08:00
henry.chen
4f6f85a85a fix(release): golang env 2021-10-27 09:06:37 +08:00
henry.chen
dc3e6659b5 chore(release): 2.1.4 2021-10-26 16:18:21 +08:00
henry.chen
ca74d13598 chore(release): 2.1.4 2021-10-26 16:18:00 +08:00
henry.chen
82fba0ddb4 fix(release): github action runner 2021-10-26 16:17:50 +08:00
henry.chen
2b6bae1f74 chore(release): 2.1.3 2021-10-15 16:54:47 +08:00
Deepzz
6387412776 Update README.md 2021-09-14 21:32:37 +08:00
razeen
cfaa25e123 fix(auto_save): fix auto save return empty id 2021-08-15 03:51:45 -07:00
Deepzz
6ff6acdbda Merge pull request #32 from eiblog/qiniu_zone
qiniu upload remove zone, support all zone upload
2021-08-12 09:19:56 +08:00
razeen
b3b3be448f chore(qiniu): qiniu upload remove zone, support all zone upload 2021-08-11 08:31:04 -07:00
henry.chen
78f5bfc1ce fix: backup app judge db driver 2021-08-11 18:44:35 +08:00
Deepzz
4b9eb1ff4d Merge pull request #29 from eiblog/fix_init_password
初始化地方参数错了。。。
2021-08-10 16:17:10 +08:00
Razeen
7d04b8f5c0 fix(pwd): fix init pwd 2021-08-10 10:37:42 +08:00
henry.chen
d000090e30 chore(release): 2.1.2 2021-07-27 17:19:04 +08:00
henry.chen
56e396f252 chore: restore app.yml database 2021-07-27 17:18:58 +08:00
10 changed files with 98 additions and 12 deletions

View File

@@ -7,7 +7,7 @@ on:
jobs:
package:
runs-on: ubuntu-16.04
runs-on: self-hosted
steps:
- name: Golang env
uses: actions/setup-go@v2
@@ -35,9 +35,13 @@ jobs:
password: ${{ secrets.DOCKER_PASSWORD }}
username: ${{ secrets.DOCKER_USERNAME }}
- name: Build image
env:
GOPROXY: https://goproxy.io,direct
run: scripts/run_build.sh deepzz0 ${{ steps.vars.outputs.tag }}
- name: Package tar
env:
GOPROXY: https://goproxy.io,direct
run: scripts/dist_tar.sh ${{ steps.vars.outputs.tag }}
- name: Release push
uses: softprops/action-gh-release@v1

View File

@@ -2,6 +2,38 @@
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
### [2.1.5](https://github.com/eiblog/eiblog/compare/v2.1.4...v2.1.5) (2021-10-27)
### Bug Fixes
* **release:** golang env ([4f6f85a](https://github.com/eiblog/eiblog/commit/4f6f85a85ae56849c49e91d76bbbce1790f16e29))
### [2.1.4](https://github.com/eiblog/eiblog/compare/v2.1.3...v2.1.4) (2021-10-26)
### Bug Fixes
* **release:** github action runner ([82fba0d](https://github.com/eiblog/eiblog/commit/82fba0ddb47c1f66cb659f775c120c08dd2b4447))
### [2.1.4](https://github.com/eiblog/eiblog/compare/v2.1.3...v2.1.4) (2021-10-26)
### Bug Fixes
* **release:** github action runner ([82fba0d](https://github.com/eiblog/eiblog/commit/82fba0ddb47c1f66cb659f775c120c08dd2b4447))
### [2.1.3](https://github.com/eiblog/eiblog/compare/v2.1.2...v2.1.3) (2021-10-15)
### Bug Fixes
* **auto_save:** fix auto save return empty id ([cfaa25e](https://github.com/eiblog/eiblog/commit/cfaa25e1239aba580e0718d40f1a2bf31158b217))
* backup app judge db driver ([78f5bfc](https://github.com/eiblog/eiblog/commit/78f5bfc1ce017bf77a7442f40963a706e608df51))
* **pwd:** fix init pwd ([7d04b8f](https://github.com/eiblog/eiblog/commit/7d04b8f5c0846bcd0c7e07d0fc3704a535f6360a))
### [2.1.2](https://github.com/eiblog/eiblog/compare/v2.1.1...v2.1.2) (2021-07-27)
### [2.1.1](https://github.com/eiblog/eiblog/compare/v2.1.0...v2.1.1) (2021-07-27)

View File

@@ -29,7 +29,7 @@ $ docker run --name mongodb \
$ docker run --name elasticsearch \
-p 9200:9200 \
-p ${PWD}/esdata:/usr/share/elasticsearch/data \
-v ${PWD}/esdata:/usr/share/elasticsearch/data \
deepzz0/elasticsearch:2.4.1
```

View File

@@ -1,7 +1,7 @@
appname: eiblog
database:
driver: sqlite
source: ./eiblog.db
driver: postgres
source: host=localhost port=5432 user=postgres dbname=eiblog sslmode=disable password=MTI3LjAuMC4x
eshost:
eiblogapp:
mode:

2
pkg/cache/cache.go vendored
View File

@@ -443,7 +443,7 @@ func (c *Cache) loadOrInit() error {
}
}
// account
pwd := tools.EncryptPasswd(blogapp.Account.Password,
pwd := tools.EncryptPasswd(blogapp.Account.Username,
blogapp.Account.Password)
account := &model.Account{

View File

@@ -18,7 +18,7 @@ type Storage struct{}
// BackupData implements timer.Storage
func (s Storage) BackupData(now time.Time) error {
switch config.Conf.Database.Source {
switch config.Conf.Database.Driver {
case "mongodb":
return backupFromMongoDB(now)
default:

View File

@@ -283,6 +283,9 @@ func handleAPIPostCreate(c *gin.Context) {
logrus.Error("handleAPIPostCreate.AddArticle: ", err)
return
}
cid = article.ID
if !article.IsDraft {
// 异步执行,快
go func() {

View File

@@ -42,7 +42,6 @@ func QiniuUpload(params UploadParams) (string, error) {
uploadToken := putPolicy.UploadToken(mac)
// 上传配置
cfg := &storage.Config{
Zone: &storage.ZoneHuadong,
UseHTTPS: true,
}
// uploader

View File

@@ -0,0 +1,47 @@
// Package internal provides ...
package internal
import (
"os"
"testing"
"time"
"github.com/eiblog/eiblog/pkg/config"
)
func TestQiniuUpload(t *testing.T) {
f, _ := os.Open("qiniu_test.go")
fi, _ := f.Stat()
type args struct {
params UploadParams
}
tests := []struct {
name string
args args
wantErr bool
}{
// TODO: Add test cases.
{"1", args{params: UploadParams{
Name: "test-" + time.Now().Format("200601021504059999") + ".go",
Size: fi.Size(),
Data: f,
Conf: config.Qiniu{
AccessKey: os.Getenv("QINIU_ACCESSKEY"),
SecretKey: os.Getenv("QINIU_SECRETKEY"),
Bucket: os.Getenv("QINIU_BUCKET"),
},
}}, false},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
got, err := QiniuUpload(tt.args.params)
if (err != nil) != tt.wantErr {
t.Errorf("QiniuUpload() error = %v, wantErr %v", err, tt.wantErr)
return
}
t.Logf("QiniuUpload() = %v", got)
})
}
}

View File

@@ -1,7 +1,5 @@
#!/usr/bin/env sh
set -e
_registry="$1"
_tag="$2"
_platform="linux/amd64,linux/arm64,linux/386"
@@ -11,11 +9,14 @@ if [ -z "$_registry" ] || [ -z "$_tag" ]; then
exit 0;
fi
# create and use builder
docker buildx inspect builder >/dev/null 2>&1
if [ "$?" != "0" ]; then
docker buildx create --use --name builder
fi
# prepare dir ./bin
mkdir -p ./bin
# create builder
docker buildx create --use --name builder
# build demo app
for file in pkg/core/*; do
app="$(basename $file)";