Kuingsmile / PicList

An image upload and manage tool, base on PicGo
https://piclist.cn
MIT License
2.17k stars 91 forks source link

[Bug]: 使用docker安装,无法上传图片 #163

Closed yzgolden86 closed 8 months ago

yzgolden86 commented 8 months ago

前置阅读 | Pre-reading

PicList的版本 | PicList Version

2.7.3

系统信息 | System Information

Linux

问题重现 | Bug reproduce

在远程服务器docker部署了piclist,obsidian中上传图片时,提示 image 应该是图片上传失败,打印docker 日志,应该是没有找到配置文件,我参看文档没有找到所示位置,我只是在/root/piclist/config.json做了修改,也尝试新建了data.json文件,也无果,求教

相关日志 | Logs

2024-02-18 20:01:01 [PicList INFO] Before transform 2024-02-18 20:01:02 [PicList INFO] Transforming... Current transformer is [path] 2024-02-18 20:01:03 [PicList INFO] Before upload 2024-02-18 20:01:03 [PicList INFO] Uploading... Current uploader is [local] 2024-02-18 20:01:03 [PicList WARN] failed 2024-02-18 20:01:03 [PicList ERROR] ------Error Stack Begin------ Error: Can not find local config! at Object.sr [as handle] (/usr/local/share/.config/yarn/global/node_modules/piclist/dist/index.cjs.js:1:66866) at Bt.doUpload (/usr/local/share/.config/yarn/global/node_modules/piclist/dist/index.cjs.js:1:37791) at Bt.start (/usr/local/share/.config/yarn/global/node_modules/piclist/dist/index.cjs.js:1:36531) at async qr.upload (/usr/local/share/.config/yarn/global/node_modules/piclist/dist/index.cjs.js:1:147571) at async /usr/local/share/.config/yarn/global/node_modules/piclist/bin/picgo-server:202:22 -------Error Stack End------- 2024-02-18 20:03:23 [PicList INFO] Before transform 2024-02-18 20:03:23 [PicList INFO] Transforming... Current transformer is [path] 2024-02-18 20:03:23 [PicList INFO] Before upload 2024-02-18 20:03:23 [PicList INFO] Uploading... Current uploader is [local] 2024-02-18 20:03:23 [PicList WARN] failed 2024-02-18 20:03:23 [PicList ERROR] ------Error Stack Begin------ Error: Can not find local config! at Object.sr [as handle] (/usr/local/share/.config/yarn/global/node_modules/piclist/dist/index.cjs.js:1:66866) at Bt.doUpload (/usr/local/share/.config/yarn/global/node_modules/piclist/dist/index.cjs.js:1:37791) at Bt.start (/usr/local/share/.config/yarn/global/node_modules/piclist/dist/index.cjs.js:1:36531) at async qr.upload (/usr/local/share/.config/yarn/global/node_modules/piclist/dist/index.cjs.js:1:147571) at async /usr/local/share/.config/yarn/global/node_modules/piclist/bin/picgo-server:202:22 -------Error Stack End------- 2024-02-18 20:16:54 [PicList INFO] Before transform 2024-02-18 20:16:54 [PicList INFO] Transforming... Current transformer is [path] 2024-02-18 20:16:54 [PicList INFO] Before upload 2024-02-18 20:16:54 [PicList INFO] Uploading... Current uploader is [local] 2024-02-18 20:16:54 [PicList WARN] failed 2024-02-18 20:16:54 [PicList ERROR] ------Error Stack Begin------ Error: Can not find local config! at Object.sr [as handle] (/usr/local/share/.config/yarn/global/node_modules/piclist/dist/index.cjs.js:1:66866) at Bt.doUpload (/usr/local/share/.config/yarn/global/node_modules/piclist/dist/index.cjs.js:1:37791) at Bt.start (/usr/local/share/.config/yarn/global/node_modules/piclist/dist/index.cjs.js:1:36531) at async qr.upload (/usr/local/share/.config/yarn/global/node_modules/piclist/dist/index.cjs.js:1:147571) at async /usr/local/share/.config/yarn/global/node_modules/piclist/bin/picgo-server:202:22 -------Error Stack End------- 2024-02-18 20:28:35 [PicList INFO] Before transform 2024-02-18 20:28:35 [PicList INFO] Transforming... Current transformer is [path] 2024-02-18 20:28:35 [PicList INFO] Before upload 2024-02-18 20:28:35 [PicList INFO] Uploading... Current uploader is [local] 2024-02-18 20:28:35 [PicList WARN] failed 2024-02-18 20:28:35 [PicList ERROR] ------Error Stack Begin------ Error: Can not find local config! at Object.sr [as handle] (/usr/local/share/.config/yarn/global/node_modules/piclist/dist/index.cjs.js:1:66866) at Bt.doUpload (/usr/local/share/.config/yarn/global/node_modules/piclist/dist/index.cjs.js:1:37791) at Bt.start (/usr/local/share/.config/yarn/global/node_modules/piclist/dist/index.cjs.js:1:36531) at async qr.upload (/usr/local/share/.config/yarn/global/node_modules/piclist/dist/index.cjs.js:1:147571) at async /usr/local/share/.config/yarn/global/node_modules/piclist/bin/picgo-server:202:22 -------Error Stack End------- 2024-02-18 20:43:34 [PicList INFO] Before transform 2024-02-18 20:43:34 [PicList INFO] Transforming... Current transformer is [path] 2024-02-18 20:43:34 [PicList INFO] Before upload 2024-02-18 20:43:34 [PicList INFO] Uploading... Current uploader is [local] 2024-02-18 20:43:34 [PicList WARN] failed 2024-02-18 20:43:34 [PicList ERROR] ------Error Stack Begin------ Error: Can not find local config! at Object.sr [as handle] (/usr/local/share/.config/yarn/global/node_modules/piclist/dist/index.cjs.js:1:66866) at Bt.doUpload (/usr/local/share/.config/yarn/global/node_modules/piclist/dist/index.cjs.js:1:37791) at Bt.start (/usr/local/share/.config/yarn/global/node_modules/piclist/dist/index.cjs.js:1:36531) at async qr.upload (/usr/local/share/.config/yarn/global/node_modules/piclist/dist/index.cjs.js:1:147571) at async /usr/local/share/.config/yarn/global/node_modules/piclist/bin/picgo-server:202:22 -------Error Stack End------- 2024-02-18 20:45:55 [PicList INFO] Before transform 2024-02-18 20:45:55 [PicList INFO] Transforming... Current transformer is [path] 2024-02-18 20:45:55 [PicList INFO] Before upload 2024-02-18 20:45:55 [PicList INFO] Uploading... Current uploader is [local] 2024-02-18 20:45:55 [PicList WARN] failed 2024-02-18 20:45:55 [PicList ERROR] ------Error Stack Begin------ Error: Can not find local config! at Object.sr [as handle] (/usr/local/share/.config/yarn/global/node_modules/piclist/dist/index.cjs.js:1:66866) at Bt.doUpload (/usr/local/share/.config/yarn/global/node_modules/piclist/dist/index.cjs.js:1:37791) at Bt.start (/usr/local/share/.config/yarn/global/node_modules/piclist/dist/index.cjs.js:1:36531) at async qr.upload (/usr/local/share/.config/yarn/global/node_modules/piclist/dist/index.cjs.js:1:147571) at async /usr/local/share/.config/yarn/global/node_modules/piclist/bin/picgo-server:202:22 -------Error Stack End------- 2024-02-18 20:59:02 [PicList INFO] Before transform 2024-02-18 20:59:02 [PicList INFO] Transforming... Current transformer is [path] 2024-02-18 20:59:02 [PicList INFO] Before upload 2024-02-18 20:59:02 [PicList INFO] Uploading... Current uploader is [local] 2024-02-18 20:59:02 [PicList WARN] failed 2024-02-18 20:59:02 [PicList ERROR] ------Error Stack Begin------ Error: Can not find local config! at Object.sr [as handle] (/usr/local/share/.config/yarn/global/node_modules/piclist/dist/index.cjs.js:1:66866) at Bt.doUpload (/usr/local/share/.config/yarn/global/node_modules/piclist/dist/index.cjs.js:1:37791) at Bt.start (/usr/local/share/.config/yarn/global/node_modules/piclist/dist/index.cjs.js:1:36531) at async qr.upload (/usr/local/share/.config/yarn/global/node_modules/piclist/dist/index.cjs.js:1:147571) at async /usr/local/share/.config/yarn/global/node_modules/piclist/bin/picgo-server:202:22 -------Error Stack End-------

yzgolden86 commented 8 months ago

{ "picBed": { "uploader": "qiniu", "current": "qiniu", "qiniu": { "accessKeyId": "xxx", "accessKeySecret": "xxx", "bucket": "xx", "area": "na0", "path": "test/", "customUrl": "xxx", "options": "" } } } 配置文件的格式我是这样写的,obsidian中的上传接口我是这样填的,http://域名:36677/upload?key=xxx

Kuingsmile commented 8 months ago

运行docker的时候的-v参数或者docker-compose文件的volumes参数,比如

docker run -d \
  --name piclist \
  --restart always \
  -p 36677:36677 \
  -v "./piclist:/root/.piclist" \
  kuingsmile/piclist:latest \
  node /usr/local/bin/picgo-server -k piclist123456

其中的-v "./piclist:/root/.piclist"里的第一个./piclist指的是你的config.json文件所在的目录,比如你的配置文件在/root/piclist/config.json,那就需要改成-v "/root/piclist:/root/.piclist"