Skip to content

Conversation

@S-H-GAMELINKS
Copy link
Contributor

@S-H-GAMELINKS S-H-GAMELINKS commented Dec 16, 2024

概要

pub-relayprototypeで利用するRailsのバージョンを7.2系列にあげています。

内容

  • Rails 7.2にアップデート
  • Rails 7.2への app:updateの差分を反映
  • Rails 7.2で挙動が変わったdefault_url_optionsを使わずに環境変数のDOMAINを使う形に修正
  • いくつかのテストのケースの追加修正
  • Rails 7.2で定数読み込みの仕組みが変わったのでリレー用のCLIのパスなどを修正

備考

またfedifyを利用してローカル環境で建てたリレーサーバからリレーに参加し、投稿が配送されているログまでは確認が取れています。


def inbox_url
"https://#{ENV['DOMAIN']}/inbox"
end
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

default_url_optionsの挙動が変更されており、そのまま扱うのは難しいと判断して環境変数を使うように変更しています。


def acct
'acct:relay@' + Rails.application.default_url_options[:host]
"acct:relay@#{ENV["DOMAIN"]}"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同じく環境変数を使うように変更しています


def actor_url
PubRelay::Application.routes.url_helpers.actor_url
"https://#{ENV['DOMAIN']}/actor"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

こちらも同じく

type: "Follow",
actor: @actor['id'],
object: URI.join(Rails.application.routes.url_helpers.root_url, "/actor")
object: "https://#{ENV["DOMAIN"]}/actor"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

こちらも同じく環境変数を使うように変更しています


module PubRelay
class CLI < Thor
class Cli < Thor
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

定数読み込み周りの対応で定数名などを変更しています


# Use a different cache store in production.
# config.cache_store = :mem_cache_store
config.cache_store = :redis_store, { url: ENV['REDIS_URL'] }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pub-relay-prototype全体で有効にしていたRedisでのキャッシュを本番環境のみで有効にするように変更しています。
そのため #601 でREDIS_URLが不要とコメントしていましたが一旦残す方向で対応できればと思います。
REDIS_URLとは別にREDIS_HOSTなどを設定すればOKですね

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant