{"id":1204,"date":"2026-09-03T11:00:48","date_gmt":"2026-09-03T03:00:48","guid":{"rendered":"https:\/\/h4ckm310n.com\/?p=1204"},"modified":"2026-09-03T14:43:29","modified_gmt":"2026-09-03T06:43:29","slug":"codimd%e8%bf%81%e7%a7%bb%e5%88%b0hedgedoc","status":"publish","type":"post","link":"https:\/\/h4ckm310n.com\/?p=1204","title":{"rendered":"CodiMD\u8fc1\u79fb\u5230HedgeDoc"},"content":{"rendered":"<p><!--more--><\/p>\n<p>\u7531\u4e8eCodiMD\u5df2\u7ecf\u8fd1\u4e00\u5e74\u6ca1\u66f4\u65b0\u4e86\uff0c\u66f4\u65b0\u9891\u7387\u8fdc\u4e0d\u5982HedgeDoc\uff08\u867d\u7136\u73b0\u5728\u7684\u529f\u80fd\u4e5f\u591f\u7528\uff09\uff0c\u4e8e\u662f\u6211\u8fc1\u79fb\u5230\u4e86HedgeDoc\u3002<\/p>\n<h4>\u521b\u5efa\u5bb9\u5668<\/h4>\n<p>\u6839\u636e\u5b98\u65b9\u6587\u6863\uff0c\u5199\u4e00\u4e2adocker-compose.yaml\uff1a<\/p>\n<pre>\r\nversion: '3'\r\nservices:\r\n  app:\r\n    # Make sure to use the latest release from https:\/\/hedgedoc.org\/latest-release\r\n    image: quay.io\/hedgedoc\/hedgedoc:latest\r\n    environment:\r\n      - CMD_DB_URL=postgres:\/\/USERNAME:PASSWORD@172.17.0.1:5432\/hedgedoc\r\n      - CMD_DOMAIN=codimd.domain\r\n      - CMD_URL_ADDPORT=false\r\n      - CMD_PROTOCOL_USESSL=true\r\n      - CMD_LOGLEVEL=debug\r\n      - CMD_ALLOW_ANONYMOUS=false\r\n      - CMD_ALLOW_ANONYMOUS_EDITS=false\r\n      - CMD_ALLOW_EMAIL_REGISTER=false\r\n      \r\n    volumes:\r\n      - uploads:\/hedgedoc\/public\/uploads\r\n    ports:\r\n      - \"3001:3000\"\r\n    restart: always\r\nvolumes:\r\n  uploads:\r\n<\/pre>\n<p>\u5176\u4e2d\uff0cCMD_DOMAIN\u6307\u5411\u6211\u73b0\u5728\u7684CodiMD\u7684\u57df\u540d\uff0c\u540c\u65f6\u5173\u95ed\u533f\u540d\u529f\u80fd\u4e0e\u6ce8\u518c\u529f\u80fd\u3002\u5bbf\u4e3b\u7cfb\u7edf\u76843000\u7aef\u53e3\u76ee\u524d\u88abCodiMD\u7684\u7aef\u53e3\u8f6c\u53d1\u5360\u7528\u7740\uff0c\u4e8e\u662f\u4f7f\u75283001\u3002<\/p>\n<p>\u63a5\u4e0b\u6765\uff0c\u542f\u52a8\u5bb9\u5668\u3002\u6839\u636e\u5bb9\u5668log\u4e2d\u7684\u8f93\u51fa\u5185\u5bb9\uff0c\u53ef\u80fd\u4f1a\u51fa\u73b0\u6570\u636e\u5e93\u8f6c\u6362\u811a\u672c\u8fd0\u884c\u9519\u8bef\u7684\u60c5\u51b5\uff0c\u53ef\u4ee5\u6839\u636e <a href=\"https:\/\/docs.hedgedoc.org\/guides\/migration-troubleshooting\/\" target=\"_blank\">https:\/\/docs.hedgedoc.org\/guides\/migration-troubleshooting\/<\/a> \u7684\u65b9\u6cd5\uff0c\u5728SequelizeMeta\u8868\u4e2d\u52a0\u5165\u4e00\u884c\u5bf9\u5e94\u7684js\u6587\u4ef6\u540d\u3002<\/p>\n<h4>\u53cd\u5411\u4ee3\u7406<\/h4>\n<p>\u6839\u636e<a href=\"https:\/\/docs.hedgedoc.org\/guides\/reverse-proxy\/\" target=\"_blank\">https:\/\/docs.hedgedoc.org\/guides\/reverse-proxy\/<\/a>\u7684\u5199\u6cd5\uff0c\u4fee\u6539\u539f\u6709\u7684CodiMD\u57df\u540d\u7684nginx\u914d\u7f6e\uff0c\u53cd\u5411\u4ee3\u7406\u81f3HedgeDoc\u76843001\u7aef\u53e3\u3002<\/p>\n<p>\u6b64\u65f6\u8bbf\u95ee\u57df\u540d\uff0c\u5e94\u8be5\u80fd\u591f\u6b63\u5e38\u8fdb\u5165HedgeDoc\u7684\u9875\u9762\u3002<\/p>\n<h4>\u8fc1\u79fb\u6570\u636e\u5e93<\/h4>\n<p>\u73b0\u5728\uff0cHedgeDoc\u7684\u6570\u636e\u5e93\u7684\u5185\u5bb9\u8fd8\u662f\u7a7a\u7684\uff0c\u9700\u8981\u5c06\u539f\u5148CodiMD\u7684\u6570\u636e\u5e93\u8fc1\u79fb\u8fc7\u6765\u3002\u5f00\u59cb\u8fc1\u79fb\u4e4b\u524d\uff0c\u5148\u5173\u6389HedgeDoc\u7684\u5bb9\u5668\u3002<\/p>\n<p>\u6211\u5c06CodiMD\u7684\u6570\u636e\u5e93\u653e\u5728MySQL\u4e2d\uff0c\u800c\u73b0\u5728HedgeDoc\u7684\u6570\u636e\u5e93\u5219\u653e\u5728PostgreSQL\u4e2d\u3002<\/p>\n<p>\u8fc1\u79fb\u9700\u8981\u4f7f\u7528pgloader\u3002<\/p>\n<pre>\r\npgloader mysql:\/\/myuser:password@172.17.0.1\/codimd pgsql:\/\/pguser:password@172.17.0.1\/hedgedoc\r\n<\/pre>\n<p>\u8fdb\u5165PostgreSQL\u6570\u636e\u5e93\uff0c\u53ef\u4ee5\u770b\u5230\u591a\u4e86\u4e00\u4e2a\u540d\u4e3acodimd\u7684\u6a21\u5f0f\uff0c\u5176\u4e2d\u7684\u8868\u5c31\u662f\u539f\u672cCodiMD\u6570\u636e\u5e93\u4e2d\u7684\u8868\uff0c\u800cHedgeDoc\u7684\u8868\u5219\u653e\u5728public\u6a21\u5f0f\u4e2d\u3002codimd\u6a21\u5f0f\u4e2d\u7684\u8868\u4e0epublic\u6a21\u5f0f\u4e2d\u7684\u8868\u53ef\u4ee5\u4e00\u4e00\u5bf9\u5e94\uff0c\u4e3b\u8981\u533a\u522b\u53ea\u6709\u4e24\u4e2a\uff1a<br \/>\n1. codimd\u6a21\u5f0f\u4e2d\u7684\u8868\u7684\u540d\u79f0\u662f\u5168\u5c0f\u5199\uff08\u4f8b\u5982users\uff09\uff0c\u800cpublic\u6a21\u5f0f\u4e2d\u7684\u8868\u7684\u540d\u79f0\u662f\u5927\u5199\u5f00\u5934\uff08\u4f8b\u5982Users\uff09\uff1b<br \/>\n2. \u90e8\u5206\u5b57\u6bb5\u7684\u6570\u636e\u7c7b\u578b\u6709\u533a\u522b\uff0c\u4f8b\u5982codimd.users.id\u662fbpchar(36)\u7c7b\u578b\uff0c\u800cpublic.Users.id\u662fuuid\u7c7b\u578b\uff0c\u5728\u8fc1\u79fb\u65f6\u9700\u8981\u8fdb\u884c\u8f6c\u6362\u3002<\/p>\n<p>\u4ee5codimd.users\u8fc1\u79fb\u5230public.Users\u4e3a\u4f8b\uff0csql\u8bed\u53e5\u53ef\u4ee5\u8fd9\u4e48\u5199\uff1a<\/p>\n<pre>\r\nTRUNCATE TABLE public.\"Users\";\r\nINSERT INTO public.\"Users\"\r\nSELECT id::text::uuid, profileid, profile, history, createdat, updatedat, accesstoken, refreshtoken, email, \"password\", deletetoken::text::uuid\r\nFROM codimd.users;;\r\n<\/pre>\n<p>\u7b2c\u4e00\u6761\u8bed\u53e5\u662f\u6e05\u7a7apublic.Users\u8868\u4e2d\u7684\u6570\u636e\uff0c\u7b2c\u4e8c\u6761\u8bed\u53e5\u662f\u4ececodimd.users\u9009\u62e9\u6240\u6709\u6570\u636e\u5e76\u63d2\u5165\u5230public.Users\u4e2d\uff0c\u5176\u4e2d\u7684id\u548cdeletetoken\u4e24\u4e2a\u5b57\u6bb5\u9700\u8981\u8f6c\u6362\u4e3auuid\u7c7b\u578b\u3002<\/p>\n<p>\u9664\u4e86sequelizemeta\u8868\u548csessions\u8868\u4ee5\u5916\uff0c\u5176\u4ed6\u8868\u90fd\u9700\u8981\u8fdb\u884c\u5982\u6b64\u8fc1\u79fb\u3002\u5c24\u5176\u4e0d\u80fd\u8fc1\u79fbsequalizemeta\u8868\uff0c\u5426\u5219\u4f1a\u5bfc\u81f4HedgeDoc\u542f\u52a8\u9519\u8bef\u3002<\/p>\n<p>\u518d\u6b21\u6253\u5f00HedgeDoc\u5bb9\u5668\uff0c\u5c31\u53ef\u4ee5\u767b\u5f55\u539f\u6765\u7684\u8d26\u53f7\uff0c\u4e5f\u53ef\u4ee5\u770b\u5230\u4e4b\u524d\u7684\u6587\u6863\u5185\u5bb9\u4e86\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[7,6],"tags":[],"class_list":["post-1204","post","type-post","status-publish","format-standard","hentry","category-vps","category-6"],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false},"uagb_author_info":{"display_name":"h4ckm310n","author_link":"https:\/\/h4ckm310n.com\/?author=1"},"uagb_comment_info":0,"uagb_excerpt":null,"_links":{"self":[{"href":"https:\/\/h4ckm310n.com\/index.php?rest_route=\/wp\/v2\/posts\/1204","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/h4ckm310n.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/h4ckm310n.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/h4ckm310n.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/h4ckm310n.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1204"}],"version-history":[{"count":3,"href":"https:\/\/h4ckm310n.com\/index.php?rest_route=\/wp\/v2\/posts\/1204\/revisions"}],"predecessor-version":[{"id":1207,"href":"https:\/\/h4ckm310n.com\/index.php?rest_route=\/wp\/v2\/posts\/1204\/revisions\/1207"}],"wp:attachment":[{"href":"https:\/\/h4ckm310n.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1204"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/h4ckm310n.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1204"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/h4ckm310n.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1204"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}