{"id":527839,"date":"2021-08-21T22:52:10","date_gmt":"2021-08-21T14:52:10","guid":{"rendered":"http:\/\/4563.org\/?p=527839"},"modified":"2021-08-21T22:52:10","modified_gmt":"2021-08-21T14:52:10","slug":"%e3%80%90%e6%95%99%e7%a8%8b%e3%80%91%e8%bd%bb%e9%87%8f%e6%8a%98%e8%85%be%e8%ae%a1%e5%88%923%ef%bc%8c%e6%90%ad%e5%bb%ba%e5%b1%9e%e4%ba%8e%e8%87%aa%e5%b7%b1%e7%9a%84%e5%bc%80%e5%8f%91%e5%85%a8-2","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=527839","title":{"rendered":"\u3010\u6559\u7a0b\u3011\u8f7b\u91cf\u6298\u817e\u8ba1\u52123\uff0c\u642d\u5efa\u5c5e\u4e8e\u81ea\u5df1\u7684\u5f00\u53d1\u5168\u5bb6\u6876\uff0c\u4e0b\u7bc7"},"content":{"rendered":"\n<p>  \t\t\t\t\t<strong>nnt<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3>\u3010\u6559\u7a0b\u3011\u8f7b\u91cf\u6298\u817e\u8ba1\u52123\uff0c\u642d\u5efa\u5c5e\u4e8e\u81ea\u5df1\u7684\u5f00\u53d1\u5168\u5bb6\u6876\uff0c\u4e0b\u7bc7<\/h3>\n<p>  \t\t \u672c\u5e16\u6700\u540e\u7531 nnt \u4e8e 2021-8-21 14:14 \u7f16\u8f91 <\/p>\n<p> \u539f\u6587Markdown\u5199\u7684\uff0c\u66f4\u597d\u7684\u9605\u8bfb\u4f53\u9a8c\u8bf7\u524d\u5f80\uff1ahttps:\/\/cloud.tencent.com\/developer\/article\/1865833<\/p>\n<p>  \u524d\u8a00<\/p>\n<p>  \u5728[\u4e0a\u7bc7\u6587\u7ae0](https:\/\/blog.1234234.xyz\/archives\/22\/)\u4e2d\uff0c\u6211\u4eec\u5229\u7528\u817e\u8baf\u4e91\u8f7b\u91cf\u5e94\u7528\u670d\u52a1\u5668\u642d\u5efa\u4e86codeserver\u5728\u7ebfIDE\u3001gogs\u8f7b\u91cfGIT\u5e73\u53f0\uff0c\u5728\u8fd9\u7bc7\u6587\u7ae0\u4e2d\uff0c\u6211\u5c06\u7ee7\u7eed\u4e3a\u5927\u5bb6\u5e26\u6765\uff1a<\/p>\n<p>  [*]\u81ea\u5efadocker\u955c\u50cf\u4ed3\u5e93\uff1b<br \/>  [*]\u57fa\u4e8eweb\u7684ssh\u7ba1\u7406\u5e73\u53f0\uff1b<br \/>  [*]nps\u7aef\u53e3\u6620\u5c04\u9762\u677f<\/p>\n<p>  \u4ee5\u4e0a\u4e09\u5927\u529f\u80fd\u90fd\u662f\u5728\u5b9e\u9645\u5f00\u53d1\u4e2d\u6240\u9700\u8981\u6216\u8005\u8bf4\u80fd\u591f\u7528\u5f97\u4e0a\u7684\u670d\u52a1\uff0c\u53ef\u80fd\u4f1a\u5bf9\u5927\u5bb6\u6709\u6240\u5e2e\u52a9\u3002<\/p>\n<p>  \u6b63\u6587<\/p>\n<p>  \u81ea\u5efadocker\u955c\u50cf\u4ed3\u5e93<\/p>\n<p>  \u8bf4\u9053docker\u955c\u50cf\u4ed3\u5e93\uff0c\u5927\u5bb6\u4f30\u8ba1\u8111\u6d77\u91cc\u7b2c\u4e00\u4e2a\u60f3\u8d77\u7684\u5c31\u662fdockerhub\u4e86\u5427\uff0c\u867d\u8bf4dockerhub\u662f\u6709\u79c1\u4eba\u955c\u50cf\u7684\u529f\u80fd\uff0c\u4f46\u662f\u5728\u6211\u4eec\u7684\u65e5\u5e38\u5de5\u4f5c\u4e2d\uff0c\u5904\u4e8e\u4f01\u4e1a\u7684\u6570\u636e\u5b89\u5168\u8003\u8651\uff08\u540c\u65f6\u53ef\u80fd\u4e5f\u8ddf\u5168\u7403\u4e24\u4e2a\u7ecf\u6d4e\u4f53\u7684\u78b0\u649e\u6709\u5173\uff09\uff0c\u57fa\u672c\u4e0a\u662f\u4e0d\u4f1a\u4e0a\u4f20\u5230dockerhub\u4e2d\uff0c\u8fd9\u65f6\u5019\u81ea\u5efa\u4e00\u4e2a\u7b80\u5355\u7684\u955c\u50cf\u4ed3\u5e93\uff0c\u7528\u4e8e\u5728\u4e00\u4e9b\u590d\u6742\u7f51\u7edc\u7684\u73af\u5883\u8fdb\u884c\u90e8\u7f72\u8fd8\u662f\u975e\u5e38\u6709\u5fc5\u8981\u7684\u3002<\/p>\n<p>  \u53ef\u80fd\u770b\u5230\u8fd9\u6709\u7684\u5c0f\u4f19\u4f34\u4f1a\u60f3\u5230\uff1aHarbor\uff0c\u4e0d\u53ef\u5426\u8ba4\u5730\u8bf4\uff0cHarbor\u7684\u786e\u662f\u4e00\u6b3e\u975e\u5e38\u6210\u719f\u7684\u4ea7\u54c1\uff0c\u6709\u8fd9\u5b8c\u5584\u7684\u529f\u80fd\u4e14\u7f8e\u89c2\u7684UI\uff0c\u53ef\u662f\u5173\u952e\u5728\u4e8e\u4ed6\u4e0d\u591f\u8f7b\u91cf\uff01\u5728\u4e0a\u6587\u4e2d\uff0c\u6211\u4eec\u642d\u5efa\u4e86\u4e24\u6b3e\u597d\u7528\u7684\u5e94\u7528\uff0c\u603b\u8ba1\u5360\u7528\u624d\u4e0d\u5230500MB\u5185\u5b58\uff0c\u53ef\u8fd9Harbor\u6700\u4f4e\u914d\u7f6e\u8981\u6c42\u5c31\u89812\u68384G\uff0c\u663e\u793a\u662f\u4e0d\u591f\u5168\u90e8\u5e94\u7528\u5206\u7684\uff0c\u6240\u4ee5\u5728\u8fd9\u91cc\u6211\u5c06\u4f7f\u7528\u7684\u662fdocker\u5b98\u65b9\u7ed9\u51fa\u7684\u4e00\u4e2a\u63d0\u4f9b\u7ed9\u7528\u6237\u5feb\u901f\u642d\u5efa\u79c1\u6709\u955c\u50cf\u7684\u8fd9\u4e48\u4e00\u4e2a\u955c\u50cf\uff1ahttps:\/\/hub.docker.com\/_\/registry\u3002<\/p>\n<p>  \u8ddf\u4e4b\u524d\u4e00\u6837\u7684\uff0c\u6211\u4eec\u65b0\u5efa\u4e00\u4e2a\u76ee\u5f55\u4f5c\u4e3a\u5b58\u653e\u955c\u50cf\u7684\u76ee\u5f55\uff1a<\/p>\n<p>  shell<br \/>  mkdir \/registry<\/p>\n<p>  \u521b\u5efa\u5b8c\u6bd5\u4e4b\u540e\u6211\u4eec\u5728\u521b\u5efa\u4e00\u4e2a\u5bb9\u5668\u5e94\u7528\u7684\u914d\u7f6e\u6587\u4ef6\uff08\/root\/config.yml\uff09\uff0c\u5185\u5bb9\u5982\u4e0b\uff1a<\/p>\n<p>  yml<br \/>  version: 0.1<br \/>  log:<br \/>  fields:<br \/>  &nbsp; &nbsp; service: registry<br \/>  storage:<br \/>  delete:<br \/>  &nbsp; &nbsp; enabled: true<br \/>  cache:<br \/>  &nbsp; &nbsp; blobdescriptor: inmemory<br \/>  filesystem:<br \/>  &nbsp; &nbsp; rootdirectory: \/var\/lib\/registry<br \/>  http:<br \/>  addr: :5000<br \/>  headers:<br \/>  &nbsp; &nbsp; X-Content-Type-Options: <br \/>  health:<br \/>  storagedriver:<br \/>  &nbsp; &nbsp; enabled: true<br \/>  &nbsp; &nbsp; interval: 10s<br \/>  &nbsp; &nbsp; threshold: 3<\/p>\n<p>  \u76ee\u7684\u662f\u4e3a\u4e86\u80fd\u591f\u5728\u7ebf\u5220\u9664\u955c\u50cf\uff0c\u9ed8\u8ba4\u7684\u914d\u7f6e\u4e2d\u662f\u4e0d\u652f\u6301\u6b64\u64cd\u4f5c\u7684\u3002<\/p>\n<p>  \u63a5\u7740\u8fd0\u884c\u547d\u4ee4\uff1a<\/p>\n<p>  shell<br \/>  docker run -d -p 5000:5000 -v \/registry:\/var\/lib\/registry-v \/root\/config.yml:\/etc\/docker\/registry\/config.yml &#8211;name registry registry:2<\/p>\n<p>  \u7528docker\u8d77\u4e00\u4e2aregistry\u5e94\u7528\uff0c\u5e76\u628a\/registry\u548c\/root\/config.yml\u6587\u4ef6\u6302\u8f7d\u4e0a\u53bb\uff0c\u540c\u65f6\u6620\u5c04\u5bb9\u5668\u5185\u76845000\u7aef\u53e3\u3002<\/p>\n<p>  \u8fd9\u65f6\u5019\u6253\u5f00\u6211\u4eec\u7684\u5b9d\u5854\uff0c\u65b0\u5efa\u4e00\u4e2a\u7f51\u7ad9\uff08\u7531\u4e8e\u8fd9\u91cc\u9700\u8981\u9002\u7528SSL\u8bc1\u4e66\uff0c\u4e0b\u5217\u56fe\u7247\u4e2d\u7684\u57df\u540d\u6211\u4f1a\u7801\u6389\u4e00\u90e8\u5206\uff0c\u5f53\u7136\u4e0d\u7528\u4e5f\u53ef\u4ee5\uff0c\u4f46\u662f\u5f97\u591a\u4e00\u4e9b\u6b65\u9aa4\uff0c\u5982\u679c\u4e0d\u60f3\u4e0aSSL\u7684\u8bfb\u8005\u8bf7\u81ea\u884c\u641c\u7d22\u67e5\u8be2\u65b9\u6cd5\uff09\uff0c\u7ed9\u7f51\u7ad9\u6dfb\u52a0\u4e0aSSL\u8bc1\u4e66\uff1a<\/p>\n<p>  https:\/\/i.loli.net\/2021\/08\/20\/nIZ3fc2xjLbaYD9.png<\/p>\n<p>  \u4e4b\u540e\u6dfb\u52a0\u53cd\u5411\u4ee3\u7406\uff1a<\/p>\n<p>  https:\/\/i.loli.net\/2021\/08\/20\/t5REaySNwzqnhis.png<\/p>\n<p>  \u7136\u540e\u7ed9git\u6dfb\u52a0\u4e00\u4e2abasic_auth\uff08\u8fd9\u91cc\u7684\u8d26\u53f7\u5bc6\u7801\u5c31\u662f\u6211\u4eec\u540e\u8fb9docker login\u65f6\u5019\u8f93\u5165\u7684\u8d26\u53f7\u5bc6\u7801\uff09\uff1a<\/p>\n<p>  https:\/\/i.loli.net\/2021\/08\/20\/LBKNr1gwcaG6j9O.png<\/p>\n<p>  \u63a5\u7740\u70b9\u51fb\u914d\u7f6e\u6587\u4ef6\uff1a<\/p>\n<p>  https:\/\/i.loli.net\/2021\/08\/20\/bitKpHWdqzASZl5.png<\/p>\n<p>  \u590d\u5236\u7ea2\u6846\u4e2d\u7684\u8def\u5f84\uff1a\/www\/server\/panel\/vhost\/nginx\/dir_auth\/docker.xxxxx.com\uff08\u81ea\u9009\u66ff\u6362\uff09<\/p>\n<p>  \u53bb\u5230\u6b64\u6587\u4ef6\u5939\uff0c\u6253\u5f00\u552f\u4e00\u7684conf\u6587\u4ef6\uff1a<\/p>\n<p>  https:\/\/i.loli.net\/2021\/08\/20\/Jp1TWXqwLZgsjbm.png<\/p>\n<p>  \u590d\u5236\u6846\u4f4f\u7684\u8fd9\u4e24\u884c\uff1a<\/p>\n<p>  &nbsp; &nbsp; auth_basic &quot;Authorization&quot;;<br \/>  &nbsp; &nbsp; auth_basic_user_file \/www\/server\/pass\/docker.xxxxxx.com\/123.pass;<\/p>\n<p>  \u56de\u5230\u914d\u7f6e\u6587\u4ef6\u90a3\uff0c\u628ainclude\u90a3\u884c\u6ce8\u91ca\u6389\uff08\u53cd\u4ee3\u548cbasic_auth\u7684location\u6709\u91cd\u5408\uff09\uff1a<\/p>\n<p>  https:\/\/i.loli.net\/2021\/08\/20\/SPjvGzJrfhYXuBl.png<\/p>\n<p>  \u63a5\u7740\u6765\u5230\u53cd\u5411\u4ee3\u7406\u5904\uff0c\u70b9\u51fb\u7f16\u8f91\uff1a<\/p>\n<p>  https:\/\/i.loli.net\/2021\/08\/20\/gJtnwGKeIpBTcoq.png<\/p>\n<p>  \u6dfb\u52a0\u5982\u4e0b\u8fd9\u51e0\u884c\uff1a<\/p>\n<p>  &nbsp; &nbsp; auth_basic &quot;Authorization&quot;;<br \/>  &nbsp; &nbsp; auth_basic_user_file \/www\/server\/pass\/docker.xxxx.com\/123.pass; \/\/ \u81ea\u884c\u66ff\u6362\u4e3a\u4f60\u590d\u5236\u7684\u90a3\u4e24\u884c<br \/>  &nbsp; &nbsp; add_header &#8216;Docker-Distribution-Api-Version&#8217; &#8216;registry\/latest&#8217; always;<br \/>  &nbsp; &nbsp; proxy_set_header X-Forwarded-Proto $scheme;<br \/>  &nbsp; &nbsp; proxy_read_timeout 900;<\/p>\n<p>  \u6dfb\u52a0\u540e\u70b9\u51fb\u4fdd\u5b58\u5373\u53ef\u3002\u6b64\u65f6\u5df2\u7ecf\u914d\u7f6e\u5b8c\u6210\uff0c\u6253\u5f00\u6d4f\u89c8\u5668\u8bbf\u95ee\uff1a`https:\/\/docker.xxxxxx.com\/v2\/_catelog`\uff0c\u5728\u5f39\u7a97\u8f93\u5165\u8d26\u53f7\u5bc6\u7801\uff0c\u5982\u4e0b\u56fe\u6240\u793a\u5373\u4e3a\u90e8\u7f72\u6210\u529f\uff1a<\/p>\n<p>  https:\/\/i.loli.net\/2021\/08\/20\/ZvYOI2QJEuUKyzG.png<\/p>\n<p>  \u5728\u5ba2\u6237\u7aef\u5c1d\u8bd5\u4e0a\u4f20\u4e00\u4e2a\u955c\u50cf\u8bd5\u8bd5\uff0c\u9996\u5148\u5148\u767b\u5f55\u5230\u6211\u4eec\u7684\u79c1\u4eba\u955c\u50cf\u4ed3\u5e93\uff1a<\/p>\n<p>  docker login docker.xxxxxx.com<\/p>\n<p>  https:\/\/i.loli.net\/2021\/08\/20\/gjWifQGUcFX5rh6.png<\/p>\n<p>  \u63a5\u7740\u6211\u4eec\u5c1d\u8bd5\u4f20\u6211\u4eec\u5728\u4e0a\u7bc7\u4e2d\u4f7f\u7528\u7684gogs\/gogs\u955c\u50cf\uff1a<\/p>\n<p>  REPOSITORY&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;TAG&nbsp; &nbsp;&nbsp; &nbsp; IMAGE ID&nbsp; &nbsp;&nbsp; &nbsp; CREATED&nbsp; &nbsp;&nbsp; &nbsp;SIZE<br \/>  gogs\/gogs&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;latest&nbsp; &nbsp; 8ec7cc11f4a3&nbsp; &nbsp;3 months ago&nbsp; &nbsp;93.9MB<\/p>\n<p>  \u4f7f\u7528docker tag\u547d\u4ee4\u4e3a\u955c\u50cf\u65b0\u589e\u4e00\u4e2a\u6807\u7b7e\uff1a<\/p>\n<p>  docker tag gogs\/gogs:latest docker.xxxxxx.com\/gogs\/gogs:latest<\/p>\n<p>  \u63a5\u7740\u4e0a\u4f20\u955c\u50cf\uff1a<\/p>\n<p>  docker push docker.xxxxxx.com\/gogs\/gogs:latest<\/p>\n<p>  https:\/\/i.loli.net\/2021\/08\/20\/5hsXIlUSZDYai83.png<\/p>\n<p>  \u63a5\u7740\u6211\u4eec\u91cd\u65b0\u8bbf\u95ee\uff1ahttps:\/\/docker.xxxxxx.com\/v2\/_catelog<\/p>\n<p>  https:\/\/i.loli.net\/2021\/08\/20\/onu5rA8wqbvVGOL.png<\/p>\n<p>  \u53ef\u4ee5\u770b\u5230\u5df2\u7ecf\u6210\u529f\u4e0a\u4f20\u4e0a\u53bb\u4e86\uff0c\u5b58\u653e\u955c\u50cf\u7684\u672c\u5730\u76ee\u5f55\u4e5f\u51fa\u73b0\u4e86\u5bf9\u5e94\u7684\u6587\u4ef6\u5939\uff1a<\/p>\n<p>  https:\/\/i.loli.net\/2021\/08\/20\/sndgbNQY2MwyRiP.png<\/p>\n<p>  \u4e0a\u4f20\u6ca1\u5565\u95ee\u9898\uff0c\u63a5\u7740\u6211\u4eec\u6765\u8bd5\u8bd5\u62c9\u53d6\u955c\u50cf\uff0c\u8fd9\u91cc\u4f7f\u7528\u53e6\u4e00\u53f0\u670d\u52a1\u5668\u6f14\u793a\uff1a<\/p>\n<p>  https:\/\/i.loli.net\/2021\/08\/20\/WMxQ7n6KlEtD1p8.png<\/p>\n<p>  \u4e5f\u6ca1\u5565\u95ee\u9898\uff0c\u6700\u540e\u5c31\u662f\u5220\u9664\u955c\u50cf\uff0c\u9996\u5148\u83b7\u53d6\u8981\u5220\u9664\u7684\u955c\u50cf\u7684sha256\u7b7e\u540d\uff1a<\/p>\n<p>  curl &#8211;user admin:admin -v &#8211;silent &quot;docker.xxxxxx.com\/v2\/gogs\/gogs\/manifests\/latest&quot; 2&gt;&amp;1 | grep Docker-Content-Digest | awk &#8216;{print ($3)}&#8217;<\/p>\n<p>  https:\/\/i.loli.net\/2021\/08\/20\/YIKGOoTX357hzMm.png<\/p>\n<p>  \u7136\u540e\u5c31\u662f\u62fc\u63a5\u5220\u9664\u8bed\u53e5\uff0c\u53d1\u9001\u5220\u9664\u8bf7\u6c42\uff1a<\/p>\n<p>  curl -I &#8211;user admin:admin -X DELETE docker.xxxxxx.com\/v2\/gogs\/gogs\/manifests\/sha256:3b0c0c685e16f2b8bdd0289e7eb8812a188b014919464f0c6f6ce5d77dac2ad9<\/p>\n<p>  \u6b64\u65f6\u53ea\u662f\u628a\u5143\u6570\u636e\u5220\u9664\u6389\u4e86\uff0c\u5177\u4f53\u7684\u955c\u50cf\u6587\u4ef6\u5e76\u6ca1\u6709\u5220\u9664\uff0c\u82e5\u8bfb\u8005\u60f3\u5220\u9664\u817e\u4e9b\u7a7a\u95f4\u7684\u8bdd\uff0c\u8fd8\u9700\u8981\u8fdb\u5165\u5bb9\u5668\uff0c\u6267\u884c\u5783\u573e\u56de\u6536\u547d\u4ee4\uff1a<\/p>\n<p>  docker exec -it registry sh<\/p>\n<p>  \u8fdb\u5165\u5bb9\u5668\u540e\u6267\u884c\uff1a<\/p>\n<p>  registry garbage-collect \/etc\/docker\/registry\/config.yml <\/p>\n<p>  \u81f3\u6b64\uff0c\u5173\u4e8e\u79c1\u6709\u955c\u50cf\u4ed3\u5e93\u7684\u90e8\u7f72\u53ca\u4f7f\u7528\u57fa\u672c\u660e\u4e86~https:\/\/cdn.jsdelivr.net\/gh\/master-of-forums\/master-of-forums\/public\/images\/patch.gif\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>nnt<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u57fa\u4e8eweb\u7684ssh\u7ba1\u7406\u5e73\u53f0<\/p>\n<p>  \u63a5\u4e0b\u6765\u5c31\u662fssh\u7ba1\u7406\u5de5\u5177\u4e86\uff0c\u6709\u65f6\u5019\u5728\u5916\u8fb9\u624b\u8fb9\u6ca1\u6709\u8d81\u624b\u5de5\u5177\u4f7f\u7684\u65f6\u5019\uff0c\u8fd9\u4e1c\u897f\u7684\u4f5c\u7528\u5c31\u4f53\u73b0\u4e86\u51fa\u6765\uff0c\u6211\u4eec\u53ea\u9700\u8981\u6253\u5f00\u6d4f\u89c8\u5668\uff0c\u8f93\u5165\u6211\u4eec\u7684\u5e73\u53f0\u7684\u5730\u5740\uff1assh.test.com\uff0c\u5c31\u53ef\u4ee5\u76f4\u63a5\u8fde\u63a5\u4e0a\u5bf9\u5e94\u670d\u52a1\u5668\uff0c\u6548\u7387\u8fd9\u4e00\u5757\u62ff\u634f\u5f97\u6b7b\u6b7b\u7684\u3002<\/p>\n<p>  \u8fd9\u91cc\u6211\u4eec\u4f7f\u7528\u7684\u662fwebssh\u8fd9\u4e2apython\u5e93\uff0c\u5b89\u88c5\u8fc7\u7a0b\u53ef\u8c13\u662f\u5341\u5206\u7b80\u5355\u65b9\u4fbf\uff0c\u4e0d\u8fc7\u8fd9\u91cc\u6211\u4eec\u8fd8\u662f\u4e3a\u4e86\u65b9\u4fbf\u7ba1\u7406\uff0c\u9009\u62e9\u4f7f\u7528docker\u3002<\/p>\n<p>  \u5b98\u65b9\u5e76\u6ca1\u6709\u63d0\u4f9bdocker\u7248\u672c\u6216\u8005\u547d\u4ee4\uff0c\u8fd9\u91cc\u6211\u6839\u636e\u5b89\u88c5\u547d\u4ee4\u7b80\u5355\u5199\u4e86\u4e2aDockerfile\uff0c\u63a5\u4e0b\u6765\u5c31\u662f\u5b89\u88c5\u7684\u8fc7\u7a0b\uff1a<\/p>\n<p>  \u9996\u5148\u6211\u4eec\u65b0\u5efa\u4e00\u4e2aDockerfile\u6587\u4ef6\uff1a<\/p>\n<p>  vim Dockerfile<\/p>\n<p>  \u5185\u5bb9\u5982\u4e0b\uff1a<\/p>\n<p>  FROM python:3<\/p>\n<p>  RUN pip install webssh -i https:\/\/pypi.tuna.tsinghua.edu.cn\/simple<\/p>\n<p>  CMD [&quot;wssh&quot;]<\/p>\n<p>  \u4fdd\u5b58\u540e\u6267\u884c\u547d\u4ee4\u6784\u5efa\u955c\u50cf\uff1a<\/p>\n<p>  docker build &#8211;tag webssh .<\/p>\n<p>  \u7b49\u5f85\u4e00\u4f1a\u513f\u6784\u5efa\u5b8c\u6210\u540e\u8fd0\u884c\u5bb9\u5668\uff1a<\/p>\n<p>  docker run -d -p 8082:8888 webssh<\/p>\n<p>  https:\/\/i.loli.net\/2021\/08\/20\/ToNb9mAh1BLuSIc.png<\/p>\n<p>  \u8fd8\u662f\u8001\u89c4\u77e9\uff0c\u8fdb\u884c\u53cd\u4ee3\u3002\u65b0\u5efa\u4e00\u4e2a\u7f51\u7ad9ssh.test.com\uff0c\u70b9\u51fb\u53cd\u5411\u4ee3\u7406\uff1a<\/p>\n<p>  https:\/\/i.loli.net\/2021\/08\/20\/3xFmLt28QGSe5JT.png<\/p>\n<p>  \u7531\u4e8e\u7f51\u7ad9\u9700\u8981\u4f7f\u7528websocket\uff0c\u6240\u4ee5\u6211\u4eec\u8fd8\u9700\u8981\u7f16\u8f91\u4e00\u4e0b\u6211\u4eec\u7684\u914d\u7f6e\u6587\u4ef6\uff1a<\/p>\n<p>  https:\/\/i.loli.net\/2021\/08\/20\/uD4Q61z5mk3ntSM.png<\/p>\n<p>  \u52a0\u4e0a\u6846\u4e2d\u7684\u4e09\u884c\uff1a<\/p>\n<p>  &nbsp; &nbsp; proxy_http_version 1.1;<br \/>  &nbsp; &nbsp; proxy_set_header Upgrade $http_upgrade;<br \/>  &nbsp; &nbsp; proxy_set_header Connection upgrade;<\/p>\n<p>  \u70b9\u51fb\u4fdd\u5b58\u540e\uff0c\u6253\u5f00\u6d4f\u89c8\u5668\u8bbf\u95ee\u6211\u4eec\u7684\u5e73\u53f0\uff1a<\/p>\n<p>  https:\/\/i.loli.net\/2021\/08\/20\/cadJmW5C7ZzpGwn.png<\/p>\n<p>  \u5c1d\u8bd5\u8fde\u63a5\u4e00\u4e2a\u670d\u52a1\u5668\uff1a<\/p>\n<p>  https:\/\/i.loli.net\/2021\/08\/20\/Rv3mhrAu8oCzIQZ.png<\/p>\n<p>  \u70b9\u51fb\u8fde\u63a5\uff1a<\/p>\n<p>  https:\/\/i.loli.net\/2021\/08\/21\/drjEcuTitPYZGMS.png<\/p>\n<p>  \u81f3\u6b64\uff0c\u6211\u4eec\u7684SSH\u7ba1\u7406\u5e73\u53f0\u4e5f\u642d\u5efa\u597d\u4e86\u3002  \t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>nnt<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\tnps\u7aef\u53e3\u6620\u5c04\u9762\u677f<\/p>\n<p>  \u6700\u540e\u4fbf\u662fnps\u7aef\u53e3\u6620\u5c04\u9762\u677f\u7684\u642d\u5efa\u4e86\uff0c\u8981\u8bf4\u4ed6\u7684\u5e94\u7528\u8fc7\u7a0b\u53ef\u8c13\u662f\u5341\u5206\u5e7f\u6cdb\u7684\uff0c\u5c31\u6bd4\u5982\u6211\u672c\u5730\u6709\u4e2a\u670d\u52a1\u60f3\u8ba9\u5176\u4ed6\u670b\u53cb\u4e5f\u80fd\u8bbf\u95ee\u5f97\u5230\uff0c\u4f46\u7531\u4e8e\u4e00\u822c\u6765\u8bf4\u975e\u4e91\u670d\u52a1\u7684\u5e26\u5bbd\u5f88\u5c11\u5e26\u6709\u516c\u7f51IP\uff0c\u90fd\u662f\u57fa\u4e8eNAT\u7684\u7f51\u7edc\u60c5\u51b5\uff0c\u8fd9\u65f6\u5019\u6211\u4eec\u4fbf\u53ef\u4ee5\u5229\u7528\u6211\u4eec\u7684\u4e91\u670d\u52a1\u5668\u6765\u8fdb\u884c\u7aef\u53e3\u6620\u5c04\uff0c\u5c06\u6211\u4eec\u672c\u5730\u7684\u7aef\u53e3\u8f6c\u53d1\u5230\u6211\u4eec\u7684\u5f00\u53d1\u5168\u5bb6\u6876\u670d\u52a1\u5668\u4e0a\uff0c\u8fd9\u6837\u5927\u5bb6\u90fd\u53ef\u4ee5\u901a\u8fc7\u5f00\u53d1\u5168\u5bb6\u6876\u670d\u52a1\u5668\u8bbf\u95ee\u5230\u6211\u4eec\u672c\u5730\u65e0\u516c\u7f51IP\u673a\u5b50\u6240\u8f6c\u53d1\u7684\u7aef\u53e3\u4e86\u3002<\/p>\n<p>  \u5bf9\u4e8e\u6211\u4e2a\u4eba\u6765\u8bf4\uff0c\u6211\u7ecf\u5e38\u7528\u4e8e\u8f6c\u53d1\u6211\u672c\u5730Mysql\u7684\u7aef\u53e3\uff0c\u7528\u4e8e\u9879\u76ee\u8c03\u8bd5\uff0c\u5f53\u7136\u73a9\u6cd5\u8fd8\u6709\u5f88\u591a\uff0c\u6bd4\u5982\u5bf9\u4e8eKali\u7cfb\u7edf\u6765\u8bf4\uff0c\u6211\u4eec\u53ef\u4ee5\u6620\u5c04\u4e00\u4e2a\u7aef\u53e3\u65b9\u4fbf\u6211\u4eec\u53cd\u5f39Shell\u7b49\u64cd\u4f5c\uff0c\u6e38\u620f\u7528\u9014\u7684\u8bdd\u53ef\u4ee5\u5c40\u57df\u7f51\u8fde\u63a5\uff0c\u7528\u6cd5\u56e0\u4eba\u800c\u5f02\u3002<\/p>\n<p>  \u9879\u76ee\u5730\u5740\uff1ahttps:\/\/github.com\/ehang-io\/nps<\/p>\n<p>  \u4e0b\u9762\u662f\u5b89\u88c5\u8fc7\u7a0b\uff0c\u9996\u5148\u662f\u53bb\u5b98\u65b9git\u4ed3\u5e93\u62c9\u53d6\u9879\u76ee\uff1a<\/p>\n<p>  git clone https:\/\/github.com\/ehang-io\/nps.git<\/p>\n<p>  \u56fd\u5185\u670d\u52a1\u5668\u62c9\u53d6\u65e0\u901f\u5ea6\u53ef\u4ee5\u4f7f\u7528\u4e00\u4e0b\u955c\u50cf\uff1a<\/p>\n<p>  git clone https:\/\/github.com.cnpmjs.org\/ehang-io\/nps.git<\/p>\n<p>  \u62c9\u53d6\u5b8c\u6210\u540e\u8f93\u5165\uff1a<\/p>\n<p>  cd nps<\/p>\n<p>  \u8fdb\u5165\u9879\u76ee\u76ee\u5f55\uff1a<\/p>\n<p>  https:\/\/i.loli.net\/2021\/08\/21\/HFqSA6pUOeMjl5i.png<\/p>\n<p>  \u8f93\u5165\u547d\u4ee4\uff0c\u62f7\u8d1d\u5e76\u91cd\u547d\u540d\u4e00\u4efdDockerfile\u6587\u4ef6\uff1a<\/p>\n<p>  cp Dockerfile.nps Dockerfile<\/p>\n<p>  \u7f16\u8f91Dockerfile\u6587\u4ef6\uff1a<\/p>\n<p>  \u628a\u7b2c\u4e8c\u884c\u7684\uff1a<\/p>\n<p>  ARG GOPROXY=direct<\/p>\n<p>  \u6539\u4e3a\uff0c\u9632\u6b62\u56fd\u5185\u673a\u5b50\u56e0\u4e3a\u7f51\u7edc\u95ee\u9898\u65e0\u6cd5\u6784\u5efa\u955c\u50cf\uff1a<\/p>\n<p>  ARG GOPROXY=https:\/\/goproxy.cn,direct<\/p>\n<p>  \u63a5\u7740\u8ddf\u4e0a\u8fb9\u7684\u6b65\u9aa4\u5dee\u4e0d\u591a\uff0c\u6784\u5efa\u955c\u50cf\uff1a<\/p>\n<p>  docker build &#8211;tag nps .<\/p>\n<p>  https:\/\/i.loli.net\/2021\/08\/21\/v2tNKeXBlsh4xaS.png<\/p>\n<p>  \u6784\u5efa\u5b8c\u6210\u540e\uff0c\u65b0\u5efa\u4e00\u4e2a\u76ee\u5f55\u4e0e\u4e00\u4e2a\u914d\u7f6e\u6587\u4ef6\uff1a<\/p>\n<p>  mkdir \/conf<br \/>  vim \/conf\/nps.conf<\/p>\n<p>  \u586b\u5199\u5185\u5bb9\u5982\u4e0b\uff08\u8d26\u53f7\u5bc6\u7801\u5728#web\u5904\uff0c\u7ebf\u4e0a\u90e8\u7f72\u8bf7\u81ea\u884c\u4fee\u6539\uff09\uff1a<\/p>\n<p>  appname = nps<br \/>  #Boot mode(dev|pro)<br \/>  runmode = dev<\/p>\n<p>  #HTTP(S) proxy port, no startup if empty<br \/>  http_proxy_ip=0.0.0.0<br \/>  http_proxy_port=80<br \/>  https_proxy_port=443<br \/>  https_just_proxy=true<br \/>  #default https certificate setting<br \/>  https_default_cert_file=conf\/server.pem<br \/>  https_default_key_file=conf\/server.key<\/p>\n<p>  ##bridge<br \/>  bridge_type=tcp<br \/>  bridge_port=8024<br \/>  bridge_ip=0.0.0.0<\/p>\n<p>  # Public password, which clients can use to connect to the server<br \/>  # After the connection, the server will be able to open relevant ports and parse related domain names according to its own configuration file.<br \/>  public_vkey=123<\/p>\n<p>  #Traffic data persistence interval(minute)<br \/>  #Ignorance means no persistence<br \/>  #flow_store_interval=1<\/p>\n<p>  # log level LevelEmergency-&gt;0LevelAlert-&gt;1 LevelCritical-&gt;2 LevelError-&gt;3 LevelWarning-&gt;4 LevelNotice-&gt;5 LevelInformational-&gt;6 LevelDebug-&gt;7<br \/>  log_level=7<br \/>  #log_path=nps.log<\/p>\n<p>  #Whether to restrict IP access, true or false or ignore<br \/>  #ip_limit=true<\/p>\n<p>  #p2p<br \/>  #p2p_ip=127.0.0.1<br \/>  #p2p_port=6000<\/p>\n<p>  #web<br \/>  web_host=a.o.com<br \/>  web_username=admin<br \/>  web_password=123<br \/>  web_port = 8080<br \/>  web_ip=0.0.0.0<br \/>  web_base_url=<br \/>  web_open_ssl=false<br \/>  web_cert_file=conf\/server.pem<br \/>  web_key_file=conf\/server.key<br \/>  # if web under proxy use sub path. like http:\/\/host\/nps need this.<br \/>  #web_base_url=\/nps<\/p>\n<p>  #Web API unauthenticated IP address(the len of auth_crypt_key must be 16)<br \/>  #Remove comments if needed<br \/>  #auth_key=test<br \/>  auth_crypt_key =1234567812345678<\/p>\n<p>  #allow_ports=9001-9009,10001,11000-12000<\/p>\n<p>  #Web management multi-user login<br \/>  allow_user_login=false<br \/>  allow_user_register=false<br \/>  allow_user_change_username=false<\/p>\n<p>  #extension<br \/>  allow_flow_limit=false<br \/>  allow_rate_limit=false<br \/>  allow_tunnel_num_limit=false<br \/>  allow_local_proxy=false<br \/>  allow_connection_num_limit=false<br \/>  allow_multi_ip=false<br \/>  system_info_display=false<\/p>\n<p>  #cache<br \/>  http_cache=false<br \/>  http_cache_length=100<\/p>\n<p>  #get origin ip<br \/>  http_add_origin_header=false<\/p>\n<p>  #pprof debug options<br \/>  #pprof_ip=0.0.0.0<br \/>  #pprof_port=9999<\/p>\n<p>  #client disconnect timeout<br \/>  disconnect_timeout=60<\/p>\n<p>  \u914d\u7f6e\u9879\u5bf9\u5e94\u7684\u542b\u4e49\uff1a<\/p>\n<p>  | \u540d\u79f0&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; | \u542b\u4e49&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;|<br \/>  | &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- | &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; |<br \/>  | web_port&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;| web\u7ba1\u7406\u7aef\u53e3&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;|<br \/>  | web_password&nbsp; &nbsp;&nbsp; &nbsp;| web\u754c\u9762\u7ba1\u7406\u5bc6\u7801&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; |<br \/>  | web_username&nbsp; &nbsp;&nbsp; &nbsp;| web\u754c\u9762\u7ba1\u7406\u8d26\u53f7&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; |<br \/>  | web_base_url&nbsp; &nbsp;&nbsp; &nbsp;| web\u7ba1\u7406\u4e3b\u8def\u5f84,\u7528\u4e8e\u5c06web\u7ba1\u7406\u7f6e\u4e8e\u4ee3\u7406\u5b50\u8def\u5f84\u540e\u9762&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; |<br \/>  | bridge_port&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;| \u670d\u52a1\u7aef\u5ba2\u6237\u7aef\u901a\u4fe1\u7aef\u53e3&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;|<br \/>  | https_proxy_port&nbsp; &nbsp; | \u57df\u540d\u4ee3\u7406https\u4ee3\u7406\u76d1\u542c\u7aef\u53e3&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;|<br \/>  | http_proxy_port&nbsp; &nbsp;| \u57df\u540d\u4ee3\u7406http\u4ee3\u7406\u76d1\u542c\u7aef\u53e3&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; |<br \/>  | auth_key&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;| web api\u5bc6\u94a5&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;|<br \/>  | bridge_type&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;| \u5ba2\u6237\u7aef\u4e0e\u670d\u52a1\u7aef\u8fde\u63a5\u65b9\u5f0fkcp\u6216tcp&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; |<br \/>  | public_vkey&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;| \u5ba2\u6237\u7aef\u4ee5\u914d\u7f6e\u6587\u4ef6\u6a21\u5f0f\u542f\u52a8\u65f6\u7684\u5bc6\u94a5\uff0c\u8bbe\u7f6e\u4e3a\u7a7a\u8868\u793a\u5173\u95ed\u5ba2\u6237\u7aef\u914d\u7f6e\u6587\u4ef6\u8fde\u63a5\u6a21\u5f0f |<br \/>  | ip_limit&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;| \u662f\u5426\u9650\u5236ip\u8bbf\u95ee\uff0ctrue\u6216false\u6216\u5ffd\u7565&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; |<br \/>  | flow_store_interval | \u670d\u52a1\u7aef\u6d41\u91cf\u6570\u636e\u6301\u4e45\u5316\u95f4\u9694\uff0c\u5355\u4f4d\u5206\u949f\uff0c\u5ffd\u7565\u8868\u793a\u4e0d\u6301\u4e45\u5316&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;|<br \/>  | log_level&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;| \u65e5\u5fd7\u8f93\u51fa\u7ea7\u522b&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; |<br \/>  | auth_crypt_key&nbsp; &nbsp;&nbsp; &nbsp;| \u83b7\u53d6\u670d\u52a1\u7aefauthKey\u65f6\u7684aes\u52a0\u5bc6\u5bc6\u94a5\uff0c16\u4f4d&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;|<br \/>  | p2p_ip&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;| \u670d\u52a1\u7aefIp\uff0c\u4f7f\u7528p2p\u6a21\u5f0f\u5fc5\u586b&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;|<br \/>  | p2p_port&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;| p2p\u6a21\u5f0f\u5f00\u542f\u7684udp\u7aef\u53e3&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;|<br \/>  | pprof_ip&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;| debug pprof \u670d\u52a1\u7aefip&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;|<br \/>  | pprof_port&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; | debug pprof \u7aef\u53e3&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;|<br \/>  | disconnect_timeout| \u5ba2\u6237\u7aef\u8fde\u63a5\u8d85\u65f6\uff0c\u5355\u4f4d 5s\uff0c\u9ed8\u8ba4\u503c 60\uff0c\u5373 300s = 5mins&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; |<\/p>\n<p>  \u7136\u540e\u5728\/conf\u76ee\u5f55\u7ee7\u7eed\u65b0\u5efa\u4e09\u4e2a\u7a7a\u6587\u4ef6\uff08\u65e0\u5185\u5bb9\uff09\uff1a<\/p>\n<p>  vim \/conf\/hosts.json<br \/>  vim \/conf\/clients.json<br \/>  vim \/conf\/hosts.json<\/p>\n<p>  \u8fd0\u884c\u5bb9\u5668\uff1a<\/p>\n<p>  docker run -d -p 10080:80 -p 10443:443 -p 18080:8080 -p 18024:8024 -v \/conf:\/conf &#8211;name nps nps<\/p>\n<p>  \u5176\u4e2d\uff1a<\/p>\n<p>  80\u4e0e443\u7aef\u53e3\u4e3a\u57df\u540d\u89e3\u6790\u6a21\u5f0f\u9ed8\u8ba4\u7aef\u53e3<br \/>  8080\u4e3aweb\u7ba1\u7406\u8bbf\u95ee\u7aef\u53e3<br \/>  8024\u4e3a\u7f51\u6865\u7aef\u53e3\uff0c\u7528\u4e8e\u5ba2\u6237\u7aef\u4e0e\u670d\u52a1\u5668\u901a\u4fe1<\/p>\n<p>  https:\/\/i.loli.net\/2021\/08\/21\/sFSkV7IjwfBNRUd.png<\/p>\n<p>  \u6700\u540e\u8fd8\u662f\u8001\u89c4\u77e9\uff0c\u4f7f\u7528nginx\u8fdb\u884c\u53cd\u4ee3\uff1a<\/p>\n<p>  https:\/\/i.loli.net\/2021\/08\/21\/uzaDFBvoGbAfQR1.png<\/p>\n<p>  \u53cd\u4ee3\u540e\u8bbf\u95ee\u6211\u4eec\u7684\u7f51\u7ad9\uff1a<\/p>\n<p>  https:\/\/i.loli.net\/2021\/08\/21\/oaHDidNwkXLFl5S.png<\/p>\n<p>  \u81f3\u6b64\uff0c\u6211\u4eec\u7684nps\u9762\u677f\u5df2\u7ecf\u642d\u5efa\u597d\u4e86\uff0c\u5177\u4f53\u4f7f\u7528\u65b9\u6cd5\u7531\u4e8e\u7bc7\u5e45\u6240\u9650\u5c31\u4e0d\u8fc7\u591a\u8d58\u8ff0\u4e86\uff0c\u7f51\u4e0a\u5df2\u7ecf\u6709\u5f88\u5168\u9762\u7684\u4f7f\u7528\u6559\u7a0b\uff0c\u4e5f\u53ef\u4ee5\u53c2\u8003\u5b98\u65b9\u6587\u6863\uff1ahttps:\/\/ehang-io.github.io\/nps\/#\/example<\/p>\n<p>  \u540e\u8bdd<\/p>\n<p>  \u81f3\u6b64\uff0c\u6211\u4eec\u7684\u5f00\u53d1\u5168\u5bb6\u6876\u5df2\u7ecf\u90e8\u7f72\u597d\u4e86\uff0c\u603b\u5171\u6709\uff1a<\/p>\n<p>  [*]CodeServer\u5728\u7ebfIDE<br \/>  [*]gogs\u79c1\u6709GIT\u5e73\u53f0<br \/>  [*]registry\u79c1\u6709docker\u955c\u50cf\u4ed3\u5e93<br \/>  [*]webssh\u5728\u7ebfSSH\u7ba1\u7406\u5e73\u53f0<br \/>  [*]nps\u7aef\u53e3\u6620\u5c04\u9762\u677f<\/p>\n<p>  \u73b0\u5728\uff0c\u8ba9\u6211\u4eec\u6765\u770b\u770b\u670d\u52a1\u5668\u7684\u8d1f\u8f7d\u60c5\u51b5\uff1a<\/p>\n<p>  https:\/\/i.loli.net\/2021\/08\/21\/PqmC3dUIieK8HD1.png<\/p>\n<p>  \u4e94\u4e2a\u5e94\u7528\uff0c\u603b\u8ba1\u4e0d\u52301.2G\u5185\u5b58\u7684\u5360\u7528\uff0c1\u68382G\u7684\u5b66\u751f\u673a\u90fd\u53ef\u4ee5\u6d41\u7545\u642d\u5efa\u548c\u4f7f\u7528\uff0c\u53ef\u8c13\u662f\u4fbf\u5b9c\u53c8\u597d\u7528~<\/p>\n<p>  \u6700\u540e\u518d\u8ba9\u6211\u4ecb\u7ecd\u4e0b\u8fd9\u6b21\u4f7f\u7528\u7684\u670d\u52a1\u5668\u5e73\u53f0\uff1a\u817e\u8baf\u4e91\u8f7b\u91cf\u5e94\u7528\u670d\u52a1\u5668\u3002<\/p>\n<p>  \u5728\u817e\u8baf\u4e91\u7684\u957f\u671f\u6d3b\u52a8\u4e2d\u65b0\u7528\u6237\u53ef\uffe574\u4fbf\u53ef\u4e70\u5230\u4e00\u53f0\uff0c1\u68382G\u5185\u5b5860G SSD\u76d86Mbps\u7684\u914d\u7f6e\u5728\u6027\u4ef7\u6bd4\u8fd9\u5757\u62ff\u634f\u5f97\u6b7b\u6b7b\u5f97\uff0c\u611f\u5174\u8da3\u7684\u8bfb\u8005\u53ef\u8003\u8651\u5165\u624b\uff1ahttps:\/\/cloud.tencent.com\/act\/new\u3002<\/p>\n<p>  https:\/\/i.loli.net\/2021\/08\/21\/MOxBAd9gzeyYTbS.png  \t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>byhmsrsh4<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u6218\u7565\u6027mark\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>nnt<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u4e0b\u7bc7\u90fd\u83ab\u5f97\u4eba\u770b\u4e86\u5417 yc005thttps:\/\/cdn.jsdelivr.net\/gh\/master-of-forums\/master-of-forums\/public\/images\/patch.gif\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>6fyC8r<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u6280\u672f\u6587\uff0c\u5f53\u7136\u8981\u9876\u4e00\u4e0b<\/p>\n<p>  \u611f\u8c22\u5206\u4eab\uff0c\u65e5\u540e\u518d\u770b<\/p>\n<p>  \t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>\u65e0\u9650\u5578\u50b2<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u611f\u8c22\u5206\u4eab\uff0c\u65e5\u540e\u518d\u770b<\/p>\n<p>  \/**<br \/>   * \u4f60\u4eec\u662f\u4e0d\u662f\u5065\u5fd8\uff1f<br \/>   * \u522b\u4e0d\u627f\u8ba4\uff0c\u6211\u5c31\u95ee\u4f60\u4eec\u4e00\u4e2a\u95ee\u9898\u3002<br \/>   * \u4f60\u539f\u672c\u662f\u6765\u6d4f\u89c8\u5668\u5e72\u561b\u7684\uff1f<br \/>   * \u5982\u679c\u4f60\u60f3\u8d77\u6765\u4e86\uff0c\u5c31\u53bb\u505a\u4f60\u8be5\u505a\u7684\u4e8b\u60c5\uff0c\u522b\u5728\u8fd9\u91cc\u8ff7\u5931\u4e86\u81ea\u5df1\u7684\u65b9\u5411\u3002<br \/>   * \u2014\u2014\u6d4f\u89c8\u5668\u5f15\u8def\u4eba<br \/>   *<br \/>   * Link https:\/\/greasyfork.org\/zh-CN\/scripts\/396933-hostloc-zsbd<br \/>   *\/\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>nnt<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t6fyC8r \u5927\u4f6c\u6709\u8bdd\u8bf4 : 2021-8-21 14:34<br \/>  \u6280\u672f\u6587\uff0c\u5f53\u7136\u8981\u9876\u4e00\u4e0b<\/p>\n<p>  \u611f\u8c22\u9876\u8d34 :lolhttps:\/\/cdn.jsdelivr.net\/gh\/master-of-forums\/master-of-forums\/public\/images\/patch.gif\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>chenliqin123<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u5df2\u6536\u85cf\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>HAZ<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u5f88\u68d2\uff0c\u697c\u4e3b\u8f9b\u82e6\u4e86\uff0c\u5e2e\u9876\t\t\t  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>nnt \u5927\u4f6c\u6709\u8bdd\u8bf4 : \u3010\u6559\u7a0b\u3011\u8f7b&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/527839"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=527839"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/527839\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=527839"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=527839"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=527839"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}