Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env.development
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ DB_USER=postgres
DB_PASS=postgres
DB_NAME=pub-relay

DOMAIN=example.com
DOMAIN=www.example.com
HTTPS=true
2 changes: 1 addition & 1 deletion .env.test
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ DB_USER=postgres
DB_PASS=postgres
DB_NAME=pub-relay

DOMAIN=example.com
DOMAIN=www.example.com

2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '3.3.6'

gem 'rails', '~> 7'
gem 'rails', '~> 7.2', '>= 7.2.2.1'
gem 'sprockets', '~> 4.2.1'
gem 'pg', '>= 0.18', '< 2.0'
gem 'puma', '~> 6.4'
Expand Down
152 changes: 76 additions & 76 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,92 +1,90 @@
GEM
remote: https://rubygems.org/
specs:
actioncable (7.1.3.2)
actionpack (= 7.1.3.2)
activesupport (= 7.1.3.2)
actioncable (7.2.2.1)
actionpack (= 7.2.2.1)
activesupport (= 7.2.2.1)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
zeitwerk (~> 2.6)
actionmailbox (7.1.3.2)
actionpack (= 7.1.3.2)
activejob (= 7.1.3.2)
activerecord (= 7.1.3.2)
activestorage (= 7.1.3.2)
activesupport (= 7.1.3.2)
mail (>= 2.7.1)
net-imap
net-pop
net-smtp
actionmailer (7.1.3.2)
actionpack (= 7.1.3.2)
actionview (= 7.1.3.2)
activejob (= 7.1.3.2)
activesupport (= 7.1.3.2)
mail (~> 2.5, >= 2.5.4)
net-imap
net-pop
net-smtp
actionmailbox (7.2.2.1)
actionpack (= 7.2.2.1)
activejob (= 7.2.2.1)
activerecord (= 7.2.2.1)
activestorage (= 7.2.2.1)
activesupport (= 7.2.2.1)
mail (>= 2.8.0)
actionmailer (7.2.2.1)
actionpack (= 7.2.2.1)
actionview (= 7.2.2.1)
activejob (= 7.2.2.1)
activesupport (= 7.2.2.1)
mail (>= 2.8.0)
rails-dom-testing (~> 2.2)
actionpack (7.1.3.2)
actionview (= 7.1.3.2)
activesupport (= 7.1.3.2)
actionpack (7.2.2.1)
actionview (= 7.2.2.1)
activesupport (= 7.2.2.1)
nokogiri (>= 1.8.5)
racc
rack (>= 2.2.4)
rack (>= 2.2.4, < 3.2)
rack-session (>= 1.0.1)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
actiontext (7.1.3.2)
actionpack (= 7.1.3.2)
activerecord (= 7.1.3.2)
activestorage (= 7.1.3.2)
activesupport (= 7.1.3.2)
useragent (~> 0.16)
actiontext (7.2.2.1)
actionpack (= 7.2.2.1)
activerecord (= 7.2.2.1)
activestorage (= 7.2.2.1)
activesupport (= 7.2.2.1)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (7.1.3.2)
activesupport (= 7.1.3.2)
actionview (7.2.2.1)
activesupport (= 7.2.2.1)
builder (~> 3.1)
erubi (~> 1.11)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
activejob (7.1.3.2)
activesupport (= 7.1.3.2)
activejob (7.2.2.1)
activesupport (= 7.2.2.1)
globalid (>= 0.3.6)
activemodel (7.1.3.2)
activesupport (= 7.1.3.2)
activerecord (7.1.3.2)
activemodel (= 7.1.3.2)
activesupport (= 7.1.3.2)
activemodel (7.2.2.1)
activesupport (= 7.2.2.1)
activerecord (7.2.2.1)
activemodel (= 7.2.2.1)
activesupport (= 7.2.2.1)
timeout (>= 0.4.0)
activestorage (7.1.3.2)
actionpack (= 7.1.3.2)
activejob (= 7.1.3.2)
activerecord (= 7.1.3.2)
activesupport (= 7.1.3.2)
activestorage (7.2.2.1)
actionpack (= 7.2.2.1)
activejob (= 7.2.2.1)
activerecord (= 7.2.2.1)
activesupport (= 7.2.2.1)
marcel (~> 1.0)
activesupport (7.1.3.2)
activesupport (7.2.2.1)
base64
benchmark (>= 0.3)
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
concurrent-ruby (~> 1.0, >= 1.3.1)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
logger (>= 1.4.2)
minitest (>= 5.1)
mutex_m
tzinfo (~> 2.0)
securerandom (>= 0.3)
tzinfo (~> 2.0, >= 2.0.5)
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
base64 (0.2.0)
benchmark (0.4.0)
bigdecimal (3.1.6)
bootsnap (1.18.3)
msgpack (~> 1.2)
builder (3.2.4)
byebug (11.1.3)
concurrent-ruby (1.2.3)
concurrent-ruby (1.3.4)
connection_pool (2.4.1)
crass (1.0.6)
date (3.3.4)
date (3.4.1)
diff-lcs (1.5.0)
domain_name (0.6.20240107)
dotenv (3.1.0)
Expand Down Expand Up @@ -117,15 +115,16 @@ GEM
i18n (1.14.1)
concurrent-ruby (~> 1.0)
io-console (0.7.2)
irb (1.11.2)
rdoc
irb (1.14.2)
rdoc (>= 4.0.0)
reline (>= 0.4.2)
listen (3.9.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
llhttp-ffi (0.5.0)
ffi-compiler (~> 1.0)
rake (~> 13.0)
logger (1.6.3)
lograge (0.14.0)
actionpack (>= 4)
activesupport (>= 4)
Expand All @@ -139,20 +138,19 @@ GEM
net-imap
net-pop
net-smtp
marcel (1.0.2)
marcel (1.0.4)
mini_mime (1.1.5)
mini_portile2 (2.8.6)
minitest (5.22.2)
msgpack (1.7.2)
mutex_m (0.2.0)
net-imap (0.4.10)
net-imap (0.5.1)
date
net-protocol
net-pop (0.1.2)
net-protocol
net-protocol (0.2.2)
timeout
net-smtp (0.4.0.1)
net-smtp (0.5.0)
net-protocol
nio4r (2.7.0)
nokogiri (1.16.4)
Expand All @@ -175,31 +173,31 @@ GEM
rackup (1.0.0)
rack (< 3)
webrick
rails (7.1.3.2)
actioncable (= 7.1.3.2)
actionmailbox (= 7.1.3.2)
actionmailer (= 7.1.3.2)
actionpack (= 7.1.3.2)
actiontext (= 7.1.3.2)
actionview (= 7.1.3.2)
activejob (= 7.1.3.2)
activemodel (= 7.1.3.2)
activerecord (= 7.1.3.2)
activestorage (= 7.1.3.2)
activesupport (= 7.1.3.2)
rails (7.2.2.1)
actioncable (= 7.2.2.1)
actionmailbox (= 7.2.2.1)
actionmailer (= 7.2.2.1)
actionpack (= 7.2.2.1)
actiontext (= 7.2.2.1)
actionview (= 7.2.2.1)
activejob (= 7.2.2.1)
activemodel (= 7.2.2.1)
activerecord (= 7.2.2.1)
activestorage (= 7.2.2.1)
activesupport (= 7.2.2.1)
bundler (>= 1.15.0)
railties (= 7.1.3.2)
railties (= 7.2.2.1)
rails-dom-testing (2.2.0)
activesupport (>= 5.0.0)
minitest
nokogiri (>= 1.6)
rails-html-sanitizer (1.6.0)
loofah (~> 2.21)
nokogiri (~> 1.14)
railties (7.1.3.2)
actionpack (= 7.1.3.2)
activesupport (= 7.1.3.2)
irb
railties (7.2.2.1)
actionpack (= 7.2.2.1)
activesupport (= 7.2.2.1)
irb (~> 1.13)
rackup (>= 1.0.0)
rake (>= 12.2)
thor (~> 1.0, >= 1.2.2)
Expand Down Expand Up @@ -261,6 +259,7 @@ GEM
rspec-support (3.12.2)
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.5)
securerandom (0.4.0)
sidekiq (7.2.2)
concurrent-ruby (< 2)
connection_pool (>= 2.3.0)
Expand All @@ -277,11 +276,12 @@ GEM
rack (>= 2.2.4, < 4)
stringio (3.1.0)
thor (1.3.0)
timeout (0.4.1)
timeout (0.4.2)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
tzinfo-data (1.2024.1)
tzinfo (>= 1.0.0)
useragent (0.16.11)
webrick (1.8.2)
websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0)
Expand All @@ -306,7 +306,7 @@ DEPENDENCIES
oj
pg (>= 0.18, < 2.0)
puma (~> 6.4)
rails (~> 7)
rails (~> 7.2, >= 7.2.2.1)
redis (~> 5.1)
redis-namespace (~> 1.10)
redis-rails
Expand Down
10 changes: 10 additions & 0 deletions app/controllers/actors_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,14 @@ def show
},
})
end

private

def actor_url
"https://#{ENV['DOMAIN']}/actor"
end

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の挙動が変更されており、そのまま扱うのは難しいと判断して環境変数を使うように変更しています。

end
4 changes: 2 additions & 2 deletions app/controllers/webfinger_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ def show
links: [{
rel: 'self',
type: 'application/activity+json',
href: actor_url,
href: "https://#{ENV['DOMAIN']}/actor",
}],
})
end

private

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.

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

end
end
2 changes: 1 addition & 1 deletion app/workers/deliver_worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def perform(url, body)
private

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.

こちらも同じく

end

def http_client
Expand Down
6 changes: 3 additions & 3 deletions app/workers/process_worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@ def subscribe!

accept_activity = Oj.dump({
'@context': %w(https://www.w3.org/ns/activitystreams https://w3id.org/security/v1),
id: URI.join(Rails.application.routes.url_helpers.root_url, "/actor#accepts/follows/#{domain}"),
id: "https://#{ENV["DOMAIN"]}/actor#accepts/follows/#{domain}",
type: 'Accept',
actor: URI.join(Rails.application.routes.url_helpers.root_url, "/actor"),
actor: "https://#{ENV["DOMAIN"]}/actor",
object: {
id: @json['id'],
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.

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

},
})

Expand Down
11 changes: 3 additions & 8 deletions bin/rails
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
#!/usr/bin/env ruby
begin
load File.expand_path('../spring', __FILE__)
rescue LoadError => e
raise unless e.message.include?('spring')
end
APP_PATH = File.expand_path('../config/application', __dir__)
require_relative '../config/boot'
require 'rails/commands'
APP_PATH = File.expand_path("../config/application", __dir__)
require_relative "../config/boot"
require "rails/commands"
9 changes: 2 additions & 7 deletions bin/rake
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
#!/usr/bin/env ruby
begin
load File.expand_path('../spring', __FILE__)
rescue LoadError => e
raise unless e.message.include?('spring')
end
require_relative '../config/boot'
require 'rake'
require_relative "../config/boot"
require "rake"
Rake.application.run
4 changes: 2 additions & 2 deletions bin/relayctl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env ruby
require_relative '../config/boot'
require_relative '../config/environment'
require_relative '../lib/cli'
PubRelay::CLI.start(ARGV)
require_relative '../lib/pub_relay/cli'
PubRelay::Cli.start(ARGV)
Loading
Loading