当前位置:   article > 正文

在群晖NAS上搭建私有部署笔记软件——Blossom_群晖 blossom

群晖 blossom

一、Blossom 简介

        Blossom 是一个需要私有部署的笔记软件,虽然本身定位是一个云端软件,但你仍然可以在本地部署,数据和图片都将保存在本地,不依赖任何的图床或者对象存储

Blossom | Blossom (wangyunf.com)icon-default.png?t=N7T8https://www.wangyunf.com/blossom-doc/index.html

二、群晖部署Blossom

2.1、安装mariadb数据库

        登陆群晖的管理界面打开【套件中心】-->顶部搜索框输入【mariadb】后按下Enter键-->找到Mariadb 10点击【安装套件、然后输入密码】,mariadb安装完成后打开该数据库开启tcp连接,如下图所示:

2.2、授权mariadb的指定用户可以远程登录该数据库

        授权mariadb的指定用户可以远程登录该数据库和创建blossom数据库可以采用以下的2种方法中的任意一种实现。

2.2.1、方法一:使用phpMyAdmin套件执行授权sql

         登陆群晖的管理界面打开【套件中心】--》顶部搜索框输入【phpmyadmin】后按下Enter键--》找到phpMyAdmin套件点击【安装套件】,phpMyAdmin套件安装完成后打开输入默认用户【root】和刚才设置的mariadb数据库密码后点击【登录】按钮登录,如下图所示:

 

        使用phpMyAdmin套件连接mariadb10数据库成功后选择【SQL】-->输入需要执行的授权指定的用户可以远程登录mariadb10数据库、创建blossom数据命令后-->点击【执行】,如下图所示:

  1. UPDATE mysql.user SET Host='%' WHERE User='root' and Host='localhost';
  2. flush privileges;
  3. CREATE DATABASE `blossom` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;

 

2.2.2、方法二:使用ssh执行授权sql

2.2.2.1、下载ssh工具连接到群晖NAS

可以直接使用putty工具连接到群晖NAS:

在Windows中通过Putty连接Linux、通过pscp传输文件到Linux_window使用putty登录linux,如何传输文件-CSDN博客icon-default.png?t=N7T8https://blog.csdn.net/xiaochenXIHUA/article/details/118067326?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522170460131616777224447380%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fblog.%2522%257D&request_id=170460131616777224447380&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~blog~first_rank_ecpm_v1~rank_v31_ecpm-1-118067326-null-null.nonecase&utm_term=Putty&spm=1018.2226.3001.4450

我这里使用WindTerm工具的ssh功能连接群晖NAS,如下图为WindTerm工具的下载方法:

直接下载WindTerm_2.5.0工具icon-default.png?t=N7T8https://github.com/kingToolbox/WindTerm/releases/download/2.5.0/WindTerm_2.5.0_Windows_Portable_x86_64.zip 

下载WindTerm工具icon-default.png?t=N7T8https://github.com/kingToolbox/WindTerm/releases

 

2.2.2.2、使用ssh工具连接到群晖NAS后连接mariadb数据库执行授权操作

        连接mariadb数据库命令【mysql -u数据库的用户名 -p数据库的用户名对应的密码】(如下为mariadb数据库默认用户root和root用户对应的密码jasmine888G连接命令,输入完成后按下Enter键即可连接上mariadb数据库) 

mysql -uroot -pjasmine888G

注意:在执行一下的sql语句前,必须要登陆到mariadb数据库中

设置任意主机使用root用户可远程访问mariadb数据库(%表示任意主机)sql语句:

  1. UPDATE mysql.user SET Host='%' WHERE User='root' and Host='localhost';
  2. flush privileges;

创建名为blossom的数据库sql语句:

CREATE DATABASE `blossom` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;

退出数据库:

exit;

2.3、部署Blossom

2.3.1、创建blossom的映射文件夹

2.3.2、拉取blossom镜像

docker pull jasminexzzz/blossom:latest

2.3.3、部署且启动blossom容器

  1. --部署blossom且启动的语法
  2. sudo docker run -d --net=host --name blossom-backend -p 9999:9999 -v /volume1/docker/blossom/bl/:/home/bl/ jasminexzzz/blossom:latest --project.iaas.blos.domain="http://你自己的群晖NASIP地址:9999/pic/" --project.iaas.blos.default-path="/home/bl/img/" --spring.datasource.url="jdbc:mysql://127.0.0.1:3306/blossom?useUnicode=true&characterEncoding=utf-8&allowPublicKeyRetrieval=true&allowMultiQueries=true&useSSL=false&&serverTimezone=GMT%2B8" --spring.datasource.username=你的mariadb数据库登陆用户名称 --spring.datasource.password=你的mariadb数据库登陆用户名称对应的密码
  3. --示例:比如我的群晖NASIP地址是【172.24.1.6】、mariadb数据库登陆用户名称是【root】、mariadb数据库登陆用户名称【root】对应的密码是【jasmine888G】
  4. sudo docker run -d --net=host --name blossom-backend -p 9999:9999 -v /volume1/docker/blossom/bl/:/home/bl/ jasminexzzz/blossom:latest --project.iaas.blos.domain="http://172.24.1.6:9999/pic/" --project.iaas.blos.default-path="/home/bl/img/" --spring.datasource.url="jdbc:mysql://127.0.0.1:3306/blossom?useUnicode=true&characterEncoding=utf-8&allowPublicKeyRetrieval=true&allowMultiQueries=true&useSSL=false&&serverTimezone=GMT%2B8" --spring.datasource.username=root --spring.datasource.password=jasmine888G

注意:

1、这里的数据库端口要根据你实际的mariadb数据库端口填写(默认情况下是3306) ;

2、还有关于部署且启动blossom容器的地址【--project.iaas.blos.domain="http://172.24.1.6:9999/pic/"】若你需要在外网使用则该地址需要修改为外网地址【--project.iaas.blos.domain="http://外网IP地址:9999/pic/"】

2.3.4、验证部署的blossom容器是否成功 

验证部署的blossom容器是否成功命令:

sudo docker logs blossom-backend

注意:执行验证命令后若出现如下所示的【821: Application run failed】 、【Error】、【Failed to execute SQL script...】错误提示,则表示部署的blossom失败!!!

2.3.5、解决部署的blossom容器失败方法

        从验证部署blossom容器是否成功的日志内容可以了解到是由于初始化sql语句在我们的数据库中执行出现了语法错误导致失败的,我们只需要替换掉原来的初始化sql语句即可。

1、创建一个文本文件并命名为【schema-mysql.sql】且用记事本打开;

