tumblr

tumblr(タンブラー)は、メディアミックスブログサービス。ブログとミニブログ、そしてソーシャルブックマークを統合したマイクロブログサービスである。アメリカのDavidville.inc(現: Tumblr, Inc.)により2007年3月1日にサービスが開始された。

githubのプライベートリポジトリのbasic認証をtokenで置き換え

githubのプライベートリポジトリにあるコードをcapistranoでデプロイしようとした時、httpsでコードをcloneしようとしたのだけど、その時にユーザー名とパスワードをプロンプトで入力しても以下の様なエラーが出た。

fatal: could not read Username for 'https://github.com': No such device or address

結局これがどういうことなのかはわからないし、https://shim0mura@github.comというようにリポジトリのurlに自分のユーザー名を入れてみても同じようなエラーが出た。

で、色々調べてみるとurlにユーザー名の代わりにtokenを入れればいいらしいということが書いてあった。githubのユーザーアカウントページのApplication=>Personal Access Tokensからtokenを取得できる。そこにも以下の様なことが書いてある。

Personal Access Tokens function like ordinary OAuth access tokens. They can be used instead of a password for git over HTTPS, or can be used to authenticate to the API over Basic Authentication.

というわけでやはりhttps上でbasic認証を通す代わりにことPersonalAccessTokenというのが必要なようだ。capistranoのdeployファイルのrepository指定部分を以下の形式に書き換えた。

set :repository, "https://@github.com/groupname/application.git"

そしたらすんなりうまくいった。特にパスワードなどのプロンプトも出ずに終了

参考: http://stackoverflow.com/questions/18886729/fatal-could-not-read-username-for-https-github-com-no-such-device-or-addre