Commit graph

2781 commits

Author SHA1 Message Date
Charles Hall
e11e27bc0c
don't try to set version extra outside flakes
The two attributes being accessed here don't exist when calling though
flake-compat, so we need to handle that case by making the environment
variable unset if neither attribute exists.
2025-03-02 10:54:56 -08:00
Olivia Lee
57c79b1999
Fix native compilation on aarch64
Turns out fenix.packages.aarch64-linux.targets.x86_64-*.minimal.rustc
is an x86_64 compiler. The only component that you actually need to pull
from 'targets' for cross compilation is rust-std.

Because x86_64-unknown-linux-gnu is first in the target list, we were
getting x86 rustc and cargo binaries, making it impossible to compile
grapevine on an aarch64 host.

We were also missing aarch64-unknown-linux-gnu in the targets list,
which is used by the default package on a aarch64 host.
2025-03-02 01:20:51 -08:00
Lambda
65ec500d75 Enable useful new clippy lints
Picked from this filtered list:
https://rust-lang.github.io/rust-clippy/master/index.html?versions=gte%3A82%2Clte%3A84&levels=allow&groups=cargo%2Ccomplexity%2Ccorrectness%2Cnursery%2Cperf%2Crestriction%2Cstyle%2Csuspicious
2025-02-18 17:06:08 +00:00
Lambda
175a62007d Update MSRV to 1.84.0
And appease clippy (`__CARGO_FIX_YOLO=1 cargo clippy --fix` plus some
manual type shuffling).
2025-02-18 17:06:08 +00:00
Lambda
5616510727 Use UInt instead of u32 for max request size
Sometimes you just really want to upload a full disk image as media.
2025-02-18 16:48:47 +00:00
Lambda
99924e5779 Add admin commands to get and reset tracing filters 2025-02-17 17:41:14 +00:00
Lambda
5eab758bd2 Make tracing filter reload handles mutable
Makes the following diff nicer.
2025-02-17 17:40:55 +00:00
Olivia Lee
4cc390345a
don't markdownlint ignored files
I like to put a bunch of untracked stuff in a /scratch directory for
each project, and then puth /scratch in my global gitignore. There are
usually some markdown notes files in here that I don't care about style
for. The previous markdownlint invokation didn't respect the global
gitignore, making local 'engage' runs kinda useless due to false
positives from the scratch dir.
2025-01-23 13:04:59 -08:00
Olivia Lee
472f51c350
allow adding canonical aliases from remote servers
Like is mentioned in the comment, this isn't explicitly required by the
spec, but it's reasonable and what synapse does.
2025-01-23 09:20:10 -08:00
Olivia Lee
29d8fbaefa
only validate canonical aliases that are new
Previously we required every alias in a canonical alias event sent by a
client to be valid, and would only validate local aliases. This
prevented clients from adding/removing canonical aliases if there were
existing remote or invalid aliases.
2025-01-23 09:20:10 -08:00
Olivia Lee
50c1e77cd6
factor canonical alias event validation into a helper function
Not all the semantics from the spec quote in the doc comment are
implemented yet.
2025-01-23 09:20:10 -08:00
Olivia Lee
051221c0ab
validate schema of new canonical alias events sent by clients
Previously, we would only attempt to validate the aliases in the event
content if we were able to parse the event, and would silently allow it
otherwise.
2025-01-23 09:20:10 -08:00
Olivia Lee
c748c7c188
return M_BAD_ALIAS when trying to set non-existent canonical aliases
This is the error code named in the spec.
2025-01-20 16:59:01 -08:00
Charles Hall
8537c0e8ac
rearrange introduction
I think it's most important for people to read the "Chat with us", "Can
I use it?" and "Expectations management" sections, though I'm not sure
what the best ordering is. This is probably fine.
2024-12-13 17:00:37 -08:00
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