2、将如下的blossom初始sql语句内容复制到【schema-mysql.sql】文件中且保存;

  1. -- 修改后的可在mariadb数据库中执行的blossom初始sql语句
  2. -- Copy from /blossom/script/sql/blossom.sql
  3. -- ----------------------------
  4. -- Table structure for base_sys_param
  5. -- ----------------------------
  6. CREATE TABLE IF NOT EXISTS `base_sys_param` (
  7. `id` bigint NOT NULL AUTO_INCREMENT COMMENT '参数ID',
  8. `param_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '参数名称',
  9. `param_value` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '参数值',
  10. `param_desc` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '参数说明',
  11. `open_state` int NOT NULL COMMENT '开放状态 [YesNo]',
  12. `cre_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  13. `upd_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  14. PRIMARY KEY (`id`) USING BTREE,
  15. UNIQUE INDEX `unq_param_name`(`param_name`) USING BTREE COMMENT '参数名称唯一'
  16. ) ENGINE = InnoDB AUTO_INCREMENT = 22 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '系统参数' ROW_FORMAT = DYNAMIC;
  17. -- ----------------------------
  18. -- Records of base_sys_param
  19. -- ----------------------------
  20. DELETE FROM base_sys_param WHERE ID=1;
  21. INSERT INTO base_sys_param (id, param_name, param_value, param_desc, open_state, cre_time, upd_time)
  22. VALUES( 1,
  23. 'WEB_ARTICLE_URL',
  24. 'https://www.domain.com/blossom/#/articles?articleId=',
  25. '博客端文章地址,用于PC端直接调往WEB端阅读文章',
  26. 1,
  27. CURRENT_TIMESTAMP,
  28. CURRENT_TIMESTAMP
  29. );
  30. DELETE FROM base_sys_param WHERE ID=3;
  31. INSERT INTO base_sys_param (id, param_name, param_value, param_desc, open_state, cre_time, upd_time)
  32. VALUES( 3,
  33. 'ARTICLE_LOG_EXP_DAYS',
  34. '30',
  35. '文章修改记录保存天数, 超过该天数将被删除',
  36. 1,
  37. CURRENT_TIMESTAMP,
  38. CURRENT_TIMESTAMP
  39. );
  40. DELETE FROM base_sys_param WHERE ID=4;
  41. INSERT INTO base_sys_param (id, param_name, param_value, param_desc, open_state, cre_time, upd_time)
  42. VALUES( 4,
  43. 'ARTICLE_RECYCLE_EXP_DAYS',
  44. '45',
  45. '文章回收站过期天数, 超过该天数将被删除',
  46. 1,
  47. CURRENT_TIMESTAMP,
  48. CURRENT_TIMESTAMP
  49. );
  50. DELETE FROM base_sys_param WHERE ID=11;
  51. INSERT INTO base_sys_param (id, param_name, param_value, param_desc, open_state, cre_time, upd_time)
  52. VALUES( 11,
  53. 'HEFENG_KEY',
  54. '',
  55. '和风天气的KEY',
  56. 1,
  57. CURRENT_TIMESTAMP,
  58. CURRENT_TIMESTAMP
  59. );
  60. DELETE FROM base_sys_param WHERE ID=21;
  61. INSERT INTO base_sys_param (id, param_name, param_value, param_desc, open_state, cre_time, upd_time)
  62. VALUES( 21,
  63. 'GITEE_ACCESS_TOKEN',
  64. '',
  65. '[过时配置]GITEE API 的访问 token',
  66. 1,
  67. CURRENT_TIMESTAMP,
  68. CURRENT_TIMESTAMP
  69. );
  70. DELETE FROM base_sys_param WHERE ID=31;
  71. INSERT INTO base_sys_param (id, param_name, param_value, param_desc, open_state, cre_time, upd_time)
  72. VALUES( 31,
  73. 'BACKUP_PATH',
  74. '/home/bl/backup/',
  75. '备份路径, 参考格式: /home/bl/backup/',
  76. 1,
  77. CURRENT_TIMESTAMP,
  78. CURRENT_TIMESTAMP
  79. );
  80. DELETE FROM base_sys_param WHERE ID=32;
  81. INSERT INTO base_sys_param (id, param_name, param_value, param_desc, open_state, cre_time, upd_time)
  82. VALUES( 32,
  83. 'BACKUP_EXP_DAYS',
  84. '7',
  85. '备份过期天数',
  86. 1,
  87. CURRENT_TIMESTAMP,
  88. CURRENT_TIMESTAMP
  89. );
  90. DELETE FROM base_sys_param WHERE ID=900;
  91. INSERT INTO base_sys_param (id, param_name, param_value, param_desc, open_state, cre_time, upd_time)
  92. VALUES( 900,
  93. 'SERVER_JWT_SECRET',
  94. '96cae35ce8a9b0244178bf28e4966c2ce1b8385723a96a6b838858cdd6ca0a1e',
  95. 'JWT加密字符串',
  96. 1,
  97. CURRENT_TIMESTAMP,
  98. CURRENT_TIMESTAMP
  99. );
  100. DELETE FROM base_sys_param WHERE ID=901;
  101. INSERT INTO base_sys_param (id, param_name, param_value, param_desc, open_state, cre_time, upd_time)
  102. VALUES( 901,
  103. 'SERVER_MACHINE_EXPIRE',
  104. '2024-01-01',
  105. '过期时间 - 服务器',
  106. 1,
  107. CURRENT_TIMESTAMP,
  108. CURRENT_TIMESTAMP
  109. );
  110. DELETE FROM base_sys_param WHERE ID=902;
  111. INSERT INTO base_sys_param (id, param_name, param_value, param_desc, open_state, cre_time, upd_time)
  112. VALUES( 902,
  113. 'SERVER_DOMAIN_EXPIRE',
  114. '2024-01-01',
  115. '过期时间 - 域名',
  116. 1,
  117. CURRENT_TIMESTAMP,
  118. CURRENT_TIMESTAMP
  119. );
  120. DELETE FROM base_sys_param WHERE ID=903;
  121. INSERT INTO base_sys_param (id, param_name, param_value, param_desc, open_state, cre_time, upd_time)
  122. VALUES( 903,
  123. 'SERVER_HTTPS_EXPIRE',
  124. '2024-01-01',
  125. '过期时间 - HTTPS 证书',
  126. 1,
  127. CURRENT_TIMESTAMP,
  128. CURRENT_TIMESTAMP
  129. );
  130. DELETE FROM base_sys_param WHERE ID=904;
  131. INSERT INTO base_sys_param (id, param_name, param_value, param_desc, open_state, cre_time, upd_time)
  132. VALUES( 904,
  133. 'SERVER_DATABASE_EXPIRE',
  134. '2024-01-01',
  135. '过期时间 - 数据库',
  136. 1,
  137. CURRENT_TIMESTAMP,
  138. CURRENT_TIMESTAMP
  139. );
  140. -- ----------------------------
  141. -- since: 1.12.0
  142. -- ----------------------------
  143. DELETE FROM base_sys_param WHERE ID=101;
  144. INSERT INTO base_sys_param (id, param_name, param_value, param_desc, open_state, cre_time, upd_time)
  145. VALUES( 101,
  146. 'BLOSSOM_OBJECT_STORAGE_DOMAIN',
  147. 'http://www.xxx.com/',
  148. 'BLOSSOM 对象存储地址',
  149. 1,
  150. CURRENT_TIMESTAMP,
  151. CURRENT_TIMESTAMP
  152. );
  153. -- ----------------------------
  154. -- Table structure for base_user
  155. -- ----------------------------
  156. CREATE TABLE IF NOT EXISTS `base_user` (
  157. `id` bigint NOT NULL AUTO_INCREMENT COMMENT '用户ID',
  158. `type` tinyint(1) NOT NULL DEFAULT 2 COMMENT '用户类型: 1:管理员; 2:普通用户; 3:只读用户;',
  159. `username` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '用户名',
  160. `phone` varchar(13) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '用户手机号',
  161. `password` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '用户密码',
  162. `salt` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '密码加盐',
  163. `nick_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '昵称',
  164. `real_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '真实姓名',
  165. `avatar` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '用户头像',
  166. `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '备注',
  167. `cre_by` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '0,SYS' COMMENT '创建人ID,名称',
  168. `cre_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  169. `upd_by` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '0,SYS' COMMENT '修改人ID,名称',
  170. `upd_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  171. `del_by` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '0,SYS' COMMENT '删除人ID,名称',
  172. `del_time` bigint NOT NULL DEFAULT 0 COMMENT '删除时间',
  173. `location` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '101100101' COMMENT '和风天气的位置, 官方文档:https://github.com/qwd/LocationList/blob/master/China-City-List-latest.csv',
  174. PRIMARY KEY (`id`) USING BTREE,
  175. UNIQUE INDEX `unq_user_username`(`username`) USING BTREE
  176. ) ENGINE = InnoDB AUTO_INCREMENT = 10002 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '用户' ROW_FORMAT = DYNAMIC;
  177. -- ----------------------------
  178. -- Records of base_user
  179. -- ----------------------------
  180. DELETE FROM base_user WHERE ID=1;
  181. INSERT INTO base_user (id, type, username, phone, password, salt, nick_name, real_name, remark, cre_by, cre_time, upd_by, upd_time, location)
  182. VALUES( 1,
  183. 1,
  184. 'blos',
  185. '',
  186. '$2a$10$SgMx8T/06595PEq3EA9US.ja1oHxpIDG/XnERmBXS.wYS8qbxAGDa',
  187. 'UVeESP5NgXwb8JmjCHUK',
  188. '用户',
  189. 'blos',
  190. '预设管理员账号, 用户名密码都是 blos',
  191. '0,SYS',
  192. CURRENT_TIMESTAMP,
  193. '0,SYS',
  194. CURRENT_TIMESTAMP,
  195. '101100101'
  196. );
  197. -- ----------------------------
  198. -- Table structure for blossom_article
  199. -- ----------------------------
  200. CREATE TABLE IF NOT EXISTS `blossom_article` (
  201. `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'ID',
  202. `pid` bigint NOT NULL COMMENT '文件夹ID',
  203. `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '文章名称',
  204. `icon` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '文章图标',
  205. `tags` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '标签集合',
  206. `sort` int NOT NULL DEFAULT 1 COMMENT '排序',
  207. `cover` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '封面',
  208. `describes` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '描述',
  209. `star_status` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'star状态',
  210. `open_status` tinyint(1) NOT NULL DEFAULT 0 COMMENT '公开状态',
  211. `open_version` int NOT NULL DEFAULT 0 COMMENT '公开版本',
  212. `pv` int NOT NULL DEFAULT 0 COMMENT '页面的查看数',
  213. `uv` int NOT NULL DEFAULT 0 COMMENT '独立的访问次数,每日IP重置',
  214. `likes` int NOT NULL DEFAULT 0 COMMENT '点赞数',
  215. `words` int NOT NULL DEFAULT 0 COMMENT '文章字数',
  216. `version` int NOT NULL DEFAULT 0 COMMENT '版本',
  217. `color` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '颜色',
  218. `toc` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '目录解析',
  219. `markdown` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT 'Markdown 内容',
  220. `html` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT 'Html内容',
  221. `cre_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  222. `upd_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  223. `user_id` bigint NOT NULL DEFAULT 1 COMMENT '用户ID',
  224. PRIMARY KEY (`id`) USING BTREE
  225. ) ENGINE = InnoDB AUTO_INCREMENT = 20153 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '文章,Article' ROW_FORMAT = DYNAMIC;
  226. -- ----------------------------
  227. -- Records of blossom_article
  228. -- ----------------------------
  229. -- ----------------------------
  230. -- Table structure for blossom_article_log
  231. -- ----------------------------
  232. CREATE TABLE IF NOT EXISTS `blossom_article_log` (
  233. `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'ID',
  234. `article_id` bigint NOT NULL COMMENT '文章ID',
  235. `version` int NOT NULL DEFAULT 0 COMMENT '版本',
  236. `markdown` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '文章内容',
  237. `cre_time` datetime NOT NULL COMMENT '修改日期',
  238. PRIMARY KEY (`id`) USING BTREE
  239. ) ENGINE = InnoDB AUTO_INCREMENT = 146 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '文章记录,ArticleLog' ROW_FORMAT = DYNAMIC;
  240. -- ----------------------------
  241. -- Records of blossom_article_log
  242. -- ----------------------------
  243. -- ----------------------------
  244. -- Table structure for blossom_article_log
  245. -- since 1.10.0
  246. -- ----------------------------
  247. CREATE TABLE IF NOT EXISTS `blossom_article_recycle` (
  248. `id` bigint NOT NULL COMMENT 'ID',
  249. `pid` bigint NOT NULL COMMENT '文件夹ID',
  250. `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '文章名称',
  251. `icon` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '文章图标',
  252. `tags` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '标签集合',
  253. `sort` int NOT NULL DEFAULT '1' COMMENT '排序',
  254. `cover` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '封面',
  255. `describes` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '描述',
  256. `pv` int NOT NULL DEFAULT '0' COMMENT '页面的查看数',
  257. `uv` int NOT NULL DEFAULT '0' COMMENT '独立的访问次数,每日IP重置',
  258. `likes` int NOT NULL DEFAULT '0' COMMENT '点赞数',
  259. `words` int NOT NULL DEFAULT '0' COMMENT '文章字数',
  260. `version` int NOT NULL DEFAULT '0' COMMENT '版本',
  261. `color` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '颜色',
  262. `markdown` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'Markdown 内容',
  263. `cre_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  264. `upd_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  265. `del_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '删除时间',
  266. `user_id` bigint NOT NULL DEFAULT '1' COMMENT '用户ID',
  267. PRIMARY KEY (`id`) USING BTREE
  268. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC COMMENT='文章回收站';
  269. -- ----------------------------
  270. -- Table structure for blossom_article_open
  271. -- ----------------------------
  272. CREATE TABLE IF NOT EXISTS `blossom_article_open` (
  273. `id` bigint NOT NULL COMMENT '文章ID',
  274. `pid` bigint NOT NULL COMMENT '文件夹ID',
  275. `words` int NOT NULL COMMENT '字数',
  276. `open_version` int NOT NULL DEFAULT 1 COMMENT '版本',
  277. `open_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '公开时间',
  278. `sync_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '同步时间',
  279. `toc` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '目录',
  280. `markdown` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT 'Markdown 内容',
  281. `html` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT 'Html内容',
  282. `user_id` bigint NOT NULL DEFAULT 1 COMMENT '用户ID',
  283. PRIMARY KEY (`id`) USING BTREE
  284. ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '公开文章,ArticleOpen' ROW_FORMAT = DYNAMIC;
  285. -- ----------------------------
  286. -- Records of blossom_article_open
  287. -- ----------------------------
  288. -- ----------------------------
  289. -- Table structure for blossom_article_reference
  290. -- ----------------------------
  291. CREATE TABLE IF NOT EXISTS `blossom_article_reference` (
  292. `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'ID',
  293. `source_id` bigint NOT NULL COMMENT '文章ID',
  294. `source_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '文章名称',
  295. `target_Id` bigint NOT NULL COMMENT '引用文章ID',
  296. `target_name` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '引用名称',
  297. `target_url` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '图片链接',
  298. `type` tinyint NOT NULL COMMENT '引用类型: 10:图片; 11:文章; 21:外部文章',
  299. `user_id` bigint NOT NULL DEFAULT '1' COMMENT '用户ID',
  300. PRIMARY KEY (`id`) USING BTREE,
  301. KEY `idx_article_ref_sourceid` (`source_id`) USING BTREE COMMENT 'source id',
  302. KEY `idx_article_ref_targetid` (`target_Id`) USING BTREE COMMENT 'target id'
  303. ) ENGINE=InnoDB AUTO_INCREMENT=100000 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC;
  304. -- ----------------------------
  305. -- Records of blossom_article_reference
  306. -- ----------------------------
  307. -- ----------------------------
  308. -- Table structure for blossom_article_view
  309. -- ----------------------------
  310. CREATE TABLE IF NOT EXISTS `blossom_article_view` (
  311. `id` int NOT NULL AUTO_INCREMENT COMMENT 'ID',
  312. `article_id` bigint NOT NULL COMMENT '文章ID',
  313. `type` char(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '事件类型 1:uv; 2:like',
  314. `ip` varchar(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '地址,IPV4',
  315. `user_agent` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '设备',
  316. `country` varchar(50) COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '国家',
  317. `province` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '省',
  318. `city` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '市',
  319. `cre_day` date NOT NULL COMMENT '日期 yyyy-MM-dd',
  320. `cre_time` datetime NOT NULL COMMENT '日期',
  321. PRIMARY KEY (`id`) USING BTREE,
  322. KEY `idx_view_articleid` (`article_id`) USING BTREE COMMENT '文章ID',
  323. KEY `idx_view_ip` (`ip`) USING BTREE COMMENT 'IP',
  324. KEY `idx_view_creday` (`cre_day`) USING BTREE COMMENT '日期'
  325. ) ENGINE=InnoDB AUTO_INCREMENT=465 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC COMMENT='文章访问记录,ArticleView';
  326. -- ----------------------------
  327. -- Records of blossom_article_view
  328. -- ----------------------------
  329. -- ----------------------------
  330. -- Table structure for blossom_folder
  331. -- ----------------------------
  332. CREATE TABLE IF NOT EXISTS `blossom_folder` (
  333. `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'id',
  334. `pid` bigint UNSIGNED NOT NULL COMMENT '父id',
  335. `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '文件夹名称',
  336. `icon` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '图标',
  337. `tags` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '标签',
  338. `open_status` tinyint(1) NOT NULL DEFAULT 0 COMMENT '开放状态',
  339. `sort` int UNSIGNED NOT NULL DEFAULT 1 COMMENT '排序',
  340. `cover` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '封面图片',
  341. `color` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '颜色',
  342. `describes` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '备注',
  343. `store_path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '/' COMMENT '存储地址',
  344. `subject_words` int NOT NULL DEFAULT 0 COMMENT '专题字数',
  345. `subject_upd_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '专题的最后修改时间',
  346. `type` tinyint(1) NOT NULL DEFAULT 1 COMMENT '1:文章;2:图片',
  347. `cre_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  348. `upd_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  349. `user_id` bigint NOT NULL DEFAULT 1 COMMENT '用户ID',
  350. PRIMARY KEY (`id`) USING BTREE
  351. ) ENGINE = InnoDB AUTO_INCREMENT = 12035 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '文件夹,Folder' ROW_FORMAT = DYNAMIC;
  352. alter table blossom_folder modify icon varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL default '' comment '图标';
  353. alter table blossom_folder modify sort int NOT NULL default 1 comment '排序';
  354. -- ----------------------------
  355. -- Records of blossom_folder
  356. -- ----------------------------
  357. -- ----------------------------
  358. -- Table structure for blossom_note
  359. -- ----------------------------
  360. CREATE TABLE IF NOT EXISTS `blossom_note` (
  361. `id` bigint NOT NULL AUTO_INCREMENT,
  362. `content` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '内容',
  363. `top` tinyint(1) NOT NULL DEFAULT 0 COMMENT '置顶',
  364. `top_time` datetime NULL DEFAULT NULL COMMENT '置顶时间',
  365. `cre_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  366. `user_id` bigint NOT NULL DEFAULT 1 COMMENT '用户ID',
  367. PRIMARY KEY (`id`) USING BTREE
  368. ) ENGINE = InnoDB AUTO_INCREMENT = 18 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = DYNAMIC;
  369. -- ----------------------------
  370. -- Records of blossom_note
  371. -- ----------------------------
  372. -- ----------------------------
  373. -- Table structure for blossom_picture
  374. -- ----------------------------
  375. CREATE TABLE IF NOT EXISTS `blossom_picture` (
  376. `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'ID',
  377. `pid` bigint NOT NULL DEFAULT -1 COMMENT '文件夹ID',
  378. `source_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '原文件名',
  379. `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '文件名',
  380. `path_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '文件路径',
  381. `url` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '文件访问url',
  382. `rate` tinyint NOT NULL DEFAULT 0 COMMENT '评分 {0,1,2,3,4,5}',
  383. `star_status` tinyint(1) NOT NULL DEFAULT 0 COMMENT '收藏 0:否,1:是',
  384. `suffix` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '文件后缀',
  385. `size` bigint NOT NULL DEFAULT 0 COMMENT '文件大小',
  386. `cre_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '创建日期',
  387. `user_id` bigint NOT NULL DEFAULT 1 COMMENT '用户ID',
  388. PRIMARY KEY (`id`) USING BTREE,
  389. UNIQUE INDEX `unq_pic_url`(`url`) USING BTREE COMMENT '链接唯一',
  390. UNIQUE INDEX `unq_pic_pathname`(`path_name`) USING BTREE COMMENT '路径唯一'
  391. ) ENGINE = InnoDB AUTO_INCREMENT = 305774931235323969 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '图片,Picture' ROW_FORMAT = DYNAMIC;
  392. -- ----------------------------
  393. -- Records of blossom_picture
  394. -- ----------------------------
  395. -- ----------------------------
  396. -- Table structure for blossom_plan
  397. -- ----------------------------
  398. CREATE TABLE IF NOT EXISTS `blossom_plan` (
  399. `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'ID',
  400. `group_id` bigint NOT NULL COMMENT '分组ID',
  401. `type` tinyint(1) NOT NULL COMMENT '计划类型: daily, day',
  402. `title` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '标题',
  403. `content` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '内容',
  404. `plan_month` varchar(7) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '日期所在月份',
  405. `plan_date` date NULL DEFAULT NULL COMMENT '日期: day',
  406. `plan_start_time` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '开始时间: daily, day',
  407. `plan_end_time` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '结束时间',
  408. `color` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '颜色',
  409. `position` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '该计划在该组计划的位置 head, tail, all',
  410. `img` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '图片名称, 或图片地址',
  411. `cre_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建日期',
  412. `user_id` bigint NOT NULL DEFAULT 1 COMMENT '用户ID',
  413. PRIMARY KEY (`id`) USING BTREE
  414. ) ENGINE = InnoDB AUTO_INCREMENT = 142 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '计划,Plan' ROW_FORMAT = DYNAMIC;
  415. -- ----------------------------
  416. -- Records of blossom_plan
  417. -- ----------------------------
  418. -- ----------------------------
  419. -- Table structure for blossom_stat
  420. -- ----------------------------
  421. CREATE TABLE IF NOT EXISTS `blossom_stat` (
  422. `id` bigint NOT NULL AUTO_INCREMENT,
  423. `type` tinyint(1) NOT NULL COMMENT '统计类型: 1:每日编辑文章数; 2:每月总字数;',
  424. `stat_date` date NOT NULL COMMENT '统计日期',
  425. `stat_value` int NOT NULL DEFAULT 0 COMMENT '统计数值',
  426. `user_id` bigint NOT NULL DEFAULT 1 COMMENT '用户ID',
  427. PRIMARY KEY (`id`) USING BTREE
  428. ) ENGINE = InnoDB AUTO_INCREMENT = 218 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = DYNAMIC;
  429. -- ----------------------------
  430. -- Records of blossom_stat
  431. -- ----------------------------
  432. -- ----------------------------
  433. -- Table structure for blossom_web
  434. -- ----------------------------
  435. CREATE TABLE IF NOT EXISTS `blossom_web` (
  436. `id` int NOT NULL AUTO_INCREMENT,
  437. `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '网页名称',
  438. `url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '网页url',
  439. `icon` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '图标',
  440. `img` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '图片, 图片的优先级高于图标',
  441. `type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '类型 ',
  442. `sort` int NOT NULL DEFAULT 1 COMMENT '排序',
  443. `cre_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  444. `user_id` bigint NOT NULL DEFAULT 1 COMMENT '用户ID',
  445. PRIMARY KEY (`id`) USING BTREE
  446. ) ENGINE = InnoDB AUTO_INCREMENT = 292 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '[FS] 网站收藏' ROW_FORMAT = DYNAMIC;
  447. alter table blossom_web modify icon varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL default '' comment '图标';
  448. -- ----------------------------
  449. -- Records of blossom_web
  450. -- ----------------------------
  451. -- ----------------------------
  452. -- Table structure for blossom_todo
  453. -- ----------------------------
  454. CREATE TABLE IF NOT EXISTS `blossom_todo` (
  455. `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'ID',
  456. `todo_id` varchar(50) COLLATE utf8mb4_bin NOT NULL COMMENT '事项ID',
  457. `todo_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '事项名称',
  458. `todo_status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '事项状态 1:未完成 | 2:完成 | 9:作废',
  459. `todo_type` tinyint(1) NOT NULL DEFAULT '10' COMMENT '事项类型 10:每日待办事项 | 20:阶段性事项',
  460. `task_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '任务名称',
  461. `task_content` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '任务内容',
  462. `task_tags` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '便签',
  463. `task_status` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT 'WAITING' COMMENT '任务状态 WAIT | PROC | DONE',
  464. `dead_line` varchar(100) COLLATE utf8mb4_bin DEFAULT '' COMMENT '截止日期',
  465. `start_time` datetime DEFAULT NULL COMMENT '开始日期',
  466. `end_time` datetime DEFAULT NULL COMMENT '结束日期',
  467. `color` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '颜色',
  468. `process` tinyint(1) NOT NULL DEFAULT '0' COMMENT '进度 0 ~ 100',
  469. `user_id` bigint DEFAULT NULL COMMENT '用户ID',
  470. `cre_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  471. PRIMARY KEY (`id`),
  472. KEY `idx_todo_todoid` (`todo_id`) COMMENT 'todoid 索引',
  473. KEY `idx_todo_userid` (`user_id`) USING BTREE COMMENT 'userid 索引',
  474. KEY `idx_todo_cretime` (`cre_time`) USING BTREE COMMENT '创建时间'
  475. ) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='待办事项,Todo';
  476. SET FOREIGN_KEY_CHECKS = 1;

