ゴールデンウイークからそろそろ1週間がたちますが、今更ながらに今年のゴールデンウイークの振り返りをします。
Misskeyのメディアプロキシを作った
Rustの学習としてMisskeyのメディアプロキシを作りました
https://github.com/tunamaguro/misskey-webp-proxy
現在自分のMisskeyではこれをメディアプロキシとして使っています。本家の動作と同じように画像をwebpに圧縮して返すだけのシンプルな仕組みですが、
Rustに不慣れなのもあって時間がかかってしまいました。
リリース部分をGitHub Actionsを使って、バイナリの作成とDockerイメージのプッシュがタグをつけたコミットをするたびに行うようになっています。
RustでCI/CDを使うのははじめてでしたがかなり便利だったので次回リポジトリを作る際は、pushするたびにcargo fmt
やcargo clippy
が自動で動くようにしたいです
それ以外の感想としてはRustのトレイトの仕組みがかなり便利でした。利用しているlibwebp
がCで書かれているので下のように確保したメモリを都度開放する関数を呼び出す必要がありました
https://github.com/webmproject/libwebp/blob/main/doc/api.md より引用
ここでDrop
トレイトを利用することでメモリ解放をRustの仕組みによって行うことができました
https://github.com/tunamaguro/misskey-webp-proxy/blob/0832163587d2d07a6842b24a1837c75ebf050496/src/webp.rs#L31-L99
これらの仕組みを使っていない開発時にはメモリ周りのエラーで苦しめられたので、これらの仕組みを十分利用していきたいと思います
Tarkovに復帰した
今季始まってすぐにスカブにアーマーを抜かれて死んでから、しばらく触れていなかったのですが4か月ぶりに復帰しました
地獄のSetupを乗り越えたので、これからはあまり根を詰めずゆっくりやっていきたいです
その他
前から気になっていた本を2冊買いました
時間を見つけて6月までには読了したいと思います
終わりに
次の長期連休は気になっているTCP/IPの自作をやってみたい…
https://drive.google.com/drive/folders/1k2vymbC3vUk5CTJbay4LLEdZ9HemIpZe