增加清理附件按钮,对悬空无引用的图片/附件进行清理 (#918)

* add attach_clean & change_theme

* add attach_clean & change_theme

* add

* add readme

---------

Co-authored-by: root <root@DESKTOP-L84EQPB.localdomain>
This commit is contained in:
Sharklet
2023-12-19 13:19:31 +08:00
committed by GitHub
parent 0dbb5d7967
commit 71b8e528ff
13 changed files with 200 additions and 18 deletions

View File

@@ -268,3 +268,59 @@ docker run -p 8181:8181 --name mindoc -e DB_ADAPTER=mysql -e MYSQL_PORT_3306_TCP
一个不纯粹的PHPer一个不自由的 gopher 。
# 部署补充
- 若内网部署draw.io无法使用外网则需要用tomcat运行war包https://github.com/jgraph/drawio 从release下载之后修改markdown.js的TODO行对应的链接即可
- 为了护眼简单增加了编辑界面的主题切换见editormd.js和markdown_edit_template.tpl
- (需重新编译项)为了对已删除文档/文档引用图片删除文字后,对悬空无引用的图片/附件进行清理,增加了清理接口,需重新编译
- 编译后除二进制文件外还需更新三个文件: conf/lang/en-us.ini,zh-cn.ini; attach_list.tpl
- 若不想重新编译也可通过database/clean.py手动执行对无引用图片/附件的文件清理和数据库记录双向清理。
- 若采用nginx二级部署以yourpath/为例,需修改
- conf/app.conf修改`baseurl="/yourpath"`
- static/js/kancloud.js文件中`url: "/comment/xxxxx` => `url: "/yourpath" + "/comment/xxxxx`, 共两处
- nginx端口代理示例:
```
增加
location /yourpath/ {
rewrite ^/yourpath/(.*) /$1 break;
proxy_pass http://127.0.0.1:8181;
}
```
注意使用的是127.0.0.1根据自身选择替换如果nginx是docker部署则还需要在docker中托管运行mindoc具体参考如下配置:
- docker-compose代理示例(docker-nginx代理运行mindoc)
```
version: '3'
services:
mynginx:
image: nginx:latest
ports:
- "8880:80"
command:
- bash
- -c
- |
service nginx start
cd /src/mindoc/ && ./mindoc
volumes:
- ..:/src
- ./nginx:/etc/nginx/conf.d
```
目录结构
```
onefolder
|
- docker
|
- docker-compose.yml
- nginx
|
- mynginx.conf
- mindoc
|
- database/
- conf/
- ...
```