カラオケは行きたいよな
キャッシュをクリアしなければいけない件はすでにIssueとして記録されていた。リリースノートに書かれますように
https://github.com/tootsuite/mastodon/issues/3505#issuecomment-305884125
Merged master at defe4f9bc3407cde4d5b1918778b0754ef7f4970
Mastodonのrake testしたいんだけどコンテナの外でやるのが一般的なんじゃろか?Dockerのどっかでできないじゃろか?
Dockerfileのbundle installには--without test developmentとか書いてあるしね
やーん。
$ npm install yarn
$ PATH=$PATH:$PWD/bin
$ yarn install
Yarn executable was not detected in the system.
Download Yarn at https://yarnpkg.com/en/docs/install
Dockerビルドマシンで直接rake specが走るようになりました
https://gist.github.com/zunda/aa6870d0f9f68e705d54d1fa882b0cc0
いやー大変w
Streaming APIのかんさつ
- /web/timelines/publicから読み込まれた/api/v1/streaming/?access_token=********&stream=publicを別のタブから読もうとするとerror: "Error: Missing access token"になる
- /web/timelines/publicをリロードしてもaccess_tokenは変化しない
- クッキーを送らなくても読める
- Acceptリクエストヘッダは必要
- Sec-WebSocket-Versionリクエストヘッダは必要
- Upgradeリクエストヘッダは必要
- Sec-WebSocket-Keyヘッダは必要
というわけで最小のcurlラインは下記のような感じ。
curl 'https://<ホスト名>//api/v1/streaming/?access_token=<トークン>&stream=public' -H 'Host: <ホスト名>' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' -H 'Sec-WebSocket-Version: 13' -H 'Sec-WebSocket-Key: <キー>==' -H 'Upgrade: websocket’
ログインしていることを証明する必要はないんだねえ
mstdn.jpではすでにリダイレクトができているとのこと https://github.com/tootsuite/mastodon/issues/2068#issuecomment-305960329 なんだけどソースコードどこよーw
これが、
Jun 05 02:05:24 zundan-mastodon app/web.1: method=GET path=/api/v1/streaming format=html controller=ApplicationController action=raise_not_found status=404
こうなった!
Jun 05 02:09:39 zundan-mastodon app/web.1: method=GET path=/api/v1/streaming format=html controller=Api::V1::StreamingController action=index status=301 location=https://zundan-mastodon-streaming.herokuapp.com/api/v1/streaming?stream=user&access_token=<deadbeef>
コード書けるの幸せだけどRailsとかRSpecとかどう書くべきか調べるのにどんどーん時間を取られる。慣れてないからねえ。
Redisならしょうがない(てか有償版高いんすけど…
method=GET path=/api/v1/timelines/home format=html controller=Api::V1::Timelines::HomeController action=show status=500 error='Redis::CommandError: ERR max number of clients reached'
# frozen_string_literal: true
してるのに文字列リテラルが一つも無いファイル
リモートワークのイベントがあるというので喜んで概要のページを見に行ったらリモート参加できるかどうかはまだわからないってw
このインスタンスのsidekiqはデフォルトでは5スレッド起動するっぽい
$ sidekiq &
$ ps x
:
13 ? Sl 0:03 sidekiq 5.0.0 app [0 of 5 busy]
:
$ sidekiq -c 3 &
$ ps x
:
49 ? Sl 0:03 sidekiq 5.0.0 app [0 of 3 busy]
:
暇そうだし2スレッドまで減らしてみよう
https://github.com/zunda/mastodon/commit/172349ea67ab4ac34075df26be0441ca861f37f4 な感じにして、
$ heroku config:set SIDEKIQ_THREADS=2 -a zundan-mastodon
こんな感じでどうじゃろ
Sidekiqのスレッド数を3個減らしたらRedisのコネクション数が制限に収まるようになった感じがします。ブラウザもうひとつ起動したら破綻するなw
@hatabowyou おおっと、bootsnapがこちらで試してるのより新しくなってますね。みてみます。
masterは壊れてることもあるので、リリース版(今ならv1.4.1)を試してみるのも良いかもしれません。
git checkout v1.4.1
@hatabowyou バージョンは関係なかったようです。RAILS_ENVを指定しないとエラーが出るようです。
$ RAILS_ENV=production bundle exec rake secret
でいかがでしょう?
カラムが「Pin」になっている時に左右に動かせて「Unpin」になっている時に左右に動かせないの、なんだか論理が逆な気がする。あれれ違うかな?操作のしかたがわからないw
@hatabowyou プロダクション用のデータベースに触り始めてる感じなので、もしデータがあるのなら消しちゃわないよう注意しつつ、データベースへの接続のためのホスト名とかポート番号とかユーザー名とかパスワードとか、意図どおりに設定されているか確認するといいかもです。
@hatabowyou おーっ!よかったです。こちらでお役に立てそうなことがあればまたお知らせください。
With three less threads for Sidekiq, (v90) this instance seems to be happier with memory. The spike in response time corresponds to a spike in traffic. https://mastodon.zunda.ninja/media/xDQGSO9DUusQFDi6eRI
$ heroku pg:info DATABASE_URL
=== DATABASE_URL, PG_HOBBY_BASIC_URL
Plan: Hobby-basic
Status: Available
Connections: 7/20
PG Version: 9.6.1
Created: 2017-04-20 18:31 UTC
Data Size: 78.2 MB
Tables: 29
Rows: 99777/10000000 (In compliance)
WAT
Unable to load application: LoadError: /tmp/build_08f19d87ce81840c613aa72c33dd4684/zunda-mastodon-7dc2edb/vendor/bundle/ruby/2.4.0/gems/nokogiri-1.7.2/ext/nokogiri/nokogiri.so: cannot open shared object file: No such file or directory - /app/vendor/bundle/ruby/2.4.0/gems/nokogumbo-1.4.12/lib/nokogumboc.so
$ heroku repo:purge_cache
and redploying... nope. Something funny is happening here.
$ cd /app/vendor/bundle/ruby/2.4.0/gems/nokogumbo-1.4.12/lib
$ ldd nokogumboc.so | grep nokogiri
/tmp/build_90c35b6741220e3f9f7136f4f509b231/zunda-mastodon-7dc2edb/vendor/bundle/ruby/2.4.0/gems/nokogiri-1.7.2/ext/nokogiri/nokogiri.so => not found
Kindleの「明るさを自動調整」って変だよね。まわりが明るければバックライトいらないのにがんばって明るくなるよね。
たぶんjとJ間違えて「# Please enter the commit message for your changes」が残ってるのね、はずかしー←
@hatabowyou こちらではdockerもngnixも使ってないのでそろそろ想像の範囲外になってしまいます。すみません。
エラーはcurlを実行しているコンピューターから自分(localhost)のポート番号3000にネットワーク接続しようとしたけれど、ポート番号3000で待ってくれているサーバが居なかった時に出ます。curlを実行しているコンピューターから見てどのコンピューターでMastodonを動かしているか、dockerに直接接続しようとしてるのか、nginxを通して接続しようとしてるのか、でどういう動作を期待するべきか、が変わりそうです。
Mastodonのdockerはポート3000でサーバが動いていたような気がするので、dockerでMastodonを動かしているようなら同じ計算機でcurl http://localhost:3000/ をすれば応答が返ってきそうです。
@hatabowyou おぉっ!よかったです。
次はChromeの右上のメニューからMore tools-Developer ToolsとたどってNetworkタブを開いてリロードすると、どこからCSSをロードしようとしているかわかると思います。そこからnginxの設定をたどってbundle rake assets:precompileの時にできたファイル(public/内)までたどり着けるようにするとCSSも読めるようになるのではないかと思います。もしかしたらS3などから読むように設定されているかもしれません。
@hatabowyou ですです。404になっている、application-ナントカ.cssにマウスカーソルを乗せるとどこから読んでこようとしているかURLが見えると思います。
@hatabowyou nginxの設定でstaticなassetを別の場所から読むようになっているか、Railsの設定で別の場所から読むようになっているか、という気がします。どちらかのログに何かヒントがあるかもしれません。
Merged 0026ba2 and got https://git.io/vHKOv
oops
StandardError: An error has occurred, this and all later migrations canceled:
PG::ForeignKeyViolation: ERROR: insert or update on table "statuses" violates foreign key constraint "fk_rails_94a6f70399"
DETAIL: Key (in_reply_to_id)=(14576) is not present in table "statuses".
: ALTER TABLE "statuses" ADD CONSTRAINT "fk_rails_94a6f70399"
FOREIGN KEY ("in_reply_to_id")
REFERENCES "statuses" ("id")
ON DELETE SET NULL
Slack says I have 150 unread messages. I decide to read all and scroll up. Scroll stops and now it shows I have 350 unread messages. dah.
Merged from master at 75c6513c678148e9a6adfcda57cfd5c8a16c804a
Running the command
rake mastodon:maintenance:prepare_for_foreign_keys
allowed rake db:migrate to complete. COOL!
https://gist.github.com/zunda/4a3b60894b5b83fb13f5f80813880a00
Heroku API is under maintenance: Critical API Service Update https://status.heroku.com/incidents/1179
@mazzo 観たい!ですが、とりあえずオイゲンさんに個人的に送ってあげると喜ばれそうです https://mastodon.social/users/Gargron/updates/2619490
@hatabowyou@mstdn.fm @hatabowyou@hatabowyou.club やった! 先生じゃないけどよかったです!
今後ともコードの更新など必要かもしれないのでお役に立てるようならまた声をかけてくださいね。
@masarakki Herokuみたいに以前のビルドが残っている環境で再ビルドしようとするとビルドできなくなっちゃうんです https://mastodon.zunda.ninja/@zundan/37406 https://github.com/sass/node-sass/issues/1918
@masarakki yarnとかちゃんと知ってたらもっとまともな直し方がありそうなものなんですが(すみません)
@hatabowyou たぶんそのインスタンスが知ってる分しか表示しないんじゃないかなあと想像してます(未確認)
I wish I had enough time, it rather energy, to understand enough if frameworks around me to be able to enjoy using them efficiently.
HerokuでのMastodonのお世話の方法に外部キーを用意する手順を追加しました https://github.com/zunda/mastodon/wiki/UpgradeInstanceOnHeroku#%E3%83%87%E3%83%BC%E3%82%BF%E3%83%99%E3%83%BC%E3%82%B9%E3%82%92migrate%E3%81%99%E3%82%8B
I might want to reduce number of threads a little bit more...
$ heroku buildpacks:remove heroku/nodejs -a zundan-mastodon-experiment
Deployed the same branch:
:
-----> Ruby app detected
:
-----> Installing node-v6.10.0-linux-x64
-----> Installing yarn-0.22.0
-----> Detecting rake tasks
-----> Preparing app for Rails asset pipeline
Running: rake assets:precompile
yarn install v0.22.0
:
-----> Compressing...
Done: 310.6M
$ heroku run bash -a zundan-mastodon-experiment
~ $ npm start &
[1] 17
~ $ [..................] \ : verb config Skipping project config: /app/.npmrc. (
> mastodon@ start /app
> rimraf ./tmp/streaming && babel ./streaming/index.js --out-dir ./tmp && node ./tmp/streaming/index.js
./streaming/index.js -> tmp/streaming/index.js
info Starting streaming API server master with 7 workers
info Starting worker 1
info Worker 1 now listening on :::40316
info Starting worker 2
info Starting worker 3
:
and the production app with heroku/node buildpack shows similar warnings.
$ heroku repo:purge_cache -a zundan-mastodon-experiment
and deploy:
-----> Compressing...
Done: 310.6M
Similar amount of files.
$ heroku buildpacks:remove heroku/nodejs -a zundan-mastodon
$ heroku buildpacks:remove heroku/nodejs -a zundan-mastodon-streaming
well, actually, buildpacks have not really been set for production apps:
heroku buildpacks -a zundan-mastodon
=== zundan-mastodon Buildpack URL
heroku/ruby
$ heroku buildpacks -a zundan-mastodon-streaming
zundan-mastodon-streaming has no Buildpack URL set.
2017-06-09T00:06:36.105374+00:00 app[web.1]: bash: npm: command not found
Oops.
$ heroku buildpacks:add heroku/nodejs -a zundan-mastodon-streaming
Buildpack added. Next release on zundan-mastodon-streaming will use heroku/nodejs.
:
2017-06-09T00:09:06.978596+00:00 app[web.1]: bash: npm: command not found
nope
I think I saw a Nissan Leaf with the Uber sticker. I couldn't imagine I would in this small town.
Merging Mastodon master while cloning a big repository for day work :P
Merged Mastodon master at 65d8c73bae62b1c0dd0befe022b4ac3719f22048.
@hatabowyou きゃー。落ちたときのログがどこかに残ってないか探してみてくたさい〜
@hatabowyou hatabowyou.clubのDNSの設定がおかしくなってしまったみたいですね…
@hatabowyou まずはインターネットからMastodonのインスタンスのIPアドレスを探し出すことができないようです。ドメインを登録した業者さんの設定画面でドメインの指す先を設定しなおしてみるのが良いのではないかと思います https://mastodon.zunda.ninja/media/19YGYTuD9iU8CZLq_Y4
@essa 最後のエラーはRailsのバージョンアップでキャッシュの非互換になってしまったために起きるようです。キャッシュの期限がすぎれば解消しますが、すぐに解消させるにはキャッシュをクリアします。
@hatabowyou むーん。ひとつずつ対応してみましょう。
まずはインスタンスへの接続かな?僕はGCEは触ったことがないのでまったくの想像になってしまいますが、ブラウザからインスタンスの「コンソール」に接続することができるのではないかと思います。黒い画面の左上に小さく「login:」と表示されてるやつです。探してみてもらえますか?そこから、rootになれるアカウントでログインしてファイアウォールの設定を見直してみてください。うまくいくまでログアウトしないように気をつけてください。
@tateisu Android 7.1.2では、SecurityExceptionかなにかのToastを表示して画像のアップロードに失敗しますね〜。いつかadbつないで見てみたいと思いつつもう何日…。Tuskyも入ってるのでTuskyに行っちゃってるインテントが会ったりするのかなあ、と、ぼんやり妄想してます
『Hidden Figures』、もうすぐ新大統領就任っていうどんよりした雰囲気の中観たのでかなり泣けた。
@tateisu Photosアプリから画像を閲覧-Shareボタン-Subway tooterを選択すると、Tootを書く画面になりつつ画像をアップロードしてくれているようですが、SecurityExceptionで落ちます。下記はadb logcatより。次のTootでToastのキャプチャをお送りします。
06-09 08:28:33.581 1204 2648 W ActivityManager: Permission Denial: opening provider com.google.android.apps.photos.contentprovider.impl.MediaContentProvider from ProcessRecord{284042e 4417:jp.juggler.subwaytooter/u0a102} (pid=4417, uid=10102) that is not exported from uid 10083
@tateisu エラーは解消してました→ https://mastodon.zunda.ninja/@zundan/63197 お騒がせしてすみませんでした!!
Sidekiqさんからのエラーなんとかしたいですよねえ。欲しい情報が含まれてなかったり要らないバックトレースがあったり。(作法をよく知らないのでなんとできない)
HerokuへのMastodonのデプロイ手順は https://github.com/zunda/mastodon/wiki/CreateInstanceOnHeroku にまとめてありますー
Merged master at 778430b54a97b619189aaa4140f3e9fc16025323. Toot :-)
行儀悪いけどマストドン会議3の中継を観始めた http://live2.nicovideo.jp/watch/lv298511250
GNU Affero General Public License https://www.gnu.org/licenses/agpl-3.0.en.html #マストドン会議
I'm happy to hear that @Gargron is happy around Mastodon ☺
「(Mastodonがポピュラーになって)この2ヶ月でいろいろな文化ができてきた」なるほどなあ #マストドン会議
Trying to reach this instance through IPv6 from an IPv6 instance on EC2. Almost there but something around TLS does not seem to be IPv6 ready.
$ curl -6 -H 'Host: mastodon.zunda.ninja' http://dualstack.elbXXXXXX.us-east-1.elb.amazonaws.com/;echo
<html><body>You are being <a href="https://mastodon.zunda.ninja/">redirected</a>.</body></html>
$ curl -k6 -H 'Host: mastodon.zunda.ninja' https://dualstack.elbXXXXXX.us-east-1.elb.amazonaws.com/
curl: (35) Peer reports it experienced an internal error
t2.microのインスタンスにpublicなIPv6アドレスも振ってもらってテストしたんだけど最初はpublicなアドレス要らないよって起動してどうにも接続できなかったのだw
AWSむずかしいねえ
@hatabowyou お返事遅くなってすみません。
SSHでの接続には、GCEのホストとPuTTYとで対になる鍵が必要だろうと思います。GCEを使ったことが無いので想像になってしまいますが、PuTTYにテスト用のインスタンスに対応する鍵が登録されていれば、テスト用のインスタンスには登録できるのではないかと思います。
@hatabowyou Mastodonのインタンスへの接続は、どうしてうまくいかないのかもう一度整理する必要があるかもしれません。GCEを使ったことがないので想像できないですがSSH以外でのログインはできないでしょうか?ポート番号を変更しただけなら、PuTTYからの接続先のポートを変更すれば接続できるかもしれません。ファイアウォールの設定を変更した場合には、次にインスタンスが起動した時に同じ設定が適用されるようになっていなければ、インスタンスの再起動で接続できるようになるかもしれません。再起動する場合には、できればデータベースのデータが消えない方法を選ぶとよさそうです。
DNSの設定が変わってしまったのはインスタンスへの接続がセキュアかどうかとは別の原因があるかもしれません。GCEについて知らないので何とも言えません。すみません。
Using ELB for the default .herokuapp.com domain instead of ELB for Heroku SNI, it seems that TLS access goes through to the app:
$ curl -k6 -H 'Host: mastodon.zunda.ninja' https://dualstack.elbYYYYYY-YYYYYYYYY.us-east-1.elb.amazonaws.com; echo
<html><body>You are being <a href="https://mastodon.zunda.ninja/users/zundan">redirected</a>.</body></html>
I'm starting to wonder if it is possible to have an v6 IP address at home.
An ELB for SSL Endpoint can also be used to accept TLS connections from a v6 address :)
Well, actually the router obtains an IPv6 address. It is now a matter of routing or tunneling or converting v4 and v6 network at home.
# sync; sync; sync; shutdown -h now
Wow. Looks like I'm using IPv6 already.
https://mastodon.zunda.ninja/media/lGycQ_n2nVbp53RHsDk https://mastodon.zunda.ninja/media/BqtunV8AZvk08rOQzs4 https://mastodon.zunda.ninja/media/QFRfOWL12iofvZB_w5Y
ぼっちインスタンスでもリモートから送られてきたトゥートは検索できますよよね〜 #孤独のインスタンス