id: 56999f1354994458bd8c299896ca13dc
parent_id: 
item_type: 1
item_id: 8e020be1e870405284977eae4f9e30f2
item_updated_time: 1764345604720
title_diff: "[{\"diffs\":[[1,\"Docker部署思源笔记, 数据自己掌握\"]],\"start1\":0,\"start2\":0,\"length1\":0,\"length2\":20}]"
body_diff: "[{\"diffs\":[[1,\"<html>\\\r\\\n<head>\\\r\\\n  <title>Docker部署思源笔记, 数据自己掌握</title>\\\r\\\n  <basefont face=\\\"微软雅黑\\\" size=\\\"2\\\" />\\\r\\\n  <meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html;charset=utf-8\\\" />\\\r\\\n  <meta name=\\\"exporter-version\\\" content=\\\"YXBJ Windows/608924 (zh-CN, DDL); Windows/10.0.0 (Win64); EDAMVersion=V2;\\\"/>\\\r\\\n  <style>\\\r\\\n\\tbody, td {\\\r\\\n\\t  font-family: 微软雅黑;\\\r\\\n\\t  font-size: 12pt;\\\r\\\n\\t}\\\r\\\n  </style>\\\r\\\n</head>\\\r\\\n<body>\\\r\\\n<a name=\\\"27694\\\"></a>\\\r\\\n<h1>Docker部署思源笔记, 数据自己掌握</h1>\\\r\\\n\\\r\\\n<div><span style=\\\"margin:0px;\\\"><div style=\\\"background-color:var(--main-background-color);margin:0\\\"><div><div style=\\\"display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;width:100%;font-family:'PingFang SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,'Helvetica Neue',Helvetica,'Hiragino Sans GB','Microsoft YaHei',SimSun,sans-serif;font-weight:300;background-color:inherit\\\"><div style=\\\"display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:start;-webkit-justify-content:flex-start;-ms-flex-pack:start;justify-content:flex-start;-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;width:100%;max-width:600px\\\"><div style=\\\"display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:start;-webkit-justify-content:flex-start;-ms-flex-pack:start;justify-content:flex-start;-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;width:100%;padding:0 24px 16px 24px;box-sizing:border-box\\\"><p style=\\\"color:rgb(40,40,40);font-size:1.5rem;font-weight:900;line-height:1.5;margin:16px 0\\\">Docker部署思源笔记, 数据自己掌握</p><div><p style=\\\"display:inline-block;color:rgb(153,153,153);font-size:14px;line-height:1.5;height:36px;margin:0 0\\\">什么值得买<span style=\\\"padding:0 4px\\\">·</span></p><p style=\\\"display:inline-block;color:rgb(153,153,153);font-size:14px;line-height:1.5;height:36px;margin:0 0\\\">2022-05-16</p></div></div><div style=\\\"color:rgb(40,40,40);width:100%;padding:0 24px 0;box-sizing:border-box;word-break:break-word;text-align:left;-webkit-letter-spacing:1px;-moz-letter-spacing:1px;-ms-letter-spacing:1px;letter-spacing:1px\\\"><div style=\\\"display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;margin:0 0 16px;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap\\\"><span style=\\\"box-sizing:border-box;display:inline-block;overflow:hidden;width:initial;height:initial;background:none;opacity:1;border:0;margin:0;padding:0;position:relative;max-width:100%\\\"><span style=\\\"box-sizing:border-box;display:block;width:initial;height:initial;background:none;opacity:1;border:0;margin:0;padding:0;max-width:100%\\\"></span><img src=\\\":/05bff0566c6749f0abc86e6cc7f770fc\\\" type=\\\"image/jpeg\\\" data-filename=\\\"bbb07236ae53aac2dbc8111a6397f272000269eb.jpg\\\" style=\\\"background-color:var(--lazyload-background-color);border-style:none;position:absolute;top:0;left:0;bottom:0;right:0;box-sizing:border-box;padding:0;border:none;margin:auto;display:block;width:0;height:0;min-width:100%;max-width:100%;min-height:100%;max-height:100%;object-fit:cover;filter:blur(20px);background-size:cover;background-image:url(https://s.flipboard.cn/flit/trans/6edcef22027c5ac2d94299584a9530f1/bbb07236ae53aac2dbc8111a6397f272000269eb?x-oss-process=image/resize,w_40);background-position:0 0\\\"/></span></div><h2 style=\\\"word-break:break-word;font-size:1.125rem;font-weight:500;margin:0 0 16px;color:rgb(40,40,40)\\\"><span style=\\\"font-weight:500\\\">关于思源</span></h2><p style=\\\"word-break:break-word;font-size:1rem;line-height:1.6;margin:0 0 16px;text-align:justify\\\"><span>感觉思源笔记功能上接近wolai, 体验稍差一些. 但是思源有一个突出优点, 数据本地化. 最近我的wolai会员到期了, 思来想去决定切换到思源. 思源是免费使用的, 会员只是多了同步和图床的功能, 使用docker部署, 不开会员也是没有问题的, 这一点非常良心</span><img src=\\\":/ddb0cc29587243c3870cf566c9fab83b\\\" type=\\\"image/png\\\" data-filename=\\\"8a95f029b4e5fdd2b5a3443196221e1fd6242923.png\\\" height=\\\"20\\\" style=\\\"border-style:none;display:inline;max-width:100%\\\" width=\\\"29.328125\\\"/><span> .</span></p><p style=\\\"word-break:break-word;font-size:1rem;line-height:1.6;margin:0 0 16px;text-align:justify\\\"><span>思源的数据存储方式如下图, 逻辑清晰很容易接受. 就是数据全存在data</span><span style=\\\"color:rgb(68,125,189)\\\"><a href=\\\"https://m.smzdm.com/fenlei/wenjianjia/\\\" style=\\\"background-color:transparent;color:inherit\\\">文件夹</a></span><span>下, 无论你安装windows程序, 还是使用安卓app, 只要把data文件夹放到对应的位置就可以成功加载. 把思源部署到docker上, 在任何设备的浏览器上都可以使用思源服务.</span></p><div style=\\\"display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;margin:0 0 16px;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap\\\"><span style=\\\"box-sizing:border-box;display:inline-block;overflow:hidden;width:initial;height:initial;background:none;opacity:1;border:0;margin:0;padding:0;position:relative;max-width:100%\\\"><span style=\\\"box-sizing:border-box;display:block;width:initial;height:initial;background:none;opacity:1;border:0;margin:0;padding:0;max-width:100%\\\"></span><img src=\\\":/114841e8ca164d37bfd4ee2388a1620c\\\" type=\\\"image/png\\\" data-filename=\\\"d9058b8739071f0e333d51ffc2eee142ddbd30cb.png\\\" style=\\\"background-color:var(--lazyload-background-color);border-style:none;position:absolute;top:0;left:0;bottom:0;right:0;box-sizing:border-box;padding:0;border:none;margin:auto;display:block;width:0;height:0;min-width:100%;max-width:100%;min-height:100%;max-height:100%;object-fit:cover;filter:blur(20px);background-size:cover;background-image:url(https://s.flipboard.cn/flit/trans/6edcef22027c5ac2d94299584a9530f1/d9058b8739071f0e333d51ffc2eee142ddbd30cb?x-oss-process=image/resize,w_40);background-position:0 0\\\"/></span></div><h2 style=\\\"word-break:break-word;font-size:1.125rem;font-weight:500;margin:0 0 16px;color:rgb(40,40,40)\\\"><span style=\\\"font-weight:500\\\">部署方法</span></h2><p style=\\\"word-break:break-word;font-size:1rem;line-height:1.6;margin:0 0 16px;text-align:justify\\\"><span>我是通过ssh部署docker, 工具为putty.exe, 这个软件太小了, 仅有0.6M的体积. 使用的root用户通过ssh连接到NAS, 不会遇到权限问题.</span><br style=\\\"content:' ';display:block;height:16px\\\"/></p><div style=\\\"display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;margin:0 0 16px;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap\\\"><span style=\\\"box-sizing:border-box;display:inline-block;overflow:hidden;width:initial;height:initial;background:none;opacity:1;border:0;margin:0;padding:0;position:relative;max-width:100%\\\"><span style=\\\"box-sizing:border-box;display:block;width:initial;height:initial;background:none;opacity:1;border:0;margin:0;padding:0;max-width:100%\\\"></span><img src=\\\":/0e559e5049da45ef91dd465ec1433b8f\\\" type=\\\"image/png\\\" data-filename=\\\"2828a6c9fb5ac0d447570df7d49937d0205b462c.png\\\" style=\\\"background-color:var(--lazyload-background-color);border-style:none;position:absolute;top:0;left:0;bottom:0;right:0;box-sizing:border-box;padding:0;border:none;margin:auto;display:block;width:0;height:0;min-width:100%;max-width:100%;min-height:100%;max-height:100%;object-fit:cover;filter:blur(20px);background-size:cover;background-image:url(https://s.flipboard.cn/flit/trans/6edcef22027c5ac2d94299584a9530f1/2828a6c9fb5ac0d447570df7d49937d0205b462c?x-oss-process=image/resize,w_40);background-position:0 0\\\"/></span></div><p style=\\\"word-break:break-word;font-size:1rem;line-height:1.6;margin:0 0 16px;text-align:justify\\\"><span>运行的代码一般镜像作者会提供, 只需要改一下就行.</span></p><blockquote style=\\\"border-left:4px solid #eee;word-break:break-word;font-size:1rem;padding:0 0 0 16px;margin:16px 0;color:rgb(153,153,153);line-height:1.5;position:relative;text-align:left\\\"><p style=\\\"display:inline-block;text-align:left;margin:0 0\\\"><span>docker run -v /srv/dev-disk-by-uuid-0494d-3f37-4a3b-bcd5-c68a07572/docker/siyuan:/siyuan -p 6806:6806 -u 1000:1000 b3log/siyuan -resident -workspace /siyuan/ -accessAuthCode password</span></p></blockquote><p style=\\\"word-break:break-word;font-size:1rem;line-height:1.6;margin:0 0 16px;text-align:justify\\\"><span>主要的参数是-v绑定硬盘, -p绑定端口, 其他的不用改. 我这里用到的路径/srv/dev-disk-by-uuid-04b5094d-3f37-4a3b-bcd5-c68a07572610是磁盘的绝对路径, 可以从omv上直接查看, 见下图. /docker/siyuan是其下的文件夹.</span></p><div style=\\\"display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;margin:0 0 16px;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap\\\"><span style=\\\"box-sizing:border-box;display:inline-block;overflow:hidden;width:initial;height:initial;background:none;opacity:1;border:0;margin:0;padding:0;position:relative;max-width:100%\\\"><span style=\\\"box-sizing:border-box;display:block;width:initial;height:initial;background:none;opacity:1;border:0;margin:0;padding:0;max-width:100%\\\"></span><img src=\\\":/06f85c46da98477f8f5126dcb4381d86\\\" type=\\\"image/png\\\" data-filename=\\\"1d4fda848a43b3ee07c062659266c76d86fec1e5.png\\\" style=\\\"background-color:var(--lazyload-background-color);border-style:none;position:absolute;top:0;left:0;bottom:0;right:0;box-sizing:border-box;padding:0;border:none;margin:auto;display:block;width:0;height:0;min-width:100%;max-width:100%;min-height:100%;max-height:100%;object-fit:cover;filter:blur(20px);background-size:cover;background-image:url(https://s.flipboard.cn/flit/trans/6edcef22027c5ac2d94299584a9530f1/1d4fda848a43b3ee07c062659266c76d86fec1e5?x-oss-process=image/resize,w_40);background-position:0 0\\\"/></span></div><p style=\\\"word-break:break-word;font-size:1rem;line-height:1.6;margin:0 0 16px;text-align:justify\\\"><br style=\\\"content:' ';display:block;height:16px\\\"/><span>-workspace /siyuan必须设置成/siyuan/, 表示工作区默认存储在你指定的文件夹下.</span></p><p style=\\\"word-break:break-word;font-size:1rem;line-height:1.6;margin:0 0 16px;text-align:justify\\\"><span>我们也可以从samba挂载的这个文件夹下看到它到底存了哪些数据.</span></p><div style=\\\"display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;margin:0 0 16px;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap\\\"><span style=\\\"box-sizing:border-box;display:inline-block;overflow:hidden;width:initial;height:initial;background:none;opacity:1;border:0;margin:0;padding:0;position:relative;max-width:100%\\\"><span style=\\\"box-sizing:border-box;display:block;width:initial;height:initial;background:none;opacity:1;border:0;margin:0;padding:0;max-width:100%\\\"></span><img src=\\\":/8c5ccb8409da4e31b4c97035b6d5251e\\\" type=\\\"image/png\\\" data-filename=\\\"d6607a4eeb2d6b8fc9afc1d5aa4e94487ba937ca.png\\\" style=\\\"background-color:var(--lazyload-background-color);border-style:none;position:absolute;top:0;left:0;bottom:0;right:0;box-sizing:border-box;padding:0;border:none;margin:auto;display:block;width:0;height:0;min-width:100%;max-width:100%;min-height:100%;max-height:100%;object-fit:cover;filter:blur(20px);background-size:cover;background-image:url(https://s.flipboard.cn/flit/trans/6edcef22027c5ac2d94299584a9530f1/d6607a4eeb2d6b8fc9afc1d5aa4e94487ba937ca?x-oss-process=image/resize,w_40);background-position:0 0\\\"/></span></div><p style=\\\"word-break:break-word;font-size:1rem;line-height:1.6;margin:0 0 16px;text-align:justify\\\"><br style=\\\"content:' ';display:block;height:16px\\\"/><span>这个文件夹拷贝到windows或手机端对应目录也能完美识别, 只要把这个数据保护好, 就不必担心丢失笔记. 好了运行命令.</span><br style=\\\"content:' ';display:block;height:16px\\\"/></p><div style=\\\"display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;margin:0 0 16px;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap\\\"><span style=\\\"box-sizing:border-box;display:inline-block;overflow:hidden;width:initial;height:initial;background:none;opacity:1;border:0;margin:0;padding:0;position:relative;max-width:100%\\\"><span style=\\\"box-sizing:border-box;display:block;width:initial;height:initial;background:none;opacity:1;border:0;margin:0;padding:0;max-width:100%\\\"></span><img src=\\\":/b1df1560feb645ada230332ce9f614bd\\\" type=\\\"image/png\\\" data-filename=\\\"6da3b7242621d218fbb56c8d5f68832a31f2a9ed.png\\\" style=\\\"background-color:var(--lazyload-background-color);border-style:none;position:absolute;top:0;left:0;bottom:0;right:0;box-sizing:border-box;padding:0;border:none;margin:auto;display:block;width:0;height:0;min-width:100%;max-width:100%;min-height:100%;max-height:100%;object-fit:cover;filter:blur(20px);background-size:cover;background-image:url(https://s.flipboard.cn/flit/trans/6edcef22027c5ac2d94299584a9530f1/6da3b7242621d218fbb56c8d5f68832a31f2a9ed?x-oss-process=image/resize,w_40);background-position:0 0\\\"/></span></div><p style=\\\"word-break:break-word;font-size:1rem;line-height:1.6;margin:0 0 16px;text-align:justify\\\"><br style=\\\"content:' ';display:block;height:16px\\\"/><span>运行完成可以从portainer中看到.</span><br style=\\\"content:' ';display:block;height:16px\\\"/></p><div style=\\\"display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;margin:0 0 16px;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap\\\"><span style=\\\"box-sizing:border-box;display:inline-block;overflow:hidden;width:initial;height:initial;background:none;opacity:1;border:0;margin:0;padding:0;position:relative;max-width:100%\\\"><span style=\\\"box-sizing:border-box;display:block;width:initial;height:initial;background:none;opacity:1;border:0;margin:0;padding:0;max-width:100%\\\"></span><img src=\\\":/e6d29e57a3f541bd908e25047965fc58\\\" type=\\\"image/png\\\" data-filename=\\\"5c620df8702abfedc33b72730b2dbeb0f4df84b4.png\\\" style=\\\"background-color:var(--lazyload-background-color);border-style:none;position:absolute;top:0;left:0;bottom:0;right:0;box-sizing:border-box;padding:0;border:none;margin:auto;display:block;width:0;height:0;min-width:100%;max-width:100%;min-height:100%;max-height:100%;object-fit:cover;filter:blur(20px);background-size:cover;background-image:url(https://s.flipboard.cn/flit/trans/6edcef22027c5ac2d94299584a9530f1/5c620df8702abfedc33b72730b2dbeb0f4df84b4?x-oss-process=image/resize,w_40);background-position:0 0\\\"/></span></div><p style=\\\"word-break:break-word;font-size:1rem;line-height:1.6;margin:0 0 16px;text-align:justify\\\"><br style=\\\"content:' ';display:block;height:16px\\\"/><span>ssh创建和使用portainer创建是一样的, 以后如果需要更改某些参数再从portainer调整, 很方便.</span><br style=\\\"content:' ';display:block;height:16px\\\"/></p><p style=\\\"word-break:break-word;font-size:1rem;line-height:1.6;margin:0 0 16px;text-align:justify\\\"><span>如果启动遇到报错, create conf folder [/siyuan/workspace/conf] failed: mkdir /siyuan/workspace/conf: permission denied</span></p><p style=\\\"word-break:break-word;font-size:1rem;line-height:1.6;margin:0 0 16px;text-align:justify\\\"><span>说明文件夹权限有问题, 这时候灯大的filebrowser就可以出手了, 找到文件夹, 将权限改成777即可.</span></p><div style=\\\"display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;margin:0 0 16px;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap\\\"><span style=\\\"box-sizing:border-box;display:inline-block;overflow:hidden;width:initial;height:initial;background:none;opacity:1;border:0;margin:0;padding:0;position:relative;max-width:100%\\\"><span style=\\\"box-sizing:border-box;display:block;width:initial;height:initial;background:none;opacity:1;border:0;margin:0;padding:0;max-width:100%\\\"></span><img src=\\\":/becedd49cd3a48ba856be154a71e6571\\\" type=\\\"image/png\\\" data-filename=\\\"c3512fa512c21bb9eb44674719d7f8c32e1e8a46.png\\\" style=\\\"background-color:var(--lazyload-background-color);border-style:none;position:absolute;top:0;left:0;bottom:0;right:0;box-sizing:border-box;padding:0;border:none;margin:auto;display:block;width:0;height:0;min-width:100%;max-width:100%;min-height:100%;max-height:100%;object-fit:cover;filter:blur(20px);background-size:cover;background-image:url(https://s.flipboard.cn/flit/trans/6edcef22027c5ac2d94299584a9530f1/c3512fa512c21bb9eb44674719d7f8c32e1e8a46?x-oss-process=image/resize,w_40);background-position:0 0\\\"/></span></div><p style=\\\"word-break:break-word;font-size:1rem;line-height:1.6;margin:0 0 16px;text-align:justify\\\"><br style=\\\"content:' ';display:block;height:16px\\\"/><span>思源的默认端口是6806, 我这就是访问</span><span style=\\\"color:rgb(0,150,136)\\\"><a href=\\\"http://192.168.6.143:6806/%E6%89%93%E5%BC%80%E6%80%9D%E6%BA%90\\\" style=\\\"background-color:transparent;color:inherit\\\">http://192.168.6.143:6806/打开思源</a></span><span>, 可以看到第一次访问需要输入</span><span style=\\\"font-weight:500;color:rgb(191,54,12)\\\">授权码</span><span>,</span><br style=\\\"content:' ';display:block;height:16px\\\"/></p><div style=\\\"display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;margin:0 0 16px;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap\\\"><span style=\\\"box-sizing:border-box;display:inline-block;overflow:hidden;width:initial;height:initial;background:none;opacity:1;border:0;margin:0;padding:0;position:relative;max-width:100%\\\"><span style=\\\"box-sizing:border-box;display:block;width:initial;height:initial;background:none;opacity:1;border:0;margin:0;padding:0;max-width:100%\\\"></span><img src=\\\":/37732e3eaa5a4bddb54f0dda3a7fe1fc\\\" type=\\\"image/png\\\" data-filename=\\\"8ac6b272c77f35ea5d6322fbcf3e8ea33d01eaff.png\\\" style=\\\"background-color:var(--lazyload-background-color);border-style:none;position:absolute;top:0;left:0;bottom:0;right:0;box-sizing:border-box;padding:0;border:none;margin:auto;display:block;width:0;height:0;min-width:100%;max-width:100%;min-height:100%;max-height:100%;object-fit:cover;filter:blur(20px);background-size:cover;background-image:url(https://s.flipboard.cn/flit/trans/6edcef22027c5ac2d94299584a9530f1/8ac6b272c77f35ea5d6322fbcf3e8ea33d01eaff?x-oss-process=image/resize,w_40);background-position:0 0\\\"/></span></div><p style=\\\"word-break:break-word;font-size:1rem;line-height:1.6;margin:0 0 16px;text-align:justify\\\"><br style=\\\"content:' ';display:block;height:16px\\\"/><span>有点词让人迷惑我还以为要去官方申请, 后来发现其实是docker语句中设置的, 所以输入password即可完成认证. 第一次用PC或者手机浏览器访问都需要填写授权码, 这个授权码其实就是代替账号密码的意思吧, 起码不是任何人访问你的网址就能打开笔记, 所以建议把授权码设置的复杂一些, 不要泄漏.</span><br style=\\\"content:' ';display:block;height:16px\\\"/></p><h2 style=\\\"word-break:break-word;font-size:1.125rem;font-weight:500;margin:0 0 16px;color:rgb(40,40,40)\\\"><span style=\\\"font-weight:500;color:rgb(68,125,189)\\\"><a href=\\\"https://pinpai.m.smzdm.com/288313/\\\" style=\\\"background-color:transparent;color:inherit\\\">界面</a></span><span style=\\\"font-weight:500\\\">美化</span></h2><p style=\\\"word-break:break-word;font-size:1rem;line-height:1.6;margin:0 0 16px;text-align:justify\\\"><span>语言设置成中文.</span></p><div style=\\\"display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;margin:0 0 16px;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap\\\"><span style=\\\"box-sizing:border-box;display:inline-block;overflow:hidden;width:initial;height:initial;background:none;opacity:1;border:0;margin:0;padding:0;position:relative;max-width:100%\\\"><span style=\\\"box-sizing:border-box;display:block;width:initial;height:initial;background:none;opacity:1;border:0;margin:0;padding:0;max-width:100%\\\"></span><img src=\\\":/54348204100a4a3bb49f849a33c79355\\\" type=\\\"image/png\\\" data-filename=\\\"ade0ae9e61afb01f8029f2895142fedde399afc8.png\\\" style=\\\"background-color:var(--lazyload-background-color);border-style:none;position:absolute;top:0;left:0;bottom:0;right:0;box-sizing:border-box;padding:0;border:none;margin:auto;display:block;width:0;height:0;min-width:100%;max-width:100%;min-height:100%;max-height:100%;object-fit:cover;filter:blur(20px);background-size:cover;background-image:url(https://s.flipboard.cn/flit/trans/6edcef22027c5ac2d94299584a9530f1/ade0ae9e61afb01f8029f2895142fedde399afc8?x-oss-process=image/resize,w_40);background-position:0 0\\\"/></span></div><p style=\\\"word-break:break-word;font-size:1rem;line-height:1.6;margin:0 0 16px;text-align:justify\\\"><br style=\\\"content:' ';display:block;height:16px\\\"/><span>从”集市”(就是皮肤插件库)中选择一款漂亮的皮肤, 换了几个皮肤发现很多适配的并不好, 比如代码块有的就没有边界, 不太友好. 最终我选的是Zhang-Light. 小建议, 优先从最近更新的和收藏数多的试试.</span><br style=\\\"content:' ';display:block;height:16px\\\"/></p><div style=\\\"display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;margin:0 0 16px;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap\\\"><span style=\\\"box-sizing:border-box;display:inline-block;overflow:hidden;width:initial;height:initial;background:none;opacity:1;border:0;margin:0;padding:0;position:relative;max-width:100%\\\"><span style=\\\"box-sizing:border-box;display:block;width:initial;height:initial;background:none;opacity:1;border:0;margin:0;padding:0;max-width:100%\\\"></span><img src=\\\":/16c3199bf5df4a30bac95ac907da840f\\\" type=\\\"image/png\\\" data-filename=\\\"edfd2cfbf14b4485cd0f5341482fe4f9bb0c972e.png\\\" style=\\\"background-color:var(--lazyload-background-color);border-style:none;position:absolute;top:0;left:0;bottom:0;right:0;box-sizing:border-box;padding:0;border:none;margin:auto;display:block;width:0;height:0;min-width:100%;max-width:100%;min-height:100%;max-height:100%;object-fit:cover;filter:blur(20px);background-size:cover;background-image:url(https://s.flipboard.cn/flit/trans/6edcef22027c5ac2d94299584a9530f1/edfd2cfbf14b4485cd0f5341482fe4f9bb0c972e?x-oss-process=image/resize,w_40);background-position:0 0\\\"/></span></div><p style=\\\"word-break:break-word;font-size:1rem;line-height:1.6;margin:0 0 16px;text-align:justify\\\"><br style=\\\"content:' ';display:block;height:16px\\\"/><span>数据备份管理, 既然已经设置到了docker/siyuan文件夹下, 所以我们也可以从samba挂载的这个文件夹下看到它到底存了哪些数据.</span><br style=\\\"content:' ';display:block;height:16px\\\"/></p><h2 style=\\\"word-break:break-word;font-size:1.125rem;font-weight:500;margin:0 0 16px;color:rgb(40,40,40)\\\"><span style=\\\"font-weight:500\\\">使用OMV备份工具保护数据</span></h2><p style=\\\"word-break:break-word;font-size:1rem;line-height:1.6;margin:0 0 16px;text-align:justify\\\"><span>原则上我们把数据同时存在两块物理硬盘上, 就能最大程度的保证数据不丢失, 毕竟两块磁盘同时坏掉的几率还是挺小的. 这种方式在</span><span style=\\\"color:rgb(68,125,189)\\\"><a href=\\\"https://pinpai.m.smzdm.com/289373/\\\" style=\\\"background-color:transparent;color:inherit\\\">极空间</a></span><span>上叫ZDR, 真是起名大师</span><img src=\\\":/5a216caeaba04f6bbed16665532ce629\\\" type=\\\"image/png\\\" data-filename=\\\"e5e1b5a5418c089f6b9e71fd93cd5dd69c9201fb.png\\\" height=\\\"20\\\" style=\\\"border-style:none;display:inline;max-width:100%\\\" width=\\\"22\\\"/><span> . 前面提到了只要保护好siyuan/data这个文件夹即可, 我们可以用omv预装的Rsync工具.</span></p><p style=\\\"word-break:break-word;font-size:1rem;line-height:1.6;margin:0 0 16px;text-align:justify\\\"><span>思源部署在磁盘A上, 我们现在在磁盘B(我这个机器上盘位已满,暂时也用磁盘A做演示)上建立一个共享文件夹siyuan_backup.</span></p><p style=\\\"word-break:break-word;font-size:1rem;line-height:1.6;margin:0 0 16px;text-align:justify\\\"><span>需要在OMV上建立两个共享文件夹, 如下图, 也就是我会定时把文件从/docker/siyuan/data备份到/siyuan_backup.</span></p><div style=\\\"display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;margin:0 0 16px;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap\\\"><span style=\\\"box-sizing:border-box;display:inline-block;overflow:hidden;width:initial;height:initial;background:none;opacity:1;border:0;margin:0;padding:0;position:relative;max-width:100%\\\"><span style=\\\"box-sizing:border-box;display:block;width:initial;height:initial;background:none;opacity:1;border:0;margin:0;padding:0;max-width:100%\\\"></span><img src=\\\":/02b54d3b3ba14e0197506ab5f84abb67\\\" type=\\\"image/png\\\" data-filename=\\\"4c33591678530aa63f76f069e6c3d2e55ccb82ef.png\\\" style=\\\"background-color:var(--lazyload-background-color);border-style:none;position:absolute;top:0;left:0;bottom:0;right:0;box-sizing:border-box;padding:0;border:none;margin:auto;display:block;width:0;height:0;min-width:100%;max-width:100%;min-height:100%;max-height:100%;object-fit:cover;filter:blur(20px);background-size:cover;background-image:url(https://s.flipboard.cn/flit/trans/6edcef22027c5ac2d94299584a9530f1/4c33591678530aa63f76f069e6c3d2e55ccb82ef?x-oss-process=image/resize,w_40);background-position:0 0\\\"/></span></div><p style=\\\"word-break:break-word;font-size:1rem;line-height:1.6;margin:0 0 16px;text-align:justify\\\"><br style=\\\"content:' ';display:block;height:16px\\\"/><span>创建任务, 我设置的是每40分钟同步一次.</span><br style=\\\"content:' ';display:block;height:16px\\\"/></p><div style=\\\"display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;margin:0 0 16px;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap\\\"><span style=\\\"box-sizing:border-box;display:inline-block;overflow:hidden;width:initial;height:initial;background:none;opacity:1;border:0;margin:0;padding:0;position:relative;max-width:100%\\\"><span style=\\\"box-sizing:border-box;display:block;width:initial;height:initial;background:none;opacity:1;border:0;margin:0;padding:0;max-width:100%\\\"></span><img src=\\\":/9c9a227412c24b758ee6ed2bdec43f99\\\" type=\\\"image/png\\\" data-filename=\\\"3b4e2460d7f5e6ba9cb77f477b605455524d9d3e.png\\\" style=\\\"background-color:var(--lazyload-background-color);border-style:none;position:absolute;top:0;left:0;bottom:0;right:0;box-sizing:border-box;padding:0;border:none;margin:auto;display:block;width:0;height:0;min-width:100%;max-width:100%;min-height:100%;max-height:100%;object-fit:cover;filter:blur(20px);background-size:cover;background-image:url(https://s.flipboard.cn/flit/trans/6edcef22027c5ac2d94299584a9530f1/3b4e2460d7f5e6ba9cb77f477b605455524d9d3e?x-oss-process=image/resize,w_40);background-position:0 0\\\"/></span></div><p style=\\\"word-break:break-word;font-size:1rem;line-height:1.6;margin:0 0 16px;text-align:justify\\\"><br style=\\\"content:' ';display:block;height:16px\\\"/><span>试一下运行效果. 以后rsync就会忠实的</span><span style=\\\"color:rgb(68,125,189)\\\"><a href=\\\"https://pinpai.m.smzdm.com/41269/\\\" style=\\\"background-color:transparent;color:inherit\\\">帮你</a></span><span>定时增量备份数据, 数据安全多了. 我前面提过, 如果你设置任务为磁盘A同步磁盘B, 那它就是极空间的ZDR模式, 也相当于一种Raid1. 并且它是可以同步到远程共享目录的, 可以多一份保障.</span><br style=\\\"content:' ';display:block;height:16px\\\"/></p><div style=\\\"display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;margin:0 0 16px;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap\\\"><span style=\\\"box-sizing:border-box;display:inline-block;overflow:hidden;width:initial;height:initial;background:none;opacity:1;border:0;margin:0;padding:0;position:relative;max-width:100%\\\"><span style=\\\"box-sizing:border-box;display:block;width:initial;height:initial;background:none;opacity:1;border:0;margin:0;padding:0;max-width:100%\\\"></span><img src=\\\":/923ca4414a4e45af92f0ecc1949a95f7\\\" type=\\\"image/png\\\" data-filename=\\\"1c600739898d5fc527eeadd8c945ce37f8dca6c7.png\\\" style=\\\"background-color:var(--lazyload-background-color);border-style:none;position:absolute;top:0;left:0;bottom:0;right:0;box-sizing:border-box;padding:0;border:none;margin:auto;display:block;width:0;height:0;min-width:100%;max-width:100%;min-height:100%;max-height:100%;object-fit:cover;filter:blur(20px);background-size:cover;background-image:url(https://s.flipboard.cn/flit/trans/6edcef22027c5ac2d94299584a9530f1/1c600739898d5fc527eeadd8c945ce37f8dca6c7?x-oss-process=image/resize,w_40);background-position:0 0\\\"/></span></div><h2 style=\\\"word-break:break-word;font-size:1.125rem;font-weight:500;margin:0 0 16px;color:rgb(40,40,40)\\\"><span style=\\\"font-weight:500\\\">总结</span></h2><p style=\\\"word-break:break-word;font-size:1rem;line-height:1.6;margin:0 0 16px;text-align:justify\\\"><span>思源最大的优势就是数据本地化, 并且它的Markdown输入体验不错, 支持所见即所得. 数据安全上, 只要你保护好data文件夹, 做好及时备份即可. </span></p><p style=\\\"word-break:break-word;font-size:1rem;line-height:1.6;margin:0 0 16px;text-align:justify\\\"><span>局限是, 思源的docker服务是运行在某台</span><span style=\\\"color:rgb(68,125,189)\\\"><a href=\\\"https://m.smzdm.com/fenlei/fuwuqi/\\\" style=\\\"background-color:transparent;color:inherit\\\">服务器</a></span><span>上, 所以我们只能通过浏览器访问来编辑, 没有windows exe和手机app可以直接连接docker. 好在无论是windows还是手机浏览器上在线编辑的体验都不错. 这也算是一种全平台的方案吧.</span><br style=\\\"content:' ';display:block;height:16px\\\"/><span>好了, 终于有一个完全属于自己的笔记平台, 一起享受码字的快乐吧.</span></p></div><div style=\\\"-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;width:100%;padding:45px 32px 45px;line-height:1.5;box-sizing:border-box\\\"><span style=\\\"color:rgb(153,153,153);font-size:12px\\\">本页面由红板报版面渲染引擎自动排版</span><a href=\\\"https://post.smzdm.com/p/a0qro908/\\\" style=\\\"background-color:transparent;color:rgb(74,144,226);font-size:12px;margin:0 0 0 4px;-webkit-text-decoration:none;text-decoration:none\\\">查看原文</a></div></div></div></div></div></span>\\\n</div></body></html>\\u0000\"]],\"start1\":0,\"start2\":0,\"length1\":0,\"length2\":30820}]"
metadata_diff: {"new":{"id":"8e020be1e870405284977eae4f9e30f2","parent_id":"f67288c3a0be4374b5d532b5dcc3aabc","latitude":"0.00000000","longitude":"0.00000000","altitude":"0.0000","author":"","source_url":"","is_todo":0,"todo_due":0,"todo_completed":0,"source":"joplin-desktop","source_application":"net.cozic.joplin-desktop","application_data":"","order":1764348818484,"markup_language":2,"is_shared":0,"share_id":"","conflict_original_id":"","master_key_id":"","user_data":"","deleted_time":0},"deleted":[]}
encryption_cipher_text: 
encryption_applied: 0
updated_time: 2025-11-28T21:03:26.209Z
created_time: 2025-11-28T21:03:26.209Z
type_: 13