{"id":1399,"date":"2013-04-14T21:17:11","date_gmt":"2013-04-14T13:17:11","guid":{"rendered":"http:\/\/leegorous.net\/blog\/?p=1399"},"modified":"2013-04-17T19:27:02","modified_gmt":"2013-04-17T11:27:02","slug":"ssh-issue-in-gitlab-shell-1-1-0","status":"publish","type":"post","link":"http:\/\/leegorous.net\/blog\/2013\/04\/14\/ssh-issue-in-gitlab-shell-1-1-0\/","title":{"rendered":"Gitlab-shell 1.1.0 \u7684 SSH \u8bbf\u95ee\u5f02\u5e38"},"content":{"rendered":"<p>\u4ece <a href=\"http:\/\/gitlab.org\/\" target=\"_blank\">GitLab<\/a> 4.2 \u5347\u7ea7\u5230 5.0\uff0c\u867d\u7136 <a href=\"https:\/\/github.com\/gitlabhq\/gitlabhq\/wiki\/From-4.2-to-5.0\" target=\"_blank\">\u6b65\u9aa4<\/a> \u6709\u70b9\u513f\u7e41\u7410\uff0c\u4f46\u8fd8\u7b97\u662f\u4e00\u8def\u7eff\u706f\uff0c\u4f46\u6700\u7ec8\u5374\u9047\u5230\u4e86\u4e0d\u80fd\u4ee5 ssh \u65b9\u5f0f\u8bbf\u95ee\u5e93\u7684\u95ee\u9898\u3002\u641e\u4e86\u51e0\u4e2a\u5c0f\u65f6\uff0c\u627e\u4e86\u6240\u6709\u80fd\u60f3\u5230\u7684\u5730\u65b9\uff0c\u90fd\u641e\u4e0d\u6e05\u695a\u7a76\u7adf\u54ea\u91cc\u9519\u4e86\uff0c\u4e8e\u662f\u5728 github \u4e0a\u7ed9\u63d0\u4e86\u4e2a <a href=\"https:\/\/github.com\/gitlabhq\/gitlabhq\/issues\/3578\" target=\"_blank\">issue 3578<\/a>\u3002<\/p>\n<p>\u95ee\u9898\u7684\u60c5\u51b5\u7b80\u5355\u6765\u8bf4\u5c31\u662f\uff0cssh -T \u6210\u529f\uff0c\u4f46\u662f git clone\/pull\/push \u5374\u610f\u5916\u5931\u8d25\uff0c\u53e6\u5916 http \u7684\u65b9\u5f0f\u662f\u6210\u529f\u7684\uff0c\u8bf4\u660e\u5e94\u8be5\u8fd8\u662f\u8fde\u63a5\u7684\u95ee\u9898\u3002<\/p>\n<p>\u552f\u4e00\u6709\u53ef\u80fd\u5b58\u5728\u7591\u95ee\u7684\u5730\u65b9\uff0c\u5e94\u8be5\u662f <a href=\"https:\/\/github.com\/gitlabhq\/gitlab-shell\" target=\"_blank\">gitlab-shell<\/a> \u7684\u7248\u672c\u3002\u68c0\u67e5\u7684\u65f6\u5019\u4f1a\u62a5\u544a\u8bf4\u9700\u8981 1.1.0\uff0c\u800c\u4e8b\u5b9e\u6839\u636e\u5347\u7ea7\u6307\u5f15\u4e2d\u7684\u64cd\u4f5c\u7ed3\u679c\u662f 1.2.0 \u7684\u3002\u4f46\u4ece <a href=\"https:\/\/github.com\/gitlabhq\/gitlabhq\/issues\/3404\" target=\"_blank\">\u53e6\u4e00\u4e2a issue \u7684\u8bf4\u660e<\/a> \u770b\u6765\uff0c\u53ef\u4ee5\u901a\u8fc7\u4fee\u6539 check.rake \u6765\u5b9e\u73b0\u201c\u7792\u5929\u8fc7\u6d77\u201d\u3002<\/p>\n<p>\u6682\u505c\u4e86 gitlab service\uff0c\u7136\u540e\u5207\u6362 gitlab-shell \u7684\u7248\u672c\u5230 1.1.0<\/p>\n<pre class=\"brush: bash;\">\r\n&gt; cd \/home\/git\/gitlab-shell\r\n&gt; git checkout v1.1.0\r\n&gt; git checkout -b v1.1.0\r\n\r\n# \u914d\u7f6e\u6587\u4ef6\u4e0d\u9700\u8981\u6539\r\n&gt; .\/bin\/install\r\n<\/pre>\n<p>\u91cd\u542f gitlab \u540e\u518d\u8bd5\u8bd5 ssh -T git@mygitlab.com<\/p>\n<p>\u7ed3\u679c\u5374\u51fa\u9519\u4e86\uff01<\/p>\n<pre class=\"brush: bash;\">\r\n\/usr\/local\/lib\/ruby\/1.9.1\/json\/common.rb:148:in `parse&#039;: 743: unexpected token at &#039;&lt;html&gt; (JSON::ParserError)\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;title&gt;Welcome to nginx!&lt;\/title&gt;\r\n&lt;\/head&gt;\r\n&lt;body bgcolor=&quot;white&quot; text=&quot;black&quot;&gt;\r\n&lt;center&gt;&lt;h1&gt;Welcome to nginx!&lt;\/h1&gt;&lt;\/center&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n&#039;\r\n     from \/usr\/local\/lib\/ruby\/1.9.1\/json\/common.rb:148:in `parse&#039;\r\n     from \/home\/git\/gitlab-shell\/lib\/gitlab_net.rb:24:in `discover&#039;\r\n     from \/home\/git\/gitlab-shell\/lib\/gitlab_shell.rb:28:in `exec&#039;\r\n     from \/home\/git\/gitlab-shell\/bin\/gitlab-shell:16:in `&lt;main&gt;&#039;\r\n<\/pre>\n<p>\u4e3a\u4ec0\u4e48\u4f1a\u51fa\u73b0\u8fd9\u4e2a\u9519\u8bef\uff0c\u6211\u6ca1\u4ec0\u4e48\u5934\u7eea\uff0cgoogle \u4e86\u4e00\u8f6e\u4e5f\u6ca1\u4ec0\u4e48\u5bf9\u75c7\u7684\u7b54\u6848\u3002<\/p>\n<p>\u8981\u51fa\u73b0\u9ed8\u8ba4\u7684 Nginx \u9875\u9762\uff0c\u5e94\u8be5\u8fd8\u662f\u8ddf Nginx \u7684\u914d\u7f6e\u6709\u5173\uff0c\u800c\u54ea\u4e2a\u914d\u7f6e\u6587\u4ef6\u662f\u4ece\u7f51\u4e0a\u4e0b\u8f7d\u7684\uff0c\u552f\u4e00\u5c31\u662f\u6307\u5b9a\u4e86 IP \u4ee5\u53ca\u57df\u540d\u3002\u5c31\u7b97\u76f4\u63a5\u7528 IP \u8bbf\u95ee\uff0c\u4e5f\u662f\u53ef\u4ee5\u770b\u89c1 GitLab \u7684\u9875\u9762\u7684\uff0c\u4f46\u662f\u4e0d\u4f1a\u770b\u89c1 Nginx \u7684\u9ed8\u8ba4\u9875\u9762\u3002<\/p>\n<p>\u8fd9\u65f6\uff0c\u6211\u60f3\u8d77\u4e4b\u524d\u66fe\u7ecf\u6539\u8fc7 \/etc\/hosts<\/p>\n<pre class=\"brush: text;\">\r\n127.0.0.1   mygitlab.com\r\n<\/pre>\n<p>\u5982\u679c\u5728\u670d\u52a1\u5668\u7aef\u8bbf\u95ee http:\/\/mygitlab.com \u7684\u65f6\u5019\u624d\u4f1a\u770b\u89c1 Nginx \u7684\u9ed8\u8ba4\u9875\u9762\u3002\u679c\u65ad\u53bb\u6389\u8fd9\u4e2a host \u8bbe\u5b9a\uff0c\u7136\u540e\u518d\u8bd5\uff0c\u4e00\u5207\u90fd\u6b63\u5e38\u4e86\u3002<\/p>\n<p>\u55ef\u55ef\uff0c\u5177\u4f53\u4ec0\u4e48\u539f\u56e0\u8981\u52a0\u8fd9\u4e2a host \u8bbe\u5b9a\uff0c\u4e0d\u592a\u6e05\u695a\u4e86\uff0c\u88c5 4.2 \u7684\u65f6\u5019\u7684\u4e8b\u60c5\u4e86\u3002\u53cd\u6b63 gitlab-shell 1.1.0 \u8ddf\u5b83\u6709\u51b2\u7a81\u3002\u4e0d\u8fc7\u5e94\u8be5\u7b97\u662f gitlab-shell \u7684\u95ee\u9898\uff0c\u5b83\u4e0d\u5e94\u8be5\u89e3\u6790\u51fa\u57df\u540d\u7684 IP \u540e\u76f4\u63a5\u7528 IP \u53bb\u8bbf\u95ee\uff0c\u56e0\u4e3a\u6709\u53ef\u80fd\u4e00\u4e2a IP \u4e0a\u4f1a\u6302\u597d\u591a\u4e2a\u7ad9\u70b9\uff0c\u9ed8\u8ba4\u7684\u4e0d\u4e00\u5b9a\u5c31\u662f gitlab\u3002<\/p>\n<p>\u6709\u65f6\u5019\u6307\u5b9a hosts \u80fd\u89e3\u51b3\u4e00\u4e9b\u95ee\u9898\uff0c\u4e5f\u6709\u50cf\u8fd9\u79cd\u5e2e\u5012\u5fd9\u7684\u60c5\u51b5\uff0c\u80fd\u4e0d\u52a0\u8fd8\u662f\u4e0d\u52a0\u5427\u3002<\/p>\n<p><em>PS: mygitlab.com \u4e0d\u662f\u4e00\u4e2a\u771f\u5b9e\u7684\u57df\u540d\u3002<\/em><\/p>\n<p><em>Update 17 Apr: <a href=\"https:\/\/github.com\/gitlabhq\/gitlabhq\/issues\/3384\">Issue 3384: Gitlab can&#8217;t clone or push<\/a> <\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4ece GitLab 4.2 \u5347\u7ea7\u5230 5.0\uff0c\u867d\u7136 \u6b65\u9aa4 \u6709\u70b9\u513f\u7e41\u7410\uff0c\u4f46\u8fd8\u7b97\u662f\u4e00\u8def\u7eff\u706f\uff0c\u4f46\u6700\u7ec8\u5374\u9047\u5230\u4e86\u4e0d\u80fd\u4ee5 ss &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/leegorous.net\/blog\/2013\/04\/14\/ssh-issue-in-gitlab-shell-1-1-0\/\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">\u201cGitlab-shell 1.1.0 \u7684 SSH \u8bbf\u95ee\u5f02\u5e38\u201d<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[17],"tags":[90],"_links":{"self":[{"href":"http:\/\/leegorous.net\/blog\/wp-json\/wp\/v2\/posts\/1399"}],"collection":[{"href":"http:\/\/leegorous.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/leegorous.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/leegorous.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/leegorous.net\/blog\/wp-json\/wp\/v2\/comments?post=1399"}],"version-history":[{"count":5,"href":"http:\/\/leegorous.net\/blog\/wp-json\/wp\/v2\/posts\/1399\/revisions"}],"predecessor-version":[{"id":1403,"href":"http:\/\/leegorous.net\/blog\/wp-json\/wp\/v2\/posts\/1399\/revisions\/1403"}],"wp:attachment":[{"href":"http:\/\/leegorous.net\/blog\/wp-json\/wp\/v2\/media?parent=1399"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/leegorous.net\/blog\/wp-json\/wp\/v2\/categories?post=1399"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/leegorous.net\/blog\/wp-json\/wp\/v2\/tags?post=1399"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}