Commit graph

2867 commits

Author SHA1 Message Date
Charles Hall
5c4d7bbe37
rewrite "Can I use it?" section 2024-12-13 17:00:10 -08:00
Charles Hall
1808ad66f4
document supported targets
This is also a good spot to link to the pre-built binaries. And since I
did that, I can also remove the bit about not publishing binary builds
from the introduction section.
2024-12-13 16:59:13 -08:00
Charles Hall
28a4483c6e
move conduit migration to installing section 2024-12-13 16:59:13 -08:00
Charles Hall
f831dfd1f1
add "Installing" chapter to the book 2024-12-13 16:59:13 -08:00
Olivia Lee
491518d2f3
add changelog entry for M_NOT_YET_UPLOADED when media is missing in fs
The first half of this change happened in !55, but we never added a
changelog entry until now.
2024-12-13 01:21:14 -08:00
Olivia Lee
795ce42518
return M_NOT_YET_UPLOADED when backing files are missing for a thumbnail
This was done for fetching original media files in
c70cfd3d25, but the change for thumbnails
was missed.
2024-12-13 01:21:14 -08:00
Olivia Lee
f216112455
don't treat media file open errors other than NotFound as missing media
For example, we want to return M_UNKNOWN and propagate the error if
somebody set up their database directory permissions wrong.
2024-12-13 01:21:05 -08:00
Olivia Lee
67f0689d73
move media file read/write logic to a helper function 2024-12-13 01:18:46 -08:00
Charles Hall
1e050c8983
expose static binaries in gitlab artifacts again 2024-12-11 14:37:43 -08:00
Charles Hall
94c1a39437
add a style guide 2024-12-11 14:01:38 -08:00
Charles Hall
42adad330e
move security info to its own page
This makes it easier to find.

Also sort the maintainers list while I'm here.
2024-12-11 13:26:16 -08:00
Charles Hall
3a10e23d94
move matrix link to introduction page 2024-12-11 13:25:12 -08:00
Charles Hall
cf067dbeb1
move changelog section above contributing 2024-12-11 13:25:07 -08:00
Olivia Lee
ba72616672
do not backoff remote device key queries when a request fails due to backoff
The previous logic would increment the backoff counter both when a
request actually fails and when we do not make a request because the
server was already in backoff. This lead to a positive feedback loop
where every request made while a server is in backoff increases the
backoff delay, making it impossible to recover from backoff unless the
entire backoff delay elapses with zero requests.
2024-12-11 13:02:11 -08:00
Olivia Lee
4ee8312068
reset device key query backoff after a successful request
Failing to reset the backoff state resulted in a monotonically
increasing backoff delay. If a remote server was temporarily
unavailable, we would have a persistently increased rate of key query
failures until the backoff state was reset by a server restart. If
enough key queries were attempted while the remote was unavailable, it
can accumulate an arbitrarily long backoff delay and effectively block
all future key queries to this server.
2024-12-11 13:02:10 -08:00
Olivia Lee
79cedccdb6
factor remote device key request logic into helper functions
This is pure code-motion, with no behavior changes. The new structure
will make it easier to fix the backoff behavior, and makes the code
somewhat less of a nightmare to follow.
2024-12-11 13:02:10 -08:00
Charles Hall
9e3738d330
run some jobs on the final commit only
These are too expensive to be worth running against all commits.
2024-12-11 11:39:20 -08:00
Charles Hall
f4dfb496e1
skip jobs that don't make artifacts on main branch
This is okay because we only allow fast-forward merges, changes always
go through MRs, and MRs are subject to, e.g., the code quality checks.
This change is desirable because it should save some time and energy.
2024-12-11 11:39:20 -08:00
Charles Hall
976aef690f
cache and skip commits that have passed already
Commits marked as passed can be re-run by changing their hash or
clearing the cache.
2024-12-11 11:39:20 -08:00
Charles Hall
2265b6615e
run ci for each commit
GitLab doesn't seem to have built-in support for this because of course
it doesn't.

To do this, we move the job scripts to a different file to make it
possible to share code between job scripts.
2024-12-11 11:39:20 -08:00
Charles Hall
a5eba45472
set owner write bit in pages job
This makes deleting the copied files easier.
2024-12-11 11:39:20 -08:00
Charles Hall
540cc89c83
move ci job scipts into an actual script
This will make it possible/easier to:

