Commit graph

347 commits

Author SHA1 Message Date
Izalia Mae
6ab6343ae7 fix ImportError on python 3.8 2024-01-29 04:26:54 -05:00
Izalia Mae
ed9d423ca3 update tinysql and set min/max db connections per thread 2024-01-27 00:59:08 -05:00
Izalia Mae
b59ead5d05 fix handle_follow and handle_undo 2024-01-24 19:55:11 -05:00
Izalia Mae
b8aae4c1bb use correct url when fetching inbox data 2024-01-24 19:28:15 -05:00
Izalia Mae
85a4797e68 make sure bool(Response) returns True 2024-01-24 19:24:27 -05:00
Izalia Mae
c2aa8c48bb ignore thread warnings in the sqlite backend for now 2024-01-24 19:20:27 -05:00
Izalia Mae
815053c06f fix the convert command 2024-01-24 01:20:23 -05:00
Izalia Mae
e66be009a6 use the right name for the domain_bans table 2024-01-24 01:20:00 -05:00
Izalia Mae
7a9d346642 fix linter warnings 2024-01-23 21:54:58 -05:00
Izalia Mae
57d7d25743 set sqlite file path relative to config path if possible 2024-01-22 06:50:31 -05:00
Izalia Mae
9cc79aa79a actually fix python packaging this time 2024-01-22 06:39:12 -05:00
Izalia Mae
5f6aef1871 use postgresql/sqlite for database backend 2024-01-22 05:32:16 -05:00
Izalia Mae
9808674b98 logging: use LogLevel enum and add functions to set/get the current level 2024-01-21 06:39:49 -05:00
Izalia Mae
3d9ba68bd1 use Message.object_id instead of Message.objectid 2024-01-16 00:33:41 -05:00
Izalia Mae
2ebb295be1 handle TypeError in Message.object_id 2024-01-16 00:33:05 -05:00
Izalia Mae
b9eb67b32d version bump 2024-01-15 23:47:23 -05:00
Izalia Mae
e6f2174ad4 don't use lazy import for aputils 2024-01-15 23:39:50 -05:00
Izalia Mae
9bf45a54d1 add annotations and fix linter warnings 2024-01-14 14:13:06 -05:00
Izalia Mae
3005e9b370 use format strings for logging 2024-01-10 10:49:43 -05:00
Izalia Mae
dcbde6d532 rework logger to not monkey-patch the logging module 2024-01-10 10:49:05 -05:00
Izalia Mae
4feaccaa53 use View class and make Message a subclass of aputils.message.Message 2024-01-09 23:15:04 -05:00
Dmytro Poltavchenko
006efc1ba4 Do not check instance's actor.type in case of Pleroma/Akkoma 2023-01-08 00:23:36 +00:00
Izalia Mae
f4698aa4dc fix RuntimeError when running commands involving http client 2022-12-29 07:27:35 -05:00
Izalia Mae
0940921383 handle more client connection errors 2022-12-26 02:02:57 -05:00
Izalia Mae
17f3e6be55 version 0.2.4 2022-12-08 04:17:17 -05:00
Izalia Mae
0e45763eff remove unnecessary config update 2022-12-08 03:53:13 -05:00
Izalia Mae
3968799d6f make sure exceptions don't bring down workers 2022-12-08 03:51:10 -05:00
Izalia Mae
aa8090eebb don't prompt for ignored settings in docker instances 2022-12-08 03:31:47 -05:00
Izalia Mae
dc74bfb588 force certain config values in docker installs 2022-12-07 23:16:48 -05:00
Izalia Mae
e281a06e7f correctly call aputils.Signer.new 2022-12-07 23:15:54 -05:00
Izalia Mae
8f16cab048 prevent errors in post and fetch_nodeinfo 2022-12-07 23:15:31 -05:00
Izalia Mae
7d37ec8145 remove await from push_message calls and reject non-system actors 2022-12-04 04:40:40 -05:00
Izalia Mae
9f58c88e9f Fix NameError when getting nodeinfo software name in processors 2022-12-04 04:16:50 -05:00
Izalia Mae
6b86bb7d98 remove leftover semaphore property 2022-12-04 02:13:13 -05:00
Izalia Mae
90234a9724 move apkeys out of RelayConfig and rename relay_software_names 2022-12-04 01:20:17 -05:00
Izalia Mae
b0851c0652 remove http_debug 2022-12-04 01:15:28 -05:00
Izalia Mae
3b89aa5e84 sort out cli
added `whitelist import` command which adds all current inboxes to the whitelist
added `config list`
fixed a few errors
2022-12-04 01:09:45 -05:00
Izalia Mae
f7e1c6b0b8 make sure db config is a string when saving 2022-12-02 11:43:39 -05:00
Izalia Mae
dcca1eb0dc fix HttpClient fetch_nodeinfo and get 2022-12-02 00:52:15 -05:00
Izalia Mae
d5b9053f71 replace various classes with aputils classes 2022-12-02 00:50:57 -05:00
Izalia Mae
d172439fac update aputils 2022-12-02 00:11:22 -05:00
Izalia Mae
1a7abb4ecb fix distill_inboxes 2022-11-29 17:41:04 -05:00
Izalia Mae
5397bb4653 only use hs2019 for mastodon 2022-11-27 17:25:54 -05:00
Izalia Mae
a640db8f06 update list of active relay software 2022-11-26 23:41:57 -05:00
Izalia Mae
ce9e0c4d00 remove unnecessary print 2022-11-26 23:11:51 -05:00
Izalia Mae
335146a970 fix NameError in cli_setup 2022-11-26 23:01:18 -05:00
Izalia Mae
5d01211a34 add aputils module for hs2019 support 2022-11-26 22:16:14 -05:00
Izalia Mae
15b314922c fix running via docker 2022-11-26 19:59:20 -05:00
Izalia Mae
b85b4ab80b create HttpClient class to avoid creating a new session every request 2022-11-26 18:56:34 -05:00
Izalia Mae
32764a1f93 make sure domain key exists for inboxes 2022-11-25 13:39:52 -05:00
Izalia Mae
fbe5746a18 fix NameError in cli_whitelist_remove 2022-11-25 13:29:45 -05:00
Izalia Mae
017363ecd5 fix nodeinfo fetching in run_processor 2022-11-25 13:19:29 -05:00
Izalia Mae
8541f63762 add timeout option to misc.request 2022-11-24 16:01:23 -05:00
Izalia Mae
da56d4bb61 add extra logging in misc.request 2022-11-22 18:11:41 -05:00
Izalia Mae
a838e4324b fix NameError in inbox 2022-11-22 18:09:25 -05:00
Izalia Mae
242052386e use correct actor variable for cli_inbox_follow 2022-11-20 22:24:36 -05:00
Izalia Mae
395971914b organize manage.py 2022-11-20 06:24:33 -05:00
Izalia Mae
c96640bfd7 add config cli commands 2022-11-20 06:14:37 -05:00
Izalia Mae
9839da906c add optional push worker threads 2022-11-20 05:50:14 -05:00
Izalia Mae
c049657765 fetch nodeinfo software name on inbox request instead of startup 2022-11-20 05:22:57 -05:00
Izalia Mae
ffe14bead3 ignore account Deletes 2022-11-20 05:12:11 -05:00
Izalia Mae
85c4df7d8c remove unecessary method 2022-11-18 16:57:34 -05:00
Izalia Mae
ba9f2718aa use new request properties and only fetch nodeinfo on follow 2022-11-18 16:41:14 -05:00
Izalia Mae
4a8a8da740 add software kwarg to RelayDatabase.add_inbox 2022-11-18 16:39:53 -05:00
Izalia Mae
306b526808 add properties to aiohttp.web.Request 2022-11-18 16:38:39 -05:00
Izalia Mae
4ea6a040fb optimize RelayDatabase.get_inbox 2022-11-18 14:36:30 -05:00
Izalia Mae
9369b598fa add software name for inboxes 2022-11-18 14:10:39 -05:00
Izalia Mae
d4955828d4 return Nodeinfo object from fetch_nodeinfo 2022-11-18 13:45:26 -05:00
Izalia Mae
22b6e6b406 cleanup 2022-11-18 11:58:27 -05:00
Izalia Mae
6960c8d6c0 views.webfinger: return 400 error on missing resource 2022-11-18 11:50:12 -05:00
Izalia Mae
d08bd6625a use signature keyid instead of object actor to fetch actor 2022-11-17 16:30:56 -05:00
Izalia Mae
d2b243d88a await misc.request in handle_follow 2022-11-16 14:22:50 -05:00
Izalia Mae
e3b06d29ab ignore signals that don't exist 2022-11-16 13:26:47 -05:00
Izalia Mae
ef5d4bc579 only fetch commit hash if in running from git repo 2022-11-16 10:41:00 -05:00
Izalia Mae
8fd712c849 always fetch nodeinfo software name 2022-11-16 10:31:21 -05:00
Izalia Mae
c88e4e748a version bump 2022-11-16 10:26:08 -05:00
Izalia Mae
d615380610 Merge branch 'dev' of ssh://pleroma/pleroma/relay into dev 2022-11-16 10:24:35 -05:00
Izalia Mae
ec325f9f08 skip raising a KeyError on missing actor 2022-11-16 09:12:23 -05:00
Izalia Mae
4bdd2b031b prevent error in inbox 2022-11-16 09:10:52 -05:00
Jeong Arm
e6d7c60a5a Fix Response.new_error 2022-11-13 15:00:53 +09:00
Izalia Mae
7732a860e9 use right variable for inbox 2022-11-10 13:08:25 -05:00
Izalia Mae
3305a25da4 create View class and fix Response.new_error 2022-11-10 12:40:48 -05:00
Izalia Mae
c1c4b24b0a add ability to change cache size 2022-11-10 12:39:37 -05:00
Izalia Mae
f397e10b04 reset config on load 2022-11-10 12:38:08 -05:00
Izalia Mae
78ce1763e0 fix a couple nodeinfo values 2022-11-09 06:11:16 -05:00
Izalia Mae
ff95a3033d create Response class 2022-11-09 05:58:35 -05:00
Izalia Mae
6af9c8e6fe add follow request management methods to database 2022-11-09 04:54:46 -05:00
Izalia Mae
0b9281bec1 make sure sub-dicts in DotDict are DotDict objects 2022-11-09 04:35:57 -05:00
Izalia Mae
76476d1d03 add missing import 2022-11-07 16:14:00 -05:00
Izalia Mae
b275b7cd0b remove (un)follow_remote_actor 2022-11-07 09:53:04 -05:00
Izalia Mae
58ebefa3bd fix WKNodeinfo.get_url 2022-11-07 08:24:03 -05:00
Izalia Mae
e3bf4258aa create WKNodeinfo class and add nodeinfo 2.1 path 2022-11-07 08:18:25 -05:00
Izalia Mae
8d17749a50 create Application class 2022-11-07 07:54:32 -05:00
Izalia Mae
70e4870ba9 remove run_in_loop function 2022-11-07 05:40:08 -05:00
Izalia Mae
c66f9d34b3 create Message class 2022-11-07 05:30:13 -05:00
Izalia Mae
3b85e2c2f2 move DotDict to misc 2022-11-06 01:11:54 -05:00
Izalia Mae
f713f54306 announce forwarded messages 2022-11-06 01:11:36 -05:00
Izalia Mae
dcb7980c50 prevent old unfollows from booting instances 2022-11-05 22:15:37 -04:00
Izalia Mae
4d121adaa2 forward all non-Follow undos 2022-11-05 20:15:40 -04:00
Izalia Mae
c0d55cebb0 cache activity id for forwards 2022-11-05 20:10:01 -04:00
Izalia Mae
8ca198b611 simplify misc.request 2022-11-05 20:07:44 -04:00
Izalia Mae
b6f311c42d version bump 2022-08-12 16:38:33 -04:00
Izalia Mae
6fcaf47f39 fix debug logging for distill_object_id 2022-08-12 15:43:24 -04:00
Izalia Mae
59a05224ff add LOG_FILE env var 2022-08-12 03:22:30 -04:00
Izalia Mae
fc7de1a3bc use proper accept header for nodeinfo fetching 2022-08-12 02:36:08 -04:00
Izalia Mae
4fc5d692bf exclude git hash if unavailable 2022-06-06 08:37:08 -04:00
Izalia Mae
4847c2bbc0 version bump 2022-06-06 08:29:06 -04:00
Izalia Mae
d005ff8f48 add/remove inbox on cli inbox (un)follow 2022-05-06 18:08:55 -04:00
Izalia Mae
c24a0ce6d5 fix actor unfollowing and simplify (un)following 2022-05-06 16:10:34 -04:00
Izalia Mae
30a3b92f26 fixes 2022-05-06 04:12:12 -04:00
Izalia Mae
b6494849b5 Reorganize codebase 2022-05-06 07:04:51 +00:00
Joel Beckmeyer
738e0a999f fix DeprecationWarnings on 3.10 2021-10-16 08:58:49 -04:00
Joel Beckmeyer
e1498a8d6e add parameter for config location 2021-10-15 08:24:57 -04:00
Izalia Mae
79276c245c Sign headers when fetching actor 2021-09-15 02:17:27 +00:00
Sam Therapy
0456e4ca50 Add Misskey to the list of instances that can subscribe using /inbox 2021-08-12 20:13:10 +00:00
Izalia Mae
6cef5d8f38 Apply 1 suggestion(s) to 1 file(s) 2020-12-05 05:35:10 +00:00
Izalia Mae
63be7f2034 Apply 1 suggestion(s) to 1 file(s) 2020-12-05 05:34:58 +00:00
Izalia Mae
bc0914b5c1 make software blocklist configurable 2020-12-04 02:34:40 -05:00
Izalia Mae
f0e08f26b3 fetch well-known url for nodeinfo 2020-12-04 01:43:49 -05:00
Izalia Mae
1727425bec add relay blocking option 2020-12-02 23:13:33 -05:00
Izalia Mae
c59cec0c31 cleanup load_config 2020-12-02 22:41:45 -05:00
Haelwenn
4d4bebd0be Merge branch 'db-inbox-fix' into 'master'
properly create 'relay-list' in db

See merge request pleroma/relay!25
2020-11-23 07:06:50 +00:00
Izalia Mae
89990331d5 properly create 'relay-list' in db 2020-11-22 00:50:57 -05:00
Joel Beckmeyer
c2d53df85b set content-type to application/activity+json for /actor 2020-11-19 21:13:24 -05:00
Haelwenn
a15d734218 Merge branch 'follows' into 'master'
remove unnecessary actor checking for (un)follows

See merge request pleroma/relay!22
2020-11-12 13:43:09 +00:00
Izalia Mae
193ea00996 Include the headers required by mastodon 2020-11-12 13:40:19 +00:00
Izalia Mae
436a57971c remove unnecessary actor checking for (un)follows 2020-03-18 00:53:21 -04:00
Izalia Mae
544d790ef2 use pycryptodome instead of pycrypto 2019-11-19 22:08:14 -05:00
Izalia Mae
b4f0835106 Fix db wipe on json error and default config checking 2019-09-30 10:45:46 +00:00
kaniini
47e2eb6556 Merge branch 'feature/add_force_remove_relay' into 'master'
implement force-remove in manage.py, should only be used when relay is not running

See merge request pleroma/relay!15
2019-07-31 19:21:12 +00:00
kaniini
b3b33c9796 Merge branch 'feature/semaphore_in_push_to_actor' into 'master'
use global semaphore in push_to_actor to prevent overloading system with outbound connections

See merge request pleroma/relay!16
2019-07-31 19:20:46 +00:00
Thibaut Girka
e56d909fe2 Fix relay crashing on signed GET requests 2019-07-31 05:36:23 +00:00
kaniini
2eb17041b1 Merge branch 'feature-update' into 'master'
Handle "Update" event

See merge request pleroma/relay!14
2019-07-20 21:18:05 +00:00
gled
94e669cf7d use global semaphore in push_to_actor to prevent overloading system with outbound connections 2019-06-11 10:54:05 -07:00
gled
06d9d4c19e implement force-remove in manage.py, should only be used when relay is not running 2019-06-11 10:48:49 -07:00
kjwon15
9e5772855d Handle "Update" event to forward update profile 2019-06-03 18:50:45 +09:00
Izalia Mae
1a922ecb29 add whitelist feature 2019-05-21 12:29:55 -04:00
kaniini
f34b42ae78 Merge branch 'feature-delete' into 'master'
Implement handle_delete to forward delete

Closes #2

See merge request pleroma/relay!12
2019-05-13 18:41:06 +00:00
kjwon15
08fe53bdbd Implement handle_delete to forward delete 2019-05-08 17:27:01 +09:00
Izalia Mae
1065c5ff36 reject activities from instance not on relay-list 2019-05-08 02:54:57 -04:00
Thibaut Girka
eefef994e1 Fix wrong URI for the relay's followers collection 2019-03-28 17:21:53 +00:00
kaniini
44faf30162 Revert "Merge branch 'fix-html' into 'master'"
This reverts merge request !8
2019-01-17 23:04:07 +00:00
kaniini
10744d9191 Merge branch 'fix-html' into 'master'
Fix html

See merge request pleroma/relay!8
2019-01-17 23:02:53 +00:00
kjwon15
6b8c2354fd Add doctype to html 2019-01-09 22:17:01 +09:00
kaniini
190ccf27d1 http signatures: cache things we've already signed
this helps with the scatter/gather
2019-01-08 05:30:29 +00:00
kaniini
18b17f91e3 http signatures: hold actor keys in an LRU cache 2019-01-08 05:15:16 +00:00
kjwon15
65c80bca55 Merge branch 'upstream' 2018-12-29 13:41:14 +09:00
kaniini
950cd1e720 Merge branch 'feature/always-update-displayed-instance-list' into 'master'
Rebuild the list of instances that use this relay every time it is requested

See merge request pleroma/relay!6
2018-12-27 18:49:12 +00:00
kjwon15
c1f1cfe066 Add white list policy 2018-12-27 19:08:38 +09:00
kjwon15
a87c6c8220 Fix encoding 2018-12-27 19:08:38 +09:00
kjwon15
94a1b633e8 Fix GIT_REV on dokku 2018-12-27 19:08:28 +09:00
Jeong Arm
ef51db3a4a Fix encoding problem on actor 2018-12-27 09:07:20 +00:00
Finn Herzfeld
1d317e9b78 Rebuild the list of instances that use this relay every time / is requested 2018-12-10 14:14:43 -08:00
kaniini
008f43db2c nodeinfo: add commit hash to version field to prevent scams 2018-12-03 21:53:26 +00:00
kaniini
e44544d22e relay: add additional assertion proving that a message is never relayed back to it's origin 2018-12-03 20:26:46 +00:00
kaniini
c9cd9a8337 actor: handle remote actor fetch failures more gracefully 2018-11-20 01:10:43 +00:00
kaniini
3af63d4d9f relay: never relay an object back to the instance which hosts it 2018-11-20 00:42:31 +00:00
kaniini
b607e382cb relay: only import urlsplit from urllib.parse 2018-11-20 00:41:52 +00:00
kaniini
4623aaf5b6 relay: status, not status_code 2018-11-18 22:09:08 +00:00
kaniini
69dfb04131 remote_actor: cleanly catch exceptions while fetching actors 2018-11-18 22:07:12 +00:00
kaniini
e0d633b861 actor: cleanly catch exceptions while delivering messages 2018-11-18 22:05:41 +00:00
kaniini
ccd0e12b0a relay: track statistics 2018-11-18 22:03:53 +00:00
kaniini
379ba26478 relay: catch 202s 2018-11-18 21:29:10 +00:00
kaniini
3cc48dd3e8 manage: fix compile 2018-11-18 18:24:21 +00:00
kaniini
33868b1e19 nodeinfo: fix capitalization 2018-11-18 15:25:46 +00:00
kaniini
db52dd4af9 relay: add support for nodeinfo protocol 2018-11-18 15:05:13 +00:00
kaniini
0941c66f7c actor: implement loop breaking for follow handshake 2018-11-18 14:49:54 +00:00
kaniini
332fd6992e relay: add manage task, allows for following/unfollowing remote peers 2018-11-18 14:41:00 +00:00
kaniini
5871c40667 database: no longer store remote actors indefinitely in JSON-LD database, use hot cache instead 2018-11-18 14:25:04 +00:00
kaniini
692cf89195 actor: use LFU cache to break cycles 2018-11-18 14:20:17 +00:00
kaniini
9c55d307ab actor: remove pointless sharedInbox declaration (was not even in the right place) 2018-11-18 14:15:45 +00:00
kaniini
34e23f0ed7 actor: add LFUCache definition 2018-11-18 14:15:34 +00:00
kaniini
3c71a35b61 relay: actor: don't send (request-target) psuedo-header 2018-11-18 00:09:36 +00:00
kaniini
2f1eed51a1 relay: add http request debugger 2018-11-18 00:09:36 +00:00
tristan
d6d86bbf86 restore proper instance list on default page 2018-11-04 18:44:27 -08:00
tristan
d74fc15198 Revert "Revert "expose the list of registered targets to default page""
This reverts commit 51d2ab4e36.
2018-11-04 18:41:08 -08:00
Tristan Mahé
ee7f1cc190 do not use regex to parse instances, and add count of instances to default page 2018-11-01 14:49:48 -07:00
Tristan Mahé
39a255375e use urllib.parse.urlsplit instead of regex 2018-11-01 13:14:37 -07:00
Tristan Mahé
fb669f124f import re in database.py for removing blocked follow on load 2018-10-31 12:53:25 -07:00
Tristan Mahé
51d2ab4e36 Revert "expose the list of registered targets to default page"
This reverts commit b15665eb1f.
2018-10-31 12:32:10 -07:00
Tristan Mahé
64d8e34904 Revert "format instance name instead of inbox url"
This reverts commit 12af824b56.
2018-10-31 12:32:00 -07:00
Tristan Mahé
aa79a27840 very simple blocklist 2018-10-31 12:29:30 -07:00
Tristan Mahé
12af824b56 format instance name instead of inbox url 2018-10-31 11:58:10 -07:00
Tristan Mahé
b15665eb1f expose the list of registered targets to default page 2018-10-31 11:42:42 -07:00
kaniini
976da47539 relay: fix mastodon announce check 2018-10-31 02:39:48 +00:00
kaniini
48f3977ff7 relay: don't relay mastodon announces
relayed mastodon announces are likely to result in fake direction issues, which will
result in the author seeing side effects from the relay.
2018-10-31 02:37:08 +00:00
kaniini
29c3bf4b5a http signatures: immediately fail validation attempt if no actor keys can be found 2018-10-31 02:28:51 +00:00
Alynna Trypnotk
79c902ae55 Fixed note support 2018-10-31 02:23:47 +00:00
Alynna Trypnotk
6170cd5ab0 Fixed error with displaying note lol 2018-10-31 02:23:30 +00:00
Alynna Trypnotk
0e6967b34a Added options to change the default listen address and port. Added default page that explains how to use the relay. Added note option to add information about the relay content and/or TOS. 2018-10-31 02:23:09 +00:00
kaniini
827f3ee42a actor: only send litepub relay messages to debug level 2018-10-31 02:18:54 +00:00
kaniini
5fcdfbd596 http signatures: log when http signature validation fails 2018-10-31 02:14:01 +00:00
kaniini
6e493ca9e1 http signatures: handle fetch_actor_key failure more gracefully 2018-10-31 02:12:35 +00:00
kaniini
1e1b1127b8 actor: implement litepub relay protocol 2018-10-30 03:10:16 +00:00
kaniini
36749620ec actor: implement mastodon & pleroma relay handshakes 2018-10-30 02:49:38 +00:00
kaniini
5ab9ccf338 kill more irc bot stuff 2018-10-30 02:49:00 +00:00
kaniini
c91d0a6755 strip down to base AP code 2018-10-30 01:42:17 +00:00