federails 0.0.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +182 -7
  3. data/Rakefile +5 -5
  4. data/app/controllers/federails/application_controller.rb +23 -0
  5. data/app/controllers/federails/client/activities_controller.rb +21 -0
  6. data/app/controllers/federails/client/actors_controller.rb +37 -0
  7. data/app/controllers/federails/client/followings_controller.rb +101 -0
  8. data/app/controllers/federails/server/activities_controller.rb +65 -0
  9. data/app/controllers/federails/server/actors_controller.rb +34 -0
  10. data/app/controllers/federails/server/followings_controller.rb +19 -0
  11. data/app/controllers/federails/server/nodeinfo_controller.rb +22 -0
  12. data/app/controllers/federails/server/server_controller.rb +17 -0
  13. data/app/controllers/federails/server/web_finger_controller.rb +38 -0
  14. data/app/helpers/federails/application_helper.rb +8 -0
  15. data/app/jobs/federails/notify_inbox_job.rb +12 -0
  16. data/app/mailers/federails/application_mailer.rb +2 -2
  17. data/app/models/concerns/federails/entity.rb +57 -0
  18. data/app/models/concerns/federails/has_uuid.rb +35 -0
  19. data/app/models/federails/activity.rb +35 -0
  20. data/app/models/federails/actor.rb +189 -0
  21. data/app/models/federails/following.rb +52 -0
  22. data/app/policies/federails/client/activity_policy.rb +6 -0
  23. data/app/policies/federails/client/actor_policy.rb +15 -0
  24. data/app/policies/federails/client/following_policy.rb +35 -0
  25. data/app/policies/federails/federails_policy.rb +59 -0
  26. data/app/policies/federails/server/activity_policy.rb +6 -0
  27. data/app/policies/federails/server/actor_policy.rb +23 -0
  28. data/app/policies/federails/server/following_policy.rb +6 -0
  29. data/app/views/federails/client/activities/_activity.html.erb +5 -0
  30. data/app/views/federails/client/activities/_activity.json.jbuilder +1 -0
  31. data/app/views/federails/client/activities/_index.json.jbuilder +1 -0
  32. data/app/views/federails/client/activities/feed.html.erb +4 -0
  33. data/app/views/federails/client/activities/feed.json.jbuilder +1 -0
  34. data/app/views/federails/client/activities/index.html.erb +5 -0
  35. data/app/views/federails/client/activities/index.json.jbuilder +1 -0
  36. data/app/views/federails/client/actors/_actor.json.jbuilder +14 -0
  37. data/app/views/federails/client/actors/_lookup_form.html.erb +5 -0
  38. data/app/views/federails/client/actors/index.html.erb +24 -0
  39. data/app/views/federails/client/actors/index.json.jbuilder +1 -0
  40. data/app/views/federails/client/actors/show.html.erb +100 -0
  41. data/app/views/federails/client/actors/show.json.jbuilder +1 -0
  42. data/app/views/federails/client/followings/_follow.html.erb +4 -0
  43. data/app/views/federails/client/followings/_follower.html.erb +7 -0
  44. data/app/views/federails/client/followings/_following.json.jbuilder +1 -0
  45. data/app/views/federails/client/followings/_form.html.erb +21 -0
  46. data/app/views/federails/client/followings/index.html.erb +29 -0
  47. data/app/views/federails/client/followings/index.json.jbuilder +1 -0
  48. data/app/views/federails/client/followings/show.html.erb +21 -0
  49. data/app/views/federails/client/followings/show.json.jbuilder +1 -0
  50. data/app/views/federails/server/activities/_activity.activitypub.jbuilder +14 -0
  51. data/app/views/federails/server/activities/outbox.activitypub.jbuilder +18 -0
  52. data/app/views/federails/server/activities/show.activitypub.jbuilder +1 -0
  53. data/app/views/federails/server/actors/_actor.activitypub.jbuilder +21 -0
  54. data/app/views/federails/server/actors/followers.activitypub.jbuilder +18 -0
  55. data/app/views/federails/server/actors/following.activitypub.jbuilder +18 -0
  56. data/app/views/federails/server/actors/show.activitypub.jbuilder +1 -0
  57. data/app/views/federails/server/followings/_following.activitypub.jbuilder +7 -0
  58. data/app/views/federails/server/followings/show.activitypub.jbuilder +1 -0
  59. data/app/views/federails/server/nodeinfo/index.nodeinfo.jbuilder +6 -0
  60. data/app/views/federails/server/nodeinfo/show.nodeinfo.jbuilder +19 -0
  61. data/app/views/federails/server/web_finger/find.jrd.jbuilder +24 -0
  62. data/app/views/federails/server/web_finger/host_meta.xrd.erb +5 -0
  63. data/config/initializers/mime_types.rb +21 -0
  64. data/config/routes.rb +43 -0
  65. data/db/migrate/20200712133150_create_federails_actors.rb +24 -0
  66. data/db/migrate/20200712143127_create_federails_followings.rb +14 -0
  67. data/db/migrate/20200712174938_create_federails_activities.rb +11 -0
  68. data/db/migrate/20240731145400_change_actor_entity_rel_to_polymorphic.rb +11 -0
  69. data/db/migrate/20241002094500_add_uuids.rb +13 -0
  70. data/db/migrate/20241002094501_add_keypair_to_actors.rb +8 -0
  71. data/lib/federails/configuration.rb +92 -0
  72. data/lib/federails/engine.rb +6 -0
  73. data/lib/federails/utils/host.rb +54 -0
  74. data/lib/federails/version.rb +1 -1
  75. data/lib/federails.rb +34 -3
  76. data/lib/fediverse/inbox.rb +71 -0
  77. data/lib/fediverse/notifier.rb +60 -0
  78. data/lib/fediverse/request.rb +38 -0
  79. data/lib/fediverse/signature.rb +49 -0
  80. data/lib/fediverse/webfinger.rb +117 -0
  81. data/lib/generators/federails/install/USAGE +9 -0
  82. data/lib/generators/federails/install/install_generator.rb +10 -0
  83. data/lib/generators/federails/install/templates/federails.rb +1 -0
  84. data/lib/generators/federails/install/templates/federails.yml +23 -0
  85. data/lib/tasks/factory_bot.rake +15 -0
  86. metadata +170 -10
  87. data/app/views/layouts/federails/application.html.erb +0 -15
