Commit graph

529 commits

Author SHA1 Message Date
84a446b494
fix: answer deletions with 200 2024-05-01 18:43:43 +02:00
bb4f6e9df0
fix: show follow/by for remote users too
this is super ugly because there's a ton of duplication but let's see if
it works first...
2024-05-01 18:37:26 +02:00
4527ff884e
feat: show in user queries if follow/by self 2024-05-01 17:47:37 +02:00
75d03195d9
feat: allow checking if identity is someone 2024-05-01 17:47:21 +02:00
e8b36cecdf
chore: should move this later 2024-04-30 16:51:30 +02:00
f2dc3f69f2
chore: refactor, moved cli tasks under directory 2024-04-30 16:48:28 +02:00
b0ebeb9fff
fix: mastodont sized 2024-04-30 16:48:00 +02:00
6f033de946
fix: try fetching following/followers, dont fail 2024-04-30 16:47:34 +02:00
938d219d7d
fix: whoops other way around 2024-04-30 15:33:41 +02:00
a6c3ef9a3e
feat: increment statuses count
be it when posting, receiving a Create or fetching an object, increment
relevant user statuses count
2024-04-30 14:22:44 +02:00
a966f7fcb5
fix: fetch remote users following/followers count 2024-04-30 14:17:29 +02:00
0bfa49fed6
chore: imports 2024-04-30 04:29:03 +02:00
3237a38d74
fix: insert liked element also in single obj view 2024-04-30 02:57:50 +02:00
8af2cd2664
fix: maybe don't filter whole queries 2024-04-30 02:05:28 +02:00
a4cdd2e67b
feat: show followers, following, statuses in users 2024-04-30 01:51:38 +02:00
45d16fa0a3
feat: query and show objects liked by you
it shows it in quite a jank way: inside the "audience" collections you
find your id as only item. it's weird af but technically valid ap i
think? will probably be replaced with a local api extension as soon as i
read about those
2024-04-30 01:50:25 +02:00
63ba54dad9
fix: activity redirects when fetching different id 2024-04-30 01:49:05 +02:00
3df01b5b0a
chore: helper to reconstruct ids 2024-04-30 01:48:30 +02:00
f0cdd4bd7a
feat: like and share relations with object 2024-04-30 00:53:57 +02:00
97ed5d60b1
feat: show users following/followers
use audience for followers, generator for following and replies for
total statuses count. restored followers, following and outbox as bare
links. silly AP!!!
2024-04-30 00:53:07 +02:00
5bdf139ef5
chore: imports 2024-04-29 22:02:18 +02:00
7f996aa2c1
feat: kinda botched way to ignore relays
basically relays send us a lot of announce activities to share posts
but we don't care about those activities: it's db bloat and it increases
the shares count. keep a table keeping track of followed relays and
lazily skip activities by them, just fetch. IMPORTANT relays are only
loaded at startup, so if you subscribe to a new relay restart your
server once it accepts!!!
2024-04-29 21:58:08 +02:00
a6e12468b7
fix: db fix tasks would get stuck on sqlite
i think because the db would end up locked, added brackets to be sure to
drop the streaming reference. also it could crash when updating records
not found, just spit a warn
2024-04-29 21:23:12 +02:00
e4b92584db
chore: imports, renamed future routes 2024-04-29 21:23:02 +02:00
3e0e4ff8d3
fix: also update comments count when fetching 2024-04-29 21:22:48 +02:00
35804730de
fix: temporarily don't set replies
we don't serve those routes yet
2024-04-29 21:02:41 +02:00
3129970fb5
feat: added fix task to recalculate stats
note that won't reset everything to 0, just force set every post which
has a count != 0
also this is kind of a bad way to do it. at least we stream objects, but
we could have it happen all inside our db with SELECT, DISTINCT and SUM,
i just don't know how to represent it in sea_orm. an intermediate
optimization may be selecting only certain columns but it's relevant
almost only for replies
2024-04-29 20:53:19 +02:00
4fe53f7011
fix: increment share and like counters for outbox 2024-04-29 20:40:20 +02:00
5ae9a140b4
feat: show likes and shares and replies in objects
it's done with anonymous inline collections, which hold a "totalItems"
field. for replies it's perfect, for likes it's stretched ("audience",
used as a Collection) and for shares it's really stretched ("generator",
used as a Collection). also using audience and generator as collections
seems weird because they should be objects but collections are objects
so it should be fine? i haven't seen these fields used anyway so it
should be safe to "claim" it for ourselves?
2024-04-29 20:30:29 +02:00
95f9d05875
fix: redirect after fetching if id is different
for example, pleroma servers objects under /notice/abcd... but the
object id itself is different, under /objects/<uuid>. when fetching
pleroma redirects, but we get unreliable behavior. redirect so that we
can force clients to use the proper id
2024-04-29 20:11:19 +02:00
ab91a4c7bc
fix: your inbox contains posts by you 2024-04-26 13:48:57 +02:00
ed0a4fd211
fix: always forget about this... 2024-04-24 05:21:04 +02:00
3156b8d2d2
feat: sensitive field
this is not part of activitystreams afaik and should not be in apub but
it's quite convenient to do it this way sooooooooooo for now will do
2024-04-24 05:19:39 +02:00
abf4e8b370
fix: always embed specific activities 2024-04-24 05:04:30 +02:00
2ba96e802e
fix: show own activities/objects 2024-04-24 04:08:07 +02:00
768081c251
fix: big refactor of timelines querying
should not be more reliable, consistent and all around less buggy, but
it may actually break some things so let's find out
2024-04-24 02:32:23 +02:00
165bf19f8c
feat: don't add next link when done paginating 2024-04-23 23:37:57 +02:00
ba07b2cb9d
fix(apb): correct node order when iterating
use a VecDeque under the hood to be able to pop_front()
2024-04-23 20:58:37 +02:00
4b4d52ef6f
feat: fetch related things
fetching an object will get its author
fetching an activity will get its object and author
2024-04-23 17:56:46 +02:00
597dee934d
fix: try hiding locked activities for public objs
idk if this works but basically when there's a public object from a
private activity, the query joins the activity anyway because it uses
the object relation, try using the addressing relation and see what
comes out
2024-04-23 17:21:32 +02:00
8a6c05f4fb
fix: relay follow/accept are public 2024-04-23 16:54:03 +02:00
2a9cf5bcf5
feat: command to also accept relay follow reqs
this has quite awful UX because you can't really know if relay is
following back without checking logs, but whatevvvv works for now
2024-04-23 16:26:19 +02:00
dfbadf5d11
fix: oops i meant server inbox GET, now it is 2024-04-23 06:29:52 +02:00
2bf4469270
feat: server timeline is object-based 2024-04-23 06:21:02 +02:00
70920985cf
fix: use hs2019 instead of rsa-sha256
im not sure why but apparently there's some bug somewhere? maybe some
instances are picky and want the new thing? should still be fine using
sha256 as signing tho
2024-04-23 05:46:48 +02:00
1731bcb1c6
fix: remove again trailing slash 2024-04-23 05:31:19 +02:00
2cb6cfd2f1
fix: well-known nodeinfo base url 2024-04-23 05:29:26 +02:00
8b88d24250
fix: show signature when invalid 2024-04-23 05:19:24 +02:00
e316e1a840
fix: also change main key name for actor 2024-04-23 05:07:04 +02:00
4f8132a642
fix: dispatcher check doesn't include trailing 2024-04-23 05:01:59 +02:00
8150b9082d
fix: proper addressing, ctx.base() with trailing /
maybe aode-relay (and rust IRI parser) goes mad if there's no
trailing slash? idk, i'm speculating
2024-04-23 04:56:29 +02:00
63d78e7ff5
fix: delete with filters instead of activemodel 2024-04-23 04:24:27 +02:00
43d5571b27
feat: better error mappings to http 2024-04-23 04:07:32 +02:00
377ed9665d
fix: set published before converting to model
user may not have set it and we overwrite it anyway. id instead is
necessary, so if it's not given we should return 500
2024-04-23 03:59:27 +02:00
867740b2e6
fix: actually hook up all outbox actions 2024-04-23 03:45:50 +02:00
852b45f8dd
fix: also fix context for fetched objects 2024-04-23 03:04:54 +02:00
46de9aebd6
feat: implemented update, delete, announce outbox 2024-04-22 22:52:19 +02:00
8dece0f004
feat: implemented authed inbox 2024-04-22 22:52:05 +02:00
3c6b2ae3e6
fix: don't embed remote objects when dispatching
weak check but should still save some bytes
2024-04-22 22:42:00 +02:00
b62b461305
fix: dispatcher fetch app key for app deliveries 2024-04-22 04:23:11 +02:00
1d8b69dda7
fix: try setting digest always
aode relay complains that digest is missing on fetches? idk, let's try
putting an empty digest, will aode work? will mastodon/akkoma still
work? will this fix some *keys too???
2024-04-22 04:11:59 +02:00
4d0fb9b684
fix: pass actor, inbox gets resolved automatically 2024-04-22 04:03:47 +02:00
32707bda0c
feat: added command to follow relays 2024-04-22 03:56:07 +02:00
87a5a77e19
chore: imports 2024-04-22 02:52:18 +02:00
f2f7b51fdc
feat: order by publish date, not discovery
also centralized ordering inside select_* queries
2024-04-22 02:49:04 +02:00
b6f10e9cc1
fix: webfinger for application returns itself 2024-04-22 01:51:37 +02:00
dfec715594
chore: comments, clearer code 2024-04-22 01:01:42 +02:00
e9a19b3cb4
feat: fetch threads recursively up to 16 2024-04-22 00:43:17 +02:00
d575ef0bef
fix: add endpoints and preferred username to app 2024-04-22 00:37:21 +02:00
e8dd15f8bd
fix: also context gives full objects
would clear local cached image oof
2024-04-22 00:16:40 +02:00
96524dbd6f
fix: cheap fix for mastodon contexts 2024-04-22 00:01:09 +02:00
cc287d3aa4
feat: show attachments in inbox, outbox and /object
attachments are lazy loaded, so it may be efficient if not all posts
have media, but it should probably be eager loaded anyway eventually
2024-04-21 23:22:55 +02:00
c595f5f5e3
feat: process and store remote attachment urls 2024-04-21 22:58:33 +02:00
cd9d3f9db4
fix: use preferred_username before using url 2024-04-21 21:15:58 +02:00
624492bcfb
feat: introduced arbitrary fetch route for users 2024-04-21 19:15:47 +02:00
48bba8af40
feat: root url redirects browsers to /web 2024-04-21 19:01:51 +02:00
4e5e8f8532
fix: use WrappedObject type for context query 2024-04-21 17:11:50 +02:00
645e14cc32
fix: ops wrong relation direction 2024-04-21 16:39:56 +02:00
a083edef6e
fix: sqlite won't update columns anyway
since this migration breaks all sqlite dbs, i changed the original
migration so that future ones won't panic when reaching here. note that,
if you are on sqlite, just `sqlite3 <your_db> .dump > backup.sql` and
then, after rebuilding and re-migrating db, `cat backup.sql | sqlite3 <your_db>`
2024-04-21 16:30:29 +02:00
46a2e53da0
fix: use wrapped object since we ask for more cols 2024-04-21 16:14:47 +02:00
5d501a3018
fix: renamed methods 2024-04-21 15:42:15 +02:00
379b4daa84
fix: don't create mock activities
basically remade addressing table so that activity too can be null
2024-04-21 15:41:29 +02:00
fa74c3dd0a
chore: imports 2024-04-20 04:34:47 +02:00
6c3aead68b
feat: handle announces 2024-04-20 04:33:23 +02:00
f3dcbffeca
feat: parse object comments count from replies 2024-04-20 04:26:31 +02:00
1ca97668a1
chore: new helper, renamed base->domain 2024-04-20 04:26:16 +02:00
4d4cbe0ef8
feat: create mock activities for fetched objects 2024-04-20 04:24:48 +02:00
2d10f29b56
fix: restore federation, remove embedded follow___
it was so good, why make **just these** only links?????
2024-04-19 18:31:20 +02:00
b338a7191f
fix: jfc mastodon stop sending me deletions!!!!!!! 2024-04-19 16:15:05 +02:00
01d0e4df85
fix: context and replies and follow___ /page 2024-04-19 06:57:01 +02:00
789fae1eae
fix: oops revert! breaks querying
probably im doing it wrong somewhere else but nonetheless fuck go back
2024-04-19 06:21:26 +02:00
bccf1f3a26
fix: ensure viewer has perms even for fetches
before, the first fetch would bypass addressing checks. now we always do
2 trips to db when viewing+fetching remote stuff: 1st to make sure we
  have it, second to make sure we can view it
