Commit graph

91 commits

Author SHA1 Message Date
fef
a0d2dc4151
refactor model IDs to use safe types
This is a major refactor that introduces a new
generic type Id<T, I> for tagging any ID with the
model they reference without any runtime overhead.
From now on, it should be pretty much impossible
to pass e.g. a note ID to a function that expects,
say, an account ID.

Furthermore, the follow and like tables have been
simplified to use the two IDs that define the
relationship as a composite primary key.

Finally, likes now have a memory cache.
2023-01-20 16:45:12 +01:00
fef
7845fb3680
data: refactor memcache 2023-01-20 12:37:03 +01:00
fef
2c96fa702e
conf: cargo fmt 2023-01-19 15:00:00 +01:00
fef
4bcaaa8f2f
ap/loader: fix tests
This removes some accidental bugs from mindlessly
retyping the original code as well as some
copy-paste errors.
Also adds tests for nyanoblog's extensions.
2023-01-19 14:59:31 +01:00
fef
605a7caa2c
util: refactor HTTP request API 2023-01-19 14:39:39 +01:00
fef
20b5cc32cc
core: move errors to separate module 2023-01-19 12:43:57 +01:00
fef
64739eeead
ap: add proper document loader
This still lacks caching, but it is slightly more
advanced than just using the ReqwestLoader that
the json_ld crate provides.
2023-01-18 20:04:14 +01:00
fef
7124590ff3
util: add reqwest wrapper 2023-01-18 19:56:19 +01:00
fef
da603511c4
cargo: update json-ld to 0.12 2023-01-18 11:50:44 +01:00
fef
af08336532
memcache: generalize indexing
This should also improve performance a little
because entries are now behind an Arc, so the
lock has to be held for shorter time periods.
2023-01-17 16:57:16 +01:00
fef
a07123f876
prevent unnecessary JWT key duplication
The HMAC secret was stored as raw bytes in the
config object, which required creating an
entirely new DecodingKey and EncodingKey struct
every whenever checking the password.
This patch stores these structures directly in
the config object, preventing new allocations.
2023-01-17 12:26:56 +01:00
fef
0000137461
web: refactor local globe icon 2023-01-10 16:08:31 +01:00
fef
d4be43c06f
web: improve button squishiness 2023-01-10 12:35:37 +01:00
fef
4c15d2ffc1
add favourite and unfavourite endpoints 2022-12-27 04:37:38 +01:00
fef
922fa83772
add some status endpoints 2022-12-27 04:18:20 +01:00
fef
aaf4ab53b7
memcache: support deleting stuff 2022-12-27 04:00:20 +01:00
fef
ef1bdfcf7c
data: add content_type field to notes 2022-12-27 02:30:03 +01:00
fef
56db49bdfe
cargussy format 2022-12-27 02:17:02 +01:00
fef
5b985b0059
add stub ActivityStreams inbox endpoint & worker 2022-12-27 02:16:29 +01:00
fef
6e81a7198b
job: improve docs a little 2022-12-27 01:53:13 +01:00
fef
e387e43dab
add API entities and more accounts endpoints 2022-12-27 01:52:28 +01:00
fef
8ea3ebda54
data: add in-memory cache 2022-12-26 15:42:47 +01:00
fef
9eb7601f9d
add LOCAL_DOMAIN config value 2022-12-25 18:33:32 +01:00
fef
0d9504ca3b
add objects table 2022-12-25 18:29:33 +01:00
fef
f1a631efff
data: remove unnecessary generics
The repository layer is the central gateway to
the data storage subsystem, so it should also be
solely responsible for transforming data coming
from the rest of the app into the appropriate
format.
2022-12-25 18:11:45 +01:00
fef
4f542571e0
add iri column 2022-12-25 15:57:33 +01:00
fef
93182705d9
data: return newly crated entries in SQL 2022-12-25 05:19:08 +01:00
fef
fb8bf0f316
job: retry on failure, general refactor 2022-12-25 04:13:06 +01:00
fef
055a97a8e1
ap: add base object type 2022-12-22 19:12:33 +01:00
fef
6a4e753069
util: fix type 2022-12-22 18:57:01 +01:00
fef
369780f48f
ap: add tests for context 2022-12-22 13:44:18 +01:00
fef
e568927d4b
ap: add well-known NS URIs 2022-12-22 13:36:48 +01:00
fef
28b36a20b4
ap: refactor context deserialization 2022-12-21 01:24:04 +01:00
fef
9be5fa9a2c
ap: add @context implementation
I'm calling it now, the path to ActivityPub
compliance is going to be an excruciatingly
painful one.
2022-12-20 20:33:57 +01:00
fef
a5b097bce5
implement validate for bearcaps 2022-12-20 14:09:19 +01:00
fef
64e670480a
add bearcap utility 2022-12-20 14:00:41 +01:00
fef
4e9a09f74b
refactor password hash API 2022-12-20 13:24:08 +01:00
fef
271a912879
add auth middleware and identity endpoint 2022-12-19 21:43:12 +01:00
fef
d6fc5d373a
add auth endpoint 2022-12-19 15:49:39 +01:00
fef
41b27830b9
add signup endpoint 2022-12-19 15:47:40 +01:00
fef
776cbe6d52
add even more fields to user schema 2022-12-19 15:45:03 +01:00
fef
eccf4810a9
add some documentation for top-level modules 2022-12-19 13:45:37 +01:00
fef
808b03b817
add source to notes schema 2022-12-18 17:38:19 +01:00
fef
44807f408f
include JWT secret in default config 2022-12-18 17:11:51 +01:00
fef
a3de1942c8
add JWT stuff 2022-12-18 17:09:08 +01:00
fef
061e4ecb57
fucking javascript 2022-12-16 05:05:02 +01:00
fef
d26ef10958
web: add redux store 2022-12-16 03:33:02 +01:00
fef
51ffb6fe71
web: rework text box shadows (again) 2022-12-16 02:15:57 +01:00
fef
3df29a3cf3
web: add dummy timeline 2022-12-16 02:05:06 +01:00
fef
3523bc86c7
web: add footer 2022-12-14 05:17:07 +01:00