metadata CHANGED
@@ -1,15 +1,99 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: federails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Manuel Tancoigne
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-02-04 00:00:00.000000000 Z
11
+ date: 2024-10-13 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: faraday
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: faraday-follow_redirects
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: json-ld
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: 3.2.0
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: 3.2.0
55
+ - !ruby/object:Gem::Dependency
56
+ name: json-ld-preloaded
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: 3.2.0
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: 3.2.0
69
+ - !ruby/object:Gem::Dependency
70
+ name: kaminari
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: 1.2.0
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: 1.2.0
83
+ - !ruby/object:Gem::Dependency
84
+ name: pundit
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: 2.3.0
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: 2.3.0
13
97
  - !ruby/object:Gem::Dependency
14
98
  name: rails
15
99
  requirement: !ruby/object:Gem::Requirement
@@ -24,7 +108,7 @@ dependencies:
24
108
  - - ">="
25
109
  - !ruby/object:Gem::Version
26
110
  version: 7.0.4
27
- description: Ruby on Rails engine to add support to Activity Pub
111
+ description: An ActivityPub engine for Ruby on Rails
28
112
  email:
29
113
  - manu@experimentslabs.com
30
114
  executables: []
@@ -36,15 +120,89 @@ files:
36
120
  - app/assets/config/federails_manifest.js
37
121
  - app/assets/stylesheets/federails/application.css
38
122
  - app/controllers/federails/application_controller.rb
123
+ - app/controllers/federails/client/activities_controller.rb
124
+ - app/controllers/federails/client/actors_controller.rb
125
+ - app/controllers/federails/client/followings_controller.rb
126
+ - app/controllers/federails/server/activities_controller.rb
127
+ - app/controllers/federails/server/actors_controller.rb
128
+ - app/controllers/federails/server/followings_controller.rb
129
+ - app/controllers/federails/server/nodeinfo_controller.rb
130
+ - app/controllers/federails/server/server_controller.rb
131
+ - app/controllers/federails/server/web_finger_controller.rb
39
132
  - app/helpers/federails/application_helper.rb
40
133
  - app/jobs/federails/application_job.rb
134
+ - app/jobs/federails/notify_inbox_job.rb
41
135
  - app/mailers/federails/application_mailer.rb
136
+ - app/models/concerns/federails/entity.rb
137
+ - app/models/concerns/federails/has_uuid.rb
138
+ - app/models/federails/activity.rb
139
+ - app/models/federails/actor.rb
42
140
  - app/models/federails/application_record.rb
