fedipub 0.9.0 → 0.11.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 +7 -1
- data/app/controllers/concerns/fedipub/rails/server/render_collections.rb +21 -0
- data/app/controllers/fedipub/rails/client/activities_controller.rb +29 -0
- data/app/controllers/fedipub/rails/client/actors_controller.rb +56 -0
- data/app/controllers/fedipub/rails/client/followings_controller.rb +105 -0
- data/app/controllers/fedipub/rails/client_controller.rb +11 -0
- data/app/controllers/fedipub/rails/server/activities_controller.rb +80 -0
- data/app/controllers/fedipub/rails/server/actors_controller.rb +52 -0
- data/app/controllers/fedipub/rails/server/approval_stamps_controller.rb +15 -0
- data/app/controllers/fedipub/rails/server/followings_controller.rb +21 -0
- data/app/controllers/fedipub/rails/server/nodeinfo_controller.rb +30 -0
- data/app/controllers/fedipub/rails/server/published_controller.rb +32 -0
- data/app/controllers/fedipub/rails/server/web_finger_controller.rb +46 -0
- data/app/controllers/fedipub/rails/server_controller.rb +48 -0
- data/app/helpers/fedipub/rails/server_helper.rb +16 -0
- data/app/jobs/fedipub/application_job.rb +1 -1
- data/app/models/concerns/fedipub/actor_entity.rb +1 -125
- data/app/models/concerns/fedipub/data_entity.rb +5 -105
- data/app/models/fedipub/activity.rb +1 -0
- data/app/models/fedipub/actor.rb +28 -22
- data/app/models/fedipub/approval_stamp.rb +38 -0
- data/app/models/fedipub/host.rb +2 -2
- data/app/policies/fedipub/server/approval_stamp_policy.rb +9 -0
- data/app/views/fedipub/rails/client/activities/_index.json.jbuilder +1 -0
- data/app/views/fedipub/rails/client/activities/feed.json.jbuilder +1 -0
- data/app/views/fedipub/rails/client/activities/index.json.jbuilder +1 -0
- data/app/views/fedipub/{client → rails/client}/actors/_actor.json.jbuilder +1 -0
- data/app/views/fedipub/rails/client/actors/index.json.jbuilder +1 -0
- data/app/views/fedipub/{client → rails/client}/actors/show.html.erb +10 -5
- data/app/views/fedipub/rails/client/actors/show.json.jbuilder +1 -0
- data/app/views/fedipub/rails/client/followings/index.json.jbuilder +1 -0
- data/app/views/fedipub/rails/client/followings/show.json.jbuilder +1 -0
- data/app/views/fedipub/{server → rails/server}/activities/_activity.activitypub.jbuilder +2 -2
- data/app/views/fedipub/rails/server/activities/show.activitypub.jbuilder +1 -0
- data/app/views/fedipub/{server → rails/server}/actors/_actor.activitypub.jbuilder +14 -7
- data/app/views/fedipub/{server → rails/server}/actors/_tombstone.activitypub.jbuilder +1 -1
- data/app/views/fedipub/rails/server/actors/show.activitypub.jbuilder +5 -0
- data/app/views/fedipub/rails/server/approval_stamps/show.activitypub.jbuilder +8 -0
- data/app/views/fedipub/{server → rails/server}/followings/_following.activitypub.jbuilder +1 -1
- data/app/views/fedipub/rails/server/followings/show.activitypub.jbuilder +1 -0
- data/app/views/fedipub/rails/server/nodeinfo/index.nodeinfo.jbuilder +10 -0
- data/app/views/fedipub/rails/server/published/_publishable.activitypub.jbuilder +20 -0
- data/app/views/fedipub/{server → rails/server}/published/_tombstone.activitypub.jbuilder +1 -1
- data/app/views/fedipub/rails/server/published/show.activitypub.jbuilder +5 -0
- data/app/views/fedipub/{server → rails/server}/shared/ordered_collection.activitypub.jbuilder +1 -1
- data/app/views/fedipub/{server → rails/server}/shared/ordered_collection_page.activitypub.jbuilder +1 -1
- data/app/views/fedipub/{server → rails/server}/web_finger/find.jrd.jbuilder +11 -3
- data/config/initializers/logger.rb +2 -0
- data/config/initializers/miscellany.rb +21 -0
- data/config/initializers/security_vocab.rb +1 -0
- data/config/routes.rb +8 -7
- data/db/migrate/20260922155524_create_fedipub_approval_stamps.rb +12 -0
- data/db/migrate/20260924090802_add_shared_inbox_url_to_fedipub_actors.rb +5 -0
- data/lib/fedipub/activity_handlers/accept_follow_handler.rb +17 -0
- data/lib/fedipub/activity_handlers/delete_handler.rb +13 -0
- data/lib/fedipub/activity_handlers/follow_handler.rb +13 -0
- data/lib/fedipub/activity_handlers/quote_request_handler.rb +33 -0
- data/lib/fedipub/activity_handlers/undo_delete_handler.rb +15 -0
- data/lib/fedipub/activity_handlers/undo_follow_handler.rb +16 -0
- data/lib/fedipub/concerns/announceable.rb +23 -0
- data/lib/fedipub/concerns/application_actor.rb +30 -0
- data/lib/fedipub/concerns/generic_actor_entity.rb +135 -0
- data/lib/fedipub/concerns/generic_data_entity.rb +112 -0
- data/lib/fedipub/concerns/handles_delete_requests.rb +42 -0
- data/lib/fedipub/concerns/has_interaction_policy.rb +85 -0
- data/lib/fedipub/concerns/likeable.rb +34 -0
- data/lib/fedipub/concerns/quote_request.rb +42 -0
- data/lib/fedipub/data_transformer/note.rb +3 -2
- data/lib/fedipub/errors.rb +10 -0
- data/lib/fedipub/features.rb +13 -0
- data/lib/fedipub/logger.rb +42 -0
- data/lib/fedipub/utils/context.rb +30 -5
- data/lib/fedipub/utils/host.rb +1 -1
- data/lib/fedipub/utils/json_request.rb +63 -17
- data/lib/fedipub/utils/object.rb +1 -1
- data/lib/fedipub/version.rb +1 -1
- data/lib/fedipub.rb +14 -1
- data/lib/fediverse/collection.rb +1 -5
- data/lib/fediverse/inbox.rb +16 -51
- data/lib/fediverse/node_info.rb +2 -5
- data/lib/fediverse/notifier.rb +12 -39
- data/lib/fediverse/signature/draft_cavage12.rb +109 -0
- data/lib/fediverse/signature/rfc9421.rb +69 -0
- data/lib/fediverse/signature.rb +14 -39
- data/lib/fediverse/webfinger.rb +19 -18
- data/lib/generators/fedipub/copy_client_policies/USAGE +1 -1
- data/lib/generators/fedipub/copy_client_policies/copy_client_policies_generator.rb +2 -2
- data/lib/generators/fedipub/copy_client_views/USAGE +1 -1
- data/lib/generators/fedipub/copy_client_views/copy_client_views_generator.rb +2 -2
- data/lib/generators/fedipub/copy_factories/copy_factories_generator.rb +2 -2
- data/lib/generators/fedipub/install/install_generator.rb +3 -3
- metadata +109 -61
- data/app/assets/config/fedipub_manifest.js +0 -1
- data/app/assets/stylesheets/fedipub/application.css +0 -15
- data/app/controllers/concerns/fedipub/server/render_collections.rb +0 -19
- data/app/controllers/fedipub/client/activities_controller.rb +0 -27
- data/app/controllers/fedipub/client/actors_controller.rb +0 -54
- data/app/controllers/fedipub/client/followings_controller.rb +0 -103
- data/app/controllers/fedipub/client_controller.rb +0 -9
- data/app/controllers/fedipub/server/activities_controller.rb +0 -78
- data/app/controllers/fedipub/server/actors_controller.rb +0 -50
- data/app/controllers/fedipub/server/followings_controller.rb +0 -19
- data/app/controllers/fedipub/server/nodeinfo_controller.rb +0 -28
- data/app/controllers/fedipub/server/published_controller.rb +0 -30
- data/app/controllers/fedipub/server/web_finger_controller.rb +0 -45
- data/app/controllers/fedipub/server_controller.rb +0 -37
- data/app/helpers/fedipub/server_helper.rb +0 -18
- data/app/mailers/fedipub/application_mailer.rb +0 -6
- data/app/models/concerns/fedipub/announceable.rb +0 -18
- data/app/models/concerns/fedipub/handles_delete_requests.rb +0 -36
- data/app/models/concerns/fedipub/likeable.rb +0 -29
- data/app/views/fedipub/client/activities/_index.json.jbuilder +0 -1
- data/app/views/fedipub/client/activities/feed.json.jbuilder +0 -1
- data/app/views/fedipub/client/activities/index.json.jbuilder +0 -1
- data/app/views/fedipub/client/actors/index.json.jbuilder +0 -1
- data/app/views/fedipub/client/actors/show.json.jbuilder +0 -1
- data/app/views/fedipub/client/followings/index.json.jbuilder +0 -1
- data/app/views/fedipub/client/followings/show.json.jbuilder +0 -1
- data/app/views/fedipub/server/activities/show.activitypub.jbuilder +0 -1
- data/app/views/fedipub/server/actors/show.activitypub.jbuilder +0 -5
- data/app/views/fedipub/server/followings/show.activitypub.jbuilder +0 -1
- data/app/views/fedipub/server/nodeinfo/index.nodeinfo.jbuilder +0 -6
- data/app/views/fedipub/server/published/_publishable.activitypub.jbuilder +0 -11
- data/app/views/fedipub/server/published/show.activitypub.jbuilder +0 -5
- data/app/views/users/show.html.erb +0 -4
- /data/app/views/fedipub/{client → rails/client}/activities/_activity.html.erb +0 -0
- /data/app/views/fedipub/{client → rails/client}/activities/_activity.json.jbuilder +0 -0
- /data/app/views/fedipub/{client → rails/client}/activities/feed.html.erb +0 -0
- /data/app/views/fedipub/{client → rails/client}/activities/index.html.erb +0 -0
- /data/app/views/fedipub/{client → rails/client}/actors/_lookup_form.html.erb +0 -0
- /data/app/views/fedipub/{client → rails/client}/actors/gone.html.erb +0 -0
- /data/app/views/fedipub/{client → rails/client}/actors/index.html.erb +0 -0
- /data/app/views/fedipub/{client → rails/client}/common/_client_links.html.erb +0 -0
- /data/app/views/fedipub/{client → rails/client}/followings/_follow.html.erb +0 -0
- /data/app/views/fedipub/{client → rails/client}/followings/_follow_actions.html.erb +0 -0
- /data/app/views/fedipub/{client → rails/client}/followings/_follower.html.erb +0 -0
- /data/app/views/fedipub/{client → rails/client}/followings/_following.json.jbuilder +0 -0
- /data/app/views/fedipub/{client → rails/client}/followings/_form.html.erb +0 -0
- /data/app/views/fedipub/{client → rails/client}/followings/index.html.erb +0 -0
- /data/app/views/fedipub/{client → rails/client}/followings/show.html.erb +0 -0
- /data/app/views/fedipub/{server → rails/server}/nodeinfo/show.nodeinfo.jbuilder +0 -0
- /data/app/views/fedipub/{server → rails/server}/web_finger/host_meta.xrd.erb +0 -0
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: fedipub
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.11.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Manuel Tancoigne
|
|
@@ -51,6 +51,20 @@ dependencies:
|
|
|
51
51
|
- - "~>"
|
|
52
52
|
- !ruby/object:Gem::Version
|
|
53
53
|
version: '2.7'
|
|
54
|
+
- !ruby/object:Gem::Dependency
|
|
55
|
+
name: json
|
|
56
|
+
requirement: !ruby/object:Gem::Requirement
|
|
57
|
+
requirements:
|
|
58
|
+
- - "~>"
|
|
59
|
+
- !ruby/object:Gem::Version
|
|
60
|
+
version: '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: '2.0'
|
|
54
68
|
- !ruby/object:Gem::Dependency
|
|
55
69
|
name: json-ld
|
|
56
70
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -93,6 +107,20 @@ dependencies:
|
|
|
93
107
|
- - ">="
|
|
94
108
|
- !ruby/object:Gem::Version
|
|
95
109
|
version: 1.2.0
|
|
110
|
+
- !ruby/object:Gem::Dependency
|
|
111
|
+
name: linzer
|
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
|
113
|
+
requirements:
|
|
114
|
+
- - "~>"
|
|
115
|
+
- !ruby/object:Gem::Version
|
|
116
|
+
version: '0.8'
|
|
117
|
+
type: :runtime
|
|
118
|
+
prerelease: false
|
|
119
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
120
|
+
requirements:
|
|
121
|
+
- - "~>"
|
|
122
|
+
- !ruby/object:Gem::Version
|
|
123
|
+
version: '0.8'
|
|
96
124
|
- !ruby/object:Gem::Dependency
|
|
97
125
|
name: ostruct
|
|
98
126
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -145,34 +173,30 @@ files:
|
|
|
145
173
|
- LICENSE
|
|
146
174
|
- README.md
|
|
147
175
|
- Rakefile
|
|
148
|
-
- app/
|
|
149
|
-
- app/
|
|
150
|
-
- app/controllers/
|
|
151
|
-
- app/controllers/fedipub/client/
|
|
152
|
-
- app/controllers/fedipub/
|
|
153
|
-
- app/controllers/fedipub/
|
|
154
|
-
- app/controllers/fedipub/
|
|
155
|
-
- app/controllers/fedipub/server/
|
|
156
|
-
- app/controllers/fedipub/server/
|
|
157
|
-
- app/controllers/fedipub/server/
|
|
158
|
-
- app/controllers/fedipub/server/
|
|
159
|
-
- app/controllers/fedipub/server/
|
|
160
|
-
- app/controllers/fedipub/
|
|
161
|
-
- app/
|
|
162
|
-
- app/helpers/fedipub/server_helper.rb
|
|
176
|
+
- app/controllers/concerns/fedipub/rails/server/render_collections.rb
|
|
177
|
+
- app/controllers/fedipub/rails/client/activities_controller.rb
|
|
178
|
+
- app/controllers/fedipub/rails/client/actors_controller.rb
|
|
179
|
+
- app/controllers/fedipub/rails/client/followings_controller.rb
|
|
180
|
+
- app/controllers/fedipub/rails/client_controller.rb
|
|
181
|
+
- app/controllers/fedipub/rails/server/activities_controller.rb
|
|
182
|
+
- app/controllers/fedipub/rails/server/actors_controller.rb
|
|
183
|
+
- app/controllers/fedipub/rails/server/approval_stamps_controller.rb
|
|
184
|
+
- app/controllers/fedipub/rails/server/followings_controller.rb
|
|
185
|
+
- app/controllers/fedipub/rails/server/nodeinfo_controller.rb
|
|
186
|
+
- app/controllers/fedipub/rails/server/published_controller.rb
|
|
187
|
+
- app/controllers/fedipub/rails/server/web_finger_controller.rb
|
|
188
|
+
- app/controllers/fedipub/rails/server_controller.rb
|
|
189
|
+
- app/helpers/fedipub/rails/server_helper.rb
|
|
163
190
|
- app/jobs/fedipub/application_job.rb
|
|
164
191
|
- app/jobs/fedipub/fetch_nodeinfo_job.rb
|
|
165
192
|
- app/jobs/fedipub/notify_inbox_job.rb
|
|
166
|
-
- app/mailers/fedipub/application_mailer.rb
|
|
167
193
|
- app/models/concerns/fedipub/actor_entity.rb
|
|
168
|
-
- app/models/concerns/fedipub/announceable.rb
|
|
169
194
|
- app/models/concerns/fedipub/data_entity.rb
|
|
170
|
-
- app/models/concerns/fedipub/handles_delete_requests.rb
|
|
171
195
|
- app/models/concerns/fedipub/has_uuid.rb
|
|
172
|
-
- app/models/concerns/fedipub/likeable.rb
|
|
173
196
|
- app/models/fedipub/activity.rb
|
|
174
197
|
- app/models/fedipub/actor.rb
|
|
175
198
|
- app/models/fedipub/application_record.rb
|
|
199
|
+
- app/models/fedipub/approval_stamp.rb
|
|
176
200
|
- app/models/fedipub/following.rb
|
|
177
201
|
- app/models/fedipub/host.rb
|
|
178
202
|
- app/policies/fedipub/client/activity_policy.rb
|
|
@@ -181,50 +205,53 @@ files:
|
|
|
181
205
|
- app/policies/fedipub/fedipub_policy.rb
|
|
182
206
|
- app/policies/fedipub/server/activity_policy.rb
|
|
183
207
|
- app/policies/fedipub/server/actor_policy.rb
|
|
208
|
+
- app/policies/fedipub/server/approval_stamp_policy.rb
|
|
184
209
|
- app/policies/fedipub/server/following_policy.rb
|
|
185
210
|
- 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/
|
|
216
|
-
- app/views/fedipub/server/followings/
|
|
217
|
-
- app/views/fedipub/server/
|
|
218
|
-
- app/views/fedipub/server/nodeinfo/
|
|
219
|
-
- app/views/fedipub/server/
|
|
220
|
-
- app/views/fedipub/server/published/
|
|
221
|
-
- app/views/fedipub/server/published/
|
|
222
|
-
- app/views/fedipub/server/
|
|
223
|
-
- app/views/fedipub/server/shared/
|
|
224
|
-
- app/views/fedipub/server/
|
|
225
|
-
- app/views/fedipub/server/web_finger/
|
|
226
|
-
- app/views/
|
|
211
|
+
- app/views/fedipub/rails/client/activities/_activity.html.erb
|
|
212
|
+
- app/views/fedipub/rails/client/activities/_activity.json.jbuilder
|
|
213
|
+
- app/views/fedipub/rails/client/activities/_index.json.jbuilder
|
|
214
|
+
- app/views/fedipub/rails/client/activities/feed.html.erb
|
|
215
|
+
- app/views/fedipub/rails/client/activities/feed.json.jbuilder
|
|
216
|
+
- app/views/fedipub/rails/client/activities/index.html.erb
|
|
217
|
+
- app/views/fedipub/rails/client/activities/index.json.jbuilder
|
|
218
|
+
- app/views/fedipub/rails/client/actors/_actor.json.jbuilder
|
|
219
|
+
- app/views/fedipub/rails/client/actors/_lookup_form.html.erb
|
|
220
|
+
- app/views/fedipub/rails/client/actors/gone.html.erb
|
|
221
|
+
- app/views/fedipub/rails/client/actors/index.html.erb
|
|
222
|
+
- app/views/fedipub/rails/client/actors/index.json.jbuilder
|
|
223
|
+
- app/views/fedipub/rails/client/actors/show.html.erb
|
|
224
|
+
- app/views/fedipub/rails/client/actors/show.json.jbuilder
|
|
225
|
+
- app/views/fedipub/rails/client/common/_client_links.html.erb
|
|
226
|
+
- app/views/fedipub/rails/client/followings/_follow.html.erb
|
|
227
|
+
- app/views/fedipub/rails/client/followings/_follow_actions.html.erb
|
|
228
|
+
- app/views/fedipub/rails/client/followings/_follower.html.erb
|
|
229
|
+
- app/views/fedipub/rails/client/followings/_following.json.jbuilder
|
|
230
|
+
- app/views/fedipub/rails/client/followings/_form.html.erb
|
|
231
|
+
- app/views/fedipub/rails/client/followings/index.html.erb
|
|
232
|
+
- app/views/fedipub/rails/client/followings/index.json.jbuilder
|
|
233
|
+
- app/views/fedipub/rails/client/followings/show.html.erb
|
|
234
|
+
- app/views/fedipub/rails/client/followings/show.json.jbuilder
|
|
235
|
+
- app/views/fedipub/rails/server/activities/_activity.activitypub.jbuilder
|
|
236
|
+
- app/views/fedipub/rails/server/activities/show.activitypub.jbuilder
|
|
237
|
+
- app/views/fedipub/rails/server/actors/_actor.activitypub.jbuilder
|
|
238
|
+
- app/views/fedipub/rails/server/actors/_tombstone.activitypub.jbuilder
|
|
239
|
+
- app/views/fedipub/rails/server/actors/show.activitypub.jbuilder
|
|
240
|
+
- app/views/fedipub/rails/server/approval_stamps/show.activitypub.jbuilder
|
|
241
|
+
- app/views/fedipub/rails/server/followings/_following.activitypub.jbuilder
|
|
242
|
+
- app/views/fedipub/rails/server/followings/show.activitypub.jbuilder
|
|
243
|
+
- app/views/fedipub/rails/server/nodeinfo/index.nodeinfo.jbuilder
|
|
244
|
+
- app/views/fedipub/rails/server/nodeinfo/show.nodeinfo.jbuilder
|
|
245
|
+
- app/views/fedipub/rails/server/published/_publishable.activitypub.jbuilder
|
|
246
|
+
- app/views/fedipub/rails/server/published/_tombstone.activitypub.jbuilder
|
|
247
|
+
- app/views/fedipub/rails/server/published/show.activitypub.jbuilder
|
|
248
|
+
- app/views/fedipub/rails/server/shared/ordered_collection.activitypub.jbuilder
|
|
249
|
+
- app/views/fedipub/rails/server/shared/ordered_collection_page.activitypub.jbuilder
|
|
250
|
+
- app/views/fedipub/rails/server/web_finger/find.jrd.jbuilder
|
|
251
|
+
- app/views/fedipub/rails/server/web_finger/host_meta.xrd.erb
|
|
252
|
+
- config/initializers/logger.rb
|
|
227
253
|
- config/initializers/mime_types.rb
|
|
254
|
+
- config/initializers/miscellany.rb
|
|
228
255
|
- config/initializers/security_vocab.rb
|
|
229
256
|
- config/routes.rb
|
|
230
257
|
- db/migrate/20200712133150_create_federails_actors.rb
|
|
@@ -240,10 +267,29 @@ files:
|
|
|
240
267
|
- db/migrate/20251121160720_add_to_and_cc_to_federails_activities.rb
|
|
241
268
|
- db/migrate/20260421170640_add_result_and_instrument_to_federails_activities.rb
|
|
242
269
|
- db/migrate/20260723113716_rename_federails_to_fedipub.rb
|
|
270
|
+
- db/migrate/20260922155524_create_fedipub_approval_stamps.rb
|
|
271
|
+
- db/migrate/20260924090802_add_shared_inbox_url_to_fedipub_actors.rb
|
|
243
272
|
- lib/fedipub.rb
|
|
273
|
+
- lib/fedipub/activity_handlers/accept_follow_handler.rb
|
|
274
|
+
- lib/fedipub/activity_handlers/delete_handler.rb
|
|
275
|
+
- lib/fedipub/activity_handlers/follow_handler.rb
|
|
276
|
+
- lib/fedipub/activity_handlers/quote_request_handler.rb
|
|
277
|
+
- lib/fedipub/activity_handlers/undo_delete_handler.rb
|
|
278
|
+
- lib/fedipub/activity_handlers/undo_follow_handler.rb
|
|
279
|
+
- lib/fedipub/concerns/announceable.rb
|
|
280
|
+
- lib/fedipub/concerns/application_actor.rb
|
|
281
|
+
- lib/fedipub/concerns/generic_actor_entity.rb
|
|
282
|
+
- lib/fedipub/concerns/generic_data_entity.rb
|
|
283
|
+
- lib/fedipub/concerns/handles_delete_requests.rb
|
|
284
|
+
- lib/fedipub/concerns/has_interaction_policy.rb
|
|
285
|
+
- lib/fedipub/concerns/likeable.rb
|
|
286
|
+
- lib/fedipub/concerns/quote_request.rb
|
|
244
287
|
- lib/fedipub/configuration.rb
|
|
245
288
|
- lib/fedipub/data_transformer/note.rb
|
|
246
289
|
- lib/fedipub/engine.rb
|
|
290
|
+
- lib/fedipub/errors.rb
|
|
291
|
+
- lib/fedipub/features.rb
|
|
292
|
+
- lib/fedipub/logger.rb
|
|
247
293
|
- lib/fedipub/maintenance/actors_updater.rb
|
|
248
294
|
- lib/fedipub/maintenance/hosts_updater.rb
|
|
249
295
|
- lib/fedipub/utils/actor.rb
|
|
@@ -260,6 +306,8 @@ files:
|
|
|
260
306
|
- lib/fediverse/notifier.rb
|
|
261
307
|
- lib/fediverse/request.rb
|
|
262
308
|
- lib/fediverse/signature.rb
|
|
309
|
+
- lib/fediverse/signature/draft_cavage12.rb
|
|
310
|
+
- lib/fediverse/signature/rfc9421.rb
|
|
263
311
|
- lib/fediverse/webfinger.rb
|
|
264
312
|
- lib/generators/fedipub/copy_client_policies/USAGE
|
|
265
313
|
- lib/generators/fedipub/copy_client_policies/copy_client_policies_generator.rb
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//= link_directory ../stylesheets/fedipub .css
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
|
3
|
-
* listed below.
|
|
4
|
-
*
|
|
5
|
-
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
|
6
|
-
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
|
|
7
|
-
*
|
|
8
|
-
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
|
9
|
-
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
|
|
10
|
-
* files in this directory. Styles in this file should be added after the last require_* statement.
|
|
11
|
-
* It is generally better to create a new file per style scope.
|
|
12
|
-
*
|
|
13
|
-
*= require_tree .
|
|
14
|
-
*= require_self
|
|
15
|
-
*/
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
module Fedipub
|
|
2
|
-
module Server
|
|
3
|
-
module RenderCollections
|
|
4
|
-
extend ActiveSupport::Concern
|
|
5
|
-
|
|
6
|
-
def render_collection(actor:, collection:, url_helper:, &items_block)
|
|
7
|
-
if params[:page].present?
|
|
8
|
-
render_collection_page(actor: actor, collection: collection, url_helper: url_helper, items_block: items_block)
|
|
9
|
-
else
|
|
10
|
-
render 'fedipub/server/shared/ordered_collection', locals: { collection: collection, url_helper: url_helper, actor: actor }
|
|
11
|
-
end
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
def render_collection_page(collection:, actor:, url_helper:, items_block:)
|
|
15
|
-
render 'fedipub/server/shared/ordered_collection_page', locals: { collection: collection, url_helper: url_helper, actor: actor, items_block: items_block }
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
end
|
|
19
|
-
end
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
module Fedipub
|
|
2
|
-
module Client
|
|
3
|
-
class ActivitiesController < Fedipub::ClientController
|
|
4
|
-
before_action :authenticate_user!, only: [:feed]
|
|
5
|
-
before_action :authorize_action!
|
|
6
|
-
|
|
7
|
-
# GET /app/activities
|
|
8
|
-
# GET /app/activities.json
|
|
9
|
-
def index
|
|
10
|
-
@activities = policy_scope(Fedipub::Activity, policy_scope_class: Fedipub::Client::ActivityPolicy::Scope).all
|
|
11
|
-
@activities = @activities.where actor: Actor.find_param(params[:actor_id]) if params[:actor_id]
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
# GET /app/feed
|
|
15
|
-
# GET /app/feed.json
|
|
16
|
-
def feed
|
|
17
|
-
@activities = Activity.feed_for(current_user.fedipub_actor)
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
private
|
|
21
|
-
|
|
22
|
-
def authorize_action!
|
|
23
|
-
authorize(Fedipub::Activity, policy_class: Fedipub::Client::ActivityPolicy)
|
|
24
|
-
end
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
end
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
module Fedipub
|
|
2
|
-
module Client
|
|
3
|
-
class ActorsController < Fedipub::ClientController
|
|
4
|
-
before_action :set_actor, only: [:show]
|
|
5
|
-
|
|
6
|
-
# GET /app/actors
|
|
7
|
-
# GET /app/actors.json
|
|
8
|
-
def index
|
|
9
|
-
authorize Fedipub::Actor, policy_class: Fedipub::Client::ActorPolicy
|
|
10
|
-
|
|
11
|
-
@actors = policy_scope(Fedipub::Actor, policy_scope_class: Fedipub::Client::ActorPolicy::Scope).all
|
|
12
|
-
@actors = @actors.local if params[:local_only]
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
# GET /app/actors/1
|
|
16
|
-
# GET /app/actors/1.json
|
|
17
|
-
def show
|
|
18
|
-
render_show
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
# GET /app/actors/lookup
|
|
22
|
-
# GET /app/actors/lookup.json
|
|
23
|
-
def lookup
|
|
24
|
-
@actor = Fedipub::Actor.find_by_account account_param
|
|
25
|
-
authorize @actor, policy_class: Fedipub::Client::ActorPolicy
|
|
26
|
-
render_show
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
private
|
|
30
|
-
|
|
31
|
-
# Use callbacks to share common setup or constraints between actions.
|
|
32
|
-
def set_actor
|
|
33
|
-
@actor = Fedipub::Actor.find_param(params[:id])
|
|
34
|
-
authorize @actor, policy_class: Fedipub::Client::ActorPolicy
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
def account_param
|
|
38
|
-
params.require('account').strip
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
def render_show
|
|
42
|
-
respond_to do |format|
|
|
43
|
-
if @actor.tombstoned?
|
|
44
|
-
format.html { render :gone, status: :gone }
|
|
45
|
-
format.json { render json: { error: I18n.t('controller.actors.gone') }, status: :gone }
|
|
46
|
-
else
|
|
47
|
-
format.html { render :show }
|
|
48
|
-
format.json { render :show }
|
|
49
|
-
end
|
|
50
|
-
end
|
|
51
|
-
end
|
|
52
|
-
end
|
|
53
|
-
end
|
|
54
|
-
end
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
module Fedipub
|
|
2
|
-
module Client
|
|
3
|
-
class FollowingsController < Fedipub::ClientController
|
|
4
|
-
before_action :authenticate_user!
|
|
5
|
-
before_action :skip_authorization, only: [:new, :create]
|
|
6
|
-
before_action :set_following, only: [:accept, :destroy]
|
|
7
|
-
|
|
8
|
-
# GET /app/followings/new?uri={uri}
|
|
9
|
-
def new
|
|
10
|
-
# Find actor (and fetch if necessary)
|
|
11
|
-
actor = Actor.find_or_create_by_federation_url(params.require(:uri))
|
|
12
|
-
# Redirect to local profile page which will have a follow button on it
|
|
13
|
-
redirect_to fedipub.client_actor_url(actor)
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
# PUT /app/followings/:id/accept
|
|
17
|
-
# PUT /app/followings/:id/accept.json
|
|
18
|
-
def accept
|
|
19
|
-
respond_to do |format|
|
|
20
|
-
url = fedipub.client_actor_url @following.actor
|
|
21
|
-
if @following.accept!
|
|
22
|
-
format.html { redirect_to url, notice: I18n.t('controller.followings.accept.success') }
|
|
23
|
-
format.json { render :show, status: :ok, location: @following }
|
|
24
|
-
else
|
|
25
|
-
format.html { redirect_to url, alert: I18n.t('controller.followings.accept.error') }
|
|
26
|
-
format.json { render json: @following.errors, status: Fedipub::Utils::ResponseCodes::UNPROCESSABLE_CONTENT }
|
|
27
|
-
end
|
|
28
|
-
end
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
# POST /app/followings
|
|
32
|
-
# POST /app/followings.json
|
|
33
|
-
def create
|
|
34
|
-
@following = Following.new(following_params)
|
|
35
|
-
@following.actor = current_user.fedipub_actor
|
|
36
|
-
authorize @following, policy_class: Fedipub::Client::FollowingPolicy
|
|
37
|
-
|
|
38
|
-
save_and_render
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
# POST /app/followings/follow
|
|
42
|
-
# POST /app/followings/follow.json
|
|
43
|
-
def follow
|
|
44
|
-
authorize Fedipub::Following, policy_class: Fedipub::Client::FollowingPolicy
|
|
45
|
-
|
|
46
|
-
begin
|
|
47
|
-
@following = Following.new_from_account following_account_params, actor: current_user.fedipub_actor
|
|
48
|
-
rescue ::ActiveRecord::RecordNotFound
|
|
49
|
-
# Renders a 422 instead of a 404
|
|
50
|
-
respond_to do |format|
|
|
51
|
-
format.html { redirect_to fedipub.client_actors_url, alert: I18n.t('controller.followings.follow.error') }
|
|
52
|
-
format.json { render json: { target_actor: ['does not exist'] }, status: Fedipub::Utils::ResponseCodes::UNPROCESSABLE_CONTENT }
|
|
53
|
-
end
|
|
54
|
-
|
|
55
|
-
return
|
|
56
|
-
end
|
|
57
|
-
|
|
58
|
-
save_and_render
|
|
59
|
-
end
|
|
60
|
-
|
|
61
|
-
# DELETE /app/followings/1
|
|
62
|
-
# DELETE /app/followings/1.json
|
|
63
|
-
def destroy
|
|
64
|
-
@following.destroy
|
|
65
|
-
respond_to do |format|
|
|
66
|
-
format.html { redirect_to fedipub.client_actor_url(@following.actor), notice: I18n.t('controller.followings.destroy.success') }
|
|
67
|
-
format.json { head :no_content }
|
|
68
|
-
end
|
|
69
|
-
end
|
|
70
|
-
|
|
71
|
-
private
|
|
72
|
-
|
|
73
|
-
# Use callbacks to share common setup or constraints between actions.
|
|
74
|
-
def set_following
|
|
75
|
-
@following = Following.find_param(params[:id])
|
|
76
|
-
authorize @following, policy_class: Fedipub::Client::FollowingPolicy
|
|
77
|
-
end
|
|
78
|
-
|
|
79
|
-
# Only allow a list of trusted parameters through.
|
|
80
|
-
def following_params
|
|
81
|
-
params.require(:following).permit(:target_actor_id)
|
|
82
|
-
end
|
|
83
|
-
|
|
84
|
-
def following_account_params
|
|
85
|
-
params.require(:account)
|
|
86
|
-
end
|
|
87
|
-
|
|
88
|
-
def save_and_render # rubocop:disable Metrics/AbcSize
|
|
89
|
-
url = fedipub.client_actor_url current_user.fedipub_actor
|
|
90
|
-
|
|
91
|
-
respond_to do |format|
|
|
92
|
-
if @following.save
|
|
93
|
-
format.html { redirect_to url, notice: I18n.t('controller.followings.save_and_render.success') }
|
|
94
|
-
format.json { render :show, status: :created, location: @following }
|
|
95
|
-
else
|
|
96
|
-
format.html { redirect_to url, alert: I18n.t('controller.followings.save_and_render.error') }
|
|
97
|
-
format.json { render json: @following.errors, status: Fedipub::Utils::ResponseCodes::UNPROCESSABLE_CONTENT }
|
|
98
|
-
end
|
|
99
|
-
end
|
|
100
|
-
end
|
|
101
|
-
end
|
|
102
|
-
end
|
|
103
|
-
end
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
require 'fediverse/inbox'
|
|
2
|
-
|
|
3
|
-
module Fedipub
|
|
4
|
-
module Server
|
|
5
|
-
class ActivitiesController < Fedipub::ServerController
|
|
6
|
-
include Fedipub::Server::RenderCollections
|
|
7
|
-
|
|
8
|
-
before_action :set_activity, only: [:show]
|
|
9
|
-
|
|
10
|
-
# GET /federation/activities
|
|
11
|
-
# GET /federation/actors/1/outbox.json
|
|
12
|
-
def outbox
|
|
13
|
-
authorize Fedipub::Activity, policy_class: Fedipub::Server::ActivityPolicy
|
|
14
|
-
|
|
15
|
-
actor = Actor.find_param(params[:actor_id])
|
|
16
|
-
activities = policy_scope(Fedipub::Activity, policy_scope_class: Fedipub::Server::ActivityPolicy::Scope).where(actor: actor).order(created_at: :desc)
|
|
17
|
-
|
|
18
|
-
render_collection(
|
|
19
|
-
collection: activities.page(params[:page]),
|
|
20
|
-
actor: actor,
|
|
21
|
-
url_helper: :server_actor_outbox_url
|
|
22
|
-
) do |builder, items|
|
|
23
|
-
builder.array! items, partial: 'fedipub/server/activities/activity', as: :activity, context: false
|
|
24
|
-
end
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
# GET /federation/actors/1/activities/1.json
|
|
28
|
-
def show; end
|
|
29
|
-
|
|
30
|
-
# POST /federation/actors/1/inbox
|
|
31
|
-
def create
|
|
32
|
-
skip_authorization
|
|
33
|
-
|
|
34
|
-
payload = payload_from_params
|
|
35
|
-
return head Fedipub::Utils::ResponseCodes::UNPROCESSABLE_CONTENT unless payload
|
|
36
|
-
|
|
37
|
-
if Fediverse::Inbox.dispatch_request(payload)
|
|
38
|
-
head :created
|
|
39
|
-
else
|
|
40
|
-
head Fedipub::Utils::ResponseCodes::UNPROCESSABLE_CONTENT
|
|
41
|
-
end
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
private
|
|
45
|
-
|
|
46
|
-
# Use callbacks to share common setup or constraints between actions.
|
|
47
|
-
def set_activity
|
|
48
|
-
@activity = Actor.find_param(params[:actor_id]).activities.find_param(params[:id])
|
|
49
|
-
authorize @activity, policy_class: Fedipub::Server::ActivityPolicy
|
|
50
|
-
end
|
|
51
|
-
|
|
52
|
-
# Only allow a list of trusted parameters through.
|
|
53
|
-
def activity_params
|
|
54
|
-
params.fetch(:activity, {})
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
def payload_from_params
|
|
58
|
-
payload_string = request.body.read
|
|
59
|
-
request.body.rewind if request.body.respond_to? :rewind
|
|
60
|
-
|
|
61
|
-
begin
|
|
62
|
-
payload = JSON.parse(payload_string)
|
|
63
|
-
rescue JSON::ParserError
|
|
64
|
-
return
|
|
65
|
-
end
|
|
66
|
-
|
|
67
|
-
hash = JSON::LD::API.compact payload, payload['@context']
|
|
68
|
-
validate_payload hash
|
|
69
|
-
end
|
|
70
|
-
|
|
71
|
-
def validate_payload(hash)
|
|
72
|
-
return unless hash['@context'] && hash['id'] && hash['type'] && hash['actor'] && hash['object']
|
|
73
|
-
|
|
74
|
-
hash
|
|
75
|
-
end
|
|
76
|
-
end
|
|
77
|
-
end
|
|
78
|
-
end
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
module Fedipub
|
|
2
|
-
module Server
|
|
3
|
-
class ActorsController < Fedipub::ServerController
|
|
4
|
-
include Fedipub::Server::RenderCollections
|
|
5
|
-
|
|
6
|
-
before_action :set_actor, only: [:show, :followers, :following]
|
|
7
|
-
|
|
8
|
-
# GET /federation/actors/1
|
|
9
|
-
# GET /federation/actors/1.json
|
|
10
|
-
def show
|
|
11
|
-
status = @actor.tombstoned? ? :gone : :ok
|
|
12
|
-
render :show, status: status
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
# GET /federation/actors/:id/followers
|
|
16
|
-
# GET /federation/actors/:id/followers.json
|
|
17
|
-
def followers
|
|
18
|
-
@actors = @actor.followers.order(created_at: :desc)
|
|
19
|
-
render_collection(
|
|
20
|
-
collection: @actors.page(params[:page]),
|
|
21
|
-
actor: @actor,
|
|
22
|
-
url_helper: :followers_server_actor_url
|
|
23
|
-
) do |builder, items|
|
|
24
|
-
builder.array! items.map(&:federated_url)
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
# GET /federation/actors/:id/followers
|
|
29
|
-
# GET /federation/actors/:id/followers.json
|
|
30
|
-
def following
|
|
31
|
-
@actors = @actor.follows.order(created_at: :desc)
|
|
32
|
-
render_collection(
|
|
33
|
-
collection: @actors.page(params[:page]),
|
|
34
|
-
actor: @actor,
|
|
35
|
-
url_helper: :following_server_actor_url
|
|
36
|
-
) do |builder, items|
|
|
37
|
-
builder.array! items.map(&:federated_url)
|
|
38
|
-
end
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
private
|
|
42
|
-
|
|
43
|
-
# Use callbacks to share common setup or constraints between actions.
|
|
44
|
-
def set_actor
|
|
45
|
-
@actor = Actor.find_param(params[:id])
|
|
46
|
-
authorize @actor, policy_class: Fedipub::Server::ActorPolicy
|
|
47
|
-
end
|
|
48
|
-
end
|
|
49
|
-
end
|
|
50
|
-
end
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
module Fedipub
|
|
2
|
-
module Server
|
|
3
|
-
class FollowingsController < Fedipub::ServerController
|
|
4
|
-
before_action :set_following, only: [:show]
|
|
5
|
-
|
|
6
|
-
# GET /federation/actors/1/followings/1.json
|
|
7
|
-
def show; end
|
|
8
|
-
|
|
9
|
-
private
|
|
10
|
-
|
|
11
|
-
# Use callbacks to share common setup or constraints between actions.
|
|
12
|
-
def set_following
|
|
13
|
-
actor = Actor.find_param(params[:actor_id])
|
|
14
|
-
@following = Following.find_by!(actor: actor, uuid: params[:id])
|
|
15
|
-
authorize @following, policy_class: Fedipub::Server::FollowingPolicy
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
end
|
|
19
|
-
end
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
module Fedipub
|
|
2
|
-
module Server
|
|
3
|
-
class NodeinfoController < Fedipub::ServerController
|
|
4
|
-
def index
|
|
5
|
-
skip_authorization
|
|
6
|
-
|
|
7
|
-
render formats: [:nodeinfo]
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
def show # rubocop:todo Metrics/AbcSize
|
|
11
|
-
skip_authorization
|
|
12
|
-
|
|
13
|
-
@total = @active_halfyear = @active_month = 0
|
|
14
|
-
@has_user_counts = false
|
|
15
|
-
Fedipub::Configuration.actor_types.each_value do |config|
|
|
16
|
-
next unless (method = config[:user_count_method]&.to_sym)
|
|
17
|
-
|
|
18
|
-
@has_user_counts = true
|
|
19
|
-
model = config[:class]
|
|
20
|
-
@total += model.send(method, nil)
|
|
21
|
-
@active_month += model.send(method, (30.days.ago)...Time.current)
|
|
22
|
-
@active_halfyear += model.send(method, (180.days.ago)...Time.current)
|
|
23
|
-
end
|
|
24
|
-
render formats: [:nodeinfo]
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
end
|