{"id":222,"date":"2026-06-24T14:36:15","date_gmt":"2026-06-24T06:36:15","guid":{"rendered":"https:\/\/blog.notiq.cn\/?p=222"},"modified":"2026-06-24T14:36:33","modified_gmt":"2026-06-24T06:36:33","slug":"222","status":"publish","type":"post","link":"https:\/\/blog.notiq.cn\/index.php\/2026\/06\/24\/222\/","title":{"rendered":"shlink\u77ed\u94fe\u63a5\u5de5\u5177\u914d\u7f6e"},"content":{"rendered":"<h2>\u77ed\u94fe\u63a5\u5de5\u5177\u914d\u7f6e<\/h2>\n<blockquote>\n<p>\u8fd9\u91cc\u5206\u4eab\u4e0b\u81ea\u5df1\u9009\u62e9shink\u914d\u7f6e\u7684\u5168\u56fd\u6210<\/p>\n<\/blockquote>\n<h3>\u9700\u6c42\u5206\u6790<\/h3>\n<p>\u5206\u4eab\u9875\u9762url\u94fe\u63a5\u592a\u8fc7\u4e8e\u5197\u957f\u4e0d\u65b9\u4fbf\u8bb0\u5fc6\uff0c\u60f3\u901a\u8fc7\u65b0\u7684\u597d\u8bb0\u5f97url\u91cd\u5b9a\u5411\u5230\u539f\u6765\u7684\u5206\u4eab\u9875\u9762\u3002<\/p>\n<h3>\u5de5\u5177\u9009\u62e9<\/h3>\n<p>\u9009\u62e9\u4e86shink\uff1a\u652f\u6301\u81ea\u5b9a\u4e49\u77ed\u7801\u3001\u8fc7\u671f\u65f6\u95f4\u3001\u8bbf\u95ee\u7edf\u8ba1\u3001API\u3001Docker \u6613\u90e8\u7f72<\/p>\n<p>\u6570\u636e\u5e93\u9009\u7528\u4e86sqlite\u56e0\u4e3a\u5c0f\u578b\u670d\u52a1\u5668\uff0c\u6ca1\u6709\u592a\u591a\u5e76\u53d1\u9700\u6c42<\/p>\n<p><a href=\"https:\/\/developer.aliyun.com\/article\/1584050\">\u53c2\u8003<\/a><\/p>\n<h3>\u90e8\u7f72\u8fc7\u7a0b<\/h3>\n<h4>\u547d\u4ee4\u521b\u5efa<\/h4>\n<pre><code>docker run -d \\\n  --name shlink \\\n  --restart unless-stopped \\\n  -p 127.0.0.1:8080:8080 \\\n  -e DEFAULT_DOMAIN=shlink.example.cn \\\n  -e IS_HTTPS_ENABLED=true \\\n  -e INITIAL_API_KEY=\"xxxxxxxxxxxxxxx\" \\\n  -e TIMEZONE=Asia\/Shanghai \\\n  -v \/opt\/shlink\/data:\/etc\/shlink\/data \\\n  shlinkio\/shlink:stable<\/code><\/pre>\n<p><strong>\u6ce8\u610f<\/strong><\/p>\n<blockquote>\n<p>\u76ee\u5f55 \/opt\/shlink\/data\u9700\u8d4b\u4e88\u5408\u9002\u6743\u9650<\/p>\n<p>chmod -R 777 \/opt\/shlink\/data<\/p>\n<p>INITIAL_API_KEY\uff1a\u540e\u7eed\u9700\u8981\u4f7f\u7528\u53ef\u968f\u673a\u751f\u6210\uff1a<a href=\"https:\/\/blog.notiq.cn\/tools\/apikey_create\/index.html\">\u5bc6\u94a5\u751f\u6210\u5de5\u5177<\/a><\/p>\n<\/blockquote>\n<h4>\u53cd\u5411\u4ee3\u7406<\/h4>\n<ol>\n<li>\n<p>\u5b9d\u5854\u6dfb\u52a0\u7ad9\u70b9<br \/>\n\u5b9d\u5854 \u2192 \u7f51\u7ad9 \u2192 \u6dfb\u52a0\u7ad9\u70b9\uff1a\u57df\u540d<\/p>\n<\/li>\n<li>\n<p>\u8bbe\u7f6e\u53cd\u5411\u4ee3\u7406<br \/>\n\u7ad9\u70b9\u8bbe\u7f6e \u2192 \u53cd\u5411\u4ee3\u7406 \u2192 \u6dfb\u52a0\uff1a\u2022\u76ee\u6807 URL\uff1a<a href=\"http:\/\/127.0.0.1:8080\">http:\/\/127.0.0.1:8080<\/a>\u3001<\/p>\n<\/li>\n<\/ol>\n<h4>\u7528\u5b98\u65b9 Web Client \u7ba1\u7406<\/h4>\n<p>\u5728\u4f60\u81ea\u5df1\u7535\u8111\u6253\u5f00\u5b98\u65b9 Shlink Web Client<a href=\"https:\/\/shlink.io\/\">Shlink \u2014 The URL shortener<\/a> \u540e\u586b\u5199\uff1a<\/p>\n<p>Server URL\uff1a\u57df\u540d<\/p>\n<p>API Key\uff1a\u4f60\u8bbe\u7f6e\u7684 <\/p>\n<p>\u5373\u53ef\u5f00\u59cb\u6b63\u5e38\u4f7f\u7528<\/p>\n<p><a href=\"https:\/\/zhichao.org\/posts\/62e6b2\">\u77ed\u94fe\u63a5\u5de5\u5177 Shlink \u90e8\u7f72\u7b80\u5355\u800c\u53c8\u529f\u80fd\u5f3a\u5927 \u652f\u6301\u591a\u79cd\u6570\u636e\u5e93 | ZhiChao&#8217;s Blog<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u77ed\u94fe\u63a5\u5de5\u5177\u914d\u7f6e \u8fd9\u91cc\u5206\u4eab\u4e0b\u81ea\u5df1\u9009\u62e9shink\u914d\u7f6e\u7684\u5168\u56fd\u6210 \u9700\u6c42\u5206\u6790 \u5206\u4eab\u9875\u9762url\u94fe\u63a5\u592a\u8fc7\u4e8e\u5197\u957f\u4e0d\u65b9\u4fbf\u8bb0\u5fc6\uff0c\u60f3 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18,6],"tags":[],"class_list":["post-222","post","type-post","status-publish","format-standard","hentry","category-tools","category-6"],"_links":{"self":[{"href":"https:\/\/blog.notiq.cn\/index.php\/wp-json\/wp\/v2\/posts\/222","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.notiq.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.notiq.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.notiq.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.notiq.cn\/index.php\/wp-json\/wp\/v2\/comments?post=222"}],"version-history":[{"count":1,"href":"https:\/\/blog.notiq.cn\/index.php\/wp-json\/wp\/v2\/posts\/222\/revisions"}],"predecessor-version":[{"id":227,"href":"https:\/\/blog.notiq.cn\/index.php\/wp-json\/wp\/v2\/posts\/222\/revisions\/227"}],"wp:attachment":[{"href":"https:\/\/blog.notiq.cn\/index.php\/wp-json\/wp\/v2\/media?parent=222"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.notiq.cn\/index.php\/wp-json\/wp\/v2\/categories?post=222"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.notiq.cn\/index.php\/wp-json\/wp\/v2\/tags?post=222"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}