43
- - app/views/layouts/federails/application.html.erb
141
+ - app/models/federails/following.rb
142
+ - app/policies/federails/client/activity_policy.rb
143
+ - app/policies/federails/client/actor_policy.rb
144
+ - app/policies/federails/client/following_policy.rb
145
+ - app/policies/federails/federails_policy.rb
146
+ - app/policies/federails/server/activity_policy.rb
147
+ - app/policies/federails/server/actor_policy.rb
148
+ - app/policies/federails/server/following_policy.rb
149
+ - app/views/federails/client/activities/_activity.html.erb
150
+ - app/views/federails/client/activities/_activity.json.jbuilder
151
+ - app/views/federails/client/activities/_index.json.jbuilder
152
+ - app/views/federails/client/activities/feed.html.erb
153
+ - app/views/federails/client/activities/feed.json.jbuilder
154
+ - app/views/federails/client/activities/index.html.erb
155
+ - app/views/federails/client/activities/index.json.jbuilder
156
+ - app/views/federails/client/actors/_actor.json.jbuilder
157
+ - app/views/federails/client/actors/_lookup_form.html.erb
158
+ - app/views/federails/client/actors/index.html.erb
159
+ - app/views/federails/client/actors/index.json.jbuilder
160
+ - app/views/federails/client/actors/show.html.erb
161
+ - app/views/federails/client/actors/show.json.jbuilder
162
+ - app/views/federails/client/followings/_follow.html.erb
163
+ - app/views/federails/client/followings/_follower.html.erb
164
+ - app/views/federails/client/followings/_following.json.jbuilder
165
+ - app/views/federails/client/followings/_form.html.erb
166
+ - app/views/federails/client/followings/index.html.erb
167
+ - app/views/federails/client/followings/index.json.jbuilder
168
+ - app/views/federails/client/followings/show.html.erb
169
+ - app/views/federails/client/followings/show.json.jbuilder
170
+ - app/views/federails/server/activities/_activity.activitypub.jbuilder
171
+ - app/views/federails/server/activities/outbox.activitypub.jbuilder
172
+ - app/views/federails/server/activities/show.activitypub.jbuilder
173
+ - app/views/federails/server/actors/_actor.activitypub.jbuilder
174
+ - app/views/federails/server/actors/followers.activitypub.jbuilder
175
+ - app/views/federails/server/actors/following.activitypub.jbuilder
176
+ - app/views/federails/server/actors/show.activitypub.jbuilder
177
+ - app/views/federails/server/followings/_following.activitypub.jbuilder
178
+ - app/views/federails/server/followings/show.activitypub.jbuilder
179
+ - app/views/federails/server/nodeinfo/index.nodeinfo.jbuilder
180
+ - app/views/federails/server/nodeinfo/show.nodeinfo.jbuilder
181
+ - app/views/federails/server/web_finger/find.jrd.jbuilder
182
+ - app/views/federails/server/web_finger/host_meta.xrd.erb
183
+ - config/initializers/mime_types.rb
44
184
  - config/routes.rb
185
+ - db/migrate/20200712133150_create_federails_actors.rb
186
+ - db/migrate/20200712143127_create_federails_followings.rb
187
+ - db/migrate/20200712174938_create_federails_activities.rb
188
+ - db/migrate/20240731145400_change_actor_entity_rel_to_polymorphic.rb
189
+ - db/migrate/20241002094500_add_uuids.rb
190
+ - db/migrate/20241002094501_add_keypair_to_actors.rb
45
191
  - lib/federails.rb
192
+ - lib/federails/configuration.rb
46
193
  - lib/federails/engine.rb
194
+ - lib/federails/utils/host.rb
47
195
  - lib/federails/version.rb
196
+ - lib/fediverse/inbox.rb
197
+ - lib/fediverse/notifier.rb
198
+ - lib/fediverse/request.rb
199
+ - lib/fediverse/signature.rb
200
+ - lib/fediverse/webfinger.rb
201
+ - lib/generators/federails/install/USAGE
202
+ - lib/generators/federails/install/install_generator.rb
203
+ - lib/generators/federails/install/templates/federails.rb
204
+ - lib/generators/federails/install/templates/federails.yml
205
+ - lib/tasks/factory_bot.rake
48
206
  - lib/tasks/federails_tasks.rake
49
207
  homepage: https://experimentslabs.com
50
208
  licenses:
@@ -52,7 +210,9 @@ licenses:
52
210
  metadata:
53
211
  rubygems_mfa_required: 'true'
54
212
  homepage_uri: https://experimentslabs.com
55
- post_install_message:
213
+ source_code_uri: https://gitlab.com/experimentslabs/federails/
214
+ changelog_uri: https://gitlab.com/experimentslabs/federails/-/blob/main/CHANGELOG.md
215
+ post_install_message:
56
216
  rdoc_options: []
57
217
  require_paths:
58
218
  - lib
@@ -60,15 +220,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
60
220
  requirements:
61
221
  - - ">="
62
222
  - !ruby/object:Gem::Version
63
- version: '0'
223
+ version: 3.1.2
64
224
  required_rubygems_version: !ruby/object:Gem::Requirement
65
225
  requirements:
66
226
  - - ">="
67
227
  - !ruby/object:Gem::Version
68
228
  version: '0'
69
229
  requirements: []
70
- rubygems_version: 3.4.1
71
- signing_key:
230
+ rubygems_version: 3.4.15
231
+ signing_key:
72
232
  specification_version: 4
73
- summary: Ruby on Rails engine to add support to Activity Pub
233
+ summary: An ActivityPub engine for Ruby on Rails
74
234
  test_files: []
@@ -1,15 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>Federails</title>
5
- <%= csrf_meta_tags %>
6
- <%= csp_meta_tag %>
7
-
8
- <%= stylesheet_link_tag "federails/application", media: "all" %>
9
- </head>
10
- <body>
11
-
12
- <%= yield %>
13
-
14
- </body>
15
- </html>