Benjamin Lee
a909e2079b
config options for log format and color usage
...
We want to be able to disable colors for complement logs (since they
are likely to be opened in a text editor). There's no pressing need for
alternative log formats, but I'm interested in whether the 'pretty'
format will be easier for debugging.
I chose to add 'log_*' options rather than making a separate 'log'
section for now. There's been some discussion about trying to separate
the tracing/logging stuff into more structured sections, but that can
happen later.
2024-06-13 21:21:14 -07:00
Charles Hall
70fa17dde0
enable clap's wrap_help feature
...
This makes the output easier to read.
2024-06-12 19:57:00 -07:00
Charles Hall
85e77832e9
follow xdg base dirs spec by default
2024-06-12 19:57:00 -07:00
Charles Hall
2b0bc140cf
drop figment
...
Just deserialize directly via the `toml` crate.
2024-06-12 19:56:59 -07:00
Charles Hall
9364d44ce2
use strum instead
2024-06-05 17:41:39 -07:00
Charles Hall
aa4cd8b1e1
switch to RustCrypto's argon2 crate
2024-06-04 19:35:21 -07:00
Charles Hall
a0b92c82e8
set up opentelemetry for metrics
...
Also adds an `allow_prometheus` option (disabled by default) to expose
a `/metrics` endpoint that returns Prometheus data.
2024-06-03 18:18:44 -07:00
Lambda
62dd097f49
Use Ruma XMatrix type instead of rolling our own
...
Both the hand-rolled parser and serialization were wrong in countless
ways. The current Ruma parser is much better, and the Ruma serialization
will be fixed by https://github.com/ruma/ruma/pull/1830 .
2024-06-03 20:50:49 +00:00
Charles Hall
aec314ce85
get tracing-opentelemetry from crates.io
...
They made a release with the changes we needed; we can stop pulling it
from git now.
2024-06-02 17:27:54 -07:00
Charles Hall
a275543494
enable axum's tracing feature
...
This pretty much only makes it log a single error event, but it's one
that's useful to know about.
2024-05-26 19:47:00 -07:00
Charles Hall
8f0fdfb2f2
upgrade all cargo dependencies
...
Unfortunately we need to pull tracing-opentelemetry from git because
there hasn't been a release including the dependency bump on the other
opentelemetry crates.
2024-05-26 19:47:00 -07:00
Charles Hall
13de9ecd41
enable unnecessary_to_owned lint
...
*facepalm*
2024-05-26 19:47:00 -07:00
Charles Hall
7e7911abcf
enable thread_local_initializer_can_be_made_const
...
There's barely enough room in the commit title for this lint's name...
2024-05-26 19:47:00 -07:00
Charles Hall
3daf2229d6
enable option_as_ref_cloned lint
2024-05-26 19:47:00 -07:00
Charles Hall
eaeb7620d9
enable multiple_bound_locations lint
2024-05-26 19:47:00 -07:00
Charles Hall
92d9f81a78
enable mixed_attributes_style lint
2024-05-26 19:47:00 -07:00
Charles Hall
41a5e6fb50
enable manual_is_variant_and lint
2024-05-26 19:47:00 -07:00
Charles Hall
5048af3a8f
enable doc_markdown lint
2024-05-26 19:47:00 -07:00
Charles Hall
c9859a9b2d
enable assigning_clones lint
2024-05-26 19:47:00 -07:00
Charles Hall
793d809ac6
enable unused_qualifications lint
2024-05-26 19:47:00 -07:00
Charles Hall
d7e945f4c5
enable dead_code lint
2024-05-26 19:46:48 -07:00
Charles Hall
518d0c9cf3
update the rust toolchain, ignore new lints
...
I will fix them in follow-up commits. Also apparently rustc doesn't warn
you when you pass it lints that don't exist (yet) so that's annoying.
2024-05-24 20:09:41 -07:00
Charles Hall
b5321d81c0
update flake.lock
...
Nixpkgs and `rust-rocksdb` line up so we can drop our RocksDB input for
the time being.
Flake lock file updates:
• Updated input 'attic':
'github:zhaofengli/attic/6eabc3f02fae3683bffab483e614bebfcd476b21' (2024-02-14)
→ 'github:zhaofengli/attic/4dbdbee45728d8ce5788db6461aaaa89d98081f0' (2024-03-29)
• Updated input 'attic/nixpkgs':
'github:NixOS/nixpkgs/aa9d4729cbc99dabacb50e3994dcefb3ea0f7447' (2023-12-14)
→ 'github:NixOS/nixpkgs/07262b18b97000d16a4bdb003418bd2fb067a932' (2024-03-25)
• Updated input 'attic/nixpkgs-stable':
'github:NixOS/nixpkgs/1e2e384c5b7c50dbf8e9c441a9e58d85f408b01f' (2023-12-17)
→ 'github:NixOS/nixpkgs/44733514b72e732bd49f5511bd0203dea9b9a434' (2024-03-26)
• Updated input 'crane':
'github:ipetkov/crane/55f4939ac59ff8f89c6a4029730a2d49ea09105f' (2024-04-21)
→ 'github:ipetkov/crane/109987da061a1bf452f435f1653c47511587d919' (2024-05-24)
• Updated input 'fenix':
'github:nix-community/fenix/c8943ea9e98d41325ff57d4ec14736d330b321b2' (2024-03-05)
→ 'github:nix-community/fenix/b6fc5035b28e36a98370d0eac44f4ef3fd323df6' (2024-05-22)
• Updated input 'fenix/rust-analyzer-src':
'github:rust-lang/rust-analyzer/9f14343f9ee24f53f17492c5f9b653427e2ad15e' (2024-03-04)
→ 'github:rust-lang/rust-analyzer/21ec8f523812b88418b2bfc64240c62b3dd967bd' (2024-05-19)
• Updated input 'flake-utils':
'github:numtide/flake-utils/d465f4819400de7c8d874d50b982301f28a84605' (2024-02-28)
→ 'github:numtide/flake-utils/b1d9ab70662946ef0850d488da1c9019f3a9752a' (2024-03-11)
• Updated input 'nix-filter':
'github:numtide/nix-filter/3449dc925982ad46246cfc36469baf66e1b64f17' (2024-01-15)
→ 'github:numtide/nix-filter/3342559a24e85fc164b295c3444e8a139924675b' (2024-03-11)
• Updated input 'nixpkgs':
'github:NixOS/nixpkgs/b8697e57f10292a6165a20f03d2f42920dfaf973' (2024-03-03)
→ 'github:NixOS/nixpkgs/5710852ba686cc1fd0d3b8e22b3117d43ba374c2' (2024-05-21)
• Removed input 'rocksdb'
2024-05-24 20:08:54 -07:00
Charles Hall
a60501189d
prevent xss via user-uploaded media
...
Previously, `Content-Disposition` was always set to `inline`, even for
HTML, which means that XSS could be easily acheived by uploading
malicious HTML and getting someone to click on the Matrix HTTP API link
for that piece of media. Now, we have an allowlist of safe values for
`Content-Type` that use `inline` while everything else defaults to
`attachment`, including HTML and SVG, which prevents XSS.
We also set the `Content-Security-Policy` header because why not.
A `set_header_or_panic` function is introduced to do what it says in
case Ruma begins providing better or worse values for the relevant
headers in the future. The safest way to handle such a case is simply
to panic.
2024-05-19 21:05:02 -07:00
Charles Hall
e7b8f78867
update rocksdb
...
Flake lock file updates:
• Updated input 'rocksdb':
'github:facebook/rocksdb/bcf88d48ce8aa8b536aee4dd305533b3b83cf435' (2024-04-16)
→ 'github:facebook/rocksdb/6f7cabeac80a3a6150be2c8a8369fcecb107bf43' (2024-04-22)
2024-05-16 21:50:31 -07:00
Charles Hall
e3c57fa83d
enable most pedantic lints as a group
...
I'm turning off the documentation related ones because they generate
way too many warnings, this kind of thing will need to be improved over
a longer timespan.
2024-05-14 20:01:25 -07:00
Charles Hall
a569bf8d99
enable zero_sized_map_values lint
2024-05-14 20:01:25 -07:00
Charles Hall
44b15dcb08
enable wildcard_imports lint
2024-05-14 20:01:25 -07:00
Charles Hall
3978b9c580
enable used_underscore_binding lint
2024-05-14 20:01:25 -07:00
Charles Hall
e3672eb4e0
enable unused_self lint
...
Functions using `services()` are allowed to pointlessly take `self`
because the existence of `services()` is a crime and the solution is
making the types store references to their dependencies and then going
through `self`, so just allowing the lint saves us from modifying some
code only to switch it back later. Much later. Getting rid of
`services()` will probably be an ordeal.
2024-05-14 20:01:25 -07:00
Charles Hall
f855bd09d1
enable unused_async lint
...
This also caused a "new" `unnecessary_wraps` lint to fire too, so that
got fixed too.
2024-05-14 20:01:25 -07:00
Charles Hall
4419e855ae
enable unreadable_literal lint
2024-05-14 20:01:25 -07:00
Charles Hall
a4ff32667e
enable unnested_or_patterns lint
2024-05-14 20:01:25 -07:00
Charles Hall
4e80dc028e
enable unnecessary_wraps lint
2024-05-14 20:01:25 -07:00
Charles Hall
86218f4771
enable uninlined_format_args lint
2024-05-14 20:01:24 -07:00
Charles Hall
baab928281
enable too_many_lines lint
...
And just disable it everywhere it fires, I know.
2024-05-14 20:01:24 -07:00
Charles Hall
8ef278d358
enable struct_excessive_bools lint
...
And ignore it in the one place it fires, I know.
2024-05-14 20:01:24 -07:00
Charles Hall
75358340bb
enable single_match_else lint
...
Also collapses some if statements in the federation name resolution code
2024-05-14 20:01:24 -07:00
Charles Hall
a62fa7b6ee
enable similar_names lint
2024-05-14 20:01:24 -07:00
Charles Hall
db4951c5fd
enable semicolon_if_nothing_returned lint
2024-05-14 20:01:24 -07:00
Charles Hall
96e1877639
enable redundant_closure_for_method_calls lint
2024-05-14 20:01:24 -07:00
Charles Hall
a636405bed
enable needless_pass_by_value lint
2024-05-14 20:01:24 -07:00
Charles Hall
c4a9bca16f
enable match_wildcard_for_single_variants lint
2024-05-14 20:01:24 -07:00
Charles Hall
2b8b5ccb1a
enable match_same_arms lint
2024-05-14 20:01:24 -07:00
Charles Hall
4e6c8451ca
enable match_bool lint
2024-05-14 20:01:24 -07:00
Charles Hall
224ba65d06
enable map_unwrap_or lint
2024-05-14 20:01:24 -07:00
Charles Hall
645d88177a
enable manual_string_new lint
2024-05-14 20:01:24 -07:00
Charles Hall
9606f59141
enable manual_let_else lint
2024-05-14 20:01:23 -07:00
Charles Hall
c51e87ec9a
enable items_after_statements lint
2024-05-14 19:59:43 -07:00
Charles Hall
5c9967f89c
enable inconsistent_struct_constructor lint
2024-05-14 19:59:43 -07:00