3、将【schema-mysql.sql】文件上传到群晖NAS的路径中且查看该文件路径

①将【schema-mysql.sql】文件上传到群晖NAS的【docker/blossom】路径中,如下图所示:

②【schema-mysql.sql】文件上传到群晖NAS的【docker/blossom】路径成功后查看该【schema-mysql.sql】文件的完整路径并复制下来,如下图所示:

4、使用ssh工具连接到群晖NAS后查看blossom的容器id

查看docker下所有容器的ID命令:

sudo docker ps

5、使用我们修改的【schema-mysql.sql】blossom初始文件替换原来的文件

首先我们需要使用ssh工具进入到群晖NAS,然后在执行替换命令:

sudo docker cp /volume1/docker/blossom/schema-mysql.sql b9275737e077:/application/BOOT-INF/classes/

6、重启blossom的容器

重启docker容器命令

sudo docker restart 需重启的docker容器id

比如我要重启容器id是【b9275737e077】的容器命令如下:

sudo docker restart b9275737e077

7、再次验证部署的blossom容器是否成功

        用ssh工具进入到群晖NAS,然后在执验证部署的blossom容器是否成功命令,如执行该命令后最下面的内容如下图显示的客户端访问地址XXX则表示成功。

启动成功: 可使用客户端登录, 默认用户名/密码: blos/blos
下载地址: https://github.com/blossom-editor/blossom/releases
文档地址: https://www.wangyunf.com/blossom-doc/index
博客端访问地址: http://IP:端口(域名)/blog/#/home
客户端访问地址: http://IP:端口(域名)/editor/#/settingindex
sudo docker logs blossom-backend

2.4、输入群晖NASIP:9999查看

        在浏览器输入群晖NASIP:9999后按下Enter键后若出现如下所示的【无效的授权信息】内容也表示blossom的服务端部署完成;

2.5、在群晖NAS部署blossom的网页客户端

1、下载blossom的网页客户端后解压

下载 | Blossom (wangyunf.com)

Releases · blossom-editor/blossom · GitHub

 或者可以直接到blossom指定的百度网盘下载blossom的网页客户端

前往百度网盘下载:百度网盘 请输入提取码

提取码uksl

2、将下载好的blossom网页客户端上传到群晖NAS中

将下载好的blossom网页客户端上传到群晖NAS中路径如下所示:

3、群晖NAS中配置blossom的网页客户端网页内容

 

 

 验证在群晖NAS部署的blossom网页客户端是否成功【在浏览器中输入群晖NASIP:9998】后按下Enter键;

三、登陆自己的blossom

1、在浏览器中输入群晖NASIP:9998后按下Enter键进入blossom的网页客户端;

2、在blossom的网页客户端输入自己部署好的blossom服务地址【群晖NASIP:9999】(比如我的是:http://172.24.1.6:9999)、默认账号和密码都是【blos】

3、登陆成功后显示如下

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/知新_RL/article/detail/619147
推荐阅读
相关标签
  

闽ICP备14008679号