* share code between jobs
* run jobs locally
2024-12-11 11:39:20 -08:00
Charles Hall
d4ffa78979
make it possible to direnv exec . at top level
This way we don't have to be so careful about where we call `direnv
exec .` and can safely assume e.g. in scripts that we're always in the
direnv environment.
2024-12-11 11:39:20 -08:00
Charles Hall
a520c4e032
fix sorting in shell.nix 2024-12-11 11:39:20 -08:00
Charles Hall
554751917a
fix some minor documentation typos
* Capitalize Conduit and Grapevine
* Replace a "Not" with "Note"
* Change a "Conduit 0.7.0" to "Conduit <0.8.0"
* Expand "db" to "database" and "database schema" as appropriate
2024-12-11 10:08:55 -08:00
Lambda
daceadb310 sync/v3: factor out into separate functions
This is both easier to read and produces much better tracing spans.
2024-12-11 17:38:49 +00:00
Lambda
8a7f87e9b4 sync/v3: move readonly data to context struct
This makes it a lot easier to factor out parts of the big
sync_events_route().
2024-12-11 17:38:49 +00:00
Lambda
55a04f77c6 sync/v3: record relevant span fields 2024-12-11 17:38:49 +00:00
Lambda
79783ebe56 sync: split into separate files 2024-12-11 17:38:49 +00:00
Olivia Lee
c7011fb70d
added "can I use it" section to the docs
This was based on the similar section in the hedgedoc. I dropped the bit
about grapevine users getting banned from the conduwuit rooms cause we
haven't heard about that happening for a while and the original case was
pretty unclear.
2024-12-09 21:03:57 -08:00
Olivia Lee
eda34adef2
add conduit migration section to docs
Most of the database compatibility info came from Charles' notes
in #17.
2024-12-09 21:03:57 -08:00
Olivia Lee
54c25ceb3c
update docs link in the readme 2024-12-06 11:37:17 -08:00
Olivia Lee
26e986a89b
update olivia's gitlab and matrix usernames 2024-12-06 11:37:11 -08:00
Olivia Lee
a5fe9129f1
update media deletion entry in changelog 2024-12-01 16:18:05 -08:00
Olivia Lee
46e8a63489
allow deleting dangling thumbnails
Previously attempting to delete an MXC that is only associated with
dangling thumbnails would fail, because it assumes that every thumbnail
must have a corresponding original in the db, and errors out if it can't
find the original. This is incorrect because we create dangling
thumbnails when requesting a remote thumbnail over federation when we
don't have the original file.
2024-12-01 16:18:05 -08:00
Olivia Lee
916088a22f
include mxcs from dangling thumbnails in service::media::iter_all
When requesting remote thumbnails over federation, we can end up with a
thumbnail in the media db without an associated original file. Because
of this, skipping thumbnails is insufficient to get a list of all MXCs.
2024-12-01 16:18:04 -08:00
Olivia Lee
230192be1b
skip thumbnails with only one nonzero dimension in all_file_metadata
Previously we were only skipping thumbnails that had both dimensions
nonzero. I think the assumption was that only the dimensions allowed by
services::media::thumbnail_properties would be used. This is not the
case because we have used arbitrary thumbnail dimensions when requesting
remote thumbnails.
2024-12-01 16:18:04 -08:00
Olivia Lee
14b44064b3
propagate corrupted media key errors
Now that we are able to distinguish between corrupted media keys and
missing files, it makes more sense to propagate the corrupted keys up to
the caller.
2024-12-01 16:18:04 -08:00
Olivia Lee
f0f81db99b
return Option from media::data::search_file_metadata
This is useful to easily distinguish missing files from corrupted keys.
All existing usage sites have been modified so there is no behavior
change in this commit.
2024-12-01 16:18:04 -08:00
Charles Hall
861016ce0f
inline state accessor service code from data trait
These were all calling into services() and not actually directly
accessing the database at all anyway.
2024-12-01 09:13:50 -08:00
Charles Hall
ec01a84efb
add custom release profile with debuginfo enabled
This is primarily useful for profiling. Also change the nix package to
decide whether to strip based on whether the "release" profile is used.
2024-12-01 08:47:09 -08:00
Charles Hall
f0e41ade59
set rules for gitlab ci jobs
This should give us access to more CI variables. This also replaces our
usage of `only`, which is apparently deprecated.
2024-11-29 15:36:40 -08:00
Charles Hall
2f8e0e3e52
update rust dependencies
Ruma dropped a couple dependencies and includes a stateres performance
improvement. May as well pull in everything else (except OTel) while
we're at it.
2024-11-29 10:39:53 -08:00
Olivia Lee
8fcec6396e
keep going when one deletion fails in delete-remote-media
We *should* ensure that media deletion is always successful, but when a
bug causes a single object to fail deletion it's better to try to delete
the remaining objects than to give up entirely.
2024-11-28 18:32:05 -08:00
Olivia Lee
11b5055647
log details of failed media deletion 2024-11-28 18:32:05 -08:00
Olivia Lee
bdb623cb07
add comment explaining that failed media keys are logged 2024-11-28 16:46:54 -08:00
Olivia Lee
ed789e6536
show count of corrupted media keys in delete-remote-media command 2024-11-28 15:55:20 -08:00
Olivia Lee
79bc2525e3
add unit tests for media key parsing
We've had at least a couple media key parsing bugs. Let's get a *little*
more confidence that this code works :)
2024-11-27 22:24:54 -08:00
Olivia Lee
103a4fb56b
handle media keys where thumbnail size contains 0xFF
Our current code should never write these, because we have an allowlist
of thumbnail sizes. None of the allowed sizes contain a 0xFF byte. We
have observed keys with a 0xFF in the thumbnail size a couple times on
real servers, and believe an early version of conduit wrote these before
the allowlist was added.

These keys were originally handled correctly, and were broken by
e2cba15ed2. Before that commit, we were
parsing media keys backwards, and never tried to read the thumbnail size
or mxc url.
2024-11-27 22:15:07 -08:00
Charles Hall
2bf1975e75
add flake output for the website root 2024-11-22 11:21:39 -08:00