2024-04-19 05:26:51 +02:00
d7ff6014c4
fix: select_object doesnt return embeddedactivity 2024-04-19 05:05:26 +02:00
4883597ee3
fix: don't rename columns while joining 2024-04-19 05:02:59 +02:00
629990fee8
fix: find objects not activities 2024-04-19 04:57:06 +02:00
ab5d0cb61a
fix: replies only in object view, page uris 2024-04-19 04:42:43 +02:00
67c4051226
feat: add context to outgoing posts 2024-04-19 04:25:17 +02:00
973a3060ac
feat: show replies collection inline with object 2024-04-19 04:04:19 +02:00
13533a58d9
feat: fetch replied posts, increase comment count 2024-04-19 04:03:57 +02:00
39add30876
chore: merge branch 'dev' of alemi.dev into dev 2024-04-19 03:32:56 +02:00
b3460690d9
feat: added /objects/.../replies collections
really not optimized, same with context, but may work?
2024-04-19 03:32:21 +02:00
b51f013138
feat: added context collections and endpoints 2024-04-19 03:29:28 +02:00
dfe116506a
chore: refactor
moved into models converters to ap objects, single conditions are now
direct column checks
2024-04-19 03:28:39 +02:00
fc6aedbca1 fix: track deletions and rejected activities 2024-04-18 14:01:55 +02:00
a4c555d0c5 fix: deliveries will try to resolve actor inbox 2024-04-18 07:02:42 +02:00
2073015b7f
feat: mock oauth login wellknown
looks like we will need oauth soon to be able to use even andstatus
2024-04-18 05:49:17 +02:00
f4252a2fbf
fix: insert addressings after fetching
also refactored fetcher into a trait of context
2024-04-18 05:25:56 +02:00
93b5c0cd4a
fix: only fetch remote objects to avoid recursion 2024-04-18 04:50:06 +02:00
3a79ca05a2
feat: local users can request to fetch remote stuff 2024-04-18 04:48:49 +02:00
b2e6703b0e
feat: also fetch liked posts 2024-04-18 04:38:21 +02:00
5f8d8be05a
fix: show in_reply_to and statuses count 2024-04-18 04:14:16 +02:00
a897edd310
feat: add statuses count and in_reply_to fields
migration + models update
2024-04-18 04:09:13 +02:00
094a8b957c
fix: increase follow counts on Accept
both for inbox and outbox
2024-04-18 03:41:27 +02:00
45a69f0332
feat: show following/followers counts for users 2024-04-18 03:06:56 +02:00
8721a44354
feat: helper methods to handle auth cases 2024-04-18 03:06:40 +02:00
8aa80c7670
fix: faker inserts addressing too 2024-04-17 22:08:41 +02:00
267840a317
fix: not all keys are #main-key 2024-04-16 19:19:49 +02:00
dab4550d08
fix: show outbox for remote users with url trick 2024-04-16 08:04:08 +02:00
3cf401467e
feat: login tells you who you are 2024-04-15 22:29:55 +02:00
d5a83a5c7c
fix: attempt to select only one addressing 2024-04-15 22:10:49 +02:00
ee26596568
feat: allow to resolve local views of remote things
basically any id prefixed with + will be:
 * prefixed with 'https://'
 * have all '@' replaced with '/'
 * not be normalized with local domain patterns
thus allowing to look up kind of any url in our db

this is kinda reinventing the wheel, but i really don't want to have
local-only ids and would much rather have a local-only way to display
them, because at least everyone can understand it and look up anything
remote easily
2024-04-15 21:36:31 +02:00
f1ff946245
fix: also store public addrs for remote activities
oopsss thank you @prefetcher
2024-04-15 21:29:30 +02:00
a5454af7a3
chore: skeleton routes for likes&co and context 2024-04-15 01:56:54 +02:00
586f8d3f97
chore: unused imports 2024-04-14 16:57:36 +02:00
fd98864606
chore: some work on mastodon statuses route 2024-04-14 16:49:38 +02:00
b1b0aee2f9
feat: process some Undo activities, small refactor 2024-04-14 16:47:36 +02:00
b99ca9fa7e
feat: ignore deletions for GONE users
mastodon is quite spammy omg
2024-04-14 16:05:44 +02:00
19598aaffd
fix: order
was it just me being silly displaying it??? lol
2024-04-14 06:43:21 +02:00
8a14600311
fix: proper addressing creation for likes 2024-04-14 05:53:36 +02:00
b11da7f3c0
fix: oops i mixed up some fields 2024-04-14 03:48:37 +02:00
a735e16f73
fix: image and icon live under url 2024-04-14 03:39:52 +02:00
8b10bde544
feat: more consistent way to view remote users 2024-04-14 02:36:59 +02:00
6613f337ce
feat: cors and tracing layers 2024-04-13 22:31:46 +02:00
4d44688564
feat: dump json to stdout after fetching 2024-04-13 22:17:35 +02:00
c9a20b4e65
feat: node.fetch() is now signed 2024-04-13 22:13:36 +02:00
2e8d4323ee
fix: don't repeat (request-target) 2024-04-13 21:35:53 +02:00
027040604c
feat: improved http signatures code 2024-04-13 21:22:19 +02:00
f29d3baeb9
fix: name is nullable, preferredUsername is not 2024-04-13 16:43:19 +02:00
7f66851136
fix: Path<()>, not Path<>, Path<> 2024-04-13 06:55:16 +02:00
fc488e6b2f
feat: route for viewing specifically remote users
WIP, will probably go away in favor of a uniform route
2024-04-13 06:50:04 +02:00
9c9b5ec380
fix: standard base64 2024-04-13 06:06:05 +02:00
5d3c222774
fix: verify_oneshot, maybe makes a difference? 2024-04-13 06:02:50 +02:00
652af15771
fix: include method in request target 2024-04-13 05:36:29 +02:00
437859008c
feat: reimplemented from scratch http sig verify 2024-04-13 05:26:50 +02:00
6614f63f56
fix: added inbox and outbox to main app actor 2024-04-13 04:42:46 +02:00
72774d01ed
fix: also in case of digest 2024-04-13 04:31:50 +02:00
5f66ca4946
fix: oh my god if it was this ... 2024-04-13 04:31:36 +02:00
80d324ae03
fix: use method, don't hardcode "post" 2024-04-13 04:24:22 +02:00
1caaa08f78
fix: fetcher specifies application/json 2024-04-13 04:21:33 +02:00
2031d8de41
fix: upub error reports status codes as-is 2024-04-13 04:08:45 +02:00
861cd2297b
fix: why is it throwing 500??? 2024-04-13 03:47:04 +02:00
b4e82b551b
fix: going back to manual http signatures
at least those worked, what the fuck is up with this lib technology...
2024-04-13 03:41:36 +02:00
d60d29bf98
fix: continue as anon if can't fetch user 2024-04-13 03:31:37 +02:00
c342b7c936
fix: object view
quite wasteful to do it like this but for some reason previous way
didn't work??
2024-04-13 03:28:52 +02:00
bb16a5b7d2
fix: return response rather than parsing
so that deliveries work
2024-04-13 03:21:25 +02:00
855434ee12
fix: try using again the new lib? 2024-04-13 03:09:47 +02:00
3a48e91655
fix: force overrule signature algorithm
really what?????
2024-04-13 03:03:54 +02:00
70c978caa0
fix: having more fun with http signatures 2024-04-13 02:55:10 +02:00
ff55d2fea4
fix: mastodon compat 2024-04-13 02:35:18 +02:00
46bbeea3ab
feat: verify inbox http signatures 2024-04-13 01:49:23 +02:00
d66f09d130
feat: inbox requests remote server auth 2024-04-13 01:49:04 +02:00
5863bdf04e
feat: signed fetches, improved signatures code
should make sure that it still works
2024-04-13 00:44:53 +02:00
95ab7a50ef
chore: refactored a little 2024-04-12 22:56:29 +02:00
576e809b69
fix: timelines ordering
what??? ASCENDING goes from most recent to least recent?? maybe
ascending oldness??????
2024-04-12 22:41:04 +02:00
d3d5f98dfd
feat: authorized fetch on activities and objects 2024-04-12 22:21:23 +02:00
4e34446894
fix: oops must be generic impl 2024-04-12 21:55:19 +02:00
5de807b3d9
fix: don't clear audiences
still quite jank way to do it but at least should work again?
2024-04-12 21:42:06 +02:00
ca59c30e70
fix: auth filter conditions any, not all 2024-04-12 21:18:01 +02:00
0fa88e51e6
feat: added all inboxes and outboxes
base POST to /outbox still returns NOT IMPLEMENTED tho
2024-04-12 20:01:47 +02:00
af8d11e75b
feat: inbox/outbox security and obj embedding 2024-04-12 19:36:00 +02:00
0d340185cf
feat: improved addressing select 2024-04-12 19:35:26 +02:00
3a874ed3e7
fix: insert activities, expand addressing
remote activities for Likes and Follows should still be added to our
database so we know where to verify those and we can present them in a
timeline for notifications
2024-04-12 18:40:24 +02:00
9e67eead69
feat: multi-join maybe? fix inbox not embedding obj
got this from https://github.com/SeaQL/sea-orm/discussions/1502, not
sure it's what i need but i'm trying some stuff
2024-04-11 17:00:09 +02:00
d5c5d341e8
fix: ownerships 2024-04-11 16:59:47 +02:00
0261f87306
feat: first mastodon route yay, mastodon default on 2024-04-11 00:52:44 +02:00
86e84d88aa
chore: updated apb things, restructured a bit 2024-04-11 00:29:32 +02:00
4c2eb7b990
chore: better routing structure 2024-04-09 04:35:57 +02:00
bb26ff763d
chore: restructured completely
kinda MVC:
Model -> model
View -> routes
Controller -> server
2024-04-09 01:14:48 +02:00
20ca18f9e3
chore: also modularized APInbox 2024-04-08 02:55:21 +02:00
7ce872cfff
chore: separated outbox business logic in methods
dumped all in server but temporary, now can be properly modularized
also fixed endpoints
2024-04-08 02:30:43 +02:00
24d547e93a
feat: subdivide into features 2024-04-06 18:03:13 +02:00
a624222751
feat: listed half of mastodon's api routes 2024-04-06 17:20:44 +02:00
ca871a867f
docs: some readmes
pretty useless but at least they're there
2024-04-06 17:20:14 +02:00
520c8eff3a
feat: separated apb types into crate, reworked
no more "impl ..." hell, each trait has associated types so that we know
it's a "Self::Link" or a "Self::Actor", but in practice they can both be
a "serde_json::Value" and thus we can change its type. also Node::Array
is now a Vec<T> rather than Vec<Node<T>> because it makes more sense.
Node is Iterable and will yield zero (Empty|Link), one (Object) or many
(Array) Ts
2024-04-06 16:56:13 +02:00
b5867b90ac
feat: accept also bare note to publish 2024-03-28 05:24:38 +01:00
0ec839f42f
fix: followers was wrong because full model 2024-03-28 05:19:13 +01:00
3725097749
fix: followers querying with full id 2024-03-28 05:14:50 +01:00
d7efbf5131
chore: imports cleanup 2024-03-28 05:14:17 +01:00
e68332bc31
chore: refactor collections with utils, moved stuff 2024-03-28 04:52:17 +01:00
68823559c1
feat: process updates for notes and users 2024-03-28 04:47:49 +01:00
5bad5e0405
fix: more lenient nodeinfo 2024-03-28 04:05:47 +01:00
4274367285
feat: immediately wakeup dispatcher when sending 2024-03-27 05:09:20 +01:00
70c1f96959
fix: maybe fix for expanding addressings 2024-03-27 04:46:57 +01:00
746c5e5921
fix: log follow request accept/reject 2024-03-27 04:40:50 +01:00
bd4d123223
fix: less extreme logging for deliveries 2024-03-27 04:38:14 +01:00
742c769014
fix: filter out empty targets 2024-03-27 04:36:46 +01:00
625b8e0e02
fix: when missing embedded object still show url! 2024-03-27 04:28:09 +01:00
fe30ad59d7
feat: normalized pagination 2024-03-27 04:23:42 +01:00
139e973277
fix: don't insert when there's nothing to insert 2024-03-27 04:13:29 +01:00
ac2c86f16e
feat: crude implementation of most inbox flows 2024-03-27 04:00:27 +01:00