fedipub 0.0.1 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +70 -2
- data/Rakefile +5 -9
- data/app/assets/config/fedipub_manifest.js +1 -0
- data/app/assets/stylesheets/fedipub/application.css +15 -0
- data/app/controllers/concerns/fedipub/server/render_collections.rb +19 -0
- data/app/controllers/fedipub/client/activities_controller.rb +27 -0
- data/app/controllers/fedipub/client/actors_controller.rb +54 -0
- data/app/controllers/fedipub/client/followings_controller.rb +103 -0
- data/app/controllers/fedipub/client_controller.rb +9 -0
- data/app/controllers/fedipub/server/activities_controller.rb +78 -0
- data/app/controllers/fedipub/server/actors_controller.rb +50 -0
- data/app/controllers/fedipub/server/followings_controller.rb +19 -0
- data/app/controllers/fedipub/server/nodeinfo_controller.rb +28 -0
- data/app/controllers/fedipub/server/published_controller.rb +30 -0
- data/app/controllers/fedipub/server/web_finger_controller.rb +45 -0
- data/app/controllers/fedipub/server_controller.rb +37 -0
- data/app/helpers/fedipub/server_helper.rb +18 -0
- data/app/jobs/fedipub/application_job.rb +10 -0
- data/app/jobs/fedipub/fetch_nodeinfo_job.rb +10 -0
- data/app/jobs/fedipub/notify_inbox_job.rb +10 -0
- data/app/mailers/fedipub/application_mailer.rb +6 -0
- data/app/models/concerns/fedipub/actor_entity.rb +166 -0
- data/app/models/concerns/fedipub/announceable.rb +18 -0
- data/app/models/concerns/fedipub/data_entity.rb +279 -0
- data/app/models/concerns/fedipub/handles_delete_requests.rb +36 -0
- data/app/models/concerns/fedipub/has_uuid.rb +61 -0
- data/app/models/concerns/fedipub/likeable.rb +29 -0
- data/app/models/fedipub/activity.rb +62 -0
- data/app/models/fedipub/actor.rb +303 -0
- data/app/models/fedipub/application_record.rb +5 -0
- data/app/models/fedipub/following.rb +72 -0
- data/app/models/fedipub/host.rb +48 -0
- data/app/policies/fedipub/client/activity_policy.rb +9 -0
- data/app/policies/fedipub/client/actor_policy.rb +15 -0
- data/app/policies/fedipub/client/following_policy.rb +35 -0
- data/app/policies/fedipub/fedipub_policy.rb +63 -0
- data/app/policies/fedipub/server/activity_policy.rb +9 -0
- data/app/policies/fedipub/server/actor_policy.rb +23 -0
- data/app/policies/fedipub/server/following_policy.rb +6 -0
- data/app/policies/fedipub/server/publishable_policy.rb +15 -0
- data/app/views/fedipub/client/activities/_activity.html.erb +5 -0
- data/app/views/fedipub/client/activities/_activity.json.jbuilder +1 -0
- data/app/views/fedipub/client/activities/_index.json.jbuilder +1 -0
- data/app/views/fedipub/client/activities/feed.html.erb +11 -0
- data/app/views/fedipub/client/activities/feed.json.jbuilder +1 -0
- data/app/views/fedipub/client/activities/index.html.erb +5 -0
- data/app/views/fedipub/client/activities/index.json.jbuilder +1 -0
- data/app/views/fedipub/client/actors/_actor.json.jbuilder +17 -0
- data/app/views/fedipub/client/actors/_lookup_form.html.erb +5 -0
- data/app/views/fedipub/client/actors/gone.html.erb +1 -0
- data/app/views/fedipub/client/actors/index.html.erb +44 -0
- data/app/views/fedipub/client/actors/index.json.jbuilder +1 -0
- data/app/views/fedipub/client/actors/show.html.erb +112 -0
- data/app/views/fedipub/client/actors/show.json.jbuilder +1 -0
- data/app/views/fedipub/client/common/_client_links.html.erb +26 -0
- data/app/views/fedipub/client/followings/_follow.html.erb +4 -0
- data/app/views/fedipub/client/followings/_follow_actions.html.erb +36 -0
- data/app/views/fedipub/client/followings/_follower.html.erb +7 -0
- data/app/views/fedipub/client/followings/_following.json.jbuilder +1 -0
- data/app/views/fedipub/client/followings/_form.html.erb +22 -0
- data/app/views/fedipub/client/followings/index.html.erb +29 -0
- data/app/views/fedipub/client/followings/index.json.jbuilder +1 -0
- data/app/views/fedipub/client/followings/show.html.erb +21 -0
- data/app/views/fedipub/client/followings/show.json.jbuilder +1 -0
- data/app/views/fedipub/server/activities/_activity.activitypub.jbuilder +25 -0
- data/app/views/fedipub/server/activities/show.activitypub.jbuilder +1 -0
- data/app/views/fedipub/server/actors/_actor.activitypub.jbuilder +27 -0
- data/app/views/fedipub/server/actors/_tombstone.activitypub.jbuilder +6 -0
- data/app/views/fedipub/server/actors/show.activitypub.jbuilder +5 -0
- data/app/views/fedipub/server/followings/_following.activitypub.jbuilder +7 -0
- data/app/views/fedipub/server/followings/show.activitypub.jbuilder +1 -0
- data/app/views/fedipub/server/nodeinfo/index.nodeinfo.jbuilder +6 -0
- data/app/views/fedipub/server/nodeinfo/show.nodeinfo.jbuilder +19 -0
- data/app/views/fedipub/server/published/_publishable.activitypub.jbuilder +11 -0
- data/app/views/fedipub/server/published/_tombstone.activitypub.jbuilder +6 -0
- data/app/views/fedipub/server/published/show.activitypub.jbuilder +5 -0
- data/app/views/fedipub/server/shared/ordered_collection.activitypub.jbuilder +6 -0
- data/app/views/fedipub/server/shared/ordered_collection_page.activitypub.jbuilder +12 -0
- data/app/views/fedipub/server/web_finger/find.jrd.jbuilder +24 -0
- data/app/views/fedipub/server/web_finger/host_meta.xrd.erb +5 -0
- data/app/views/users/show.html.erb +4 -0
- data/config/initializers/mime_types.rb +21 -0
- data/config/initializers/security_vocab.rb +53 -0
- data/config/routes.rb +53 -0
- data/db/migrate/20200712133150_create_federails_actors.rb +22 -0
- data/db/migrate/20200712143127_create_federails_followings.rb +14 -0
- data/db/migrate/20200712174938_create_federails_activities.rb +11 -0
- data/db/migrate/20241002094500_add_uuids.rb +13 -0
- data/db/migrate/20241002094501_add_keypair_to_actors.rb +8 -0
- data/db/migrate/20250122160618_add_extensions_to_federails_actors.rb +5 -0
- data/db/migrate/20250301082500_add_local_to_actors.rb +11 -0
- data/db/migrate/20250329123939_add_actor_type_to_actors.rb +5 -0
- data/db/migrate/20250329123940_add_tombstoned_at_to_actors.rb +5 -0
- data/db/migrate/20250426061729_create_federails_hosts.rb +22 -0
- data/db/migrate/20251121160720_add_to_and_cc_to_federails_activities.rb +6 -0
- data/db/migrate/20260421170640_add_result_and_instrument_to_federails_activities.rb +6 -0
- data/db/migrate/20260723113716_rename_federails_to_fedipub.rb +15 -0
- data/lib/fedipub/configuration.rb +119 -0
- data/lib/fedipub/data_transformer/note.rb +36 -0
- data/lib/fedipub/engine.rb +11 -0
- data/lib/fedipub/maintenance/actors_updater.rb +66 -0
- data/lib/fedipub/maintenance/hosts_updater.rb +19 -0
- data/lib/fedipub/utils/actor.rb +85 -0
- data/lib/fedipub/utils/context.rb +12 -0
- data/lib/fedipub/utils/host.rb +54 -0
- data/lib/fedipub/utils/json_request.rb +41 -0
- data/lib/fedipub/utils/object.rb +131 -0
- data/lib/fedipub/utils/response_codes.rb +11 -0
- data/lib/fedipub/version.rb +1 -3
- data/lib/fedipub.rb +127 -4
- data/lib/fediverse/collection.rb +31 -0
- data/lib/fediverse/inbox.rb +110 -0
- data/lib/fediverse/node_info.rb +38 -0
- data/lib/fediverse/notifier.rb +90 -0
- data/lib/fediverse/request.rb +29 -0
- data/lib/fediverse/signature.rb +49 -0
- data/lib/fediverse/webfinger.rb +140 -0
- data/lib/fediverse.rb +5 -0
- data/lib/generators/fedipub/copy_client_policies/USAGE +8 -0
- data/lib/generators/fedipub/copy_client_policies/copy_client_policies_generator.rb +9 -0
- data/lib/generators/fedipub/copy_client_views/USAGE +8 -0
- data/lib/generators/fedipub/copy_client_views/copy_client_views_generator.rb +9 -0
- data/lib/generators/fedipub/copy_factories/USAGE +8 -0
- data/lib/generators/fedipub/copy_factories/copy_factories_generator.rb +43 -0
- data/lib/generators/fedipub/install/USAGE +9 -0
- data/lib/generators/fedipub/install/install_generator.rb +10 -0
- data/lib/generators/fedipub/install/templates/fedipub.rb +1 -0
- data/lib/generators/fedipub/install/templates/fedipub.yml +27 -0
- data/lib/tasks/factory_bot.rake +15 -0
- data/lib/tasks/fedipub_tasks.rake +13 -0
- metadata +259 -10
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
require 'fedipub/utils/host'
|
|
2
|
+
require 'fedipub/utils/json_request'
|
|
3
|
+
|
|
4
|
+
module Fediverse
|
|
5
|
+
# Methods related to Webfinger: find accounts, fetch actors,...
|
|
6
|
+
class Webfinger
|
|
7
|
+
class << self
|
|
8
|
+
ACCOUNT_REGEX = /(?<username>[a-z0-9\-_.]+)(?:@(?<domain>.*))?/
|
|
9
|
+
|
|
10
|
+
# Extracts username and domain from an account string.
|
|
11
|
+
# Accepts forms "user@domain", "@user@domain" and "acct:user@domain"
|
|
12
|
+
#
|
|
13
|
+
# @param account [String] Account string
|
|
14
|
+
#
|
|
15
|
+
# @return [MatchData, nil] Matches with +:username+ and +:domain+ or +nil+
|
|
16
|
+
def split_account(account)
|
|
17
|
+
/\A(acct:|@)?#{ACCOUNT_REGEX}\z/io.match account
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
# Determines if a given account string should be a local account (same host as configured one)
|
|
21
|
+
#
|
|
22
|
+
# @param hash [Hash, MatchData] Object with +:username+ and +:domain+ keys
|
|
23
|
+
#
|
|
24
|
+
# @return [Boolean]
|
|
25
|
+
def local_user?(hash)
|
|
26
|
+
hash[:username] && (hash[:domain].nil? || (hash[:domain] == Fedipub::Utils::Host.localhost))
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# Fetches a distant actor
|
|
30
|
+
#
|
|
31
|
+
# @param username [String]
|
|
32
|
+
# @param domain [String]
|
|
33
|
+
#
|
|
34
|
+
# @return [Fedipub::Actor, nil] Fedipub actor or nothing when not found
|
|
35
|
+
def fetch_actor(username, domain)
|
|
36
|
+
fetch_actor_url webfinger(username, domain)
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# Fetches an actor given its URL
|
|
40
|
+
#
|
|
41
|
+
# @param url [String] Actor's federation URL
|
|
42
|
+
#
|
|
43
|
+
# @return [Fedipub::Actor, nil] Fedipub actor or nothing when not found
|
|
44
|
+
def fetch_actor_url(url)
|
|
45
|
+
webfinger_to_actor get_json url
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# Gets the real actor's federation URL from its username and domain
|
|
49
|
+
#
|
|
50
|
+
# @param username [String]
|
|
51
|
+
# @param domain [String]
|
|
52
|
+
#
|
|
53
|
+
# @return [String, nil] Federation URL if found
|
|
54
|
+
def webfinger(username, domain)
|
|
55
|
+
json = webfinger_response(username, domain)
|
|
56
|
+
link = json['links'].find { |l| Mime::Type.lookup(l['type']).to_sym == :activitypub }
|
|
57
|
+
|
|
58
|
+
link['href'] if link
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# Returns remote follow link template, or complete link if actor_url is provided
|
|
62
|
+
#
|
|
63
|
+
# @param username [String]
|
|
64
|
+
# @param domain [String]
|
|
65
|
+
# @param actor_url [String] Optional Federation URL to provide when known
|
|
66
|
+
#
|
|
67
|
+
# @return [String] The URL to use as follow URL
|
|
68
|
+
def remote_follow_url(username, domain, actor_url: nil)
|
|
69
|
+
json = webfinger_response(username, domain)
|
|
70
|
+
link = json['links'].find { |l| l['rel'] == 'http://ostatus.org/schema/1.0/subscribe' }
|
|
71
|
+
return nil if link&.dig('template').nil?
|
|
72
|
+
|
|
73
|
+
if actor_url
|
|
74
|
+
link['template'].gsub('{uri}', CGI.escape(actor_url))
|
|
75
|
+
else
|
|
76
|
+
link['template']
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
private
|
|
81
|
+
|
|
82
|
+
# Makes a webfinger request for a given username/domain
|
|
83
|
+
# @return [Hash] Webfinger response's content
|
|
84
|
+
def webfinger_response(username, domain)
|
|
85
|
+
scheme = Fedipub.configuration.force_ssl ? 'https' : 'http'
|
|
86
|
+
get_json "#{scheme}://#{domain}/.well-known/webfinger", resource: "acct:#{username}@#{domain}"
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# Extracts the server and port from a string, omitting common ports
|
|
90
|
+
# @return [String] Server and port
|
|
91
|
+
def server_and_port(string)
|
|
92
|
+
uri = URI.parse string
|
|
93
|
+
if uri.port && [80, 443].exclude?(uri.port)
|
|
94
|
+
"#{uri.host}:#{uri.port}"
|
|
95
|
+
else
|
|
96
|
+
uri.host
|
|
97
|
+
end
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# Builds a +Fedipub::Actor+ from a Webfinger response
|
|
101
|
+
# @param data [Hash] Webfinger response
|
|
102
|
+
# @return [Fedipub::Actor]
|
|
103
|
+
def webfinger_to_actor(data) # rubocop:disable Metrics/MethodLength
|
|
104
|
+
data = data.clone
|
|
105
|
+
id = data.delete('id')
|
|
106
|
+
Fedipub::Actor.new federated_url: id,
|
|
107
|
+
username: data.delete('preferredUsername'),
|
|
108
|
+
actor_type: data.delete('type'),
|
|
109
|
+
name: data.delete('name'),
|
|
110
|
+
server: server_and_port(id),
|
|
111
|
+
inbox_url: data.delete('inbox'),
|
|
112
|
+
outbox_url: data.delete('outbox'),
|
|
113
|
+
followers_url: data.delete('followers'),
|
|
114
|
+
followings_url: data.delete('following'),
|
|
115
|
+
profile_url: data.delete('url'),
|
|
116
|
+
public_key: data.delete('publicKey')&.dig('publicKeyPem'),
|
|
117
|
+
extensions: data.except('@context')
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
# Makes a simple GET request and returns a +Hash+ from the parsed body
|
|
121
|
+
# @return [Hash]
|
|
122
|
+
# @raise [ActiveRecord::RecordNotFound] when the response is invalid
|
|
123
|
+
def get_json(url, params = {})
|
|
124
|
+
Fedipub::Utils::JsonRequest.get_json(url, params: params, follow_redirects: true, headers: { accept: 'application/json' })
|
|
125
|
+
rescue Fedipub::Utils::JsonRequest::UnhandledResponseStatus => e
|
|
126
|
+
Rails.logger.debug { e.message }
|
|
127
|
+
|
|
128
|
+
raise ActiveRecord::RecordNotFound
|
|
129
|
+
rescue Faraday::ConnectionFailed
|
|
130
|
+
Rails.logger.debug { "Failed to reach server for GET #{url}" }
|
|
131
|
+
|
|
132
|
+
raise ActiveRecord::RecordNotFound
|
|
133
|
+
rescue JSON::ParserError
|
|
134
|
+
Rails.logger.debug { "Invalid JSON response for GET #{url}" }
|
|
135
|
+
|
|
136
|
+
raise ActiveRecord::RecordNotFound
|
|
137
|
+
end
|
|
138
|
+
end
|
|
139
|
+
end
|
|
140
|
+
end
|
data/lib/fediverse.rb
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
module Fedipub
|
|
2
|
+
class CopyClientPoliciesGenerator < Rails::Generators::Base
|
|
3
|
+
source_root File.expand_path('../../../../app/policies/fedipub', __dir__)
|
|
4
|
+
|
|
5
|
+
def copy_policies
|
|
6
|
+
directory 'client', Rails.root.join('app', 'policies', 'fedipub', 'client')
|
|
7
|
+
end
|
|
8
|
+
end
|
|
9
|
+
end
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
module Fedipub
|
|
2
|
+
class CopyFactoriesGenerator < Rails::Generators::Base
|
|
3
|
+
SOURCE_DIRECTORY = File.expand_path('../../../../spec/factories/fedipub', __dir__)
|
|
4
|
+
FACTORY_DEFINITION_REGEX = /(FactoryBot.define do\n\s+factory) :(\w+),/
|
|
5
|
+
|
|
6
|
+
source_root SOURCE_DIRECTORY
|
|
7
|
+
|
|
8
|
+
def initialize
|
|
9
|
+
super
|
|
10
|
+
@files = []
|
|
11
|
+
@factories = []
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def copy_factories
|
|
15
|
+
dest = Rails.root.join('spec', 'factories')
|
|
16
|
+
|
|
17
|
+
Dir.entries(SOURCE_DIRECTORY).each do |node|
|
|
18
|
+
source_path = File.join(SOURCE_DIRECTORY, node)
|
|
19
|
+
next unless File.file?(source_path) && node.match?(/\.rb\Z/)
|
|
20
|
+
|
|
21
|
+
file_path = File.join(dest, "fedipub_#{node}")
|
|
22
|
+
copy_file node, file_path
|
|
23
|
+
@files << file_path
|
|
24
|
+
@factories << File.read(file_path).match(FACTORY_DEFINITION_REGEX)&.[](2)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
substitute_values!
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
private
|
|
31
|
+
|
|
32
|
+
def substitute_values!
|
|
33
|
+
@factories.compact!
|
|
34
|
+
@files.each do |file|
|
|
35
|
+
gsub_file file, FACTORY_DEFINITION_REGEX, '\1 :fedipub_\2,'
|
|
36
|
+
|
|
37
|
+
@factories.each do |factory|
|
|
38
|
+
gsub_file file, ":#{factory}", ":fedipub_#{factory}"
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
module Fedipub
|
|
2
|
+
class InstallGenerator < Rails::Generators::Base
|
|
3
|
+
source_root File.expand_path('templates', __dir__)
|
|
4
|
+
|
|
5
|
+
def copy_files
|
|
6
|
+
copy_file 'fedipub.yml', Rails.root.join('config', 'fedipub.yml')
|
|
7
|
+
copy_file 'fedipub.rb', Rails.root.join('config', 'initializers', 'fedipub.rb')
|
|
8
|
+
end
|
|
9
|
+
end
|
|
10
|
+
end
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Fedipub.config_from 'fedipub'
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
defaults: &defaults
|
|
3
|
+
app_name:
|
|
4
|
+
app_version:
|
|
5
|
+
force_ssl: false
|
|
6
|
+
site_host: http://localhost
|
|
7
|
+
site_port: 3000
|
|
8
|
+
enable_discovery: true
|
|
9
|
+
open_registrations: false
|
|
10
|
+
app_layout: 'layouts/application'
|
|
11
|
+
server_routes_path: federation
|
|
12
|
+
client_routes_path: app
|
|
13
|
+
job_queue: default
|
|
14
|
+
#remote_entities_cache_duration: 86400 # 1 day in seconds
|
|
15
|
+
#base_client_controller: ::ActionController::Base
|
|
16
|
+
|
|
17
|
+
development:
|
|
18
|
+
<<: *defaults
|
|
19
|
+
|
|
20
|
+
test:
|
|
21
|
+
<<: *defaults
|
|
22
|
+
site_port: null
|
|
23
|
+
|
|
24
|
+
production:
|
|
25
|
+
<<: *defaults
|
|
26
|
+
force_ssl: true
|
|
27
|
+
site_port: 443
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
namespace :factory_bot do
|
|
2
|
+
desc 'Verify that all FactoryBot factories are valid'
|
|
3
|
+
task lint: :environment do
|
|
4
|
+
if Rails.env.test?
|
|
5
|
+
conn = ActiveRecord::Base.connection
|
|
6
|
+
conn.transaction do
|
|
7
|
+
FactoryBot.lint traits: true
|
|
8
|
+
raise ActiveRecord::Rollback
|
|
9
|
+
end
|
|
10
|
+
else
|
|
11
|
+
system("bundle exec rake app:factory_bot:lint RAILS_ENV='test'")
|
|
12
|
+
raise if $CHILD_STATUS.exitstatus.nonzero?
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
namespace :fedipub do
|
|
2
|
+
desc 'Re-fetches every remote actors to update database'
|
|
3
|
+
task sync_actors: :environment do
|
|
4
|
+
Fedipub::Maintenance::ActorUpdater.run do |actor, status|
|
|
5
|
+
puts "#{actor.federated_url}: #{status}"
|
|
6
|
+
end
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
desc 'Re-fetches every host and completes missing ones'
|
|
10
|
+
task sync_hosts: :environment do
|
|
11
|
+
Fedipub::Maintenance::HostsUpdater.run
|
|
12
|
+
end
|
|
13
|
+
end
|
metadata
CHANGED
|
@@ -1,15 +1,140 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: fedipub
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0
|
|
4
|
+
version: 0.9.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Manuel Tancoigne
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
12
|
-
dependencies:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
|
+
dependencies:
|
|
12
|
+
- !ruby/object:Gem::Dependency
|
|
13
|
+
name: faraday
|
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
|
15
|
+
requirements:
|
|
16
|
+
- - ">="
|
|
17
|
+
- !ruby/object:Gem::Version
|
|
18
|
+
version: '0'
|
|
19
|
+
type: :runtime
|
|
20
|
+
prerelease: false
|
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
22
|
+
requirements:
|
|
23
|
+
- - ">="
|
|
24
|
+
- !ruby/object:Gem::Version
|
|
25
|
+
version: '0'
|
|
26
|
+
- !ruby/object:Gem::Dependency
|
|
27
|
+
name: faraday-follow_redirects
|
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
|
29
|
+
requirements:
|
|
30
|
+
- - ">="
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: '0'
|
|
33
|
+
type: :runtime
|
|
34
|
+
prerelease: false
|
|
35
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
36
|
+
requirements:
|
|
37
|
+
- - ">="
|
|
38
|
+
- !ruby/object:Gem::Version
|
|
39
|
+
version: '0'
|
|
40
|
+
- !ruby/object:Gem::Dependency
|
|
41
|
+
name: jbuilder
|
|
42
|
+
requirement: !ruby/object:Gem::Requirement
|
|
43
|
+
requirements:
|
|
44
|
+
- - "~>"
|
|
45
|
+
- !ruby/object:Gem::Version
|
|
46
|
+
version: '2.7'
|
|
47
|
+
type: :runtime
|
|
48
|
+
prerelease: false
|
|
49
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
50
|
+
requirements:
|
|
51
|
+
- - "~>"
|
|
52
|
+
- !ruby/object:Gem::Version
|
|
53
|
+
version: '2.7'
|
|
54
|
+
- !ruby/object:Gem::Dependency
|
|
55
|
+
name: json-ld
|
|
56
|
+
requirement: !ruby/object:Gem::Requirement
|
|
57
|
+
requirements:
|
|
58
|
+
- - ">="
|
|
59
|
+
- !ruby/object:Gem::Version
|
|
60
|
+
version: 3.2.0
|
|
61
|
+
type: :runtime
|
|
62
|
+
prerelease: false
|
|
63
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
64
|
+
requirements:
|
|
65
|
+
- - ">="
|
|
66
|
+
- !ruby/object:Gem::Version
|
|
67
|
+
version: 3.2.0
|
|
68
|
+
- !ruby/object:Gem::Dependency
|
|
69
|
+
name: json-ld-preloaded
|
|
70
|
+
requirement: !ruby/object:Gem::Requirement
|
|
71
|
+
requirements:
|
|
72
|
+
- - ">="
|
|
73
|
+
- !ruby/object:Gem::Version
|
|
74
|
+
version: 3.2.0
|
|
75
|
+
type: :runtime
|
|
76
|
+
prerelease: false
|
|
77
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
78
|
+
requirements:
|
|
79
|
+
- - ">="
|
|
80
|
+
- !ruby/object:Gem::Version
|
|
81
|
+
version: 3.2.0
|
|
82
|
+
- !ruby/object:Gem::Dependency
|
|
83
|
+
name: kaminari
|
|
84
|
+
requirement: !ruby/object:Gem::Requirement
|
|
85
|
+
requirements:
|
|
86
|
+
- - ">="
|
|
87
|
+
- !ruby/object:Gem::Version
|
|
88
|
+
version: 1.2.0
|
|
89
|
+
type: :runtime
|
|
90
|
+
prerelease: false
|
|
91
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
92
|
+
requirements:
|
|
93
|
+
- - ">="
|
|
94
|
+
- !ruby/object:Gem::Version
|
|
95
|
+
version: 1.2.0
|
|
96
|
+
- !ruby/object:Gem::Dependency
|
|
97
|
+
name: ostruct
|
|
98
|
+
requirement: !ruby/object:Gem::Requirement
|
|
99
|
+
requirements:
|
|
100
|
+
- - ">="
|
|
101
|
+
- !ruby/object:Gem::Version
|
|
102
|
+
version: 0.6.3
|
|
103
|
+
type: :runtime
|
|
104
|
+
prerelease: false
|
|
105
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
106
|
+
requirements:
|
|
107
|
+
- - ">="
|
|
108
|
+
- !ruby/object:Gem::Version
|
|
109
|
+
version: 0.6.3
|
|
110
|
+
- !ruby/object:Gem::Dependency
|
|
111
|
+
name: pundit
|
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
|
113
|
+
requirements:
|
|
114
|
+
- - ">="
|
|
115
|
+
- !ruby/object:Gem::Version
|
|
116
|
+
version: 2.3.0
|
|
117
|
+
type: :runtime
|
|
118
|
+
prerelease: false
|
|
119
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
120
|
+
requirements:
|
|
121
|
+
- - ">="
|
|
122
|
+
- !ruby/object:Gem::Version
|
|
123
|
+
version: 2.3.0
|
|
124
|
+
- !ruby/object:Gem::Dependency
|
|
125
|
+
name: rails
|
|
126
|
+
requirement: !ruby/object:Gem::Requirement
|
|
127
|
+
requirements:
|
|
128
|
+
- - ">="
|
|
129
|
+
- !ruby/object:Gem::Version
|
|
130
|
+
version: 7.2.0
|
|
131
|
+
type: :runtime
|
|
132
|
+
prerelease: false
|
|
133
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
134
|
+
requirements:
|
|
135
|
+
- - ">="
|
|
136
|
+
- !ruby/object:Gem::Version
|
|
137
|
+
version: 7.2.0
|
|
13
138
|
description: An ActivityPub engine for Ruby on Rails
|
|
14
139
|
email:
|
|
15
140
|
- manu@experimentslabs.com
|
|
@@ -20,17 +145,142 @@ files:
|
|
|
20
145
|
- LICENSE
|
|
21
146
|
- README.md
|
|
22
147
|
- Rakefile
|
|
148
|
+
- app/assets/config/fedipub_manifest.js
|
|
149
|
+
- app/assets/stylesheets/fedipub/application.css
|
|
150
|
+
- app/controllers/concerns/fedipub/server/render_collections.rb
|
|
151
|
+
- app/controllers/fedipub/client/activities_controller.rb
|
|
152
|
+
- app/controllers/fedipub/client/actors_controller.rb
|
|
153
|
+
- app/controllers/fedipub/client/followings_controller.rb
|
|
154
|
+
- app/controllers/fedipub/client_controller.rb
|
|
155
|
+
- app/controllers/fedipub/server/activities_controller.rb
|
|
156
|
+
- app/controllers/fedipub/server/actors_controller.rb
|
|
157
|
+
- app/controllers/fedipub/server/followings_controller.rb
|
|
158
|
+
- app/controllers/fedipub/server/nodeinfo_controller.rb
|
|
159
|
+
- app/controllers/fedipub/server/published_controller.rb
|
|
160
|
+
- app/controllers/fedipub/server/web_finger_controller.rb
|
|
161
|
+
- app/controllers/fedipub/server_controller.rb
|
|
162
|
+
- app/helpers/fedipub/server_helper.rb
|
|
163
|
+
- app/jobs/fedipub/application_job.rb
|
|
164
|
+
- app/jobs/fedipub/fetch_nodeinfo_job.rb
|
|
165
|
+
- app/jobs/fedipub/notify_inbox_job.rb
|
|
166
|
+
- app/mailers/fedipub/application_mailer.rb
|
|
167
|
+
- app/models/concerns/fedipub/actor_entity.rb
|
|
168
|
+
- app/models/concerns/fedipub/announceable.rb
|
|
169
|
+
- app/models/concerns/fedipub/data_entity.rb
|
|
170
|
+
- app/models/concerns/fedipub/handles_delete_requests.rb
|
|
171
|
+
- app/models/concerns/fedipub/has_uuid.rb
|
|
172
|
+
- app/models/concerns/fedipub/likeable.rb
|
|
173
|
+
- app/models/fedipub/activity.rb
|
|
174
|
+
- app/models/fedipub/actor.rb
|
|
175
|
+
- app/models/fedipub/application_record.rb
|
|
176
|
+
- app/models/fedipub/following.rb
|
|
177
|
+
- app/models/fedipub/host.rb
|
|
178
|
+
- app/policies/fedipub/client/activity_policy.rb
|
|
179
|
+
- app/policies/fedipub/client/actor_policy.rb
|
|
180
|
+
- app/policies/fedipub/client/following_policy.rb
|
|
181
|
+
- app/policies/fedipub/fedipub_policy.rb
|
|
182
|
+
- app/policies/fedipub/server/activity_policy.rb
|
|
183
|
+
- app/policies/fedipub/server/actor_policy.rb
|
|
184
|
+
- app/policies/fedipub/server/following_policy.rb
|
|
185
|
+
- app/policies/fedipub/server/publishable_policy.rb
|
|
186
|
+
- app/views/fedipub/client/activities/_activity.html.erb
|
|
187
|
+
- app/views/fedipub/client/activities/_activity.json.jbuilder
|
|
188
|
+
- app/views/fedipub/client/activities/_index.json.jbuilder
|
|
189
|
+
- app/views/fedipub/client/activities/feed.html.erb
|
|
190
|
+
- app/views/fedipub/client/activities/feed.json.jbuilder
|
|
191
|
+
- app/views/fedipub/client/activities/index.html.erb
|
|
192
|
+
- app/views/fedipub/client/activities/index.json.jbuilder
|
|
193
|
+
- app/views/fedipub/client/actors/_actor.json.jbuilder
|
|
194
|
+
- app/views/fedipub/client/actors/_lookup_form.html.erb
|
|
195
|
+
- app/views/fedipub/client/actors/gone.html.erb
|
|
196
|
+
- app/views/fedipub/client/actors/index.html.erb
|
|
197
|
+
- app/views/fedipub/client/actors/index.json.jbuilder
|
|
198
|
+
- app/views/fedipub/client/actors/show.html.erb
|
|
199
|
+
- app/views/fedipub/client/actors/show.json.jbuilder
|
|
200
|
+
- app/views/fedipub/client/common/_client_links.html.erb
|
|
201
|
+
- app/views/fedipub/client/followings/_follow.html.erb
|
|
202
|
+
- app/views/fedipub/client/followings/_follow_actions.html.erb
|
|
203
|
+
- app/views/fedipub/client/followings/_follower.html.erb
|
|
204
|
+
- app/views/fedipub/client/followings/_following.json.jbuilder
|
|
205
|
+
- app/views/fedipub/client/followings/_form.html.erb
|
|
206
|
+
- app/views/fedipub/client/followings/index.html.erb
|
|
207
|
+
- app/views/fedipub/client/followings/index.json.jbuilder
|
|
208
|
+
- app/views/fedipub/client/followings/show.html.erb
|
|
209
|
+
- app/views/fedipub/client/followings/show.json.jbuilder
|
|
210
|
+
- app/views/fedipub/server/activities/_activity.activitypub.jbuilder
|
|
211
|
+
- app/views/fedipub/server/activities/show.activitypub.jbuilder
|
|
212
|
+
- app/views/fedipub/server/actors/_actor.activitypub.jbuilder
|
|
213
|
+
- app/views/fedipub/server/actors/_tombstone.activitypub.jbuilder
|
|
214
|
+
- app/views/fedipub/server/actors/show.activitypub.jbuilder
|
|
215
|
+
- app/views/fedipub/server/followings/_following.activitypub.jbuilder
|
|
216
|
+
- app/views/fedipub/server/followings/show.activitypub.jbuilder
|
|
217
|
+
- app/views/fedipub/server/nodeinfo/index.nodeinfo.jbuilder
|
|
218
|
+
- app/views/fedipub/server/nodeinfo/show.nodeinfo.jbuilder
|
|
219
|
+
- app/views/fedipub/server/published/_publishable.activitypub.jbuilder
|
|
220
|
+
- app/views/fedipub/server/published/_tombstone.activitypub.jbuilder
|
|
221
|
+
- app/views/fedipub/server/published/show.activitypub.jbuilder
|
|
222
|
+
- app/views/fedipub/server/shared/ordered_collection.activitypub.jbuilder
|
|
223
|
+
- app/views/fedipub/server/shared/ordered_collection_page.activitypub.jbuilder
|
|
224
|
+
- app/views/fedipub/server/web_finger/find.jrd.jbuilder
|
|
225
|
+
- app/views/fedipub/server/web_finger/host_meta.xrd.erb
|
|
226
|
+
- app/views/users/show.html.erb
|
|
227
|
+
- config/initializers/mime_types.rb
|
|
228
|
+
- config/initializers/security_vocab.rb
|
|
229
|
+
- config/routes.rb
|
|
230
|
+
- db/migrate/20200712133150_create_federails_actors.rb
|
|
231
|
+
- db/migrate/20200712143127_create_federails_followings.rb
|
|
232
|
+
- db/migrate/20200712174938_create_federails_activities.rb
|
|
233
|
+
- db/migrate/20241002094500_add_uuids.rb
|
|
234
|
+
- db/migrate/20241002094501_add_keypair_to_actors.rb
|
|
235
|
+
- db/migrate/20250122160618_add_extensions_to_federails_actors.rb
|
|
236
|
+
- db/migrate/20250301082500_add_local_to_actors.rb
|
|
237
|
+
- db/migrate/20250329123939_add_actor_type_to_actors.rb
|
|
238
|
+
- db/migrate/20250329123940_add_tombstoned_at_to_actors.rb
|
|
239
|
+
- db/migrate/20250426061729_create_federails_hosts.rb
|
|
240
|
+
- db/migrate/20251121160720_add_to_and_cc_to_federails_activities.rb
|
|
241
|
+
- db/migrate/20260421170640_add_result_and_instrument_to_federails_activities.rb
|
|
242
|
+
- db/migrate/20260723113716_rename_federails_to_fedipub.rb
|
|
23
243
|
- lib/fedipub.rb
|
|
244
|
+
- lib/fedipub/configuration.rb
|
|
245
|
+
- lib/fedipub/data_transformer/note.rb
|
|
246
|
+
- lib/fedipub/engine.rb
|
|
247
|
+
- lib/fedipub/maintenance/actors_updater.rb
|
|
248
|
+
- lib/fedipub/maintenance/hosts_updater.rb
|
|
249
|
+
- lib/fedipub/utils/actor.rb
|
|
250
|
+
- lib/fedipub/utils/context.rb
|
|
251
|
+
- lib/fedipub/utils/host.rb
|
|
252
|
+
- lib/fedipub/utils/json_request.rb
|
|
253
|
+
- lib/fedipub/utils/object.rb
|
|
254
|
+
- lib/fedipub/utils/response_codes.rb
|
|
24
255
|
- lib/fedipub/version.rb
|
|
25
|
-
|
|
256
|
+
- lib/fediverse.rb
|
|
257
|
+
- lib/fediverse/collection.rb
|
|
258
|
+
- lib/fediverse/inbox.rb
|
|
259
|
+
- lib/fediverse/node_info.rb
|
|
260
|
+
- lib/fediverse/notifier.rb
|
|
261
|
+
- lib/fediverse/request.rb
|
|
262
|
+
- lib/fediverse/signature.rb
|
|
263
|
+
- lib/fediverse/webfinger.rb
|
|
264
|
+
- lib/generators/fedipub/copy_client_policies/USAGE
|
|
265
|
+
- lib/generators/fedipub/copy_client_policies/copy_client_policies_generator.rb
|
|
266
|
+
- lib/generators/fedipub/copy_client_views/USAGE
|
|
267
|
+
- lib/generators/fedipub/copy_client_views/copy_client_views_generator.rb
|
|
268
|
+
- lib/generators/fedipub/copy_factories/USAGE
|
|
269
|
+
- lib/generators/fedipub/copy_factories/copy_factories_generator.rb
|
|
270
|
+
- lib/generators/fedipub/install/USAGE
|
|
271
|
+
- lib/generators/fedipub/install/install_generator.rb
|
|
272
|
+
- lib/generators/fedipub/install/templates/fedipub.rb
|
|
273
|
+
- lib/generators/fedipub/install/templates/fedipub.yml
|
|
274
|
+
- lib/tasks/factory_bot.rake
|
|
275
|
+
- lib/tasks/fedipub_tasks.rake
|
|
276
|
+
homepage: https://experimentslabs.com
|
|
26
277
|
licenses:
|
|
27
278
|
- MIT
|
|
28
279
|
metadata:
|
|
29
280
|
rubygems_mfa_required: 'true'
|
|
30
|
-
homepage_uri: https://
|
|
281
|
+
homepage_uri: https://experimentslabs.com
|
|
31
282
|
source_code_uri: https://gitlab.com/fedipub/fedipub/
|
|
32
283
|
changelog_uri: https://gitlab.com/fedipub/fedipub/-/blob/main/CHANGELOG.md
|
|
33
|
-
post_install_message:
|
|
34
284
|
rdoc_options: []
|
|
35
285
|
require_paths:
|
|
36
286
|
- lib
|
|
@@ -38,15 +288,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
38
288
|
requirements:
|
|
39
289
|
- - ">="
|
|
40
290
|
- !ruby/object:Gem::Version
|
|
41
|
-
version: 3.
|
|
291
|
+
version: 3.3.0
|
|
42
292
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
43
293
|
requirements:
|
|
44
294
|
- - ">="
|
|
45
295
|
- !ruby/object:Gem::Version
|
|
46
296
|
version: '0'
|
|
47
297
|
requirements: []
|
|
48
|
-
rubygems_version: 3.
|
|
49
|
-
signing_key:
|
|
298
|
+
rubygems_version: 3.6.9
|
|
50
299
|
specification_version: 4
|
|
51
300
|
summary: An ActivityPub engine for Ruby on Rails
|
|
52
301
|
test_files: []
|