Compare commits

...

28 Commits

Author SHA1 Message Date
henry.chen
c51055a0db chore(release): 2.1.16 2022-11-20 23:40:06 +08:00
henry.chen
445b188517 chore: imgtonormal add at xmlTmpl 2022-11-20 23:37:49 +08:00
henry.chen
4bfff2e5e9 fix: rss image path incorrect: data-src -> src 2022-11-20 23:33:10 +08:00
Deepzz
aa91997c0c fix(backup): error path in compressed file 2022-10-14 14:45:15 +08:00
henry.chen
3b2a6689be chore: update 2022-10-01 21:18:53 +08:00
henry.chen
4c46be3f03 chore: update readme 2022-10-01 21:09:53 +08:00
henry.chen
da47e9880f chore: update readme 2022-09-30 09:51:44 +08:00
henry.chen
4f92e0d619 chore(release): 2.1.15 2022-09-28 19:00:36 +08:00
henry.chen
3a8f7d120b chore: rm dns with cgo 2022-09-28 19:00:26 +08:00
Deepzz
cf0a897ad0 chore(app.yml): default db use sqlite 2022-09-28 18:59:28 +08:00
henry.chen
418b604946 chore(release): 2.1.14 2022-09-28 18:20:41 +08:00
henry.chen
b93c320987 fix: cgo and sqlite build in alpine image closed #28 2022-09-28 18:20:38 +08:00
henry.chen
b24f7c0666 chore(release): 2.1.13 2022-09-27 10:50:22 +08:00
Deepzz
efe80fbc6b Update feedTpl.xml 2022-09-21 09:47:50 +08:00
henry.chen
65b89bcae5 chore(release): 2.1.12 2022-08-09 18:41:21 +08:00
henry.chen
289b8145bc fix: #35 no pubDate added for feed generation 2022-08-09 18:40:52 +08:00
henry.chen
bf0ad811ff chore(release): 2.1.11 2022-07-19 22:35:32 +08:00
henry.chen
db00a9b527 chore: upgrade to yaml.v3 close #1 2022-05-27 09:13:22 +08:00
henry.chen
38aa704198 fix(backup): configuration error 2022-05-11 10:16:38 +08:00
henry.chen
9c58447e3b chore(release): 2.1.10 2022-04-22 13:45:50 +08:00
Deepzz
34fc5f368c Update release.yml 2022-04-22 13:44:03 +08:00
Deepzz
daa561e67e Update eiblog.conf 2022-03-22 18:16:12 +08:00
henry.chen
364d293660 chore(release): 2.1.9 2022-02-14 17:50:42 +08:00
henry.chen
5170844623 fix(eiblog): comments title error 2022-01-10 15:50:13 +08:00
henry.chen
7047a3599d chore(docs): add docs images 2022-01-06 09:33:06 +08:00
Deepzz
d0c830c1e6 Create FUNDING.yml 2021-12-15 09:20:34 +08:00
henry.chen
bf699e4957 chore(release): 2.1.8 2021-11-18 10:47:10 +08:00
henry.chen
c315737871 chore: clean alpine respositories 2021-11-18 10:47:06 +08:00
35 changed files with 177 additions and 100 deletions

12
.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1,12 @@
# These are supported funding model platforms
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: eiblog
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

View File

@@ -7,7 +7,7 @@ on:
jobs:
package:
runs-on: self-hosted
runs-on: ubuntu-latest
steps:
- name: Golang env
uses: actions/setup-go@v2

View File

@@ -2,6 +2,50 @@
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.16](https://github.com/eiblog/eiblog/compare/v2.1.15...v2.1.16) (2022-11-20)
### Bug Fixes
* **backup:** error path in compressed file ([aa91997](https://github.com/eiblog/eiblog/commit/aa91997c0caca27e9979692879f8877765dabd9d))
* rss image path incorrect: data-src -> src ([4bfff2e](https://github.com/eiblog/eiblog/commit/4bfff2e5e9b0efb4112a5f2f6bc55eebcef1c6eb))
### [2.1.15](https://github.com/eiblog/eiblog/compare/v2.1.14...v2.1.15) (2022-09-28)
### [2.1.14](https://github.com/eiblog/eiblog/compare/v2.1.13...v2.1.14) (2022-09-28)
### Bug Fixes
* cgo and sqlite build in alpine image closed [#28](https://github.com/eiblog/eiblog/issues/28) ([b93c320](https://github.com/eiblog/eiblog/commit/b93c320987a936db6e5ca50c547022de9ab9a0f1))
### [2.1.13](https://github.com/eiblog/eiblog/compare/v2.1.12...v2.1.13) (2022-09-27)
### [2.1.12](https://github.com/eiblog/eiblog/compare/v2.1.11...v2.1.12) (2022-08-09)
### Bug Fixes
* [#35](https://github.com/eiblog/eiblog/issues/35) no pubDate added for feed generation ([289b814](https://github.com/eiblog/eiblog/commit/289b8145bcdabd0060c9a0d5f40f5df69d3882d3))
### [2.1.11](https://github.com/eiblog/eiblog/compare/v2.1.10...v2.1.11) (2022-07-19)
### Bug Fixes
* **backup:** configuration error ([38aa704](https://github.com/eiblog/eiblog/commit/38aa704198070d3e1436b230b40b1deb3e94c5ac))
### [2.1.10](https://github.com/eiblog/eiblog/compare/v2.1.9...v2.1.10) (2022-04-22)
### [2.1.9](https://github.com/eiblog/eiblog/compare/v2.1.8...v2.1.9) (2022-02-14)
### Bug Fixes
* **eiblog:** comments title error ([5170844](https://github.com/eiblog/eiblog/commit/517084462336ce01c3f79099c1e54297979f5877))
### [2.1.8](https://github.com/eiblog/eiblog/compare/v2.1.7...v2.1.8) (2021-11-18)
### [2.1.7](https://github.com/eiblog/eiblog/compare/v2.1.6...v2.1.7) (2021-11-13)
### [2.1.6](https://github.com/eiblog/eiblog/compare/v2.1.5...v2.1.6) (2021-11-12)

View File

@@ -6,9 +6,43 @@
但它有着部署简单(上线复杂!)的特点,不推荐没有计算机知识的朋友搭建,欢迎咨询。该博客的个中优点(简洁、轻快,安全),等你体验。
Docker镜像地址
* 博客服务:[deepzz0/eiblog](https://hub.docker.com/r/deepzz0/eiblog)
* 博客搜索:[deepzz0/elasticsearch](https://hub.docker.com/r/deepzz0/elasticsearch)
* 数据备份:[deepzz0/backup](https://hub.docker.com/r/deepzz0/backup)
### 快速体验
这里以 mongodb 为例,更多支持的后端存储服务如下:
**二进制**
1、下载压缩包到 [这里](https://github.com/eiblog/eiblog/releases) 下载 eiblog非backup 相应系统压缩包,然后解压缩。
2、启动服务`./backend`
**Docker**
```
$ docker run --name eiblog \
-p 9000:9000 \
deepzz0/eiblog:latest
```
**Compose**
参考项目根目录下的 [docker-compose.yml](https://github.com/eiblog/eiblog/blob/v2/docker-compose.yml),修改相关配置:
```
$ docker compose up -d
$ docker-compose up -d
```
然后访问 `localhost:9000` 就可以了,后台地址 `localhost:9000/admin/login`,默认账户密码 `deepzz/deepzz`
> 默认情况下未开启博客搜索 `elasticsearch`,需要的话需要启动 es 服务并修改配置 `app.yml`。
**数据库支持**
| 类型driver | 地址source示例 |
| -------------- | ------------------------------------------------------------ |
@@ -19,42 +53,6 @@
| sqlserver | sqlserver://user:password@localhost:9930?database=eiblog |
| clickhouse | tcp://localhost:9000?database=eiblog&username=user&password=password&read_timeout=10&write_timeout=20 |
1、启动依赖服务mongodb、elasticsearch
```
$ docker run --name mongodb \
-p 27017:27017 \
-v ${PWD}/mgodb:/data/db \
mongo:3.2
$ docker run --name elasticsearch \
-p 9200:9200 \
-v ${PWD}/esdata:/usr/share/elasticsearch/data \
deepzz0/elasticsearch:2.4.1
```
2、下载压缩包到 [这里](https://github.com/eiblog/eiblog/releases) 下载 eiblog非backup 相应系统压缩包,然后解压缩。
3、修改配置将数据库与ES地址修改为相应地址
```
# 修改 conf/app.yml 数据库连接配置
database:
driver: mongodb
source: mongodb://localhost:27017
# 修改 conf/app.yml ES连接配置如果不启用搜索功能可以置空
eshost: http://localhost:9200
```
4、启动服务
```
./backend
```
然后访问 `localhost:9000` 就可以了,后台地址 `localhost:9000/admin/login`,默认账户密码 `deepzz/deepzz`
### 功能特性
本着博客本质用来分享知识的特点,`EiBlog` 不会有较强的定制功能包括主题CDN支持等仅保持常用简单页面与功能
@@ -85,12 +83,11 @@ eshost: http://localhost:9200
### 博客页面
可以容易的看到 [httpsecurityreport](https://httpsecurityreport.com/?report=deepzz.com) 评分`96`[ssllabs](https://www.ssllabs.com/ssltest/analyze.html?d=deepzz.com&latest) 评分`A+`[myssl](https://myssl.com/deepzz.com) 评分`A+`,堪称完美。这些安全的相关配置会在后面的部署过程中接触到。
可以容易的看到 [ssllabs](https://www.ssllabs.com/ssltest/analyze.html?d=deepzz.com&latest) 评分`A+`[myssl](https://myssl.com/deepzz.com) 评分`A+`,堪称完美。这些安全的相关配置会在后面的部署过程中接触到。
![show-home](https://st.deepzz.com/blog/img/show-home.png)
![show-home2](https://st.deepzz.com/blog/img/show-home2.png)
![show-admin](https://st.deepzz.com/blog/img/show-admin.png)
![show-home](./docs/img/show-home.png)
![show-home2](./docs/img/show-home2.png)
![show-admin](./docs/img/show-admin.png)
### 更多文档

View File

@@ -1,7 +1,8 @@
FROM alpine:latest
LABEL maintainer="deepzz.qi@gmail.com"
RUN apk add --update --no-cache tzdata ca-certificates mongodb-tools
RUN sed -i "s/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g" /etc/apk/repositories \
&& apk add --update --no-cache tzdata ca-certificates mongodb-tools
COPY README.md /app/README.md
COPY CHANGELOG.md /app/CHANGELOG.md
COPY LICENSE /app/LICENSE

View File

@@ -1,7 +1,8 @@
FROM alpine:latest
LABEL maintainer="deepzz.qi@gmail.com"
RUN apk add --update --no-cache tzdata
RUN sed -i "s/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g" /etc/apk/repositories \
&& apk add --update --no-cache tzdata
COPY README.md /app/README.md
COPY CHANGELOG.md /app/CHANGELOG.md
COPY LICENSE /app/LICENSE

View File

@@ -30,7 +30,7 @@ func runTimer(endRun chan error) {
}
func runHTTPServer(endRun chan error) {
if !config.Conf.EiBlogApp.EnableHTTP {
if !config.Conf.BackupApp.EnableHTTP {
return
}
@@ -46,7 +46,7 @@ func runHTTPServer(endRun chan error) {
ping.RegisterRoutes(e)
// start
address := fmt.Sprintf(":%d", config.Conf.EiBlogApp.HTTPPort)
address := fmt.Sprintf(":%d", config.Conf.BackupApp.HTTPPort)
go func() {
endRun <- e.Run(address)
}()

View File

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

View File

@@ -21,7 +21,6 @@ services:
- elasticsearch
- mongodb
environment:
- GODEBUG=netdns=cgo
- RUN_MODE=prod
ports:
- 127.0.0.1:9000:9000

View File

@@ -2,42 +2,58 @@
> 博客项目结构参考模版https://github.com/deepzz0/appdemo
EiBlog 镜像仓库地址https://hub.docker.com/u/deepzz0
用过其它博客系统,不喜欢,不够轻,不够快!这是我开发的第二款博客系统,也实在不想再在这件事情上过多纠结了。`EiBlog` 是一个比较稳定的博客系统,现已迭代至 `2.0` 版本,稳定性和维护你是不用担心的。
但它有着部署简单(上线复杂!)的特点,不推荐没有计算机知识的朋友搭建,欢迎咨询。该博客的个中优点(简洁、轻快,安全),等你体验。
### 快速体验
1、下载程序压缩包到 [这里](https://github.com/eiblog/eiblog/releases) 下载 eiblog 相应系统压缩包,然后解压缩。
这里以 mongodb 为例,更多支持的后端存储服务如下:
2、启动数据库服务博客支持多种数据库后端如MongoDB、MySQL、Postgres、SQLite等。
| 类型driver | 地址source示例 |
| -------------- | ------------------------------------------------------------ |
| mongodb | mongodb://localhost:27017 |
| mysql | user:password@tcp(localhost:3306)/eiblog?charset=utf8mb4&parseTime=True&loc=Local |
| postgres | host=localhost port=5432 user=user password=password dbname=eiblog sslmode=disable |
| sqlite | /path/eiblog.db |
| sqlserver | sqlserver://user:password@localhost:9930?database=eiblog |
| clickhouse | tcp://localhost:9000?database=eiblog&username=user&password=password&read_timeout=10&write_timeout=20 |
1、启动依赖服务mongodb、elasticsearch
```
$ docker run --name mongodb \
-p 27017:27017 \
-v ${PWD}/mgodb:/data/db \
mongo:3.2
$ docker run --name elasticsearch \
-p 9200:9200 \
-v ${PWD}/esdata:/usr/share/elasticsearch/data \
deepzz0/elasticsearch:2.4.1
```
2、下载压缩包到 [这里](https://github.com/eiblog/eiblog/releases) 下载 eiblog非backup 相应系统压缩包,然后解压缩。
3、修改配置将数据库与ES地址修改为相应地址
```
# 修改 conf/app.yml 数据库连接配置
# driver可选mongodb、mysql、postgres、sqlite、sqlserver、clickhouse、redis等
# source为相应的连接地址
database:
driver: postgres
source: host=localhost port=5432 user=postgres dbname=eiblog sslmode=disable password=MTI3LjAuMC4x
```
driver: mongodb
source: mongodb://localhost:27017
3、启动 ES 搜索服务:博客使用 ElasticSearch 2.4.1 做为搜索引擎。
```
# 修改 conf/app.yml ElasticSearch连接配置
# 如果不启用搜索功能可以置空
# 修改 conf/app.yml ES连接配置如果不启用搜索功能可以置空
eshost: http://localhost:9200
```
4、启动博客程序。
4、启动服务:
```
./backend
```
然后访问 `localhost:9000` 就可以了。
然后访问 `localhost:9000` 就可以了,后台地址 `localhost:9000/admin/login`,默认账户密码 `deepzz/deepzz`
### 功能特性
@@ -49,16 +65,16 @@ eshost: http://localhost:9200
功能说明:
- [x] 博客归档,利用时间线帮助我们将归纳博文,内容少于一年按月归档,大于则按年归档。
- [x] 博客专题,有时候博文是同一系列,专题能够帮助我们很好归纳博文,对阅读者是非常友好的。
- [x] 标签系统,每篇博文都可以打上不同标签,使得在归档和专题不满足的情况下自定义归档,这块辅助搜索简直完美。
- [x] 搜索系统依托ElasticSearch实现的站内搜索速度与效率并存再加上google opensearch搜索只流畅。
- [x] 管理后台,内嵌全功能 `Typecho` 后台系统,全功能 `Markdown` 编辑器让你感觉什么是简洁清爽。
- [x] 谷歌统计由于google api的速度问题从而实现了后端API异步统计使得博客页面加载飞速。
- [x] Disqus评论国内评论系统不友好因此选择disqus又由于众所周知原因国内不能用实现另类disqus评论方式。
- [x] 多存储后端支持mongodb、mysql、postgres、sqlite等存储后端。
- [x] 七牛CDN支持在 `Markdown` 编辑器直接上传附件,让你只考虑编辑内容,解放思想。
- [x] 自动备份支持多存储后端的备份功能备份数据保存到七牛CDN上。
* 博客归档,利用时间线帮助我们将归纳博文,内容少于一年按月归档,大于则按年归档。
* 博客专题,有时候博文是同一系列,专题能够帮助我们很好归纳博文,对阅读者是非常友好的。
* 标签系统,每篇博文都可以打上不同标签,使得在归档和专题不满足的情况下自定义归档,这块辅助搜索简直完美。
* 搜索系统依托ElasticSearch实现的站内搜索速度与效率并存再加上google opensearch搜索只流畅。
* 管理后台,内嵌全功能 `Typecho` 后台系统,全功能 `Markdown` 编辑器让你感觉什么是简洁清爽。
* 谷歌统计由于google api的速度问题从而实现了后端API异步统计使得博客页面加载飞速。
* Disqus评论国内评论系统不友好因此选择disqus又由于众所周知原因国内不能用实现另类disqus评论方式。
* 多存储后端支持mongodb、mysql、postgres、sqlite等存储后端。
* 七牛CDN支持在 `Markdown` 编辑器直接上传附件,让你只考虑编辑内容,解放思想。
* 自动备份支持多存储后端的备份功能备份数据保存到七牛CDN上。
当然,为了让整个系统加载速度更快,还做了更多优化措施:
@@ -71,10 +87,9 @@ eshost: http://localhost:9200
可以容易的看到 [httpsecurityreport](https://httpsecurityreport.com/?report=deepzz.com) 评分`96`[ssllabs](https://www.ssllabs.com/ssltest/analyze.html?d=deepzz.com&latest) 评分`A+`[myssl](https://myssl.com/deepzz.com) 评分`A+`,堪称完美。这些安全的相关配置会在后面的部署过程中接触到。
![show-home](https://st.deepzz.com/blog/img/show-home.png)
![show-home2](https://st.deepzz.com/blog/img/show-home2.png)
![show-admin](https://st.deepzz.com/blog/img/show-admin.png)
![show-home](./img/show-home.png)
![show-home2](./img/show-home2.png)
![show-admin](./img/show-admin.png)
### 更多文档

View File

@@ -13,13 +13,13 @@ twitter:
每当你发部一个推文,你如果带上你的网址,它会自动给你展示成卡片的形式
![twitter-pub](https://st.deepzz.com/blog/img/twitter-pub.png)
![twitter-pub](./img/twitter-pub.png)
![twitter-pub2](https://st.deepzz.com/blog/img/twitter-pub2.png)
![twitter-pub2](./img/twitter-pub2.png)
可以看到``之前是没有内容的,该内容是我们文章的描述。
### Google OpenSearch
在 Chrome 浏览器上,你可以在输入网站后按 TAB 键进入搜索模式,如:
![opensearch](/Users/edz/go/src/github.com/eiblog/eiblog/opensearch.gif)
![opensearch](./img/opensearch.gif)

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

BIN
docs/img/article-title.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

BIN
docs/img/blank.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

BIN
docs/img/default_avatar.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

BIN
docs/img/opensearch.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 MiB

BIN
docs/img/show-admin.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 566 KiB

BIN
docs/img/show-home.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 547 KiB

BIN
docs/img/show-home2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 382 KiB

BIN
docs/img/twitter-pub.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
docs/img/twitter-pub2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

View File

@@ -24,14 +24,14 @@
结果是:
![article-title](https://st.deepzz.com/blog/img/article-title.png)
![article-title](./img/article-title.png)
### 文章描述
文章描述,主要是给`html->head->meta`中的 name 为 description 用的。现采用了一个临时的办法:在文章的第一行通过前缀识别(只看第一行)。
该前缀可到`conf/app.yml`设置,默认为`Desc:`,如:
![article-description](https://st.deepzz.com/blog/img/article-description.png)
![article-description](./img/article-description.png)
### 图片懒加载
博客系统提供图片懒加载功能浏览到某个位置图片才会加载以此来提高页面加载速度。我们可根据需要是否使用。当然由此带来的坏处就是rss不能够正确加载图片。后续看是否解决这个问题或朋友提PR。
@@ -44,7 +44,7 @@
```
![sublime-dialog](https://st.deepzz.com/blog/img/dialog-box-without-all-contols.png)
```
![sublime-dialog](https://st.deepzz.com/blog/img/dialog-box-without-all-contols.png)
![sublime-dialog](./img/dialog-box-without-all-contols.png)
懒加载,需要为该图片指定大小(长高):
```
@@ -61,7 +61,7 @@ x 为小写字母x,y,z中的 x。使页面未加载时也占了相应的
### 摘要截取
摘要截取主要是提供给首页显示,如:
![deepzz-home-page](https://st.deepzz.com/blog/img/deepzz-home-page.jpg)
![deepzz-home-page](./img/deepzz-home-page.jpeg)
红框中圈出来的就是截取出来的内容。在 `conf/app.yml` 的配置项有两个:

View File

@@ -17,7 +17,7 @@ server {
server_tokens off;
location / {
rewrite ^/(.*)$ https://$host/$1 permanent;
rewrite ^/(.*)$ https://deepzz.com/$1 permanent;
}
}
@@ -61,6 +61,10 @@ server {
root /usr/share/nginx/html;
expires 1d;
}
if ($host != 'deepzz.com' ) {
rewrite ^/(.*)$ https://deepzz.com/$1 permanent;
}
# proxy setting
proxy_http_version 1.1;

3
go.mod
View File

@@ -3,7 +3,6 @@ module github.com/eiblog/eiblog
go 1.15
require (
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751
github.com/eiblog/blackfriday v0.0.0-20161010144836-c0ec111761ae
github.com/gin-contrib/sessions v0.0.3
github.com/gin-gonic/gin v1.7.4
@@ -17,7 +16,7 @@ require (
go.mongodb.org/mongo-driver v1.5.1
google.golang.org/grpc v1.35.0
google.golang.org/protobuf v1.25.0
gopkg.in/yaml.v2 v2.4.0
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
gorm.io/driver/clickhouse v0.1.0
gorm.io/driver/mysql v1.0.6
gorm.io/driver/postgres v1.0.8

2
go.sum
View File

@@ -8,8 +8,6 @@ github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tN
github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M=
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM=
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/aws/aws-sdk-go v1.34.28 h1:sscPpn/Ns3i0F4HPEWAVcwdIRaZZCuL7llJ2/60yPIk=
github.com/aws/aws-sdk-go v1.34.28/go.mod h1:H7NKnBqNVzoTJpGfLrQkkD+ytBA93eiDYi/+8rV9s48=
github.com/bkaradzic/go-lz4 v1.0.0 h1:RXc4wYsyz985CkXXeX04y4VnZFGG8Rd43pRaHsOXAKk=

View File

@@ -7,7 +7,7 @@ import (
"path/filepath"
"strings"
"gopkg.in/yaml.v2"
"gopkg.in/yaml.v3"
)
var (

View File

@@ -44,7 +44,7 @@ func backupFromMongoDB(now time.Time) error {
}
// tar
name := fmt.Sprintf("eiblog-%s.tar.gz", now.Format("2006-01-02"))
arg = fmt.Sprintf("tar czf /tmp/%s /tmp/eiblog", name)
arg = fmt.Sprintf("tar czf /tmp/%s -C /tmp eiblog", name)
cmd = exec.CommandContext(ctx, "sh", "-c", arg)
err = cmd.Run()
if err != nil {

View File

@@ -21,7 +21,8 @@ func init() {
var err error
xmlTmpl, err = template.New("").Funcs(template.FuncMap{
"dateformat": tools.DateFormat,
"dateformat": tools.DateFormat,
"imgtonormal": tools.ImgToNormal,
}).ParseGlob(root)
if err != nil {
panic(err)

View File

@@ -240,7 +240,7 @@ func handleDisqusPage(c *gin.Context) {
}
article := cache.Ei.ArticlesMap[array[0]]
params := gin.H{
"Titile": "发表评论 | " + cache.Ei.Blogger.BTitle,
"Title": "发表评论 | " + cache.Ei.Blogger.BTitle,
"ATitle": article.Title,
"Thread": array[1],
"Slug": article.Slug,

View File

@@ -10,8 +10,8 @@ for file in pkg/core/*; do
# tar platform
for os in linux darwin windows; do
_target="$app-$_tag.$os-$_arch.tar.gz"
CGO_ENABLED=0 GOOS=$os GOARCH=$_arch \
go build -tags prod -o backend "./cmd/$app"
GOOS=$os GOARCH=$_arch \
go build -tags prod -ldflags '-extldflags "-static"' -o backend "./cmd/$app"
if [ "$app" = "eiblog" ]; then
tar czf $_target conf website assets backend
else

View File

@@ -20,7 +20,7 @@ mkdir -p ./bin
# build demo app
for file in pkg/core/*; do
app="$(basename $file)";
CGO_ENABLED=0 go build -tags prod -o bin/backend "./cmd/$app"
go build -tags prod -ldflags '-extldflags "-static"' -o bin/backend "./cmd/$app"
# docker image
docker buildx build --platform "$_platform" \
-f "build/package/$app.Dockerfile" \

View File

@@ -73,3 +73,8 @@ func GetAvatar(domain string) string {
return avatar
}
// ImgToNormal replace lazy image attr data-src to src
func ImgToNormal(content string) string {
return strings.ReplaceAll(content, "data-src=", "src=")
}

View File

@@ -15,8 +15,9 @@
<comments>https://{{$.Host}}/post/{{.Slug}}.html#comments</comments>
<guid>https://{{$.Host}}/post/{{.Slug}}.html</guid>
<description>
<![CDATA[<blockquote>{{.Content}}<p>本文链接:<a href="https://{{$.Host}}/post/{{.Slug}}.html">https://{{$.Host}}/post/{{.Slug}}.html</a><a href="https://{{$.Host}}/post/{{.Slug}}.html#comments">参与评论 »</a></p>]]>
<![CDATA[{{imgtonormal .Content}}<p>本文链接:<a href="https://{{$.Host}}/post/{{.Slug}}.html">https://{{$.Host}}/post/{{.Slug}}.html</a><a href="https://{{$.Host}}/post/{{.Slug}}.html#comments">参与评论 »</a></p>]]>
</description>
<pubDate>{{dateformat .CreatedAt "Mon, 02 Jan 2006 15:04:05 -0700"}}</pubDate>
</item>
{{end}}
</channel>