mirror of
https://github.com/eiblog/eiblog.git
synced 2026-02-08 15:52:25 +08:00
Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dc3e6659b5 | ||
|
|
ca74d13598 | ||
|
|
82fba0ddb4 | ||
|
|
2b6bae1f74 | ||
|
|
6387412776 | ||
|
|
cfaa25e123 | ||
|
|
6ff6acdbda | ||
|
|
b3b3be448f | ||
|
|
78f5bfc1ce | ||
|
|
4b9eb1ff4d | ||
|
|
7d04b8f5c0 |
5
.github/workflows/release.yml
vendored
5
.github/workflows/release.yml
vendored
@@ -7,7 +7,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
package:
|
package:
|
||||||
runs-on: ubuntu-16.04
|
runs-on: self-hosted
|
||||||
steps:
|
steps:
|
||||||
- name: Golang env
|
- name: Golang env
|
||||||
uses: actions/setup-go@v2
|
uses: actions/setup-go@v2
|
||||||
@@ -35,6 +35,8 @@ jobs:
|
|||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
- name: Build image
|
- name: Build image
|
||||||
|
env:
|
||||||
|
GOPROXY: https://goproxy.io,direct
|
||||||
run: scripts/run_build.sh deepzz0 ${{ steps.vars.outputs.tag }}
|
run: scripts/run_build.sh deepzz0 ${{ steps.vars.outputs.tag }}
|
||||||
|
|
||||||
- name: Package tar
|
- name: Package tar
|
||||||
@@ -44,6 +46,7 @@ jobs:
|
|||||||
if: startsWith(github.ref, 'refs/tags/')
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
GOPROXY: https://goproxy.io,direct
|
||||||
with:
|
with:
|
||||||
files: |
|
files: |
|
||||||
*.tar.gz
|
*.tar.gz
|
||||||
|
|||||||
23
CHANGELOG.md
23
CHANGELOG.md
@@ -2,6 +2,29 @@
|
|||||||
|
|
||||||
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.
|
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.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.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)
|
### [2.1.1](https://github.com/eiblog/eiblog/compare/v2.1.0...v2.1.1) (2021-07-27)
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ $ docker run --name mongodb \
|
|||||||
|
|
||||||
$ docker run --name elasticsearch \
|
$ docker run --name elasticsearch \
|
||||||
-p 9200:9200 \
|
-p 9200:9200 \
|
||||||
-p ${PWD}/esdata:/usr/share/elasticsearch/data \
|
-v ${PWD}/esdata:/usr/share/elasticsearch/data \
|
||||||
deepzz0/elasticsearch:2.4.1
|
deepzz0/elasticsearch:2.4.1
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
2
pkg/cache/cache.go
vendored
2
pkg/cache/cache.go
vendored
@@ -443,7 +443,7 @@ func (c *Cache) loadOrInit() error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// account
|
// account
|
||||||
pwd := tools.EncryptPasswd(blogapp.Account.Password,
|
pwd := tools.EncryptPasswd(blogapp.Account.Username,
|
||||||
blogapp.Account.Password)
|
blogapp.Account.Password)
|
||||||
|
|
||||||
account := &model.Account{
|
account := &model.Account{
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ type Storage struct{}
|
|||||||
|
|
||||||
// BackupData implements timer.Storage
|
// BackupData implements timer.Storage
|
||||||
func (s Storage) BackupData(now time.Time) error {
|
func (s Storage) BackupData(now time.Time) error {
|
||||||
switch config.Conf.Database.Source {
|
switch config.Conf.Database.Driver {
|
||||||
case "mongodb":
|
case "mongodb":
|
||||||
return backupFromMongoDB(now)
|
return backupFromMongoDB(now)
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -283,6 +283,9 @@ func handleAPIPostCreate(c *gin.Context) {
|
|||||||
logrus.Error("handleAPIPostCreate.AddArticle: ", err)
|
logrus.Error("handleAPIPostCreate.AddArticle: ", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cid = article.ID
|
||||||
|
|
||||||
if !article.IsDraft {
|
if !article.IsDraft {
|
||||||
// 异步执行,快
|
// 异步执行,快
|
||||||
go func() {
|
go func() {
|
||||||
|
|||||||
@@ -42,7 +42,6 @@ func QiniuUpload(params UploadParams) (string, error) {
|
|||||||
uploadToken := putPolicy.UploadToken(mac)
|
uploadToken := putPolicy.UploadToken(mac)
|
||||||
// 上传配置
|
// 上传配置
|
||||||
cfg := &storage.Config{
|
cfg := &storage.Config{
|
||||||
Zone: &storage.ZoneHuadong,
|
|
||||||
UseHTTPS: true,
|
UseHTTPS: true,
|
||||||
}
|
}
|
||||||
// uploader
|
// uploader
|
||||||
|
|||||||
47
pkg/internal/qiniu_test.go
Normal file
47
pkg/internal/qiniu_test.go
Normal 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)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,5 @@
|
|||||||
#!/usr/bin/env sh
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
_registry="$1"
|
_registry="$1"
|
||||||
_tag="$2"
|
_tag="$2"
|
||||||
_platform="linux/amd64,linux/arm64,linux/386"
|
_platform="linux/amd64,linux/arm64,linux/386"
|
||||||
@@ -11,11 +9,14 @@ if [ -z "$_registry" ] || [ -z "$_tag" ]; then
|
|||||||
exit 0;
|
exit 0;
|
||||||
fi
|
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
|
# prepare dir ./bin
|
||||||
mkdir -p ./bin
|
mkdir -p ./bin
|
||||||
# create builder
|
|
||||||
docker buildx create --use --name builder
|
|
||||||
|
|
||||||
# build demo app
|
# build demo app
|
||||||
for file in pkg/core/*; do
|
for file in pkg/core/*; do
|
||||||
app="$(basename $file)";
|
app="$(basename $file)";
|
||||||
|
|||||||
Reference in New Issue
Block a user