Compare commits

..

3312 Commits

Author SHA1 Message Date
strawberry 6ef4781050 downgrade zlib/libz-sys to 1.1.16 as it breaks nix
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-17 03:42:25 -04:00
strawberry 302592f219 bump conduwuit version to 0.3.4
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-17 03:17:27 -04:00
Benjamin Lee 7cd72d8447 bump lockfile 2024-05-17 03:08:56 -04:00
renovate[bot] 4389e08686 chore(deps): update cachix/install-nix-action action to v27 2024-05-15 14:39:21 -04:00
strawberry 91064fe873 fix up systemd unit file, remove chown on config file for debian
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-15 14:31:35 -04:00
strawberry 004354353a docker-compose: slight cleanups, correct database paths, fix branding
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-15 14:31:35 -04:00
strawberry c64a507691 correct default database path to /var/lib/conduwuit
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-15 14:31:35 -04:00
strawberry 81d2078cdb debian: dont start service immediately, add postinst instructions
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-15 14:31:35 -04:00
strawberry f5864afb52 remove namespace check on username login, code simplification on login route
the namespace check on username login is unnecessary, hashes aren't ever
going to match, and axum auth handles this kind of stuff already

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-15 14:31:35 -04:00
strawberry 9a63e7cc9b flip order of complement diff checking, update test results
we now pass all Content-Disposition checks/tests

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-15 14:31:35 -04:00
strawberry 296d7c58ee nix: bump complement input for conduwuit support
https://github.com/matrix-org/complement/pull/723

• Updated input 'complement':
    'github:matrix-org/complement/370a014dca0f720614e0c8f68b9a3e66ecf7f516' (2024-05-02)
  → 'github:matrix-org/complement/8587fb3cbe746754b2c883ff6c818ca4d987d0a5' (2024-05-14)

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-15 14:31:35 -04:00
strawberry a8446f910a debian: fix config permissions, delete debconf support
debconf support needs to be done in a way that does not duplicate
the config file like upstream does.

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-15 14:31:35 -04:00
strawberry a063a6d088 debian: make the docs actually coherent and understandable, and update it
the language here is very poor and i'm not sure why it was written like this.

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-15 14:31:35 -04:00
strawberry 5069c88f77 ci: correct paths for debian package creation, use conduwuit
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-15 14:31:35 -04:00
strawberry 53974320e5 debian: create system account verbosely
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-15 14:31:35 -04:00
strawberry 1c6ef66e3e fix gitlab ci
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-15 14:31:35 -04:00
strawberry ffb63c9c8d ci: regex out the cargo/rustc target for cargo-deb
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-15 14:31:35 -04:00
strawberry de6b296eb5 ci: use verbose for mv operations
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-15 14:31:35 -04:00
strawberry 4c11c9f048 ci: use target-specific dirs for cargo-deb, fix cargo-deb paths
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-15 14:31:35 -04:00
strawberry 6074298426 ci: allow build job to be ran for all events except for draft PRs
this allows build to be ran for workflow_dispatch

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-15 14:31:35 -04:00
strawberry 6e9f68bf81 chore: update complement test results
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-15 14:31:35 -04:00
strawberry edd67a102a ci(debian): add missing --target= for arm64 debs, add --verbose
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-15 14:31:35 -04:00
strawberry 434b5118cc media: return our detected MIME type for Content-Type
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-12 15:54:22 -04:00
strawberry 4185a33747 fix: we should be checking for xml MIME type instead
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-12 15:54:22 -04:00
strawberry 829307c83b disallow svg MIME types to be inline Content-Disposition
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-12 11:37:50 -04:00
strawberry 2bd7a92256 complement: add -tags="conduwuit_blacklist"
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-12 03:05:34 -04:00
strawberry bfa33f8713 unpin rust-rocksdb version
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-12 03:05:34 -04:00
strawberry 040cf29051 ci: add lix binary cache, update .gitlab-ci file
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-12 03:05:34 -04:00
strawberry 80bc1cd78a ci: output 100 failure summary lines instead of 50
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-12 03:05:34 -04:00
strawberry 78994deb1e nix: simplify isDarwin lib check
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-12 03:05:34 -04:00
strawberry 714b3e7144 s/nix/lix in a couple places
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-12 03:05:34 -04:00
strawberry 1cd57f40f6 upload complement OCI image from CI, document where it can be found, use main instead of dev for tag
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-12 03:05:34 -04:00
strawberry da9a0eb77b docs: fix broken systemd unit link
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-12 03:05:34 -04:00
strawberry 37b2c90e62 chore(nix): bump flake
• Updated input 'complement':
    'github:matrix-org/complement/891d18872c153d39a9ce63b545045efddb845738' (2024-04-30)
  → 'github:matrix-org/complement/370a014dca0f720614e0c8f68b9a3e66ecf7f516' (2024-05-02)
• Updated input 'crane':
    'github:ipetkov/crane/f6c6a2fb1b8bd9b65d65ca9342dd0eb180a63f11' (2024-04-21)
  → 'github:ipetkov/crane/27025ab71bdca30e7ed0a16c88fd74c5970fc7f5' (2024-05-09)
• Updated input 'fenix':
    'github:nix-community/fenix/73124e1356bde9411b163d636b39fe4804b7ca45' (2024-05-01)
  → 'github:nix-community/fenix/297c756ba6249d483c1dafe42378560458842173' (2024-05-10)
• Updated input 'fenix/rust-analyzer-src':
    'github:rust-lang/rust-analyzer/55d9a533b309119c8acd13061581b43ae8840823' (2024-04-20)
  → 'github:rust-lang/rust-analyzer/5bf2f85c8054d80424899fa581db1b192230efb5' (2024-05-09)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/5c24cf2f0a12ad855f444c30b2421d044120c66f' (2024-04-19)
  → 'github:NixOS/nixpkgs/f1010e0469db743d14519a1efd37e23f8513d714' (2024-05-09)

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-12 03:05:34 -04:00
strawberry ba150a1185 nix: stop running unnecessary cargo check on builds
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-12 03:05:34 -04:00
strawberry ddce9496f2 nix: fix building rust on macOS (Security apple_sdk framework)
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-12 03:05:34 -04:00
strawberry fe637f481d ci: fix incorrect startsWith syntax
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-11 14:29:00 -04:00
strawberry 18e43e1d35 Reapply "bump various deps"
This reverts commit 6b918966d4.
2024-05-10 22:56:44 -04:00
strawberry 09fca89ac5 Revert "rocksdb: enable async_io if using io_uring feature"
This reverts commit 6266e0ab5e.
2024-05-10 22:56:44 -04:00
morguldir 9f19a2025d Revert "feat(membership): check if user already has the membership that is requested to be set"
This reverts commit 321a6ca0fe.

These checks were not working as intended, resulting in the unban button not working

The join check gets kept since it slightly reduces the amount of sent joins in some cases
This check will probably be replaced soon for a more universal solution to the "made no change" issue

Signed-off-by: morguldir <morguldir@protonmail.com>
2024-05-10 22:52:44 -04:00
strawberry 6b918966d4 Revert "bump various deps"
This reverts commit 653ec3799e.
2024-05-09 22:38:05 -04:00
strawberry 328502c1cd dont send avatar url or display name for ban membership events
the display name or avatar may be offensive

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-09 17:44:15 -04:00
strawberry d15e461303 config option to auto-remediate bad users joining bad rooms or servers
also forgets all rooms upon leave_all_rooms

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-09 17:44:15 -04:00
strawberry 6946eead28 pin rust-rocksdb to before snappy update
it seems to break nix builds

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-09 17:42:05 -04:00
strawberry 09d3240365 bump conduwuit version to 0.3.3
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-09 17:42:05 -04:00
strawberry 653ec3799e bump various deps
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-09 17:42:05 -04:00
strawberry 6de9f52d5a docs: update differences.md
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-09 12:34:50 -04:00
strawberry 484e7d1d2a docs: add my selfhosted forgejo mirror
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-09 12:34:50 -04:00
strawberry dfa01541b3 docs: transfem.dev has rules
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-09 12:34:50 -04:00
strawberry adbe9268ce docs: add troubleshooting, maintenance, various improvements and fixes
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-09 12:34:50 -04:00
strawberry 3504e6e724 fix broken reports
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-09 12:33:46 -04:00
strawberry 154b2ab490 media: additional sanitisation on the Content-Disposition filename
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-09 09:53:04 -04:00
strawberry 2231ccf118 return inline Content-Disposition based on the detected file type (e.g. image/video)
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-09 09:53:04 -04:00
strawberry d4d9f92ade add security response HTTP headers if not present
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-09 09:53:04 -04:00
renovate[bot] e4e1636da8 chore(deps): update aquasecurity/trivy-action action to v0.20.0 2024-05-08 15:06:45 -04:00
strawberry e99aac9550 ci: fix gitlab container registry destination
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-08 15:04:59 -04:00
strawberry ddb87168ed update gitlab repo link
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-08 15:04:59 -04:00
strawberry 245c34e659 ci: dont run docker publishing if none of the usernames are set
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-07 23:59:05 -04:00
strawberry 43b07be3fc ci: use PR author instead of branch name for docker image publishing
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-07 02:44:55 -04:00
strawberry 99d98efeb1 ci: fix docker publishing typo
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-06 13:05:00 -04:00
strawberry 7b25ef2e6c make next_batch token a variable in search, revert threads_until change
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-06 03:45:10 -04:00
strawberry 1f8a7a707c nix: cache complement outputs using nix-build-and-cache
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-06 03:45:10 -04:00
strawberry 86ec20e787 docs: remove last dev branch mention
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-06 03:45:10 -04:00
Charles Hall 8c21388f01 fix nix-build-and-cache
Now it actually caches everything.

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-06 03:45:10 -04:00
strawberry d657fa32e9 ci: format string
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-06 03:45:10 -04:00
strawberry 321e197d8c correct arithmetic adjustments
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-06 03:45:10 -04:00
strawberry 16a98b0683 ci: push docker images for PRs in the merge-PR_NUMBER-HEAD_REF format, fix main pushes
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-06 03:45:10 -04:00
strawberry 9e1bbc1650 ci: run on new tag pushes
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-06 03:45:10 -04:00
strawberry 91ff6a36a4 ci: abort workflow if latest repo tag does not match with running tag ref
protects against a maintainer creating a downgrading version tag, and
uploading artifacts with that version

this check is only ran via workflow dispatch on the tag

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-06 03:45:10 -04:00
strawberry 56f1d8be1f ci(docker): publish latest only if ref starts with our tag format
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-06 03:45:10 -04:00
strawberry ed60f189cc docs: remove dev docker images
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-06 03:45:10 -04:00
strawberry cabf4362be docs: direct all PRs to main
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-06 03:45:10 -04:00
strawberry 2472c7c47a ci: don't run on dev anymore, run on main and non-draft PRs
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-06 03:45:10 -04:00
Xiretza 136cb038cf auth_chain: add useful debug logging 2024-05-06 03:45:10 -04:00
Xiretza 8f89be0fbd utils: add helper for adding unbounded slices to tracing spans 2024-05-06 03:45:10 -04:00
Xiretza bbdced9c90 Fix appservice namespace check for room aliases
Only normal users should be prevented from creating an alias within an
exclusive namespace, not the appservice itself. This mirrors the
behaviour in api/client_server/room.rs on room creation.
2024-05-06 03:45:10 -04:00
strawberry a6f4dc2b74 engage(lychee): check all markdown files too, enable verbose mode
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-06 03:45:10 -04:00
strawberry df203fa244 add a contributing guide
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-06 03:45:10 -04:00
strawberry c6e6eb0af3 ignore empty CONDUWUIT_VERSION_EXTRA for server version
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-06 03:45:10 -04:00
strawberry 29babebc4d adminroom: add count to list-joined-rooms user command
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-06 03:45:10 -04:00
Matt Moriarity 2f3194840c fix extra version when using flake-compat 2024-05-06 03:45:10 -04:00
strawberry 0ebb323490 resolve almost all as_conversions lints
may need further opinion from others on these

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-06 03:45:10 -04:00
strawberry f8e1255994 presence: set empty string status msg to None
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-06 03:45:10 -04:00
strawberry b5c0c30a5e resolve half of the integer_arithmetic lints, couple misc changes
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-06 03:45:10 -04:00
strawberry ac4590952b set io_uring for rocksdb a default feature
this was already enabled by default by rocksdb technically, but
it wasn't building with it properly.

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-06 03:45:10 -04:00
strawberry 67569cb9c8 nix: switch to fork of rocksdb input
https://github.com/girlbossceo/rocksdb/commit/db6df0b185774778457dabfcbd822cb81760cade
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-06 03:45:10 -04:00
strawberry 11ec0dff4f add PATCH to list of allowed HTTP methods in CORS (MSC4138)
https://github.com/matrix-org/matrix-spec-proposals/pull/4138

we already had HEAD

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-06 03:45:10 -04:00
strawberry a198f0481a nix: add liburing to devshell
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-06 03:45:10 -04:00
strawberry 6266e0ab5e rocksdb: enable async_io if using io_uring feature
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-06 03:45:10 -04:00
strawberry 9ee1485960 enable overflow-checks for dev/debug profile
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-06 03:45:10 -04:00
strawberry 05314ec46c nix: set hardcoded NIX_OUTPATH_USED_AS_RANDOM_SEED for bindgen
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-06 03:45:10 -04:00
strawberry b66d2d44d0 chore: bump MSRV to 1.77.0 as 1.78.0 came out
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-06 03:45:10 -04:00
strawberry 3b2db9027a envrc: allow loading env vars from .env if it exists
from https://or.computer.surgery/charles/matrix/-/commit/ffd479d66fae5092073ff380d25fac3735d055bd

This is primarily useful for replicating the environment from CI so that
the `nix-build-and-cache` script is easier to invoke.

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-06 03:45:10 -04:00
strawberry 97e81885db use dep: syntax in cargo.toml features
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-06 03:45:10 -04:00
strawberry 706c1c993b nix: don't run cargo test for crane buildpackage
CI does this already

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-06 03:45:10 -04:00
strawberry cb70d51e2b bump conduwuit version to 0.3.2
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-05 16:52:51 -04:00
strawberry bfb827a418 send Cache-Control and CORS header for remote thumbnail responses
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-05 16:28:21 -04:00
strawberry e2fb588a8c sent attachment content-disposition on thumbnails too
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-05 16:28:21 -04:00
strawberry 43c4dfc5df set content-disposition to attachment instead of inline
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-05 16:28:21 -04:00
strawberry 42e3567153 disable overflow-checks for performance
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 02:18:24 -04:00
strawberry 75ad5cfbb7 bump conduwuit version to 0.3.1
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 02:12:34 -04:00
strawberry be5101b07c bump console-subscriber to 0.2
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 02:12:34 -04:00
strawberry c531101657 misc docs adjustments
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
strawberry 761263332b ci: push to gitlab container registry too
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
strawberry 5fe146aa85 docs: update differences.md
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
strawberry d7399a12fb config: split at __ for struct sections of config, add couple missing settings for show-config
this makes `CONDUWUIT_WELL_KNOWN__CLIENT` a valid env variable config
option as it would normally exist under `[well_known.client]` in toml

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
strawberry 7e2a15497c use function comments for lsp here
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
strawberry e226046e15 drop default appservice_timeout to 35 seconds
AS's are generally hosted on the same machine or within the same
network

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
strawberry 75b9332917 dont allow creating remote users in admin room
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
strawberry de26bf22dc adjust a couple error codes for room alias getting
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
strawberry a7c14a861b ci: output complement diff results to job summary, temp allow error
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
strawberry 05b7dec482 temp(ci): comment complement results diff for now
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
strawberry 38ca88da9f ci(gitlab): use --no-strip for cargo deb
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
strawberry 2e5ba7ab17 ci(gitlab): use gitlab fastzip feature flag
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
strawberry 35683d66dd sort the complement results by test name for consistent output
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
strawberry e1052d1829 chore: update checked-in complement test results
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
strawberry 49078aa836 fix: get the presence of the requested user instead of ourselves
after getting the shared rooms with the target user, we actually only
get the presence of ourselves instead of the requested user

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
strawberry b6b739a7b7 set -vet=off to (hopefully) run all complement tests
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
strawberry fa0bdd431b add destination to X-Matrix Authorization outbound requests
we were already validating this for inbound requests

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
strawberry a6cf5cfd8b remove future deleted nix binary cache
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
strawberry 37c2877cf8 chore: update checked in list of complement test results
also remove the separated passed/failed list, it's already ordered
neatly for folks to read.

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
strawberry 1181a7a7a9 nix: specify explicit branches/refs for flake inputs
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
strawberry cad16b9268 ci, nix: build and cache all packages and CI dependencies
from https://or.computer.surgery/charles/matrix/-/commit/f5bd9bc45e5e5eaf76cff31f1c259ed3f39fb88a
with changes for GitHub CI and misc

Co-authored-by: Charles Hall <charles@computer.surgery>
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
strawberry 3b410d0556 ci: run complement with direnv
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
strawberry 28f599236a ci: compare complement results with checked-in results
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
strawberry 365c85ad27 use nix-output-monitor if available
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
strawberry 13f1274c35 run complement in CI (does not compare results yet)
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
strawberry c4beb7d462 dont return "Allocator" header for server memory-usage if empty
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
strawberry 0f13ada300 return more user-friendly message for debug memory-stats
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
strawberry a7f8c848aa refactor and simplify room creation route a bit
removes a couple unnecessary checks, uses our room_id ruma request field

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
strawberry 25bc1f069d chore: bump deps
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
strawberry 0223386243 remove this unnecessary log, use debug_warn
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
strawberry a496cc4705 dedupe version getting code, rename to CONDUWUIT_VERSION_EXTRA
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
strawberry 8ec9372a8e lint
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
Charles Hall a01a7e1219 improve "Leave event has no state" log
To include the user, room, and event ID.

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
strawberry db81ffb4ea nix: only set CONDUIT_VERSION_EXTRA for final build + slight cleanup
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
strawberry 096c252dc2 move hierarchy via servers higher up, add some debug logging to it
this entire thing needs to be cleaned up later, but i need spaces
to work

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
strawberry 1464b30433 add workaround for room creation initial_state event content as {}, slight refactor
this will simply skip over the events

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
Jason Volk 3585e8a2ef rename / simplify tester stub for now
Signed-off-by: Jason Volk <jason@zemos.net>
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
Jason Volk b19d2ad5b0 daily logging improvements
Signed-off-by: Jason Volk <jason@zemos.net>
2024-05-03 01:52:29 -04:00
Jason Volk 8ecf722abb split http serving from main.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-05-03 01:52:29 -04:00
Jason Volk 5d76db8f19 add configuration for rocksdb direct-io enablement
Signed-off-by: Jason Volk <jason@zemos.net>
2024-05-03 01:52:29 -04:00
strawberry f4a2b39d55 split up alias.rs a bit (alias checks and room alias server name stuff)
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
strawberry e00b65b0e0 use ok_or_else instead of ok_or for backup.rs
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
strawberry beeacd4ef1 initialise capabilities with default constructor
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
strawberry e5735c81ed dedupe half of account/room data config.rs code
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
strawberry b17ccdadd2 dedupe some code in state.rs
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
strawberry 8e3918250d rm complement test logs, rm docker healthcheck.sh, rm .vscode/ dir, move test results to tests/ dir
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
strawberry 6021cb0a1f partially revert this
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
strawberry 35114dde7d add query_over_tcp_only config option for hickory
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
strawberry 62fd6e2c7c set AD bit to false in hickory
this is purely DNSSEC related which we don't use, and DNSSEC on matrix
is unbearable for federation (no one sets it up properly, it's extremely taxing, etc)

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
strawberry 668a7645e9 add ip_lookup_strategy config option for hickory resolver
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
strawberry 3f8407dd64 add hot_lib to default.nix src include
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
strawberry b8c4d6b157 bump ruma
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
strawberry 0b39bb813e tiny refactoring, split out report_event_route a bit
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
strawberry d32ea6ec20 cargo doc lints
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
strawberry 041a7a90f3 hot lib things again
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
strawberry 9c0c4c292c document hot_lib for developers a bit
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
strawberry ed86a4aa9e slight misc adjustments
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
strawberry b282c1eb6d add (probably messy) support for hot lib reload via admin command
`!admin test test1`

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
strawberry 76c5942b4f use user_is_local and server_is_ours more, remove few double filters
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
strawberry e7505a4b20 resolve ptr_as_ptr lint
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
strawberry a97520b0e9 bump MSRV to 1.76.0
there's really no point in trying to stay as low as possible for us,
and this makes development easier. Debian users should just use rustup,
Nix users already get the proper toolchains.

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
strawberry 9931e60050 use single global function for server name local and user local checking
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
strawberry 8f17d965b2 use <pre> for codeblock formatting in jemalloc stats, link to ffi func
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
Jason Volk 9f5d7b0761 fix mallctl suite lints
Signed-off-by: Jason Volk <jason@zemos.net>
2024-05-03 01:52:29 -04:00
Charles Hall 4faf690f57 run clippy on default, all, and allocator features
This way all 4 major configurations are linted.
2024-05-03 01:52:29 -04:00
Charles Hall 838550536a reflow clippy in engage file 2024-05-03 01:52:29 -04:00
Charles Hall 3b05417246 handle the case where 0 or >1 allocs are enabled
In particular this fixes `cargo build --all-features`.
2024-05-03 01:52:29 -04:00
Charles Hall e0c0d51a05 fix lints 2024-05-03 01:52:29 -04:00
Jason Volk e4b669360f start mallctl suite w/ jemalloc stats
Signed-off-by: Jason Volk <jason@zemos.net>
2024-05-03 01:52:29 -04:00
Jason Volk 56f652c12d cleanup admin worker loop
Signed-off-by: Jason Volk <jason@zemos.net>
2024-05-03 01:52:29 -04:00
Jason Volk 4b6938e0f6 add admin server uptime command
Signed-off-by: Jason Volk <jason@zemos.net>
2024-05-03 01:52:29 -04:00
Benjamin Lee 781d4b7907 document tracing_flame options in example config 2024-05-03 01:52:29 -04:00
Benjamin Lee 56f1e905de add config option tracing_flame_output_path
Hardcoding the output path to something in CWD is a pain if you're running
conduwuit through systemd or similar. Also made the error message when
it's unable to create the output file a little more friendly.
2024-05-03 01:52:29 -04:00
Benjamin Lee 646b31d2bd flush tracing-flame output file on exit
Previously we were dropping the flush guard early, possibly causing
samples to be lost on exit.
2024-05-03 01:52:29 -04:00
Benjamin Lee 7d92515b1d add tracing_flame_filter config option
The previous hardcoded filter `trace,h2=off` isn't appropriate in all
cases, it's better to have this be configurable.
2024-05-03 01:52:29 -04:00
Benjamin Lee cc578d9a67 keep stdout logs when tracing-flame/jaeger is enabled
Previously, enabling the `tracing_flame` or `allow_jaeger` options would
prevent any logs from being written to stdout. In addition, enabling the
`allow_jaeger` option would inhibit the `tracing_flame` option.

Now that we have a way to use separate tracing filters with different
layers, we can enable all three at the same time without issues.

This commit also prevents the `debug log_level` command from modifying
the `tracing-flame` filter. This was supported previously, but I don't
think it's something that you would ever want to do intentionally. Now
that we have both the normal log filter and the `tracing-flame` filter
enabled at the same time, we want to `debug log_level` to only modify the
normal filter.
2024-05-03 01:52:29 -04:00
strawberry bf713cd0ba lints
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
strawberry 61f813c187 admin command to get rooms a remote user is in, remove unnecessary dedupe+sort
imagine this SQL query but in conduwuit:

select * from users_in_public_rooms where user_id like '%user_id%';

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
strawberry 450f15df4f admin debug command to fetch a server's true destination
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
strawberry 1cbf2bdc6b update dns_cache_entries example config setting
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
Jason Volk b4035bf0da increase default dns cache entries
Signed-off-by: Jason Volk <jason@zemos.net>
2024-05-03 01:52:29 -04:00
Jason Volk 37ecb4f2b9 decrease log verbosity for potentially cached NoRecordsFound
Signed-off-by: Jason Volk <jason@zemos.net>
2024-05-03 01:52:29 -04:00
Jason Volk daf4b56435 fix inherited sequential small options
Signed-off-by: Jason Volk <jason@zemos.net>
2024-05-03 01:52:29 -04:00
strawberry 799b2909ab ci: dont run registry pushes if creds are not set
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
strawberry 614ef5b3a1 raise dns_min_ttl_nxdomain back to 3 days
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
strawberry cfa89b8b64 add remaining other rocksdb compression options
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
strawberry 9f245281b1 never allow only 1 tokio worker or rocksdb parallelism thread (max compare)
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
strawberry d172a6883d bump some deps
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
strawberry 04afc83043 switch to my fork of tracing
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00
Benjamin Lee 8a5599adf9 add optional support for tokio-console
This turned out to be quite hairy, mostly because we need to apply the
config's log level filter to the actual logs (stdout and, optionally
sentry), but do not want to filter out the tokio tracing events needed by
the console_subscriber. I hit several edge cases in tracing getting
this to work, and we now depend on a git version of tracing with a
backported patch :(
2024-05-03 01:52:29 -04:00
strawberry 341bafb91e final last minute change
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry 72877622e5 forgot to update example config
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
Jason Volk 66e3e95b78 use logical core count for rocksdb parallelism
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-26 02:03:40 -04:00
strawberry b0de16bf5a misc docs updates and ci path-ignore again
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry e8508d16e1 update README.md
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry 8574d0758e add concurrency group and paths-ignore to ci.yml
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
Jason Volk 59199e8f66 document presence_timeout_remote_users
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-26 02:03:40 -04:00
strawberry a41472cc3f why not
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry 6fd3123660 update some documentation a bit for new users
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry 5195593f55 add @resources to syscall filter in the default systemd unit
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
Tom Foster 536efe2cd7 CI working with job summaries
All images should be generating correctly with parallelism and Docker manifests, and should output the end of the CI testing errors in a job summary box when the test fails.

When the test succeeds you get a big  then at the end of the Docker publish it should include the `docker pull` commands for both Docker Hub and GHCR registries to make those pesky Docker users lives easier!
2024-04-26 02:03:40 -04:00
strawberry aa299111a4 update differences.md a bit more, and README.md
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
Jason Volk 33afd60026 use number of logical cores for tokio worker thread count
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-26 02:03:40 -04:00
Jason Volk 54eb634588 add rocksdb compaction thread priority/iopriority w/ conf
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-26 02:03:40 -04:00
strawberry a4c243cae5 cleanup, update, and format differences.md
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry 1da3048bb8 allow accepting CONDUWUIT_ prefixed config options
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry 894902b75f bump cargo.lock due to yanked crate
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry c87ea1dea1 delete unused servername_ratelimiter semaphore now
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry d55015ccda rename release_log_level dev feature to dev_release_log_level, some rebranding
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
Charles Hall 76ab8ca69b allow disabling default features via override 2024-04-26 02:03:40 -04:00
Jason Volk 67f9553790 backoff to valhalla
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-26 02:03:40 -04:00
Jason Volk 255bcf5243 split sending from mod interface.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-26 02:03:40 -04:00
Jason Volk a124122dd4 daily logging improvements
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-26 02:03:40 -04:00
Jason Volk 0b33eec1c2 remove max_concurrent_requests sender hazard
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-26 02:03:40 -04:00
Jason Volk 00ce43d739 remove redundant timers
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-26 02:03:40 -04:00
Jason Volk b01d25277d fix remote media error propagation
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-26 02:03:40 -04:00
Jason Volk b3984f5337 deduplicate cache control into constant
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-26 02:03:40 -04:00
Jason Volk 7e5ed199c9 deduplicate media handler bodies; minor reorg
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-26 02:03:40 -04:00
Tom Foster 6fbf4b5679 Simplify docker manifest CI stage 2024-04-26 02:03:40 -04:00
Charles Hall ee9650bd9f update flake.lock
Should've been done in fe606f4fad but the
author didn't realize it.

Flake lock file updates:

• Updated input 'rocksdb':
    'github:facebook/rocksdb/bcf88d48ce8aa8b536aee4dd305533b3b83cf435' (2024-04-16)
  → 'github:facebook/rocksdb/6f7cabeac80a3a6150be2c8a8369fcecb107bf43' (2024-04-22)
2024-04-26 02:03:40 -04:00
strawberry c1d8678eeb try moving a couple things around in CI
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry e2c460ec54 ci: define packages permission in publish step
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry 4128d83be6 bump ruma, adjust a couple lines of docs
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry a81563244f restricted room join typo
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry 3c45a468f1 bump rocksdb to 9.1.1
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry af0b81f5fb simplify conduwuit version number, bump to 0.3.0
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
Tom Foster d57110e2f3 Improved CI artifact filename handling 2024-04-26 02:03:40 -04:00
Jason Volk 49e453fe07 cleanup/refactor sender base loop
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-26 02:03:40 -04:00
Jason Volk d19573c7b5 Revert "Revert "prevent empty transactions from going out""
This reverts commit bb43351658.
2024-04-26 02:03:40 -04:00
strawberry c57601a4b8 delete all active requests for the appservice when we delete it
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry dc35d06c0a misc changes
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry c915f3dec5 resolve rust 1.75 error?
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry 7f86a166ec make "release_max_level_info" into a crate feature
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry b1ddc502cc please stop "rustc-ice"
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry bd73103713 adjust appservice sending logging
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry eb5dcf08c6 remove unnecessary appservice reqwest timeout, reduce couple unwraps, return if unsuccessful HTTP response
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry 46ce15f61f slightly adjust pusher logging, return if non-successful status instead of continuing
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry ee07e3e975 missing semicolon
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
Jason Volk 15a990dc25 improve various logging
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-26 02:03:40 -04:00
Jason Volk 57e6af6e21 split sending/send base functions
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-26 02:03:40 -04:00
Jason Volk f919fa879b abbrev destination in sender
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-26 02:03:40 -04:00
strawberry d91f24d841 partially revert this in main.rs
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
Jason Volk e90ab8ec8e split request base result handling and tweak logging
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-26 02:03:40 -04:00
Jason Volk aef77bd338 add release_log_level feature to simulate release logs in debug mode.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-26 02:03:40 -04:00
Jason Volk 3140f101c1 move clap into utils
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-26 02:03:40 -04:00
strawberry 0734b52a8a slight misc error.rs changes
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
renovate[bot] f0dd3930fa chore(deps): update nixos/nix docker tag to v2.22.0 2024-04-26 02:03:40 -04:00
Tom Foster e17f8d5b24 Multi-threaded CI to accelerate builds 2024-04-26 02:03:40 -04:00
strawberry 726bc50fe4 ignore irrelevant cargo audit RUSTSEC in engage explicitly
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry 418ec87cfd try logging the full URI instead of just the path for tracing_span
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry 6874ac0015 allow RUSTSEC-2020-0016 due to hot lib reload
this is an optional crate anyways

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry 6394b1812c use 403 for auth check fails everywhere else
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry 1b41e35f1d use HTTP 403 (forbidden) instead of HTTP 400 for membership failed auth checks
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry 73c67d6b17 add back complement test results (dir subject to change?)
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry 5f0d519327 docs: fix complement script command
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry eb10e7d39b fix(appservices): don't perform identity assertion when auth is optional
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry 456a3f93bd replace all mentions of docker compose v1
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry a730adb836 use perf_measurements attributes here
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
Jason Volk b7a494c40d reduce tls override cache lock exposure
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-26 02:03:40 -04:00
strawberry 17d0c869b0 remove some various unused functions and mark some possibly important ones *for now*
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry 66bb88a03a make everything pub(crate) instead of pub
conduwuit is not a library

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry 472c32f453 conduit "library" delete, resolve some warnings from that
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry 5e8ae971f1 flip min_duration and max_duration
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
Jason Volk 1595037427 cleanup scoped types; improve error logging
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-26 02:03:40 -04:00
Jason Volk 938d1f6e77 add conf item for sender retry backoff limit
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-26 02:03:40 -04:00
Jason Volk f273e8feb5 resolver defaults to error for everything except NoRecordsFound.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-26 02:03:40 -04:00
strawberry 906057dd8d add all admin query command for appservices
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry d90ac11603 remove mentions of "outgoing_kind" everywhere else too
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry e26cd5e296 rename OutgoingKind to Destination, add QueuedRequests and ActiveRequestsFor admin query commands
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
Tom Foster 77d73583f6 Separate CI job for publishing docker manifest 2024-04-26 02:03:40 -04:00
strawberry b8a748815a dont allow admin room to be made world readable
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
Charles Hall 9297c642aa update flake.lock
Flake lock file updates:

• Updated input 'attic':
    'github:zhaofengli/attic/6eabc3f02fae3683bffab483e614bebfcd476b21?narHash=sha256-wSZjK%2BrOXn%2BUQiP1NbdNn5/UW6UcBxjvlqr2wh%2B%2BMbM%3D' (2024-02-14)
  → 'github:zhaofengli/attic/4dbdbee45728d8ce5788db6461aaaa89d98081f0?narHash=sha256-0O4v6e4a1toxXZ2gf5INhg4WPE5C5T%2BSVvsBt%2B45Mcc%3D' (2024-03-29)
• Updated input 'attic/nixpkgs':
    'github:NixOS/nixpkgs/aa9d4729cbc99dabacb50e3994dcefb3ea0f7447?narHash=sha256-KnIRG5NMdLIpEkZTnN5zovNYc0hhXjAgv6pfd5Z4c7U%3D' (2023-12-14)
  → 'github:NixOS/nixpkgs/07262b18b97000d16a4bdb003418bd2fb067a932?narHash=sha256-QoQqXoj8ClGo0sqD/qWKFWezgEwUL0SUh37/vY2jNhc%3D' (2024-03-25)
• Updated input 'attic/nixpkgs-stable':
    'github:NixOS/nixpkgs/1e2e384c5b7c50dbf8e9c441a9e58d85f408b01f?narHash=sha256-blbrBBXjjZt6OKTcYX1jpe9SRof2P9ZYWPzq22tzXAA%3D' (2023-12-17)
  → 'github:NixOS/nixpkgs/44733514b72e732bd49f5511bd0203dea9b9a434?narHash=sha256-akSgjDZL6pVHEfSE6sz1DNSXuYX6hq%2BP/1Z5IoYWs7E%3D' (2024-03-26)
• Updated input 'crane':
    'github:ipetkov/crane/55f4939ac59ff8f89c6a4029730a2d49ea09105f?narHash=sha256-Vz1KRVTzU3ClBfyhOj8gOehZk21q58T1YsXC30V23PU%3D' (2024-04-21)
  → 'github:ipetkov/crane/f6c6a2fb1b8bd9b65d65ca9342dd0eb180a63f11?narHash=sha256-qd/MuLm7OfKQKyd4FAMqV4H6zYyOfef5lLzRrmXwKJM%3D' (2024-04-21)
• Updated input 'fenix':
    'github:nix-community/fenix/aa45c3e901ea42d6633af083c0c555efaf948b17?narHash=sha256-nTaO7ZDL4D02dVC5ktqnXNiNuODBUHyE4qEcFjAUCQY%3D' (2024-03-28)
  → 'github:nix-community/fenix/19aaa94a73cc670a4d87e84f0909966cd8f8cd79?narHash=sha256-3pbv7UgAgetwz9YdjzIT/lZ6Rgj6wj6MR4mphBLyDjU%3D' (2024-04-21)
• Updated input 'fenix/rust-analyzer-src':
    'github:rust-lang/rust-analyzer/ad51a17c627b4ca57f83f0dc1f3bb5f3f17e6d0b?narHash=sha256-s/YOyBM0vumhkqCFi8CnV5imFlC5JJrGia8CmEXyQkM%3D' (2024-03-27)
  → 'github:rust-lang/rust-analyzer/55d9a533b309119c8acd13061581b43ae8840823?narHash=sha256-iN5QUlUq527lswmBC%2BRopfXdu6Xx7mmTaBSH2l59FtM%3D' (2024-04-20)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/2726f127c15a4cc9810843b96cad73c7eb39e443?narHash=sha256-UKcYiHWHQynzj6CN/vTcix4yd1eCu1uFdsuarupdCQQ%3D' (2024-03-27)
  → 'github:NixOS/nixpkgs/5c24cf2f0a12ad855f444c30b2421d044120c66f?narHash=sha256-XtTSSIB2DA6tOv%2Bl0FhvfDMiyCmhoRbNB%2B0SeInZkbk%3D' (2024-04-19)
2024-04-26 02:03:40 -04:00
Charles Hall 06e8b63a3c add cargo-audit to the devshell
Apparently github actions VMs ship with it and that's how it was working
before? Cursed. We should control our own supply chain and also ensure
that local development uses the same version as CI.
2024-04-26 02:03:40 -04:00
Charles Hall 63fe828120 use lib.makeScope and files to organize packages
Some of the improvements here include:

* rocksdb can actually use jemalloc now instead of just pulling in a
  second rocksdb for no reason
* "complement-runtime" factored back out into shell file
* complement image no longer uses `mkDerivation` for `copyToRoot`
  because that's what `buildEnv` is for
* complement image no longer sets `SERVER_NAME`, complement already does
  that
* all packages were factored out into `callPackage`-able files for use
  with a custom `lib.makeScope pkgs.newScope`
* new version of `mkPackage` has options that are easier to use and
  override such as `features`
2024-04-26 02:03:40 -04:00
Charles Hall 36774322e1 always go through inputs 2024-04-26 02:03:40 -04:00
Charles Hall 5476a36a0b remove dead code 2024-04-26 02:03:40 -04:00
Charles Hall d2c3275323 get complement via flake inputs
Flake lock file updates:

• Added input 'complement':
    'github:matrix-org/complement/d73c81a091604b0fc5b6b0617dcac58c25763f57?narHash=sha256-hom/Lt0gZzLWqFhUJG0X2i88CAMIILInO5w0tPj6G3s%3D' (2024-04-18)
2024-04-26 02:03:40 -04:00
Charles Hall b635e807ef get rocksdb via flake inputs
Flake lock file updates:

• Added input 'rocksdb':
    'github:facebook/rocksdb/bcf88d48ce8aa8b536aee4dd305533b3b83cf435?narHash=sha256-vRPyrXkXVVhP56n5FVYef8zbIsnnanQSpElmQLZ7mh8%3D' (2024-04-16)
2024-04-26 02:03:40 -04:00
Charles Hall 503c0f1076 flatten and sort all flake inputs 2024-04-26 02:03:40 -04:00
strawberry acbe3bfbda use global valid_cidr_range everywhere else
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
Jason Volk 22bebb9b74 various logging improvements.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-26 02:03:40 -04:00
Jason Volk 423fc6dad0 precompute cidr range denylist; move validator.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-26 02:03:40 -04:00
strawberry 93c3e6dec8 forgor is_err check too
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry ebc59e6f15 some more room alias helper logging
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry 5acb110f2b remove unnecessary continue
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry b3f03d307d try finding more servers for federation hierarchy instead of room ID server name
just the room ID server name is terrible

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry 69968b94ea flip this
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry 311be20055 break out the via field for hierarchy requests
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry 8a767c4b10 on room alias joins, attempt to find the room ID through *more* servers if available
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry 8ad42a85ef dont eat the ?server_name= param for join room by ID or alias
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry 54cf992490 bump all deps
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
Jason Volk 85b5597ea7 integrate reqwest read_timeout options.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-26 02:03:40 -04:00
Jason Volk c396ff5cb8 show info log in release mode
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-26 02:03:40 -04:00
Jason Volk eb9a6fe426 refactor sending send/resolver/well-known error propagation
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-26 02:03:40 -04:00
Jason Volk 68aa368450 cleanup/split/dedup sending/send callstack
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-26 02:03:40 -04:00
Jason Volk 9361acadcb add debug log level macros.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-26 02:03:40 -04:00
strawberry 1e0b34367b add users query command, initial fsck admin command
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry affd063df6 allow user admin commands to take the username only
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry 8b3c4a528c add get_latest_edu_count admin query cmd
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry cffe48d2dc add federation allowed checks on get remote pdu list
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry f87a012834 always print the details in panic catcher
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry 039e79ab1b return matrix JSON response for panic catcher with details if debug build or trace used
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry afd72f23da add get-remote-pdu-list debug admin command
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
Charles Hall a260308bc9 unpin crane because the bug was fixed
Flake lock file updates:

• Updated input 'crane':
    'github:ipetkov/crane/2c653e4478476a52c6aa3ac0495e4dea7449ea0e?narHash=sha256-XoXRS%2B5whotelr1rHiZle5t5hDg9kpguS5yk8c8qzOc%3D' (2024-02-11)
  → 'github:ipetkov/crane/55f4939ac59ff8f89c6a4029730a2d49ea09105f?narHash=sha256-Vz1KRVTzU3ClBfyhOj8gOehZk21q58T1YsXC30V23PU%3D' (2024-04-21)
2024-04-26 02:03:40 -04:00
strawberry 2271a56adc move sign_json and verify_json admin commands to debug
these are purely debug-related commands

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry 9b7dab3a57 add sending.rs to admin db query command
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry 67b4f19c60 simplify room v11 top level redacts key
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
Tom Foster 820cf3b9af ci: extract OCI images before loading and before login
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry aaba7342b5 fix config check running too late, add tower panic catcher(?)
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry 94dfe26707 ci: fix dockerhub login
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry 893707d501 finish general admin room cleanup
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
Tom Foster a36b37ee3d Simplify to publish combined jemalloc image for all architectures 2024-04-26 02:03:40 -04:00
Tom Foster 8525dda468 Simplify publish to Dockerhub 2024-04-26 02:03:40 -04:00
strawberry 0cf368a327 refactor a ton of the admin room code (50% done)
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry 6b28bd5ae7 refactor more of admin code, add unfinished fsck command
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry 7cbe82668b ci: oci image registry publishing take 374237598
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry ce7355cbe0 add globals iterators/getters for admin query cmd, improve structure a bit
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry 2de4eea688 create better structure for admin query commands
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry b93215d7f2 use raw database functions, not helper functions, for admin query command
the helper functions may do ad-hoc data manipulation

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry e4a6a2325b initial support for querying database getters and iterators via admin cmd
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry f954cd2387 ci(oci): add back arch prefix, try labeling our jemalloc images
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry 640cb2d4a8 ci: 🧌
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry 96399703cc use --no-strip for cargo-deb, fix OCI image stuff
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry 31f851f157 temp: get rid of hardened_malloc builds from CI
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry dd415182f9 bump hardened_malloc-rs, dont make num_cpus optional, use full debuginfo instead
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry 99f920f7bc use gcc by default for hardened_malloc instead
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry 7007df9abd bump conduwuit version to 0.2.1
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry 1b8ae43ec9 fix lint for now
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry e64f4df763 add release-debuginfo cargo profile with limited debug and no strip
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry ef23c604d7 bump axum-server-dual-protocol, remove 2 unnecessary attribute check
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry 19255c0c14 use max_request_size in axum.rs
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
AwesomeQubic 999cc7ccf5 possibly fix macOS builds for nix
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
morguldir 6c0d527b90 Use jemalloc/hmalloc for cross builds
Signed-off-by: morguldir <morguldir@protonmail.com>
2024-04-26 02:03:40 -04:00
morguldir 056c9d6920 Since we use crane.buildPackage we need to use cargoExtraArgs
Signed-off-by: morguldir <morguldir@protonmail.com>
2024-04-26 02:03:40 -04:00
morguldir 3ebf1082d6 Base oci-images on their matching alloc variant
Co-authored-by: AwesomeQubic <ThatQubicWah@protonmail.com>
Signed-off-by: morguldir <morguldir@protonmail.com>
2024-04-26 02:03:40 -04:00
strawberry aa77a31dfc stop excluding http deps from renovate !!!!
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
AwesomeQubic 30b5142ecc fix flake for macos, fix jemalloc/hmalloc builds
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
Jason Volk 05477150a2 Upgrade hyper/axum/tower/http stack.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-26 02:03:40 -04:00
strawberry 305f75b0e7 ci: try to fix cargo-deb arm64 stripping
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry 8fc32b8e90 comment x86_64-unknown-linux-gnu for now
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry 2e15a0d18b split up CI again into tests, static builds, and OCI images
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry 73b25b9793 ci: limit max parallel jobs to 4
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry 2a987ca67a try using upstream rocksdb again
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
AwesomeQubic 90fc2bf53e add Complement support to the nix flake
Co-authored-by: strawberry <strawberry@puppygock.gay>
Signed-off-by: AwesomeQubic <ThatQubicWah@protonmail.com>
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry de38d61126 merge ci steps back into one job for now
how do i persist or reuse the "state" of previous jobs

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry a4b28507de bump hickory, ruma, and cargo.lock
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry 3d445dd984 bump rocksdb to 9.1.0
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry 30e6c2385c use latest main rev for hickory (and for reqwest)
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry d3dbe110d5 adjust DNS default config options
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry a898cf0db4 ci: remove download env
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry d070c89f84 split up CI steps
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry a3c53036d5 cargo fmt
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
morguldir 32eb568909 Remove extra test flag when publishing to ghcr in the CI
test -n checks if a string is longer than non-zero, but we just need a compare

Signed-off-by: morguldir <morguldir@protonmail.com>
2024-04-26 02:03:40 -04:00
strawberry bd25709446 Revert "dont use loole for sending channel code"
This reverts commit d0a9666a29.
2024-04-26 02:03:40 -04:00
strawberry a64cbd0304 fix wrong warn message
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00
strawberry d0a9666a29 dont use loole for sending channel code
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-17 14:51:08 -04:00
strawberry 11a2da3819 fix flake for other oci images too
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-17 14:51:08 -04:00
strawberry fcda7252c3 fix flake
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-17 14:51:08 -04:00
strawberry bb43351658 Revert "prevent empty transactions from going out"
This reverts commit cc7cd51e9c.
2024-04-17 14:51:08 -04:00
strawberry e95e4b9200 revert tag name in nix flake for OCI images
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-17 14:51:08 -04:00
strawberry 7300103796 check if user is allowed to invite for restricted room join
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-17 14:51:08 -04:00
strawberry 5667884a6a ci: wrap ref_name in quotes
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-17 14:51:08 -04:00
Matthias Ahouansou 19e4befcb8 feat(appservice): ensure users/aliases outside of namespaces are not accessed
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-17 14:51:08 -04:00
morguldir b303a774d8 Set the time of the HEAD commit as the OCI created field
Apparently it uses `date -Iseconds` to parse, so we can use @ with a timestamp

Also it doesn't parse `created` in buildImage, only buildLayeredImage

Signed-off-by: morguldir <morguldir@protonmail.com>
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-17 14:51:08 -04:00
strawberry 5015fc7a2c add ci and flake support for using ref name to docker image tag
also runs ci on dev branch

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-17 14:51:08 -04:00
strawberry 641399e900 dont auto join rooms if registrations are from appservices
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-17 14:51:08 -04:00
strawberry 6131465d23 don't use bad_database (HTTP 500) for auth check failures
this is not database-related, and may trigger exponential backoff
against us from other servers

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-17 14:51:08 -04:00
strawberry c5c8934db7 default to shared room history visibility if invalid (per spec)
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-17 14:51:08 -04:00
strawberry eebdd30ed7 bump cargo.toml dependencies
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-17 14:51:08 -04:00
Jason Volk 541fa2d2f7 tweak various log levels and messages
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-17 14:51:08 -04:00
Jason Volk 33cc3d56c1 lazy-construct presence; avoids useless db queries in sender and syncer.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-17 14:51:08 -04:00
Jason Volk 8b003e6be2 add DNS configuration for TCP fallback.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-17 14:51:08 -04:00
Jason Volk b6cf0e6fcf fix trust_negative_responses config option
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-17 14:51:08 -04:00
strawberry 160b9afe97 fix force room banning for room alias resolution
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-17 14:51:08 -04:00
strawberry 8e77d60abf bump major conduwuit version to 0.2.0 due to federation breakage
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-17 14:51:08 -04:00
strawberry 97c63604fd "global" ACLs config option, block room directory requests to forbidden servers
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-17 14:51:08 -04:00
strawberry 47c43769d7 improve some user admin cmd checks
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-17 14:51:08 -04:00
strawberry 404bdd1db5 allow ban-list-of-rooms to take room aliases
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-17 14:51:08 -04:00
Matthias Ahouansou 59be0b3ddc sync upstream token/appservice auth code
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-17 14:51:08 -04:00
strawberry c76445e9c1 clear ratelimits when clearing cache too
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-17 14:51:08 -04:00
renovate[bot] 6d47c20efa Update Rust crate chrono to 0.4.38 2024-04-15 07:34:45 -04:00
Jason Volk cc7cd51e9c prevent empty transactions from going out
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-15 07:30:39 -04:00
strawberry 38b15418ca remove created date from OCI image generation
dockerhub and github container registry don't like this,
and i have no idea what to do.

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-15 07:01:00 -04:00
strawberry 775191d5c1 dont include the timestamp in the docker image created date
i hate this

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-15 00:55:07 -04:00
strawberry 527a5cbd73 don't allow moderators dangerous permissions, fix pl 100 state_default
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-14 23:05:26 -04:00
strawberry d1c139de26 add config option for url_preview_domain_explicit_denylist
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-14 22:35:23 -04:00
Jason Volk 287887224f default empty presence string to offline.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-14 22:35:23 -04:00
Jason Volk cdb2dff7dd federation incoming logging/tracing related
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-14 22:35:23 -04:00
Jason Volk ad4e214d28 polylogarithmic debodge
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-14 22:35:23 -04:00
Jason Volk e493b3a60d split prev_event loop body; fetch state; dedup room version procurement.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-14 22:35:23 -04:00
Jason Volk 424e13cec2 split signing_keys from event_handler/mod.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-14 22:35:23 -04:00
Jason Volk dba0575e75 some optimizations to get_auth_chain()
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-14 22:35:23 -04:00
Jason Volk 678d87ced1 add multi_get_or_create_shorteventids()
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-14 22:35:23 -04:00
Jason Volk b4080de749 fix multi_get for abstraction and limit to specific column for least-surprise
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-14 22:35:23 -04:00
Jason Volk c4ebc2f1d1 fix double-deserialization in federation transaction handler.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-14 22:35:23 -04:00
Jason Volk 97fc6c158f add edu select limit and condition for presence.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-14 22:35:23 -04:00
Jason Volk 6c9e95f7c9 add config option for allow_outgoing_read_receipts
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-14 22:35:23 -04:00
Jason Volk 2b54c00f04 add config option to disable rocksdb LOG file
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-14 22:35:23 -04:00
strawberry 20efe437fb default to debug log level if using debug build
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-14 22:35:23 -04:00
strawberry 878dcd71bb fix invalid database code for servers_invite_via
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-14 22:35:23 -04:00
strawberry 59ba3e3190 only allow admins to send room state events by default (e.g. ACLs)
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-14 22:35:23 -04:00
strawberry 27f8c5b63d don't debug log device display name for guest registrations
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-14 22:35:23 -04:00
strawberry 71611f0ae5 nix: try lastModifiedDate for oci image created date
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-14 22:35:23 -04:00
strawberry 0f3f919e7b add list of passed, failed, and all complement tests
Signed-off-by: strawberry <strawberry@pupbrain.dev>
2024-04-14 22:35:23 -04:00
strawberry ac5dd77783 update complement Dockerfile conduwuit config sed's
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-14 22:35:23 -04:00
strawberry d9ea3ffe70 raise complement test timeout to 30 minutes from 10 minutes
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-14 22:35:23 -04:00
strawberry ca8128b195 document commandline args for complement
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-14 22:35:23 -04:00
strawberry eceef5efa2 add config option for allowing guests to auto join rooms
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-14 22:35:23 -04:00
strawberry d95c02f575 add config option for logging guest regs in admin room
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-14 22:35:23 -04:00
strawberry e57051acd8 run all complement tests
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-14 22:35:23 -04:00
strawberry f263630ac1 fix: use path_and_query() for "uri" in request_map for signatures
resolves X-Matrix signatures being invalid in some edge-cases,
and fixes Complement/Sytest federation tests

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-14 22:35:23 -04:00
strawberry 81f5492675 fix complement script
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-14 22:35:23 -04:00
strawberry d717329448 cite banner image used by at least github repo
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-14 22:35:23 -04:00
strawberry 068a878260 partially update differences.md, at note at the top
this is hard to maintain now, and i think conduwuit is reaching a point that
it's way too different from upstream to simply "list all the differences" out

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-14 22:35:23 -04:00
strawberry 168858c8de port room directory auth to new auth stuff
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-14 22:35:23 -04:00
strawberry 9b82551e63 bump cargo.lock due to yanked jobserver
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-14 22:35:23 -04:00
Matthias Ahouansou a0b65eda1e merge the huge authentication MR mess (reject requests with authentication when not used)
and (fix: allow invalid auth when no auth is required)

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-14 22:35:23 -04:00
strawberry 792a8ddb2f fix rustdoc lint
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-14 22:35:23 -04:00
Matthias Ahouansou 8eda3be9ce disable federation at the router level too
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-14 22:35:23 -04:00
strawberry 0d21d70d4a remove two unnecessary matches
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-14 22:35:23 -04:00
strawberry e5307d44ca log error for /publicRooms requests, simplify it a bit
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-14 22:35:23 -04:00
strawberry 9b5c8c124e fix example config well_known options
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-14 22:35:23 -04:00
strawberry c2785038d8 add back default derive for WellKnownConfig
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-14 22:35:23 -04:00
strawberry fdf523a93c bump conduwuit version to 0.1.15
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-14 22:35:23 -04:00
Matthias Ahouansou 2d4877f9a5 feat(federation): implement /make_leave and /send_leave
also fixed some clippy lints, and added "event_id" field
removal check for room v1 and 2

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-14 22:35:23 -04:00
strawberry bfa68e7bc5 refactor well-known stuff to use proper ruma types, config types, etc
this does deprecate the original `well_known_` prefixed config options
with a dedicated/proper config sub-block (`[config.well_known]`)

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-14 22:35:23 -04:00
strawberry 993c0102d9 add unstable support for MSC4125
from https://gitlab.com/famedly/conduit/-/merge_requests/626 with code fixes and clippy lint fixes

MSC4125: https://github.com/matrix-org/matrix-spec-proposals/pull/4125

Co-authored-by: Matthias Ahouansou <matthias@ahouansou.cz>
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-14 22:35:23 -04:00
strawberry 46e945d571 bump ruma, deps, and add MSC4125 ruma feature
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-14 22:35:23 -04:00
strawberry f9e6caef87 simplify getting event content in build_and_append_pdu
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-14 22:35:23 -04:00
strawberry 223f05c922 mark room version 11 as stable
there's nothing unstable about this, and per upstream only unstable
room versions are used if they are complex to support (versions <=5)

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-14 22:35:23 -04:00
strawberry b7a2482e4d output jemalloc and hmalloc builds in CI, add back target check for cargo.toml
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-14 22:35:23 -04:00
strawberry befdc29b1e bump deps, fix repo link on cargo.toml
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-14 22:35:23 -04:00
strawberry 593bad7780 remove unnecessary malloc imports, remove cargo.toml env check
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-14 22:35:23 -04:00
strawberry 9883444486 allow unset variables in nix-build-and-cache for unset ATTIC_TOKEN
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-14 22:35:23 -04:00
strawberry 89c22435d5 nix: simplify malloc outputs
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-14 22:35:23 -04:00
strawberry 354487fa10 nix: use HEAD commit's date for docker image creation and reproducible images
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-14 22:35:23 -04:00
strawberry a94387dcdc maybe add multiple outputs support to nix flake for jemalloc and hardened_malloc
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-14 22:35:23 -04:00
strawberry 10219a531b dual malloc feature check
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-14 22:35:23 -04:00
strawberry f6e9c106aa use hardened_malloc by default only on supported targets
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-14 22:35:23 -04:00
strawberry ff0d4c98ee add hardened_malloc-rs feature and global_allocator
Signed-off-by: strawberry <strawberry@pupbrain.dev>
2024-04-14 22:35:23 -04:00
Jason Volk 7d92cad55f deactivate bloom filter
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-10 12:15:34 -04:00
Jason Volk 6345742e8b tweak compaction options
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-09 15:26:45 -04:00
Jason Volk c42209c0b3 use Arc<[u64]> rather than Arc<HashSet<u64>> for auth_chain_cache value.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-09 15:26:45 -04:00
Jason Volk 2cc72de80e fix lossy origin regression 12a8c9badd
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-09 15:26:45 -04:00
Jason Volk 458e56818c polylogarithmic debodge
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-09 15:26:45 -04:00
Jason Volk 345be5ba5e use rocksdb caches for a few of the lru_caches
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-09 15:26:45 -04:00
strawberry fc44ba6ab3 bump ruma and cargo.lock
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-09 15:26:45 -04:00
strawberry 839a89c968 remove some unnecessary loops
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-09 15:26:45 -04:00
strawberry 40596634c4 respond with actual servers for /_matrix/federation/v1/query/directory requests instead of just us
aka be spec compliant

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-09 15:26:45 -04:00
strawberry 973fed155e config option to allow/disallow federation profile requests
allow_profile_lookup_federation_requests

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-09 15:26:45 -04:00
strawberry 85814e96e3 implement unstable MSC2666 support for querying mutual rooms
https://github.com/matrix-org/matrix-spec-proposals/pull/2666

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-09 15:26:45 -04:00
strawberry 0dc3acea71 build zstd_compression by default for tower-http
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-09 15:26:45 -04:00
strawberry 9be072181c remove unneeded url preview function
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-09 15:26:45 -04:00
strawberry 3438b340a9 remove comments, log channel errors
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-09 15:26:45 -04:00
strawberry 68321ec467 bump conduwuit version to 0.1.14
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-09 15:26:45 -04:00
raizo 579d3ce865 replace tokio channels with loole (#256)
* rewrite admin handler to use loole channels

* apply correct formatting

* move all other services to loole channels

* fix ci
2024-04-09 15:26:45 -04:00
strawberry c82c548cbf bump ruma and cargo.lock
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-09 15:26:45 -04:00
strawberry 7f14c08c34 admin command to change tracing log level dynamically
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-09 15:26:45 -04:00
Jason Volk a83da4f17b refactor rocksdb opts; split kvtree
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-09 15:26:45 -04:00
Jason Volk bade4ed17f conf item to toggle periodic cleanup for rocksdb
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-09 15:26:45 -04:00
Jason Volk 865b5d7241 reorganize database crate.
split database Cork into unit.

split database migrations from mod.rs

Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-09 15:26:45 -04:00
Jason Volk fe91ce0601 add conf items for rocksdb repair and read-only modes.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-09 15:26:45 -04:00
Jason Volk 5f11d68616 tracing instruments for ruma state res
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-09 15:26:45 -04:00
strawberry d92e8e170f list max cache capacity in memory-usage admin cmd
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-09 15:26:45 -04:00
strawberry 72d983d2ec add admin command to fetch /.well-known/matrix/support from server
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-09 15:26:45 -04:00
strawberry 39946beda8 add server-side support for /.well-known/matrix/support
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-09 15:26:45 -04:00
Matthias Ahouansou c946352e7f fix(sync): send phoney leave event where room state is unknown on invite rejection
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-09 15:26:45 -04:00
Matthias Ahouansou 3b5794b5bd fix(membership): check if server is in room to decide whether to do remote leaves
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-09 15:26:45 -04:00
Matthias Ahouansou 6078b5ee9d fixup! feat: support /make_join and /send_join for restricted rooms
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-09 15:26:45 -04:00
Matthias Ahouansou d8949d55c4 refactor(state_accessor): add method to check if a user can invite another user
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-09 15:26:45 -04:00
strawberry 70ce9c299e bump ruma and cargo.lock
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-09 15:26:45 -04:00
strawberry 2516d44cb1 dont 404 and respond+update with default push rules if non-existent
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-05 22:15:16 -04:00
strawberry e4a987cf80 bump ruma and declare support for unstable MSC3026 (busy presence state)
https://github.com/girlbossceo/ruma/commit/a938640491bf2bf98196cecd4102c5749f89a554

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-05 22:15:16 -04:00
strawberry db8e7e5382 TEMP: remove user_is_invited stuff
this is clearly unfinished right now

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-05 22:15:16 -04:00
Matthias Ahouansou f0b91461a0 refactor(state_accessor): add method to check if a user can invite another user
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-05 22:15:16 -04:00
renovate[bot] a8452f3ae1 chore(deps): update nixos/nix docker tag to v2.21.2 2024-04-05 22:15:16 -04:00
Matthias Ahouansou 321a6ca0fe feat(membership): check if user already has the membership that is requested to be set
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-05 22:15:16 -04:00
strawberry 0307cdf2b2 bump ruma
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-05 22:15:16 -04:00
strawberry 1ccc777532 bump conduwuit version to 0.1.13
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-05 22:15:16 -04:00
Jason Volk ebb71b7d7c add contains_url filter to /messages; also split out visibility filter.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-05 22:15:16 -04:00
Jason Volk cde06125b8 immutable cache-control for media
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-05 22:15:16 -04:00
strawberry bfd91c93e0 enable presence by default, remove presence warning
it is now very very good

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-05 22:15:16 -04:00
strawberry 1b84f5a855 resolve wildcard_imports and checked_conversations lints
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-05 22:15:16 -04:00
strawberry f0a0704a93 slight adjustments, remove some explicit annotations
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-05 22:15:16 -04:00
Jason Volk 9cc4f3e929 split main
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-05 22:15:16 -04:00
Jason Volk 7f6c19f066 fix using same federation reqwest pool after sender deduplication.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-05 22:15:16 -04:00
Jason Volk ca1c77d76b refactor presence to not involve rooms.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-05 22:15:16 -04:00
Jason Volk 885224ab76 add tools for user-to-server and user-to-user visibility
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-05 22:15:16 -04:00
strawberry 3c2e8a5250 fix spaces test lints
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-05 22:15:16 -04:00
Jason Volk 568136296f add granular conf items for all memory caches
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-05 22:15:16 -04:00
Matthias Ahouansou 5c30d2b2b0 fix(membership): perform stricter checks when choosing an authorized user
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-05 22:15:16 -04:00
Matthias Ahouansou 68e64392f0 fix(membership): remove join_authorized_via_users_server field on state update
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-05 22:15:16 -04:00
Matthias Ahouansou 172d71e365 check if user is joined in the room in user_can_invite
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-05 22:15:16 -04:00
strawberry c803891634 better event_type checks for send_state_event_for_key_helper
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-05 22:15:16 -04:00
strawberry 0214caeaea always allow count to be filled in search response
i fail to see any reason why we would always want
this to be None

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-05 22:15:16 -04:00
strawberry a2ee6b410e add another element_hacks feature check
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-05 22:15:16 -04:00
strawberry ab0182ace4 check if user is allowed to invite for join_authorized_via_users_server in join_room_by_id_helper
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-05 22:15:16 -04:00
strawberry b9e442b694 use map_or in user_can_invite
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-05 22:15:16 -04:00
strawberry ddcf43f1b8 replace ErrorKind::Forbidden with forbidden() non-exhaustive constructor
https://github.com/ruma/ruma/commit/917584e0cae4ae8642625f234f22f049bc159fee

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-05 22:15:16 -04:00
strawberry 13cd9c4c38 bump cargo.lock due to RUSTSEC-2024-0332, and bump ruma
https://rustsec.org/advisories/RUSTSEC-2024-0332

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-05 22:15:16 -04:00
Matthias Ahouansou 49eb418786 feat: support /make_join and /send_join for restricted rooms
from https://gitlab.com/famedly/conduit/-/merge_requests/618

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-05 22:15:16 -04:00
Matthias Ahouansou ed960f41ac feat: recurse relationships (and fix some lints)
from https://gitlab.com/famedly/conduit/-/merge_requests/613

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-05 22:15:16 -04:00
strawberry 661dba688a add trivially_copy_pass_by_ref lint
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-05 22:15:16 -04:00
strawberry 3efb3a93ca sync hierarchy over federation MR
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-05 22:15:16 -04:00
strawberry bd69d9b565 move invalid 200 response log to info
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-03 12:52:46 -04:00
strawberry 6800f91949 remove some services() usage on startup for accessing config
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-03 12:52:46 -04:00
strawberry bd117bdf0d use config.allow_local_presence instead of services()
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-03 12:52:46 -04:00
strawberry d6651ab422 remove unused import
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-03 12:52:46 -04:00
K900 8134dd9151 Reduce number of separate sources of truth for presence disabled-ness
Instead of checking if we should update every time we want to update,
call the updater every time and decide internally.
2024-04-03 12:52:46 -04:00
strawberry 34fe7b7369 drop /hierarchy requests to debug
this is not helpful informational logging

```
2024-04-02T04:40:52.590444Z  INFO http_request{path=/_matrix/client/v1/rooms/:room_id/hierarchy}: conduit::service::rooms::spaces: Asking thomcat.rocks for /hierarchy
2024-04-02T04:40:52.628248Z  INFO http_request{path=/_matrix/client/v1/rooms/:room_id/hierarchy}: conduit::service::rooms::spaces: Asking hackingfor.eu for /hierarchy
2024-04-02T04:40:52.808526Z  INFO http_request{path=/_matrix/client/v1/rooms/:room_id/hierarchy}: conduit::service::rooms::spaces: Asking matrix.org for /hierarchy
2024-04-02T04:40:52.920936Z  INFO http_request{path=/_matrix/client/v1/rooms/:room_id/hierarchy}: conduit::service::rooms::spaces: Asking matrix.org for /hierarchy
2024-04-02T04:40:52.959362Z  INFO http_request{path=/_matrix/client/v1/rooms/:room_id/hierarchy}: conduit::service::rooms::spaces: Got response from matrix.org for /hierarchy
Response { children: [], inaccessible_children: [], room: SpaceHierarchyParentSummary { canonical_alias: Some("#cybersec-whonix:matrix.org"), name: Some("Whonix"), num_joined_members: 329, room_id: "!OJFkLJksWastbfdRuf:matrix.org", topic: Some("| Part of the Cybersec matrix.org community (#cyber-space:matrix.org) | RULES: https://cybersec-rules.thomcat.rocks | Whonix-focused room | Off-topic chat is fine. Keep it brief and/or move it to #cybersec-offtopic:matrix.org"), world_readable: true, guest_can_join: false, avatar_url: Some("mxc://matrix.org/DMJtrQdhQHKxeODrSibtrczX"), join_rule: "public", room_type: None, children_state: [], allowed_room_ids: [] } }
2024-04-02T04:40:52.959762Z  INFO http_request{path=/_matrix/client/v1/rooms/:room_id/hierarchy}: conduit::service::rooms::spaces: Asking matrix.org for /hierarchy
2024-04-02T04:40:53.109611Z  INFO http_request{path=/_matrix/client/v1/rooms/:room_id/hierarchy}: conduit::service::rooms::spaces: Got response from matrix.org for /hierarchy
Response { children: [], inaccessible_children: [], room: SpaceHierarchyParentSummary { canonical_alias: Some("#lockpicking:matrix.org"), name: Some("Lockpicking"), num_joined_members: 284, room_id: "!uEYjSxQOZnHEkiurTP:matrix.org", topic: Some("| Part of the Cybersec matrix.org community (#cyber-space:matrix.org) | RULES: https://cybersec-rules.thomcat.rocks | Off-topic chat is fine. Keep it brief and/or move it to #cybersec-offtopic:matrix.org"), world_readable: false, guest_can_join: false, avatar_url: Some("mxc://thomcat.rocks/cSeFfMLUdjymKdkUmXtIQTjf"), join_rule: "public", room_type: None, children_state: [], allowed_room_ids: [] } }
2024-04-02T04:40:53.109880Z  INFO http_request{path=/_matrix/client/v1/rooms/:room_id/hierarchy}: conduit::service::rooms::spaces: Asking matrix.org for /hierarchy
2024-04-02T04:40:53.261581Z  INFO http_request{path=/_matrix/client/v1/rooms/:room_id/hierarchy}: conduit::service::rooms::spaces: Got response from matrix.org for /hierarchy
Response { children: [], inaccessible_children: [], room: SpaceHierarchyParentSummary { canonical_alias: Some("#cybersec-rss:matrix.org"), name: Some("Cybersecurity-RSS"), num_joined_members: 347, room_id: "!IVHnAZkhJOhdZxlHRA:matrix.org", topic: Some("|   Part of the Cybersec matrix.org community (#cyber-space:matrix.org)   |   Suggestions to our RSS feed list welcome at #cybersecurity:matrix.org"), world_readable: true, guest_can_join: false, avatar_url: Some("mxc://thomcat.rocks/ugdubBloOkVCYxqFzdVoPwcV"), join_rule: "public", room_type: None, children_state: [], allowed_room_ids: [] } }
2024-04-02T04:40:53.305166Z  INFO http_request{path=/_matrix/client/v1/rooms/:room_id/hierarchy}: conduit::service::rooms::spaces: Got response from matrix.org for /hierarchy
Response { children: [], inaccessible_children: [], room: SpaceHierarchyParentSummary { canonical_alias: Some("#cybersec-whonix:matrix.org"), name: Some("Whonix"), num_joined_members: 329, room_id: "!OJFkLJksWastbfdRuf:matrix.org", topic: Some("| Part of the Cybersec matrix.org community (#cyber-space:matrix.org) | RULES: https://cybersec-rules.thomcat.rocks | Whonix-focused room | Off-topic chat is fine. Keep it brief and/or move it to #cybersec-offtopic:matrix.org"), world_readable: true, guest_can_join: false, avatar_url: Some("mxc://matrix.org/DMJtrQdhQHKxeODrSibtrczX"), join_rule: "public", room_type: None, children_state: [], allowed_room_ids: [] } }
2024-04-02T04:40:53.323257Z  INFO http_request{path=/_matrix/client/v1/rooms/:room_id/hierarchy}: conduit::service::rooms::spaces: Asking thomcat.rocks for /hierarchy
2024-04-02T04:40:53.323672Z  INFO http_request{path=/_matrix/client/v1/rooms/:room_id/hierarchy}: conduit::service::rooms::spaces: Asking matrix.org for /hierarchy
2024-04-02T04:40:53.369721Z  INFO http_request{path=/_matrix/client/v1/rooms/:room_id/hierarchy}: conduit::service::rooms::spaces: Asking matrix.org for /hierarchy
2024-04-02T04:40:53.529250Z  INFO http_request{path=/_matrix/client/v1/rooms/:room_id/hierarchy}: conduit::service::rooms::spaces: Got response from matrix.org for /hierarchy
Response { children: [], inaccessible_children: [], room: SpaceHierarchyParentSummary { canonical_alias: None, name: None, num_joined_members: 1463, room_id: "!aBXqGDWIxVYeYxVbRu:matrix.org", topic: Some("| Part of the Cybersec matrix.org community (#cyber-space:matrix.org) | The room needs urgent attention? @ all the mods! | RULES: https://cybersec-rules.thomcat.rocks | \"you seem to be completely in lack of basic knowledge of how a computer or any programming language operates, to the point that any attempt of discussing any security measures is a complete waste of time\""), world_readable: false, guest_can_join: false, avatar_url: Some("mxc://thomcat.rocks/DjRWzuYjLkScQYPySYNedlFr"), join_rule: "public", room_type: None, children_state: [], allowed_room_ids: [] } }
2024-04-02T04:40:53.546581Z  INFO http_request{path=/_matrix/client/v1/rooms/:room_id/hierarchy}: conduit::service::rooms::spaces: Got response from matrix.org for /hierarchy
Response { children: [], inaccessible_children: [], room: SpaceHierarchyParentSummary { canonical_alias: None, name: None, num_joined_members: 1463, room_id: "!aBXqGDWIxVYeYxVbRu:matrix.org", topic: Some("| Part of the Cybersec matrix.org community (#cyber-space:matrix.org) | The room needs urgent attention? @ all the mods! | RULES: https://cybersec-rules.thomcat.rocks | \"you seem to be completely in lack of basic knowledge of how a computer or any programming language operates, to the point that any attempt of discussing any security measures is a complete waste of time\""), world_readable: false, guest_can_join: false, avatar_url: Some("mxc://thomcat.rocks/DjRWzuYjLkScQYPySYNedlFr"), join_rule: "public", room_type: None, children_state: [], allowed_room_ids: [] } }
```

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-03 12:52:46 -04:00
strawberry 667db8e8a3 output error if sending to trusted key server failed
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-03 12:52:46 -04:00
strawberry 935202eaa3 move panic = "abort" to release-high-perf build profile
i don't really want to do this but broken dependencies
are making this unavoidable

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-02 00:32:41 -04:00
strawberry a20b071a8a add manual_let_else lint
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-02 00:32:41 -04:00
Matthias Ahouansou c31fb7134a fix: do not expect that all http requests are valid reqwest requests
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-02 00:32:41 -04:00
Jason Volk 93a43a0eda add conf item for exact amount of startup netburst.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-02 00:32:41 -04:00
Jason Volk 0ba8d1318d move presence up two levels out of rooms.edus and rooms.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-02 00:32:41 -04:00
Jason Volk 9790477b0e move typing feature up one level out of rooms.edus.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-02 00:32:41 -04:00
Jason Volk 89a919ce75 move read_receipt feature up one level out of rooms.edus.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-02 00:32:41 -04:00
Jason Volk 22b123de7b improve tracing attributes in sending stack.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-02 00:32:41 -04:00
Jason Volk a87e7d8e17 split out, dedup, cleanup sending service methods
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-02 00:32:41 -04:00
Jason Volk 3c09313f79 move and reorganize sending codepaths; no functional changes
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-02 00:32:41 -04:00
strawberry a72ea54d11 update differences.md
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-02 00:32:41 -04:00
strawberry e75fb17899 ci: dont run docker stuff if not a PR *and* both env variables are not empty
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-02 00:32:41 -04:00
strawberry ed5be58f9f ci: only run dockerhub steps if username and token are not empty
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-02 00:32:41 -04:00
strawberry 95ca7bc3e4 move complement dir to tests dir
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-02 00:32:41 -04:00
Matthias Ahouansou 2a48e562e6 fix: return error when trying to unregister unknown appservice id
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-02 00:32:41 -04:00
strawberry 51afde9e98 admin cmd to send a request/ping to /_matrix/federation/v1/version
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-02 00:32:41 -04:00
strawberry 738878f6ff bump conduwuit version to 0.1.12
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-02 00:32:41 -04:00
strawberry fec4b3c953 delete conduit_bin feature
i dont know what's the point of this

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-02 00:32:41 -04:00
strawberry a0ad911688 stop sending make_join requests after 50 failures
this is a very generous number

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-02 00:32:41 -04:00
strawberry af6c72fa84 stop sending make_join if 15 servers responded with unsupported/invalid room version
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-02 00:32:41 -04:00
strawberry ce414023a4 default to None room topic if invalid/redacted for spaces too
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-02 00:32:41 -04:00
Matthias Ahouansou c61aee4f1c fix: reject /register requests when there is no token and the type is appservice
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-02 00:32:41 -04:00
strawberry 7a1a271518 dont allow m.call.invite timeline events in public rooms
also simplifies the encrypted event check (we dont
need to convert anything here)

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-02 00:32:41 -04:00
renovate[bot] 71cea1c567 fix(deps): update rust crate image to 0.25.1 2024-04-02 00:32:41 -04:00
strawberry ff3bc3fb09 on new room creations: only allow moderators to call public rooms
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-02 00:32:41 -04:00
strawberry 72b60c4770 add lockdown_public_room_directory config option
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-02 00:32:41 -04:00
strawberry 00ddc1c88e generalise and cleanup docs a bit
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-30 22:06:18 -04:00
Jason Volk 114324e26c remove write_lock around rocksdb
Signed-off-by: Jason Volk <jason@zemos.net>
2024-03-30 22:06:18 -04:00
strawberry 141a6bc73e dont panic when failing to create admin room response/PDU
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-30 22:06:18 -04:00
strawberry 712cdef6c7 drop url_preview_max_spider_size to 384KB
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-30 22:06:18 -04:00
strawberry 9cd25db955 list resolver caches in memory-usage admin cmd
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-30 22:06:18 -04:00
strawberry 89e3d17e65 update differences.md
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-30 22:06:18 -04:00
Jason Volk 18c34434bc add outgoing federation typing and conf items
Signed-off-by: Jason Volk <jason@zemos.net>
2024-03-30 22:06:18 -04:00
Jason Volk 4a57592378 add clamp util.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-03-30 22:06:18 -04:00
Jason Volk 4becbed2a7 refactor sending interface stack
Signed-off-by: Jason Volk <jason@zemos.net>
2024-03-30 22:06:18 -04:00
Jason Volk f956e8c3b5 move and deduplicate read receipt flusher.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-03-30 22:06:18 -04:00
strawberry 6fa2e0814c dont ignore all tracing logs for sentry
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-30 22:06:18 -04:00
strawberry 350d25a368 bump cargo.lock
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-30 22:06:18 -04:00
strawberry 2b3ee3bf0b set allow_incoming_presence to true by default
this is harmless and is a better UX anyways

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-30 22:06:18 -04:00
strawberry f818c368c0 config options for HTTP compression on tower+reqwest
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-30 22:06:18 -04:00
strawberry 44435f76fe bump conduwuit version to 0.1.11
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-30 22:06:18 -04:00
strawberry b437e47d8c partial tower/tower-http sentry and gzip/brotli compression
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-30 22:06:18 -04:00
renovate[bot] 3103ad2205 chore(deps): update actions/configure-pages action to v5 2024-03-30 22:06:18 -04:00
strawberry b36c397702 mark msc2285 (private read receipts) as supported
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-30 22:06:18 -04:00
strawberry 60623cd14b dont return bad_config for private room directory requests
this would log as an error and as HTTP 500

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-30 22:06:18 -04:00
strawberry b39aa00a9b add trusted keyservers to backfill from if in room
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-30 22:06:18 -04:00
strawberry babf29d217 fix sentry features, add sentry_traces_sample_rate
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-30 22:06:18 -04:00
strawberry 835c2112c8 dont depend on openssl, add sentry_tracing
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-30 22:06:18 -04:00
strawberry 47889410eb use CONDUIT_VERSION_EXTRA in endpoints
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-30 22:06:18 -04:00
strawberry 87a7c8d9e8 add opt-in sentry logging, improve main function
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-30 22:06:18 -04:00
strawberry 93b03fe338 use true_fn for startup_netburst option
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-30 22:06:18 -04:00
strawberry 07135cc849 add two pedantic clippy lints
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-30 22:06:18 -04:00
Jason Volk 125ff21c88 add conf item to toggle startup netburst (for developers).
Signed-off-by: Jason Volk <jason@zemos.net>
2024-03-30 22:06:18 -04:00
Jason Volk 3cf67f3993 disambiguate logging macros by locking log crate
Signed-off-by: Jason Volk <jason@zemos.net>
2024-03-30 22:06:18 -04:00
strawberry cf8727a5f8 only test long_file_names_works if using sha256_media feature
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-30 22:06:18 -04:00
strawberry 77475dacf5 bump rocksdb, switch to fork of rocksdb, bump flake
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-30 22:06:18 -04:00
renovate[bot] 80f624c0fb fix(deps): update rust crate serde_html_form to 0.2.6 2024-03-30 22:06:18 -04:00
strawberry 98e480ddcd revert checking appserice destination against ip_range_denylist
this is the url field in the appservice registration file,
this is almost always localhost and the admin should
be vetting the appservice registration yaml file before
registering it anyways.

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-30 22:06:18 -04:00
renovate[bot] e4d1d4e86d fix(deps): update rust crate tokio to 1.37.0 2024-03-30 22:06:18 -04:00
renovate[bot] 73bdf3c5cc chore(deps): update aquasecurity/trivy-action action to v0.19.0 2024-03-30 22:06:18 -04:00
strawberry ee3160dd1b allow manual_unwrap_or_default lint here
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-30 22:06:18 -04:00
strawberry 8915b6469d forbid admin room from being made public
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-30 22:06:18 -04:00
strawberry 38c2e5567e remove unwrap from admin room build_and_append_pdu
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-30 22:06:18 -04:00
strawberry 1893b45de3 propagate errors if we fail processing admin room subcommands
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-30 22:06:18 -04:00
strawberry 48d1a3af3c resolve the last few relevant pedantic clippy lints
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-30 22:06:18 -04:00
strawberry fa71dd4b4c use body.dir for relations now
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-30 22:06:18 -04:00
strawberry 92dbe82675 remove unnecessary clone from into_iter
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-30 22:06:18 -04:00
strawberry 6aaf169c45 fix wrong order of logic, prefer room alias server first if available
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-30 22:06:18 -04:00
strawberry e9793868ec add recursion_depth None for now
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-30 22:06:18 -04:00
strawberry 0d50dfd7cf bump ruma and cargo.lock
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-30 22:06:18 -04:00
strawberry 567b24e410 add /_conduwuit/server_version route
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-30 22:06:18 -04:00
strawberry 4f1f6fa56f drop -alpha from version string
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-30 22:06:18 -04:00
strawberry 051668b62b use rusqlite commit before c-strings were added
this is a 1.77.0 rust feature, this would require
bumping MSRV

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-26 22:24:24 -04:00
strawberry 4b4b63eda4 bump cargo.lock
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-26 22:24:24 -04:00
renovate[bot] 50c870cc1d chore(deps): update docker docker tag to v26 2024-03-26 22:24:24 -04:00
renovate[bot] b252572db4 fix(deps): update rust crate clap to 4.5.4 2024-03-26 22:24:24 -04:00
renovate[bot] cf474d96f0 fix(deps): update rust crate serde_json to 1.0.115 2024-03-26 22:24:24 -04:00
renovate[bot] aa2af6bf93 chore(deps): update nixos/nix docker tag to v2.21.1 2024-03-26 22:24:24 -04:00
strawberry 53c0cfd70e docs: fix a few headlines
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-26 22:24:24 -04:00
strawberry 3d0f0cc1ce add query_all_nameservers config option
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-26 22:24:24 -04:00
Jason Volk cb12f285e9 improve incoming http request and other logging
Signed-off-by: Jason Volk <jason@zemos.net>
2024-03-26 22:24:24 -04:00
Jason Volk 0df1f84cc8 set trust_negative_responses in nameserver config.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-03-26 22:24:24 -04:00
strawberry e6c34b982f fix git blame ignore revs
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-26 22:24:24 -04:00
strawberry 08a21b8ee2 better maximize_fd_limit test
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-26 22:24:24 -04:00
Jason Volk edb4468771 clear destinations cache in clear_caches fn.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-03-26 22:24:24 -04:00
strawberry c31de51efc ignore rev 16294831 from blame
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-26 22:24:24 -04:00
strawberry 868976a149 use chain_width 60
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-26 22:24:24 -04:00
strawberry 9d6b070f35 Revert "update rustfmt"
This reverts commit e517f2bad8c8a4181f70126067ea49d8b3ad1635.
2024-03-26 22:24:24 -04:00
Jason Volk 07596d866f update rustfmt 2024-03-26 22:24:24 -04:00
Jason Volk 525379f8ac enable caching in hickory_dns w/ configurables.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-03-26 22:24:24 -04:00
Jason Volk 21874f8ab7 eliminate gai resolver.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-03-26 22:24:24 -04:00
Jason Volk f5da75e476 split structs from service/globals/mod.rs into separate units
Signed-off-by: Jason Volk <jason@zemos.net>
2024-03-26 22:24:24 -04:00
Jason Volk f3bc87c4e6 elaborate on RocksDB recovery modes in example-config.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-03-26 22:24:24 -04:00
strawberry 24faf4dd26 revert 0297cfe307
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-26 22:24:24 -04:00
strawberry 6f7113950b raise too-many-lines-threshold to 700 (for now?)
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-26 22:24:24 -04:00
strawberry 3f9825788e check URL preview requests against ip_range_denylist
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-26 22:24:24 -04:00
strawberry bef0459fb8 bump conduwuit version to 0.1.10
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-26 22:24:24 -04:00
strawberry 4be37fbe8d only remove event_id field in room v1 and v2
no this doesnt make those rooms work,
just a why not thing

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-26 22:24:24 -04:00
strawberry 0863bec098 allow non-joined users to get aliases of world_readable rooms
`user_can_see_state_events` checks if user is joined,
or if room visibility is world_readable

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-26 22:24:24 -04:00
strawberry 380b61184d reduce high presence timeouts
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-26 22:24:24 -04:00
strawberry 32ab88e68a check the URL and response remote address for ip_range_denylist
the previous only checked the server_name

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-26 22:24:24 -04:00
strawberry fbefbd57be implement include_state search criteria
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-26 22:24:24 -04:00
strawberry c2e89b939c add element web search count hack (?)
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-26 22:24:24 -04:00
strawberry f4146de17d add feature for smElement client hacks
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-26 22:24:24 -04:00
strawberry 55813e90bf add EditorConfig vs code extension to recommendations
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-26 22:24:24 -04:00
Jason Volk d3c9f5595a split admin commands into modules.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-03-26 22:24:24 -04:00
Jason Volk 6b1933914d add file listing to database abstraction.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-03-26 22:24:24 -04:00
strawberry bdf3997de5 pin ruma rev
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-26 22:24:24 -04:00
strawberry 7bd56765ef fix some more pedantic clippy lints
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-26 22:24:24 -04:00
strawberry a7e6fe8b60 fix infinite loop lint
this is actually better to do CPU-wise anyways

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-26 22:24:24 -04:00
strawberry 8dad4461b4 log if our trusted key server is broken for batch requests
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-26 22:24:24 -04:00
strawberry 101cb34f9a make rocksdb_recovery_mode a u8, document it
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-23 01:49:27 -04:00
Jason Volk 331c0b37cd add conf item for alternate rocksdb recovery modes. 2024-03-23 01:49:27 -04:00
strawberry a57f4db207 bump default_sender_timeout from 75 seconds to 180
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-23 01:49:27 -04:00
strawberry 27d6ce3cc5 log path parameters when try http request fails
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-23 01:49:27 -04:00
strawberry 6e0d6c78fb use BTreeMap again
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-23 01:49:27 -04:00
strawberry 27d83a51f2 remove unnecessary match arm for space invite join_rule
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-23 01:49:27 -04:00
renovate[bot] 8fab2cd94a fix(deps): update rust crate regex to 1.10.4 2024-03-23 01:49:27 -04:00
strawberry 7fbbdf83ab forgot to fix these ones too
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-23 01:49:27 -04:00
strawberry 3bc2af7d26 resolve and add even more pedantic clippy lints
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-23 01:49:27 -04:00
strawberry 0bb5115bd1 resolve clippy match_bool
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-23 01:49:27 -04:00
strawberry 9d0b647911 resolve couple pedantic clippy lints, remove unnecessary qualifications
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-23 01:49:27 -04:00
strawberry 6d7ef80aba format cargo.toml
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-23 01:49:27 -04:00
strawberry 931e1cad06 ci: make docker username and GHCR variables
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-23 01:49:27 -04:00
strawberry 9832f11074 add zed to .gitignore
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-23 01:49:27 -04:00
strawberry d8c6c2930e update differences.md
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-23 01:49:27 -04:00
strawberry 23ee479062 only allow up to info level logging on release builds
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-23 01:49:27 -04:00
strawberry c5afc6bf98 bump ruma and bytes
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-23 01:49:27 -04:00
strawberry 0384b48b4a add main.rs test for unix maximize_fd_limit
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-23 01:49:27 -04:00
Charles Hall 74c34e885e allow including extra info in --version output
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-23 01:49:27 -04:00
strawberry 9f7431c08f remove rocksdb prefix extractor
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-23 01:49:27 -04:00
Timo Kösters 710a6b5c6f refactor: remove previous typing implementation and add sync wakeup for new one
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-23 01:49:27 -04:00
Matthias Ahouansou 60f2471f59 refactor appservice type stuff
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-23 01:49:27 -04:00
strawberry 7c9c5b1d78 log room for backfill_if_required requests
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-23 01:49:27 -04:00
strawberry d7fc6874d1 Revert RocksDB 9.0.0 update
there seems to be a regression, likely from https://github.com/facebook/rocksdb/issues/12361 / https://github.com/facebook/rocksdb/pull/12309

```
[1/0/2 built] building rocksdb-9.0.0 (configurePhase): -- Detecting CXX compile features - donedirenv: ([/Users/strawberry/.nix-profile/bin/direnv export zsh]) is taking a while to execute. Use CTRL-C to give up.
error: builder for '/nix/store/9slwgpnardhn2vqzqhn361ic668n38wq-rocksdb-9.0.0.drv' failed with exit code 1;
       last 10 log lines:
       > -- Found lz4: /nix/store/cafwv4439qbm2ij04mpc7xz5m3f7mfix-lz4-1.9.4/lib/liblz4.dylib
       > CMake Error at /nix/store/bin32lqag7lx38994xpf9jvhk1xbd64c-cmake-3.28.2/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
       >   Could NOT find zstd (missing: ZSTD_INCLUDE_DIRS)
       > Call Stack (most recent call first):
       >   /nix/store/bin32lqag7lx38994xpf9jvhk1xbd64c-cmake-3.28.2/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
       >   cmake/modules/Findzstd.cmake:17 (find_package_handle_standard_args)
       >   CMakeLists.txt:167 (find_package)
       >
       >
       > -- Configuring incomplete, errors occurred!
       For full logs, run 'nix log /nix/store/9slwgpnardhn2vqzqhn361ic668n38wq-rocksdb-9.0.0.drv'.
error: 1 dependencies of derivation '/nix/store/ir8jf2wic98iymjlk7d2i1kjjsgv15v2-nix-shell-env.drv' failed to build
```

happens in both rust-rocksdb and our fork of rust-rocksdb

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-23 01:49:27 -04:00
strawberry ab5552ec6c Revert "bump rocksdb in nix flake"
This reverts commit 4475c1ba25.
2024-03-23 01:49:27 -04:00
strawberry fdb0ccc9dc bump rocksdb in nix flake
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-23 01:49:27 -04:00
strawberry 10e1801974 remove/update incorrect example config comment
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-23 01:49:27 -04:00
strawberry f27a2bace8 bump conduwuit version to 0.1.9
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-23 01:49:27 -04:00
strawberry 37c040dc77 fix incorrect v1 URL path for URL previews
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-23 01:49:27 -04:00
strawberry 90b8ac0c64 follow 3 redirects for federation requests instead of 2
just in case

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-23 01:49:27 -04:00
strawberry 33dfa64963 follow 3 redirects for URL previews instead of 6
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-23 01:49:27 -04:00
strawberry 713b1b23c9 document new timeout config options
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-23 01:49:27 -04:00
strawberry 9ed3e64a60 oops forgot to commit these new files
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-23 01:49:27 -04:00
Jason Volk 9334f938ae refactor reqwest client suite w/ conf items.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-03-23 01:49:27 -04:00
Jason Volk 61b1d6d869 add corks to coalesce writes for several heavy calltrees.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-03-23 01:49:27 -04:00
Jason Volk 3f60365cc6 add write buffer corking using rocksdb manual_wal_flush.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-03-23 01:49:27 -04:00
Charles Hall 3969b667ba make chapter name reflect file name
Personally I think this makes more sense anyway.
2024-03-23 01:49:27 -04:00
Charles Hall 52fb4d9752 reduce scope of nixos documentation
There are so many ways to do this we realistically shouldn't bother
describing any of them, especially because people should be learning all
the options and choosing the one that suits them best anyway.

Co-authored-by: strawberry <strawberry@puppygock.gay>
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-23 01:49:27 -04:00
strawberry 3059801ed8 rename Docker header
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-23 01:49:27 -04:00
Charles Hall ed96bd2053 rename "simple" deployment to "generic"
The main thing this section is really useful for is explaining how to
configure various reverse proxies, which applies to basically anything.

Also, remove all the language about this being "recommended", because
nothing in this documentation is actually tested in CI.

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-23 01:49:27 -04:00
Charles Hall 58f113451f remove section about cross compilation
It is very stale. Please just use Nix. Trying to do it outside of Nix
will be an exercise in frustration, I guarantee it.

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-23 01:49:27 -04:00
strawberry 2e713753d5 bump ruma, rust-rocksdb, and cargo.lock
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-23 01:49:27 -04:00
Charles Hall 831c452af9 avoid duplicating links in documentation
Because one might forget to update them. I did, initially, which is why
I'm making this change.
2024-03-23 01:49:27 -04:00
Charles Hall 2de47fc9c0 add mdbook to the devshell 2024-03-23 01:49:27 -04:00
renovate[bot] 99c38d2a5e fix(deps): update rust crate jsonwebtoken to 9.3.0 2024-03-23 01:49:27 -04:00
strawberry 66a36a5576 significantly drop URL preview timeouts
theres no reason for us to spend so long trying to get
a preview

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-23 01:49:27 -04:00
strawberry 2470fa91d8 raise connection pooling idle timeout to 50 seconds
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-23 01:49:27 -04:00
strawberry 1e07f417ba raise get_keys_helper timeout even more
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-23 01:49:27 -04:00
strawberry 4dfefda03b update book.toml for conduwuit
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-23 01:49:27 -04:00
strawberry 55708949cc slight request logging improvements
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-23 01:49:27 -04:00
strawberry 5ed55da0dd auto join rooms from admin room created users too
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-23 01:49:27 -04:00
strawberry f06f30ca2a fix wrong error message about presence
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-23 01:49:27 -04:00
strawberry 9715b07b38 skip rooms we have not joined before for auto-join
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-23 01:49:27 -04:00
strawberry dda3b0e7e2 default to None if "name" in m.room.name is empty
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-23 01:49:27 -04:00
strawberry 3e902836cc simplify heroes get_avatar
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-23 01:49:27 -04:00
strawberry 7066b7b428 feat: automatically join rooms on registration
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-23 01:49:27 -04:00
strawberry 2ca357e44c use unwrap_or_default if timestamp conversion fails
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-23 01:49:27 -04:00
strawberry 694986db29 check+clarify online backups are RocksDB only
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-23 01:49:27 -04:00
strawberry 7af78cf708 return helpful message instead of empty message if no backups
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-23 01:49:27 -04:00
strawberry f9a60bf48b make database_backup_path a PathBuf
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-23 01:49:27 -04:00
strawberry 5a434e7f3d make database_path a PathBuf
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-23 01:49:27 -04:00
renovate[bot] ab420e8a90 chore(deps): update docker docker tag to v25.0.5 2024-03-23 01:49:27 -04:00
strawberry f7e8054a00 fix lints
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-23 01:49:27 -04:00
Jason Volk fa942aedd7 add database backup with admin commands
Signed-off-by: Jason Volk <jason@zemos.net>
2024-03-23 01:49:27 -04:00
strawberry ece817c562 db_cache_capacity_mb defaults to 256.0 now
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-23 01:49:27 -04:00
Jason Volk e9d67ecb53 reconfigure and optimize rocksdb options.
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-23 01:49:27 -04:00
Jason Volk 544c38341b add sync() to db abstraction for fsync(2). 2024-03-23 01:49:27 -04:00
Jason Volk d4cfee4e71 add rocksdb env to options. keep options in engine state.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-03-23 01:49:27 -04:00
Jason Volk af605a03b7 add abstract fallbacks for kv batch methods.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-03-23 01:49:27 -04:00
strawberry 10e2eb5e08 bump rocksdb, deps, switch to hickory dns/resolver
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-23 01:49:27 -04:00
renovate[bot] 5eb4010e03 fix(deps): update rust crate serde_yaml to 0.9.33 2024-03-23 01:49:27 -04:00
strawberry a405f10f82 fix docs
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-23 01:49:27 -04:00
Jason Volk 7b15f85c62 fix zealous client connection close (regression 809c9b4481)
Signed-off-by: Jason Volk <jason@zemos.net>
2024-03-23 01:49:27 -04:00
strawberry 7809f0a6ae bump ruma and cargo.lock
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-19 00:17:41 -04:00
strawberry 85cb559002 update DIFFERENCES.md
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-19 00:17:41 -04:00
strawberry 61f49ecf0e rename forbidden_room_names to forbidden_alias_names
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-19 00:17:41 -04:00
strawberry 5e880ac44a declare various missing server capabilities
this should fix FluffyChat password resets, and
other possible client issues that expose features
based on server capabilities.

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-19 00:17:41 -04:00
strawberry 7f7bd91e8a add comment for future org.matrix.msc2285.stable
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-19 00:17:41 -04:00
strawberry 96e1938616 remove unnecessary assert for test
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-19 00:17:41 -04:00
strawberry 694b926366 move docs/gh pages into separate workflow
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-19 00:17:41 -04:00
strawberry c8c3a9ed43 docs: s/conduit-example/conduwuit-example
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-19 00:17:41 -04:00
strawberry 896c372cfe disable broken assertions_on_result_states lint
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-19 00:17:41 -04:00
strawberry 2be43d3712 fix failing to register new appservice accounts
this is such a terribly named enum field.

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-19 00:17:41 -04:00
strawberry 0301c7c083 fix Appservice AccessTokenOptional authentication type endpoints
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-19 00:17:41 -04:00
strawberry a2a7b81076 fix test
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-19 00:17:41 -04:00
strawberry ea6425712a dont setup github pages if pull request
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-19 00:17:41 -04:00
strawberry 19f313b91d deploy book to github pages
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-19 00:17:41 -04:00
strawberry e2827a1a79 build documentation/book in github actions
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-19 00:17:41 -04:00
strawberry b1b88601ab docs: dont point everyone to element
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-19 00:17:41 -04:00
Samuel Meenzen e9ce642795 docs: build docs using mdBook, build in CI, deploy to gitlab pages
squashed from https://gitlab.com/famedly/conduit/-/merge_requests/604

added differences.md

Co-authored-by: Charles Hall <charles@computer.surgery>
Co-authored-by: strawberry <strawberry@puppygock.gay>
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-19 00:17:41 -04:00
strawberry a7966b8f05 config option to allow incoming remote read receipts
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-19 00:17:41 -04:00
strawberry b78d79a45a ignore deactivated users and remote user profiles wih forbidden_usernames
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-19 00:17:41 -04:00
strawberry 8c3f946e97 bump conduwuit version to 0.1.8
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-19 00:17:41 -04:00
Jason Volk abceae26de add flush suite to sending service; trigger on read receipts.
Signed-off-by: Jason Volk <jason@zemos.net>
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-19 00:17:41 -04:00
Jason Volk 95ea665649 complete federation destination caching preempting getaddrinfo(3).
fixed some clippy lints and spacing adjusted

Signed-off-by: Jason Volk <jason@zemos.net>
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-19 00:17:41 -04:00
Jason Volk 6fe0ea05b8 add remove_batch with transaction to database abstraction.
adjusted to make building sqlite happy again

Signed-off-by: Jason Volk <jason@zemos.net>
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-19 00:17:41 -04:00
Jason Volk ba03d55879 clear dns and tls-override caches from !admin command.
Signed-off-by: Jason Volk <jason@zemos.net>
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-19 00:17:41 -04:00
strawberry 9b5c4697bf bump async-trait and ruma
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-19 00:17:41 -04:00
strawberry 16572a868a slight inclusive wording changes
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-19 00:17:41 -04:00
strawberry b079b94715 track media uploads by user
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-19 00:17:41 -04:00
strawberry 19135eaa58 document forbidden room aliases and usernames
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-19 00:17:41 -04:00
Matthias Ahouansou e7c6b8c91b feat(spaces): hierarchy over federation
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-19 00:17:41 -04:00
strawberry 1ecbf55d68 check allow_federation in send_federation_request
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-19 00:17:41 -04:00
Matthias Ahouansou 4c841cd909 refactor: check if federation is disabled inside the authcheck where possible
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-19 00:17:41 -04:00
Matthias Ahouansou c48535ef32 fix: avoid panics when admin room is not available
Co-authored-by: strawberry <strawberry@puppygock.gay>
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-19 00:17:41 -04:00
strawberry 5473631e1d admin command to see a room's full state from our database
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-19 00:17:41 -04:00
strawberry de8f773620 slight wording updates
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-19 00:17:41 -04:00
strawberry b4fa306a20 remove rocksdb optimize_level_style_compaction
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-19 00:17:41 -04:00
renovate[bot] 930bf3891c fix(deps): update rust crate figment to 0.10.15 2024-03-16 11:18:07 -04:00
strawberry 8d8467a4ea add legacy v1 routes for the remaining media endpoints
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-16 00:09:48 -04:00
strawberry c6cf3589f4 check if rocksdb_max_log_files is 0
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-16 00:09:48 -04:00
Samuel Meenzen 623478fa2d chore: add EditorConfig
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-16 00:09:48 -04:00
strawberry a9059afe21 update DIFFERENCES.md
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-16 00:09:48 -04:00
strawberry 1c67a1da45 update README.md
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-16 00:09:48 -04:00
strawberry 99efa6d622 bump rust-rocksdb, and transitive deps
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-16 00:09:48 -04:00
strawberry 8cc23671e0 treat non-appservice registrations as None auth
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-16 00:09:48 -04:00
strawberry da9fdd2a60 add unimplemented default impl to fix sqlite building
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-16 00:09:48 -04:00
strawberry 1bfc5336f7 remove some conditional compilation
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-16 00:09:48 -04:00
strawberry 8e3b9a3d17 Revert "switch to hickory-dns / hickory_resolver"
This reverts commit 2ea524bfab.
2024-03-16 00:09:48 -04:00
strawberry dd1bdf0698 bump conduwuit version to 0.1.7
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-16 00:09:48 -04:00
strawberry 935f83af98 dont allow GetRemotePdu server to be ourselves
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-16 00:09:48 -04:00
strawberry b0bee8f6ae drop sync requests to debug
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-16 00:09:48 -04:00
strawberry 5ea1f18776 rocksdb_max_log_files must not be 0
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-16 00:09:48 -04:00
strawberry 0bed5ca506 remove unnecessary variable qualifications
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-16 00:09:48 -04:00
strawberry 01b722beb0 add room alias server names for backfill, self check server name
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-16 00:09:48 -04:00
strawberry 9b2ccff7dd add room ID server_name as backfill server, make servers a vector
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-16 00:09:48 -04:00
strawberry 690928ec81 (hopefully?) implement AuthScheme::AppserviceToken
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-16 00:09:48 -04:00
strawberry ad8d1dc68a silence unused_qualification clippys warning due to async traits
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-16 00:09:48 -04:00
strawberry 416c6b1778 bump ruma (cargo update)
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-16 00:09:48 -04:00
strawberry 0ac2092888 check if federation is enabled in GetRemotePdu
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-16 00:09:48 -04:00
strawberry f1507a4522 handle GetRemotePdu response as backfilled PDU
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-16 00:09:48 -04:00
strawberry 6c9f47a968 some more rocksdb conditional compilation
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-16 00:09:48 -04:00
strawberry a3c24bcc31 add rocksdb_bottommost_compression_level config option
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-16 00:09:48 -04:00
strawberry 9a9f7b9c54 add RocksDB rocksdb_compression_level and rocksdb_bottommost_compression
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-16 00:09:48 -04:00
strawberry 9dc4290438 split GetPdu and GetRemotePdu, handle response as incoming PDU
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-16 00:09:48 -04:00
Jason Volk 10336f9af6 use WriteBatchWithTransaction for batched insertions.
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-16 00:09:48 -04:00
strawberry fcca352795 apply Read/Write/FlushOptions where available for future usage
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-16 00:09:48 -04:00
strawberry 20c089b7ed simplify/tune rocksdb options, config option for compression algo
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-16 00:09:48 -04:00
Timo Kösters 6f77f7ee9e dont leak users in room directory if sender is not allowed to see them
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-16 00:09:48 -04:00
strawberry 6df7f976db log sync sender_user
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-16 00:09:48 -04:00
strawberry be5c13ab0d make config PathBuf instead of String
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-16 00:09:48 -04:00
strawberry 0db3a43d1f add multi_get (multi_get_cf) for rocksdb
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-16 00:09:48 -04:00
Samuel Meenzen 238c371ef4 fix(ci): avoid duplicate pipelines
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-16 00:09:48 -04:00
strawberry e174686eeb bump misc deps
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-16 00:09:48 -04:00
Charles Hall 3160a36634 refactor clap into a separate file
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-16 00:09:48 -04:00
strawberry 5454b653fe switch to hickory-dns / hickory_resolver
trust-dns rebranded to hickry-dns

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-16 00:09:48 -04:00
strawberry ad54311c2e attempt to use example config for debian package
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-16 00:09:48 -04:00
strawberry 3f01293a6f fix User-Agent
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-16 00:09:48 -04:00
strawberry 307d42ccc7 disable update check by default
save the few bytes of bandwidth for something else

also now that we send our User-Agent, it is
technically sending conduwuit versions now

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-16 00:09:48 -04:00
strawberry 4bfcbf2b57 update image(-rs)
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-16 00:09:48 -04:00
strawberry c26ba6437e clearly document where this code came from
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-16 00:09:48 -04:00
renovate[bot] 4781e232db fix(deps): update rust crate serde_html_form to 0.2.5 2024-03-16 00:09:48 -04:00
strawberry c2317d5e83 use CFG when building on Windows
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-16 00:09:48 -04:00
strawberry ccd149245f adjust dev build args to speed up builds
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-16 00:09:48 -04:00
strawberry 33f0d111bc use main branch for rusqlite
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-16 00:09:48 -04:00
strawberry 7d825690f7 admin cmd to fetch PDU from remote server
does not append to timeline/database yet

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-16 00:09:48 -04:00
strawberry e888a0a745 drop dead server log spam to debug
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-10 13:03:28 -04:00
strawberry 742c869cc2 dont build default features for jemalloc
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-10 13:03:28 -04:00
strawberry e435d48b6f ci: run cargo deb version
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-10 13:03:28 -04:00
strawberry efe6a90159 ci: run cargo audit version, run audit earlier
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-10 13:03:28 -04:00
strawberry 9ed7d36e8e ci: run cargo doc for all features
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-10 13:03:28 -04:00
strawberry 39d9cc9d33 fix sqlite lints
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-10 13:03:28 -04:00
strawberry 82247f7ab9 fix test
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-10 13:03:28 -04:00
strawberry 781853603c test all features in engage (CI)
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-10 13:03:28 -04:00
strawberry 4a6d17b835 fix rocksdb hash
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-10 13:03:28 -04:00
strawberry 2f45ba8eac link to CI page for artifacts
i need to figure out how to do programmatic releases soon

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-10 13:03:28 -04:00
strawberry bed6953601 add CI status badge to README
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-10 13:03:28 -04:00
strawberry 0fb87cdbf8 document we officially support various OS's
i build/develop on a mac, i have a windows machine,
my servers run linux and i do prod builds on linux,
and BSD support is generally inherent with linux
and mac.

i don't think it hurts or would be difficult for me
to say i support all of these.

upstream conduit only officially supports Linux

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-10 13:03:28 -04:00
strawberry a49e79caff resolve windows-only lints
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-10 13:03:28 -04:00
strawberry d52f03414e add commandline arg to specify a conduwuit config file
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-10 13:03:28 -04:00
strawberry aec7097cd3 tokio signals are actually used for CTRL+C
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-10 13:03:28 -04:00
strawberry 26982fbe05 make these variables unix only too
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-10 13:03:28 -04:00
strawberry fee6cad778 s/rocksdb/rust_rocksdb, fix copy paste errors
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-10 13:03:28 -04:00
strawberry d84378db18 build unix socket support on unix platforms only
yes windows technically supports unix sockets,
but its not as good or the same as actual
nix platform unix sockets

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-10 13:03:28 -04:00
strawberry 39aef8d1b9 dont build sha2, opentelemetry, or zstd code if unused
reduces unnecessary crates being compiled. splits them
into features.

i have yet to see anyone use conduit's opentelemetry
stuff, and realistically those people who do
performance benchmarking and measurements will be
building stuff anyways so they can just enable this
feature.

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-10 13:03:28 -04:00
strawberry 958b738e5a drop querying _matrix SRV record to debug
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-10 13:03:28 -04:00
strawberry 3f06725261 reformat and improve cargo.toml significantly
makes it a LOT more readable, and found some ways
to reduce unnecessary crates being built.

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-10 13:03:28 -04:00
strawberry 04e5d2c20a document github ci in rust-toolchain.toml
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-10 13:03:28 -04:00
strawberry cd2f00e012 format flake, use rust-rocksdb fork
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-10 13:03:28 -04:00
strawberry 4d4c2cf5f8 bump conduwuit version to 0.1.6
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-08 18:09:41 -05:00
strawberry 5c94caa3bb temp: dont fetch remote profiles for remote membership updates
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-08 18:09:41 -05:00
renovate[bot] e4789cfc23 fix(deps): update rust crate reqwest to 0.11.25 2024-03-08 18:09:41 -05:00
strawberry e4370b2f6f bump ruma to fix Element Android URL previews
https://github.com/ruma/ruma/pull/1743

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-08 18:09:41 -05:00
strawberry 1a40171bc1 log warning for failed preview gen, better error message
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-08 18:09:41 -05:00
strawberry 1911f5a8fa fix cargo doc lint
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-08 12:51:21 -05:00
strawberry c58f93105a implement legacy "v1" media request routes
if https://github.com/ruma/ruma/issues/1240 is to
be trusted, there are apparently still servers
and clients that may call these endpoints.

i'm unable to read the history of that matrix.to
link so i don't know the full context, but this
is trivial to implement so..

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-08 12:51:21 -05:00
strawberry 496a9c7af8 resolve some pedantic lints, reduce some allocations
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-08 12:51:21 -05:00
strawberry 507baf20fa bump conduwuit version to 0.1.5
lots of new stuff

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-08 12:51:21 -05:00
strawberry c44d317907 update DIFFERENCES.md
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-08 12:51:21 -05:00
Matthias Ahouansou 5ab76a1332 update ruma appservice Registration type MR
from https://gitlab.com/famedly/conduit/-/merge_requests/583

and fixed panic from blocking async call in timeline/mod.rs

Co-authored-by: strawberry <strawberry@puppygock.gay>
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-08 12:51:21 -05:00
Timo Kösters 019a82850d improvement: do not save typing edus in db
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-08 12:51:21 -05:00
strawberry a47923820c bump rusqlite, ruma, and http
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-08 12:51:21 -05:00
strawberry 7c1624931d remove various unnecessary qualifications
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-08 12:51:21 -05:00
strawberry aedb5966fe resolve nightly performance assigning_clones lint
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-08 12:51:21 -05:00
strawberry 4dfd5a7c15 add AuthScheme AccessTokenOptional in ruma_wrapper
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-08 12:51:21 -05:00
strawberry 5a15dab7a9 bump ruma and cargo.lock
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-08 12:51:21 -05:00
strawberry dd22a14147 bump CI deps (CVE-2024-27297 / GHSA-2ffj-w4mj-pg37)
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-08 12:51:21 -05:00
Samuel Meenzen d593d1825b feat: run ci on demand to prevent unnecessary job executions
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-08 12:51:21 -05:00
strawberry f991dd381f update DIFFERENCES.md
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-08 12:51:21 -05:00
strawberry 99fdf699ae finish query_trusted_key_servers_first option
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-08 12:51:21 -05:00
strawberry d2060c8647 add config option for max RocksDB LOG files
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-08 12:51:21 -05:00
strawberry 7bfb86a851 set default rocksdb log level to error
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-08 12:51:21 -05:00
strawberry e90cd48f61 remove unnecessary pubs
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-08 12:51:21 -05:00
strawberry 139b0fdc3e add global flush function
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-08 12:51:21 -05:00
strawberry 7cbb0139f2 implement flush() and cleanup() for rocksdb
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-08 12:51:21 -05:00
strawberry 0df17a4103 remove unused lifetimes for sqlite functions
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-08 12:51:21 -05:00
strawberry ce3e61a39a document cleanup_second_interval, change default to 1800 seconds
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-08 12:51:21 -05:00
strawberry b5ef72826e dont run perform_cleanup twice on shutdown
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-08 12:51:21 -05:00
strawberry 3b90932cff bump deps
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-08 12:51:21 -05:00
strawberry 21f35d46c8 update DIFFERENCES.md
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-08 12:51:21 -05:00
strawberry da34b7f90f fix unused_must_use lints
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-08 12:51:21 -05:00
strawberry f3df9437c2 allow broken lint (?)
the braces are required. removing them like
the suggestion says breaks everything.

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-08 12:51:21 -05:00
strawberry 5c225ccbe7 mention RocksDB Direct IO in example config
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-08 12:51:21 -05:00
strawberry 9c789bd82f (hopefully correct) check if ATTIC_ENDPOINT is set in gh repo vars
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-08 12:51:21 -05:00
strawberry 446cb24c0b use Default value of 0 if BE array is not valid
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-08 12:51:21 -05:00
strawberry 6c7bc8d7dd add back more verbose nix build logging (-L)
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-08 12:51:21 -05:00
strawberry c8289f0886 partially make other docker compose files consistent
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-08 12:51:21 -05:00
Tom Foster 37b6c1e7f7 Add extra example options 2024-03-08 12:51:21 -05:00
Charles Hall a4ec0daafa make CI more efficient (github and gitlab)
squashed from https://gitlab.com/famedly/conduit/-/merge_requests/596

ported the relevant parts to GitHub Actions

Co-authored-by: strawberry <strawberry@puppygock.gay>
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-08 12:51:21 -05:00
Matthias Ahouansou 4ec2d3ecb5 refactor: use async-aware RwLocks and Mutexes where possible
squashed from https://gitlab.com/famedly/conduit/-/merge_requests/595

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-08 12:51:21 -05:00
strawberry 46b543eebe add .git-blame-ignore-revs
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-08 12:51:21 -05:00
strawberry f419c64aca add rustfmt.toml, format entire codebase
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-08 12:51:21 -05:00
strawberry 9fd521f041 partial impl of query_trusted_key_servers_first option
65% finished

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-08 12:51:21 -05:00
strawberry 2832d8cb93 make CONDUIT_CONFIG optional
retains compatibility for container users
who set it to empty.

if the variable is unspecified, it will
use the CONDUIT_ variables as normal.

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-08 12:51:21 -05:00
strawberry 3cfa34d8b8 update config comment for rocksdb threads
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-08 12:51:21 -05:00
strawberry 90d90c46da use get_physical for only physical core count
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-08 12:51:21 -05:00
strawberry 0352ea7dda add rocksdb parallelism threads config option
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-08 12:51:21 -05:00
strawberry 9251727d57 return proper error if fail fetching and dont have profile
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-08 12:51:21 -05:00
strawberry 465533d32b attempt keeping track/cache remote profiles locally again
also fixes logic error where we always say
we couldnt find the profile

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-08 12:51:21 -05:00
strawberry b527ec4666 Revert "bump nix flake"
This reverts commit 68f2c637da.
2024-03-03 22:20:37 -05:00
strawberry daaf4b7bea add basic loopback address container checks
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-03 22:20:37 -05:00
strawberry 9202f18521 bump nix flake
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-03 22:20:37 -05:00
strawberry ffcdbe2cc7 bump conduwuit version to 0.1.4, adjust example config
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-03 22:20:37 -05:00
strawberry 023c16e4f4 specify if registration token is set in show-config
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-03 22:20:37 -05:00
strawberry d1b919ed07 update DIFFERENCES.md
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-03 22:20:37 -05:00
strawberry 608aa83ed2 check if invited user is an admin before rejecting instead
i think this makes more sense tbh than what synapse does

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-03 22:20:37 -05:00
strawberry 34e8fd38cf extend room banning to local+remote room invites
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-03 22:20:37 -05:00
strawberry ea66bff46b config option to block non-admin room invites
works just like block_non_admin_invites from synapse

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-03 22:20:37 -05:00
strawberry c97483dbd3 fix rocksdb-specific lints
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-03 22:20:37 -05:00
strawberry e2c7afe69c go through a ton of pedantic clippy lints
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-03 22:20:37 -05:00
strawberry 33727a3423 replace database assert!s with if statements
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-03 22:20:37 -05:00
strawberry 624b866ed5 adjust lints for CI
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-03 22:20:37 -05:00
strawberry 04d16ac544 remove two unnecessary string heap allocs
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-03 22:20:37 -05:00
strawberry a9f714ae8d remove single-use lifetimes
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-03 22:20:37 -05:00
strawberry 56f36fe7a7 add a lot more rustc and clippy workspace lints
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-03 22:20:37 -05:00
strawberry 71654f26b9 add todo for MockedKVDatabase get_all_media_keys
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-03 22:20:37 -05:00
strawberry cde6fdd741 resolve or_fun_call clippy lint
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-03 22:20:37 -05:00
strawberry 93cc98a04c fix cargo doc lint
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-03 22:20:37 -05:00
strawberry d5bfef18a4 fix 1.77 clippy warning (multiple_bound_locations)
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-03 22:20:37 -05:00
strawberry 6022d20797 remove useless rustfmt.toml
if it ends up being useful, add it back

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-03 22:20:37 -05:00
strawberry 103df55a43 dont use default features for argon2, dev build speedup
this seems to reduce a few crates when building

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-03 22:20:37 -05:00
strawberry c7d950a52c update DIFFERENCES.md
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-03 22:20:37 -05:00
strawberry cd6a6b308b remove unnecessary clone
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-03 22:20:37 -05:00
strawberry 27f61a2dee add missing comment slash
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-03 22:20:37 -05:00
strawberry b26c593a2a adjust max rocksdb LOG files based on hard drive or SSD option
keeps 3 LOG files at most if on hard drive, else keeps 20

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-03 22:20:37 -05:00
strawberry 86de649742 cargo.lock maintenance
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-03 22:20:37 -05:00
strawberry ee548bd2e7 admin command to delete all remote media within the past x time
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-03 22:20:37 -05:00
strawberry 5c94c9c0d4 bump ruma and base64
base64 0.22.0 has decoding perf improvements

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-03 22:20:37 -05:00
strawberry 3f4f0b0d3b adjust nix build script for github actions
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-03 22:20:37 -05:00
strawberry dd57ce7d0c bump trivy
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-03 22:20:37 -05:00
strawberry 5b6d05f2db add missing CI error check, add package permission
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-03 22:20:37 -05:00
strawberry 9bcbccc391 bump gitlab CI nix version
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-03 22:20:37 -05:00
sininenkissa e71855cd0b make conduwuit show up as the server software name on /_matrix/federation/v1/version (#186)
conduwuit > /_matrix/federation/v1/version

Co-authored-by: June <june@girlboss.ceo>
2024-03-01 19:29:21 -05:00
strawberry 82f10214b3 remove all unused lifetimes
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-28 13:56:19 -05:00
strawberry abf41f4c79 check if specified user belongs to us
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-28 13:56:19 -05:00
strawberry 5a8abaa54d update DIFFERENCES.md
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-28 13:56:19 -05:00
strawberry ee4f0a0ae5 admin cmd to list all rooms a user is in
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-28 13:56:19 -05:00
strawberry fb53849b9d adjust the nix README a bit
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-28 13:56:19 -05:00
Timo Kösters f0ae99125a fix: avoid panic when client is confused about rooms 2024-02-28 13:56:19 -05:00
Timo Kösters 8e0f7b0d0a Avoid federation when it is not necessary 2024-02-28 13:56:19 -05:00
olly1240 3d4ed3e4fc Fixed nginx proxy_pass directive 2024-02-28 13:56:19 -05:00
strawberry 3c12c2b6ca fix: add top level "redacts" key for v11 redactions
at least with Element Web: they still rely on the
"redacts" top level key. it was reported that
federated redactions were not working for v11 rooms
with conduwuit. after adding back the top level
key when appending a PDU to the timeline, they
now work again.

spec below says to continue adding the top level
key for compatibility with older clients.

https://spec.matrix.org/v1.9/rooms/v11/#moving-the-redacts-property-of-mroomredaction-events-to-a-content-property

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-28 13:56:19 -05:00
EPS-DEV 4e2ce16bb8 docs: Fix 2 Links To Config Example 2024-02-28 11:02:08 -05:00
June ca281b21db document conduwuit homeserver, slight README adjustments 2024-02-26 00:49:14 -05:00
strawberry f76937a085 fix incorrect repo link on welcome msg
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-26 00:40:15 -05:00
strawberry 24625e9659 resolve nightly rust warnings
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-26 00:40:15 -05:00
strawberry 63fe9ef567 document nix binary cache in nix/README.md
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-26 00:40:15 -05:00
strawberry 6fc859e718 update DIFFERENCES.md and document multiple listening ports
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-26 00:40:15 -05:00
strawberry 598ac3e140 unmark v1 as experimental
it was reported that even with this, conduit
still cannot join those rooms.

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-26 00:40:15 -05:00
strawberry 0a91a3e6cc remove non-working key
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-26 00:40:15 -05:00
strawberry 12d2680862 disable incremental builds in CI (just to be safe)
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-26 00:40:15 -05:00
strawberry a9d232f064 remove a few unused deps (cargo machete)
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-26 00:40:15 -05:00
strawberry cdc644946d admin cmd to delete MXCs via event_id
this can be used as a way to deal with the thumbnail
and the media file at the same time without knowing
the thumbnail MXC URL.

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-26 00:40:15 -05:00
strawberry da3297fdcb add !admin as way to call conduit bot
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-26 00:40:15 -05:00
strawberry 9224e37472 helpful error msg upon failed db version assert
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-26 00:40:15 -05:00
strawberry 443bb244fc bump ruma fork
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-26 00:40:15 -05:00
strawberry 50fb202382 admin cmd to delete multiple MXC URLs in bulk
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-26 00:40:15 -05:00
strawberry 45ad7b40b3 add support for dual HTTP/HTTPS, rm caddy from complement
complement sends C-S requests over HTTP, and federation
over HTTPS.

complement without caddy *almost* works. unfortunately
i am now dealing with invalid X-Matrix signatures
due to non-percent encoded URIs and it does not
seem trivial to percent-encode URIs that a
reverse proxy would normally do for you.

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-26 00:40:15 -05:00
strawberry 5344cdbbca correct rocksdb flake version override
this was causing rocksdb to be built with
a version of 8.3.2, but pulling 8.10.0
source code.

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-26 00:40:15 -05:00
strawberry ec2092cb43 add complement CA to conduit.toml dockerfile
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-26 00:40:15 -05:00
strawberry 07772f2fed document conduit direct TLS support + logging
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-26 00:40:15 -05:00
strawberry 67b307c75b add support for listening on multiple ports
retains existing config compatibility using either:
`port = 6167`
`port = [80, 443, 8448]`

Co-authored-by: Charles Hall <charles@computer.surgery>
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-26 00:40:15 -05:00
strawberry 99f7dad939 bump nix (rust crate) and add either
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-26 00:40:15 -05:00
strawberry 342400fe2d fix tests
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-24 13:04:13 -05:00
strawberry 43c2ac6c1c update DIFFERENCES.md
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-24 13:04:13 -05:00
strawberry ca42ec338b replace accidental unwraps with if let's
this provides not only some future compatibility with MSC4051,
but it just makes sense to not crash/error if we can't get a server_name
from the room ID and should just use the server_name from the sender
user's invite event. there is already code ahead that accounts for
an empty vector so this is safe.

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-24 13:04:13 -05:00
strawberry 81b8f7c380 bump ruma and image-rs
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-24 13:04:13 -05:00
strawberry 47671606dd bump nix version in gitlab CI
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-24 13:04:13 -05:00
strawberry 99b8a568d6 add .DS_Store to gitignore (lol)
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-24 13:04:13 -05:00
strawberry c038da21b4 adjust complement stuff a tad
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-24 13:04:13 -05:00
strawberry 4d624846ee admin command to delete media via MXC url
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-24 13:04:13 -05:00
strawberry 27c29e6063 db functions to delete media via MXC
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-24 13:04:13 -05:00
strawberry cc762c49e2 bump thread_local in cargo.toml
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-24 13:04:13 -05:00
strawberry 1ecad225be feat: custom text for user displayname suffix upon registration
replaces the lightning bolt emoji option with support for
your own text or emojis

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-24 13:04:13 -05:00
strawberry 0972079319 raise default systemd unit start/stop timeout
default of 90 seconds can be too low if hardware is not very fast
and rocksdb compaction or shutdown takes too long

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-24 13:04:13 -05:00
strawberry 5a4403fa25 bump cargo.lock due to yanked crate
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-24 13:04:13 -05:00
K900 9602fefa7e fix: update ruma commit hash 2024-02-24 11:07:26 -05:00
strawberry 0593dce8a6 add missing feature to DIFFERENCES.md
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-20 07:06:57 -05:00
strawberry 03d796e95e support room aliases for room blocking, argument to disable federation
and makes parsing the room more generic (room ID or room alias)

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-20 07:06:57 -05:00
renovate[bot] 8fe42cb9e8 fix(deps): update rust crate serde to 1.0.197 2024-02-20 07:06:57 -05:00
renovate[bot] ac3a3a84e2 fix(deps): update rust crate serde_json to 1.0.114 2024-02-20 07:06:57 -05:00
strawberry 36bc21193c oops forgot import
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-20 07:06:57 -05:00
renovate[bot] 54728ac440 chore(deps): update nixos/nix docker tag to v2.20.2 2024-02-20 07:06:57 -05:00
renovate[bot] a8574fdfd7 fix(deps): update rust crate serde_yaml to 0.9.32 2024-02-20 07:06:57 -05:00
strawberry 3d26210eac more useful database logging (compaction, time taken to load)
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-20 07:06:57 -05:00
strawberry ce1aae7abc update transitive png dependency
thanks to cargo audit, 0.17.12 was yanked due
to build breakage.

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-20 07:06:57 -05:00
strawberry 620206be91 update DIFFERENCES.md
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-20 07:06:57 -05:00
renovate[bot] 856ea200ac fix(deps): update rust crate ring to 0.17.8 2024-02-20 07:06:57 -05:00
strawberry bdda875416 bump conduwuit version to 0.1.3
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-20 07:06:57 -05:00
strawberry 9a6a77974b add support for bulk banning room IDs
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-20 07:06:57 -05:00
strawberry e25d574208 move room moderation stuff to a subcommand
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-20 07:06:57 -05:00
strawberry c9364dc077 dont evict admins from room, allow admins to join banned rooms
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-20 07:06:57 -05:00
strawberry ed0c8e86f7 initial implementation of banning room IDs
takes a full room ID, evicts all our users from that room,
adds room ID to banned room IDs metadata db table, and
forbids any new local users from attempting to join it.

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-20 07:06:57 -05:00
strawberry a92f291bbf feat: query param to return full state event or event content
query parameter `?format=event|content`

defaults to normal behaviour which is the event's content.

ruma impl: https://github.com/girlbossceo/ruma/commit/788ea6b00fab49b04a17d88caa0c840b7d74aa13

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-20 07:06:57 -05:00
strawberry b80be6c709 remove unused database function
i have no idea what this is for

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-20 07:06:57 -05:00
strawberry a2f7f6fda4 prefix every admin room help cmd with -
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-20 07:06:57 -05:00
strawberry a0205cd41d implement deprecated user field for login requests
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-20 07:06:57 -05:00
renovate[bot] 5f007d8117 chore(deps): lock file maintenance 2024-02-16 19:30:28 -05:00
renovate[bot] f2d4e626c0 fix(deps): update rust crate clap to 4.5.1 2024-02-16 17:40:29 -05:00
renovate[bot] 45698e310a chore(deps): lock file maintenance 2024-02-15 01:27:13 -05:00
strawberry b1d1f3a643 add my attic binary caches
conduit and conduwuit are the same

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-15 01:18:30 -05:00
strawberry bef1061a51 that was not a valid option
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-15 01:18:30 -05:00
strawberry adb2059ea2 make ATTIC_TOKEN available in environment
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-15 01:18:30 -05:00
strawberry bb3d5b5d9f add cargo audit as engage task
just in case trivy is useless

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-15 01:18:30 -05:00
strawberry 359a137d2e add trivy for code and vulnerability scanning
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-14 20:14:21 -05:00
renovate[bot] cf9d77d04e chore(deps): update nixos/nix docker tag to v2.20.1 2024-02-14 19:36:13 -05:00
renovate[bot] 3c675dd08e chore(deps): update docker docker tag to v25.0.3 2024-02-14 19:35:58 -05:00
renovate[bot] aa8e534293 fix(deps): update rust crate tikv-jemallocator to 0.5.4 2024-02-14 19:35:29 -05:00
renovate[bot] 9f5b823b3a fix(deps): update rust crate tikv-jemalloc-ctl to 0.5.4 2024-02-14 19:34:02 -05:00
strawberry 62603f2348 install nix-env engage for gitlab ci
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-14 19:31:30 -05:00
strawberry 3a72193c84 move nix config to NIX_CONFIG env variable
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-14 19:07:08 -05:00
strawberry 33e7dafc1a fix incorrect comment about db_cache_capacity_mb
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-14 19:07:08 -05:00
strawberry 5515d12edd make gitlab CI work for conduwuit
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-14 19:07:08 -05:00
strawberry 63bb00d902 error if using known placeholder server_name, log if using debug build
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-14 19:07:08 -05:00
strawberry d1f55b59cf fix wrong docker image in compose files
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-14 19:07:08 -05:00
strawberry e09b2598ee update attic URL, upload to conduwuit too
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-14 19:07:08 -05:00
strawberry 5d7b8cd309 think this is the correct way
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-14 19:07:08 -05:00
strawberry 0e7ec9f2dd update rocksdb to 8.10.0 in nix flake
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-14 19:07:08 -05:00
strawberry 4bcedf7f4b bump rocksdb (finally)
queue the CI errors

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-14 19:07:08 -05:00
renovate[bot] c66fa14002 fix(deps): update rust crate serde_yaml to 0.9.31 2024-02-14 17:34:16 -05:00
renovate[bot] 8c074d1cf9 fix(deps): update rust crate serde_json to 1.0.113 2024-02-14 17:27:48 -05:00
renovate[bot] 7a08f0754b fix(deps): update rust crate serde_html_form to 0.2.4 2024-02-14 17:23:53 -05:00
renovate[bot] 5ef46c63e6 fix(deps): update rust crate serde to 1.0.196 2024-02-14 17:22:57 -05:00
strawberry 5b31cdf1b5 ignore basically all the http dependencies we cant upgrade to
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-14 09:51:11 -05:00
Samuel Meenzen 8e03a79d35 feat: renovate all the way
Because dependabot is lazy on weekends.
2024-02-14 09:42:00 -05:00
dependabot[bot] c98c71eb7c Bump thiserror from 1.0.56 to 1.0.57
Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.56 to 1.0.57.
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.56...1.0.57)

---
updated-dependencies:
- dependency-name: thiserror
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-12 07:23:22 -05:00
strawberry 16d384271b CI expects default features of rocksdb?
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-11 21:56:55 -05:00
strawberry 9724fe7d70 go back to outdated rocksdb (the fork breaks CI in a weird way now)
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-11 21:56:55 -05:00
strawberry 4ef6c8a01a does this commit work???
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-11 21:56:55 -05:00
strawberry 0052d7b669 use rust-rocksdb 8f65a73f0962edc4cc028f4012692043dc657a76
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-11 21:56:55 -05:00
strawberry dac8b3db49 move these config checks to main.rs
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-11 21:56:55 -05:00
strawberry 0ea8657070 default to Undefined if room avatar URL was not found despite checking if its Some
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-11 21:56:55 -05:00
strawberry bb1edc3f1a use zaidoon1's fork of rust-rocksdb
https://github.com/zaidoon1/rust-rocksdb

https://github.com/rust-rocksdb/rust-rocksdb/issues/855#issuecomment-1937412844

shame that this has resulted in yet another fork of software, but oh well...

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-11 21:56:55 -05:00
strawberry 244c1f7190 config option to check root domain with URL previews
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-11 21:56:55 -05:00
strawberry 54ade97f96 add expect message when failing to send oneshot channel shutdown transaction
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-11 21:56:55 -05:00
strawberry 6ee6217f95 update DIFFERENCES.md and debian postinst config
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-11 21:56:55 -05:00
strawberry 48e4b71dd1 remove hardcoded 300kb limit on spider size with config option of 1MB default
modern websites are sadly massive, 300kb is pretty low. 1MB should be enough.

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-11 21:56:55 -05:00
strawberry 2ea895199a dont drop true error with url str parse, fix url contains logic order, clarify config comment
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-11 21:56:55 -05:00
strawberry 7786553cda doc+check if user does not have local presence enabled if using outgoing presence
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-11 21:56:55 -05:00
strawberry d069379d77 (please) dont drop true error in presence timer creation failures
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-11 21:56:55 -05:00
strawberry 8e6d52e7dd dont follow more than 2 redirects for URL previews for security reasons
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-11 21:56:55 -05:00
strawberry fb2eba722d fix media tests for URL previews
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-11 21:56:55 -05:00
Reiner Herrmann c0dd5b1cc2 feat: URL preview support
from upstream MR https://gitlab.com/famedly/conduit/-/merge_requests/347
with the following changes (so far):
- remove hardcoded list of allowed hosts (strongly disagree with this,
even if it is desired, it should not be harcoded)
- add more allow config options for granularity via URL contains,
host contains, and domain is (explicit match) for security
- warn if a user is allowing all URLs to be previewed for security reasons
- replace an expect with proper error handling
- bump webpage to 2.0
- improved code style a tad

Co-authored-by: rooot <hey@rooot.gay>
Signed-off-by: rooot <hey@rooot.gay>
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-11 21:56:55 -05:00
strawberry 6f26be1c6e eat less /ban endpoint fields, fix ban reason not consistently applied
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-11 21:56:55 -05:00
strawberry 9be73d341c update debian systemd unit to use notify and harden/update it more
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-11 21:56:55 -05:00
strawberry 3ff5bc5298 ask systemd for more time when shutting down if needed, raise axum shutdown timeout to 3 mins
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-11 21:56:55 -05:00
strawberry 0b171a2b9c bump default max_concurrent_requests to 500, update config comment
also raise 1024 bytes to 4096 bytes in minimum max_request_size check

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-11 21:56:55 -05:00
strawberry da4b509940 update DIFFERENCES.md
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-11 21:56:55 -05:00
strawberry b8ab4754a5 slight wording addition
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-11 21:56:55 -05:00
strawberry 7ddf08e8b7 filter out "config" as it's an expected config option
this seems to exist when using `CONDUIT_CONFIG`
environment variable, this is expected.

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-11 21:56:55 -05:00
strawberry 6996d63a02 warn if a catchall config option (unknown config option) exists
a longer way of saying: warn if a config key is unknown

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-11 21:56:55 -05:00
strawberry d4d8c6eb21 check if custom room ID is apart of forbidden room alias
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-11 21:56:55 -05:00
Matthias Ahouansou fc93b29abe feat: forbid certain usernames & room aliases
squashed from https://gitlab.com/famedly/conduit/-/merge_requests/582

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-11 21:56:55 -05:00
Matthias Ahouansou 784d307425 revamp appservice registration to ruma's Registration type
squashed from https://gitlab.com/famedly/conduit/-/merge_requests/583

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-11 21:56:55 -05:00
Raito Bezarius 0e9eb22ee7 feat: support non-flake users
This uses flakes-compat to read the `flake.nix` and expose it
to non-flake users.

Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-11 21:56:55 -05:00
strawberry 1f7ac6d112 update valid_until_ts comment
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-02-11 21:56:55 -05:00
dependabot[bot] e0cdcf66d3 Bump tokio from 1.35.1 to 1.36.0
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.35.1 to 1.36.0.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.35.1...tokio-1.36.0)

---
updated-dependencies:
- dependency-name: tokio
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-06 21:08:17 -05:00
dependabot[bot] 3ac42129ac Bump reqwest from 0.11.23 to 0.11.24
Bumps [reqwest](https://github.com/seanmonstar/reqwest) from 0.11.23 to 0.11.24.
- [Release notes](https://github.com/seanmonstar/reqwest/releases)
- [Changelog](https://github.com/seanmonstar/reqwest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/seanmonstar/reqwest/compare/v0.11.23...v0.11.24)

---
updated-dependencies:
- dependency-name: reqwest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-01 19:39:24 -05:00
strawberry 1157994b49 update docker README with our links
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-31 21:12:09 -05:00
strawberry 71d5361703 bit of repo cleanup
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-31 21:12:09 -05:00
strawberry ee90f66450 remove test branch, only publish if not PR
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-31 19:39:26 -05:00
strawberry 03080c5677 bump ruma
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-31 19:39:26 -05:00
strawberry 1b780fdbfa i think its docker.io
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-31 19:39:26 -05:00
strawberry c239ff5e42 make image_name variable work, OCI uses/expects conduit
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-31 19:39:26 -05:00
strawberry 2dd8d372de username is not secret, use conduwuit and main branch
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-31 19:39:26 -05:00
strawberry 4be2948afc fix syntax error, add test branch
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-31 19:39:26 -05:00
strawberry 29d7257a41 attempt to push OCI images to docker hub and ghcr
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-31 19:39:26 -05:00
strawberry 98b54caca5 remove test branch from CI
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-31 16:27:13 -05:00
strawberry ab22dc4bc8 update DIFFERENCES.md
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-31 16:20:26 -05:00
strawberry 83f7ea54df update gh actions OCI image paths to match gitlab
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-31 16:20:26 -05:00
Samuel Meenzen d8e7ea78ed Publish oci image to the gitlab registry
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-31 16:20:26 -05:00
Charles Hall c33fd35c1c (upstream) update DEPLOY.md with new build links
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-31 16:20:26 -05:00
strawberry 25d9cc28d6 remove removing rustup and default cargo, remove building aarch64 deb
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-31 16:20:26 -05:00
strawberry 4cebb282ab (prob doesnt work) build aarch64 deb
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-31 16:20:26 -05:00
strawberry fedbe0dc66 build deb, update deb metadata and files
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-31 16:20:26 -05:00
strawberry 1581a3ca84 force copy
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-31 16:20:26 -05:00
strawberry d11b03feab dont compress OCI images, copy result to tar.gz
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-31 16:20:26 -05:00
Charles Hall 621c85fd3b run cargo update
`IndexMap::remove` was deprecated in favor of explicitly named methods.
I assume that we actually needed to be using `shift_remove`, otherwise
we probably wouldn't be bothering with `indexmap` here in the first
place. I wonder if this fixes any bugs lol

from: https://gitlab.com/famedly/conduit/-/merge_requests/580

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-31 16:20:26 -05:00
strawberry 950d69eb66 build OCI images for x86_64 and aarch64 in CI
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-31 16:20:26 -05:00
strawberry 468009fce5 fix wrong artifact path in gitlab ci
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-31 16:20:26 -05:00
strawberry 1f3b91accd remove redundant copy and just use path
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-31 16:20:26 -05:00
Charles Hall d68268da2e pass pkgsCrossStatic to mkOciImage, not pkgsHost
This fixes a bug where the aarch64 OCI image had metadata saying it was
an x86_64 OCI image. On top of that, I think the metadata was actually
right (aside from Conduit's binary): since all other packages were being
pulled from `pkgsHost`, an OCI image cross compiled for aarch64 from a
different architecture would result in unexecutable binaries (e.g. tini)
since they were compiled for the completely wrong architecture.

from: https://gitlab.com/famedly/conduit/-/merge_requests/579

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-31 16:20:26 -05:00
strawberry fb1fa4364d downgrade rust-rocksdb back to latest stable
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-31 16:20:26 -05:00
Charles Hall 8954243457 switch crane input back to upstream
Thanks to the crane maintainer to fixing my issue in a way that doesn't
suck, unlike my attempt in the fork we were briefly using.

from: https://gitlab.com/famedly/conduit/-/merge_requests/576

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-31 16:20:26 -05:00
Charles Hall 79750b9685 make complement (mostly) work again
Well, kinda. It crashed on me after 10 minutes because the tests timed
out like in <https://github.com/matrix-org/complement/issues/394>.
Sounds like this means it's a them problem though.

I want to use Nix to build this image instead in the future but this
will at least make it work for now and give me a reference for while I'm
porting it. I also want to make Conduit natively understand Complement's
requirements instead of `sed`ing a bunch of stuff and needing a reverse
proxy in the container. Should be more reliable that way.

I'm not making this run in CI until the above stuff is addressed and
until I can decide on a way to pin the revision of Complement being
tested against.

from: https://gitlab.com/famedly/conduit/-/merge_requests/575

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-31 16:20:26 -05:00
strawberry bc421ec96b add -L to nix build command
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-31 16:20:26 -05:00
strawberry 33847b8b4b fix syntax error (both uses and run)
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-31 16:20:26 -05:00
strawberry 77e8a6e5ae port some of artifacts building to gh actions (attempt 1)
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-31 16:20:26 -05:00
strawberry aa3fd6a47e switch cargo.toml pkg name back to conduit
we already make it clear this is a fork with
our version and such

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-27 16:47:33 -05:00
strawberry 24605e151d make allow_federation default to true
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-27 16:47:33 -05:00
Charles Hall c329eb197d add ca certificates to the OCI image
Without this, checking the authority of TLS certificates fails, making
Conduit (rightly) refuse to connect to anything.

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-27 16:47:33 -05:00
strawberry 81a4f9e539 use main instead of latest for docker tag
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-27 16:47:33 -05:00
strawberry fd19d132eb make nix-build-and-cache executable
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-26 20:39:01 -05:00
strawberry 8793abf41f does this work
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-26 19:47:54 -05:00
strawberry 331b63ca40 upstream nix changes, make rocksdb git work
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-26 19:47:54 -05:00
strawberry 35ebc459fa add explicit_outlives_requirements rustc lint
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-26 19:47:54 -05:00
strawberry 5a8a3c742d s/15000/10000
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-26 19:47:54 -05:00
Charles Hall 620bfacc30 ci: cross compile static binaries for x86_64 and aarch64
from https://gitlab.com/famedly/conduit/-/merge_requests/569

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-26 19:47:54 -05:00
kubo6472 7588790c3b bump nix cache
Fix nodejs v16 incompatible/deprecation
2024-01-25 20:20:27 -05:00
strawberry 4ac568769b improvement: registration token now only works when registration is enabled
Co-authored-by: Timo Kösters <timo@koesters.xyz>
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-25 19:28:33 -05:00
strawberry ab0b52ef1e update DIFFERENCES.md
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-25 19:28:33 -05:00
strawberry 8b6bd8e89e add cargo clippy
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-25 19:28:33 -05:00
strawberry 2c51cdc23b update nix flake for gitlab CI building docker images
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-25 19:28:33 -05:00
strawberry 0e8267656f fix room ID messages, remove comments
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-25 19:28:33 -05:00
strawberry 08a183e8c7 assume well-known is None if text length exceeds 10000 chars
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-25 19:28:33 -05:00
Charles Hall ec7aeb1096 move resolver logic into the resolver
Honestly not sure why it wasn't done like this before. This code is much
less awkward to follow and more compartmentalized.

These changes were mainly motivated by a clippy lint triggering on the
original code, which then made me wonder if I could get rid of some of
the `Box`ing. Turns out I could, and this is the result of that.

Co-authored-by: strawberry <strawberry@puppygock.gay>
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-25 19:28:33 -05:00
strawberry 1536f08d81 use both is_ip_literal and IPAddress is_valid checks
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-25 19:28:33 -05:00
strawberry 9858b33b37 just remove double quotes if found instead
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-25 19:28:33 -05:00
strawberry e0419d9c5d custom room ID checks, dont use format! macro due to quotes being added
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-25 19:28:33 -05:00
strawberry 7eff572e77 check if room ID already exists instead of erroring on auth check
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-25 19:28:33 -05:00
strawberry 8754f0e2a5 additional character check on room alias
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-25 19:28:33 -05:00
strawberry e272f0f34f update DIFFERENCES.md
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-25 19:28:33 -05:00
strawberry 89d9cdeb3a IP range denylist logging, and fix logic error
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-25 19:28:33 -05:00
strawberry 382347353e add custom room ID support using room_id field
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-25 19:28:33 -05:00
strawberry 2980af6490 move room creation config check higher up
dont bother wasting resources if we know we
arent even allowed to make the room to begin with

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-25 19:28:33 -05:00
strawberry ead9a58dce dont crash failing to deserialise room creation content
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-25 19:28:33 -05:00
strawberry 3453dcc344 add error checking to room aliases
length, colon, and spaces. also dont crash.

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-25 19:28:33 -05:00
strawberry b51d148899 remove random space
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-25 19:28:33 -05:00
strawberry 6c1358d0c8 send home_server on login response again
a 6+ year old deprecated field that isnt even spelled
right, and no clients use it must still be sent
according to spec

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-25 19:28:33 -05:00
strawberry 9d1ca3e84a update deps
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-25 19:28:33 -05:00
strawberry 114369bcf6 delete Dockerfile
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-25 19:28:33 -05:00
strawberry fa0c083555 don't send requests to specified list of IP CIDRs
this can most definitely be improved but this is a decent attempt.
the only annoying this is i couldn't just use a Vec<IPAddress> which
would have significantly simplified all of this, but serde can't
deserialise it on the config side i guess.

i may find a better way to do this in the future, but this should cover
most areas anyways.

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-25 19:28:33 -05:00
strawberry 71d247232d oops forgot that endpoint too
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-25 19:28:33 -05:00
strawberry 6c75087863 eat less of client parameters for media requests
still cantt respect allow_redirect yet

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-25 19:28:33 -05:00
strawberry ab6cb4ad2d switch back to expect for sender_user
as far as i can tell, it will return a normal
error in the auth token handling code so this is fine.
we also shouldnt assume all errors from this are
access_token related.

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-25 19:28:33 -05:00
strawberry 02bc818633 match explicit URI to see if we should authenticate the user
first attempt at forcing an endpoint to be authenticated

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-25 19:28:33 -05:00
strawberry 1de7980143 update DIFFERENCES.md so far
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-25 19:28:33 -05:00
strawberry dc9c86d3db bump ruma, rusqlite, and rocksdb
latest rocksdb now has WriteBufferManager support

i hope no one is using sqlite with conduwuit, but if they are let's
bump it to latest git too for the latest sqlite version available.

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-25 19:28:33 -05:00
strawberry 9d0c85ab17 use ruma JsOption, bump figment
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-25 19:28:33 -05:00
strawberry 4e8823dedb add warning about outgoing presence PDU/EDU relationship
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-25 19:28:33 -05:00
strawberry 1460a82f54 use engage for gitlab CI
from https://gitlab.com/famedly/conduit/-/merge_requests/564

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-25 19:28:33 -05:00
strawberry 11bc725268 return joined member count of room for pushrules instead of hardcoded 10
im not sure what the TODO is trying to say here,
but since it's many years old and conduwuit is
fast, i dont see an issue with this.

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-25 19:28:33 -05:00
strawberry b50c47e1c2 silence loud tower_http errors (move to info)
these are benign errors that are from things like
conduwuit fetching remote media from dead servers

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-25 19:28:33 -05:00
strawberry 34bac4d1d9 support sending well_known client response in /login using well_known_client
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-25 19:28:33 -05:00
strawberry cf62cb0d0a send avatar_url on invite member events like synapse
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-25 19:28:33 -05:00
strawberry f275a0dfbe fix obvious copy-paste error
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-25 19:28:33 -05:00
strawberry 982eec178b add conduwuit-example.toml (new example config)
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-25 19:28:33 -05:00
strawberry fb1ade551a revamp example config, document lots of config options
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-25 19:28:33 -05:00
strawberry a7aa91739f make warning and slight changes to DEPLOY.md for conduwuit
this is not finished yet

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-25 19:28:33 -05:00
strawberry fae00e5136 remove rocksdb_max_open_files option
default for RocksDB is -1 and conduwuit already raises the
soft and hard nofile limits at startup.

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-25 19:28:33 -05:00
strawberry 6ffc54e241 support blocking servers from fetching remote media from
akin to synapse's `prevent_media_downloads_from`

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-17 23:57:45 -05:00
strawberry 1a06c8c9d3 more error checking for deserialising events and canonical JSON
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-17 23:57:45 -05:00
strawberry c83acabfb0 return proper error if we fail to convert to canonical JSON
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-17 23:57:45 -05:00
strawberry 3d6b499b88 log error and PDU for failed auth checks
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-17 23:57:45 -05:00
strawberry 3ffca25f6f update few endpoint docs versions
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-17 23:57:45 -05:00
strawberry 2bbc75d68e why did i have to run cargo fmt twice
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-17 14:26:26 -05:00
strawberry de303d9480 update rust toolchain in flake
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-17 14:26:26 -05:00
strawberry 40f5345586 fix formatting and links of user reports more
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-17 14:26:26 -05:00
strawberry 6063a671c3 bump MSRV to 1.75.0 for latest ruma
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-17 14:26:26 -05:00
strawberry 632276ae99 bump ruma to aa3acd88d21dfbb7595f54e619f52761bcb0259e
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-17 14:26:26 -05:00
strawberry e944ed5eb4 fix /report endpoint a lot
in short, the `/report` endpoint now checks if:
- the reporting room in the URI matches the PDU/event reported
- sender user is in the room reported
- raises report reasoning to 750 characters (spec doesn't say to limit
these, but thorough and informative reports for server admins are not
a bad thing)
- (hopefully) fixes some broken formatting
- add a random short delay before sending a successful response to the
client to make it more annoying to enumerate for events on our server
(security by obscurity but spec suggests it)

basically, secure reports better lol

see https://spec.matrix.org/v1.9/client-server-api/#post_matrixclientv3roomsroomidreporteventid

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-17 14:26:26 -05:00
strawberry 7eb57a9fd5 explicitly fallback to None for invalid/empty room topics
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-17 14:26:26 -05:00
strawberry 1f117582ca update all transitive dependencies (cargo update)
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-17 14:26:26 -05:00
strawberry 9a3866afff return M_INVALID_PARAM instead of M_BAD_JSON for bad room aliases
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-17 14:26:26 -05:00
strawberry 92641d0628 first of many small code documentation
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-17 14:26:26 -05:00
strawberry ad1d272e2a fix blocks_in_conditions clippy lint
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-17 14:26:26 -05:00
strawberry 8d42351e34 add presence options to show-config admin cmd
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-17 14:26:26 -05:00
strawberry 0252e9c2c7 split max build optimisations into release-high-perf build profile
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-17 14:26:26 -05:00
strawberry a85ebdeaa0 require sender_user being in the reporting room for /report events
Matrix 1.8 change:
https://spec.matrix.org/v1.9/client-server-api/#post_matrixclientv3roomsroomidreporteventid

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-17 14:26:26 -05:00
strawberry efa6308172 actually we can remove loole (for now) and crossbeam
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-17 14:26:26 -05:00
strawberry bfc738d80e default to None for room topic event in spaces or /publicRooms
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-17 14:26:26 -05:00
strawberry ef10a2df36 add more lints, bump image and crossbeam
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-17 14:26:26 -05:00
strawberry 59c7f93656 fix more clippy lints (part 1)
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-17 14:26:26 -05:00
renovate[bot] 44440f745f chore(deps): update actions/cache action to v4 2024-01-17 12:04:47 -05:00
strawberry 2074e36aa4 add missing ban reason to ban events
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-14 20:55:56 -05:00
strawberry 2f16726bac raise generated passwords to 25 chars
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-14 20:55:56 -05:00
strawberry 2b031e40a2 partially revert keeping track of remote user profiles
this seems to require some more work to properly ignore
dead server errors without breaking the entire room join

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-14 20:55:56 -05:00
strawberry 149d22eef7 make set avatar, displayname, and blurhash async and forgot another let _
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-14 20:55:56 -05:00
strawberry 9ec1532580 ignore potential errors when updating user profiles
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-14 20:55:56 -05:00
strawberry 4d410d7304 update DIFFERENCES.md
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-14 20:55:56 -05:00
strawberry 0297cfe307 remove cached destination for a destination if request fails
this can help if users change their well-known or such and we don't want
to keep on hitting the old destination.

from https://gitlab.com/Aranjedeath/conduit/-/commit/11357d1f1af27b0cbd06ee2d8431bd965bc6d95e

Co-authored-by: Jacob Taylor <jacob@explodie.org>
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-14 20:55:56 -05:00
strawberry ad792f4565 oops dedup only works on consecutive elements
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-14 20:55:56 -05:00
strawberry 52884abff6 don't validate or add signature if room is not v8 or above or not using restricted joins
should resolve https://github.com/matrix-org/matrix-spec/issues/1708 on
for conduwuit until spec clarifies.

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-14 20:55:56 -05:00
strawberry 5c4b8ad7a3 replace panics on unknown room versions with errors
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-14 20:55:56 -05:00
strawberry c70ce49ec0 don't allow non-local users to have their creds modified in Deactivate admin cmds
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-14 20:55:56 -05:00
strawberry edd74efbf2 dedup servers in get_alias_helper
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-14 20:55:56 -05:00
strawberry da539efb98 only follow up to 6 redirects in default reqwest ClientBuilder
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-14 20:55:56 -05:00
strawberry ae11e378d2 debug log well-known response body and text
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-14 20:55:56 -05:00
strawberry 14a0d12002 declare support for Matrix 1.5 in our federation requests
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-14 20:55:56 -05:00
strawberry acc0bdad1a update rocksdb to 8.10.0
https://github.com/rust-rocksdb/rust-rocksdb/pull/852

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-14 20:55:56 -05:00
strawberry 424f02466c DIFFERENCES.md: suggest servers to join via at room directory
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-14 20:55:56 -05:00
strawberry 0b0b52c33b add all possible workspace clippy lints (with commenting out most for now)
this will be a major pain to work through. for now, let's
just add them and overtime work through these.

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-14 20:55:56 -05:00
strawberry 49b6f338fd feat: suggest servers to join at /_matrix/client/v3/directory/room/{roomAlias}
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-14 20:55:56 -05:00
strawberry da3ac7a2f1 deps updates again
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-14 20:55:56 -05:00
strawberry 15ffc4951e oops forgot to bump 1.70.0 in flake and gitlab dockerfile
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-14 20:55:56 -05:00
strawberry 8e569b8d29 we also support webp images
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-14 20:55:56 -05:00
strawberry 6ea07da24d nix: update flake
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-14 20:55:56 -05:00
strawberry 468e5a48f3 add more stuff to DIFFERENCES.md
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-14 20:55:56 -05:00
strawberry ee2f1c3084 the great persy, sled, and heed purge (and bump MSRV to 1.74.1)
these database backends are either unmaintained, broken in conduit, or
incredibly niche for something like conduwuit.

also i want to bump the MSRV.

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-14 20:55:56 -05:00
strawberry b28a2fad97 feat: keep track of remote profiles for user directory and local requests
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-14 20:55:56 -05:00
strawberry ef8dcdfe3c declare explicit support for room filtering (MSC3827)
conduit has supported this for a while now and is a Matrix 1.4 feature

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-14 20:55:56 -05:00
strawberry c75674faf5 bump default_presence_offline_timeout to 30 minutes (too low imo)
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-14 20:55:56 -05:00
strawberry 966cca25f1 bump conduwuit version as we've made a lot of changes
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-14 20:55:56 -05:00
strawberry 85b2c6681b allow HEAD HTTP requests in CORS
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-14 20:55:56 -05:00
strawberry 20aa2cfca6 update device lists for user upon logout
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-14 20:55:56 -05:00
strawberry 830cd0e6d7 document we shutdown cleaner and safer
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-09 12:24:42 -05:00
strawberry 7021c52c9b send a User-Agent on all requests
amazing that this wasn't done in the first place. a lack of a UA is
suspicious and some providers may block our requests just for the sake
of no UA.

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-07 22:26:27 -05:00
strawberry aa40e07d2d add some new things/fixes to DIFFERENCES.md
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-07 22:26:27 -05:00
strawberry 8586b15e1a add support for serving client+server well-known and /client/server.json endpoints from conduwuit
the last endpoint is a non-standard health check endpoint used by at
least Element Web as a weird way to determine if syncv3 is available

there can also be some valid use-cases for serving well-knowns from the
application itself

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-07 22:26:27 -05:00
strawberry bb2f213ac3 more helpful panic msg on failing to increase soft/hard FD limits
this can be caused by security policies, hardening, etc

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-07 22:26:27 -05:00
strawberry 1308574db0 bump ruma to latest commit (syncv3 JsOption and push optional power levels)
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-07 22:26:27 -05:00
strawberry 5422d0cedd declare support for various missing matrix versions
this is another one of those things that upstream has neglected

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-07 22:26:27 -05:00
dependabot[bot] bead35d460 Bump clap from 4.4.12 to 4.4.13
Bumps [clap](https://github.com/clap-rs/clap) from 4.4.12 to 4.4.13.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/v4.4.12...v4.4.13)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-06 16:17:14 -05:00
dependabot[bot] 8b57ebe9a2 Bump opentelemetry_sdk from 0.21.1 to 0.21.2
Bumps [opentelemetry_sdk](https://github.com/open-telemetry/opentelemetry-rust) from 0.21.1 to 0.21.2.
- [Release notes](https://github.com/open-telemetry/opentelemetry-rust/releases)
- [Commits](https://github.com/open-telemetry/opentelemetry-rust/compare/v0.21.1...v0.21.2)

---
updated-dependencies:
- dependency-name: opentelemetry_sdk
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-06 16:17:07 -05:00
dependabot[bot] 16a0cd4ed4 Bump loole from 0.1.13 to 0.3.0
Bumps [loole](https://github.com/mahdi-shojaee/loole) from 0.1.13 to 0.3.0.
- [Commits](https://github.com/mahdi-shojaee/loole/commits)

---
updated-dependencies:
- dependency-name: loole
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-06 16:17:00 -05:00
dependabot[bot] 673febe9a4 Bump serde from 1.0.193 to 1.0.194
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.193 to 1.0.194.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.193...v1.0.194)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-06 16:16:53 -05:00
strawberry 2161630b54 raise reqwest client timeout to 300 seconds
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-06 16:16:44 -05:00
strawberry 3ba129e80c remove unnecessary else logic in sha256_media db migration
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-06 16:16:44 -05:00
strawberry 3723d37b14 raise report reason limit to 500 (though spec doesnt say to limit these)
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-06 16:16:44 -05:00
strawberry d56e76c23e raise various timeouts, make exp backoff consistent
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-06 16:16:44 -05:00
strawberry 8c04dffbbd add DIFFERENCES.md (changes conduwuit makes from upstream)
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-06 14:51:08 -05:00
strawberry c534027fa4 revamp README.md to conduwuit
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-01-06 14:51:08 -05:00
dependabot[bot] 7a8aa969fa Bump thiserror from 1.0.52 to 1.0.56
Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.52 to 1.0.56.
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.52...1.0.56)

---
updated-dependencies:
- dependency-name: thiserror
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-02 19:36:40 -05:00
dependabot[bot] c82f662e0e Bump async-trait from 0.1.75 to 0.1.77
Bumps [async-trait](https://github.com/dtolnay/async-trait) from 0.1.75 to 0.1.77.
- [Release notes](https://github.com/dtolnay/async-trait/releases)
- [Commits](https://github.com/dtolnay/async-trait/commits)

---
updated-dependencies:
- dependency-name: async-trait
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-02 19:27:21 -05:00
dependabot[bot] 4ed6de2919 Bump figment from 0.10.12 to 0.10.13
Bumps [figment](https://github.com/SergioBenitez/Figment) from 0.10.12 to 0.10.13.
- [Commits](https://github.com/SergioBenitez/Figment/commits)

---
updated-dependencies:
- dependency-name: figment
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-02 19:21:23 -05:00
dependabot[bot] 796dea43cb Bump serde_json from 1.0.108 to 1.0.109
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.108 to 1.0.109.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.108...v1.0.109)

---
updated-dependencies:
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-02 19:21:15 -05:00
dependabot[bot] 712da2b354 Bump clap from 4.4.11 to 4.4.12
Bumps [clap](https://github.com/clap-rs/clap) from 4.4.11 to 4.4.12.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/v4.4.11...v4.4.12)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-29 19:18:17 -05:00
dependabot[bot] e38c595a6d Bump tokio from 1.34.0 to 1.35.1
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.34.0 to 1.35.1.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.34.0...tokio-1.35.1)

---
updated-dependencies:
- dependency-name: tokio
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-27 13:20:33 -05:00
dependabot[bot] 14a880257e Bump thiserror from 1.0.51 to 1.0.52
Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.51 to 1.0.52.
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.51...1.0.52)

---
updated-dependencies:
- dependency-name: thiserror
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-26 18:11:29 -05:00
dependabot[bot] 56282414fe Bump serde_yaml from 0.9.27 to 0.9.29
Bumps [serde_yaml](https://github.com/dtolnay/serde-yaml) from 0.9.27 to 0.9.29.
- [Release notes](https://github.com/dtolnay/serde-yaml/releases)
- [Commits](https://github.com/dtolnay/serde-yaml/compare/0.9.27...0.9.29)

---
updated-dependencies:
- dependency-name: serde_yaml
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-26 17:53:56 -05:00
dependabot[bot] 06685874b7 Bump reqwest from 0.11.22 to 0.11.23
Bumps [reqwest](https://github.com/seanmonstar/reqwest) from 0.11.22 to 0.11.23.
- [Release notes](https://github.com/seanmonstar/reqwest/releases)
- [Changelog](https://github.com/seanmonstar/reqwest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/seanmonstar/reqwest/compare/v0.11.22...v0.11.23)

---
updated-dependencies:
- dependency-name: reqwest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-26 17:53:49 -05:00
strawberry 06e0360142 change welcome message
Signed-off-by: strawberry <strawberry@puppygock.gay>
2023-12-25 17:07:24 -05:00
strawberry 91c7c15bb3 log where we are listening at/on
Signed-off-by: strawberry <strawberry@puppygock.gay>
2023-12-25 17:07:24 -05:00
strawberry 7e447765fe remove warning in error message, drop 2nd error down to warn
Signed-off-by: strawberry <strawberry@puppygock.gay>
2023-12-25 17:07:24 -05:00
strawberry 09d0c13d6f remove unused config global function
Signed-off-by: strawberry <strawberry@puppygock.gay>
2023-12-25 17:07:24 -05:00
strawberry d4c360c135 replace run_server() unwrap just to be safe
Signed-off-by: strawberry <strawberry@puppygock.gay>
2023-12-25 17:07:24 -05:00
strawberry 757ba60ff9 add comment about the blocking await above this config check
comment saying this would have been nice. moved the config checks above
that blocking call.

Signed-off-by: strawberry <strawberry@puppygock.gay>
2023-12-25 17:07:24 -05:00
strawberry 071f9959a6 remove false_fn as just default alone always evaluates to false
ideally we could just do true/false but it is almost 2024 and this is
not possible in serde.

Signed-off-by: strawberry <strawberry@puppygock.gay>
2023-12-25 17:07:24 -05:00
strawberry d214371423 add option for explicit opt-in allow open registration and make it clear
Signed-off-by: strawberry <strawberry@puppygock.gay>
2023-12-25 17:07:24 -05:00
strawberry 5e641e2886 move default rocksdb logging from info to warn
info is still logging useless database statistics and metrics that will
accumulate, less I/O activity.

Signed-off-by: strawberry <strawberry@puppygock.gay>
2023-12-25 17:07:24 -05:00
dependabot[bot] b7cfca5e7b Bump futures-util from 0.3.29 to 0.3.30
Bumps [futures-util](https://github.com/rust-lang/futures-rs) from 0.3.29 to 0.3.30.
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.29...0.3.30)

---
updated-dependencies:
- dependency-name: futures-util
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-25 16:02:19 -05:00
dependabot[bot] f1d978f139 Bump tracing from 0.1.37 to 0.1.40
Bumps [tracing](https://github.com/tokio-rs/tracing) from 0.1.37 to 0.1.40.
- [Release notes](https://github.com/tokio-rs/tracing/releases)
- [Commits](https://github.com/tokio-rs/tracing/compare/tracing-0.1.37...tracing-0.1.40)

---
updated-dependencies:
- dependency-name: tracing
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-25 16:02:12 -05:00
dependabot[bot] 49a92f08d6 Bump crossbeam from 0.8.2 to 0.8.3
Bumps [crossbeam](https://github.com/crossbeam-rs/crossbeam) from 0.8.2 to 0.8.3.
- [Release notes](https://github.com/crossbeam-rs/crossbeam/releases)
- [Changelog](https://github.com/crossbeam-rs/crossbeam/blob/master/CHANGELOG.md)
- [Commits](https://github.com/crossbeam-rs/crossbeam/compare/crossbeam-0.8.2...crossbeam-0.8.3)

---
updated-dependencies:
- dependency-name: crossbeam
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-25 15:46:09 -05:00
dependabot[bot] cb23dba67d Bump persy from 1.4.4 to 1.4.7
Bumps [persy](https://gitlab.com/tglman/persy) from 1.4.4 to 1.4.7.
- [Changelog](https://gitlab.com/tglman/persy/blob/master/release-checklist.md)
- [Commits](https://gitlab.com/tglman/persy/compare/1.4.4...1.4.7)

---
updated-dependencies:
- dependency-name: persy
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-25 15:45:59 -05:00
strawberry 14fc20e31e cargo fmt
Signed-off-by: strawberry <strawberry@puppygock.gay>
2023-12-25 11:09:19 -05:00
Val Lorentz 89c3679e9a Add missing pub key in send_join handling 2023-12-25 11:09:19 -05:00
Val Lorentz 33cae7eaab Explicitly match RoomVersionId::V11 2023-12-25 11:09:19 -05:00
Val Lorentz f3045be622 Reuse existing get_room_version 2023-12-25 11:09:19 -05:00
Nineko fdc3e07be6 feat: replaced flaky argon2 with better argon2 crate (#37)
* feat: replaced flaky argon2 with better argon2 crate

* fix: applied cargo fmt nightly

* docs: added comment specifying what the settings for Argon2 mean

* fix: made hashing error a bit more descriptive

* fix: fixed incorrect value for Kib
2023-12-25 10:28:56 -05:00
Charles Hall 6a9f8dfa6f add shebang to .envrc
All this really does is make syntax highlighting and shellcheck work by
default in more editors.
2023-12-24 01:56:56 -05:00
Charles Hall 629efaa910 use constructor to avoid deprecation warnings 2023-12-24 01:05:13 -05:00
Charles Hall 827af38cc9 comment out heed backend; code doesn't compile 2023-12-24 01:05:13 -05:00
strawberry 5bb6128149 remove wrong else logic
Signed-off-by: strawberry <strawberry@puppygock.gay>
2023-12-23 11:49:14 -05:00
strawberry dd8a6ede09 dont allow guest registration if registration disabled with token configured
Signed-off-by: strawberry <strawberry@puppygock.gay>
2023-12-23 11:49:14 -05:00
strawberry 6664259e64 forbid guest users from registering if no real admin user exists
Signed-off-by: strawberry <strawberry@puppygock.gay>
2023-12-23 11:49:14 -05:00
strawberry 01a8f6323d log next steps if a guest account registered and attempted to get admin
this might be an unreachable state with the next commit, but let's be
extra sure here just in case a guest still managed to register before
a real admin was created.

Signed-off-by: strawberry <strawberry@puppygock.gay>
2023-12-23 11:49:14 -05:00
strawberry c026ef77fb document allow_guest_registration in conduit-example.toml
Signed-off-by: strawberry <strawberry@puppygock.gay>
2023-12-23 11:49:14 -05:00
strawberry dc73df763a don't grant guest users admin, slight user + guest logging improvements
Signed-off-by: strawberry <strawberry@puppygock.gay>
2023-12-23 11:49:14 -05:00
strawberry b0fdc1351b add config option for guest registration, make guest registration respect allow_registration
Signed-off-by: strawberry <strawberry@puppygock.gay>
2023-12-23 11:49:14 -05:00
dependabot[bot] f20beae8dc Bump nix from 0.26.4 to 0.27.1
Bumps [nix](https://github.com/nix-rust/nix) from 0.26.4 to 0.27.1.
- [Changelog](https://github.com/nix-rust/nix/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nix-rust/nix/compare/v0.26.4...v0.27.1)

---
updated-dependencies:
- dependency-name: nix
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-22 18:56:36 -05:00
dependabot[bot] 09f68f9f78 Bump serde_html_form from 0.2.2 to 0.2.3
Bumps [serde_html_form](https://github.com/jplatte/serde_html_form) from 0.2.2 to 0.2.3.
- [Changelog](https://github.com/jplatte/serde_html_form/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jplatte/serde_html_form/compare/v0.2.2...v0.2.3)

---
updated-dependencies:
- dependency-name: serde_html_form
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-22 18:39:35 -05:00
dependabot[bot] ba40582412 Bump ring from 0.17.5 to 0.17.7
Bumps [ring](https://github.com/briansmith/ring) from 0.17.5 to 0.17.7.
- [Commits](https://github.com/briansmith/ring/commits)

---
updated-dependencies:
- dependency-name: ring
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-22 18:32:38 -05:00
dependabot[bot] d502357a0f Bump tracing-subscriber from 0.3.17 to 0.3.18
Bumps [tracing-subscriber](https://github.com/tokio-rs/tracing) from 0.3.17 to 0.3.18.
- [Release notes](https://github.com/tokio-rs/tracing/releases)
- [Commits](https://github.com/tokio-rs/tracing/compare/tracing-subscriber-0.3.17...tracing-subscriber-0.3.18)

---
updated-dependencies:
- dependency-name: tracing-subscriber
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-22 18:32:28 -05:00
Charles Hall d76ea86909 update opentelemetry things
Upstream's changelogs are unhelpful :/
2023-12-22 18:24:03 -05:00
strawberry a3336902a0 bump rust-rockdb to latest git for 8.9.1
Co-authored-by: Charles Hall <charles@computer.surgery>
Signed-off-by: strawberry <strawberry@puppygock.gay>
2023-12-21 22:47:28 -05:00
dependabot[bot] b977d94261 Bump thiserror from 1.0.48 to 1.0.51
Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.48 to 1.0.51.
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.48...1.0.51)

---
updated-dependencies:
- dependency-name: thiserror
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-21 19:17:27 -05:00
dependabot[bot] 65c9b1721f Bump jsonwebtoken from 9.1.0 to 9.2.0
Bumps [jsonwebtoken](https://github.com/Keats/jsonwebtoken) from 9.1.0 to 9.2.0.
- [Changelog](https://github.com/Keats/jsonwebtoken/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Keats/jsonwebtoken/compare/v9.1.0...v9.2.0)

---
updated-dependencies:
- dependency-name: jsonwebtoken
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-21 19:17:06 -05:00
strawberry b239de551d remove deprecated recommended vscode extension
Signed-off-by: strawberry <strawberry@puppygock.gay>
2023-12-20 23:03:18 -05:00
dependabot[bot] b49e43d8bb Bump clap from 4.4.8 to 4.4.11
Bumps [clap](https://github.com/clap-rs/clap) from 4.4.8 to 4.4.11.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/v4.4.8...v4.4.11)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-20 22:37:04 -05:00
dependabot[bot] f5d2df5483 Bump async-trait from 0.1.74 to 0.1.75
Bumps [async-trait](https://github.com/dtolnay/async-trait) from 0.1.74 to 0.1.75.
- [Release notes](https://github.com/dtolnay/async-trait/releases)
- [Commits](https://github.com/dtolnay/async-trait/compare/0.1.74...0.1.75)

---
updated-dependencies:
- dependency-name: async-trait
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-20 22:32:46 -05:00
renovate[bot] 4db66496a8 chore: Configure Renovate (#15)
* Add renovate.json

* remove default preset, add nix, allow non-office hours

Signed-off-by: strawberry <strawberry@puppygock.gay>

* enable lockfile maintenance

Signed-off-by: strawberry <strawberry@puppygock.gay>

* will this make nix work

Signed-off-by: strawberry <strawberry@puppygock.gay>

---------

Signed-off-by: strawberry <strawberry@puppygock.gay>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: strawberry <strawberry@puppygock.gay>
2023-12-20 22:26:36 -05:00
Jakub Kubík cc4e6e213f fix(sync): correctly update presence properties 2023-12-20 21:50:18 -05:00
Jakub Kubík 69025d30f7 style(presence): use flat_map instead of matching Results in filter 2023-12-20 21:50:13 -05:00
strawberry e93b4aa08e fix typo
Signed-off-by: strawberry <strawberry@puppygock.gay>
2023-12-20 21:46:54 -05:00
dependabot[bot] a4afe2111b Bump actions/checkout from 3 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-20 21:46:54 -05:00
strawberry 0927754d37 add dependabot
Signed-off-by: strawberry <strawberry@puppygock.gay>
2023-12-20 21:46:54 -05:00
strawberry b3252dd1d4 remove old gitlab stuff and issue templates
not really important enough for us to have these right now

Signed-off-by: strawberry <strawberry@puppygock.gay>
2023-12-20 21:46:54 -05:00
Charles Hall 216d83ea1d run engage in github actions 2023-12-20 21:46:54 -05:00
Charles Hall 6910a68699 use engage for ci 2023-12-20 21:46:54 -05:00
Charles Hall 311c7d83ca fix rustdoc warnings
Also removed all instances of `#[command(verbatim_doc_comment)]` because
I'm pretty sure it's not necessary anymore. The `[commandbody]` things
were making rustdoc upset about broken link syntax. I also normalized
"code-block" to "code block" in that file since the latter appears more
often.
2023-12-20 21:46:54 -05:00
Charles Hall f54dd1c0fb improve the nix flake
It's pretty much the same as it was before but now it's more better.
2023-12-20 21:46:54 -05:00
nat 118a061ac9 nix: bump inputs and update rocksdb
otherwise bindings are too new and it doesn't build
2023-12-06 22:30:08 +01:00
strawberry 8454773275 log rejected sendjoin, remove unnecessary clone
Signed-off-by: strawberry <strawberry@puppygock.gay>
2023-12-03 20:20:25 -05:00
strawberry 0ed891b3a1 bump version
Signed-off-by: strawberry <strawberry@puppygock.gay>
2023-12-03 01:16:08 -05:00
strawberry d9d1ce3cb5 fix refering uninit static, use upstream rocksdb again, don't compile debug info
even rust-analyzer themselves don't compile with debug info because it
makes cargo checks and builds in general a lot longer. helps speed
things up and we mainly care about panics/stacktraces and compiler
errors.

https://github.com/rust-lang/rust-analyzer/blob/master/Cargo.toml#L12-L15

upstream rust-rocksdb is active again finally

Signed-off-by: strawberry <strawberry@puppygock.gay>
2023-12-03 01:00:23 -05:00
strawberry 4d52dd2f44 use puppy check for updates endpoint
Signed-off-by: strawberry <strawberry@puppygock.gay>
2023-12-02 21:45:09 -05:00
strawberry f62f641545 add rocksdb configurable options and tweaks, logging improvements, exp. room v11 support
split out the spinning disk focused options into a configurable option, current
conduwuit users are NVMe/SSDs anyways so those options are just hindering performance.

rocksdb logging builds up overtime with no cleanup or anything, adds support for
configuring the amount of logging, size of files, log rotate, etc.
fixes https://gitlab.com/girlbossceo/conduwuit/-/issues/1

misc conduit logging improvements for help debugging issues and maybe a future feature

experimental Room V11 support from https://gitlab.com/famedly/conduit/-/merge_requests/562

Signed-off-by: strawberry <strawberry@puppygock.gay>
2023-12-02 21:30:06 -05:00
strawberry 56e4166ee8 never let clippy fail, use CARGO_PKG_NAME, allow issues on gh, simplify regex a tad
Signed-off-by: strawberry <strawberry@puppygock.gay>
2023-11-29 23:19:53 -05:00
strawberry 1a3051eb4a remove nightly only feature, small housekeeping stuff
Signed-off-by: strawberry <strawberry@puppygock.gay>
2023-11-29 21:59:18 -05:00
strawberry 150364b07d rename to conduwuit and use proper version number
Signed-off-by: strawberry <june@girlboss.ceo>
2023-11-29 21:37:12 -05:00
strawberry 87d6a17f0a fix all the warnings!!!! (0 clippy and rustc warnings now)
too many changes to list, codebase significantly better than it was a few weeks ago though

Signed-off-by: strawberry <june@girlboss.ceo>
2023-11-29 21:36:02 -05:00
strawberry 20b686cac5 add some ruma features, fix futures warning
Signed-off-by: strawberry <june@girlboss.ceo>
2023-11-27 21:34:45 -05:00
strawberry b06ed1b92f remove # from internal room ID list
internal room IDs do not have #, they start with !

Signed-off-by: strawberry <june@girlboss.ceo>
2023-11-27 01:35:30 -05:00
strawberry e2ec2a98ba make rooms alias list command more nicer
room IDs in conduit have a server name attached to them already
outputting the server name again just makes it look incorrect

also add codeblock to the internal room ID portion

Signed-off-by: strawberry <june@girlboss.ceo>
2023-11-27 01:25:20 -05:00
strawberry 54a3f47851 fix every clippy warning possible, remove io_uring as default feature
this project's codebase is so horrendous, im shocked that no one has ran
clippy at all. it had ~200 total lint warnings, some with performance
issues and unsoundness, and the rest just very ugly codebase. i have sat
down and fixed as many of these as possible and i am exhausted.
i haven't fixed some extremely complex ones, but i brought it down from
~200 to ~30.

i have also removed io_uring as a default feature due to it falling
under the same category as linux eBPF: major kernel attack surface for
minimal performance gains. this also makes it impossible to cross-compile
from macOS to Linux because io_uring does not exist in Darwin land.
there are far better ways to achieve better performance than io_uring on
the codebase level.

Signed-off-by: strawberry <june@girlboss.ceo>
2023-11-27 00:50:55 -05:00
tezlm 19d1b484e0 split out room info into its own function 2023-11-26 22:16:38 -05:00
tezlm c2b103514b Make commands plural 2023-11-26 22:16:38 -05:00
tezlm 5fc5076517 Room directory admin commands 2023-11-26 22:16:32 -05:00
tezlm b30884c7ac reply to messages 2023-11-26 22:14:59 -05:00
tezlm ebb94341c8 Admin room alias commands
- room alias set
- room alias remove
- room alias which
- room alias list
2023-11-26 22:14:59 -05:00
tezlm 6fdeec1108 Add appservice show command to show config 2023-11-26 22:14:59 -05:00
tezlm 562eaa1dea Allow using languages in code blocks.
```yaml
This works now
```
2023-11-26 22:14:59 -05:00
tezlm 3e9c564209 Rework admin commands to use subcommands.
This commit doesn't add, remove, or change any
commands, it only organizes them
2023-11-26 22:14:59 -05:00
strawberry 5106203d67 drop iouring, add 2 info logs, silence clippy warning
iouring falls into the same category as eBPF and is a major source of kernel vulnerabilities. the benefits gained here are too minimal to bother keeping this enabled, and makes cross-compiling from macOS impossible

Signed-off-by: strawberry <june@girlboss.ceo>
2023-11-26 22:14:59 -05:00
strawberry dd544fad29 use cache_capacity_modifier for spaces/hierarchy cache
Signed-off-by: strawberry <strawberry@pupbrain.dev>
2023-11-26 22:14:59 -05:00
strawberry 2dc1c1fdcb fix clippy performance and sus warnings, remove 1 unwrap, forgot to increment db version
Signed-off-by: strawberry <strawberry@pupbrain.dev>
2023-11-26 22:14:43 -05:00
strawberry b4e2f7ca37 log error for invalid room member events in db
Signed-off-by: strawberry <strawberry@pupbrain.dev>
2023-11-25 20:42:38 -05:00
AndSDev d13e3827ce feat: send push notification on invite to invited user and etc 2023-11-25 20:28:25 -05:00
strawberry 6958c720d0 make pdu stuff async, remove unnecessary db version check
Signed-off-by: strawberry <strawberry@pupbrain.dev>
2023-11-25 18:29:38 -05:00
strawberry 4d7b5eb759 add version argument, move import to test body
Signed-off-by: strawberry <strawberry@pupbrain.dev>
2023-11-25 15:53:33 -05:00
strawberry 8fffb6ea04 fix compilation with no zstd, use correct key, bump 2 deps
Signed-off-by: strawberry <strawberry@pupbrain.dev>
2023-11-25 15:46:03 -05:00
strawberry 0c4604b482 bump ruma, add wrong room keys error code, tiny logging change
can't update ruma to very latest commit because of the weird JsOption thing for syncv4 that i can't wrap my head around how to use, not important anyways

Signed-off-by: strawberry <strawberry@pupbrain.dev>
2023-11-25 12:42:05 -05:00
strawberry e9cd8caaed add feature flagged support for migrating from base64 file name keys to sha256 ones
core implementation and tests from https://gitlab.com/famedly/conduit/-/merge_requests/467
feature flag, base64 encode update, and tweaks were me

Signed-off-by: strawberry <strawberry@pupbrain.dev>
2023-11-25 11:38:28 -05:00
Val Lorentz d092820699 Fetch server keys concurrently
This speeds up handling of /_matrix/federation/v1/send/:transaction_id
when more than one event contains unknown keys.

In particular, when receiving multiple PDUs with dead servers in their
auth chain, timeouts of each server accumulate and can make handling of
incoming requests take several minutes, to the point the client closes
the connection (eg. matrix.org has a 2 minute timeout), causing new
events to be dropped eventually.
2023-11-25 11:38:28 -05:00
strawberry 87d1040386 bump various deps (except for the HTTP libs currently), use my
rust-rocksdb fork, add optional opt-in zstd response body compression
config, add webp support for images

cant upgrade things like axum, http, tower, hyper, etc due to the 1.0
release of http which are breaking all of these libs

Signed-off-by: strawberry <strawberry@pupbrain.dev>
2023-11-25 11:36:55 -05:00
girlbossceo 3533645959 bump rust-argon2
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-11-10 20:50:36 -05:00
girlbossceo 65b682c841 bump rocksdb
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-11-10 20:47:09 -05:00
girlbossceo af1f7404f1 add notification_push_path global
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-10-28 23:43:41 -04:00
girlbossceo 16c3a38761 remove another unnecessary unwrap/expect
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-10-28 23:43:08 -04:00
girlbossceo 6931f4b778 reduce more unnecessary logging and improve a tad
dead servers in rooms are not relevant to log, keep it as info/debug

Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-10-28 23:40:44 -04:00
girlbossceo 64084fb2d0 use a proper function for this instead of checking 200
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-10-28 22:36:47 -04:00
girlbossceo 9bb1dca5f1 mark unused variables as unusued
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-10-28 22:34:50 -04:00
girlbossceo 03af588efb don't unwrap reqwest requests for appservice and pushers too
this is another denial of service vector, but less severe than the federation one.

Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-10-28 22:34:09 -04:00
girlbossceo 8b95399387 add support for modifying the default notification pusher path
this is not officially in spec yet, but who cares? matrix team certainly doesn't care.

Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-10-28 22:31:11 -04:00
girlbossceo b8acacfb3e use light owasp defs instead of argon2 defs
the ones now used by default in rust-argon2 are extremely aggressive and
resource intensive. owasp's 2nd default is very reasonable with the same
security.

Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-10-28 22:15:36 -04:00
tezlm 23ec725923 remove unnecessary config overwrite
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-10-28 22:14:21 -04:00
girlbossceo 95187419f9 do not expect/unwrap requests
causes tokio runtime worker to panic as we attempt to convert an HTTP
Request from ruma (try_into_http_request) into a reqwest Request so the
reqwest http client on the server can execute said request. error
message is not ideal ("invalid port number") but core issue is fixed.

Co-authored-by: infamous <ehuff007@gmail.com>
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-10-28 09:05:23 -04:00
girlbossceo 8b28225af9 add lz4 to rocksdb features
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-10-23 22:22:42 -04:00
Rohan Kumar d08beada62 Stop using default features for rocksdb
We only need zstd and snappy
2023-10-21 21:18:45 -07:00
Jakub Kubík 58a83f06b1 feat(presence): add granular allow configuration 2023-10-21 22:31:16 -04:00
Jakub Kubík ba03edfae9 feat(presence): implement presence functionality 2023-10-21 22:31:06 -04:00
girlbossceo 22eff2d29c clean up few unnecessary warnings
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-10-21 16:15:42 -04:00
girlbossceo 05c08c8529 fix device name federation control
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-10-21 12:19:21 -04:00
girlbossceo 6e46f56929 error log thing
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-10-21 12:18:59 -04:00
girlbossceo a3d219e401 tweak rocksdb, use direct io
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-10-21 12:18:41 -04:00
girlbossceo c223f8284c bump deps, update rocksdb
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-10-21 12:18:07 -04:00
girlbossceo e486c35faa don't skip tracing for event_handler
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-09-24 13:01:54 -04:00
girlbossceo f72fd67a71 remove dbg's, update rocksdb, use iouring
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-09-24 10:17:26 -04:00
girlbossceo 0390d19b56 log state res error
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-09-24 10:17:06 -04:00
girlbossceo 28b63e913f unix sockets
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-09-13 21:49:53 -04:00
girlbossceo fda30f5602 fix: add destination field authorization handler (not my commit)
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-09-13 21:47:37 -04:00
girlbossceo ebd2ec45b1 fix: Do not allow fetching cached remote users' profiles over federation (nyaaori)
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-09-13 21:47:37 -04:00
girlbossceo 1b75d384d7 option to control federating device display names
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-09-13 21:47:35 -04:00
girlbossceo 81e8df3102 options to control public room directory visibility
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-09-13 21:46:43 -04:00
girlbossceo 76c00283de woof woof
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-09-13 21:46:41 -04:00
June 84338cc827 aggressive optimisations
Signed-off-by: June <june@girlboss.ceo>
2023-09-13 21:46:06 -04:00
June 100cae49b6 add my Cross config
Signed-off-by: June <june@girlboss.ceo>
2023-09-13 21:46:06 -04:00
Tobias Bucher 9c3b3daafc Use upstream reqwest instead of vendored one
This uses the `ClientBuilder::dns_resolver` function that was added in
reqwest 0.11.13, instead of the homebrew `ClientBuilder::resolve_fn`.
2023-09-13 21:46:06 -04:00
girlbossceo 42efc9deaf Implement UNIX sockets
Initial implementation done in https://gitlab.com/famedly/conduit/-/merge_requests/507,
*substantially* reworked, corrected, improved by infamous <ehuff007@gmail.com>,
and few parts done by me.

Co-authored-by: infamous <ehuff007@gmail.com>
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-09-13 20:49:02 -04:00
girlbossceo 81e68434d8 update few deps
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-09-13 20:39:03 -04:00
girlbossceo 618036dc31 support querying _matrix-fed and _matrix
_matrix-fed is the new IANA registered SRV record service name
per MSC4040. _matrix is now considered deprecated in Matrix 1.8.
see 3.3 and 3.4 of https://spec.matrix.org/v1.8/server-server-api/#resolving-server-names

Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-09-13 20:36:03 -04:00
girlbossceo 6695b8d8b6 mark room versions 1 and 2 as unstable
even though these rooms would be quite broken as they typically would be
super super old rooms, people seem to still complain about conduit not
"supporting" room versions 1 and 2. to make them happy, just make them
as unstable so they can at least join it.

Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-09-13 20:36:03 -04:00
girlbossceo 87c527ad79 remove unused trace
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-09-13 20:36:03 -04:00
girlbossceo 6e672a3592 mark room version 11 as unstable
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-09-13 20:36:03 -04:00
girlbossceo 40908b24e7 set default room version to 10
this has been the new default since Matrix 1.6, and V10 has been flagged
as stable for a while in Conduit

Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-09-13 20:36:03 -04:00
Timo Kösters 3bfdae795d Merge branch 'sliding' into 'next'
Sliding sync improvements and redaction fixes

See merge request famedly/conduit!549
2023-09-13 18:57:57 +00:00
Timo Kösters 75c80df271 Sliding sync improvements and redaction fixes 2023-09-13 20:54:53 +02:00
Timo Kösters 094cb888d4 Merge branch 'badacl' into 'next'
fix: ACL error shouldn't break the whole request

See merge request famedly/conduit!542
2023-09-13 18:46:03 +00:00
Timo Kösters fa725a14e2 Merge branch 'lukehmcc-next-patch-37096' into 'next'
Update README.md to fix typo & fix compatibility with new versions of docker compose

See merge request famedly/conduit!545
2023-09-11 18:34:06 +00:00
Luke McCarthy 9b3664aeeb Update README.md to fix typo & fix compatibility with new versions of docker compose 2023-08-27 02:14:03 +00:00
Jonas Zohren 90fea00dc7 Merge branch 'docs-docker-coturn' into 'next'
Docs: coturn instructions for docker

See merge request famedly/conduit!498
2023-08-23 14:18:42 +00:00
Jonas Zohren 20924a44f1 Suggestion on how to generate a secure key 2023-08-23 11:17:47 +02:00
purplemeteorite 38d6426b0e coturn setup instructions for docker 2023-08-23 11:09:21 +02:00
Timo Kösters 9b55ce933a Back off from more events, don't retry auth events 2023-08-12 09:53:32 +02:00
Timo Kösters f73a657a23 fix: ACL error shouldn't break the whole request 2023-08-11 20:29:22 +02:00
Timo Kösters 6dfb262ddf Merge branch 'patch-3' into 'next'
log handling previous event time as debug

See merge request famedly/conduit!540
2023-08-11 09:27:42 +00:00
Timo Kösters 75cdc3a1f6 Merge branch 'roomversionwarnings' into 'next'
Do not show "Invalid room version" errors when server is not in room

See merge request famedly/conduit!541
2023-08-11 09:27:23 +00:00
Timo Kösters 11103a92ed Do not show "Invalid room version" errors when server is not in room 2023-08-11 10:48:48 +02:00
girlbossceo ce2017a10e log handling previous event time as debug
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-08-10 23:12:37 +00:00
Timo Kösters 0c2cfda3ae Merge branch 'next' into 'master'
Merge remote-tracking branch 'origin/next'

See merge request famedly/conduit!538
2023-08-10 17:01:56 +00:00
Timo Kösters 4bf8ee1f74 Merge branch 'nextversion' into 'next'
Bump version to v0.6.0

See merge request famedly/conduit!537
2023-08-10 16:58:47 +00:00
Timo Kösters 5d16948030 Bump version to v0.6.0 2023-08-10 18:57:52 +02:00
Timo Kösters b7b2eb9d05 Merge branch 'trust' into 'next'
improvement: matrix.org is default trusted server if unspecified

See merge request famedly/conduit!536
2023-08-10 15:50:16 +00:00
Timo Kösters 19bfee1835 improvement: matrix.org is default trusted server if unspecified 2023-08-10 17:45:58 +02:00
Timo Kösters 9db87550fd Merge branch 'admincommands' into 'next'
improvement: more forgiving admin command syntax

See merge request famedly/conduit!535
2023-08-10 15:36:29 +00:00
Timo Kösters 606b25b9e7 improvement: more forgiving admin command syntax 2023-08-10 17:26:55 +02:00
Timo Kösters fd9e52a559 More sanity checks 2023-08-10 11:45:31 +02:00
Timo Kösters 0a0f227601 Merge branch 'registrationtokens' into 'next'
Registrationtokens

Closes #372

See merge request famedly/conduit!533
2023-08-09 20:27:19 +00:00
Timo Kösters 183558150d fix: don't show removed rooms in space 2023-08-09 22:21:21 +02:00
Timo Kösters c028e0553c feat: registration tokens 2023-08-09 18:27:30 +02:00
Timo Kösters 2581f7a10b Merge branch 'fix-broken-links' into 'next'
Docs: Fix broken links in docker documentation

See merge request famedly/conduit!520
2023-08-09 07:55:49 +00:00
Timo Kösters 3e518773e2 Merge branch 'improvements' into 'next'
cross signing fixes

See merge request famedly/conduit!532
2023-08-07 16:11:11 +00:00
Timo Kösters 888f7e4403 Merge branch 'more-logging-enrichment' into 'next'
Slightly more logging improvements

See merge request famedly/conduit!530
2023-08-07 16:04:12 +00:00
Timo Kösters d82c26f0a9 Avatars for sliding sync DMs 2023-08-07 17:54:08 +02:00
Timo Kösters c1e2ffc0cd improvement: maybe cross signing really works now 2023-08-07 13:55:44 +02:00
June 06fccbc340 debug log before and after nofile soft limit increases
Signed-off-by: June <june@girlboss.ceo>
2023-08-03 14:51:39 -10:00
girlbossceo fbd8090b0b log room ID for invalid room topic event errors
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-08-03 08:54:47 -10:00
Timo Kösters 06ab707c79 Merge branch 'rusqlite-update' into 'next'
bump rusqlite to 0.29.0

See merge request famedly/conduit!529
2023-08-02 05:06:54 +00:00
Timo Kösters 174a580319 Merge branch 'base64-update' into 'next'
update base64 to 0.21.2

See merge request famedly/conduit!528
2023-08-02 05:06:24 +00:00
June fbb256dd91 bump rusqlite to 0.29.0
Signed-off-by: June <june@girlboss.ceo>
2023-08-01 15:09:55 -10:00
June 5a7bade476 update base64 to 0.21.2
Signed-off-by: June <june@girlboss.ceo>
2023-08-01 14:48:50 -10:00
Timo Kösters d2bfcb018e Merge branch 'error-leak-fix' into 'next'
sanitise potentially sensitive errors

See merge request famedly/conduit!523
2023-08-01 11:25:06 +00:00
Timo Kösters 08f0f17ff7 Merge branch 'msteenhagen-next-patch-18830' into 'next'
Removed ambiguity in deploy.md

See merge request famedly/conduit!525
2023-08-01 11:23:47 +00:00
Timo Kösters 57b86f1130 Merge branch 'msteenhagen-next-patch-22350' into 'next'
Correct option error adduser in DEPLOY.md

See merge request famedly/conduit!526
2023-08-01 11:23:28 +00:00
Maarten Steenhagen 3a6eee7019 Correct option error adduser in DEPLOY.md 2023-08-01 11:03:31 +00:00
Maarten Steenhagen 9ce1cad983 Changed 'right' to 'appropriate' to avoid ambiguity (original could be read as right-hand-side) 2023-08-01 10:58:07 +00:00
Timo Kösters 10da9485a5 Merge branch 'threads' into 'next'
fix: threads get updated properly

See merge request famedly/conduit!524
2023-07-31 14:24:11 +00:00
Timo Kösters acfe381dd3 fix: threads get updated properly
Workaround for element web while waiting for https://github.com/matrix-org/matrix-js-sdk/pull/3635
2023-07-31 16:18:23 +02:00
girlbossceo 83805c66e5 sanitise potentially sensitive errors
prevents errors like DB or I/O errors from leaking filesystem paths

Co-authored-by: infamous <ehuff007@gmail.com>
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-07-30 17:30:16 +00:00
Timo Kösters afd8112e25 Merge branch 'spaces' into 'next'
Automatic update checker

See merge request famedly/conduit!522
2023-07-29 19:55:51 +00:00
Timo Kösters b8c164dc60 feat: version checker 2023-07-29 21:53:57 +02:00
Timo Kösters 0453a72890 Merge branch 'patch-1' into 'next'
fix: s/ok_or/ok_or_else in relevant places

See merge request famedly/conduit!521
2023-07-29 19:19:05 +00:00
girlbossceo e2c914cc11 fix: s/ok_or/ok_or_else in relevant places
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-07-29 19:17:12 +00:00
Timo Kösters da907451e7 Admin commands to sign and verify jsons 2023-07-29 20:00:12 +02:00
Timo Kösters 2b4a6c96ee Merge branch 'small-logging-improvements' into 'next'
Slight logging improvements

See merge request famedly/conduit!517
2023-07-29 15:00:42 +00:00
girlbossceo d7061e6984 cargo fmt
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-07-29 14:30:48 +00:00
girlbossceo 3494d7759e Return "Hello from Conduit!" on the / route
akin to Synapes's "It works!" page, removing an unnecessary warning
about / route being unknown

Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-07-29 14:29:26 +00:00
girlbossceo cc5dcceacc Log the room ID, event ID, PDU, and event type where possible
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-07-29 14:29:26 +00:00
girlbossceo 863103450c Log the unknown login type in warning level
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-07-29 14:29:26 +00:00
girlbossceo a0148a9996 Print relevant room ID and ACL'd server in informational level
These are room ACLs, not server ACLs. Causes confusion where people
think their Conduit homeserver was ACL'd. Print where these are coming from
in informational level.

Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-07-29 14:29:26 +00:00
girlbossceo 1f867a2c86 Only print raw malformed JSON body in debug level
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-07-29 14:29:26 +00:00
purplemeteorite c0a2acb869 Merge branch 'next' into 'fix-broken-links'
# Conflicts resolved:
#   docker/README.md
2023-07-29 08:02:56 +00:00
Timo Kösters 97835541ce Merge branch 'uak-next-patch-77212' into 'next'
Change link from docker-compose.override.traefik.yml to docker-compose.override.yml in README.md

See merge request famedly/conduit!514
2023-07-29 07:13:58 +00:00
purplemeteorite 081cc66eda fixed broken traefik links in docker README 2023-07-29 08:26:34 +02:00
purplemeteorite 7489e2c4f6 moved docker-compose.yml into the docker folder 2023-07-29 08:23:17 +02:00
Timo Kösters 1e675dbb68 Merge branch 'next' into 'next'
Docs: OCI image registries and tags

See merge request famedly/conduit!492
2023-07-28 19:34:42 +00:00
Timo Kösters f4c1748ab1 Merge branch 'bugfix/well-known-missing' into 'next'
It's ok not being able to find a .well-known response.

See merge request famedly/conduit!519
2023-07-28 15:45:59 +00:00
Tobias Tom 7990822f72 It's ok not being able to find a .well-known response. 2023-07-28 16:26:40 +01:00
Timo Kösters 2a100412fa Merge branch 'relax-rocksdb' into 'next'
relax recovery mode

See merge request famedly/conduit!516
2023-07-27 06:12:31 +00:00
Timo Kösters 3e7652909b Merge branch 'maximize-fd-limit' into 'next'
maximize fd limit

See merge request famedly/conduit!515
2023-07-27 06:11:05 +00:00
Charles Hall 9fb8498067 relax recovery mode 2023-07-26 15:32:36 -07:00
Charles Hall 291290db92 maximize fd limit 2023-07-26 13:24:44 -07:00
uak 54a115caf3 Change link from docker-compose.override.traefik.yml to docker-compose.override.yml in README.md 2023-07-26 18:53:19 +00:00
Timo Kösters 81866170f0 Merge branch 'spaces' into 'next'
fix: spaces with restricted rooms

See merge request famedly/conduit!513
2023-07-26 06:40:00 +00:00
Timo Kösters bf46829595 fix: spaces with restricted rooms 2023-07-26 08:34:12 +02:00
Timo Kösters 9f14ad7125 Merge branch 'sync-up-debian-packaging' into 'next'
Sync up Debian packaging

See merge request famedly/conduit!510
2023-07-24 17:10:45 +00:00
Timo Kösters 90a10c84ef Merge branch 'slidingfixes' into 'next'
Better sliding sync

See merge request famedly/conduit!511
2023-07-24 08:48:27 +00:00
Timo Kösters d220641d64 Sliding sync subscriptions, e2ee, to_device messages 2023-07-24 10:42:52 +02:00
Timo Kösters caddc656fb slightly better sliding sync 2023-07-24 10:42:47 +02:00
Paul van Tilburg b1a591a06c Also create the conduit (system) group
The `chown` command mentioned later in `DEPLOY.md` needs this group to
exist. Also make sure this account cannot be used to login with by
disabling its password and its shell.

This is similar to how the Debian `postinst` script does this.
2023-07-23 12:53:43 +02:00
Paul van Tilburg 3cd3d0e0ff Add section about how to download/install/deploy
This refers to `DEPLOY.md` as to not duplicate the information.
2023-07-23 12:53:36 +02:00
Paul van Tilburg 433dad6ac2 Turn README.Debian into a markdown file
It is common to have a markdown file per deployment subdirectory.
Still install it as `README.Debian` to `/usr/share/doc/matrix-conduit`
as per Debian policy.

Also update the link in the main `README.md` file.
2023-07-23 12:37:38 +02:00
Paul van Tilburg 8cf408e966 Fix up permissions of the database path
Also apply the database creation and ownership change on every
installation and upgrade.
2023-07-23 12:37:38 +02:00
Timo Kösters 1e560529d8 Merge branch 'nix-upkeep' into 'next'
Nix upkeep

See merge request famedly/conduit!505
2023-07-23 09:23:41 +00:00
Timo Kösters ff98444d03 Merge branch 'nogroup' into 'next'
[Security fix] Create dedicated user group

See merge request famedly/conduit!509
2023-07-23 09:22:39 +00:00
x4u 82f31d6b72 Replace nogroup with dedicated user group 2023-07-23 14:21:36 +08:00
Charles Hall 6ae5143ff5 only listen on IPv6 since that's what conduit does 2023-07-21 12:12:37 -07:00
purplemeteorite bd8fec3836 changed registry options
1. Recommended GitLab's own registry over Docker Hub. (Reason: https://gitlab.com/famedly/conduit/-/merge_requests/492#note_1457220261)
2. Added the development image :next to the list of options.
3. Displayed text for Docker Hub now contains "docker.io" as part of the link for easier copy-paste for podman users. Clicking on the link still takes to the website.
2023-07-21 20:33:32 +02:00
Charles Hall 742331e054 Revert "only use musl on x86_64"
This reverts commit 56f0f3dfa4.

This shouldn't be needed anymore since [this][0] reached nixos-unstable.

[0]: https://github.com/NixOS/nixpkgs/pull/242889
2023-07-16 13:48:05 -07:00
Charles Hall abd8e1bf54 nixpkgs' rocksdb is now new enough :)
This reverts commit abd0a014e8.
2023-07-16 13:47:42 -07:00
Charles Hall fa3b1fd9bd update flake.lock
Flake lock file updates:

• Updated input 'crane':
    'github:ipetkov/crane/75f7d715f8088f741be9981405f6444e2d49efdd' (2023-06-13)
  → 'github:ipetkov/crane/8b08e96c9af8c6e3a2b69af5a7fa168750fcf88e' (2023-07-07)
• Updated input 'crane/rust-overlay':
    'github:oxalica/rust-overlay/c535b4f3327910c96dcf21851bbdd074d0760290' (2023-06-03)
  → 'github:oxalica/rust-overlay/f9b92316727af9e6c7fee4a761242f7f46880329' (2023-07-03)
• Updated input 'fenix':
    'github:nix-community/fenix/df0a6e4ec44b4a276acfa5a96d2a83cb2dfdc791' (2023-06-17)
  → 'github:nix-community/fenix/39096fe3f379036ff4a5fa198950b8e79defe939' (2023-07-16)
• Updated input 'fenix/rust-analyzer-src':
    'github:rust-lang/rust-analyzer/a5a71c75e62a0eaa1b42a376f7cf3d348cb5dec6' (2023-06-16)
  → 'github:rust-lang/rust-analyzer/996e054f1eb1dbfc8455ecabff0f6ff22ba7f7c8' (2023-07-15)
• Updated input 'flake-utils':
    'github:numtide/flake-utils/a1720a10a6cfe8234c0e93907ffe81be440f4cef' (2023-05-31)
  → 'github:numtide/flake-utils/919d646de7be200f3bf08cb76ae1f09402b6f9b4' (2023-07-11)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/04af42f3b31dba0ef742d254456dc4c14eedac86' (2023-06-17)
  → 'github:NixOS/nixpkgs/8acef304efe70152463a6399f73e636bcc363813' (2023-07-15)
2023-07-16 13:37:40 -07:00
Timo Kösters e9946f81a0 Merge branch 'e2eefed' into 'next'
fix: e2ee over federation

See merge request famedly/conduit!504
2023-07-16 14:54:44 +00:00
Timo Kösters a9ba067e77 fix: e2ee over federation 2023-07-16 16:50:03 +02:00
Timo Kösters 706148f941 Merge branch 'nhekobug' into 'next'
fix: nheko e2ee verification bug

See merge request famedly/conduit!503
2023-07-15 21:46:12 +00:00
Timo Kösters 24402312c5 fix: could not verify own events 2023-07-15 23:43:25 +02:00
Jonas Zohren 17180a3e08 capitalize names 2023-07-13 16:54:56 +00:00
Timo Kösters 3c6ffd88bf Merge branch 'unbreak-aarch64-nix' into 'next'
only use musl on x86_64

See merge request famedly/conduit!502
2023-07-11 14:11:45 +00:00
Timo Kösters c3966f501c fix: nheko e2ee verification bug 2023-07-10 23:10:27 +02:00
Charles Hall 56f0f3dfa4 only use musl on x86_64
Since that's all I've tested it on. Apparently this caused issues on
aarch64 even though it allegedly shouldn't.
2023-07-10 11:06:19 -07:00
Timo Kösters ad06d475de Merge branch 'sliding' into 'next'
Very basic Element X support and fixes

See merge request famedly/conduit!501
2023-07-10 14:35:35 +00:00
Timo Kösters 0b4e3de9c0 fix: spaces with restricted rooms 2023-07-10 16:28:08 +02:00
Timo Kösters edd4a3733f fix: actually clear memory in the admin commands 2023-07-10 16:27:42 +02:00
Timo Kösters c17187777f fix: never try federation with self 2023-07-10 16:26:36 +02:00
Timo Kösters 78e7b711df fix: better sliding sync 2023-07-10 16:25:33 +02:00
Timo Kösters 4b7d3e24dd bump ruma 2023-07-10 16:24:57 +02:00
Timo Kösters e4f769963f feat: very simple sliding sync implementation 2023-07-06 10:32:25 +02:00
Jonas Zohren eab5dac6e8 Merge branch 'fix-docker-build-image-size' into 'next'
ci: Fix "0 B" image size display

See merge request famedly/conduit!499
2023-07-04 21:18:25 +00:00
Jonas Zohren c4824a6ebc ci: Fix "0 B" image size display
works around gitlab issue https://gitlab.com/gitlab-org/gitlab/-/issues/388865#workaround
2023-07-04 21:13:11 +00:00
Timo Kösters f8a36e7554 Merge branch 'memory' into 'next'
improvement: better memory usage and admin commands to analyze it

See merge request famedly/conduit!497
2023-07-03 17:43:27 +00:00
Timo Kösters a2c3256ced improvement: better memory usage and admin commands to analyze it 2023-07-03 19:41:07 +02:00
Timo Kösters 833c1505f1 Merge branch 'hierarchy' into 'next'
feat: space hierarchies

See merge request famedly/conduit!495
2023-07-03 13:56:47 +00:00
Timo Kösters bac13d08ae fix: cache invalidation 2023-07-02 22:50:50 +02:00
Timo Kösters f0a27dcb00 Merge branch 'next' into 'next'
update example configurations in DEPLOY.md for Apache and Nginx which include...

See merge request famedly/conduit!493
2023-07-02 20:20:31 +00:00
Timo Kösters 9d49d599f3 feat: space hierarchies 2023-07-02 22:12:06 +02:00
Jacob Taylor 2640f67e4b remove comments 2023-07-02 18:00:30 +00:00
Timo Kösters eb8bc1af8d Merge branch 'jplatte/axum06' into 'next'
Upgrade axum to 0.6

See merge request famedly/conduit!494
2023-07-02 07:02:04 +00:00
Jonas Platte 0ded637b4a Upgrade axum to 0.6 2023-06-29 11:20:52 +02:00
Jacob Taylor dc50197a13 update example configurations in DEPLOY.md for Apache and Nginx which include upstream proxy timeouts of 5 minutes to allow for room joins which take a while 2023-06-29 02:42:32 +00:00
purplemeteorite 06a1321e56 easier-to-read docker setup instructions 2023-06-28 18:51:44 +02:00
Timo Kösters 6a6f8e80f1 Merge branch 'joinfix' into 'next'
improvement: randomize server order for alias joins

See merge request famedly/conduit!491
2023-06-28 15:47:36 +00:00
Timo Kösters fd1ccbd3ad improvement: randomize server order for alias joins 2023-06-28 17:44:30 +02:00
Timo Kösters 3a1a72df98 Merge branch 'stateres' into 'next'
Make state resolution more resistant and some sync performance improvements

See merge request famedly/conduit!490
2023-06-28 10:46:32 +00:00
Timo Kösters 84784970b2 Merge branch 'fix/docker-ci-pipeline' into 'next'
ci: Adjust to current docker

See merge request famedly/conduit!488
2023-06-27 18:54:40 +00:00
Timo Kösters d64a56d88b Do soft fail check before doing state res to allow leave events 2023-06-27 18:48:34 +02:00
Timo Kösters be877ef719 Improve sync performance with more caching and wrapping things in Arcs to avoid copies 2023-06-27 13:15:11 +02:00
Timo Kösters 7c6d25dcd1 Do state res even if the event soft fails 2023-06-27 13:13:33 +02:00
Timo Kösters b671238aa0 Merge branch 'rumafix' into 'next'
bump ruma

See merge request famedly/conduit!489
2023-06-26 21:11:20 +00:00
Timo Kösters 91180e011d bump ruma 2023-06-26 23:10:26 +02:00
Jonas Zohren 26b8605fa0 ci: Adjust to current docker 2023-06-26 22:26:33 +02:00
Timo Kösters dbd360ebb9 Merge branch 'unbreak' into 'next'
fix rustc version, nix upkeep

See merge request famedly/conduit!482
2023-06-26 19:12:46 +00:00
Timo Kösters 48e6e0659f Merge branch 'relations' into 'next'
Add relations endpoints, edits and threads work now

See merge request famedly/conduit!487
2023-06-26 19:11:57 +00:00
Timo Kösters 72eb1972c1 Add relations endpoints, edits and threads work now 2023-06-26 12:38:51 +02:00
Timo Kösters 63cbaedb79 Merge branch 'bearerfix' into 'next'
fix: send correct bearer token to appservices

Closes #358

See merge request famedly/conduit!486
2023-06-26 07:16:20 +00:00
Timo Kösters db6def8800 fix: send correct bearer token to appservices 2023-06-26 09:15:52 +02:00
Timo Kösters caa841c434 Merge branch 'contextfix' into 'next'
fix: /context for element android. start and end must be set even with limit=0

See merge request famedly/conduit!485
2023-06-26 06:34:10 +00:00
Timo Kösters 49a0f3a60d fix: /context for element android. start and end must be set even with limit=0 2023-06-26 08:33:31 +02:00
Timo Kösters bac82f43af Merge branch 'compressionoff' into 'next'
Disable compression, see https://en.wikipedia.org/wiki/BREACH

See merge request famedly/conduit!484
2023-06-25 21:46:34 +00:00
Timo Kösters 15cc801840 Disable compression, see https://en.wikipedia.org/wiki/BREACH 2023-06-25 23:43:54 +02:00
Timo Kösters 5f9ca8e458 Merge branch 'threads' into 'next'
feat: WIP relationships and threads

See merge request famedly/conduit!483
2023-06-25 20:59:53 +00:00
Timo Kösters c7e0ea525a feat: WIP relationships and threads 2023-06-25 19:40:33 +02:00
Charles Hall abd0a014e8 nixpkgs' rocksdb is too old :( 2023-06-17 17:04:57 -07:00
Charles Hall 4a7d3c7301 upgrade rust in Cargo.toml/flake.nix
Looks like this should've happened as part of !479.
2023-06-17 17:04:11 -07:00
Charles Hall 15e60818c9 pin nixos-unstable, update flake.lock
`nixos-unstable` is the rolling release channel of NixOS. The default is
the master branch, which doesn't always have a populated binary cache
and so may result in compiling a bunch of stuff unnecessarily.
2023-06-17 17:02:10 -07:00
Timo Kösters def079267d Merge branch 'adjust-to-rust-version-bumps' into 'next'
chore(ci): Adjust to rust version bumps

See merge request famedly/conduit!479
2023-06-10 15:35:22 +00:00
Jonas Zohren a3a9b60abc chore(ci): Adjust to rust version bumps 2023-06-10 15:35:22 +00:00
Timo Kösters 808b12f618 Merge branch 'restricted' into 'next'
fix: restricted room error is now FORBIDDEN

See merge request famedly/conduit!478
2023-06-08 18:52:03 +00:00
Timo Kösters faa9208a3e cargo fmt 2023-06-08 20:51:34 +02:00
Timo Kösters 1ea27c4f97 fix: restricted room error is now FORBIDDEN 2023-06-08 20:49:42 +02:00
Timo Kösters 422ee40107 Merge branch 'mr-conduit-appservice-login' into 'next'
feat: support end to bridge encryption

See merge request famedly/conduit!454
2023-05-26 12:48:23 +00:00
Timo Kösters 0280fa5793 Merge branch 'next' into 'next'
fix nix readme to work with ipv6

See merge request famedly/conduit!475
2023-05-26 12:30:02 +00:00
digital 664d6baace fix: make requested changes 2023-05-26 13:06:28 +02:00
Jade be9196430d fix nix readme to work with ipv6 2023-05-25 18:21:01 +00:00
Jonas Zohren 533bccad8f Merge branch '350-debian-package-from-docker-packager-result-doesn-t-seem-to-install-configuration-files' into 'next'
Fix CI + Debian packaging

Closes #350

See merge request famedly/conduit!474
2023-05-21 20:41:08 +00:00
Jonas Zohren a4261aac76 * Fix Debian builds by actually including the whole debian directory into deb creation
* Fix CI by explicitly setting hostname of docker in docker service
* Fix Docker build by bumping the Rust version to 1.69
* Fix cargo check in CI by bumping the Rust version to 1.69
2023-05-21 20:41:08 +00:00
Timo Kösters c38df57279 Merge branch 'deploymd' into 'next'
Minor DEPLOY.md changes

See merge request famedly/conduit!473
2023-05-21 13:17:29 +00:00
Timo Kösters 4e2bbf9d6a Minor DEPLOY.md changes 2023-05-21 15:16:23 +02:00
Timo Kösters 7a9ec851fc Merge branch 'bump' into 'next'
Bump dependencies

See merge request famedly/conduit!472
2023-05-21 11:45:20 +00:00
Timo Kösters d62cd2ae51 chore: bump dependencies 2023-05-21 13:42:59 +02:00
Timo Kösters 49b5af6d45 chore: bump rocksdb 2023-05-21 13:41:51 +02:00
Timo Kösters 1f1444da8c Merge branch 'pushrules' into 'next'
Improvements to pushrules endpoints

Closes #316

See merge request famedly/conduit!461
2023-05-21 10:41:31 +00:00
Timo Kösters 2a9a908343 Merge branch 'x4u/add-apache-cloudflare-deploy-info' into 'next'
X4u/add apache cloudflare deploy info

See merge request famedly/conduit!471
2023-05-21 07:04:59 +00:00
x4u 921b266d86 X4u/add apache cloudflare deploy info 2023-05-21 07:04:58 +00:00
Timo Kösters dbbd164e39 Merge branch 'admin-command-fix' into 'next'
Recognize admin commands without : after tag

See merge request famedly/conduit!470
2023-05-17 19:09:54 +00:00
Jonathan Flueren f5e3b0e2dd Recognize admin commands without : after tag
Very useful since many Matrix clients don't insert : after user tags
2023-05-15 19:25:57 +00:00
Timo Kösters 1b9e63f426 Merge branch 'unbreak-nix' into 'next'
Fix Nix builds (actually) (for real) (it seriously builds this time)

See merge request famedly/conduit!466
2023-04-05 09:59:09 +00:00
Charles Hall eb4323cc0f use mold on linux 2023-04-04 19:16:07 -07:00
Charles Hall a6712627e4 tiny refactor 2023-04-04 19:15:09 -07:00
Charles Hall 3be32c4dac factor out shared things 2023-04-04 17:52:15 -07:00
Charles Hall 55149e3336 use crane instead of naersk
I guess naersk still doesn't support git dependencies using workspace
inheritance, but crane does.
2023-04-04 17:42:24 -07:00
Charles Hall 2b63e46fc5 use system rocksdb
This mostly just improves build times.
2023-04-04 17:42:13 -07:00
Charles Hall a0c449e570 update flake.lock 2023-04-04 17:09:49 -07:00
Charles Hall c997311bea Revert "build(nix): fix flake builds"
This reverts commit 5d913f7010.

Sorry, I don't understand how any of this works, and it seems pretty
opaque/difficult to fine-tune.
2023-04-04 17:02:34 -07:00
Kévin Commaille 1929ca5d9d Add a database migration to fix and update the default pushrules 2023-03-18 15:03:57 +01:00
Kévin Commaille 88c6bf7595 Always return an error if a push rule is not found 2023-03-18 15:03:57 +01:00
Kévin Commaille 4635644e21 Use the ruma methods for managing rulesets 2023-03-18 15:03:57 +01:00
Kévin Commaille f53ecaa97d Bump Ruma 2023-03-18 15:03:56 +01:00
Timo Kösters f704169aeb Merge branch 'fixjoin' into 'next'
fix: let requests continue event if client disconnects

See merge request famedly/conduit!464
2023-03-18 07:59:36 +00:00
Timo Kösters 2a7c4693b8 fix: don't accept new requests when shutting down 2023-03-18 08:58:20 +01:00
Timo Kösters da3871f39a fix: let requests continue event if client disconnects 2023-03-17 22:45:13 +01:00
Timo Kösters 664ee7d89a Merge branch 'backfill' into 'next'
feat: handle backfill requests

See merge request famedly/conduit!459
2023-03-16 13:32:42 +00:00
Timo Kösters 42b12934e3 Don't crash when a room errors 2023-03-13 10:43:09 +01:00
Timo Kösters 63f787f635 Reduce logs from info to debug 2023-03-13 10:39:19 +01:00
Timo Kösters a1bd348977 fix: history visibility 2023-03-13 10:39:19 +01:00
Timo Kösters 27f29ba699 fix: SRV lookups should end with a period 2023-03-13 10:39:19 +01:00
Timo Kösters cb0ce5b08f Logs for server resolution 2023-03-13 10:39:18 +01:00
Timo Kösters b7c99788e4 All the logs 2023-03-13 10:39:18 +01:00
Timo Kösters 2316d89048 Even more logging 2023-03-13 10:39:18 +01:00
Timo Kösters bde4880c1d fix: don't unwrap server keys 2023-03-13 10:39:18 +01:00
Timo Kösters 8b648d0d3f fix: force abort federation requests after 2 minutes 2023-03-13 10:39:18 +01:00
Timo Kösters 4617ee2b6b More logging for remote joins 2023-03-13 10:39:18 +01:00
Timo Kösters 10fa686c77 feat: respect history visibility 2023-03-13 10:39:18 +01:00
Timo Kösters 2a16a5e967 fix: don't send nulls as unsigned content 2023-03-13 10:39:17 +01:00
Timo Kösters 2aa0a2474b fix: ignore unparsable pdus in /send 2023-03-13 10:39:17 +01:00
Timo Kösters d39003ffc0 Allow backfilling create event itself 2023-03-13 10:39:17 +01:00
Timo Kösters eae0989c40 fix: refactor backfill and add support for search 2023-03-13 10:39:17 +01:00
Timo Kösters 17a6431f5f fix: make backfilled events reachable 2023-03-13 10:39:17 +01:00
Timo Kösters fcfb06ffa6 fix: allow handling create event itself 2023-03-13 10:39:17 +01:00
Timo Kösters 7bdd9660aa feat: ask for backfill 2023-03-13 10:39:17 +01:00
Timo Kösters 23b18d71ee feat: handle backfill requests
Based on https://gitlab.com/famedly/conduit/-/merge_requests/421
2023-03-13 10:39:16 +01:00
Timo Kösters 84cfed5231 Merge branch 'fix-nix-build' into 'next'
Fix Nix flake build

See merge request famedly/conduit!456
2023-02-18 21:18:51 +00:00
Timo Kösters cdcf4a017d Merge branch 'fixreset' into 'next'
fix: allow reactivation of users using reset-password admin command

See merge request famedly/conduit!458
2023-02-11 11:49:54 +00:00
Timo Kösters fc0aff20cf fix: allow reactivation of users using reset-password admin command 2023-02-11 12:43:41 +01:00
Timo Kösters 4223288cdf Merge branch 'fixbadservernameusers' into 'next'
fix: ignore bad user ids in migration

See merge request famedly/conduit!457
2023-02-07 16:19:59 +00:00
Timo Kösters a4f18f99ad fix: ignore bad user ids 2023-02-07 16:29:41 +01:00
Jonas Zohren 06df04f61c Merge branch 'fix_docker_healthcheck_for_address' into 'next'
Add a dynamic address resolution to the Docker healthcheck

See merge request famedly/conduit!434
2023-01-27 22:43:04 +00:00
Moritz Heiber cfcc9086ff Add a dynamic address resolution to the Docker healthcheck 2023-01-27 22:43:04 +00:00
Yusuf Bera Ertan 11b9cfad5e docs: update nix comment for rust-version in Cargo.toml 2023-01-28 00:14:58 +03:00
Yusuf Bera Ertan 5d913f7010 build(nix): fix flake builds 2023-01-28 00:10:21 +03:00
Jonas Zohren d68dad580b Merge branch 'complement-improvements' into 'next'
Complement improvements

See merge request famedly/conduit!404
2023-01-27 16:41:34 +00:00
Jonathan de Jong e13dc7c14a add little readme 2023-01-26 18:28:33 +01:00
Jonathan de Jong b158896396 Merge remote-tracking branch 'origin/next' into complement-improvements 2023-01-26 18:19:39 +01:00
Timo Kösters f95dd4521c Merge branch 'validate-state-of-admins-room' into 'next'
Validate PDU in admins room

See merge request famedly/conduit!382
2023-01-24 13:46:49 +00:00
Timo Kösters 1e77373332 Merge branch 'braid/ci-magic' into 'next'
fix: adjust CI config to runner requirements

See merge request famedly/conduit!455
2023-01-19 07:46:36 +00:00
The one with the braid f01b96588d fix: adjust CI config to runner requirements
- make use of more stable BTRFS driver
- set default pull policy to `if-not-present`

Signed-off-by: The one with the braid <the-one@with-the-braid.cf>
2023-01-19 07:42:23 +01:00
digital 4d589d9788 feat: support end to bridge encryption
by implementing appservice logins
2023-01-18 23:34:18 +01:00
Timo Kösters 815db0d962 Merge branch 'joinfix' into 'next'
Maybe fix room joins

See merge request famedly/conduit!453
2023-01-14 20:22:55 +00:00
Timo Kösters 809c9b4481 Maybe fix room joins
This is a workaround for https://github.com/hyperium/hyper/issues/2312
2023-01-14 21:20:16 +01:00
Timo Kösters c6e3438e76 Merge branch 'trusted-servers-doc' into 'next'
document `trusted_servers` option

See merge request famedly/conduit!451
2023-01-09 16:35:54 +00:00
Charles Hall 844508bc48 document trusted_servers option 2023-01-09 08:14:13 -08:00
Timo Kösters b3aec63d67 Merge branch 'partial-nix-fix' into 'next'
partial nix fix

See merge request famedly/conduit!446
2023-01-09 15:58:40 +00:00
Timo Kösters 2da4ae6b3b Merge branch 'code-of-conduct' into 'next'
Add Contributor's Covenant Code of Conduct

See merge request famedly/conduit!448
2023-01-09 15:37:19 +00:00
Timo Kösters 5e6b498c22 Merge branch 'fix-nix-docs' into 'next'
fix nix docs

See merge request famedly/conduit!449
2023-01-09 15:35:39 +00:00
Charles Hall 391beddaf4 fix nix docs
I made some silly copy paste errors while writing this...
2023-01-08 12:44:59 -08:00
r3g_5z 112b76b1c1 Add Contributor's Covenant Code of Conduct
Signed-off-by: r3g_5z <june@girlboss.ceo>
2023-01-08 02:44:25 -05:00
Charles Hall 315944968b remind people to update the hash
And offer help since it's pretty easy but impossible if you don't have
Nix installed.
2022-12-23 00:30:36 -08:00
Charles Hall 9f74555c88 update flake.lock 2022-12-23 00:29:43 -08:00
Charles Hall 0a4e8e5909 update rust toolchain hash 2022-12-23 00:29:43 -08:00
Timo Kösters 19156c7bbf Update Cargo.lock 2022-12-21 16:16:07 +01:00
Timo Kösters 2a66ad4329 Bump version to 0.6.0-alpha 2022-12-21 16:08:05 +01:00
Timo Kösters 53f14a2c4c Merge remote-tracking branch 'origin/next' 2022-12-21 15:51:47 +01:00
Timo Kösters d20f21ae32 Merge branch 'nextversion' into 'next'
Preparing for v0.5.0 release

See merge request famedly/conduit!443
2022-12-21 13:12:18 +00:00
Timo Kösters f7db3490f6 Bump version to v0.5.0 2022-12-21 14:08:09 +01:00
Timo Kösters c7a7c913d4 Bump ruma 2022-12-21 14:08:08 +01:00
Timo Kösters 76a82339a2 tweak default rocksdb settings 2022-12-21 13:44:23 +01:00
Timo Kösters 94df9cdbba Merge branch 'Nyaaori/prev_events-config-option' into 'next'
Make prev_events fetch limit configurable

See merge request famedly/conduit!422
2022-12-21 11:06:42 +00:00
Timo Kösters b231d7f15c Merge branch 'Nyaaori/membership-events-reason' into 'next'
Implement membership ban/join/leave/invite reason

See merge request famedly/conduit!442
2022-12-21 10:58:05 +00:00
Nyaaori 7cc346bc18 feat: Implement membership ban/join/leave/invite reason support 2022-12-21 11:45:12 +01:00
Timo Kösters 48bc0db723 Merge branch 'Nyaaori/code-cleanup' into 'next'
Code Cleanup

See merge request famedly/conduit!441
2022-12-21 10:00:40 +00:00
Nyaaori 7c196f4e00 feat: Add max prev events config option, allowing adjusting limit for prev_events fetching 2022-12-21 10:55:32 +01:00
Nyaaori c86313d4fa chore: code cleanup
https://rust-lang.github.io/rust-clippy/master/index.html#op_ref

https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string

https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
2022-12-21 10:42:12 +01:00
Timo Kösters 7b98741163 Merge branch 'restrictedjoinlocally' into 'next'
improvement: handle restricted joins locally

See merge request famedly/conduit!439
2022-12-18 08:51:31 +00:00
Timo Kösters 2a04c213f9 improvement: handle restricted joins locally 2022-12-18 09:44:46 +01:00
Timo Kösters d7eaa9c5cc Merge branch 'logging-cleanup' into 'next'
Replace println/dbg calls with corresponding macros from tracing crate

See merge request famedly/conduit!424
2022-12-18 06:57:23 +00:00
Timo Kösters 2a0515f528 Replace println/dbg calls with corresponding macros from tracing crate 2022-12-18 07:52:22 +01:00
Timo Kösters 3930fd08d7 Merge branch 'docs' into 'next'
Update README

See merge request famedly/conduit!438
2022-12-18 06:06:26 +00:00
Timo Kösters 683eefbd0b Update README 2022-12-18 07:02:07 +01:00
Timo Kösters d963ad8cc1 Merge branch 'jaegerfix' into 'next'
fix: jaeger support

See merge request famedly/conduit!437
2022-12-18 05:52:49 +00:00
Timo Kösters 6d5e54a66b fix: jaeger support 2022-12-18 06:37:03 +01:00
Timo Kösters 2b2bfb91c2 Merge branch 'up-ruma' into 'next'
Upgrade Ruma

See merge request famedly/conduit!435
2022-12-18 05:05:33 +00:00
Timo Kösters f1d2574651 finish upgrade ruma 2022-12-17 09:28:08 +01:00
Jonas Platte d39ce1401d WIP: Upgrade Ruma 2022-12-16 11:57:32 +01:00
Jonas Platte 7fd5b22e3b The procMacro option has long been on by default
… and it's good to let people have their own local configs that won't be
tracked by git.
2022-12-16 10:12:11 +01:00
Timo Kösters db7a7085f4 Merge branch 'fix/pushrules_database' into 'next'
Migrate database to use correct rule id in pushrules.

See merge request famedly/conduit!405
2022-12-16 08:38:49 +00:00
Timo Kösters 5894d35eb2 Merge branch 'fixrestrictedjoin' into 'next'
fix: rejoining restricted rooms over federation

See merge request famedly/conduit!431
2022-11-30 21:32:12 +00:00
Timo Kösters b9fd6127e2 fix: rejoining restricted rooms over federation 2022-11-30 22:30:55 +01:00
Jonas Zohren bb9bc0a001 Merge branch 'dockerdoc-nginx-content-type' into 'next'
Describe a better way to enforce Content-Type in nginx

See merge request famedly/conduit!415
2022-11-29 17:56:14 +00:00
Timo Kösters f4dd051a1d Merge branch 'sd-notify' into 'next'
call sd-notify after init and before exit

See merge request famedly/conduit!426
2022-11-28 15:50:12 +00:00
Vladan Popovic 06d3efc4d0 feat(systemd): call sd-notify after init and before exit 2022-11-27 22:17:15 +01:00
Vladan Popovic 66ad114e19 feat: add systemd feature flag 2022-11-27 22:17:15 +01:00
Jonas Zohren 4b737b46ac Merge branch 'cross-compiling' into 'next'
Added cross-compilation instructions

See merge request famedly/conduit!430
2022-11-27 20:15:48 +00:00
Orhideous bcd522e75f Added cross-compilation instructions to DEPLOY.md 2022-11-27 20:15:47 +00:00
Jonas Zohren 249960b111 Merge branch 'fix-lock' into 'next'
Update Cargo.lock

See merge request famedly/conduit!427
2022-11-25 21:44:31 +00:00
Andriy Kushnir (Orhideous) 583aea187b Update Cargo.lock 2022-11-25 23:13:58 +02:00
Timo Kösters 396dac6d82 Merge branch 'fixroomleave' into 'next'
fix: unable to leave room

See merge request famedly/conduit!419
2022-11-21 20:04:27 +00:00
Timo Kösters 9149be31af Merge branch 'logs-cleanup' into 'next'
Clean some noisy logs

See merge request famedly/conduit!423
2022-11-21 20:03:17 +00:00
Timo Kösters 32a4ded4a1 Merge branch 'Nyaaori/reduce-generated-token-length' into 'next'
Reduce length of generated access tokens and session ids

See merge request famedly/conduit!386
2022-11-21 20:02:20 +00:00
Timo Kösters e3dabdf525 Merge branch 'Nyaaori/cleanup' into 'next'
misc. cleanup

See merge request famedly/conduit!420
2022-11-21 19:59:45 +00:00
Nyaaori b59304a4df Reduce length of generated access tokens and session ids
Reduces generated tokens and session ids down to 32 characters (~190 bits of entropy) in length
2022-11-21 20:51:59 +01:00
Nyaaori 66bc41125c refactor: cleanup 2022-11-21 20:50:39 +01:00
Nyaaori 6786c44f4d chore: Fix MSRV
Ruma requires Rust 1.64
2022-11-21 20:50:30 +01:00
Andriy Kushnir (Orhideous) a3a1db124d Clean some noisy logs 2022-11-21 21:48:06 +02:00
Timo Kösters 3b3c451c83 fix: unable to leave room 2022-11-21 19:50:48 +01:00
Timo Kösters cf99316082 Merge branch 'dendritefix' into 'next'
Dendrite invite fix

See merge request famedly/conduit!416
2022-11-09 20:27:22 +00:00
Timo Kösters c063700255 fix: invite dendrite users 2022-11-09 21:14:17 +01:00
Timo Kösters 7540227388 chore: bump dependencies 2022-11-09 18:46:10 +01:00
Ticho 34782694 09015f113c Describe a better way to enforce Content-Type in nginx
add_header will not override the Content-Type header set by the server,
but will instead add another header below, which is obviously not ideal.

The proposed change will instead tell nginx to set the correct value for
this header straight away.
2022-11-08 15:56:24 +00:00
Paul Beziau a2d8aec1e3 Moving the unwraping of a variable
Moving the unwraping of the variable "rule" inside the condition instead of the if body, for the migration of the database from version 11 to 12.
2022-11-03 13:12:53 +00:00
Timo Kösters ccdaaceb33 Merge branch 'ci-revamp-2022-10' into 'next'
Fix CI

See merge request famedly/conduit!414
2022-11-02 16:47:48 +00:00
Jonas Zohren b37876f3b2 fix(ci): Only build in (remote host) docker and switch to glibc 2022-11-02 12:12:48 +01:00
Timo Kösters e8e0a4dcc5 Merge branch 'Nyaaori/fix-trusted-server-panic' into 'next'
Cleanly handle invalid response from trusted server instead of panicking

See merge request famedly/conduit!411
2022-10-31 11:35:55 +00:00
Nyaaori 23cf39c525 Cleanly handle invalid response from trusted server instead of panicking 2022-10-31 12:28:30 +01:00
Nyaaori 00996dd834 Cargo Clippy 2022-10-31 09:31:17 +01:00
Timo Kösters 2a52f666dc Merge branch 'fixtyping' into 'next'
Fix typing indicators and unencrypted messages in encrypted rooms

See merge request famedly/conduit!409
2022-10-30 20:25:45 +00:00
Timo Kösters 0cf6545116 fix: not sending enough state on join 2022-10-30 21:23:43 +01:00
Timo Kösters 5d691f405e fix: stuck typing indicators 2022-10-30 21:22:32 +01:00
Timo Kösters c61914c8e1 Merge branch 'fixhead' into 'next'
fix: HEAD requests should continue to produce METHOD_NOT_ALLOWED

See merge request famedly/conduit!402
2022-10-30 19:45:58 +00:00
Timo Kösters 9548c84d32 Merge branch 'fixnotifcount' into 'next'
fix: element android did not reset notification counts

See merge request famedly/conduit!408
2022-10-30 19:43:39 +00:00
Timo Kösters 02dd3d32f2 fix: element android did not reset notification counts 2022-10-30 20:41:32 +01:00
Timo Kösters 7c98ba64aa fix: HEAD requests should produce METHOD_NOT_ALLOWED 2022-10-30 19:53:05 +01:00
Jonathan de Jong 52018c3967 allow complement dockerfile to copy over target folder 2022-10-28 21:04:05 +02:00
Timo Kösters e86fb11512 Merge branch 'nabulator-next-patch-84388' into 'next'
Update nginx configuration to allow for larger uploads.

See merge request famedly/conduit!407
2022-10-28 13:32:02 +00:00
Timo Kösters 20e3c42456 Merge branch 'add-nix-flake' into 'next'
add nix flake

See merge request famedly/conduit!403
2022-10-28 13:31:21 +00:00
Nabulator 1aff2a54ef comment typo 2022-10-27 04:23:07 +00:00
Nabulator 238ebcfcac Update nginx configuration to allow for larger uploads. 2022-10-27 04:20:56 +00:00
Timo Kösters 876fdf480d Merge branch '3pid_403_next' into 'next'
Return 403 to 3pid token routes to signal not implemented

See merge request famedly/conduit!375
2022-10-25 20:47:41 +00:00
James Blachly 3bc0a1924b Return 403 to 3pid token routes to signal not implemented 2022-10-25 20:47:41 +00:00
Timo Kösters 4af998963b Merge branch 'fix-axum-request-size' into 'next'
fix(main): fix request size limit to max_request_size (axum defaults 2MB)

See merge request famedly/conduit!406
2022-10-25 20:34:33 +00:00
AndSDev 10d2da3009 fix(main): fix request size limit to max_request_size (axum defaults 2MB) 2022-10-25 12:53:58 +03:00
Paul Beziau d47c1a8ba6 Fix database version check & code formating 2022-10-21 12:27:11 +00:00
Paul Beziau 9c0c74f547 Migrate database to use correct rule id in pushrules.
it convert :
- ".m.rules.call" to ".m.rule.call"
- ".m.rules.room_one_to_one" to ".m.rule.room_one_to_one"
- ".m.rules.encrypted_room_one_to_one" to ".m.rule.encrypted_room_one_to_one"
- ".m.rules.message" to ".m.rule.message"
- ".m.rules.encrypted" to ".m.rule.encrypted"

related to issue #264
2022-10-18 09:15:07 +00:00
Jonathan de Jong 215d909e59 More debug info when try_from_http_request fails 2022-10-17 18:41:59 +02:00
Jonathan de Jong ada15ceacc Complement improvements 2022-10-17 18:41:45 +02:00
Charles Hall 716f82db6d add nix/nixos deployment documentation 2022-10-16 10:50:52 -07:00
Charles Hall fe7d8c4f12 add nix flake
Also add `.envrc` for direnv + Nix users. This makes developing locally
easier for us NixOS folks.

The flake itself will allow NixOS users to pull code directly from
Conduit's repository, making it completely trivial to stay up-to-date
with every commit.

I'd also like to add a NixOS module directly to this repository at some
point so that new configuration options will be available in the NixOS
module faster. But for now, NixOS users can simply override
`serivces.matrix-conduit.package` and get pretty much all the
functionality.

I've added myself to the `CODEOWNERS` file for the Nix files, since I am
willing to maintain this stuff. I use Conduit on NixOS so I'm personally
invested in having this work.

Lastly, `.gitignore` was updated to exclude symlinks created by `direnv`
and `nix build` and other such Nix commands.

This doesn't come without maintenance burden, however:

* The `sha256` in `flake.nix` will need to be updated whenever Conduit's
  MSRV is updated, but that should be pretty infrequent.

* `nix flake update` should be run every so often to pull in updates to
  `nixpkgs` and other flake inputs. I think downstream users can also
  override this themselves with `inputs.<name>.inputs.<name>.follows`.

* `nix flake check` should be run in CI to ensure Nix builds keep
  working.

* `nixpkgs-fmt --check $(fd '\.nix')` (or similar) should be run in CI
  to ensure style uniformity.
2022-10-15 19:26:53 -07:00
Timo Kösters cb2b5beea8 Merge branch 'fix_persy' into 'next'
fix: update persy implementation after refactor

See merge request famedly/conduit!396
2022-10-15 12:13:36 +00:00
Timo Kösters 2231a69b4c fix: make previous MR compile 2022-10-15 14:07:27 +02:00
Timo Kösters 13052388a7 Merge branch 'conduit-next' into next 2022-10-15 13:55:39 +02:00
Max Cohen 6fd39ae174 Raise 404 when room doesn't exist
Raise 404 "Room not found" when changing or accessing room visibility
settings (`GET` and `PUT
/_matrix/client/r0/directory/list/room/{roomId}`).
See issue #290
2022-10-15 13:52:58 +02:00
Timo Kösters 2627ca5e3d Merge branch 'update-rust' into 'next'
update rust to avoid a cargo problem

See merge request famedly/conduit!395
2022-10-15 11:50:55 +00:00
Timo Kösters ed5b8d6a46 Merge branch 'Nyaaori/fix-whoami-appservices' into 'next'
Fix is_guest value on whoami for appservice users

Closes #310

See merge request famedly/conduit!401
2022-10-15 11:32:49 +00:00
Nyaaori 2d0fdddd34 Do not return true for is_guest on whoami for appservice users 2022-10-15 13:17:58 +02:00
Timo Kösters 3054af41ba Merge branch 'Nyaaori/bump-default-room-version' into 'next'
Bump default room version to V9

See merge request famedly/conduit!400
2022-10-15 11:02:44 +00:00
Nyaaori 1e1a144dfa Move room version 10 out of experimental/unstable 2022-10-15 12:17:06 +02:00
Nyaaori cc3e1f58cc Bump default room version to V9; per matrix spec recommendation 2022-10-15 12:16:02 +02:00
Timo Kösters b1991c8f4f Merge branch 'Nyaaori/rejoin-fix' into 'next'
Rejoin over federation if we are not participating

See merge request famedly/conduit!399
2022-10-15 09:56:55 +00:00
Timo Kösters 6f7f2820ce Merge branch 'Nyaaori/restricted-join-fix' into 'next'
Fix doing restricted joins into rooms we are not participating in

See merge request famedly/conduit!398
2022-10-15 09:50:25 +00:00
Nyaaori e9697f13d6 Handle initiating restricted joins over federation
Allows Conduit users to join restricted rooms if we are not currently participating
2022-10-15 10:46:50 +02:00
Nyaaori 3b0aa23fdf Rejoin room over federation if we are not participating in it; do not include invited users in participating servers calculation 2022-10-15 10:38:30 +02:00
Timo Kösters aca6218c0a Merge branch 'unrecognizedmethods' into 'next'
fix: send unrecognized error on wrong http methods

See merge request famedly/conduit!397
2022-10-15 08:35:39 +00:00
Timo Kösters 3a45628e1d fix: send unrecognized error on wrong http methods 2022-10-15 00:28:43 +02:00
AndSDev e923f63c49 fix(service/rooms/timeline): fix validating for non-joined members 2022-10-14 14:45:05 +03:00
Tglman 842feabced fix: update persy implementation after refactor 2022-10-13 20:02:36 +01:00
Charles Hall 286936db32 msrv is 1.63 in Cargo.toml; use that 2022-10-13 08:26:46 -07:00
Charles Hall bf7c4b4001 update rust to avoid a cargo problem
We were hitting [this bug][0] when trying to select a version for clap
^4.

[0]: https://github.com/rust-lang/cargo/issues/10623
2022-10-13 08:06:49 -07:00
AndSDev d755a96c2c refactor(service/rooms/timeline): add cache for server_name 2022-10-13 11:19:51 +00:00
Timo Kösters c948324cf2 Merge branch 'fix-admin-help' into 'next'
fix `@conduit help` not working in the admin room

See merge request famedly/conduit!392
2022-10-13 11:15:49 +00:00
AndSDev 76f81ac201 feat(db/rooms): disable banning for last user and conduit user in admins room 2022-10-13 14:15:23 +03:00
Timo Kösters ce188daccb Merge branch 'conduit-lower-default-log-level' into HEAD 2022-10-13 13:13:03 +02:00
exin 98702da4e6 Lower default log level for docker 2022-10-13 13:11:15 +02:00
exin 92f7f0c849 Lower log level commented config options 2022-10-13 13:11:15 +02:00
exin 7451abe3ea Lower default log level for docker and debian 2022-10-13 13:11:14 +02:00
exin 3e6c66b899 Fix formatting 2022-10-13 13:11:14 +02:00
exin 3a40bf8ae0 Add error for invalid log config
Log config falls back to "warn"
2022-10-13 13:11:14 +02:00
exin 9c922db14b Lower default log level
Update config-example.toml to accordingly

Closes #281
2022-10-13 13:11:13 +02:00
Timo Kösters 175fba5739 Merge branch 'fix-login-token' into 'next'
fix(client/login): username in lowercase for login by token

See merge request famedly/conduit!380
2022-10-13 11:08:04 +00:00
AndSDev 912491cb28 style(db/rooms): refactor admin room pdu validating 2022-10-13 14:04:26 +03:00
AndSDev da2dbd2877 feat(db/rooms): disable leaving from admin room for last user 2022-10-13 13:09:26 +03:00
AndSDev c67f95ebff feat(db/rooms): disable leaving from admin room for conduit user 2022-10-13 13:01:18 +03:00
AndSDev 3a8321f9ad feat(db/rooms): encryption is not allowed in the admins room 2022-10-13 12:50:23 +03:00
Timo Kösters f46d64e52f Merge branch 'unstability' into 'next'
Mark unstable versions as unstable in /capabilities

See merge request famedly/conduit!394
2022-10-13 09:39:45 +00:00
Timo Kösters 8c6e75a0cd Mark unstable versions as unstable in /capabilities 2022-10-13 10:27:42 +02:00
Timo Kösters c23b4946c5 Merge branch 'fixallthebugs' into 'next'
fix: all the e2ee problems

See merge request famedly/conduit!393
2022-10-13 08:21:12 +00:00
Timo Kösters ac52b234fa fix: all the e2ee problems 2022-10-13 10:15:35 +02:00
AndSDev 9a47069f45 fix(client/login): username in lowercase for login by token 2022-10-13 06:40:17 +00:00
Charles Hall 7ef9fe3454 add regression tests
This way we don't regress on accident again in the future.
2022-10-12 17:58:43 -07:00
Charles Hall fc852f8be6 resolve cargo check --features clap/deprecated
This has no functional effects.
2022-10-12 17:55:12 -07:00
Charles Hall 4710f739c0 clap v4 turned more things into optional features
So we need to re-enable some things. See their changelog[0] for details.

[0]: https://github.com/clap-rs/clap/blob/master/CHANGELOG.md#migrating
2022-10-12 17:55:12 -07:00
Charles Hall 3c20c1b72e fix cargo test 2022-10-12 17:55:12 -07:00
Timo Kösters 37eb686b5b Merge branch 'fixfluffy' into 'next'
fix: fluffychat login works again

See merge request famedly/conduit!391
2022-10-12 15:37:50 +00:00
Timo Kösters fdd64fc966 fix: fluffychat login works again 2022-10-12 17:18:01 +02:00
Timo Kösters 4d982d05af Merge branch 'claimfast' into 'next'
improvement: more efficient /claim

See merge request famedly/conduit!389
2022-10-12 09:09:23 +00:00
Timo Kösters 1e725bc548 Merge branch 'fixmakejoin' into 'next'
fix: make join should not send event id

See merge request famedly/conduit!390
2022-10-12 09:08:58 +00:00
Timo Kösters dd8f4681a2 fix: make join should not send event id 2022-10-12 10:57:54 +02:00
Timo Kösters 0290f1f355 improvement: more efficient /claim 2022-10-12 10:43:30 +02:00
Timo Kösters cd835fc7a8 Merge branch 'initialSyncFix' into 'next'
Initial sync fix

See merge request famedly/conduit!388
2022-10-11 21:24:19 +00:00
Timo Kösters 2b70d9604a fix: element gets stuck in /initialSync 2022-10-11 23:07:03 +02:00
Timo Kösters d3968c2fd1 fix: bump ruma again to fix state res problems 2022-10-11 21:51:20 +02:00
Timo Kösters 8105c5cc60 cargo fmt 2022-10-11 18:10:51 +02:00
Timo Kösters d1e5acd7b3 fix: don't panic on missing events in state 2022-10-11 17:59:49 +02:00
Timo Kösters 68227c06c3 fix: state for left rooms 2022-10-11 17:10:56 +02:00
Timo Kösters 31d1801912 fix: workaround for missing avatars on element and rooms becoming historical 2022-10-11 17:10:09 +02:00
Timo Kösters fb6bfa9753 fix: missing field origin error with synapse servers 2022-10-11 15:25:10 +02:00
Timo Kösters c30cc6120b fix: send right errors on make/send join in restricted rooms 2022-10-11 11:53:13 +02:00
Nyaaori 2b7c19835b Add room version 10 to experimental versions 2022-10-10 15:00:44 +02:00
Timo Kösters c2a5315e9f Merge branch 'm0dex/fix-signature-upload' into 'next'
fix(client/keys): ignore all but signed keys in signature upload route

See merge request famedly/conduit!378
2022-10-10 14:42:23 +02:00
Jakub Kubík 0ddc3c01ef style(client/keys): rename signature key to signed key 2022-10-10 14:41:43 +02:00
Jakub Kubík c15205fb46 fix(client/keys): ignore non-signature keys in signature upload route 2022-10-10 14:41:00 +02:00
Jonas Zohren cb837d5a1c Merge branch 'conduit-dockerfile-db-path' into 'next'
Dockerfile: changing DB path to be same as we are using in CI

See merge request famedly/conduit!371
2022-10-10 14:40:19 +02:00
majso 18ca2e4c29 Dockerfile: changing DB path to be same as we are using in CI 2022-10-10 14:39:36 +02:00
Timo Kösters a10dae38e2 Merge branch 'v4' into 'next'
Bump version to 0.4

See merge request famedly/conduit!368
2022-10-10 14:38:56 +02:00
Timo Kösters 7cf060ae5b Bump version to 0.4 2022-10-10 14:38:17 +02:00
Timo Kösters de9b0cec50 Merge branch 'lightning_bolt_option' into 'next'
Lightning bolt optional

See merge request famedly/conduit!366
2022-10-10 14:35:56 +02:00
Jonas Zohren 773eded0af Merge branch 'ci-split-cargo-test-and-clippy' into 'next'
Feat(ci): Split clippy into own fallible job

See merge request famedly/conduit!367
2022-10-10 14:35:15 +02:00
Jim df8703cc13 Lightning bolt optional 2022-10-10 14:34:28 +02:00
Jonas Zohren 71cffcd537 feat(ci): Split clippy into own fallible job
For some reason, the clippy build does not work.
This change allows the cargo:test job to still succeed
and the pipeline to pass
2022-10-10 14:13:18 +02:00
Nyaaori f430b87459 cargo clippy 2022-10-10 14:09:11 +02:00
Timo Kösters ca82b2940d fix: sending does not work
We were inserting one too many 0xff bytes
2022-10-10 14:02:05 +02:00
Timo Kösters 229444c932 Use ring-compat feature so out signing keys work again 2022-10-10 14:02:04 +02:00
Timo Kösters 076e9810ba cargo fix 2022-10-10 14:02:04 +02:00
Timo Kösters 6b131202b9 Bump ruma 2022-10-10 14:02:04 +02:00
Timo Kösters 275c6b447d Bump some dependencies 2022-10-10 14:02:04 +02:00
Timo Kösters 1a7893dbbd fix: update state_cache on join over federation 2022-10-10 14:02:03 +02:00
Timo Kösters 5a04559cb4 fix: maintain server list again 2022-10-10 14:02:03 +02:00
Timo Kösters 25c3d89f28 Bump rust version for const fn RwLock::new 2022-10-10 14:02:03 +02:00
Timo Kösters 8b5b7a1f63 fix: panic on launch
Now we start the admin and sending threads at a later time.
2022-10-10 14:02:02 +02:00
Timo Kösters 50b0eb9929 cargo fix 2022-10-10 14:02:02 +02:00
Timo Kösters 7822a385bb cargo fmt 2022-10-10 14:02:02 +02:00
Timo Kösters d5b4754cf4 0 errors left! 2022-10-10 14:02:02 +02:00
Timo Kösters f47a5cd5d5 cargo fix 2022-10-10 14:02:01 +02:00
Timo Kösters a4637e2ba1 cargo fmt 2022-10-10 14:02:01 +02:00
Timo Kösters 33a2b2b772 37 errors left 2022-10-10 14:02:01 +02:00
Timo Kösters 44fe6d1554 127 errors left 2022-10-10 14:02:00 +02:00
Timo Kösters cff52d7ebb messing around with arcs 2022-10-10 14:02:00 +02:00
Timo Kösters face766e0f messing with trait objects 2022-10-10 14:02:00 +02:00
Timo Kösters 8708cd3b63 431 errors left 2022-10-10 14:02:00 +02:00
Timo Kösters bd8b616ca0 Fixed more compile time errors 2022-10-10 13:54:00 +02:00
Nyaaori 785ddfc4aa refactor: prepare for more splits 2022-10-10 13:52:52 +02:00
Nyaaori 232978087a refactor: prepare database/key_value/media.rs from service/media.rs 2022-10-10 13:52:07 +02:00
Nyaaori 7946c5f29e refactor: prepare service/account_data/mod.rs from service/account_data.rs 2022-10-10 13:52:07 +02:00
Nyaaori efad401751 refactor: prepare service/account_data/data.rs from service/account_data.rs 2022-10-10 13:52:07 +02:00
Nyaaori e1e87b8d0c refactor: prepare service/admin/mod.rs from service/admin.rs 2022-10-10 13:52:07 +02:00
Nyaaori c6d1421e81 refactor: prepare service/key_backups/mod.rs from service/key_backups.rs 2022-10-10 13:52:06 +02:00
Nyaaori 5a29511d34 refactor: prepare service/key_backups/data.rs from service/key_backups.rs 2022-10-10 13:52:06 +02:00
Nyaaori d024d205c0 refactor: prepare service/media/mod.rs from service/media.rs 2022-10-10 13:52:06 +02:00
Nyaaori 4649cd82b5 refactor: prepare database/key_value/globals.rs from service/globals.rs 2022-10-10 13:52:05 +02:00
Timo Kösters 057f8364cc fix: some compile time errors
Only 174 errors left!
2022-10-10 13:25:01 +02:00
Timo Kösters 82e7f57b38 refactor state accessor, state cache, user, uiaa 2022-10-10 13:21:09 +02:00
Nyaaori 3e22bbeecd refactor: prepare for state accessor, state cache, user, and uiaa 2022-10-10 13:20:05 +02:00
Nyaaori 213579ee9d refactor: prepare database/key_value/uiaa.rs from service/uiaa/mod.rs 2022-10-10 13:19:31 +02:00
Nyaaori 810a6baf34 refactor: prepare service/uiaa/data.rs from service/uiaa/mod.rs 2022-10-10 13:19:31 +02:00
Nyaaori 61f6ac0d66 refactor: prepare service/rooms/state_accessor/data.rs from service/rooms/state_accessor/mod.rs 2022-10-10 13:19:31 +02:00
Nyaaori 6d981f37a2 refactor: prepare database/key_value/rooms/state_accessor.rs from service/rooms/state_accessor/mod.rs 2022-10-10 13:19:30 +02:00
Nyaaori 7e0b8ec0ac refactor: prepare database/key_value/rooms/user.rs from service/rooms/user/mod.rs 2022-10-10 13:19:30 +02:00
Nyaaori 19743ae195 refactor: prepare service/rooms/user/data.rs from service/rooms/user/mod.rs 2022-10-10 13:19:30 +02:00
Jakub Kubík fd0ea4bf71 feat(database/presence): add skeleton for presence maintenance 2022-10-10 13:00:55 +02:00
Timo Kösters f56424bc8d Refactor appservices, pusher, timeline, transactionids, users 2022-10-10 13:00:53 +02:00
Nyaaori 01bf348811 refactor: prepare for appservices, pusher, timeline, transactionids, and users 2022-10-10 13:00:06 +02:00
Nyaaori bea5d1e0d8 refactor: prepare database/key_value/rooms/timeline.rs from service/rooms/timeline/mod.rs 2022-10-10 12:56:13 +02:00
Nyaaori e8b33e8c5a refactor: prepare service/rooms/timeline/data.rs from service/rooms/timeline/mod.rs 2022-10-10 12:56:13 +02:00
Nyaaori dc7670f3a8 refactor: prepare service/users/mod.rs from service/users.rs 2022-10-10 12:56:12 +02:00
Nyaaori 94ce06bb76 refactor: prepare service/users/data.rs from service/users.rs 2022-10-10 12:56:12 +02:00
Nyaaori 70863260f6 refactor: prepare service/pusher/mod.rs from service/pusher.rs 2022-10-10 12:56:12 +02:00
Nyaaori cb9458122c refactor: prepare service/pusher/data.rs from service/pusher.rs 2022-10-10 12:56:12 +02:00
Nyaaori e62b0904ea refactor: prepare database/key_value/pusher.rs from service/pusher.rs 2022-10-10 12:56:11 +02:00
Nyaaori 306ff5ee4e refactor: prepare database/key_value/users.rs from service/users.rs 2022-10-10 12:56:11 +02:00
Timo Kösters e045abe961 refactor: work on auth chain and state compressor 2022-10-10 11:18:53 +02:00
Nyaaori 0daa3209db refactor: prepare for auth chain and state compressor 2022-10-10 11:17:43 +02:00
Nyaaori 8d0ed3ec51 refactor: prepare database/key_value/rooms/state_compressor.rs from service/rooms/state_compressor/mod.rs 2022-10-10 11:17:34 +02:00
Nyaaori 691e69847f refactor: prepare database/key_value/rooms/auth_chain.rs from service/rooms/state_compressor/mod.rs 2022-10-10 11:17:34 +02:00
Nyaaori c8f64844ab refactor: prepare service/rooms/auth_chain/mod.rs from service/rooms/state_compressor/mod.rs 2022-10-10 11:17:34 +02:00
Timo Kösters b0029c49b9 refactor: work on search 2022-10-10 10:46:39 +02:00
Nyaaori 91ad250177 refactor: prepare for search work 2022-10-10 10:43:52 +02:00
Nyaaori f6040ef2d7 refactor: prepare database/key_value/rooms/search.rs from service/rooms/timeline/mod.rs 2022-10-09 18:52:58 +02:00
Nyaaori 877ee48480 refactor: prepare database/key_value/rooms/search.rs from service/rooms/search/mod.rs 2022-10-09 18:52:58 +02:00
Timo Kösters 03e6e43ecd refactor: split up database/key_value.rs 2022-10-09 18:23:59 +02:00
Nyaaori 6ace16abf6 refactor: prepare to split up database/key_value.rs 2022-10-09 18:23:59 +02:00
Nyaaori 158de9ca08 refactor: prepare src/database/key_value/room/outlier.rs from src/database/key_value.rs 2022-10-09 18:23:58 +02:00
Nyaaori ea2dcf4ff0 refactor: prepare src/database/key_value/room/pdu_metadata.rs from src/database/key_value.rs 2022-10-09 18:23:58 +02:00
Nyaaori 332e7c9dba refactor: prepare src/database/key_value/room/state.rs from src/database/key_value.rs 2022-10-09 18:23:58 +02:00
Nyaaori 0213a32e6a refactor: prepare src/database/key_value/room/edus/typing.rs from src/database/key_value.rs 2022-10-09 18:23:57 +02:00
Nyaaori cd3a163816 refactor: prepare src/database/key_value/room/lazy_load.rs from src/database/key_value.rs 2022-10-09 18:23:57 +02:00
Nyaaori 2950349adf refactor: prepare src/database/key_value/room/metadata.rs from src/database/key_value.rs 2022-10-09 18:23:57 +02:00
Nyaaori 56cacf6f1c refactor: prepare src/database/key_value/room/alias.rs from src/database/key_value.rs 2022-10-09 18:23:56 +02:00
Nyaaori 0f77ae14e4 refactor: prepare src/database/key_value/room/directory.rs from src/database/key_value.rs 2022-10-09 18:23:56 +02:00
Nyaaori 8fa990330f refactor: prepare src/database/key_value/room/edus/presence.rs from src/database/key_value.rs 2022-10-09 18:23:56 +02:00
Nyaaori 84630f90b7 refactor: prepare src/database/key_value/room/edus/read_receipt.rs from src/database/key_value.rs 2022-10-09 18:23:56 +02:00
Jakub Kubík 1869a38b85 refactor(edus): split edus into separate modules 2022-10-09 18:23:55 +02:00
Nyaaori e39358d375 refactor: prepare to split edus into separate modules 2022-10-09 18:23:55 +02:00
Nyaaori c7e601eb0b refactor: prepare service/rooms/edus/typing/data.rs from service/rooms/edus/data.rs 2022-10-09 17:38:46 +02:00
Nyaaori ac4724e82c refactor: prepare service/rooms/edus/read_receipt/data.rs from service/rooms/edus/data.rs 2022-10-09 17:38:23 +02:00
Nyaaori 73217f238c refactor: prepare service/rooms/edus/presence/data.rs from service/rooms/edus/data.rs 2022-10-09 17:37:57 +02:00
Nyaaori d410f08642 refactor: prepare src/service/rooms/edus/typing/mod.rs from src/service/rooms/edus/mod.rs 2022-10-09 17:36:08 +02:00
Nyaaori bfccd4f136 refactor: prepare src/service/rooms/edus/presence/mod.rs from src/service/rooms/edus/mod.rs 2022-10-09 17:35:14 +02:00
Nyaaori c21820083b refactor: prepare src/service/rooms/edus/read_receipt/mod.rs from src/service/rooms/edus/mod.rs 2022-10-09 17:34:24 +02:00
Timo Kösters 865e35df17 Work on rooms/state, database, alias, directory, edus services, event_handler, lazy_loading, metadata, outlier, and pdu_metadata 2022-08-15 19:03:37 +02:00
Nyaaori 604b1a5cf1 refactor: Prepare src/database/key_value.rs 2022-08-15 18:58:03 +02:00
Nyaaori 81ac01c2f5 refactor: restore src/service/rooms/pdu_metadata/mod.rs 2022-08-15 18:47:01 +02:00
Nyaaori 1ccc226c6b refactor: prepare src/database/key_value.rs from src/service/rooms/pdu_metadata/mod.rs 2022-08-15 18:47:01 +02:00
Nyaaori 0ce4446b1a refactor: restore src/service/rooms/metadata/mod.rs 2022-08-15 18:47:00 +02:00
Nyaaori daa969508f refactor: restore src/service/rooms/outlier/mod.rs 2022-08-15 18:47:00 +02:00
Nyaaori 715b30a2b5 refactor: prepare src/database/key_value.rs from src/service/rooms/outlier/mod.rs 2022-08-15 18:47:00 +02:00
Nyaaori 42fe118cbe refactor: restore src/service/rooms/edus/mod.rs 2022-08-15 18:46:59 +02:00
Nyaaori 06bfddf0da refactor: restore src/service/rooms/lazy_loading/mod.rs 2022-08-15 18:46:59 +02:00
Nyaaori 931c8ece4a refactor: prepare src/database/key_value.rs from src/service/rooms/metadata/mod.rs 2022-08-15 18:46:59 +02:00
Nyaaori 85e571badd refactor: prepare src/database/key_value.rs from src/service/rooms/lazy_loading/mod.rs 2022-08-15 18:46:59 +02:00
Nyaaori 0071a9cbf4 refactor: restore src/service/rooms/directory/mod.rs 2022-08-15 18:46:58 +02:00
Nyaaori a563b1ba9a refactor: prepare src/database/key_value.rs from src/service/rooms/edus/mod.rs 2022-08-15 18:46:58 +02:00
Nyaaori 9e1ab74bb4 refactor: prepare src/database/key_value.rs from src/service/rooms/directory/mod.rs 2022-08-15 18:46:58 +02:00
Nyaaori adafb335ff refactor: restore src/service/rooms/state/mod.rs 2022-08-15 18:46:57 +02:00
Nyaaori 05487c7c15 refactor: restore src/service/rooms/alias/mod.rs 2022-08-15 18:46:57 +02:00
Nyaaori a2a327af7c refactor: prepare src/database/key_value.rs from src/service/rooms/state/mod.rs 2022-08-15 18:46:57 +02:00
Nyaaori 33c0e0f430 refactor: prepare src/database/key_value.rs from src/service/rooms/alias/mod.rs 2022-08-15 18:46:57 +02:00
Nyaaori 1442c64420 refactor: restore src/service/rooms/state/data.rs 2022-08-15 18:46:50 +02:00
Nyaaori 28644f236e refactor: prepare src/database/key_value.rs from src/service/rooms/state/data.rs 2022-08-15 18:46:50 +02:00
Timo Kösters cc80152889 refactor: split up force_state 2022-08-15 17:17:53 +02:00
Timo Kösters dcdbcc0851 refactor: event handling code 2022-08-15 17:12:22 +02:00
Nyaaori 1b0477d569 refactor: Preparation commit to split src/service/rooms/state.rs and src/api/server_server.rs 2022-08-15 17:09:41 +02:00
Nyaaori 57c92f8044 refactor: restore src/api/server_server.rs 2022-08-15 17:09:22 +02:00
Nyaaori e1d8c03e47 refactor: prepare splitting src/api/server_server.rs to src/service/rooms/event_handler/mod.rs 2022-08-15 17:09:15 +02:00
Nyaaori 7d2b22f58d refactor: prepare splitting src/service/rooms/state.rs to src/service/rooms/state_accessor/mod.rs 2022-08-15 17:08:33 +02:00
Nyaaori 9efd9f06c6 refactor: prepare splitting src/service/rooms/state.rs to src/service/rooms/state/data.rs 2022-08-15 17:07:33 +02:00
Nyaaori d0cbe46ff0 refactor: prepare splitting src/service/rooms/state.rs to src/service/rooms/state/mod.rs 2022-08-15 17:07:33 +02:00
Timo Kösters 025b64befc refactor: renames and split room.rs 2022-08-15 16:30:34 +02:00
Nyaaori 92e59f14e0 refactor: Preparation commit to split src/database/rooms.rs 2022-08-15 16:25:38 +02:00
Nyaaori 7989c7cdda refactor: prepare splitting src/database/rooms.rs to src/service/rooms/timeline.rs 2022-08-15 16:22:38 +02:00
Nyaaori e22f5fef1f refactor: prepare splitting src/database/rooms.rs to src/service/rooms/user.rs 2022-08-15 16:22:38 +02:00
Nyaaori 64a022a4d2 refactor: prepare splitting src/database/rooms.rs to src/service/rooms/state.rs 2022-08-15 16:22:37 +02:00
Nyaaori 751be39376 refactor: prepare splitting src/database/rooms.rs to src/service/rooms/state_cache.rs 2022-08-15 16:22:37 +02:00
Nyaaori d05b84d0f5 refactor: prepare splitting src/database/rooms.rs to src/service/rooms/state_compressor.rs 2022-08-15 16:22:37 +02:00
Nyaaori 54bf91b76e refactor: prepare splitting src/database/rooms.rs to src/service/rooms/outlier.rs 2022-08-15 16:22:36 +02:00
Nyaaori 8ed79a00fd refactor: prepare splitting src/database/rooms.rs to src/service/rooms/pdu_metadata.rs 2022-08-15 16:22:36 +02:00
Nyaaori 8dffdadfd3 refactor: prepare splitting src/database/rooms.rs to src/service/rooms/search.rs 2022-08-15 16:22:36 +02:00
Nyaaori 2dbfbd45a2 refactor: prepare splitting src/database/rooms.rs to src/service/rooms/short.rs 2022-08-15 16:22:36 +02:00
Nyaaori 249440115b refactor: prepare splitting src/database/rooms.rs to src/service/rooms/lazy_loading.rs 2022-08-15 16:22:35 +02:00
Nyaaori baa8224cce refactor: prepare splitting src/database/rooms.rs to src/service/rooms/metadata.rs 2022-08-15 16:22:35 +02:00
Nyaaori bd7b49b098 refactor: prepare splitting src/database/rooms.rs to src/service/rooms/mod.rs 2022-08-15 16:22:35 +02:00
Nyaaori 27e2f0d545 refactor: prepare splitting src/database/rooms.rs to src/service/rooms/alias.rs 2022-08-15 16:22:34 +02:00
Nyaaori 4dc14e1580 refactor: prepare splitting src/database/rooms.rs to src/service/rooms/directory.rs 2022-08-15 16:22:34 +02:00
Timo Kösters df16012661 Merge branch 'next' into 'master'
Release v0.4.0

See merge request famedly/conduit!369
2022-06-23 07:43:05 +00:00
Timo Kösters e8cd85fee4 Merge branch 'v4' into 'next'
Bump version to 0.4

See merge request famedly/conduit!368
2022-06-23 07:07:44 +00:00
Timo Kösters 35fd732b04 Bump version to 0.4 2022-06-23 09:06:39 +02:00
Timo Kösters 10b1557c0e Merge branch 'lightning_bolt_option' into 'next'
Lightning bolt optional

See merge request famedly/conduit!366
2022-06-23 06:58:34 +00:00
Jim 49bd75b856 Lightning bolt optional 2022-06-23 06:58:34 +00:00
Jonas Zohren 02f8218867 Merge branch 'ci-split-cargo-test-and-clippy' into 'next'
Feat(ci): Split clippy into own fallible job

See merge request famedly/conduit!367
2022-06-22 23:16:45 +00:00
Jonas Zohren 40eebbd9d8 feat(ci): Split clippy into own fallible job
For some reason, the clippy build does not work.
This change allows the cargo:test job to still succeed
and the pipeline to pass
2022-06-22 22:14:53 +00:00
Timo Kösters 9ee199b0c3 Merge branch 'deactivate-user-command' into 'next'
Deactivate user command

See merge request famedly/conduit!337
2022-06-19 19:38:07 +00:00
Zeyphros 1c31f7905f Update command comment to coincide with the default action 2022-06-19 18:59:49 +02:00
Zeyphros f6183e457d Implement command to deactivate user from admin channel
Use `leave_room` in `leave_all_rooms`

WIP: Add command to delete a list of users
also implements a flag to prevent the user from being removed from their joined rooms.

Report user deactivation failure reason

Don't send leave events by default when mass deactivating user accounts

Don't stop leaving rooms if an error was encountered

WIP: Rename command, make flags consistent, don't deactivate admin accounts.
Accounts should be deactivated as fast as possible and removing users from joined groups is completed afterwards.

Fix admin safety logic, improve command output

Continue leaving rooms if a room_id is invalid

Ignore errors from leave_room

Add notice to the list-local-users command
Output form list-local-users can be used directly without modification with the deactivate-all command

Only get mutex lock for admin room when sending message
2022-06-19 18:59:48 +02:00
Timo Kösters 2ecbcdda42 Merge branch 'upgrades' into 'next'
Upgrade dependencies

See merge request famedly/conduit!363
2022-06-19 15:11:21 +00:00
Timo Kösters 0c8e51e1b7 Upgrade dependencies 2022-06-19 15:40:14 +02:00
Timo Kösters 86b23338dd Merge branch 'password-length-consistency' into 'next'
Length of passwords consistently use the constant

See merge request famedly/conduit!361
2022-06-19 07:35:06 +00:00
Dietrich 7bee9c1c69 Length of passwords consistently use the constant 2022-06-19 07:10:47 +02:00
Timo Kösters 6ef1e8c4f9 Merge branch 'timo' into 'next'
More async

See merge request famedly/conduit!359
2022-06-18 20:56:26 +00:00
Timo Kösters 0bc03e90a1 improvement: make more things async 2022-06-18 22:55:37 +02:00
Timo Kösters 9b898248c7 feat: more admin commands, better logging 2022-06-18 22:55:34 +02:00
Timo Kösters 566dc0a6a2 Merge branch 'next' into 'next'
Remove outdated rust version info

See merge request famedly/conduit!360
2022-06-18 15:02:31 +00:00
Jim b4be087a46 Merge branch 'JimZAH-next-patch-83655' into 'next'
Remove rust version requirement from deploy.md

See merge request JimZAH/conduit!2
2022-06-18 14:57:30 +00:00
Jim 722e553c6e Remove rust version requirement from deploy.md 2022-06-18 14:47:32 +00:00
Timo Kösters f8547ecba4 Merge branch 'create-user-command' into 'next'
added a command to the admin bot to create a new user, even with registration disabled

See merge request famedly/conduit!354
2022-06-18 13:08:51 +00:00
Timo Kösters e70cff196b Merge branch 'fix-deb-postinst-config' into 'next'
Remove the address override in deb generated config

See merge request famedly/conduit!344
2022-06-18 11:21:31 +00:00
Timo Kösters 0286a804f4 Merge branch 'filter-users' into 'next'
Hide users from user directory if they are only in private rooms and they don't share a room

Closes #24

See merge request famedly/conduit!325
2022-06-18 11:17:09 +00:00
Radek Stępień 7239243163 Hide users from user directory if they are only in private rooms and they don't share a room 2022-06-18 11:17:09 +00:00
Timo Kösters 124471199c Merge branch 'registration-without-username' into 'next'
Allow registration without username

Closes #111

See merge request famedly/conduit!340
2022-06-18 11:13:37 +00:00
Radek Stępień 84ec057f6e Allow registration without username 2022-06-18 11:13:37 +00:00
Timo Kösters 8e08a72229 Merge branch 'bump-docker-image-to-alpine-3-16-0' into 'next'
chore(docker): Bump base image to alpine 3.16.0

See merge request famedly/conduit!355
2022-06-18 11:05:42 +00:00
Jonas Zohren e03a2b8636 chore(docker): Bump base image to alpine 3.16.0 2022-06-18 11:05:42 +00:00
Timo Kösters 83d3cbfa99 Merge branch 'rmsthebest-next-patch-62586' into 'next'
Added Caddy to the web proxy examples

See merge request famedly/conduit!352
2022-06-18 11:05:22 +00:00
Timo Kösters 84cb0667f3 Merge branch 'to_device-existing-txn-id' into 'next'
feat: if txn id exists in the db, skip the event

See merge request famedly/conduit!353
2022-06-18 11:04:16 +00:00
Jakub Kubík c3924b566b feat: if txn id exists in the db, skip the event 2022-06-18 11:04:16 +00:00
Timo Kösters 0f86506288 Merge branch 'Miepee-next-patch-24570' into 'next'
Mention different database backends in DEPLOY.md

See merge request famedly/conduit!358
2022-06-18 11:03:09 +00:00
Miepee b862283ed9 Mention different databse backends in DEPLOY.md 2022-06-16 13:23:45 +00:00
Timo Kösters ba682fa3b4 Merge branch 'kubo6472-next-patch-16934' into 'next'
Fix FluffyChat Compatibility

See merge request famedly/conduit!357
2022-06-15 20:42:40 +00:00
Jakub Doboš 8a63a2cc68 Fix FluffyChat Compatibility 2022-06-15 13:07:07 +00:00
Timo Kösters f6dc22127a Merge branch 'next' into 'next'
Add portforwarding + opening to the docs (+recommended extension fix)

See merge request famedly/conduit!356
2022-06-13 19:28:00 +00:00
Dietrich bd3f9e0dbe Fix spelling. 2022-06-13 20:45:12 +02:00
Dietrich 58d784aa29 Adding a hint to closed ports in the testing section 2022-06-13 20:23:08 +02:00
Dietrich ae8e143fe9 Add a section to Ports and forwarding 2022-06-13 20:08:18 +02:00
Dietrich d9782c508a rust-analyzer-extension moved to rust-lang
The recommended extension id could not be found as rust-analyzer now has the id `rust-lang.rust-analyzer`
2022-06-13 20:03:30 +02:00
Timo Kösters 39bc84d81c Merge branch 'fix_panic_on_long_message' into 'next'
Don't panic when signing event fails.

Closes #232

See merge request famedly/conduit!343
2022-05-28 20:47:15 +00:00
Timo Kösters 89eb54b7ff Merge branch 'unignore-feddest-doc-test' into 'next'
enable FedDest doc-test

See merge request famedly/conduit!349
2022-05-28 20:43:37 +00:00
Jonas Zohren 8bb58061fd Merge branch 'adopt-aur-patches' into 'next'
Adjust some files to the AUR patches

See merge request famedly/conduit!351
2022-05-10 07:26:20 +00:00
Jonas Zohren 8392809eb1 Adjust some files to the AUR patches 2022-05-10 07:26:19 +00:00
= bb033fe02a added a command to the admin bot to create a new user, even with registration disabled 2022-05-01 17:49:02 +02:00
rmsthebest 23f29d1bda Added Caddy to the web proxy examples 2022-04-17 23:08:17 +00:00
Jan Christian Grünhage efe9d5000e enable FedDest doc-test
Doc rendering is exactly as before, but it now actually tests the code
2022-04-14 16:42:11 +02:00
Zeyphros 090d0fe684 Fix typo 2022-04-13 00:08:55 +02:00
Timo Kösters 2fcb3c8b93 Merge branch '262-missing_room_keys_endpoint' into 'next'
feat: re-register missing add_backup_keys route

Closes #262

See merge request famedly/conduit!346
2022-04-11 16:05:59 +00:00
Jakub Kubík 729d66aa11 feat: register missing add_backup_keys route 2022-04-10 14:56:43 +02:00
Paul van Tilburg b10dbc747b Remove the address override in deb generated config
This override was accidentally introduced by commit de6c331.
The Debian postinst script will ask for and generate a config with the
address set. This should not be overriden by what is set in the default
config and is thus a deviation from the standard docs.
2022-04-09 15:13:01 +02:00
Zeyphros 07a3a6fa9a Return an error when signing an event fails
Prevents the server from crashing/become unresponsive when overly long
messages are sent
2022-04-08 22:05:13 +02:00
Timo Kösters 6e106b5732 Merge branch 'v9' into 'next'
Support all room versions from V3 to V9

Closes #161

See merge request famedly/conduit!257
2022-04-07 15:27:58 +00:00
Timo Kösters 00b362b43b fix: cors warning 2022-04-07 17:09:07 +02:00
Timo Kösters b6b27b66c8 fix: don't allow unjoined users to send typing notifications 2022-04-07 17:07:33 +02:00
Timo Kösters 3573d40027 fix warnings 2022-04-07 17:04:29 +02:00
Timo Kösters e4600ccfef bump ruma 2022-04-07 17:02:49 +02:00
Timo Kösters 0ae39807a4 Add V9 to list of allowed versions 2022-04-07 16:50:09 +02:00
Timo Kösters 686319e2e3 fix: error handling 2022-04-07 16:50:07 +02:00
Nyaaori d655f4c1be Cleanup rooms.rs, globals.rs, and pdu.rs 2022-04-07 16:48:37 +02:00
Nyaaori 4b28146ee7 Support room version 3 2022-04-07 16:44:50 +02:00
Nyaaori d8a3b257f2 Enable room version 4 2022-04-07 16:36:27 +02:00
Nyaaori 714873694d Refactor room version support, add default room version config 2022-04-07 16:35:10 +02:00
Timo Kösters d81216cad7 improvement: preparing for room version 9 2022-04-07 16:26:50 +02:00
Timo Kösters 9e29dc808f Merge branch '198-support-user-password-resets' into 'next'
feat: support user password resets

Closes #198

See merge request famedly/conduit!339
2022-04-07 12:11:55 +00:00
Jakub Kubík ada07de204 feat: support user password resets 2022-04-07 12:11:55 +00:00
Timo Kösters 2556e29984 Merge branch 'up-ruma-went-too-far' into 'next'
Upgrade Ruma

See merge request famedly/conduit!342
2022-04-07 11:37:53 +00:00
Timo Kösters df4c38cb61 fix: remove warnings 2022-04-07 13:22:32 +02:00
Timo Kösters 2808dd2000 Ruma upgrade 2022-04-07 12:58:48 +02:00
Timo Kösters 17ad5f0595 fix: checks for incoming cross signing changes 2022-04-07 12:56:18 +02:00
Timo Kösters b8411ae2fd refactor: rename endpoints to match ruma 2022-04-07 12:56:17 +02:00
Timo Kösters 566833111c refactor: small improvements 2022-04-07 12:56:16 +02:00
chenyuqide ee96a03d60 Update ruma 2022-04-07 12:56:16 +02:00
chenyuqide 21bc099ccf Update ruma 2022-04-07 12:56:12 +02:00
Timo Kösters 1ce03059a0 Merge branch 'next' into 'next'
Fix wrong associated type in OutgoingKind::Appservice

See merge request famedly/conduit!324
2022-04-03 19:48:25 +00:00
Timo Kösters 9ed352d4c0 Merge branch '199-fix-kick-ban-over-federation' into 'next'
fix: fix kick and ban events over federation

Closes #199

See merge request famedly/conduit!338
2022-04-03 17:59:15 +00:00
Jakub Kubík a08c667230 docs: add comments for clarification of recent changes 2022-04-03 19:27:48 +02:00
Jakub Kubík 414c7c40c4 fix: remove our server from the list of servers to send the event PDU to 2022-04-03 19:19:57 +02:00
Jakub Kubík 1712e63e06 fix: fix kick and ban events over federation
Fix the scenario where a MembershipState change event was not sent to the server of a user kicked/banned from a room on a Conduit instance if there were not any other users from that server in the room.
2022-04-03 18:58:45 +02:00
Timo Kösters 272e27ae01 Merge branch 'appservice-pdu-send-fix' into 'next'
Send PDU to appservice if state_key is their user ID

Closes #110

See merge request famedly/conduit!331
2022-04-03 12:32:23 +00:00
Andrej Kacian 9046223e7f Send PDU to appservice if state_key is their user ID
Fixes #110.
2022-04-01 19:38:38 +02:00
Timo Kösters 0066f20bdd Merge branch 'trailingslash' into 'next'
fix: allow trailing slashes for /state/<type>/ again

See merge request famedly/conduit!336
2022-04-01 14:17:21 +00:00
Timo Kösters a5465dfd3e fix: allow trailing slashes for /state/<type>/ again 2022-04-01 16:00:04 +02:00
Timo Kösters 8086bee146 Merge branch 'show-config' into 'next'
Add show-config admin command

See merge request famedly/conduit!295
2022-04-01 09:01:00 +00:00
Timo Kösters b11a3b80bc Merge branch 'shutdown-msg' into 'next'
Log caught Ctrl+C or SIGTERM for operator feedback

See merge request famedly/conduit!319
2022-04-01 08:49:28 +00:00
Timo Kösters 554146f46e Merge branch 'notify-admin-room-on-user-register' into 'next'
Notify admin room for user registrations, deactivations and password changes

See merge request famedly/conduit!318
2022-04-01 08:41:51 +00:00
Timo Kösters 7bc84dc971 Merge branch 'jplatte/up-axum' into 'next'
Upgrade axum to 0.5

See merge request famedly/conduit!335
2022-04-01 08:33:22 +00:00
Timo Kösters d89141100c Merge branch 'insensitive-login' into 'next'
Case insensitive username login

Closes #248

See merge request famedly/conduit!323
2022-04-01 08:20:45 +00:00
Timo Kösters f9bf465578 Merge branch 'readable' into 'next'
Fix security issue.

See merge request famedly/conduit!316
2022-04-01 07:30:05 +00:00
Jonas Platte 3933bd9a8e Update axum feature set used 2022-03-31 22:52:16 +02:00
Jonas Platte db0659cb3d Upgrade axum to 0.5 2022-03-31 22:50:17 +02:00
Timo Kösters 1219535e56 Merge branch 'fix/bad-uid-crash' into 'next'
Fix crash when a bad user ID is in the database

See merge request famedly/conduit!334
2022-03-31 19:23:41 +00:00
LordMZTE 4a12a7cbc8 Fix crash when a bad user ID is in the database
To my understanding, a bad user ID can sometimes make it into the
database, which lead to a panic prior to this change.
2022-03-31 20:59:59 +02:00
Jonas Zohren 08072d2c8d Merge branch 'docker/ci-bump-alpine-version' into 'next'
chore: Bump alpine version for CI generated docker

See merge request famedly/conduit!333
2022-03-30 20:30:56 +00:00
Jonas Zohren 1ebf417c11 chore: Bump alpine version for CI generated docker 2022-03-30 20:23:04 +00:00
Jonas Zohren a2a7c61872 Merge branch 'docker-bump-alpine-version' into 'next'
chore(docker): Bump alpine (base image) version

Closes #255

See merge request famedly/conduit!330
2022-03-18 17:52:50 +00:00
Jonas Zohren 61277452af chore(docker): Bump alpine (base image) version 2022-03-18 18:44:05 +01:00
Timo Kösters 6be5e83e61 Merge branch 'reqwest-tls-native-roots' into 'next'
Use native root CA certificates for reqwest

See merge request famedly/conduit!329
2022-03-14 14:27:12 +00:00
Timo Kösters c70c0129f8 Merge branch 'proxy-config-examples' into 'next'
Fix proxy config examples in config/proxy.rs

See merge request famedly/conduit!321
2022-03-14 14:26:28 +00:00
Andrej Kacian b5b8181851 Notify admin room for user registrations, deactivations and password changes 2022-03-13 09:13:45 +01:00
Andrej Kacian 194a85d4c5 Use native root CA certificates for reqwest 2022-03-12 15:44:22 +01:00
kk a6edf00810 Merge remote-tracking branch 'origin/next' into insensitive-login
pulling next into dev branch
2022-03-09 19:12:02 -08:00
Jonas Zohren 738f5e8f68 Merge branch 'ci-fix-cross-musl-builds' into 'next'
CI: Fix musl builds

See merge request famedly/conduit!328
2022-03-08 22:13:31 +00:00
Jonas Zohren 5a9462c9ab fix(ci): Fix musl builds
This pins the image to use for cross to a working image's sha256
2022-03-08 21:52:57 +00:00
chenyuqide 5695121f38 Fix wrong associated type in OutgoingKind::Appservice 2022-03-02 23:48:01 +08:00
reti4 8bafdc4623 fixed location of lowercase fn 2022-03-02 02:25:15 +00:00
Jonas Zohren 36a6d724fe Merge branch 'writable' into 'next'
Fix permissions

See merge request famedly/conduit!317
2022-03-01 23:55:10 +00:00
reti4 9385ea0e7c fmt fix 2022-03-01 21:23:34 +00:00
reti4 9f059ad4c3 make username login case insensitive 2022-03-01 21:03:55 +00:00
TomZ 5c6c6f272c Fix security issue.
The docs state that you need to make the config file _readable_
and then proceeds to make the file writable.

This changes it to make the file to be owned by root and readable by
anyone. This is the default for unix / linux and suggested practice
for files in /etc.
2022-02-23 10:15:33 +01:00
Andrej Kacian 65fa4b2ca4 Fix proxy config examples in config/proxy.rs 2022-02-22 22:32:38 +01:00
Jonas Zohren 6788225cac Merge branch 'fix-docker-db-dir-permissions' into 'next'
Fix(docker): Make conduit own default db path

See merge request famedly/conduit!320
2022-02-22 15:34:14 +00:00
Jonas Zohren a5bb6786c8 fix(docker): Make conduit own default db path
When a user mounts a volume into the default volume path,
it uses the permissions and ownership from the host volume.
In most cases, this is 1000:1000, which it also uses on the inside.

If you don't mount a volume though (e.g., for testing), conduit cries:
“The database couldn't be loaded or created.”

This fix chowns the default db dir to remedy this.
2022-02-22 16:26:30 +01:00
Andrej Kacian 3b2b35aab7 Log caught Ctrl+C or SIGTERM for operator feedback 2022-02-22 00:28:46 +01:00
TomZ 949f2523f9 Fix permissions
The text just sets the ownership and ignores that defaults on unix
are to have newly created dirs be readable by everyone.
This closes the database to unauthorized users on multi-user systems.
2022-02-21 22:35:08 +01:00
Andrej Kacian 196c83939c Add show-config admin room command 2022-02-21 22:27:19 +01:00
Jonas Zohren 237645e975 Merge branch 'docs' into 'next'
docs: make all configs match

Closes #205

See merge request famedly/conduit!301
2022-02-20 10:59:56 +00:00
Jonas Zohren 86162c2c20 Merge branch 'next' into docs 2022-02-20 11:43:50 +01:00
Jonas Zohren 199c84195a Merge branch 'improve-docker-documentation' into 'next'
Improve docker documentation some

See merge request famedly/conduit!314
2022-02-20 10:43:05 +00:00
Jonas Zohren 57ac4160b7 Merge branch 'next' into docs 2022-02-20 11:42:19 +01:00
Jonas Zohren 91c648253a Merge branch 'docs-remove-obsolete-cross-readme' into 'next'
Remove the now obsolete cross readme

See merge request famedly/conduit!315
2022-02-20 10:22:47 +00:00
Jonas Zohren 5a80507006 chore(docs): Remove the now obsolete cross readme 2022-02-20 11:12:49 +01:00
Jonathan de Jong cc14727888 revert reflow 2022-02-20 10:55:17 +01:00
Jonathan de Jong 94573a3a61 improve docker documentation some 2022-02-19 17:06:06 +01:00
Jonas Zohren 0ba0fa5f6c Merge branch 'ci-audit-dependencies' into 'next'
CI: audit dependencies

See merge request famedly/conduit!313
2022-02-19 11:25:30 +00:00
Jonas Zohren ad6eb92bbd feat(ci): Add dependency audit to CI tests 2022-02-19 12:19:06 +01:00
Timo Kösters ce76041c03 Merge branch 'up-ruma' into 'next'
Update Ruma

See merge request famedly/conduit!312
2022-02-19 09:46:56 +00:00
Jonas Zohren 8f063c99d5 chore(ci): Split up tests 2022-02-18 22:29:55 +01:00
Jonathan de Jong 557d119bee change search_events_v3 to search_events::v3 2022-02-18 19:54:26 +01:00
Jonathan de Jong e9f87e1952 update ruma 2022-02-18 15:33:14 +01:00
Jonas Zohren f3795846b5 Merge branch 'readme' into 'next'
Slight clarification

See merge request famedly/conduit!310
2022-02-18 12:19:51 +00:00
Timo Kösters b8eaa3be85 Merge branch 'redactfix' into 'next'
Redaction fix

Closes #235

See merge request famedly/conduit!298
2022-02-18 12:00:40 +00:00
Timo Kösters c496e599ef Merge branch 'serde-cleanup' into 'next'
Remove useless serde roundtrips

See merge request famedly/conduit!311
2022-02-18 11:07:59 +00:00
Jonas Platte 27692a2f14 Remove useless serde roundtrips 2022-02-18 11:52:00 +01:00
TomZ e57cd437d4 Slight clarification
Which version it started being beta in is quite irrelevant here.
2022-02-17 23:00:39 +01:00
Timo Kösters 5a99460a4c Merge branch 'not-found' into 'next'
Add a not-found route

See merge request famedly/conduit!306
2022-02-17 15:43:08 +00:00
Jonas Zohren ba83d0ac68 Merge branch 'more-vscode-defaults' into 'next'
Provide some sane defaults for vscode developing

See merge request famedly/conduit!309
2022-02-17 15:33:03 +00:00
Jonas Zohren bcd6c0bf53 feat: Provide sane defaults for vscode developing
This includes some extensions and a debug profile
2022-02-17 11:14:50 +00:00
Jonas Zohren b4225cb0fc fix(docker): use user 1000 and standard db path 2022-02-16 15:13:04 +01:00
Jonas Zohren 98b67da649 fix: Docker syntax 2022-02-16 15:13:03 +01:00
Jonas Zohren 0be8500c4f Set all env vars in docker README 2022-02-16 15:12:40 +01:00
Jonas Zohren 97507d2880 Remove most env vars from Dockerfile 2022-02-16 15:12:40 +01:00
Jonas Zohren c4353405a5 Suggestions from Jonas Zohren 2022-02-16 15:12:38 +01:00
Timo Kösters de6c3312ce docs: make all configs match 2022-02-16 15:11:46 +01:00
Jonas Zohren c66866d890 Merge branch 'ci-lint-dockerfiles-with-hadolint' into 'next'
CI: Lint dockerfiles with hadolint

Closes #239

See merge request famedly/conduit!308
2022-02-15 19:10:12 +00:00
Jonas Zohren b21a44ca4c feat(ci): Lint dockerfiles with hadolint 2022-02-15 20:01:38 +01:00
Jonas Zohren e04d4ff150 Merge branch 'ci-fix-tag-pipelines' into 'next'
Ci fix tag pipelines

Closes #229

See merge request famedly/conduit!307
2022-02-15 10:56:25 +00:00
Jonas Zohren 2645494582 fix(ci): Also run CI for git tags 2022-02-15 11:17:46 +01:00
Jonas Zohren 77f4b68c8e fix(ci): Also create versioned docker image 2022-02-15 11:17:32 +01:00
Timo Kösters 6602f6114c fix: redacts can't error anymore 2022-02-13 15:47:58 +01:00
Jonas Platte 3aece38e9d Add a not-found route 2022-02-13 13:59:27 +01:00
Timo Kösters 9cfef51af3 Merge branch 'more-paths' into 'next'
Take advantage of multiple paths

See merge request famedly/conduit!305
2022-02-13 12:13:22 +00:00
Jonas Platte aee6bf7e7a Change this to handler 2022-02-13 11:30:04 +00:00
Jonathan de Jong b8d92d3cec take advantage of multiple paths 2022-02-13 12:07:00 +01:00
Timo Kösters 0c4b42ac13 Merge branch 'parse-pdu-command-panic' into 'next'
fix: do not panic on a JSON not containing the PDU

Closes #236

See merge request famedly/conduit!304
2022-02-12 21:22:37 +00:00
Timo Kösters 91d5fbd56c Merge branch 'up-ruma' into 'next'
Update ruma

See merge request famedly/conduit!303
2022-02-12 20:59:07 +00:00
M0dEx d4217007fe fix: do not panic on a JSON not containing the PDU
Do not panic on a JSON not containing the PDU when executing the parse-pdu admin command.
2022-02-12 21:40:07 +01:00
Jonathan de Jong 35b82d51cf fix compilations 2022-02-12 21:04:38 +01:00
Jonathan de Jong 0ed1e42aed update ruma 2022-02-12 21:01:53 +01:00
Timo Kösters 2b644ef7b7 Merge branch 'tracing-cleanup' into 'next'
Remove unnecessary tracing::instrument attributes

See merge request famedly/conduit!302
2022-02-12 15:50:24 +00:00
Jonas Platte 0ad6eac4f8 Remove all tracing::instrument attributes from database::abstraction::* 2022-02-12 16:38:47 +01:00
Jonas Platte accdb77315 Clean up tracing::instrument attributes
Remove it from request handler since there's already the context of the
request path, added through TraceLayer.
2022-02-12 16:38:47 +01:00
Timo Kösters 914152fcbd Merge branch 'syncfast' into 'next'
improvement: faster /syncs

Closes #231

See merge request famedly/conduit!297
2022-02-12 15:11:03 +00:00
Timo Kösters 2a00c547a1 improvement: faster /syncs 2022-02-12 15:57:54 +01:00
Jonas Platte adeb8ee425 Remove no-op conversions 2022-02-12 15:03:07 +01:00
Jonas Platte d74074ad53 Remove tracing::instrument attribute from util functions
They don't ever log anything, so the extra context is never used.
2022-02-12 15:01:28 +01:00
Timo Kösters 41d3da245e Merge branch 'update_turn_readme' into 'next'
Update turn readme

See merge request famedly/conduit!292
2022-02-12 13:04:07 +00:00
Timo Kösters 0565b5a6c8 Merge branch 'show-dns-setup-error' into 'next'
Display actual error message from TokioAsyncResolver, if any

See merge request famedly/conduit!296
2022-02-12 13:01:41 +00:00
Timo Kösters f3502beb94 Merge branch 'welcome-message-command-hint' into 'next'
feat: add welcome message command hint

See merge request famedly/conduit!299
2022-02-12 12:28:53 +00:00
Timo Kösters d6b9874b35 Merge branch 'fix-admin-self-commands' into 'next'
Fix admin room processing commands from its own messages

See merge request famedly/conduit!293
2022-02-12 12:27:57 +00:00
Timo Kösters 1d01e2a077 Merge branch 'axum' into 'next'
Port from rocket to axum

See merge request famedly/conduit!263
2022-02-12 12:22:41 +00:00
Jonas Platte ce714cfd07 Bump version 2022-02-12 13:20:55 +01:00
Jonas Platte 50b24b37c2 Upgrade Ruma 2022-02-12 12:56:18 +01:00
Jonas Platte 9db0473ed5 Improve error messages in Ruma wrapper FromRequest impl 2022-02-12 12:56:08 +01:00
Jonas Platte 5d8c80b170 Strip quotes from X-Matrix fields 2022-02-12 12:56:08 +01:00
Jonas Platte 21ae63d46b Rewrite query parameter parsing 2022-02-12 12:56:08 +01:00
Jonas Platte c8951a1d9c Use axum-server for direct TLS support 2022-02-12 12:56:08 +01:00
Jonas Platte 5fa9190117 Simplify return type of most route handlers 2022-02-12 12:56:08 +01:00
Jonas Platte 77a87881c9 Add message to unsupported HTTP method panic 2022-02-12 12:56:08 +01:00
Jonas Platte 7bf538f549 Fix axum route conflicts 2022-02-12 12:56:07 +01:00
Jonas Platte a5757ab195 Generalize RumaHandler 2022-02-12 12:56:07 +01:00
Jonas Platte d1d2217019 Clean up error handling for server_server::get_server_keys_route 2022-02-12 12:56:07 +01:00
Jonas Platte 1f7b3fa4ac Port from Rocket to axum 2022-02-12 12:56:07 +01:00
Timo Kösters 8709c3ae7b Merge branch 'refactor2' into 'next'
Remove unnecessary uses of event enums

See merge request famedly/conduit!300
2022-02-12 11:50:23 +00:00
Jonas Platte 5db4c001d1 Remove another unnecessary use of an event enum 2022-02-12 01:58:47 +01:00
Jonas Platte 583ec51f9f Remove unnecessary use of event enum 2022-02-12 01:58:47 +01:00
M0dEx f602d32aaa feat: add the actual server name to the welcome message 2022-02-11 18:51:28 +01:00
M0dEx a6976e6d2d feat: add 'available' to the help command line in the welcome message 2022-02-11 18:40:51 +01:00
M0dEx f2b8aa28f3 feat: add a line with the help command to the welcome message 2022-02-11 18:26:56 +01:00
Andrej Kacian bfbefb0cd2 Display actual error message from TokioAsyncResolver, if any 2022-02-07 12:56:44 +01:00
Andrei Vasiliu 31918bb990 Fix admin room processing commands from its own messages 2022-02-05 08:57:15 +02:00
Torsten Flammiger f110b5710a Move appservice howto into whats-next; again, rename placeholder TURN url 2022-02-04 21:11:50 +01:00
Torsten Flammiger 1cc0b55650 Resolve merge conflict 2022-02-04 19:28:57 +01:00
Torsten Flammiger 63a2c6cce5 Add new TURN Readme and reference it from DEPLOY.md 2022-02-04 19:11:29 +01:00
Jonas Zohren faa0cdb595 Merge branch 'next' into 'master'
CI-Hotfix to master

See merge request famedly/conduit!290
2022-02-04 18:00:01 +00:00
Jonas Zohren 0cec421930 Merge branch 'ci-hotfix-sytest-on-master' into 'next'
fix(ci): Always build debug version for sytest

See merge request famedly/conduit!289
2022-02-04 17:51:57 +00:00
Jonas Zohren 826b077e21 fix(ci): Always build debug version for sytest 2022-02-04 18:43:13 +01:00
Timo Kösters 9c8c784fe7 Merge branch 'next' into 'master'
Release 0.3

See merge request famedly/conduit!288
2022-02-04 17:37:26 +00:00
Jonas Zohren 4dcc080ad9 Merge branch 'pre-release-doc-changes' into 'next'
Pre-0.3 doc adjustments

See merge request famedly/conduit!287
2022-02-04 17:12:33 +00:00
Timo Kösters d55992dc83 Merge branch 'jemallocfeature' into 'next'
feat: allow disabling jemalloc via feature

See merge request famedly/conduit!285
2022-02-04 17:08:03 +00:00
Jonas Zohren 103dc7e09b Pre-0.3 doc adjustments 2022-02-04 18:05:24 +01:00
Timo Kösters dffa5570e7 Merge branch 'emptysearchcrash' into 'next'
fix: crash on empty search

Closes #190

See merge request famedly/conduit!286
2022-02-04 16:42:56 +00:00
Timo Kösters dd03608f17 use our own reqwest fork 2022-02-04 17:24:45 +01:00
Timo Kösters eb0b2c429f fix: crash on empty search 2022-02-04 17:15:52 +01:00
Timo Kösters 8d8edddb2e feat: allow disabling jemalloc via feature 2022-02-04 17:00:46 +01:00
Timo Kösters f35ad27627 Merge branch 'contextfix' into 'next'
fix: lazy loading for /context

See merge request famedly/conduit!284
2022-02-04 13:45:57 +00:00
Timo Kösters 72cd52e57c fix: lazy loading for /context 2022-02-04 13:33:04 +01:00
Timo Kösters 8db7d2c025 Merge branch 'asonix/encourage-reqwest-reuse' into 'next'
Re-use a basic reqwest client in all possible cases

See merge request famedly/conduit!265
2022-02-04 11:27:41 +00:00
Timo Kösters 51cca1a60f Merge branch 'create-admin-room' into 'next'
Create admin room and hide migration messages on first run

Closes #157 and #225

See merge request famedly/conduit!282
2022-02-03 21:09:21 +00:00
Andrei Vasiliu e1c0dcb6bb Create admin room and hide migration messages on first run 2022-02-03 22:50:11 +02:00
Timo Kösters 86a9ec9f44 Merge branch 'up-ruma' into 'next'
Upgrade Ruma

See merge request famedly/conduit!281
2022-02-03 19:41:47 +00:00
Jonas Platte d23d6fbb37 Upgrade Ruma 2022-02-03 20:24:02 +01:00
Timo Kösters 2d9c5791a6 Merge branch 'rocket-config' into 'next'
Remove mutation from default_config and set default log_level to off

See merge request famedly/conduit!280
2022-02-03 19:20:49 +00:00
Jonas Platte 92571d961f Remove mutation from default_config and set default log_level to off 2022-02-03 19:55:54 +01:00
Timo Kösters 7a388f4d72 Merge branch 'command-refactor' into 'next'
Move and refactor admin commands into admin module

See merge request famedly/conduit!253
2022-02-03 18:43:54 +00:00
Andrei Vasiliu b56efcdc2a Merge remote-tracking branch 'origin/next' into command-refactor
Fixed a small conflict in admin.rs
2022-02-03 20:31:06 +02:00
Andrei Vasiliu 6399a7fe4e Remove dash from admin command help 2022-02-03 20:21:04 +02:00
Timo Kösters 79345dc2a6 Merge branch 'refactor' into 'next'
Some refactorings

See merge request famedly/conduit!279
2022-02-03 12:50:55 +00:00
Jonas Platte 974c10e739 Move Config out of database module 2022-02-03 13:30:04 +01:00
Jonas Platte ce60fc6859 Stop using set_env to configure tracing-subscriber 2022-02-03 13:24:28 +01:00
Jonas Platte abb4b4cf0b Remove TryFrom, TryInto imports
They are no longer needed in the 2021 edition.
2022-02-03 13:24:04 +01:00
Andrei Vasiliu 4bbff69a24 Merge remote-tracking branch 'origin/next' into command-refactor
Fixed conflict with commit 78502aa6b1
2022-02-03 13:12:55 +02:00
Timo Kösters b4755ba15b Merge branch 'tests' into 'next'
Bug fixes

See merge request famedly/conduit!278
2022-02-03 10:12:04 +00:00
Timo Kösters 9ef3abacd4 fix: initial state deserialize->serialize error 2022-02-03 10:57:54 +01:00
Andrei Vasiliu 87225e70c3 Parse admin command body templates from doc comments 2022-02-02 21:35:57 +02:00
Jonas Zohren 510a44699d Merge branch 'fix-healthcheck-no-port' into 'next'
Docker: Healtcheck and build fixes

Closes #222

See merge request famedly/conduit!277
2022-02-02 14:07:49 +00:00
Jonas Zohren c4733676cf Apply feedback from Ticho 2022-02-02 13:35:15 +00:00
Jonas Zohren e5bac5e4f5 fix: Running in Docker 2022-02-02 14:07:35 +01:00
Jonas Zohren 9478c75f9d Use prebuilt CI-containers from https://gitlab.com/jfowl/conduit-containers
Also run all builds on approved MRs
2022-02-02 13:31:28 +01:00
Torsten Flammiger e24d75cffc Return the ID of the appservice that was created by register_appservice 2022-02-02 13:29:10 +01:00
Torsten Flammiger 8f69f02e59 add error handling for register_appservice too 2022-02-02 13:29:09 +01:00
Torsten Flammiger da7b55b39c Cleanup appservice events after removing the appservice 2022-02-02 13:29:09 +01:00
user bfcf2db497 fix: mention dependencies to build from source 2022-02-02 13:29:09 +01:00
Timo Kösters a5f004d7e9 fix: signature mismatch on odd send_join servers 2022-02-02 13:25:31 +01:00
Jonas Zohren 004dfdeaac Merge branch 'ci-test-using-prebuilt-images' into 'next'
Use custom container images for CI

Closes #221

See merge request famedly/conduit!273
2022-02-01 23:51:38 +00:00
Jonas Zohren fa4099b138 Use prebuilt CI-containers from https://gitlab.com/jfowl/conduit-containers
Also run all builds on approved MRs
2022-02-01 23:51:38 +00:00
Timo Kösters caf9834e50 feat: cache capacity modifier 2022-02-01 14:42:13 +01:00
Timo Kösters 23aecb78c7 fix: use to_lowercase on /register/available username 2022-01-31 15:40:31 +01:00
Timo Kösters e17bbdd42d tests 2022-01-31 14:49:00 +01:00
Timo Kösters 95ca43e20f Merge branch 'cleanup_events_after_unregister_appservice' into 'next'
Cleanup events after unregister appservice / update appservice error handling / return ID of new appservice

See merge request famedly/conduit!276
2022-01-31 13:24:01 +00:00
Torsten Flammiger 28d3b348d2 Return the ID of the appservice that was created by register_appservice 2022-01-31 11:52:33 +01:00
Torsten Flammiger 78502aa6b1 add error handling for register_appservice too 2022-01-31 10:07:49 +01:00
Torsten Flammiger cc13112592 Cleanup appservice events after removing the appservice 2022-01-31 09:27:31 +01:00
Andrei Vasiliu 677f044d13 Refactor admin code to always defer command processing 2022-01-31 00:00:05 +02:00
Timo Kösters fb2a7ebf66 Merge branch 'build-dependencies-deploy' into 'next'
Mention dependencies to build from source

See merge request famedly/conduit!275
2022-01-29 08:35:54 +00:00
user 8ff95a5a48 fix: mention dependencies to build from source 2022-01-28 22:26:56 -08:00
Jonas Zohren 401b88d16d fix: Healtcheck use netstat for port as fallback 2022-01-28 23:23:58 +01:00
Jonas Zohren 8c1cf733b5 Merge branch 'fix-healthcheck-no-port' into 'next'
fix: Use default port for healthcheck as fallback

Closes #222

See merge request famedly/conduit!274
2022-01-28 21:48:25 +00:00
Jonas Zohren 44f7a85077 fix: Use default port for healthcheck as fallback
Conduit can start without a specific port being configured.
This adjusts the healthcheck script to tolerate that state.

Closes https://gitlab.com/famedly/conduit/-/issues/222
2022-01-28 22:33:49 +01:00
Aode (lion) b39ddf7be9 Rename reqwest clients, mention cheap client clones in comment 2022-01-28 12:42:47 -06:00
Jonas Platte 296c68c0cd Merge branch 'get-thumbnail-mxc-as-ref' into 'next'
Do not copy mxc string unnecessarily in db.get_thumbnail()

See merge request famedly/conduit!272
2022-01-27 17:14:42 +00:00
Andrej Kacian 529e88c7f9 Do not copy mxc string unnecessarily in db.get_thumbnail() 2022-01-27 17:47:09 +01:00
Aode (lion) 1059f35fdc use pre-constructed client for well-known requests also 2022-01-27 10:37:04 -06:00
Aode (Lion) f8d1c1a8af Re-use a basic request in all possible cases 2022-01-27 10:37:04 -06:00
Timo Kösters 20006c91af Merge branch 'media-download-followup' into 'next'
Media download followup

See merge request famedly/conduit!271
2022-01-27 16:24:15 +00:00
Andrej Kacian 0f6d232cb1 Style fixes from 'cargo fmt' 2022-01-27 17:13:33 +01:00
Andrej Kacian ccfc243c2c Make get_remote_content() return Result instead of ConduitResult 2022-01-27 17:13:07 +01:00
Timo Kösters f7148def90 Merge branch 'up-ruma' into 'next'
Upgrade Ruma

See merge request famedly/conduit!268
2022-01-27 15:46:00 +00:00
Timo Kösters 63309e52f8 Merge branch 'media-download-with-filename' into 'next'
Media download with filename

See merge request famedly/conduit!266
2022-01-27 15:44:56 +00:00
Andrej Kacian c4317a7a96 Reduce code duplication in media download route handlers 2022-01-27 16:32:19 +01:00
Jonas Platte 9c2000cb89 Upgrade Ruma 2022-01-27 16:25:42 +01:00
Andrej Kacian 52873c88b7 Fix incorrect HTTP method in doc comments of two media routes 2022-01-27 00:31:44 +01:00
Andrej Kacian 8472eff277 Implement media download with custom filename 2022-01-27 00:31:44 +01:00
Jonas Zohren ba8d5abb67 Merge branch 'fix/sccache' into 'next'
Fix CI cargo-cross caching with sccache

See merge request famedly/conduit!264
2022-01-26 18:54:13 +00:00
Maxim De Clercq ff16729976 fix: correct RUSTC_WRAPPER path in cross container 2022-01-26 00:02:03 +01:00
Maxim De Clercq acf1585fc3 fix: make sure that libatomic is linked statically 2022-01-24 11:45:07 +01:00
Maxim De Clercq 067fcfc0e4 fix: remove trailing slash from shared path 2022-01-23 22:51:02 +01:00
Maxim De Clercq 77ad4cb8f8 fix: use readelf for checking static compilation 2022-01-23 22:51:02 +01:00
Maxim De Clercq 64c25ea4a1 fix: always print ELF information 2022-01-23 18:38:33 +01:00
Maxim De Clercq c7560b3502 fix: remove libgcc dependency in ci builds since the binary is ensured to be statically compiled 2022-01-23 18:09:14 +01:00
Maxim De Clercq c2ad2b3dd7 fix: pass sccache variables to cross container with build.env.passthrough 2022-01-23 17:43:28 +01:00
Maxim De Clercq 219dfbabd5 fix: pass RUSTC_WRAPPER to the cross container and enforce static builds 2022-01-23 17:31:12 +01:00
Jonas Zohren 4a34d757d7 Merge branch 'fix/rocksdb-cross-compiling' into 'next'
Fix cross-compiling for RocksDB

Closes #213

See merge request famedly/conduit!261
2022-01-23 15:58:27 +00:00
Maxim De Clercq fd67cd7450 feat: support targetting i686 2022-01-23 15:58:19 +01:00
Maxim De Clercq cd9902637d feat: use rustembedded/cross images and use static relocation model to fix cross-compile 2022-01-23 14:41:39 +01:00
Andrei Vasiliu 7505548b94 Merge remote-tracking branch 'refs/remotes/origin/next' into command-refactor
Resolved conflict for the new list_local_users command
2022-01-22 14:29:50 +02:00
Timo Kösters f50bdb6010 Merge branch 'list_local_users' into 'next'
Implement list_local_users command

See merge request famedly/conduit!260
2022-01-22 09:33:32 +00:00
Maxim De Clercq a021680591 fix: make sure libatomic is always linked because it's skipped on arm targets 2022-01-22 01:14:36 +01:00
Maxim De Clercq 3e9abfedb4 fix: make sure libstdc++ is linked statically when cross-compiling 2022-01-22 00:14:19 +01:00
Timo Kösters b634f9d45c Merge branch 'reqwestfix' into 'next'
improvement: use jemalloc for lower memory usage

See merge request famedly/conduit!262
2022-01-21 16:54:35 +00:00
Timo Kösters f88523988e improvement: use jemalloc for lower memory usage 2022-01-21 17:54:05 +01:00
Maxim De Clercq bfef94f5f4 fix: linking against libatomic is no longer required since the library path is fixed 2022-01-21 17:26:25 +01:00
Maxim De Clercq d94f3c1e9a fix: make sure cc-rs and bindgen use the correct paths when cross-compiling 2022-01-21 17:06:15 +01:00
Timo Kösters 4ef995cf7d Merge branch 'next' into 'next'
Add heisenbridge to tested appservices

See merge request famedly/conduit!250
2022-01-21 15:43:40 +00:00
Reiner Herrmann 97d56af5bd Add heisenbridge to tested appservices 2022-01-21 16:40:03 +01:00
Andrei Vasiliu 57979da28c Change structopt to clap, remove markdown dependency 2022-01-21 17:35:26 +02:00
Timo Kösters 58da67e59e Merge branch 'mautrix-signal-support' into 'next'
Add mautrix-signal to tested appservices

See merge request famedly/conduit!251
2022-01-21 15:33:10 +00:00
Timo Kösters 5d3ba5c628 Merge branch 'WIP_persy_batch_next' into 'next'
feat: Integration with persy using background ops

See merge request famedly/conduit!231
2022-01-21 15:31:46 +00:00
Torsten Flammiger 960ba8bd99 Merged current next 2022-01-21 14:32:59 +01:00
Torsten Flammiger ba6d72f3f9 Reformatted 2022-01-21 14:28:07 +01:00
Andrei Vasiliu cc3ef1a8be Improve help text for admin commands 2022-01-21 11:13:24 +02:00
Andrei Vasiliu f244c0e2ce Merge remote-tracking branch 'refs/remotes/origin/next' into command-refactor 2022-01-21 10:19:17 +02:00
Andrei Vasiliu e378bc4a2c Refactor admin commands to use structopt 2022-01-21 10:17:50 +02:00
Timo Kösters ab4f3bd06c Merge branch 'lib-main' into 'next'
Clean up mod and use statements in lib.rs and main.rs

See merge request famedly/conduit!258
2022-01-20 12:32:39 +00:00
Jonas Platte 8d81c1c072 Use MSRV for build CI jobs
The test job will use the latest stable so all stable lints are included.
2022-01-20 13:23:58 +01:00
Jonas Platte 6bb1081b71 Use BTreeMap::into_values
Stable under new MSRV.
2022-01-20 13:19:51 +01:00
Jonas Platte ff5fec9e74 Raise minimum supported Rust version to 1.56 2022-01-20 13:19:51 +01:00
Jonas Platte 5afb27a5a9 Use latest stable for Docker image 2022-01-20 12:29:24 +01:00
Jonas Platte 6e322716ca Delete rust-toolchain file 2022-01-20 12:29:10 +01:00
Jonas Platte 756a41f22d Fix rustc / clippy warnings 2022-01-20 00:10:39 +01:00
Jonas Platte a0fc5eba72 Remove unnecessary Result 2022-01-19 23:57:22 +01:00
Timo Kösters cc0f094ff7 Merge branch 'rocksdbbreaks' into 'next'
Rocksdb breaking change. If your server breaks, come to #conduit:fachschaften.org

See merge request famedly/conduit!259
2022-01-19 06:17:57 +00:00
Timo Kösters d4eb3e3295 fix: rocksdb does not use zstd compression unless we disable everything else 2022-01-19 07:09:25 +01:00
Jonas Platte c6277c72a1 Fix warnings in database::abstraction 2022-01-18 21:05:40 +01:00
Jonas Platte 13a48c4577 Clean up mod and use statements in lib.rs and main.rs 2022-01-18 21:04:44 +01:00
Timo Kösters b2ffc4e496 Merge branch 'maxopenfiles' into 'next'
Server ACL support and more config options

Closes #67

See merge request famedly/conduit!248
2022-01-18 09:05:57 +00:00
Timo Kösters 53de350908 fix: less load when lazy loading 2022-01-17 23:24:27 +01:00
Torsten Flammiger fd6427a83f Update/Revert code comment 2022-01-17 22:34:34 +01:00
Torsten Flammiger fc39b3447c Little bit of refactoring 2022-01-17 19:43:45 +01:00
Torsten Flammiger 4aefc29650 Merge branch 'list_local_users_test' into list_local_users 2022-01-17 19:20:11 +01:00
Timo Kösters 03b174335c improvement: lower default pdu cache capacity 2022-01-17 14:46:53 +01:00
Timo Kösters 8c90e7adfb refactor: fix warnings 2022-01-17 14:46:03 +01:00
Timo Kösters ee8e72f7a8 feat: implement server ACLs 2022-01-17 14:35:38 +01:00
Jonas Zohren 24aa034e48 Merge branch 'ci-fix-cargo-test-missing-libclang' into 'next'
CI: Fix cargo-test

See merge request famedly/conduit!255
2022-01-16 20:57:23 +00:00
Jonas Zohren 10f1da12bf CI: Fix cargo-test 2022-01-16 20:57:23 +00:00
Torsten Flammiger 50430cf4ab Name function after command: list_local_users 2022-01-16 21:22:57 +01:00
Torsten Flammiger 52284ef9e2 Add some debug/info if user was found 2022-01-16 20:25:16 +01:00
Torsten Flammiger 3e79d15495 Updated function documentation 2022-01-16 20:15:53 +01:00
Andrei Vasiliu 13ae036ca0 Move and refactor admin commands into admin module 2022-01-16 13:52:23 +02:00
Torsten Flammiger 9205c07048 Update get_local_users description 2022-01-15 22:37:39 +01:00
Torsten Flammiger c03bf6ef11 name the function after its purpose: iter_locals -> get_local_users 2022-01-15 22:20:51 +01:00
Julius de Bruijn 217e378992 Add mautrix-signal to tested appservices 2022-01-15 17:34:13 +00:00
Torsten Flammiger 91eb6c4d08 Return a Result instead of a vector 2022-01-15 17:10:23 +01:00
Torsten Flammiger fb19114bd9 rename iter_locals to get_local_users; make get_local_users skip on parse errors; remove deprecated function count_local_users 2022-01-15 15:52:47 +01:00
Tglman c1cd4b5e26 chore: set the released version of persy in Cargo.toml 2022-01-15 14:17:15 +00:00
Tglman f9977ca64f fix: changes to update to the last database engine trait definition 2022-01-15 14:17:15 +00:00
Tglman 1cc41937bd refactor:use generic watcher in persy implementation 2022-01-15 14:17:15 +00:00
Tglman ab15ec6c32 feat: Integration with persy using background ops 2022-01-15 14:17:15 +00:00
Timo Kösters d434dfb3a5 feat: config option for rocksdb max open files 2022-01-14 11:44:20 +01:00
Timo Kösters 5b8d2a736e Merge branch 'default' into 'next'
improvement: better default cache capacity

See merge request famedly/conduit!247
2022-01-14 10:44:06 +00:00
Timo Kösters 80e51986c4 improvement: better default cache capacity 2022-01-14 11:08:31 +01:00
Jonas Zohren 8fc51f0029 Merge branch 'ci-cargo-home-workaround' into 'next'
Fix(ci): Disable CARGO_HOME caching

See merge request famedly/conduit!246
2022-01-13 22:24:47 +00:00
Jonas Zohren f67785caaf Fix(ci): Disable CARGO_HOME caching 2022-01-13 22:24:47 +00:00
Timo Kösters 1119c2f510 Merge branch 'rocksdb' into 'next'
feat: rocksdb backend

See merge request famedly/conduit!217
2022-01-13 22:12:51 +00:00
Timo Kösters 16f826773b refactor: fix warnings 2022-01-13 22:55:35 +01:00
Timo Kösters 6fa01aa982 fix: remove dbg 2022-01-13 22:44:27 +01:00
Timo Kösters a336027b0e fix: better memory usage message 2022-01-13 22:44:27 +01:00
Timo Kösters 447639054e improvement: higher default pdu capacity 2022-01-13 22:44:27 +01:00
Timo Kösters 9e77f7617c fix: disable direct IO again 2022-01-13 22:44:27 +01:00
Timo Kösters 7f27af032b improvement: optimize rocksdb for spinning disks 2022-01-13 22:44:26 +01:00
Timo Kösters b96822b617 fix: use db options for column families too 2022-01-13 22:44:26 +01:00
Timo Kösters 0bb7d76dec improvement: rocksdb configuration 2022-01-13 22:44:26 +01:00
Timo Kösters 077e9ad438 improvement: memory usage for caches 2022-01-13 22:44:25 +01:00
Andrej Kacian 68ee1a5408 Add rocksdb implementation of memory_usage() 2022-01-13 22:42:25 +01:00
Andrej Kacian ff243870f8 Add "database_memory_usage" AdminCommand 2022-01-13 22:42:24 +01:00
Andrej Kacian 71431f330a Add memory_usage() to DatabaseEngine trait 2022-01-13 22:42:24 +01:00
Timo Kösters fa6d7f7ccd feat: database backend selection at runtime 2022-01-13 22:42:22 +01:00
Timo Kösters 4f39d36e98 docs: lazy loading 2022-01-13 22:38:52 +01:00
Timo Kösters c6d88359d7 fix: incremental lazy loading 2022-01-13 22:38:52 +01:00
Timo Kösters f285c89006 fix: make incremental sync efficient again 2022-01-13 22:38:52 +01:00
Timo Kösters 93d225fd1e improvement: faster way to load required state 2022-01-13 22:38:52 +01:00
Timo Kösters 1bd9fd74b3 feat: partially support sync filters 2022-01-13 22:38:52 +01:00
Timo Kösters 68e910bb77 feat: lazy loading 2022-01-13 22:38:50 +01:00
Timo Kösters 5bcc1324ed fix: auth event fetch order 2022-01-13 22:29:19 +01:00
Timo Kösters 54f4d39e3e improvement: don't fetch event multiple times 2022-01-13 22:29:17 +01:00
Timo Kösters b1d9ec3efc fix: atomic increment 2022-01-13 22:28:18 +01:00
Timo Kösters ee3d2db8e0 improvement, maybe not safe 2022-01-13 22:10:51 +01:00
Timo Kösters 83a9095cdc fix? 2022-01-13 22:10:51 +01:00
Timo Kösters 74951cb239 dbg 2022-01-13 22:10:51 +01:00
Timo Kösters 4b4afea2ab fix auth event fetching 2022-01-13 22:10:51 +01:00
Timo Kösters c9c9974641 fix: stack overflows when fetching auth events 2022-01-13 22:10:50 +01:00
Timo Kösters a30b588ede rocksdb as default 2022-01-13 22:10:50 +01:00
Timo Kösters 1d647a1a9a improvement: allow rocksdb again 2022-01-13 22:10:43 +01:00
Timo Kösters b25354c747 Merge branch 'add_remove_appservice' into 'next'
Add ability to remove an appservice

See merge request famedly/conduit!236
2022-01-13 11:38:17 +00:00
Torsten Flammiger eecd664c43 Reformat code 2022-01-13 12:26:23 +01:00
Timo Kösters f3ea2df9fe Merge branch 'simpler-traefik-nginx' into 'next'
Make traefik+nginx config more self-contained

See merge request famedly/conduit!239
2022-01-13 11:18:15 +00:00
Timo Kösters fbcbadf265 Merge branch 'rust-1.53' into 'next'
Restore compatibility with Rust 1.53

See merge request famedly/conduit!244
2022-01-13 11:09:14 +00:00
Jonas Platte bcf4ede0bc Restore compatibility with Rust 1.53 2022-01-13 12:06:20 +01:00
Timo Kösters f5d1dda766 Merge branch 'up-ruma' into 'next'
Upgrade Ruma

See merge request famedly/conduit!243
2022-01-13 10:52:13 +00:00
Jonas Platte 84862352ba Replace to_string calls on string literals with to_owned 2022-01-13 11:48:40 +01:00
Jonas Platte cf54185a1c Use struct literals for consistency 2022-01-13 11:48:18 +01:00
Jonas Platte 349865d3cc Upgrade Ruma 2022-01-13 11:44:23 +01:00
Timo Kösters 2fa8171e79 Merge branch 'ci-use-sccache' into 'next'
CI: Use sccache for caching

Closes #200

See merge request famedly/conduit!232
2022-01-13 10:42:33 +00:00
Timo Kösters 8e12b47df4 Merge branch 'no-passwords-in-db' into 'next'
Do not store uiaa requests in database

See merge request famedly/conduit!219
2022-01-13 10:33:49 +00:00
Timo Kösters 0ec26b7e96 Merge branch 'next' into 'next'
refactor:moved key watch wake logic to specific module

See merge request famedly/conduit!238
2022-01-13 10:27:56 +00:00
Timo Kösters b32e85ffa8 Merge branch 'up-ruma' into 'next'
Upgrade Ruma

See merge request famedly/conduit!237
2022-01-13 10:24:45 +00:00
Ticho 34782694 b746f17e56 Make traefik+nginx config more self-contained
The nginx instance which is serving the .well-known endpoints can serve
the simple JSON replies directly from memory, instead of having them
as external files on disk.
2022-01-07 13:06:21 +00:00
Torsten Flammiger 8d51359668 Fix typo and remove unneeded newline 2021-12-26 20:49:19 +01:00
Torsten Flammiger a69eb277d4 Update count users: It's now list_local_users and contains the number and the usernames 2021-12-26 20:00:31 +01:00
Torsten Flammiger 39787b41cb Rename admin command CountUsers -> CountLocalUsers; Update comments 2021-12-26 12:04:38 +01:00
Torsten Flammiger 2281bcefc6 Finalize count_local_users function 2021-12-26 11:06:28 +01:00
Torsten Flammiger d21030566c Rename/Add count methods to count_local_users 2021-12-25 21:29:03 +01:00
Torsten Flammiger 567cf6dbe9 Add command count_local_users to database/rooms.rs 2021-12-25 20:51:22 +01:00
Torsten Flammiger 7c1b2625cf Prepare to add an option to list local user accounts from your homeserver 2021-12-24 23:06:54 +01:00
Tglman a889e884e6 refactor:moved key watch wake logic to specific module 2021-12-23 23:17:43 +00:00
Jonas Platte aba95b20f3 Upgrade Ruma 2021-12-23 17:40:42 +01:00
Moritz Bitsch c4a438460e Use Box to store UserID and DeviceID
Userid and DeviceID are of unknown size, use Box to be able to store
them into the userdevicesessionid_uiaarequest BTreeMap
2021-12-22 19:26:23 +01:00
Torsten Flammiger 7f2445be6c On unregister_appservice(service_name), remove the appservice service_name from cache too 2021-12-22 16:48:27 +01:00
Torsten Flammiger b6c9582cf4 Fix doc style comment according to Rust; VSCode added line breaks 2021-12-22 13:09:56 +01:00
Torsten Flammiger 7857da8a0b Add ability to remove an appservice 2021-12-20 15:46:36 +01:00
Moritz Bitsch 720a54b3bb Use String to store UserId for uiaa request
Fixes compilation error after ruma upgrade
2021-12-18 19:05:18 +01:00
Moritz Bitsch 0725b69abb Clean up userdevicesessionid_uiaarequest BTreeMap
There is no need to encode or decode anything as we are not
saving to disk
2021-12-18 18:57:36 +01:00
Moritz Bitsch fe8cfe0556 Add database migration to remove stored passwords
uiaarequests can contain plaintext passwords, which were stored on disk
2021-12-18 18:57:36 +01:00
Moritz Bitsch 3d25d46dc5 Use simple BTreeMap to store uiaa requests
some uiaa requests contain plaintext passwords which should never be
persisted to disk.

Currently there is no cleanup implemented (you have to restart conduit)
2021-12-18 18:57:36 +01:00
Timo Kösters 9b57c89df6 Merge branch 'more-event-id-arcs' into 'next'
Use Arc for EventIds in PDUs

See merge request famedly/conduit!229
2021-12-16 13:06:30 +00:00
Jonas Platte 34d3f74f36 Use Arc for EventIds in PDUs
Upgrades Ruma again to make this work.
2021-12-16 13:55:24 +01:00
Timo Kösters 11a21fc136 Merge branch 'up-ruma' into 'next'
Upgrade ruma

See merge request famedly/conduit!228
2021-12-15 14:22:30 +00:00
Jonas Platte 0183d003d0 Revert rename of Ruma<_> parameters 2021-12-15 13:58:25 +01:00
Jonas Platte f712455047 Reduce EventId copying 2021-12-15 13:00:37 +01:00
Jonas Platte 58ea081762 Use int! macro instead of Int::from 2021-12-15 13:00:37 +01:00
Jonas Platte bffddbd487 Simplify identifier parsing code 2021-12-15 13:00:37 +01:00
Jonas Platte 41fef1da64 Remove unnecessary .to_string() calls 2021-12-15 13:00:37 +01:00
Jonas Platte 892a0525f2 Upgrade Ruma 2021-12-15 13:00:37 +01:00
Jonas Platte 1fc616320a Use struct init shorthand 2021-12-15 13:00:37 +01:00
Timo Kösters 14a178d783 Merge branch 'update-docker-base-image' into 'next'
Update docker images

See merge request famedly/conduit!230
2021-12-15 10:14:20 +00:00
Jonas Zohren 339a26f56c Update docker images 2021-12-15 10:14:20 +00:00
Jonas Zohren adb518fa0d CI: Use curl instead of wget
The rust docker image already comes with curl, no need to install wget.
2021-12-14 11:16:40 +01:00
Jonas Zohren f91216dd3c CI: Optionally use sccache for compilation
This moves compiler caching for incremental builds away from GitLab
caching the whole target/ folder to caching each code unit in S3.
This aleviates the need to zip and unzip and just caches on the fly.

This feature is optional and gated behind the SCCACHE_BIN_URL env
2021-12-14 11:16:02 +01:00
Timo Kösters ca724b6340 Merge branch '226-fix-docker-ci-issues' into 'next'
Fixes for !225

See merge request famedly/conduit!226
2021-11-25 22:36:44 +00:00
Jonas Zohren 9bfc7b34b6 Fixes for !225 2021-11-25 22:36:44 +00:00
Timo Kösters afa5d449c6 Merge branch 'better-multiarch-building-the-second-attempt' into 'next'
CI: New Multiarch builds and Docker images + cargo clippy/test output now integrated into GitLab

Closes #145

See merge request famedly/conduit!225
2021-11-21 17:34:09 +00:00
Jonas Zohren 2fff720df3 CI: New Multiarch builds and Docker images + cargo clippy/test output now integrated into GitLab 2021-11-21 17:34:08 +00:00
Timo Kösters da00f611e9 Merge branch 'feature/turn-server-settings' into 'next'
Implement turn server settings

Closes #97

See merge request famedly/conduit!208
2021-11-19 16:39:24 +00:00
Moritz Bitsch 9fccbb014a Implement TURN server authentication with hmac
This is a prefered method to allow limited access to the TURN server
2021-11-12 12:43:15 +00:00
Moritz Bitsch 109892b4b7 Implement turn server settings
this fills out the infos in /_matrix/client/r0/voip/turnServer with
values specified in the server config
2021-11-12 12:43:15 +00:00
Jonas Platte 24a835647c Merge branch 'nyaaori/fix-room-creation' into 'next'
Make createRoom follow spec for m.room.create, allowing creation of spaces

See merge request famedly/conduit!220
2021-11-09 16:34:51 +00:00
Nyaaori c4bce1d0c7 Cleanup room.rs; replace unwraps with map_err 2021-11-09 16:12:44 +00:00
Jonas Platte 9b63708685 Merge branch 'nyaaori/fix-join-panic' into 'next'
Fix join panic bug

See merge request famedly/conduit!224
2021-11-09 14:46:28 +00:00
Nyaaori 86177faae7 Fix join panic bug 2021-11-07 07:57:15 +00:00
Timo Kösters 2a749c1e99 Merge branch 'nyaaori/implement-report' into 'next'
Implement the report feature

Closes #13

See merge request famedly/conduit!218
2021-11-03 14:17:32 +00:00
Timo Kösters 5ae753b2e7 Merge branch 'amorgan-next-patch-81816' into 'next'
Add 'Federation publicRoom Name/topic keys are correct' test to sytest whitelist

See merge request famedly/conduit!221
2021-10-27 11:49:55 +00:00
Andrew Morgan 743bdbe961 Add 'Federation publicRoom Name/topic keys are correct' test to sytest whitelist 2021-10-26 13:30:02 +00:00
Nyaaori d5d25fb064 Preserve all m.room.create entries when performing room upgrades 2021-10-24 22:13:08 +00:00
Nyaaori 8087a26a35 Make createRoom follow spec for m.room.create, allowing creation of spaces 2021-10-24 20:26:51 +00:00
Nyaaori bbe16f8467 Update Ruma 2021-10-24 00:45:02 +00:00
Nyaaori 50f931a2fd Cleanup and fix validation in report.rs, lower max report length, better html 2021-10-20 11:12:06 +00:00
Nyaaori 1541b93f45 Make reports look nicer and reduce spam potential, increase max report length to 1000 characters 2021-10-18 05:38:41 +00:00
Nyaaori ccf501a420 Initial implementation of /report, fixing #13 2021-10-18 04:51:11 +00:00
Timo Kösters 6f70beb78c Merge branch 'nyaaori/fix-bad-json' into 'next'
Nyaaori/fix bad json

Closes #115

See merge request famedly/conduit!216
2021-10-16 06:59:34 +00:00
Timo Kösters 259fc580ca Merge branch 'nyaaori/otk-sync-fix' into 'next'
Remove device_one_time_keys_count from is_empty() sync checks, fixing sync issue as reported by Nekron

Closes #115

See merge request famedly/conduit!215
2021-10-16 06:54:14 +00:00
Nyaaori 55d78b1914 Bump Ruma version to fix M_BAD_JSON on login 2021-10-16 00:45:51 +00:00
Nyaaori 484a044b50 Remove device_one_time_keys_count from is_empty() sync checks, fixing sync issue as reported by Nekron 2021-10-15 23:17:08 +00:00
Nyaaori 2264a5f945 Merge branch 'next' of https://gitlab.com/famedly/conduit into next 2021-10-15 23:14:07 +00:00
Timo Kösters e88929e154 Merge branch 'nyaaori/fix-otk-reporting' into 'next'
Always send device_one_time_keys_count, fixing #178

Closes #169 and #178

See merge request famedly/conduit!213
2021-10-15 13:01:52 +00:00
Nyaaori d996d1b0e6 Always send device_one_time_keys_count, fixing #178 2021-10-15 12:38:20 +00:00
Timo Kösters dc8bc4a880 Merge branch 'up-ruma' into 'next'
Upgrade Ruma

See merge request famedly/conduit!210
2021-10-15 11:38:12 +00:00
Timo Kösters 87694f4369 Merge branch 'moa31-next-patch-76037' into 'next'
Change listen address when running inside a Container to prevent Bad Gateway error

See merge request famedly/conduit!207
2021-10-15 10:51:19 +00:00
Timo Kösters 335027e739 Merge branch 'nyaaori/admin-check' into 'next'
Implement admin check and add config option for allowing room creation

See merge request famedly/conduit!211
2021-10-15 10:47:55 +00:00
Timo Kösters 0ccda5f1c7 Merge branch 'nyaaori/allow_encryption' into 'next'
Make allow_encryption work again, fixing #115

Closes #115

See merge request famedly/conduit!212
2021-10-15 10:20:05 +00:00
Nyaaori 9082a531c9 Make allow_encryption work again, fixing #115 2021-10-15 09:57:49 +00:00
Jonas Platte 91afa1e0e0 Make Result alias usable with any error type 2021-10-13 12:25:58 +02:00
Jonas Platte f2ef5677e0 Reduce turbofish usage
Should make the code a little bit easier to read.
2021-10-13 12:25:58 +02:00
Jonas Platte 1c4d9af586 Enable more lints and apply their suggestions 2021-10-13 10:24:39 +02:00
Jonas Platte 09895a20c8 Upgrade Ruma
Co-authored-by: Timo Kösters <timo@koesters.xyz>
2021-10-13 10:16:45 +02:00
Nyaaori 636db8cfaa Make allow_encryption work again, fixing #115 2021-09-24 22:44:26 +00:00
Nyaaori 6bc8fb2ae7 Implement admin check and add config option for allowing room creation 2021-09-24 07:16:34 +00:00
Luc-pascal Ceccaldi 5b23d3d06e Change listen address when running inside a Container to prevent Bad Gateway error 2021-09-23 07:49:52 +00:00
Timo Kösters 47f3263396 Merge branch 'gwmngilfen-next-patch-21674' into 'next'
Add two flavours of change for the mautrix-signal patch

See merge request famedly/conduit!197
2021-09-15 20:31:21 +00:00
Greg Sutcliffe d38f9b5f01 Move Generic instructions for APPSERVICES above notes for specific bridges and tidy up. 2021-09-15 21:16:25 +01:00
Greg Sutcliffe fa616342b6 Add two flavours of change for the mautrix-signal patch 2021-09-15 21:16:25 +01:00
Timo Kösters 34fa7fee05 Merge branch 'ci-fix-kaniko-i-hope' into 'next'
fix(ci): Convince kaniko that it is indeed running in a container by --force-ing it.

See merge request famedly/conduit!205
2021-09-15 07:05:33 +00:00
Jonas Zohren e8d998cedf fix(ci): Convince kaniko that it is indeed running in a container by --force-ing it. 2021-09-14 20:44:11 +00:00
Timo Kösters 565fe3a7dd Merge branch 'faster-sending' into 'next'
improvement: batch inserts for inserting pdus

See merge request famedly/conduit!204
2021-09-14 18:35:12 +00:00
Timo Kösters 5c02dc7830 improvement: batch inserts for inserting pdus 2021-09-14 14:33:46 +02:00
Timo Kösters 159e22e450 Merge branch 'ci-fix-aarch64-build' into 'next'
fix(ci): Fix aarch64 build

See merge request famedly/conduit!203
2021-09-14 12:09:44 +00:00
Jonas Zohren ab472e9b7c fix(ci): Fix aarch64 build
gcc-8-aarch64-linux-gnu is not available in debian 11 (which the rust image uses), so update to gcc-10

Signed-off-by: Jonas Zohren <git-pbkyr@jzohren.de>
2021-09-14 12:32:07 +02:00
Timo Kösters 31264e3d1d Merge branch 'ci-remove-element-web-register-test' into 'next'
Remove the "register an account with element" test

See merge request famedly/conduit!202
2021-09-14 09:50:24 +00:00
Jonas Zohren 422bd09e32 Remove the "register an account with element" test
Broke due to a timeout and Timo does not like broken tests.
Less testing means less failing tests.

Also, hopefully sytest is less broken now.
2021-09-14 09:44:15 +00:00
Timo Kösters b64538c6f1 Merge branch 'efficient-sqlite' into 'next'
improvement: more efficient sqlite

See merge request famedly/conduit!199
2021-09-14 07:23:02 +00:00
Timo Kösters 178451e9b5 Merge branch 'deduplicate-watchers' into 'next'
improvement: deduplicate watchers

See merge request famedly/conduit!201
2021-09-14 07:10:59 +00:00
Timo Kösters 583a966f6e Merge branch 'less-alloc' into 'next'
Reduce allocations in server_server

See merge request famedly/conduit!190
2021-09-14 07:09:55 +00:00
Timo Kösters cbee7fe111 improvement: deduplicate watchers 2021-09-13 23:20:30 +02:00
Jonas Platte d68c93b5fa Clean up (mostly automated with cargo clippy --fix) 2021-09-13 20:58:58 +02:00
Jonas Platte 979ec6b4fa Upgrade ruma 2021-09-13 20:55:13 +02:00
Jonas Platte 910ad7fed1 Get rid of more unnecessary intermediate collections 2021-09-13 20:55:12 +02:00
Timo Kösters 2c8412fe58 improvement: more efficient sqlite 2021-09-13 20:12:42 +02:00
Timo Kösters 06b0c9267f Merge branch 'appservice-signal' into 'next'
Add mautrix-signal appservice instructions

See merge request famedly/conduit!196
2021-09-13 14:07:18 +00:00
Daniel Wiesenberg 00927a7ce3 Add mautrix-signal appservice instructions 2021-09-09 10:02:11 +02:00
Timo Kösters 4aacafc298 Merge branch 'roomidshort-fix' into 'next'
fix sync not firing on new events in room

See merge request famedly/conduit!194
2021-09-08 13:39:05 +00:00
Jonathan de Jong 23c5ec8099 fix sync not firing on new events in room 2021-09-08 14:50:44 +02:00
Timo Kösters 562a2524d7 Merge branch 'db-errors' into 'next'
fix(database): handle errors in config parsin or database creation

Closes #121

See merge request famedly/conduit!193
2021-09-08 09:53:25 +00:00
Rasmus Thomsen 51245d34f1 fix(database): handle errors in config parsin or database creation
Showing the user a backtrace can be pretty confusing, so just printing
a nice error message makes errors easier to understand for end users.

fixes #121
2021-09-08 09:08:45 +01:00
Timo Kösters 4a773a1096 Merge branch 'rm-unused-deps' into 'next'
Remove unused dependencies

See merge request famedly/conduit!192
2021-09-07 14:00:27 +00:00
Jonas Platte 5821b8e705 Remove unused dependencies 2021-09-07 15:41:01 +02:00
Timo Kösters 0737bc021f Merge branch 'charludo-next-patch-31617' into 'next'
apache2 sample-config error

See merge request famedly/conduit!191
2021-09-06 18:38:38 +00:00
charludo 487046571c These lines get *generated* by certbot. Having them in the file before running certbot results in an apache2 error, and putting them in afterwards is not necessary, since certbot places them there on its own. 2021-09-06 18:35:35 +00:00
Timo Kösters 2d242523fc Merge branch 'next' into 'next'
Fix deprecated/removed Traefik label

See merge request famedly/conduit!189
2021-09-03 20:56:21 +00:00
Daniel Wiesenberg bbe36810ec Fix deprecated/removed Traefik label 2021-09-03 21:51:17 +02:00
Timo Kösters a449b1d73f Merge branch 'fix-old-events' into 'next'
fix: make sure old events don't sneek into the timeline

See merge request famedly/conduit!188
2021-09-03 09:47:24 +00:00
Timo Kösters 71341ea05a fix: make sure old events don't sneek into the timeline 2021-09-03 11:26:15 +02:00
Timo Kösters 73b764322f Merge branch 'adjust-ci-for-next-and-master-development' into 'master'
CI: Adjust CI for master and next branch development model (master)

See merge request famedly/conduit!187
2021-09-02 18:25:57 +00:00
Jonas Zohren a1f51440e2 chore(CI): Adjust CI for master and next branch development model
- Build release builds for branches "master" and "next"
- Push docker images under different tags, depending on why the pipeline started
  - branch master: push to `latest`
  - branch next: push to `next`
  - tag: push to `$TAG_NAME`

Signed-off-by: Jonas Zohren <git-pbkyr@jzohren.de>
2021-09-02 17:17:51 +02:00
Timo Kösters 0d6ae2e1e7 Merge branch 'thanks' into 'master'
docs: add thanks to

See merge request famedly/conduit!185
2021-09-02 11:10:23 +00:00
Timo Kösters d0baca44f8 docs: add thanks to 2021-09-02 13:05:19 +02:00
Timo Kösters 5536bfdca5 Merge branch 'ci-also-run-for-tags' into 'master'
Also run CI on git tags, not only new commits.

See merge request famedly/conduit!184
2021-09-02 07:33:25 +00:00
Jonas Zohren 3357bbec1e chore: Also run CI on git tags, not only new commits.
Signed-off-by: Jonas Zohren <git-pbkyr@jzohren.de>
2021-09-02 09:17:25 +02:00
Timo Kösters 102ff574ea Merge branch 'readme' into 'master'
docs: update readme and version

See merge request famedly/conduit!180
2021-09-01 21:28:28 +00:00
Timo Kösters 2770ce2cf6 fix: avoid panic 2021-09-01 23:00:24 +02:00
Timo Kösters 7cd7f1923f chore: update dependencies 2021-09-01 22:31:25 +02:00
Timo Kösters 43d693ca19 revert Arc<EventId> commit 2021-09-01 22:30:11 +02:00
Timo Kösters 875b345a5f docs: update readme and version 2021-09-01 22:18:19 +02:00
Timo Kösters 17adf096e9 Merge branch 'server-server-opt' into 'master'
Remove unneeded intermediary container collection

See merge request famedly/conduit!183
2021-09-01 20:02:37 +00:00
Jonas Platte 487601a249 Remove unneeded intermediary container collection 2021-09-01 21:46:05 +02:00
Timo Kösters 27788af022 Merge branch 'batch_keys' into 'master'
Get required keys in batch when joining a room

See merge request famedly/conduit!182
2021-09-01 19:12:21 +00:00
Timo Kösters 4b39d7cb64 fix: batch key fetching 2021-09-01 20:02:34 +02:00
Kurt Roeckx c53d79e287 fixup! Get required keys in batch when joining a room 2021-09-01 19:30:32 +02:00
Kurt Roeckx 984ad5ecd6 fixup! Get required keys in batch when joining a room 2021-09-01 19:30:31 +02:00
Kurt Roeckx b546a5bf15 Let our server signing be valid for 1 week
It was valid for 2 minutes, which can result in the server being
asked too much for something that never changes.
2021-09-01 19:30:31 +02:00
Kurt Roeckx a87519fb71 Get required keys in batch when joining a room
We now ask the trusted server for all keys in 1 request, instead of
asking each server individual for it's own keys.
2021-09-01 19:30:30 +02:00
Timo Kösters 9c3f1a9272 Merge branch 'master' into 'master'
Add Traefik setup, incl. step-by-step, to docker README.

See merge request famedly/conduit!158
2021-09-01 16:04:41 +00:00
Timo Kösters 8518d59a0b Merge branch 'clippy' into 'master'
Fix a bunch of clippy lints

See merge request famedly/conduit!178
2021-09-01 10:47:23 +00:00
Timo Kösters 4e68c22457 Merge branch 'docs' into 'master'
docs: documentation for every endpoint

See merge request famedly/conduit!177
2021-09-01 10:20:13 +00:00
Timo Kösters 73d876643c improvement: make pdu cache capacity configurable 2021-09-01 11:03:45 +02:00
Timo Kösters 22779c21d3 Merge branch 'health_script' into 'master'
Fix healthcheck.sh permissions and rearange ci dockerfile

See merge request famedly/conduit!179
2021-09-01 08:08:22 +00:00
Daniel Wiesenberg 8c584887c9 Fix healthcheck.sh permissions and rearange ci dockerfile 2021-08-31 23:17:32 +02:00
Timo Kösters 33738dbbc2 improvement: stop prev event fetching if too many events fail 2021-08-31 22:04:47 +02:00
Jonas Platte a6bb9bbe68 Fix a bunch of clippy lints 2021-08-31 21:20:03 +02:00
Timo Kösters b9eb39a9c6 docs: documentation for every endpoint 2021-08-31 19:20:34 +02:00
Timo Kösters 364820aae4 Merge branch 'registration-default' into 'master'
Default registration true

See merge request famedly/conduit!176
2021-08-31 17:03:05 +00:00
Timo Kösters ec38411620 Merge branch 'health_script' into 'master'
Move docker healthcheck into dedicated script.

See merge request famedly/conduit!173
2021-08-31 16:59:33 +00:00
Jonathan de Jong 9ec8b7f2b3 registration default true 2021-08-31 18:25:35 +02:00
Daniel Wiesenberg a08ea15695 Use $CI_COMMIT_SHORT_SHA for GIT_REF
Using `$CI_COMMIT_REF_NAME` means we get `master` for every image build,
which is not very useful/informative. Using `$CI_COMMIT_SHORT_SHA`,
on the other hand, makes it possible to see exactly from which commit an
image was built.
2021-08-31 18:03:44 +02:00
Timo Kösters 49dd3567c6 Merge branch 'connection-lifetime' into 'master'
thread_local connections

See merge request famedly/conduit!175
2021-08-30 19:05:22 +00:00
Jonathan de Jong 69df9a0145 add tls 2021-08-30 20:18:48 +02:00
Timo Kösters d0d47675d8 Merge branch 'speed' into 'master'
improvement: call /state_ids less often by using state res

See merge request famedly/conduit!174
2021-08-30 17:32:41 +00:00
Timo Kösters bd4ea14a29 improvement: call /state_ids less often by using state res 2021-08-30 16:07:59 +02:00
Timo Kösters 9033cc86aa Merge branch 'speed' into 'master'
fix: make appservices more efficient

See merge request famedly/conduit!172
2021-08-30 09:14:08 +00:00
Timo Kösters 1b25e78e3a fix: inviting dendrite users 2021-08-30 10:56:41 +02:00
Timo Kösters d57c19802d improvement: don't do state updates if the event was soft failed 2021-08-30 10:46:36 +02:00
Daniel Wiesenberg 9ded40e983 Change healthcheck in ci dockerfile 2021-08-30 09:14:08 +02:00
Daniel Wiesenberg a469ca0461 Move docker healthcheck into dedicated script. 2021-08-29 20:01:38 +02:00
Timo Kösters 632a1343eb fix: make appservices more efficient 2021-08-29 20:00:43 +02:00
Timo Kösters 00c9ad12bd Merge branch 'speed' into 'master'
Speed

See merge request famedly/conduit!168
2021-08-28 18:28:25 +00:00
Timo Kösters 1601027605 add warning if calculated event id != requested event id 2021-08-28 19:35:42 +02:00
Timo Kösters afca61fe7c fix: don't retry soft failed events 2021-08-28 11:39:33 +02:00
Devin Ragotzy 9bff276fa9 Use Arc<EventId> in place of most EventIds 2021-08-27 20:20:14 +02:00
Timo Kösters 19b89ab91f fix: server resolution 2021-08-27 20:20:13 +02:00
Timo Kösters 0330d3e270 fix: server resolution with well-known files 2021-08-27 20:20:13 +02:00
Timo Kösters a1e8a99db5 improvement: less IO for auth chains 2021-08-27 20:20:12 +02:00
Timo Kösters 33172a70e6 fix: improve key fetching 2021-08-27 20:20:12 +02:00
Timo Kösters 1b56a7bbfd Merge branch 'speed' into 'master'
fix: e2ee over federation

See merge request famedly/conduit!165
2021-08-26 12:55:47 +00:00
Timo Kösters d485eb5a24 chore: bump dependencies 2021-08-26 14:38:25 +02:00
Timo Kösters 41d07be97b improvement: persist cached auth chains in db 2021-08-26 14:19:08 +02:00
Timo Kösters bef4fe50ce fix: better migration, force e2ee device key updates 2021-08-26 14:19:08 +02:00
Timo Kösters 9152b877a7 fix: wrong soft fail check, too many events in /sync state response 2021-08-26 14:19:07 +02:00
Timo Kösters 9f8c45c763 fix: e2ee over federation
to device events were not being sent
2021-08-26 14:19:07 +02:00
Daniel Wiesenberg 5800e9b797 Add Traefik setup, incl. step-by-step, to docker README. 2021-08-26 12:26:32 +02:00
Timo Kösters 5aa56b92ee Merge branch 'speed' into 'master'
improvement: more efficient auth chain cache

See merge request famedly/conduit!164
2021-08-24 20:12:10 +00:00
Timo Kösters dd87066546 improvement: more efficient auth chain cache 2021-08-24 21:55:18 +02:00
Timo Kösters 30b309b708 Merge branch 'speed' into 'master'
Better E2EE and faster incoming event handling

See merge request famedly/conduit!163
2021-08-24 18:16:56 +00:00
Timo Kösters d5695fb9fe Merge branch 'only-set-max-optimzations-in-ci' into 'master'
Only apply max. optimizations in CI builds.

See merge request famedly/conduit!162
2021-08-24 17:54:17 +00:00
Timo Kösters 81e056417c improvement: better e2ee over fed, faster incoming event handling 2021-08-24 19:52:05 +02:00
Timo Kösters 72dd95f500 Merge branch 'createwarnings' into 'master'
fix: correct create event warnings

See merge request famedly/conduit!161
2021-08-24 17:51:53 +00:00
Jonas Zohren b6e755f67e Only apply max. optimizations in CI builds.
The average german man has a life expectancy of 78.7 years, or 689884.2 hours.
Assuming that Timo is 20 years old, he has rougly 514564.2 hours left on planet earth.
Also assuming that cross release builds took him 25 minutes before,
but 2-2.5x of that with the current release compilation config he wasted roughly an hour waiting for it to complete.
If he continued to work on Conduit for 20 more years (or 175320 hours),
and makes a release compilation about once per day, this means 7305 hours or 304 days wasted waiting for the rust compiler.
By cutting that back down to the original settings, he get's 182 days of his life back.
That's about 0.63% of his remaining life.
182 joyful days he can spend with family and loved ones.
2021-08-22 21:05:32 +00:00
Timo Kösters 4f8cf3bed4 Merge branch 'send_join_v1' into 'master'
Implement federation/v1/send_join

See merge request famedly/conduit!141
2021-08-22 12:06:26 +00:00
Timo Kösters b3ea6adc9c Merge branch 'get-pdu-json' into 'master'
Consistent and escaped response in get_pdu

See merge request famedly/conduit!160
2021-08-22 11:08:11 +00:00
Timo Kösters 6d83954c40 fix: room upgrades 2021-08-22 13:06:50 +02:00
Timo Kösters 667ffb4239 fix: correct create event warnings 2021-08-22 13:01:13 +02:00
Kurt Roeckx 48494c9464 Implement federation/v1/send_join 2021-08-22 10:07:38 +02:00
Tom Smeding 2ef23b213a Consistent and escaped response in get_pdu
1. The fallback text of the get_pdu admin room command response message
   now contains the same text as the formatted_body content (namely, the
   json instead of Debug-formatting of a serde type).
2. The formatted_body content of the get_pdu response is now
   html-escaped.
2021-08-21 15:31:26 +02:00
Timo Kösters 33481ec062 Merge branch 'statediffs' into 'master'
Statediffs

See merge request famedly/conduit!145
2021-08-21 13:05:38 +00:00
Timo Kösters 3b78e43a18 fmt 2021-08-21 14:24:10 +02:00
Timo Kösters 4956fb9fba improvement: limit prev event fetching 2021-08-21 14:22:21 +02:00
Timo Kösters b09499c2df fix: don't save empty tokens 2021-08-19 14:05:23 +02:00
Timo Kösters 46d8a46e1f improvement: faster incoming transaction handling 2021-08-19 11:01:43 +02:00
Timo Kösters cefca2d0d1 Merge branch 'different-optimizations-for-master-and-branches' into 'master'
CI: Use full optimizations for master and faster config else

See merge request famedly/conduit!155
2021-08-18 08:58:45 +00:00
Timo Kösters bf7e019a68 improvement: better prev event fetching, perf improvements 2021-08-17 16:06:09 +02:00
Timo Kösters 75ba8bb565 fix: faster room joins 2021-08-17 00:22:52 +02:00
Timo Kösters 0823506d05 fix: don't load endless prev events and fix room join bug 2021-08-16 23:24:52 +02:00
Timo Kösters 2c3bee34a0 improvement: better sqlite 2021-08-15 13:27:03 +02:00
Timo Kösters a4310f840e improvement: state info cache 2021-08-15 06:48:25 +02:00
Timo Kösters 5bd5b41c70 fix: fetch event multiple times 2021-08-15 06:48:25 +02:00
Timo Kösters f9a2edc0dd fix: also fetch prev events that are outliers already 2021-08-15 06:48:25 +02:00
Timo Kösters ecd1e45a44 fix: fetch more than one prev event 2021-08-15 06:48:24 +02:00
Timo Kösters 1d46569929 fix: don't use recursion for prev events 2021-08-15 06:48:24 +02:00
Timo Kösters 1e3a8ca35d fmt 2021-08-15 06:48:24 +02:00
Timo Kösters 0cb22996be remove prev event fetch limit 2021-08-15 06:48:14 +02:00
Jonas Zohren 9c3a8edcae Use full optimizations for master and faster config else
Signed-off-by: Jonas Zohren <git-pbkyr@jzohren.de>
2021-08-14 21:41:27 +02:00
Timo Kösters 38effda799 fix: delta calculation 2021-08-14 19:11:10 +02:00
Timo Kösters 3cf0145bc5 fix: room exists panic 2021-08-14 08:26:45 +02:00
Timo Kösters 3eabaa2a95 finish implementing better state store 2021-08-13 19:49:16 +02:00
Timo Kösters 31f60ad6fd improvement: migrations, batch inserts 2021-08-12 17:56:35 +02:00
Timo Kösters 41dd620d74 WIP improvement: much better state storage 2021-08-12 17:56:35 +02:00
Timo Kösters 9410d3ef9c fix: long prev event fetch times for huge rooms 2021-08-12 17:56:14 +02:00
Timo Kösters 665aee11c0 less warnings 2021-08-12 17:56:14 +02:00
Timo Kösters 5173d0deb5 improvement: cache for short event ids 2021-08-12 17:56:14 +02:00
Timo Kösters c2c6a8673e improvement: use u64s in auth chain cache 2021-08-12 17:56:14 +02:00
Timo Kösters 096e0971f1 improvement: smaller cache, better prev event fetching 2021-08-12 17:56:13 +02:00
Timo Kösters 8a5dbef474 Merge branch 'set-canonical-room-alias-on-room-creation' into 'master'
Try to set canonical room alias on room creation.

Closes #123

See merge request famedly/conduit!154
2021-08-12 12:24:33 +00:00
Jonas Zohren 4cf3c432af Try to set canonical room alias on room creation.
The spec does not require servers to apply a room canonical alias event upon room creation (yet).
Still, synapse does that, since users can set their desired alias in Elements room creation dialog.
With this commit, conduit also sets that alias if it is a valid one.

This closes https://gitlab.com/famedly/conduit/-/issues/123
2021-08-12 14:02:46 +02:00
Timo Kösters dd3c60fb5a Merge branch 'master' into 'master'
Bump version of alpine docker image to 3.14

See merge request famedly/conduit!150
2021-08-10 05:44:16 +00:00
Timo Kösters e83c226b1b Merge branch 'zap-displayname' into 'master'
Set nicer displayname

See merge request famedly/conduit!149
2021-08-10 05:43:44 +00:00
Jonathan de Jong 8335f44bfe Set nicer displayname 2021-08-10 05:43:44 +00:00
Timo Kösters 3745a7cbe6 Merge branch '3pid' into 'master'
Add support for a minimal `r0/account/3pid`.

See merge request famedly/conduit!151
2021-08-10 05:42:50 +00:00
Timo Kösters 610b4f9ad1 Merge branch 'fetchprev' into 'master'
improvement: try to load missing prev events

See merge request famedly/conduit!152
2021-08-10 05:30:12 +00:00
Ahmed Charles 879aeafa9e Add support for a minimal r0/account/3pid. 2021-08-09 12:34:25 -07:00
Daniel Wiesenberg a7b6af7caf Bump version of alpine docker image to 3.14 2021-08-09 21:21:18 +02:00
Timo Kösters 260db9fcc7 improvement: try to load missing prev events 2021-08-09 21:05:41 +02:00
Timo Kösters 1cbc61c558 Merge branch 'badeventfix' into 'master'
fix: handle bad events in db better

See merge request famedly/conduit!148
2021-08-08 19:48:08 +00:00
Timo Kösters d2f406e0e8 fix: handle bad events in db better 2021-08-08 21:33:28 +02:00
Timo Kösters a816e3decd Merge branch 'room_create_version' into 'master'
Support creating rooms with a version

See merge request famedly/conduit!147
2021-08-07 15:36:45 +00:00
Kurt Roeckx 989a20e99c Support creating rooms with a version 2021-08-07 16:25:21 +02:00
Timo Kösters 1cf9da26bf Merge branch 'timeout' into 'master'
improvement: longer timeout, more descriptive errors

See merge request famedly/conduit!146
2021-08-04 21:09:48 +00:00
Timo Kösters 55a2ff025f improvement: longer timeout, more descriptive errors 2021-08-04 22:55:03 +02:00
Timo Kösters 76660bf189 Merge branch 'sqlitefixes' into 'master'
Sqlitefixes

See merge request famedly/conduit!144
2021-08-04 19:52:30 +00:00
Timo Kösters df727688ef remove rocksdb 2021-08-04 21:17:40 +02:00
Timo Kösters 902404d48d improvement: save member count + sled fixes 2021-08-04 21:15:01 +02:00
Timo Kösters b813c34642 improvement: more auth chain caching 2021-08-04 18:30:56 +02:00
Timo Kösters ab7835dedb fix: early return from state res 2021-08-04 15:19:50 +02:00
Timo Kösters 9bb4c3cd01 improvement: batched inserts for tokenids 2021-08-04 12:54:26 +02:00
Timo Kösters fce22362d4 improvement: better auth chain calculation 2021-08-03 19:18:41 +02:00
Timo Kösters 41ec7cf5d0 improvement: batch inserts for stateids 2021-08-03 16:14:07 +02:00
Timo Kösters 49ade0cfbd improvement: allow batch inserts 2021-08-03 11:24:21 +02:00
Timo Kösters 0eeba86b32 fix: improve locks 2021-08-03 11:17:39 +02:00
Timo Kösters 6b06fc9707 fix: don't run push rules for users that don't exist 2021-08-03 10:24:20 +02:00
Timo Kösters bd63797213 improvement: make better use of sqlite connections 2021-08-03 10:24:14 +02:00
Timo Kösters 2c4f966d60 improvement: use sqlite properly 2021-08-01 16:59:52 +02:00
Timo Kösters 8174b16c38 Merge branch 'master' into 'master'
Also push docker image to docker hub

See merge request famedly/conduit!142
2021-08-01 10:10:51 +00:00
Timo Kösters 6666aae5a5 Merge branch 'docs' into 'master'
docs: make it clear that database_path is a folder

See merge request famedly/conduit!143
2021-07-30 17:44:33 +00:00
Timo Kösters 0f045890eb docs: make it clear that database_path is a folder 2021-07-30 19:27:37 +02:00
Timo Kösters 9cb99a05e0 Merge branch 'tracing_flame' into 'master'
feat: tracing flame graph

See merge request famedly/conduit!140
2021-07-30 16:42:25 +00:00
Timo Kösters dc85a8fafd fix: migration and push edu bugs 2021-07-30 18:05:26 +02:00
Daniel Wiesenberg fcd127aadc Also push docker image to docker hub 2021-07-30 17:15:44 +02:00
Timo Kösters 5df6b8cd5f improvement: better account data implementation 2021-07-30 16:08:24 +02:00
Timo Kösters 5c776e9ba7 feat: heed db backend (LMDB) 2021-07-29 23:11:53 +02:00
Timo Kösters c209775abd fix: pdu without state bug 2021-07-29 12:33:44 +02:00
Timo Kösters 5e924227b6 feat: add threadpool for iterator threads, bug fixes, tracing_flame support 2021-07-29 08:49:28 +02:00
Timo Kösters 734c4637f0 Merge branch 'ci-build-docker-image' into 'master'
CI: Build docker image

See merge request famedly/conduit!134
2021-07-21 15:05:20 +00:00
Timo Kösters e0072eff63 Merge branch 'v5' into 'master'
feat: support room version 5

See merge request famedly/conduit!138
2021-07-21 11:05:59 +00:00
Timo Kösters cae2b200cc Merge branch 'initial_state_keys' into 'master'
Implement From<AnyInitialStateEvent> on PduBuilder

Closes #116

See merge request famedly/conduit!136
2021-07-21 10:03:08 +00:00
Timo Kösters 918df9ca6d feat: support room version 5 2021-07-21 11:59:56 +02:00
Timo Kösters 387e864659 Merge branch 'aliases' into 'master'
Implement getting room aliases

See merge request famedly/conduit!116
2021-07-21 09:48:17 +00:00
Timo Kösters c84960df91 Merge branch 'deploy-guide-remove-arm-add-x86_64-musl' into 'master'
Docs: Remove arm download, but add x86_64 musl one

See merge request famedly/conduit!137
2021-07-21 09:34:14 +00:00
Jonas Zohren 32db4c09a0 Docs: Remove arm download, but add x86_64 musl one 2021-07-21 09:21:49 +00:00
Kurt Roeckx 0d33cc4acd Implement getting room aliases
Signed-off-by: Kurt Roeckx <kurt@roeckx.be>
2021-07-21 10:56:22 +02:00
phesch 666e1d30a3 Implement From<AnyInitialStateEvent> on PduBuilder
The conversion between the two is now direct and thus shouldn't lose the state_keys.
2021-07-21 10:55:23 +02:00
Timo Kösters f43fd6a475 Merge branch 'e2ee-fed' into 'master'
Initial E2EE over federation support

See merge request famedly/conduit!135
2021-07-21 08:41:00 +00:00
Timo Kösters 1587f2cd52 fix: check events in timeline (not only state) for member changes 2021-07-21 09:39:54 +02:00
Timo Kösters f121978897 fix: state bug 2021-07-20 23:36:03 +02:00
Timo Kösters 80533bfab2 fix: improve code when skipping /state_ids 2021-07-20 22:06:42 +02:00
Timo Kösters 08a3326431 docs: Initial end-to-end encryption over federation support 2021-07-20 21:37:08 +02:00
Timo Kösters fe3b5d32a7 feat: send to-device events over federation 2021-07-20 21:17:15 +02:00
Timo Kösters e20f55970e feat: call /query/profile over federation when local user asks 2021-07-20 19:49:47 +02:00
Timo Kösters 728e176a06 feat: /keys/query and /keys/claim over federation 2021-07-20 19:40:25 +02:00
Timo Kösters 7d14a46607 Merge branch 'improvements' into 'master'
Update ruma

See merge request famedly/conduit!127
2021-07-20 16:59:49 +00:00
Timo Kösters 68cc743f2a fix: use get_auth_chain method more often 2021-07-20 18:45:21 +02:00
Timo Kösters 56e5d5e3d2 fix: add warning for strange bug 2021-07-20 18:38:17 +02:00
Timo Kösters f0ac7ed933 chore: update ruma again 2021-07-20 15:25:17 +02:00
Timo Kösters 0f8ecdc625 fix: state res fixes 2021-07-20 15:25:17 +02:00
Timo Kösters cfaa900e83 improvement: auth chain cache 2021-07-20 15:25:16 +02:00
Timo Kösters f5273f7eb1 improvement: upgrade ruma and implement blurhashes 2021-07-20 15:25:16 +02:00
Timo Kösters 0fcefa4125 fix: ruma 2021-07-20 15:25:16 +02:00
Timo Kösters d07762f596 Merge branch 'connection-cushion' into 'master'
Spillover connection cushion

See merge request famedly/conduit!133
2021-07-20 10:39:04 +00:00
Jonathan de Jong d253f9236a change fraction type 2021-07-20 11:01:35 +02:00
Jonathan de Jong ec44f3d568 change to f64 2021-07-20 10:47:36 +02:00
Jonas Zohren 167e903a56 Fix typo 2021-07-19 22:02:10 +02:00
Jonas Zohren 0a8dadb797 Add hardcoded artifacts.expose_as to show them in MRs 2021-07-19 20:39:58 +02:00
Jonas Zohren 678ce0abc6 CI: Create docker image with musl binary 2021-07-19 20:39:58 +02:00
Jonathan de Jong e7a51c07d0 log change feedback 2021-07-19 17:17:10 +02:00
Jonathan de Jong 79bf7fc597 some logging shuffling 2021-07-19 16:46:59 +02:00
Jonathan de Jong 7e579f8d34 change to fraction-based approach 2021-07-19 16:25:41 +02:00
Jonathan de Jong 0f2dc9a239 add stuff and bits 2021-07-19 15:56:20 +02:00
Timo Kösters 59d538206f Merge branch 'fix-shutdown-period' into 'master'
Fix shutdown period

See merge request famedly/conduit!131
2021-07-19 13:11:25 +00:00
Jonathan de Jong faa283d35b review feedback 2021-07-19 13:44:53 +02:00
Timo Kösters 86160597ea Merge branch 'ci-package-upload-hotfix' into 'master'
CI: Fix package upload

See merge request famedly/conduit!132
2021-07-19 11:20:00 +00:00
Jonas Zohren d6b37480e7 CI: Fix package upload 2021-07-19 10:00:44 +00:00
Jonathan de Jong 3ce75d1f02 apply fix 2021-07-19 11:55:39 +02:00
Timo Kösters a50abeedad Merge branch 'ci-rough-sytest-integration' into 'master'
CI: Add sytest

See merge request famedly/conduit!130
2021-07-19 08:47:32 +00:00
Jonas Zohren 130b9841da CI: Add sytest 2021-07-19 08:47:31 +00:00
Timo Kösters ffa10a68b9 Merge branch 'more-detailed-issue-templates' into 'master'
Docs: More (detailed) templates for Issues and MRs

See merge request famedly/conduit!129
2021-07-19 08:28:10 +00:00
Timo Kösters 124b5484b5 Merge branch 'test-registering-with-element-web' into 'master'
CI: Test registration with element web

See merge request famedly/conduit!128
2021-07-19 08:23:05 +00:00
Jonas Zohren 2babff1e41 CI: Test registration with element web 2021-07-19 08:23:04 +00:00
Jonas Zohren cdd01262d2 Shorten more templates 2021-07-18 20:43:21 +00:00
Jonas Zohren 092221ca3f Reduce amount of text in Bug Report template 2021-07-18 20:30:57 +00:00
Jonas Zohren 5d8ad4fd72 Add some more details to the MR template 2021-07-17 12:22:11 +02:00
Jonas Zohren 7054f74783 Add issue template for GitHub which redirects to Gitlab 2021-07-17 12:21:41 +02:00
Jonas Zohren 82a4ec9cbd Add more detailed issue templates
Shamelessly stolen from
https://github.com/HedgeDoc/client

Originally written by
https://github.com/ErikMichelson and
https://github.com/DerMolly
2021-07-17 12:00:38 +02:00
Timo Kösters f924ebf8a6 Merge branch 'fix-windows-signal' into 'master'
fix signal compiling on windows

See merge request famedly/conduit!126
2021-07-15 16:29:47 +00:00
Jonathan de Jong b1993421c2 fix signal compiling on windows 2021-07-15 18:09:10 +02:00
Timo Kösters 8e2d6f7e43 Merge branch 'sled-fix' into 'master'
Sled fixes

See merge request famedly/conduit!125
2021-07-15 15:38:40 +00:00
Jonathan de Jong d76e95e8fc use existing db cache size 2021-07-15 13:47:21 +02:00
Jonathan de Jong 661101c9ae add sled cache_capacity back 2021-07-15 13:29:08 +02:00
Timo Kösters f7ecf83ac3 Merge branch 'stuff' into 'master'
fix: stuck/duplicate messages, e2ee and sync timeouts

See merge request famedly/conduit!123
2021-07-15 08:18:56 +00:00
Timo Kösters 9a4789efdc Merge branch 'ci-format-check-before-cargo-test' into 'master'
CI: Check format before running test

See merge request famedly/conduit!124
2021-07-14 20:53:10 +00:00
Jonas Zohren eaa4c77641 CI: Check format before running test
Testing needs compilation and is slow. Format checking is quick.
As format checking fails more often than tests,
switching them should result in faster failure and feedback
2021-07-14 20:33:19 +00:00
Timo Kösters 9268b33c3f Merge branch 'shutdown-sync' into 'master'
Make shutdown short-circuit sync helpers

See merge request famedly/conduit!122
2021-07-14 13:49:00 +00:00
Timo Kösters 9de32ae12f fix toolchain 2021-07-14 15:46:30 +02:00
Jonathan de Jong 952fb75795 add shutdown handler to kick sync 2021-07-14 14:50:07 +02:00
Timo Kösters e12b1ff863 improvement: locks 2021-07-14 13:21:25 +02:00
Timo Kösters e15e6d4405 improvement: efficient /sync, mutex for federation transactions 2021-07-14 13:20:39 +02:00
Timo Kösters 1c25492a7e fix: stuck messages
Conduit did not send the event in /sync because of a race condition.
There is a brief moment in time where Conduit accepted the event, but
did not store it yet. So when the client /syncs it updates the since
token without sending the event. I hope I fixed it by significantly
shortening the race-condition period.
2021-07-14 13:19:24 +02:00
Timo Kösters 8c44312485 fix: e2ee verification 2021-07-14 13:10:56 +02:00
Timo Kösters ac0027756e improvement: more efficient state res 2021-07-14 13:10:49 +02:00
Timo Kösters f3e806096b Merge branch 'clippy-fix' into 'master'
Fix clippy lint

See merge request famedly/conduit!121
2021-07-14 10:57:44 +00:00
Jonathan de Jong e1b89c1248 apply lint suggestions and version bump 2021-07-14 12:31:38 +02:00
Timo Kösters be6b6c3cf0 Merge branch 'rocket-update' into 'master'
Update rocket to rc1 and lock file

See merge request famedly/conduit!120
2021-07-14 09:48:17 +00:00
Jonathan de Jong 15471d9ac4 update rocket and lock 2021-07-14 11:28:24 +02:00
Timo Kösters 3c236fb671 Merge branch 'sqlite' into 'master'
Sqlite

See merge request famedly/conduit!114
2021-07-14 07:07:09 +00:00
Jonathan de Jong 9d4fa9a220 Sqlite 2021-07-14 07:07:08 +00:00
Timo Kösters bd4bd58612 Merge branch 'capabilities_auth' into 'master'
Getting capabilities requires authentication

See merge request famedly/conduit!117
2021-07-13 07:55:19 +00:00
Timo Kösters 0eec1cc696 Merge branch 'ci-tag-jobs-with-docker' into 'master'
Better CI (run on faster CI hosts, incremental release builds, thin-lto)

See merge request famedly/conduit!118
2021-07-12 20:35:00 +00:00
Jonas Zohren 3fa09ff57d Use thin-lto [1] for "better" release builds.
This performs a rather quick variant of Link Time Optimization [2].
It should add negligible build time but also more optimized binaries.

[1]: https://doc.rust-lang.org/cargo/reference/profiles.html#lto

[2]: https://llvm.org/docs/LinkTimeOptimization.html
2021-07-12 20:21:13 +00:00
Jonas Zohren 0080932aef Speed up release builds
Setting cargo to run incremental builds means partial build results should be cached. This is not enabled by default in release mode.

Incremental builds use 256 codegen units by default [1].
We set them to 16 (release default) again for somewhat faster code but slightly slower builds.


[1]: https://doc.rust-lang.org/cargo/reference/profiles.html#codegen-units
2021-07-12 20:18:14 +00:00
Jonas Zohren 888a2f7fa1 Make CI run on famedly runners
By default, jobs without tags only run on CI runners configured to do so [1].
Conduit can use famedly runners, which are more powerfull than gitlab's runners, but require a tag on the job to run it there.
This commit tags each job with the "docker" tag.
On the famedly/conduit repo this means faster CI.
On other gitlab.com forks the normal ci.
Selfhosted gitlab's might need to add a "docker" tag to their runner.

[1]: https://docs.gitlab.com/ee/ci/runners/configure_runners.html#use-tags-to-limit-the-number-of-jobs-using-the-runner
2021-07-12 19:58:35 +00:00
Kurt Roeckx dcb5e5900f Getting capabilities requires authentication 2021-07-11 22:07:10 +02:00
Timo Kösters 4732aa6782 Merge branch 'invalid_utf8' into 'master'
Return proper error in case of invalid UTF-8

See merge request famedly/conduit!110
2021-07-11 13:44:27 +00:00
Kurt Roeckx 699f77671f Return proper error in case of invalid UTF-8 in json_body
json_body is used in places that need authentication. In
case an unknown field is set, Ruma doesn't parse the field
and so doesn't give an error on invalid UTF-8. But Conduit
has parsed and on error makes json_body None. Return an
error to the client instead of generating an internal error.
2021-07-11 14:47:13 +02:00
Timo Kösters fcfb9b51de Merge branch 'fix-ci-failing-duplicate-nightly-release' into 'master'
Fix: Duplicate releases don't work, remove nightly

Closes #100

See merge request famedly/conduit!113
2021-07-11 11:43:48 +00:00
Jonas Zohren 36681dd3ac Fix: Duplicate releases don't work, remove nightly 2021-07-11 11:43:48 +00:00
Timo Kösters 13c0beafa6 Merge branch 'lib-fix' into 'master'
Export conduits Config struct and fix clippy warnings

See merge request famedly/conduit!99
2021-07-11 11:42:07 +00:00
Timo Kösters a313a93ff5 Merge branch 'master' into 'master'
Change default port in docker to the new

See merge request famedly/conduit!115
2021-07-11 11:41:12 +00:00
Daniel Wiesenberg 6a96cfaac1 Change default port in docker to the new
conduit default port 6167 and fix the docker healthcheck
2021-07-06 10:43:33 +02:00
Timo Kösters 787e18b2a4 Merge branch 'jfowl-master-patch-57056' into 'master'
Fix: Nightly release tag name should not be a branch name

See merge request famedly/conduit!112
2021-07-02 15:18:26 +00:00
Jonas Zohren fcc30f059e Fix: Nightly release tag name should not be a branch name
According to tulir this breaks the GitLab Matrix bot, and nightly is a better match anyway
2021-07-02 14:58:00 +00:00
Timo Kösters f1a2aa3a94 Merge branch 'jfowl-master-patch-97252' into 'master'
Publish master builds as nightly releases & also build debs

See merge request famedly/conduit!111
2021-07-02 12:26:27 +00:00
Jonas Zohren a7cb1c999a Publish master builds as nightly releases & also build debs 2021-07-02 12:26:26 +00:00
Timo Kösters 5711467ad9 Merge branch 'state-res-closure' into 'master'
Remove auth_cache using a closure to fetch events in state-res

See merge request famedly/conduit!108
2021-07-02 10:56:21 +00:00
Devin Ragotzy c30cc50a0b Switch ruma to a commit from next 2021-07-02 06:40:40 -04:00
Timo Kösters 5f6b0c673c Merge branch 'feature/proxy' into 'master'
add support for arbitrary proxies

See merge request famedly/conduit!54
2021-07-01 19:46:18 +00:00
Aiden McClelland c53cc03ff8 address pr comments 2021-07-01 13:38:25 -06:00
Timo Kösters af903ceac3 Merge branch 'ci-build-artifacts-1' into 'master'
Generate binaries for 3 architectures in the CI

See merge request famedly/conduit!94
2021-07-01 19:06:40 +00:00
Aiden McClelland f25f61d4a9 fix errors introduced by rebase 2021-07-01 12:48:12 -06:00
Aiden McClelland b2d5516058 add support for arbitrary proxies 2021-07-01 12:41:12 -06:00
Devin Ragotzy 1bb84a8e2d Fix docs for fetch_and_handle_events 2021-06-30 07:48:16 -04:00
Devin Ragotzy 98f1480e2b Remove auth_cache using a closure to fetch events in state-res 2021-06-30 12:54:19 +02:00
Timo Kösters cc9111059d Merge branch 'search-impovements' into 'master'
improvement: /search works for multiple rooms

See merge request famedly/conduit!106
2021-06-30 08:32:55 +00:00
Timo Kösters 05821d6fd5 improvement: pdu cache, /sync cache 2021-06-30 10:31:34 +02:00
Devin Ragotzy 09a8737f24 Export conduits Config struct and fix clipp warningsy 2021-06-29 16:02:12 -04:00
Timo Kösters dcac1361ec improvement: /search works for multiple rooms 2021-06-21 15:21:00 +02:00
Timo Kösters fee7d3d2e3 Merge branch 'allow_appservice_registration' into 'master'
Always allow appservices to register new users

See merge request famedly/conduit!105
2021-06-21 10:15:48 +00:00
Timo Kösters 1a70ea5702 Merge branch 'upgrade-deps' into 'master'
Upgrade Ruma

See merge request famedly/conduit!104
2021-06-21 10:14:12 +00:00
phesch 637d9d3b6f Always allow appservices to register new users 2021-06-19 16:12:05 +02:00
Jonas Platte 808741bcb6 Remove unnecessary Option-wrapping and successive unwrapping 2021-06-17 20:44:29 +02:00
Jonas Platte b291e76572 Use try operator for Option more 2021-06-17 20:37:07 +02:00
Jonas Platte f3e630c064 Fix lots of clippy lints 2021-06-17 20:34:14 +02:00
Jonas Platte af2ce5803e Remove pointless double deserialization 2021-06-17 20:29:02 +02:00
Jonas Platte 7fa54e4411 Use Ruma-provided default power levels for shorter code 2021-06-17 20:14:37 +02:00
Jonas Platte f6046871f4 Upgrade Ruma 2021-06-17 20:12:36 +02:00
Timo Kösters 2ac7b6d411 Merge branch 'event_auth' into 'master'
feat: /event_auth

Closes #43

See merge request famedly/conduit!103
2021-06-14 09:44:07 +00:00
Timo Kösters 67f9592b17 feat: /event_auth 2021-06-14 11:36:40 +02:00
Timo Kösters 07271b7725 Merge branch 'roomdirfilter' into 'master'
improvement: filter our room directory

Closes #35

See merge request famedly/conduit!102
2021-06-14 09:33:20 +00:00
Timo Kösters 77a23f8969 improvement: filter our room directory
Fixes #35
2021-06-14 11:26:41 +02:00
Timo Kösters 01e01bf25e Merge branch 'state' into 'master'
feat: /state

Closes #47

See merge request famedly/conduit!101
2021-06-14 09:23:22 +00:00
Timo Kösters 3c9ea55938 feat: /state 2021-06-14 11:01:12 +02:00
Timo Kösters cf493f2b5b Merge branch 'userdir' into 'master'
User directory improvements

See merge request famedly/conduit!100
2021-06-12 16:52:49 +00:00
Timo Kösters e8f6708927 improvement: show more users in our user directory 2021-06-12 18:40:33 +02:00
Timo Kösters 8c6bcc47bf Merge branch 'rocksdb' into 'master'
Swappable database backend

See merge request famedly/conduit!98
2021-06-12 14:25:03 +00:00
Timo Kösters cd4bc520d8 improvement: feature flags for sled, rocksdb 2021-06-12 15:13:04 +02:00
hamidreza kalbasi 2078af59d8 fix fmt problems 2021-06-09 22:22:05 +02:00
hamidreza kalbasi 2385bd1cfd add migrations 2021-06-09 22:22:05 +02:00
hamidreza kalbasi affa124864 create media folder in init 2021-06-09 22:22:05 +02:00
hamidreza kalbasi ff841b73c5 use .keys() and remove unneccery .to_vec() 2021-06-09 22:22:04 +02:00
hamidreza kalbasi 804105479c fix fmt and clippy warnings 2021-06-09 22:22:04 +02:00
hamidreza kalbasi 972caacdc2 put media in filesystem 2021-06-09 22:22:04 +02:00
Timo Kösters d0ee823254 feat: swappable database backend 2021-06-09 22:21:52 +02:00
Timo Kösters 81715bd84d Merge branch 'account' into 'master'
Fix account and media bugs

See merge request famedly/conduit!97
2021-06-08 07:22:32 +00:00
Timo Kösters b3cec1d20d Merge branch 'master' into 'master'
Fix ruma dependency

Closes #95

See merge request famedly/conduit!96
2021-06-05 06:14:55 +00:00
Damian Poddebniak bb7a4220d3 Fix ruma dependency 2021-06-04 20:18:03 +02:00
Jonas Fowl b84c66daba Generate binaries for 3 architectures in the CI
The result is stored in the gitlab package registry
2021-06-01 00:58:50 +00:00
Timo Kösters e1e529d818 fix: don't apply push rules for users of other homeservers 2021-05-30 22:01:12 +02:00
Timo Kösters 88cf043f94 fix: deactivate accounts that should be deactivated 2021-05-30 21:56:36 +02:00
Timo Kösters bff68e595b Merge branch 'account' into 'master'
fix: putting global account data works now

Closes #92

See merge request famedly/conduit!93
2021-05-29 09:14:47 +00:00
Timo Kösters 59dd3676d5 fix: putting global account data works now 2021-05-29 10:53:03 +02:00
Timo Kösters 1fa7ff2eb1 Merge branch 'claim' into 'master'
feat: implement /claim, handle to-device events

See merge request famedly/conduit!92
2021-05-28 21:36:46 +00:00
Timo Kösters deacdf6f58 fix: is_direct for locally invited users 2021-05-28 22:53:00 +02:00
Timo Kösters 5b5cc0574e feat: implement /claim, handle to-device events 2021-05-28 13:46:15 +02:00
Timo Kösters 953f2b005f Merge branch 'specify-and-document-msrv' into 'master'
Specify the minimum required Rust version in the manifest

See merge request famedly/conduit!91
2021-05-28 07:49:06 +00:00
Vadim Zeitlin f199b51f97 Move the link to cross-compiling guide to DEPLOY.md 2021-05-28 09:42:59 +02:00
Vadim Zeitlin 0f16a79888 Specify the minimum required Rust version in the manifest
Also mention it in the deployment guide.
2021-05-27 23:32:33 +02:00
Vadim Zeitlin 6af942814f Fix some typos in the README 2021-05-27 23:32:33 +02:00
Timo Kösters 0805f4ac2a Merge branch 'pdu-success' into 'master'
fix: also return successful PDUs in /send/:txnId

See merge request famedly/conduit!90
2021-05-27 21:24:43 +00:00
Gabriel Souza Franco 7db59c550f fix: also return successful PDUs in /send/:txnId 2021-05-27 18:10:48 -03:00
Timo Kösters 25b1cd2683 Merge branch 'stateres' into 'master'
fix: state resolution bugs

See merge request famedly/conduit!89
2021-05-27 09:10:53 +00:00
Timo Kösters daa1fc90a7 fix: state resolution bugs 2021-05-27 10:48:17 +02:00
Timo Kösters eeb0b59b76 Merge branch 'redaction_quotes' into 'master'
Fix redacted_because field being sent as a string

Closes #87

See merge request famedly/conduit!88
2021-05-26 15:58:00 +00:00
phesch ddcf1a715b Fix redacted_because field being sent as a string 2021-05-26 17:38:30 +02:00
Timo Kösters d1c0eaf628 Merge branch 'master' into 'master'
Fix docker-compose trusted_servers env var

See merge request famedly/conduit!87
2021-05-26 07:03:51 +00:00
Daniel Wiesenberg 8387ceacab Fix docker-compose trusted_servers env var 2021-05-25 21:34:31 +02:00
Timo Kösters 1aec80c57c Merge branch 'logs' into 'master'
fix: logs for ruma crate

See merge request famedly/conduit!86
2021-05-24 16:08:56 +00:00
Timo Kösters aacf6289db improvement: increase default max concurrent requests 2021-05-24 18:00:39 +02:00
Timo Kösters 57ecd81534 fix: logs for ruma crate 2021-05-24 13:22:30 +02:00
Timo Kösters ceaeab6816 Merge branch 'federation-errors' into 'master'
feat: forward federation errors to the client

See merge request famedly/conduit!85
2021-05-23 18:27:05 +00:00
Timo Kösters e5c7119516 feat: forward federation errors to the client 2021-05-23 16:46:46 +02:00
Timo Kösters 1939e62814 fmt 2021-05-23 11:11:20 +02:00
Timo Kösters 1ab209736a Merge branch 'forbidden' into 'master'
fix: Forbidden instead of InvalidParam when joining

See merge request famedly/conduit!84
2021-05-22 19:56:46 +00:00
Timo Kösters fd69ac621c fix: run ci with docker 2021-05-22 21:41:08 +02:00
Timo Kösters c1b2b468b8 fix: bad except in ruma wrapper 2021-05-22 21:33:31 +02:00
Timo Kösters 7e4dc65747 Merge branch 'master' into 'master'
Update Dockerfile and docker-compose

See merge request famedly/conduit!39
2021-05-22 19:26:03 +00:00
Daniel Wiesenberg 634fe04c33 Fix wrong env var name in traefik compose 2021-05-22 20:49:07 +02:00
Timo Kösters 90cd11d850 fix: Forbidden instead of InvalidParam when joining 2021-05-22 18:50:40 +02:00
Daniel Wiesenberg c6625d83e6 Add CONDUIT_TRUSTED_SERVERS config param 2021-05-22 16:53:48 +02:00
Daniel Wiesenberg 5a7ccbdfab Add CONDUIT_CONFIG to all relevant docker files
And mention that an empty string can be used to configure
Conduit purely with env vars.
2021-05-22 16:53:48 +02:00
Daniel Wiesenberg beb428d866 Update docker command in README
Mention the need for a config.
2021-05-22 16:53:48 +02:00
Daniel Wiesenberg 52a96b3d84 Update Dockerfile and docker-compose
- Dockerfile now tracks the gitlab repository and the master branch.
- docker-compose now points to conduit.toml instead of Rocket.toml and
its env vars were also renamed from ROCKET_ to CONDUIT_.
Furthermore vectorim/riot-web was changed to vectorim/element-web
2021-05-22 16:53:48 +02:00
Timo Kösters 42c9ba2e5c Merge branch 'appservice-docs' into 'master'
docs: APPSERVICES setup guide

See merge request famedly/conduit!83
2021-05-22 13:13:54 +00:00
Timo Kösters 47160e9e06 docs: APPSERVICES setup guide 2021-05-22 13:55:28 +02:00
Timo Kösters 488581cc51 Merge branch 'fix-sync' into 'master'
fix: too many syncs

See merge request famedly/conduit!82
2021-05-22 09:39:14 +00:00
Timo Kösters 9b77eb7bb7 fix: too many syncs 2021-05-22 11:31:15 +02:00
Timo Kösters acfd0aef27 Merge branch 'cargo-deb-packaging-update' into 'master'
Update cargo-deb packaging for recent changes

See merge request famedly/conduit!61
2021-05-22 09:03:43 +00:00
Timo Kösters 50348de1dd Merge branch 'improvements' into 'master'
improvement: federation get_keys and optimize signingkey storage

See merge request famedly/conduit!81
2021-05-22 08:49:18 +00:00
Timo Kösters 1b42770ab5 improvement: warning for small max_request_size values 2021-05-22 10:34:19 +02:00
Timo Kösters 3e2f742f30 fix: room version warnings and other bugs when joining rooms 2021-05-21 22:22:05 +02:00
Timo Kösters 989d843c40 fix: unauthorized pdus will be responded to with FORBIDDEN 2021-05-21 18:12:02 +02:00
Timo Kösters 09157b2096 improvement: federation get_keys and optimize signingkey storage
- get encryption keys over federation
- optimize signing key storage
- rate limit parsing of bad events
- rate limit signature fetching
- dependency bumps
2021-05-21 13:25:24 +02:00
Timo Kösters ae41bc5067 fix: run state res with old current state again
I'm a bit torn on the "auth check based on the current state of the
room". It can mean multiple things:

1. The state of the room before the homeserver looked at the event at
all. But that means if a message event from a user arrives, but we
didn't see their join event before, we soft fail the message (even
though we would find the join event when going through the auth events
of the event and doing state res)

2. The state of the room after doing state-res with the event and our
previous room state. We need to do this state resolution to find the new
room state anyway, so we could just use the new room state for the auth
check. The problem is that if the incoming event is a membership leave
event, the new room state does not allow another leave event. This is
obviously the wrong option.

3. The state of the room after doing state-res with the state **before**
the event and our previous room state. This will mean a lot more
calculations because we have to run state-res again

We used 2. before and now use 1. again
2021-05-17 10:58:44 +02:00
Timo Kösters 8f27e6123b feat: send read receipts over federation
currently they will only be sent if a PDU has to be sent as well
2021-05-17 10:25:27 +02:00
Timo Kösters 24793891e0 feat: implement GET /presence 2021-05-14 11:05:41 +02:00
Timo Kösters 767fe76d3e Merge branch 'jfowl-master-patch-93743' into 'master'
Try to improve CI build times by caching

See merge request famedly/conduit!79
2021-05-13 07:57:11 +00:00
Jonas Fowl 3ea0d2b567 Try to improve CI build times by caching 2021-05-13 07:57:11 +00:00
Timo Kösters f3e6311680 Merge branch 'clippy_ci' into 'master'
Add linting checks to CI

See merge request famedly/conduit!76
2021-05-12 18:44:41 +00:00
Timo Kösters 37b4a1cd0d Merge branch 'dbg_clippy' into 'master'
Add dbg_macro check

See merge request famedly/conduit!75
2021-05-12 18:44:01 +00:00
Timo Kösters 68c5c57486 Merge branch 'improvements' into 'master'
improvement: bug fixes and refactors

See merge request famedly/conduit!78
2021-05-12 18:29:26 +00:00
Timo Kösters f62258ba35 improvement: bug fixes and refactors
- power level content override adds to the default event instead of
replacing it
- sending code refactored to make edus possible
- remove presence events when restarting conduit
- remove room_id field from read receipts over /sync
- handle incoming read receipts
- fix array bounds bug in server_server.rs
2021-05-12 20:15:24 +02:00
Timo Kösters ad5e51dc25 Merge branch 'up-ruma' into 'master'
Upgrade Ruma

See merge request famedly/conduit!77
2021-05-08 07:46:26 +00:00
Jonas Platte af6fea3d4e Refactor some canonical JSON code 2021-05-08 02:13:01 +02:00
Jonas Platte a0457000ff Upgrade Ruma 2021-05-08 01:54:28 +02:00
Jonathan de Jong 80f1844476 fix rustup pls 2021-05-05 17:44:32 +00:00
Jonathan de Jong 9bf99e99a8 fix clippy rustup 2021-05-05 17:26:59 +00:00
Jonathan de Jong 442d0732a4 add rustup 2021-05-05 17:01:48 +00:00
Jonathan de Jong 9d2cc4d8b1 add cargo fmt check 2021-05-05 16:48:44 +00:00
Jonathan de Jong e48cd9b018 add clippy to CI 2021-05-05 16:41:22 +00:00
Jonathan de Jong 268ad3441c add dbg_macro check 2021-05-05 16:14:49 +00:00
Timo Kösters bd16850fd4 Merge branch 'trusted' into 'master'
fix: add trusted_servers to config and deploy guide

See merge request famedly/conduit!74
2021-05-05 10:42:55 +00:00
Timo Kösters 3408d74f93 fix: add trusted_servers to config and deploy guide 2021-05-05 12:27:49 +02:00
Timo Kösters 861cc76363 Merge branch 'uiaa' into 'master'
improvement: uiaa works like in synapse

See merge request famedly/conduit!73
2021-05-05 10:18:26 +00:00
Timo Kösters cf94b8e712 improvement: uiaa works like in synapse 2021-05-04 19:05:30 +02:00
Timo Kösters b42d34858e Merge branch 'up-ruma' into 'master'
Upgrade ruma and clean up request sending code

See merge request famedly/conduit!72
2021-05-02 16:59:31 +00:00
Jonas Platte e1c4e5c73e Return only event content in account_data endpoints, not the entire event 2021-04-29 21:28:01 +02:00
Jonas Platte 8bfaf09f37 Clean up reqwest::Response to http::Response conversion 2021-04-29 21:28:00 +02:00
Jonas Platte c28eba1e5b Bump ruma 2021-04-29 21:05:29 +02:00
Jonas Platte 08ca573df0 Remove explicit setting of content-type header
`try_into_http_request` takes care of this already.
2021-04-29 20:50:59 +02:00
Jonas Platte 61c522dcc0 Fix formatting 2021-04-29 20:50:59 +02:00
Jonas Platte b76af682a6 Fix clippy warnings 2021-04-29 20:50:59 +02:00
Timo Kösters 27d25914e1 Merge branch 'roomdir' into 'master'
improvement: optimize room directory

Closes #36

See merge request famedly/conduit!71
2021-04-28 15:58:54 +00:00
Timo Kösters 3c3062a316 improvement: optimize room directory 2021-04-28 17:56:15 +02:00
Timo Kösters d35ad69af1 Merge branch 'up-ruma' into 'master'
Bump ruma

See merge request famedly/conduit!70
2021-04-28 09:44:04 +00:00
Jonas Platte 2e1d7d12ca Refactor usage of CanonicalJsonValue 2021-04-26 19:03:51 +02:00
Jonas Platte c2b72773d5 Fix clippy warning 2021-04-26 19:02:32 +02:00
Jonas Platte 5be5c9e9f0 Bump ruma 2021-04-26 19:02:32 +02:00
Timo Kösters f9f37cfcf8 Merge branch 'invites' into 'master'
feat: send invites over federation

Closes #53

See merge request famedly/conduit!69
2021-04-26 16:53:53 +00:00
Timo Kösters 58463bba93 feat: send invites over federation 2021-04-25 14:10:21 +02:00
Timo Kösters abe176e3d0 Merge branch 'sending' into 'master'
fix: send transaction retry code

See merge request famedly/conduit!68
2021-04-24 21:17:18 +00:00
Timo Kösters 3dfc245633 fix: send transaction retry code 2021-04-24 18:26:41 +02:00
Timo Kösters dd0b2597b7 Merge branch 'signatures' into 'master'
feat: verify signatures for incoming requests

Closes #77

See merge request famedly/conduit!65
2021-04-24 12:55:41 +00:00
Timo Kösters 2fc1ec2ad5 fix: logging 2021-04-24 13:34:35 +02:00
Timo Kösters 226045ea4b improvement: warning on misconfigured reverse proxy 2021-04-24 12:29:02 +02:00
Jonas Platte 026af6b1a6 Improve formatting of ruma_wrapper.rs 2021-04-24 12:22:42 +02:00
Jonas Platte d8b484beed Upgrade ruma 2021-04-24 12:22:36 +02:00
Jonas Platte e72fd44bb5 Refactor send_request for appservices 2021-04-24 12:18:21 +02:00
Jonas Platte 7067d7acae Refactor Responder implementation for RumaResponse 2021-04-24 12:18:21 +02:00
Timo Kösters 23f81bfaf7 chore: update dependencies 2021-04-24 12:18:19 +02:00
Timo Kösters bb234ca002 fix: only show one typing event per user 2021-04-24 12:17:45 +02:00
Timo Kösters 6e84d317b2 improvement: update ruma 2021-04-24 12:17:44 +02:00
Timo Kösters 1f84013b2a feat: verify signatures for incoming requests 2021-04-24 12:17:44 +02:00
Timo Kösters f89e3668fd Merge branch 'deploy-proxy' into 'master'
Document proper proxy options in DEPLOY.md

See merge request famedly/conduit!67
2021-04-24 08:57:11 +00:00
Gabriel Souza Franco 7e4320a079 chore: document proper proxy options in DEPLOY.md 2021-04-23 15:27:35 -03:00
Paul van Tilburg f63a624743 Add text about using cargo-deb to the README 2021-04-23 19:11:42 +02:00
Timo Kösters 8c72909bb8 Merge branch 'tls-name' into 'master'
Validate TLS certificates according to Matrix spec

See merge request famedly/conduit!60
2021-04-23 05:22:07 +00:00
Paul van Tilburg 4fb2f17b83 Purge debconf changes from the DB on purge 2021-04-22 21:52:47 +02:00
Paul van Tilburg 19aaffeb23 Change the default port (follows DEPLOY.md) 2021-04-22 21:52:47 +02:00
Paul van Tilburg f3b1096417 Change the default library path (follows DEPLOY.md) 2021-04-22 21:52:47 +02:00
Paul van Tilburg 5bf43a4d7e Generate conduit.toml instead of debian environment file
Only generate this file once. I am not sure what to do with future
upgrades yet.
2021-04-22 21:52:40 +02:00
Timo Kösters 14c7ecf722 Merge branch 'improvements' into 'master'
Implement /devices

Closes #62

See merge request famedly/conduit!64
2021-04-21 09:03:18 +00:00
Timo Kösters 2f440e644d fix: clippy 2021-04-21 10:59:07 +02:00
Timo Kösters 71ed1b295a feat: /devices route 2021-04-21 10:51:56 +02:00
Timo Kösters e815486030 fix: don't allow inviting other users (not implemented yet) 2021-04-21 10:00:23 +02:00
Gabriel Souza Franco ed253e236c chore: document FedDest, fix tests 2021-04-21 00:35:44 -03:00
Timo Kösters 1937cf554f Merge branch 'add-ci' into 'master'
Add basic CI

See merge request famedly/conduit!41
2021-04-20 12:23:28 +00:00
Timo Kösters 9adcc20335 Merge branch 'update-readme' into 'master'
docs: update readme

See merge request famedly/conduit!63
2021-04-20 11:21:18 +00:00
Timo Kösters 4c4e1f9027 docs: update readme 2021-04-20 13:07:00 +02:00
Timo Kösters ad19264c38 Merge branch 'fix-fetch' into 'master'
fix: bug when fetching events over federation

See merge request famedly/conduit!62
2021-04-19 10:00:47 +00:00
Timo Kösters 0b9182455c fix: use working email 2021-04-19 11:57:17 +02:00
Timo Kösters d4e0ba245b fix: bug when fetching events over federation 2021-04-19 11:55:27 +02:00
Timo Kösters 0b89ffe566 Merge branch 'make-join' into 'master'
feat: make_join, send_join and /directory

See merge request famedly/conduit!59
2021-04-16 21:15:27 +00:00
Paul van Tilburg ab58609d3d No longer use/support a local environment file 2021-04-16 22:07:58 +02:00
Timo Kösters eedac4fd96 feat: make_join, send_join and /directory 2021-04-16 18:18:29 +02:00
Gabriel Souza Franco 7faa021ff5 chore: code formatting and cleanup 2021-04-16 12:18:22 -03:00
Timo Kösters 6d109b9902 Merge branch 'mdformatting' into 'master'
docs: Fix markdown formatting in DEPLOY.md

See merge request famedly/conduit!58
2021-04-16 09:24:52 +00:00
Tobias Fella 95db30918e docs: Fix fix formatting of code blocks in markdown 2021-04-16 11:10:01 +02:00
Gabriel Souza Franco e73de2317e fix: verify tls cert for non-conformant servers 2021-04-16 00:36:35 -03:00
Gabriel Souza Franco b4c001de2f chore: cleanup string-based code in find_actual_destination 2021-04-16 00:27:26 -03:00
Gabriel Souza Franco 0b56589dce feat: add handling of tls cert for delegated hosts 2021-04-15 22:07:27 -03:00
Timo Kösters 18398e1f17 Merge branch 'bump-stateres' into 'master'
Bump stateres

See merge request famedly/conduit!57
2021-04-14 15:47:00 +00:00
Timo Kösters 04b08d4505 chore: bump stateres 2021-04-14 17:46:17 +02:00
Timo Kösters f6c4da829e Merge branch 'better-joining' into 'master'
improvement: use invite state as hints to what servers to ask for joining

See merge request famedly/conduit!56
2021-04-14 13:06:14 +00:00
Timo Kösters bc98425dfe improvement: use invite state as hints to what servers to ask for joining 2021-04-14 14:46:40 +02:00
Timo Kösters d6b59cd20c Merge branch 'develop' into 'master'
State resolution overhaul

See merge request famedly/conduit!53
2021-04-14 11:36:53 +00:00
Timo Kösters 001d8dc257 fix: don't do expensive operation on local /send 2021-04-14 12:55:14 +02:00
Timo Kösters c1953efa6b chore: code cleanup 2021-04-14 10:43:31 +02:00
Timo Kösters abddfc2d2a Merge remote-tracking branch 'famedly/master' into develop 2021-04-14 10:26:28 +02:00
Timo Kösters 5951294638 feat: join cursed rooms
this removes several restrictions and tries to continue verifying a pdu
event if some auth events fail (it drops/ignores bad pdus)
2021-04-14 09:39:06 +02:00
Timo Kösters 8b40e0a85f improvement: fetch signing keys in parallel when joining a room 2021-04-13 22:54:01 +02:00
Timo Kösters 5049d0e01b improvement: check signatures on join 2021-04-13 18:17:51 +02:00
Timo Kösters b4f79b77ba feat: reject invites over federation 2021-04-13 17:41:14 +02:00
Timo Kösters 662a0cf1df improvement: better and more efficient message count calculation 2021-04-12 12:40:16 +02:00
Timo Kösters 1dc85895a7 fix: show warning for invalid user ids 2021-04-12 10:12:52 +02:00
Timo Kösters a961732f5f fix: overflow 2021-04-11 21:35:17 +02:00
Timo Kösters a8231eef25 fix: alias parsing 2021-04-11 21:29:37 +02:00
Timo Kösters 8773e5013d feat: incoming invites over federation 2021-04-11 21:04:31 +02:00
Timo Kösters b427395648 Merge branch 'add-vscode-settings' into 'master'
Add settings.json for vscode rust-analyzer

See merge request famedly/conduit!45
2021-04-11 10:56:38 +00:00
Timo Kösters b4bbbd26bf Merge branch 'MTRNord/propose-better-systemd-user' into 'master'
fix: Do not run conduit as root instead use a separate user

See merge request famedly/conduit!49
2021-04-11 10:52:52 +00:00
Marcel ac99e05714 docs: capitalize a "conduit" that was missed 2021-04-11 10:51:43 +00:00
Marcel dd69850598 docs: Fix missing _matrix in apache config 2021-04-11 10:50:38 +00:00
Timo Kösters b0ea692706 fix: malformed pushrule error when event does not trigger any actions 2021-04-11 10:50:30 +02:00
Timo Kösters 588de12d79 fix: lost forward extremity 2021-04-11 10:12:29 +02:00
Timo Kösters 044e65afcc fix: move back to sled stable 2021-04-11 10:12:05 +02:00
Timo Kösters 84f4ce73e5 fix: membership deserializing 2021-04-09 21:45:22 +02:00
Timo Kösters 51aa6448bc fix: use sled main to avoid deadlock 2021-04-07 17:58:33 +02:00
Timo Kösters f3f95a73d0 improvement: /event route 2021-04-07 15:57:23 +02:00
Timo Kösters d0cdbe2e2b Merge branch 'up-ruma' into 'develop'
Upgrade ruma

See merge request famedly/conduit!48
2021-04-07 13:55:31 +00:00
Jonas Platte dc031fff95 Remove redundant calls to .iter() and .into_iter() 2021-04-06 17:38:54 +02:00
Jonas Platte dbe8c2ce19 Remove lots of redundant string allocations 2021-04-06 17:38:54 +02:00
Jonas Platte fe744c856f Upgrade ruma
… and refactor push rule code along the way.
2021-04-06 17:38:53 +02:00
Marcel c267c0f09e fix: use full codeblocks and capitalize Conduit and Debian 2021-04-06 13:17:39 +00:00
Marcel 9b2f8730bb fix: Do not run conduit as root instead use a separate user 2021-04-06 12:26:47 +00:00
Timo Kösters c9b1f0ca83 Merge branch 'k0gen-master-patch-33282' into 'master'
No need to log out and back in fix

See merge request famedly/conduit!47
2021-04-03 13:04:55 +00:00
Mariusz Kogen 246e4735fd No need to log out and back in fix 2021-04-02 22:11:14 +00:00
Timo Kösters db7044a950 sytest test 2021-03-26 13:41:05 +01:00
Timo Kösters 8c6a49bec3 Merge branch 'update_CI_for_develop' into 'develop'
Update Complement CI container

See merge request famedly/conduit!46
2021-03-26 12:31:34 +00:00
Timo Kösters cd4dc13731 fix: use correct room versions 2021-03-26 13:30:17 +01:00
Rudi Floren 5a13f6f7e0 Remove build container and use the always present build artifact directly
Proper chmod caddy and conduit binaries
2021-03-26 04:19:54 +01:00
Timo Kösters c213769d9f improvement: refactor state res and fix a few bugs in the process 2021-03-25 23:55:40 +01:00
Timo Kösters 16eed1d8c2 chore: get rid of warnings 2021-03-24 12:44:10 +01:00
Timo Kösters e50f2864de improvement: save state for send_join pdu 2021-03-24 11:46:15 +01:00
Timo Kösters e305889b72 feat: room_account_data endpoints 2021-03-24 08:48:28 +01:00
Timo Kösters 1d00a8c41f improvement: better logging
Use CONDUIT_LOG or the log setting in the config
2021-03-23 22:06:09 +01:00
Timo Kösters 46d8f36a2c fix: media thumbnail calculation and appservice detection 2021-03-23 21:18:16 +01:00
Timo Kösters 3ea7d162db fix: various improvements and fixes 2021-03-23 12:59:27 +01:00
Timo Kösters 363c629faf fix: signature key fetching, optimize push sending 2021-03-22 14:04:41 +01:00
Timo Kösters d4c76f4654 chore: update ruma 2021-03-18 19:38:08 +01:00
Timo Kösters f775c76d8a chore: get rid of warnings 2021-03-18 18:33:43 +01:00
Timo Kösters abe9122df6 Merge branch 'more-gitignore' into 'master'
Add more gitignore

See merge request famedly/conduit!42
2021-03-18 17:09:04 +00:00
Gabriel Souza Franco 7b3fe88345 Send proper Host header in federation requests 2021-03-18 17:59:16 +01:00
Timo Kösters 5cb15551f3 improvement: use db compression 2021-03-18 13:13:08 +01:00
Timo Kösters a0fa0ee7a0 fix: join appservice room with alias 2021-03-18 12:03:44 +01:00
Timo Kösters a77fcd106e feat: implement /state_ids and fix federation stuff 2021-03-18 00:11:13 +01:00
Timo Kösters 100307c936 improvement: optimize state storage 2021-03-17 22:31:28 +01:00
Timo Kösters 44425a903a fix: multiple federation/pusher fixes 2021-03-16 18:00:46 +01:00
Timo Kösters 21f785d530 Merge branch 'correct-sendtxn' into pushers 2021-03-15 09:56:04 +01:00
Jonathan de Jong 0367028203 add settings.json 2021-03-14 11:55:28 +01:00
Jonathan de Jong d0d5bc412b Add more gitignore 2021-03-13 20:33:16 +01:00
Jonathan de Jong f79053484b Add .gitlab-ci.yml 2021-03-13 20:18:56 +01:00
Timo Kösters 6da40225bb improvement: make state res actually work 2021-03-13 16:30:12 +01:00
Timo Kösters e785ff6f56 Merge branch 'sled-no-metrics' into 'master'
fix: avoid illegal instruction crash

See merge request famedly/conduit!38
2021-03-12 17:29:47 +00:00
Timo Kösters 7bc58461cd fix: avoid illegal instruction crash
see https://github.com/spacejam/sled/issues/1232
2021-03-12 16:22:35 +01:00
Timo Kösters 6538d91567 Merge branch 'readme' into 'master'
docs: add icon and license to readme

See merge request famedly/conduit!37
2021-03-04 20:37:50 +00:00
Timo Kösters 96431069a9 docs: add icon and license to readme 2021-03-04 21:37:24 +01:00
Timo Kösters 3436e844c2 Merge branch 'valkum-master-patch-62987' into 'master'
Fix Complement CI paths

See merge request famedly/conduit!36
2021-03-04 17:51:52 +00:00
Rudi Floren 156296ac05 Fix Complement CI paths
The final container tried to COPY from the default cargo target dir, but we only checked if cached_target is present.
We copy from cached_target to target when cached_target is present now in the builder
2021-03-04 17:22:23 +00:00
Timo Kösters 643109309b Merge branch 'incoming-pdu' into 'master'
fix: don't accept incoming pdus if we know about them already

Closes #70

See merge request famedly/conduit!33
2021-03-04 14:38:07 +00:00
Timo Kösters 03440f4b15 Merge branch 'readme' into 'master'
docs: small readme changes

See merge request famedly/conduit!35
2021-03-04 14:35:12 +00:00
Timo Kösters 79c910efdf Merge branch 'clippy_again' into 'master'
Fix more clippy errors in master

See merge request famedly/conduit!34
2021-03-04 14:30:28 +00:00
Timo Kösters bb1064ce04 docs: small readme changes 2021-03-04 15:28:28 +01:00
Rudi Floren 4027cbd01d Fix various clippy errors 2021-03-04 15:27:25 +01:00
Rudi Floren 6309506a48 Allow suspicious_else_formatting
This is probably unfixable because it is caused by macros
2021-03-04 15:26:34 +01:00
Devin Ragotzy 0d55964d24 Run nightly cargo fmt 2021-03-04 08:45:23 -05:00
Devin Ragotzy d0df8b495c Merge remote-tracking branch 'upstream/master' into correct-sendtxn 2021-03-04 08:39:16 -05:00
Devin Ragotzy e239014fa3 Query for the correct server 2021-03-04 08:02:41 -05:00
Timo Kösters 1ce00f90fe fix: don't accept incoming pdus if we know about them already 2021-03-04 13:37:16 +01:00
Timo Kösters bd6507eafb Merge branch 'valkum-master-patch-25423' into 'master'
Make clippy happy (needless-return, etc.)

See merge request famedly/conduit!23
2021-03-04 12:35:12 +00:00
Rudi Floren 231c6032f4 Make clippy happy (needless-return, etc.) 2021-03-04 12:35:12 +00:00
Timo Kösters eaeba35f3c Merge branch 'valkum/complement' into 'master'
Sync paths with CI pipeline due to dockerignore

See merge request famedly/conduit!24
2021-03-04 12:32:55 +00:00
Timo Kösters 3e274d7d2c Merge branch 'valkum/conduit-update_rocket' into 'master'
update dependencies

See merge request famedly/conduit!32
2021-03-04 12:32:22 +00:00
Timo Kösters 105f893cf3 chore: bump other dependencies to make it work 2021-03-04 12:29:08 +01:00
Timo Kösters a04860b513 Merge branch 'as-fix' into 'master'
fix: apply the same appservice sending rules to events coming from federation

See merge request famedly/conduit!31
2021-03-04 11:18:00 +00:00
Timo Kösters 437cb5783a fix: apply the same appservice sending rules to events coming from federation
currently this code is duplicated from database/rooms.rs, when we
refactor server_server.rs we should deduplicate it
2021-03-04 11:34:38 +01:00
Rudi Floren f4039902d8 Bump Rocket to current HEAD 2021-03-03 22:42:10 +01:00
Timo Kösters 1a940b6e05 Merge branch 'as-fix' into 'master'
fix: don't always query aliases of appservices

See merge request famedly/conduit!29
2021-03-03 21:07:18 +00:00
Timo Kösters f2ec2be821 fix: don't always query aliases of appservices
only do so if the alias matches the regex in the registration file
2021-03-03 21:53:32 +01:00
Timo Kösters 1a198e7336 Merge branch 'jaeger' into 'master'
feat: opentelemetry/jaeger support

See merge request famedly/conduit!28
2021-03-02 14:14:26 +00:00
Timo Kösters 4155a47db1 feat: opentelemetry/jaeger support 2021-03-02 15:08:54 +01:00
Timo Kösters 066d5b92da Merge branch 'sending' into 'master'
fix: sending code got stuck sometimes

See merge request famedly/conduit!25
2021-03-02 14:04:11 +00:00
Timo Kösters f7713fdf2e fix: sending code got stuck sometimes 2021-03-02 14:58:46 +01:00
Timo Kösters 566b8ebabb Merge branch 'receipt-and-txnid' into 'master'
/receipt and transaction ids for federated requests

Closes #11

See merge request famedly/conduit!27
2021-03-02 13:49:14 +00:00
Timo Kösters 278751eb23 improvement: use transaction ids for federation requests 2021-03-02 14:36:48 +01:00
Timo Kösters dd68031b69 improvement: implement /receipt 2021-03-02 14:33:35 +01:00
Devin Ragotzy 79c9de98cd Add trusted_servers, filter servers to query keys by trusted_servers 2021-03-01 09:17:53 -05:00
Devin Ragotzy c9f4ff5cf8 Ask multiple servers for keys when not known or sending server failed 2021-03-01 08:23:28 -05:00
Devin Ragotzy f3253f2033 Move comments about Rooms trees to doc comments 2021-02-28 18:53:17 -05:00
Devin Ragotzy 0dd8a15c49 Fix leaves not being replaced by correct eventId in membership
Update ruma
2021-02-27 16:09:22 -05:00
Timo Kösters a9239a4d0b Merge branch 'larodar-master-patch-53953' into 'master'
Chore: Add Issue Template

See merge request famedly/conduit!26
2021-02-26 15:00:19 +00:00
Niklas Zender a601c29c97 Chore: Add Issue Template 2021-02-26 14:55:06 +00:00
Devin Ragotzy 0cc6448dbe Temp disable rust_2018_idioms for CI 2021-02-23 17:21:01 -05:00
Devin Ragotzy 8f283510aa Fix unused import clippy warning 2021-02-23 17:21:01 -05:00
Devin Ragotzy 48601142f8 Use auth_cache to avoid db, save state for every event when joining 2021-02-23 17:21:01 -05:00
Devin Ragotzy 74d530ae0e Address review issues, fix forward extremity calc
Keep track of all prev_events since if we know that an event is a
prev_event it is referenced and does not qualify as a forward extremity.
2021-02-23 17:21:01 -05:00
Devin Ragotzy 591769d5f3 Fiter PDU's before main incoming PDU loop 2021-02-23 17:21:01 -05:00
Devin Ragotzy 64374b4679 Use eventId when saving outliers 2021-02-23 17:21:01 -05:00
Devin Ragotzy e09be2f7ee Add incoming event to the current room state then resolve
All state snapshots that are used in the resolve call are state after
snapshots, they have the event inserted.
2021-02-23 17:21:01 -05:00
Devin Ragotzy 6661de50ab Fix and integrate outlier tree, build forks after adding event to DB 2021-02-23 17:21:01 -05:00
Devin Ragotzy 6fd3e1d1dd Append state event that pass resolution to DB, update to tokio 1.1 2021-02-23 17:21:01 -05:00
Devin Ragotzy e0453e2348 Cleanup dbg prints and error messages 2021-02-23 17:21:01 -05:00
Devin Ragotzy 68f60933e6 Resolved state is set as the current room state on incoming events 2021-02-23 17:21:01 -05:00
Devin Ragotzy 05a4c0b325 Finish forward extremity gathering, use resolved state as new snapshot 2021-02-23 17:21:01 -05:00
Timo Kösters 602edfd849 feature: push rule settings 2021-02-23 17:21:01 -05:00
Devin Ragotzy 88c60605b4 Add ability to update room leaves with multiple eventIds
Tokio seems a bit broken with Rocket...
2021-02-23 17:21:01 -05:00
Devin Ragotzy 66af1ff695 Update ruma and rocket to latest git rev and tokio to 1.0
Ruma updated the event signing validation code and there was a dep
resolving failure with serde rocket and tokio so I updated rocket latest and
tokio 1.0 to fix.
2021-02-23 17:20:52 -05:00
Valkum aa7b6b6e09 Sync paths with CI pipeline due to dockerignore#
As the docker ignore file includes the target dir, content in this dir
is no accessible to the docker daemon.
We circumvent this by providing the build artifact in a dir called
cached_dir
2021-02-22 19:07:39 +01:00
Timo Kösters 835cf80acd fix: pushers 2021-02-11 13:17:21 +01:00
Devin Ragotzy 7309b2fba9 WIP gather and update forward extremities 2021-02-09 15:25:30 -05:00
Devin Ragotzy 94da569119 Fixing the incoming events algorithm (review with time) 2021-02-09 15:25:22 -05:00
Devin Ragotzy db0aee3318 Use the auth_events for step 6, WIP forward_extremity_ids fn 2021-02-09 15:25:10 -05:00
Devin Ragotzy 4b2eb5ab82 Fix ALL clippy warnings 2021-02-09 15:25:00 -05:00
Devin Ragotzy 4cf530c55b Abstract event validation/fetching, add outlier and signing key DB trees
Fixed the miss named commented out keys in conduit-example.toml.
2021-02-09 15:24:09 -05:00
Devin Ragotzy 52392628e9 Convert uses of Box<ServerName> to a ref 2021-02-09 15:22:22 -05:00
Devin Ragotzy d108a735a4 State resolution outline for /send 2021-02-09 15:22:12 -05:00
Devin Ragotzy d0b8d0f5fd Fix signature/hash checks, fetch recursive auth events 2021-02-09 15:22:02 -05:00
Devin Ragotzy 168ae8dca0 Fill event_map with all events that will be needed for resolution 2021-02-09 15:21:51 -05:00
Devin Ragotzy 8de0d9f9ce Remove StateStore trait from state-res collect events needed 2021-02-09 15:21:41 -05:00
Devin Ragotzy cdeb1236a2 Fix clippy warnings remove unused imports 2021-02-09 15:21:14 -05:00
Devin Ragotzy 63af3d3da0 Step 5 in /send just fetches state from incoming server 2021-02-09 15:20:07 -05:00
Devin Ragotzy 4b9976aa74 Update state-res, use the new Event trait
This also bumps ruma to latest and removes js_int infavor of the ruma
re-export
2021-02-09 15:19:47 -05:00
Devin Ragotzy 4a92a29b56 State resolution outline for /send 2021-02-09 15:18:47 -05:00
Timo Kösters fb9880fee9 Merge branch 'are-we-synpase-sync' into 'master'
Sync are-we-synapse with dendrite

See merge request famedly/conduit!21
2021-02-07 21:36:05 +00:00
Timo Kösters 098ecb2ca3 Merge branch 'jwt-token-fixed' into 'master'
Add 'm.login.token' authentication

See merge request famedly/conduit!5
2021-02-07 17:11:53 +00:00
Timo Kösters d49911c5e0 Add 'm.login.token' authentication 2021-02-07 17:38:45 +01:00
Timo Kösters 3588dcd6d0 Merge branch 'deviceid-login' into 'master'
Handle optional device_id field during login

See merge request famedly/conduit!16
2021-02-07 12:28:05 +00:00
Timo Kösters 2d7012cdb1 Merge branch 'appservices' into 'master'
Appservices

Closes #29

See merge request famedly/conduit!11
2021-02-07 12:24:28 +00:00
Timo Kösters ea1e4625d1 fix: default config options 2021-02-07 13:20:00 +01:00
Timo Kösters 6924dfc8ea improvement: better appservice compatibility and optimizations 2021-02-06 15:28:30 +01:00
Timo Kösters 7be2a83195 Merge branch 'valkum/complement' into 'master'
Complement Testing: Fix binary name typo

See merge request famedly/conduit!20
2021-02-05 08:52:25 +00:00
Valkum 1d7207b39e Sync are-we-synapse with dendrite 2021-02-05 02:06:14 +01:00
Valkum a61b1cef5b Fix binary name typo 2021-02-04 23:51:20 +01:00
Timo Kösters a478ec0443 Merge branch 'cleanup' into 'master'
Update repository link in crate metadata

See merge request famedly/conduit!19
2021-02-03 18:30:11 +00:00
Timo Kösters fd3fb3a7ed Merge remote-tracking branch 'famedly/master' into appservices 2021-02-03 12:54:37 +01:00
Jonas Platte 6de5b3c2a0 Update repository link in crate metadata 2021-02-02 18:14:00 +01:00
Devin Ragotzy e4dc7ea8ac Prevent admin room from recursively spamming itself and user -> user 2021-01-30 11:52:48 -05:00
Devin Ragotzy 73124629b7 Add general rules matching for pusher, calc unread msgs 2021-01-29 21:48:35 -05:00
Devin Ragotzy 2d69e81699 WIP: send out push notification, impl pusher routes
It seems in order to test this I may also have to impl the email 3pid
route? I need to call the set_pusher route somehow.
2021-01-29 21:48:09 -05:00
Devin Ragotzy a0ecd76e21 Run cargo fmt using nightly 2021-01-29 21:48:09 -05:00
Devin Ragotzy 56b816a2be Fix and integrate outlier tree, build forks after adding event to DB 2021-01-29 21:45:33 -05:00
Devin Ragotzy cd0c5c0566 Append state event that pass resolution to DB, update to tokio 1.1 2021-01-29 11:20:33 -05:00
Devin Ragotzy b8b40ce38b Cleanup dbg prints and error messages 2021-01-28 15:50:45 -05:00
Devin Ragotzy 894b6ef037 Resolved state is set as the current room state on incoming events 2021-01-28 15:33:41 -05:00
Timo Kösters 265fab843a feature: push rule settings 2021-01-28 20:47:19 +01:00
Devin Ragotzy 35c1904b37 Finish forward extremity gathering, use resolved state as new snapshot 2021-01-24 20:18:40 -05:00
Timo Kösters a119d858f3 feature: push rule settings 2021-01-24 16:07:49 +01:00
Timo Kösters 87a0019f3a Merge branch 'valkum/complement' into 'master'
Allow the complement test image to use build artifacts

See merge request famedly/conduit!17
2021-01-23 07:43:05 +00:00
Valkum a1e296374f Allow the complement test image to use build artifacts 2021-01-22 20:11:19 +01:00
Devin Ragotzy a897608025 Roll back tokio and rocket update since ruma's request is at 0.2 tokio 2021-01-18 19:59:08 -05:00
Devin Ragotzy 3a6f264450 Add ability to update room leaves with multiple eventIds
Tokio seems a bit broken with Rocket...
2021-01-18 19:41:38 -05:00
Devin Ragotzy 00436a32b0 Update ruma and rocket to latest git rev and tokio to 1.0
Ruma updated the event signing validation code and there was a dep
resolving failure with serde rocket and tokio so I updated rocket latest and
tokio 1.0 to fix.
2021-01-18 19:36:44 -05:00
Devin Ragotzy c65bde41e0 WIP gather and update forward extremities 2021-01-18 19:08:59 -05:00
Devon Hudson 762255fa8d Simplify device creation logic during login 2021-01-17 08:39:47 -07:00
Devon Hudson 890187e004 improvement: Handle optional device_id field during login
remove debug logging
2021-01-16 22:19:48 -07:00
Timo Kösters 9424ba0559 Merge branch 'logout-devices' into 'master'
Respect logout_devices param on password change

See merge request famedly/conduit!15
2021-01-16 22:35:08 +00:00
Devon Hudson ebb38cd330 improvement: respect logout_devices param on password change
Move logout devices comment next to relevant loop

remove unnecessary log
2021-01-16 15:14:50 -07:00
Devin Ragotzy b1ae2bbeb2 Fixing the incoming events algorithm (review with time) 2021-01-16 16:37:20 -05:00
Devin Ragotzy 96dc6be14b Use the auth_events for step 6, WIP forward_extremity_ids fn 2021-01-15 15:46:47 -05:00
Devin Ragotzy 5a8041969d Fix ALL clippy warnings 2021-01-15 11:05:57 -05:00
Devin Ragotzy 851eb555b6 Abstract event validation/fetching, add outlier and signing key DB trees
Fixed the miss named commented out keys in conduit-example.toml.
2021-01-14 21:32:22 -05:00
Devin Ragotzy 2ac3ffbb24 Convert uses of Box<ServerName> to a ref 2021-01-14 15:11:55 -05:00
Devin Ragotzy 7c4e116caa State resolution outline for /send 2021-01-14 15:07:40 -05:00
Devin Ragotzy 27c4e9d9d5 Fix signature/hash checks, fetch recursive auth events 2021-01-14 14:36:24 +01:00
Devin Ragotzy 88f3ee489b Fill event_map with all events that will be needed for resolution 2021-01-14 14:31:47 +01:00
Devin Ragotzy 8a035880f0 Remove StateStore trait from state-res collect events needed 2021-01-14 14:30:24 +01:00
Devin Ragotzy 7c4d74bf9b Fix clippy warnings remove unused imports 2021-01-14 14:30:24 +01:00
Devin Ragotzy 0ee239c9d7 Step 5 in /send just fetches state from incoming server 2021-01-14 14:30:23 +01:00
Devin Ragotzy 9e83d2b2d5 Update state-res, use the new Event trait
This also bumps ruma to latest and removes js_int infavor of the ruma
re-export
2021-01-14 14:30:19 +01:00
Devin Ragotzy 690c066064 State resolution outline for /send 2021-01-14 14:28:32 +01:00
Paul van Tilburg c263e13000 fix: update binary file name in docs for consistency 2021-01-11 20:28:47 +01:00
Timo Kösters ad7b3f184b improvement: send 200 response for turn server info
We didn't implement it, but this will stop clients from retrying the
endpoint every minute
2021-01-11 17:26:47 +01:00
Timo Kösters d45d033bf1 fix: send presence updates when going offline
remaining bug: conduit sends presence updates every 5 minutes even if
the user is already offline
2021-01-10 17:12:34 +01:00
Timo Kösters b4818716b8 improvement: better deploy guide 2021-01-01 22:21:05 +01:00
Timo Kösters d7e56dbfa0 docs: recommend using binaries 2021-01-01 11:27:01 +01:00
Timo Kösters 3bdaf6e79e improvement: better default config 2021-01-01 11:24:09 +01:00
Timo Kösters 85364a9c27 improvement: change federation_enabled to federation_disabled
This enables federation by default
2021-01-01 10:52:43 +01:00
Timo Kösters edfd3c1f34 improvement: better config, better logs 2020-12-31 21:07:55 +01:00
Timo Kösters df16b2ba98 fix: rare state races 2020-12-31 14:52:08 +01:00
Timo Kösters 2cf6fd57b7 improvement: don't send pdus to appservices if it isn't interested
TODO: we need to send pdus if a user of the appservice is in the room
but not the appservice user itself
2020-12-23 19:41:54 +01:00
Timo Kösters fb9bd34696 improvement: better warnings when server is unreachable 2020-12-23 15:53:41 +01:00
Timo Kösters c1bc70aeca Merge branch 'kuboschek/conduit-always-query-srv' into appservices 2020-12-22 20:35:43 +01:00
Leonhard Kuboschek 8dcc1dfe56 improvement: always use port from SRV lookups
Also query SRV records when well-known is not found, fixes #29
2020-12-22 20:34:07 +01:00
Timo Kösters f12fbca3c5 fix: send state in /sync, element displays wrong membership changes 2020-12-22 20:22:17 +01:00
Timo Kösters 6606e41dde feat: improved state store 2020-12-20 13:34:11 +01:00
Timo Kösters 6e5b35ea92 feat: implement appservices
this also reverts some stateres changes
2020-12-08 12:59:20 +01:00
Timo Kösters d62f17a91a improvement: cache actual destination 2020-12-06 11:05:51 +01:00
Timo Kösters 9d4c7c34a0 Merge branch 'cargo-deb-packaging' into 'master'
Add Debian packaging via cargo-deb

See merge request famedly/conduit!3
2020-12-06 07:31:09 +00:00
Timo Kösters 45086b54b3 improvement: upgrade dependencies, fix timeline reload bug 2020-12-05 21:04:34 +01:00
Devin Ragotzy 164b1633d8 Update ruma to latest, renamed server keys and removed PduStub 2020-12-05 17:44:54 +01:00
Devin Ragotzy b869aab5d0 Cleanup removing debug printing and logging, append non state events 2020-12-05 17:37:13 +01:00
Devin Ragotzy c173ce43a5 convert_to_outgoing_federation_event takes CanonicalJsonObj 2020-12-05 17:37:12 +01:00
Devin Ragotzy 27e686f9ff Convert uses of serde_json::Value to CanonicalJsonObject 2020-12-05 17:37:12 +01:00
Devin Ragotzy b6d721374f Have Media db return optional content_type, conversion fixes 2020-12-05 17:37:11 +01:00
Devin Ragotzy bb24f6ad90 Address some review issues fmt, errors, comments 2020-12-05 17:37:11 +01:00
Devin Ragotzy 86bb93f8cf Remove outdated TODOs, use StateEvent::from_id_value consistently 2020-12-05 17:37:10 +01:00
Devin Ragotzy 234b226468 Fix review issues, Remove EventHash's in prev/auth_events in StateEvent
The latest state-res crate uses ruma's PduRoomV3 PDU's which don't have
tuples of (EventId, EventHashs) like previous versions did (this was
left from rebasing onto master). The Media DB
now takes an optional content_type like the updated ruma structs.
2020-12-05 17:37:10 +01:00
Devin Ragotzy acd144e934 Fix get_closest_parent and cleanup federation/send/:txn 2020-12-05 17:37:10 +01:00
Devin Ragotzy b13049a6fa Fix federated join miss hashing the join event created 2020-12-05 17:37:09 +01:00
Devin Ragotzy eca0bbb35a Fix federated join miss hashing the join event created 2020-12-05 17:37:09 +01:00
Devin Ragotzy dcd1163806 All outgoing pdus in Sending must be PduStubs 2020-12-05 17:37:08 +01:00
Devin Ragotzy c9a6ce54cb Add basic handling of EDUs for /send/txn 2020-12-05 17:37:08 +01:00
Devin Ragotzy 0d69ebdc6c Reformat imports and fix clippy warnings 2020-12-05 17:37:07 +01:00
Devin Ragotzy db8a0c5d69 Add closest_parent method to Rooms Db insert in order /send pdus 2020-12-05 17:37:07 +01:00
Devin Ragotzy 96dd3b2880 Update ruma to latest, fix unstable origin feature in ruma 2020-12-05 17:37:07 +01:00
Timo Kösters 49f6ab503a Merge branch 'better-logs' into 'master'
feat: send logs into admin room

See merge request famedly/conduit!6
2020-12-05 16:36:05 +00:00
Timo Kösters 6e36081573 improvement: more logging 2020-12-05 17:35:00 +01:00
Timo Kösters 9439f2c183 feat: send logs into admin room
Log entries will automatically be deduplicated, so a message won't be
sent if the same line has already been sent in the last 30 mins
2020-12-05 17:34:58 +01:00
Timo Kösters ecea0d4af2 Merge branch 'fix-admin-room' into 'master'
fix: logging thread crash when admin room does not exist

See merge request famedly/conduit!9
2020-12-05 16:31:18 +00:00
Timo Kösters e691e880e0 fix: logging thread crash when admin room does not exist 2020-12-02 16:08:59 +01:00
Paul van Tilburg 1a341543ba Lock down the Conduit process in the systemd unit
This will secure the service more and allow only what is necessary.
2020-11-24 14:42:20 +01:00
Paul van Tilburg 1b4a79d47c Add and install README.Debian
This file documents how the packaging is organized and how to
configure and use it.  It also details what the default deployment
is like.
2020-11-24 14:42:20 +01:00
Paul van Tilburg f72554de10 Split config into a Debian and local part
* The Debian part will be generated and managed by Debconf and configure
  homeserver name, address and port
* The local part will just be a config file that shows the other
  configuration options

Added the address configuration and moved the config generation
from the config to the postinst script.
2020-11-24 14:42:18 +01:00
Paul van Tilburg 79692db45d First version of cargo-deb packaging setup 2020-11-24 14:38:15 +01:00
Timo Kösters 7078443460 Merge branch 'fix_complement' into 'master'
Fix complement

See merge request famedly/conduit!7
2020-11-18 20:17:50 +00:00
Timo Kösters 998f9e2109 Merge branch 'sending' into 'master'
Sending improvements

See merge request famedly/conduit!2
2020-11-09 19:28:56 +00:00
Rudi Floren fc08b13db1 Change CA to PKI per naming in Complement 2020-11-09 17:32:04 +01:00
Rudi Floren e4c5ed96a9 Sync with newest complement changes 2020-11-09 17:21:35 +01:00
Timo Kösters 9f8cffcd22 Admin room improvements 2020-11-09 12:21:57 +01:00
Timo Kösters 16b22bb432 fix: don't allow more than 50 PDUs in a transaction 2020-11-03 21:53:57 +01:00
Rudi Floren 335a33c901 Fix and Improve Complement testing Dockerfile 2020-10-30 02:57:22 +01:00
Timo Kösters 0762196963 fix: don't send new events from left rooms 2020-10-27 20:26:28 +01:00
Timo Kösters 2f5df4aac9 improvement: more reliable federation sending 2020-10-27 20:26:27 +01:00
Timo Kösters 18f33b1ece Merge pull request 'Frequent flushing, configurable cache capacity, welcome message' (#237) from small-improvements into master
Reviewed-on: https://git.koesters.xyz/timo/conduit/pulls/237
2020-10-23 14:41:54 +02:00
Timo Kösters df82314440 improvement: welcome message 2020-10-23 14:38:12 +02:00
Timo Kösters 6b3934e31d feat: configurable cache capacity 2020-10-23 14:38:12 +02:00
Timo Kösters 6dbe195695 improvement: flush after every request that manipulates the db 2020-10-23 14:38:07 +02:00
Timo Kösters b2a1505535 Merge pull request 'improvement: correct thumbnailing algorithm' (#233) from fix-thumbnailing into master
Reviewed-on: https://git.koesters.xyz/timo/conduit/pulls/233
2020-10-19 17:46:22 +02:00
Timo Kösters 6bb8284fc0 improvement: correct thumbnailing algorithm 2020-10-19 17:21:28 +02:00
Timo Kösters de8bba4b49 Merge pull request 'Fix order of docker command arguments' (#232) from Weasy666/conduit:master into master
Reviewed-on: https://git.koesters.xyz/timo/conduit/pulls/232
Reviewed-by: Timo Kösters <timo@koesters.xyz>
2020-10-19 07:05:18 +02:00
Daniel Wiesenberg 2d6b7750fd Fix order of docker command arguments and change repository link to...
...github.com repo, to relieve some pressure from git.koesters.xyz.
2020-10-18 23:06:08 +02:00
Timo Kösters cde4178f4a Merge pull request 'fix: use device_id when registering' (#231) from fix-deviceid into master
Reviewed-on: https://git.koesters.xyz/timo/conduit/pulls/231
2020-10-18 21:54:37 +02:00
Timo Kösters f0a21b6165 fix: use device_id when registering
TIL body.device_id != (*body).device_id, which is pretty bad, so I
renamed body.device_id to body.sender_device
2020-10-18 21:51:28 +02:00
Timo Kösters 9936027e8f Merge pull request 'Change license to Apache-2.0' (#195) from license into master
Reviewed-on: https://git.koesters.xyz/timo/conduit/pulls/195
2020-10-18 19:37:18 +02:00
Timo Kösters fccd3fdb88 Merge pull request 'Allow unjoined users to read state of world readable rooms' (#230) from allow-reading-state into master
Reviewed-on: https://git.koesters.xyz/timo/conduit/pulls/230
2020-10-18 16:45:17 +02:00
Timo Kösters f6f15d9396 Use conduit.rs server in the README shield 2020-10-18 16:44:18 +02:00
Timo Kösters 243126d393 Allow reading state if history_visibility is world readable
See https://matrix.org/docs/spec/client_server/r0.6.1#id87
2020-10-18 16:44:18 +02:00
Timo a2dbc6fe6d Change license to Apache-2.0 2020-10-18 13:47:52 +02:00
Timo Kösters 9f487dd93a Merge pull request 'Update README.md' (#229) from update-readme into master
Reviewed-on: https://git.koesters.xyz/timo/conduit/pulls/229
2020-10-18 13:35:01 +02:00
Timo Kösters ce94ad05a7 Update README.md 2020-10-18 13:23:06 +02:00
Timo Kösters fbbf9f8999 Merge pull request 'docs: cross compile' (#226) from cross-compile into master
Reviewed-on: https://git.koesters.xyz/timo/conduit/pulls/226
2020-10-18 13:03:18 +02:00
Timo Kösters 935546b25b Merge pull request 'fix: random timeline reloads' (#227) from fix-random-timeline-reloads into master
Reviewed-on: https://git.koesters.xyz/timo/conduit/pulls/227
2020-10-18 09:56:28 +02:00
Timo Kösters 151ef07fb3 docs: cross compile 2020-10-18 09:04:11 +02:00
Timo Kösters 12b0efac8b fix: random timeline reloads 2020-10-18 09:03:40 +02:00
Timo Kösters f56b463278 Merge pull request 'fix: double join over federation' (#225) from join into master
Reviewed-on: https://git.koesters.xyz/timo/conduit/pulls/225
2020-10-17 11:29:03 +02:00
Timo Kösters 9109cb492f fix: double join over federation 2020-10-17 11:24:57 +02:00
Timo Kösters a89f7eaf9f Merge pull request 'Add complement support for CI' (#209) from valkum/complement into master
Reviewed-on: https://git.koesters.xyz/timo/conduit/pulls/209
2020-10-16 14:34:08 +02:00
Timo Kösters f7c2d23599 Merge branch 'master' into valkum/complement 2020-10-16 14:27:09 +02:00
Timo Kösters 294fae5cdb Merge pull request 'Update dependencies, remove dbgs' (#222) from deps into master
Reviewed-on: https://git.koesters.xyz/timo/conduit/pulls/222
2020-10-16 14:12:08 +02:00
Timo Kösters dfcfab5b7e Merge branch 'master' into deps 2020-10-16 14:06:14 +02:00
Timo Kösters 9d1387954f Update dependencies, remove dbgs 2020-10-16 14:04:29 +02:00
Timo Kösters 15fa7fb1cc Merge pull request 'Reduce media ID length from 256 to 32' (#216) from miruka/conduit:reduce-mxc-length into master
Reviewed-on: https://git.koesters.xyz/timo/conduit/pulls/216
Reviewed-by: Timo Kösters <timo@koesters.xyz>
2020-10-16 13:24:52 +02:00
Timo Kösters b6ed018d16 Merge branch 'master' into reduce-mxc-length 2020-10-14 11:48:25 +02:00
Timo Kösters 0e817f6951 Merge pull request 'Federation, Admin room and many fixes' (#221) from federation into master
Reviewed-on: https://git.koesters.xyz/timo/conduit/pulls/221
2020-10-13 19:04:42 +02:00
Timo Kösters 304c53c4f5 style: make clippy happier 2020-10-07 12:29:19 +02:00
Timo Kösters 4964e21342 Merge remote-tracking branch 'origin/master' into federation 2020-10-07 12:02:36 +02:00
Timo Kösters 6afc4c9b3e feat: federation disabled by default
It can be enable in the Rocket.toml config or using ROCKET_FEDERATION_ENABLED=true
2020-10-07 11:51:56 +02:00
Timo Kösters c15ae3c126 fix: invalid typing bytes because of 0xff in numbers 2020-10-07 11:51:56 +02:00
Timo Kösters bcd1fe1856 feat: admin room 2020-10-07 11:51:49 +02:00
Timo Kösters 0d6159c2da improvement: get_missing_events route and cleanup 2020-10-01 20:49:15 +02:00
Timo Kösters ab332363ce fix: don't send new requests to servers if we are already waiting 2020-10-01 20:49:14 +02:00
miruka 26e200e290 Reduce media ID length from 256 to 32
Most common filesystems limit paths to 255 bytes.
This change brings down the media ID length to be similar to
Synapse servers (25), and makes it possible for clients to
download media with the ID included in the filename.
2020-09-25 14:18:36 -04:00
Timo Kösters e08dfd982b improvement: look at SRV record when sending requests 2020-09-23 12:04:02 +02:00
Timo Kösters f0beffb0a9 Merge pull request 'Fix ruma dependency' (#211) from fix into master
Reviewed-on: https://git.koesters.xyz/timo/conduit/pulls/211
2020-09-20 18:18:45 +02:00
Timo Kösters 19207845bc Fix ruma dependency 2020-09-20 13:49:13 +02:00
Timo Kösters 267c721616 fix: encryption and sync spam 2020-09-18 10:29:44 +02:00
Timo Kösters 8bcfff2766 fix: no notification counts for fast /syncs 2020-09-18 10:29:43 +02:00
Timo Kösters ea3aaa6b5c improvement: more efficient /sync with gaps 2020-09-18 10:29:43 +02:00
Rudi Floren 009e36b680 Fix Caddy integration for reverse-proxy 2020-09-17 21:11:18 +02:00
Rudi Floren 7c456a0390 Update dockerignore
Removing Rocket-example.toml from here is fine,
as it is not included in the last stage of our build stages
2020-09-17 20:14:07 +02:00
Valkum da28c12eeb Try to add TLS reverse proxy for complement 2020-09-17 15:36:36 +02:00
Valkum 8d66428beb Add intermediate container to hide ARGs
ARGs contain secrets to speed up builds
2020-09-17 12:50:37 +02:00
Timo Kösters 506c2a3146 fix: can't find count from event in db 2020-09-17 10:24:18 +02:00
Valkum 3e03787551 Add Complement dockerfile and move sytest dir 2020-09-16 19:53:27 +02:00
Timo Kösters 4db6d7e430 fix: remove avatar url checks
They are not in the spec and maubot relies on that
2020-09-16 18:10:55 +02:00
Timo Kösters a567cd81d5 improvement: better logs on deserialization errors 2020-09-16 15:08:51 +02:00
Timo Kösters f4078a29eb fix: synapse complains about missing origin 2020-09-16 11:42:33 +02:00
Timo Kösters dd749b8aee fix: server keys and destination resolution when server name contains port 2020-09-16 11:01:04 +02:00
Timo Kösters 005e00e9b1 fix: remove well-known 2020-09-15 17:16:55 +02:00
Timo Kösters 1bf614b0f5 fix: remove transaction_id from pdus over federation 2020-09-15 17:02:20 +02:00
Timo Kösters b7ab57897b fix: sending slowness 2020-09-15 16:14:59 +02:00
Timo Kösters 0b263208e3 fix: don't panic on bad server names 2020-09-15 08:55:02 +02:00
Timo Kösters 71500b14b9 fix: send to all servers and fix media store 2020-09-15 08:17:15 +02:00
Timo Kösters f7816b11de feat: send messages over federation 2020-09-15 08:17:06 +02:00
Timo Kösters 9f05ef926a fix: filter public room dir 2020-09-14 16:23:15 +02:00
Timo d1099e9224 Update dependencies 2020-09-14 14:36:49 +02:00
Timo Kösters aa5e9e607e feat: download media and thumbnails over federation 2020-09-14 14:20:38 +02:00
Timo Kösters 4e44fedbcd fix: room list over federation 2020-09-14 11:43:42 +02:00
Timo Kösters c5313b3e8f improvement: try out multiple servers when joining remote rooms 2020-09-14 11:00:31 +02:00
Timo Kösters 1f292c09f2 improvement: better federation joins 2020-09-14 09:29:46 +02:00
Timo Kösters af53485d70 fix: avoid pdus without event ids 2020-09-12 23:38:52 +02:00
Timo Kösters 1f28434988 feat: hacky transactions 2020-09-12 22:42:05 +02:00
Timo Kösters e6b1f54857 Merge remote-tracking branch 'origin/master' into federation 2020-09-12 22:23:54 +02:00
Timo Kösters 12a8c9badd fix: join rooms over federation 2020-09-12 21:30:07 +02:00
Timo Kösters 1e8fbd8d50 Update ruma version 2020-09-08 17:32:03 +02:00
Timo Kösters b5488f86b5 Merge pull request 'Add room upgrade.' (#182) from q-b/conduit-fork:rooms_upgrade into master
Reviewed-on: https://git.koesters.xyz/timo/conduit/pulls/182
Reviewed-by: Timo Kösters <timo@koesters.xyz>
2020-09-01 13:10:30 +02:00
Timo Kösters 698e44a732 Fix /upgrade account data problems 2020-09-01 13:08:49 +02:00
Timo Kösters 515465f900 fix: make element not show "unknown user" warning
The 404 error for /profile in the spec says "There is no profile
information for this user or this user does not exist.", but Element
assumes every 404 is a user that does not exist.
2020-08-31 13:23:39 +02:00
Faelar df55e8ed0b Add room upgrade. 2020-08-31 12:01:41 +02:00
Timo Kösters aef0c8563c Merge pull request 'improvement: add remaining key backup endpoints' (#201) from keybackup into master
Reviewed-on: https://git.koesters.xyz/timo/conduit/pulls/201
2020-08-31 11:24:11 +02:00
Devin Ragotzy 2a63d0955a Sort and authenticate the events from /send_join response 2020-08-30 16:08:47 -04:00
Devin Ragotzy 3b40f3d60e Update state-res crate 2020-08-27 20:11:53 -04:00
Devin Ragotzy f46c2d1eec Fix review issues, move state-res to spec-comp branch 2020-08-27 20:11:53 -04:00
Timo Kösters 3f4cb753ee improvement: add remaining key backup endpoints 2020-08-27 14:52:20 +02:00
Timo Kösters d15b8d7c4e Merge pull request 'feat: handle txn ids' (#198) from txnids into master
Reviewed-on: https://git.koesters.xyz/timo/conduit/pulls/198
2020-08-25 21:35:24 +02:00
Timo 4954df3cc3 feat: handle txn ids 2020-08-25 21:33:44 +02:00
Devin Ragotzy d9a29e3e5c Fix state for empty key route
Replace None with Some("") for state_key
2020-08-25 15:30:25 -04:00
Timo Kösters 6343eea417 Merge pull request 'Docker add healthcheck and mention Docker Hub image' (#196) from Weasy666/conduit:master into master
Reviewed-on: https://git.koesters.xyz/timo/conduit/pulls/196
Reviewed-by: Timo Kösters <timo@koesters.xyz>
2020-08-25 09:40:08 +02:00
Daniel Wiesenberg 38ac3e42be Docker add healthcheck and mention Docker Hub image 2020-08-25 09:02:45 +02:00
Timo Kösters 0f524955b2 Merge pull request 'fix: send notification count updates when private read receipts change' (#194) from fixrr into master
Reviewed-on: https://git.koesters.xyz/timo/conduit/pulls/194
2020-08-24 13:39:39 +02:00
Timo 0c1cc8d82b Fix CI 2020-08-24 11:31:19 +02:00
Timo 33215d6099 fix: send notification count updates when private read receipts change 2020-08-24 10:46:20 +02:00
Timo Kösters 9aa5e99a0f Merge pull request 'fix: put reason of redaction in the redacted event' (#193) from redact into master
Reviewed-on: https://git.koesters.xyz/timo/conduit/pulls/193
2020-08-24 10:43:05 +02:00
Timo Kösters f0cb17d7a5 Merge branch 'master' into redact 2020-08-24 10:42:00 +02:00
Devin Ragotzy 27ffe77823 Use helper instead of route for get_public_rooms_filtered 2020-08-23 16:45:01 -04:00
Devin Ragotzy 1848f08292 Use full sorting algorithm on incoming PDU's in membership 2020-08-23 16:43:48 -04:00
Timo 3c26166fb5 improvement: device list works better
The only situation that isn't working yet is sending `left` events for
users when the sender leaves the room
2020-08-23 16:43:48 -04:00
Timo 972babbc79 fix: set limited to true when skipping messages in /sync 2020-08-23 16:43:21 -04:00
Devin Ragotzy 672bf4f473 Cargo lock update and a few doc additions 2020-08-23 16:43:21 -04:00
Devin Ragotzy fe795d38ea Replace route calling routes with helpers
This fixes the panic from ruma "index out of bounds"
2020-08-23 16:43:21 -04:00
Devin Ragotzy 5ccdd3694b Add helper function for get_alias route 2020-08-23 16:43:21 -04:00
Devin Ragotzy ea20032404 Helper for join_room_by_id route so routes aren't calling routes 2020-08-23 16:43:21 -04:00
Devin Ragotzy 64fb0374b6 Use Vec<u8> instead of string for digest bytes and add roomid_statehash 2020-08-23 16:43:21 -04:00
Devin Ragotzy d73c6aa8ad Add roomid_statehash tree, clean up review issues 2020-08-23 16:43:21 -04:00
Devin Ragotzy 846a0098c1 Split append_pdu -> append_pdu and build_and_append
Move all state event appending to append_state_pdu.
2020-08-23 16:43:21 -04:00
Devin Ragotzy cb68bf9e0c Use ring crate to generate StatHashes when saving stateid/statehash 2020-08-23 16:43:21 -04:00
Devin Ragotzy c4f5a0a631 Keep track of State at event for state resolution
feat: first steps towards joining rooms over federation
Add state-res as a dependency of conduit
Add reverse_topological_power_sort before append_pdu
Implement statehashstatid_pduid tree for keeping track of state
Clean up implementation of state_hash as key for tracking state
2020-08-23 16:43:21 -04:00
Timo 38663228f5 fix: put reason of redaction in the redacted event 2020-08-23 16:47:27 +02:00
Timo Kösters 8e55623bde Merge pull request 'More Federation' (#181) from docs into master
Reviewed-on: https://git.koesters.xyz/timo/conduit/pulls/181
2020-08-23 16:15:01 +02:00
Timo 7ba9263cc6 improvement: show most recent PDUs first when searching 2020-08-23 16:14:11 +02:00
Timo 366554630a fix: account registration 2020-08-23 16:14:11 +02:00
Timo 804d097a18 fix: wake up /sync for typing events 2020-08-23 16:14:10 +02:00
Timo c092f06068 docs: /sync 2020-08-23 16:14:10 +02:00
Timo df936e8e7e improvement: guests are more spec-conform 2020-08-23 16:14:10 +02:00
Timo 64789537f5 fix: device list when leaving rooms 2020-08-23 16:14:09 +02:00
Timo 4323cf5fec improvement: device list works better
The only situation that isn't working yet is sending `left` events for
users when the sender leaves the room
2020-08-23 16:14:09 +02:00
Timo f23fb32e95 fix: set limited to true when skipping messages in /sync 2020-08-23 16:14:09 +02:00
timokoesters e457e19088 feat: search pdus 2020-08-23 16:14:08 +02:00
Timo 27d35f5ab4 docs: fix /register method 2020-08-23 16:14:08 +02:00
Timo 69a7cb5142 fix dependency version 2020-08-23 16:14:07 +02:00
Timo 3ff17f69ad fmt 2020-08-23 16:14:07 +02:00
Timo 4be68eba76 feat: allow querying conduit's room list over federation 2020-08-23 16:14:07 +02:00
Timo 940f533d61 refactor: avoid some allocations when redacting 2020-08-23 16:14:06 +02:00
Timo 04eee089e0 feat: first steps towards joining rooms over federation 2020-08-23 16:14:06 +02:00
timokoesters f40f1d9f75 docs: endpoint documentation 2020-08-23 16:14:06 +02:00
Timo Kösters cfda76860b Merge pull request 'Make default server name more obvious' (#192) from spaetz/conduit:master into master
Reviewed-on: https://git.koesters.xyz/timo/conduit/pulls/192
Reviewed-by: Timo Kösters <timo@koesters.xyz>
2020-08-18 20:51:15 +02:00
Sebastian Spaeth 6b7e92ccf5 Make default server name more obvious
Too many people fell into the trap and left conduit.rs in the deployment
configuration, wondering why users are all listed as @conduit.rs.

Make the default server name really easy to identify and make it obvious
that this needs to be changed.
2020-08-18 19:18:10 +02:00
Timo Kösters 6191c3bd00 Merge pull request 'Fix license.' (#190) from q-b/conduit-fork:license into master
Reviewed-on: https://git.koesters.xyz/timo/conduit/pulls/190
Reviewed-by: Timo Kösters <timo@koesters.xyz>
2020-08-17 14:13:19 +02:00
Faelar 0fef955b28 Fix license. 2020-08-17 13:59:35 +02:00
Timo Kösters 2d96323d5f Merge pull request 'Update ruma' (#184) from jplatte/conduit:up-ruma into master
Reviewed-on: https://git.koesters.xyz/timo/conduit/pulls/184
Reviewed-by: Timo Kösters <timo@koesters.xyz>
2020-08-13 09:04:22 +02:00
Jonas Platte 75ea0b3163 Update ruma 2020-08-12 23:42:17 +02:00
Timo Kösters 4b3d6e736f Merge pull request 'Alpine based Docker image' (#152) from Weasy666/conduit:master into master
Reviewed-on: https://git.koesters.xyz/timo/conduit/pulls/152
Reviewed-by: Timo Kösters <timo@koesters.xyz>
2020-08-12 21:42:58 +02:00
Timo 2fc99c05e1 docs: add documentation to the repo and improve layout 2020-08-12 21:17:53 +02:00
Daniel Wiesenberg 87ed132ae4 Add README in docker folder and mention docker in Conduit's README 2020-08-11 15:38:24 +02:00
Daniel Wiesenberg 7288010e55 Move additional files into dedicated folder and make build the def...
...fault in the compose files.
2020-08-11 15:38:24 +02:00
Daniel Wiesenberg 31c725660f Add build option to compose file 2020-08-11 15:38:24 +02:00
Daniel Wiesenberg 7456caeefd Add Element-Web to compose and provide extra compose files for using..
..Conduit behind Traefik Reverse Proxy
2020-08-11 15:38:24 +02:00
Daniel Wiesenberg 5f3cb3f926 Minor modifications to compose file and update Dockerfile comments 2020-08-11 15:38:24 +02:00
Daniel Wiesenberg 0338053774 Add ability to switch between local and remote build with build arg a...
...nd add env vars to docker-compose
2020-08-11 15:38:24 +02:00
Daniel Wiesenberg ecb6416244 Image now builds and runs 🎉 Thx to the help of yzhr 2020-08-11 15:38:24 +02:00
Daniel Wiesenberg a21858758c Change labels from label-schema to opencontainer.image 2020-08-11 15:38:24 +02:00
Daniel Wiesenberg 624ff08a07 Initial docker files trinity
The image builds as is, but running it exits with: standard_init_linux.go:211: exec user process caused "no such file or directory"
2020-08-11 15:38:23 +02:00
Timo Kösters 0f1e3d8214 Merge pull request 'Make State struct constructable by lib user' (#178) from DevinR528/conduit:library-mode into master
Reviewed-on: https://git.koesters.xyz/timo/conduit/pulls/178
Reviewed-by: Timo Kösters <timo@koesters.xyz>
2020-08-04 08:03:41 +02:00
Devin Ragotzy da1c53aaef Make State struct constructable by lib user 2020-08-03 20:56:14 -04:00
Timo Kösters 4a8bc93b1a Merge pull request 'Send invites only if invited during the sync request' (#176) from gnieto/conduit:fix/send-invite-when-needed into master
Reviewed-on: https://git.koesters.xyz/timo/conduit/pulls/176
Reviewed-by: Timo Kösters <timo@koesters.xyz>
2020-08-02 10:41:05 +02:00
Guillem Nieto b575593647 Do not ignore db errors 2020-08-02 09:38:20 +02:00
Guillem Nieto 47abe6686e Send invites only if invited during the sync request
Fixes: https://git.koesters.xyz/timo/conduit/issues/175
2020-08-02 09:24:47 +02:00
Timo Kösters 935f0e6185 Merge pull request 'feat: handle /publicRooms pagination' (#174) from publicrooms-pagination into master
Reviewed-on: https://git.koesters.xyz/timo/conduit/pulls/174
2020-07-30 22:52:23 +02:00
timokoesters 98f37302a6 feat: handle /publicRooms pagination 2020-07-30 22:51:02 +02:00
Timo Kösters 5cfda2f5d3 Merge pull request 'feat: handle inhibit_login in /register' (#173) from inhibit-login into master
Reviewed-on: https://git.koesters.xyz/timo/conduit/pulls/173
2020-07-30 22:21:09 +02:00
timokoesters 0616acbde6 feat: handle inhibit_login in /register 2020-07-30 20:52:37 +02:00
Timo Kösters acc7b15981 Merge pull request 'refactor: put endpoints into modules' (#172) from route-files into master
Reviewed-on: https://git.koesters.xyz/timo/conduit/pulls/172
2020-07-30 19:09:43 +02:00
timokoesters c1c62b7eb4 refactor: put endpoints into modules 2020-07-30 18:34:03 +02:00
Timo Kösters 485a24398b Merge pull request 'Implement ignore invite when inviting user is ignored' (#164) from DevinR528/conduit:ignored-list-invite into master
Reviewed-on: https://git.koesters.xyz/timo/conduit/pulls/164
Reviewed-by: Timo Kösters <timo@koesters.xyz>
2020-07-30 15:27:08 +02:00
Devin Ragotzy 7a70d8488f Rebase with master and update append_pdu call 2020-07-30 09:22:51 -04:00
Devin Ragotzy c8d7d80eb2 Fix start/end token swap left from dropped commits 2020-07-30 09:22:51 -04:00
Devin Ragotzy 99220565d4 Fix invite leave auth error by moving update_membership 2020-07-30 09:22:51 -04:00
Devin Ragotzy 25c0e75f29 Cargo fmt 2020-07-30 09:22:51 -04:00
Devin Ragotzy 8aac332b3a Move ignore invite logic into update_member 2020-07-30 09:22:51 -04:00
Devin Ragotzy f2fab27d81 Implement filtering invites if sender is ignored by receiver 2020-07-30 09:22:51 -04:00
Timo Kösters 100e3d6d6d Merge pull request 'improvement: handle limit and set limited in /user_directory/search' (#169) from user-dir-limit into master
Reviewed-on: https://git.koesters.xyz/timo/conduit/pulls/169
2020-07-30 15:19:21 +02:00
timokoesters 52b1df6fd2 improvement: handle limit and set limited in /user_directory/search 2020-07-30 15:17:34 +02:00
Timo Kösters 18dcf44aa4 Merge pull request 'fix: send device list updates when user is in no rooms' (#170) from fix-set-up-encryption into master
Reviewed-on: https://git.koesters.xyz/timo/conduit/pulls/170
2020-07-30 14:46:27 +02:00
timokoesters ce460ea159 fix: send device list updates when user is in no rooms 2020-07-30 14:09:05 +02:00
Timo Kösters c824652de6 Merge pull request 'Fix clippy warnings and run rustfmt' (#163) from DevinR528/conduit:clippy-fix2 into master
Reviewed-on: https://git.koesters.xyz/timo/conduit/pulls/163
Reviewed-by: Timo Kösters <timo@koesters.xyz>
2020-07-30 08:20:31 +02:00
timokoesters b67372b11b refactor: make all mods in database pub
Now they can easily export their own structs
2020-07-29 21:48:31 +02:00
Devin Ragotzy d948f896c0 Turn append_pdu args into struct PduBuilder 2020-07-29 21:47:09 +02:00
Devin Ragotzy 1c6f211933 Create media::FileMeta to represent a file and meta data 2020-07-29 21:33:48 +02:00
Devin Ragotzy 2da48b941d Convert all map_err -> expect when deserializing to Raw 2020-07-29 21:33:47 +02:00
Devin Ragotzy 62df9ca580 Fix all clippy warnings, shorten line len in client_server 2020-07-29 21:32:35 +02:00
Timo Kösters 3ccbd02081 Merge pull request 'Long polling and more' (#162) from longpoll into master
Reviewed-on: https://git.koesters.xyz/timo/conduit/pulls/162
2020-07-29 21:17:58 +02:00
timokoesters e0d0fb4703 fix: only send device_one_time_keys_count when there are updates 2020-07-29 20:44:06 +02:00
timokoesters 66bc25fcd3 feat: implement /keys/changes 2020-07-29 18:05:16 +02:00
timokoesters 0693387769 improvement: more efficient /sync and only send device updates when sharing a room 2020-07-29 17:03:04 +02:00
timokoesters 310b0fcd86 fix ci 2020-07-29 13:05:38 +02:00
timokoesters d891bbb5dc improve: presence 2020-07-29 13:05:38 +02:00
timokoesters 05f9d927b8 fix: account data 2020-07-29 13:05:37 +02:00
timokoesters 21eb8d4fe3 fix: problems with pdu serialization 2020-07-29 12:59:40 +02:00
timokoesters dd3dab39ae feat: whoami route 2020-07-29 12:59:40 +02:00
timokoesters 489cbc0a93 refactor: use <_> instead of <_parameter_name> 2020-07-29 12:59:36 +02:00
gnieto cc411c530b Fix custom account data serialization (#165)
Stylistic change

Fix custom data serialization

Build a custom event before storing global account data

Co-authored-by: Guillem Nieto <gnieto.talo@gmail.com>
Reviewed-on: https://git.koesters.xyz/timo/conduit/pulls/165
Reviewed-by: Timo Kösters <timo@koesters.xyz>
2020-07-29 07:48:34 +02:00
Timo Kösters c4260bde81 Merge pull request 'Timo's Conditionally emit rocket::http_verb attr macros if lib/bin' (#157) from timo-make-lib into master
Reviewed-on: https://git.koesters.xyz/timo/conduit/pulls/157
2020-07-27 20:40:30 +02:00
Devin Ragotzy e6a1b0b66f Add cfg_attr gate to server_server endpoints 2020-07-27 18:54:43 +02:00
Devin Ragotzy 42e0102a2a Conditionally emit rocket::http_verb attr macros if lib/bin 2020-07-27 18:54:43 +02:00
Timo Kösters b82fd02ee3 Merge pull request 'Implement /rooms/<room_id>/joined_members' (#143) from joined_members into master
Reviewed-on: https://git.koesters.xyz/timo/conduit/pulls/143
2020-07-27 18:22:04 +02:00
CapsizeGlimmer 4d4969862a Implement /rooms/<room_id>/joined_members 2020-07-27 18:21:06 +02:00
Timo Kösters fdb7b8f0f1 Merge pull request 'Implement max_request_size config option' (#153) from media-size-config into master
Reviewed-on: https://git.koesters.xyz/timo/conduit/pulls/153
Reviewed-by: Timo Kösters <timo@koesters.xyz>
2020-07-27 18:08:50 +02:00
timokoesters 5f47cbf7dc improvement: documentation 2020-07-27 18:06:36 +02:00
CapsizeGlimmer 8fcf8e20b8 fix MR 153 requests; cargo fmt 2020-07-27 17:50:21 +02:00
CapsizeGlimmer fa2da9e048 Implement max_request_size config option 2020-07-27 17:49:11 +02:00
Timo Kösters 3451b10a4b Merge pull request 'Fix CI' (#161) from fix-ci into master
Reviewed-on: https://git.koesters.xyz/timo/conduit/pulls/161
2020-07-27 08:21:34 +02:00
timokoesters 2765071201 Fix CI 2020-07-27 08:19:14 +02:00
Timo Kösters 75d91b9064 Merge pull request 'feat: encryption_disabled config option' (#160) from disable-encryption-config into master
Reviewed-on: https://git.koesters.xyz/timo/conduit/pulls/160
2020-07-27 08:15:04 +02:00
timokoesters 808a7deae3 cargo fmt 2020-07-26 22:45:10 +02:00
timokoesters dc5fb7e33a feat: encryption_disabled config option
Can be used with ROCKET_ENCRYPTION_DISABLED=true
2020-07-26 22:41:29 +02:00
gnieto 5a8705bd25 Add room tags (#140)
Merge branch 'master' into task/add-tags

Add room tagging support

Co-authored-by: Timo Kösters <timo@koesters.xyz>
Co-authored-by: Guillem Nieto <gnieto.talo@gmail.com>
Reviewed-on: https://git.koesters.xyz/timo/conduit/pulls/140
Reviewed-by: Timo Kösters <timo@koesters.xyz>
2020-07-26 22:33:20 +02:00
Timo Kösters c3d142ad28 Merge pull request 'fix: stop /messages at to' (#159) from fix-to into master
Reviewed-on: https://git.koesters.xyz/timo/conduit/pulls/159
2020-07-26 22:21:39 +02:00
timokoesters b7df8fe83c fix: stop /messages at to
Fixes #150
2020-07-26 22:21:05 +02:00
Timo Kösters 20ab19d828 Merge pull request 'Upgrade ruma' (#158) from jplatte/conduit:up-ruma into master
Reviewed-on: https://git.koesters.xyz/timo/conduit/pulls/158
Reviewed-by: Timo Kösters <timo@koesters.xyz>
2020-07-26 17:20:11 +02:00
Jonas Platte 09561ccea3 Upgrade ruma 2020-07-26 16:52:43 +02:00
Timo Kösters f8544bf6e3 Merge pull request 'improvement: only remove to-device events when sure the client received them' (#139) from improve-to-device-removal into master
Reviewed-on: https://git.koesters.xyz/timo/conduit/pulls/139
2020-07-26 14:14:08 +02:00
timokoesters 16576d19cd improvement: only remove to-device events when sure the client received them
To make this work, I had to remove the recommended limit of 100
to-device events per /sync
(https://matrix.org/docs/spec/client_server/latest#id72)
2020-07-26 13:59:19 +02:00
Timo Kösters 678f33acf9 Merge pull request 'Moving to ruma-monorepo' (#133) from DevinR528/conduit:ruma-mono into master
Reviewed-on: https://git.koesters.xyz/timo/conduit/pulls/133
Reviewed-by: Timo Kösters <timo@koesters.xyz>
2020-07-25 22:02:45 +02:00
Devin Ragotzy 87fd432527 Refactor account_data to be more similar to other endpoints 2020-07-25 15:48:12 -04:00
Devin Ragotzy 60381ddcf4 Update to latest ruma/master rev 2020-07-25 14:25:24 -04:00
Devin Ragotzy 61458536ab Merge branch 'master' of https://git.koesters.xyz/timo/conduit into ruma-mono 2020-07-25 13:46:28 -04:00
aura 630196f0a3 Implement get_joined_rooms (#155)
whitelist /joined_rooms in sytest

Signed-off-by: Aurabindo Pillai <mail@aurabindo.in>

style: fmt

feat: implement /joined_rooms (#78)

Signed-off-by: Aurabindo Pillai <mail@aurabindo.in>

Co-authored-by: Aurabindo Pillai <mail@aurabindo.in>
Co-authored-by: timokoesters <timo@koesters.xyz>
Reviewed-on: https://git.koesters.xyz/timo/conduit/pulls/155
Reviewed-by: Timo Kösters <timo@koesters.xyz>
2020-07-25 18:35:22 +02:00
Timo Kösters be43b9557e Merge pull request 'improvement: switch to stable rust' (#151) from stable into master
Reviewed-on: https://git.koesters.xyz/timo/conduit/pulls/151
2020-07-23 10:23:01 +02:00
timokoesters d8e1248df6 improvement: switch to stable rust 2020-07-22 22:42:01 +02:00
Devin R 84d47da392 Simplify deserialization and deconstruction for Responses 2020-07-21 16:26:01 -04:00
Devin R 33bc666859 Use sync ephemeral events in sync Resposne (remove room_id)
Bump ruma to latest master which also fixes some server name as String
to now being of type Box<ServerName>.
2020-07-21 14:04:39 -04:00
Devin R 9a993fa7c1 Convert Pdu to a validated ruma type when calling to_*_event 2020-07-18 08:22:30 -04:00
Devin R 75959cdc10 Resolve stying review issues 2020-07-18 08:21:25 -04:00
Devin R 029c60be78 Replace to_string into_boxed_str with into 2020-07-17 19:52:04 -04:00
Devin R 59cbf202e4 Cargo.lock updated while rebasing 2020-07-17 16:05:53 -04:00
Devin R d02685a4fd Update to latest ruma/ruma commit
This will most likely be the API that is released to crates.io so it
should be fairly stable...
2020-07-17 16:04:05 -04:00
Devin R 63e23154f3 Rebase with key backups and cross signing
Moved back to a fork of ruma with timo's key-backup and cross-signing
branch. Ephemeral events in sync responses are EphemeralRoomEventStub
(they also have no room_id like all of sync responses events)
2020-07-17 16:04:05 -04:00
Devin R 84dcb885a7 Return correct Errors and replace panic, fix misc review issues
Remove EventJson todo comments, clean up Cargo.toml commented ruma deps.
2020-07-17 16:03:36 -04:00
Devin R ddc7598870 Use ruma/ruma master 2020-07-17 16:03:36 -04:00
Devin R 24b6702047 Add to_*_event_stub methods to pdu, filter for correct event kind
When creating some responses (sync) an AnyRoomEventStub is needed for this
PduEvent will deserialize the JSON as a Stub event and a non stub event
when needed. Ephemeral and account events are checked to be the correct
type and filtered out if not. This requires an extra `deserialize` call
which could/should be removed.

TODO: Possibly get rid of EventJson in some places.
2020-07-17 16:03:33 -04:00
Devin R 7c38e53839 Move to depend on ruma monorepo and ruma-events0.22 2020-07-17 16:03:02 -04:00
Timo Kösters 9c095f1538 Update README, fix CI (#148)
Update 'README.md'

Update README, fix CI

Co-authored-by: timokoesters <timo@koesters.xyz>
Reviewed-on: https://git.koesters.xyz/timo/conduit/pulls/148
2020-07-16 07:50:11 +02:00
Timo Kösters b9de21949d Update to rocket master (#147)
Merge branch 'master' into rocket

Update to rocket master

Co-authored-by: timokoesters <timo@koesters.xyz>
Reviewed-on: https://git.koesters.xyz/timo/conduit/pulls/147
2020-07-14 18:23:26 +02:00
the0 469071e105 feat: implement /event (#144)
Merge branch 'master' into event-route

Event: Implement /event

Co-authored-by: the0 <theo@localhost>
Reviewed-on: https://git.koesters.xyz/timo/conduit/pulls/144
Reviewed-by: Timo Kösters <timo@koesters.xyz>
2020-07-11 14:08:37 +02:00
Timo Kösters b03d030b71 Merge pull request 'Improve README' (#145) from readme into master
Reviewed-on: https://git.koesters.xyz/timo/conduit/pulls/145
2020-07-11 09:57:43 +02:00
timokoesters f361cb3d39 Improve README 2020-07-11 09:55:44 +02:00
Timo Kösters 8409146415 Merge pull request 'Implement /logout/all' (#141) from CapsizeGlimmer/conduit:logout-all into master
Reviewed-on: https://git.koesters.xyz/timo/conduit/pulls/141
Reviewed-by: Timo Kösters <timo@koesters.xyz>
2020-07-09 19:21:12 +02:00
CapsizeGlimmer 3a8efaeafa Whitelist logout all 2020-07-07 23:09:29 -04:00
CapsizeGlimmer 76aa44ead3 Add logout/all route to main 2020-07-05 15:35:03 -04:00
CapsizeGlimmer 7c2144c6d7 Implement /logout/all 2020-07-05 15:35:03 -04:00
the0 b81939841b feat: account deactivation (#137)
Deactivation: swap unwrap_or(false) to .ok()?

feat: implement deactivate account route

Implement error code on login to deactivated account

Deactivation: Changes requested

Add missing .clone()

Deactivation: Requested changes

Remove unneeded .filter()

Deactivation: badly named signature leads to confusion

Co-authored-by: the0 <theo@localhost>
Reviewed-on: https://git.koesters.xyz/timo/conduit/pulls/137
Reviewed-by: Timo Kösters <timo@koesters.xyz>
2020-07-05 07:48:19 +02:00
the0 67a1f21f5d feat: implement password changing (#138)
Password: Fixes

Password: Implement logging out all devices except current

Password: Implement password changing

Co-authored-by: the0 <theo@localhost>
Reviewed-on: https://git.koesters.xyz/timo/conduit/pulls/138
Reviewed-by: Timo Kösters <timo@koesters.xyz>
2020-07-02 20:38:25 +02:00
Timo Kösters e809d819ac Merge pull request 'Key backups and cross signing' (#132) from cross-signing into master
Reviewed-on: https://git.koesters.xyz/timo/conduit/pulls/132
2020-06-26 19:01:32 +02:00
timokoesters b83fba5c44 chore: update dependencies 2020-06-26 18:04:08 +02:00
timokoesters 54ad1fbed9 fix: CI 2020-06-26 16:26:29 +02:00
timokoesters 05f1f73e10 improvement: upgrade to sled 0.32
BREAKING CHANGE: old databases are not compatible anymore
2020-06-26 16:26:28 +02:00
timokoesters 24c544f650 fix: DMs show up as rooms 2020-06-26 15:16:15 +02:00
Guillem Nieto 8f06d0258a Remove is_direct flag from Join event
When I was investigating the DM issue, I found that join event contained
the `is_direct` flag. According to the spec, this flag should only be
set on "invite" events, but not on join.

Other homeservers do not have this flag on join.
2020-06-26 15:16:15 +02:00
timokoesters a49a572d76 feat: cross-signing 2020-06-26 15:16:15 +02:00
timokoesters 7031240af3 improvement: /members route 2020-06-16 23:25:15 +02:00
timokoesters 02fe030b2a improvement: better default push rules 2020-06-16 23:25:14 +02:00
Timo Kösters e7803e310a Merge pull request 'fix: update rocket version' (#127) from fix into master 2020-06-16 13:55:20 +02:00
timokoesters db685e0cf7 fix: update rocket version 2020-06-16 13:53:15 +02:00
Timo Kösters 0f72bd9f32 Merge pull request 'fix: update ruma version' (#125) from fix into master 2020-06-16 12:21:12 +02:00
timokoesters 13d474f6ee fix: update ruma version 2020-06-16 12:19:58 +02:00
Timo Kösters bc959f7634 Merge pull request 'Update 'README.md'' (#123) from timo-patch-1 into master 2020-06-16 08:44:24 +02:00
Timo Kösters 853ccd6fbf Update 'README.md' 2020-06-16 08:43:46 +02:00
Timo Kösters b0bbc049fa Merge pull request 'Update 'README.md'' (#122) from timo-bitcoin into master 2020-06-16 08:42:13 +02:00
Timo Kösters c6194b27a3 Update 'README.md' 2020-06-16 08:21:06 +02:00
Timo Kösters 7b23069943 Merge pull request 'Remove unused imports' (#119) from PublicByte/conduit:remove-unused-imports into master 2020-06-11 22:34:49 +02:00
PublicByte fa7612f069 refactor: remove unused imports 2020-06-11 21:06:43 +02:00
Timo Kösters 4c98079c4c Merge pull request 'refactor: better error handling' (#116) from error-handling into master 2020-06-11 15:21:23 +02:00
timokoesters 56d4742201 improvement: log bad database errors automatically 2020-06-11 14:58:44 +02:00
timokoesters 2368a90584 refactor: better error handling 2020-06-11 13:14:35 +02:00
Timo Kösters 80935c5826 Merge pull request 'fix' (#115) from uiaa into master 2020-06-08 15:19:48 +02:00
timokoesters f2a5d46628 fix 2020-06-08 15:17:58 +02:00
Timo Kösters c681f0c494 Merge pull request 'Uiaa + Close registration + optimizations' (#113) from uiaa into master 2020-06-08 14:30:45 +02:00
timokoesters 95047272e8 fix: let example config show how to use registration_disabled 2020-06-08 14:29:44 +02:00
timokoesters 176bd114a0 fix: use correct device in GET /devices 2020-06-08 14:23:42 +02:00
timokoesters bfe5b89ba4 style: cargo fmt 2020-06-08 11:45:22 +02:00
timokoesters 588049678b refactor: replace DeviceId with str or String 2020-06-08 11:40:19 +02:00
timokoesters b4d65ab67d improvement: optimize /sync response 2020-06-08 11:39:32 +02:00
timokoesters 0067f49d52 feat: close registration with ROCKET_REGISTRATION_DISABLED=true 2020-06-08 11:39:32 +02:00
timokoesters c85d363d71 feat: user interactive authentication 2020-06-08 11:39:30 +02:00
Timo Kösters 88d091fca1 Merge pull request 'Allow client to load history on newly joined rooms' (#111) from gnieto/conduit:fix/issue-39-history-load into master
Reviewed-by: Timo Kösters <timo@koesters.xyz>
2020-06-07 11:21:53 +02:00
Guillem Nieto cc383ac932 Cargo fmt 2020-06-06 19:48:01 +02:00
Guillem Nieto 9269f009db Allow client to load history on newly joined rooms
On /sync, check if a room is a new join between `since` parameter and
now. If it's a newly joined room, set the limited flag to true, which will force
the client to load room messages via the `/messages` endpoint.

On `master`, I could not reproduce the messages not showing to others
when joining after being invited.

Fixes #39
2020-06-06 19:29:03 +02:00
Timo Kösters 4400bb93bb Merge pull request 'fix: edus will not be removed after timeout' (#108) from fix into master 2020-06-06 15:26:51 +02:00
timokoesters 8eedc12567 fix: edus will not be removed after timeout 2020-06-06 15:23:37 +02:00
Timo Kösters 8f6b446193 Merge pull request 'Switch to the ruma meta-crate' (#106) from jplatte/conduit:master into master
Reviewed-by: Timo Kösters <timo@koesters.xyz>
2020-06-06 08:58:13 +02:00
Jonas Platte 7526fd8602 Switch to the ruma meta-crate 2020-06-05 18:42:45 +02:00
Timo Kösters 3a5b292f22 Merge pull request 'feat: heroes' (#102) from fix into master 2020-06-05 10:08:47 +02:00
Timo Kösters 22a12ac6c0 Merge pull request 'Update 'README.md'' (#104) from riot-fixed into master 2020-06-05 09:31:23 +02:00
timokoesters 08d19c3e0b fix: broken dependencies 2020-06-05 09:04:51 +02:00
Timo Kösters 0a49b24322 Update 'README.md' 2020-06-04 22:51:19 +02:00
timokoesters d404f902bf fix: send presence too often 2020-06-04 22:36:48 +02:00
timokoesters 32da76b9a2 feat: heroes, don't send notifications every time 2020-06-04 19:05:11 +02:00
Timo Kösters 55e14cbf44 Merge pull request 'Replies load context, /kick, /ban, /unban work' (#101) from fix into master 2020-06-04 16:53:40 +02:00
timokoesters b7f7a39973 feat: kick,ban,unban user route 2020-06-04 16:51:36 +02:00
timokoesters a8df1acdfd feat: load replies, forward pagination 2020-06-04 13:58:55 +02:00
Timo Kösters c655870d23 Merge pull request 'Small fixes' (#98) from fix into master 2020-06-04 12:05:54 +02:00
timokoesters 168f2281fd improvement: bundle typing events and only send on changes
Fixes #67 and #49
2020-06-04 11:17:36 +02:00
timokoesters 8328eeb5ac Make sytest not fail 2020-06-04 09:53:26 +02:00
timokoesters 1c85b0fd05 remove tests in favor of sytests 2020-06-04 09:48:33 +02:00
timokoesters b192fddf2f fix: show device display names 2020-06-04 09:48:32 +02:00
timokoesters 325e373684 refactor: small changes 2020-06-03 22:30:51 +02:00
timokoesters 19c9e4b916 fix: room version 6 2020-06-03 22:30:50 +02:00
Timo Kösters 77318af563 Merge pull request 'Implement devices API (#20)' (#97) from fix into master 2020-06-03 14:12:01 +02:00
gnieto 0883c44659 Implement devices API (#20)
small improvements

Cargo fmt

Simplify insert and update methods

Review feedback

Remove has_device method calls

Load all devices with a single db call

Remove device as in logout

Put all metadata on the same tree

Create userdevice key fucntion

Implement devices API

Implement all the devices endpoints. There's a couple of pending tasks:

- Integrate the "logout" logic once it lands to master (this should
  remove the given device from the database).
- Track and store last seen timestamp and IP.

Co-authored-by: timokoesters <timo@koesters.xyz>
Co-authored-by: Guillem Nieto <gnieto.talo@gmail.com>
2020-06-03 14:09:50 +02:00
gnieto ed9b544ace Implement devices API (#20)
small improvements

Cargo fmt

Simplify insert and update methods

Review feedback

Remove has_device method calls

Load all devices with a single db call

Remove device as in logout

Put all metadata on the same tree

Create userdevice key fucntion

Implement devices API

Implement all the devices endpoints. There's a couple of pending tasks:

- Integrate the "logout" logic once it lands to master (this should
  remove the given device from the database).
- Track and store last seen timestamp and IP.

Co-authored-by: timokoesters <timo@koesters.xyz>
Co-authored-by: Guillem Nieto <gnieto.talo@gmail.com>
2020-06-03 13:41:30 +02:00
Timo Kösters 720d48bd67 Merge pull request 'get_state_events_for_key_route returns the content of the requested event instead of the all event.' (#95) from jbbouille/conduit:fix-get_state_events_for_key_route-returning-all-event into master 2020-06-03 10:27:13 +02:00
Jean-Baptiste Petit 1222289c75 get_state_events_for_key_route return the content of the requested event instead of the all event. 2020-06-03 09:30:34 +02:00
Timo Kösters 0a1c4f3649 Merge pull request 'Black list temporaly some room creation tests.' (#50) from jbbouille/conduit:blacklist_some_creation_room_tests into master 2020-06-02 14:44:51 +02:00
Jean-Baptiste Petit 75e75c3b2f Black list temporaly some room creation tests. 2020-06-02 13:57:41 +02:00
Timo Kösters 4c2c0e2458 Merge pull request 'Better notifications and fix redactions' (#44) from notification into master 2020-06-01 22:25:24 +02:00
timokoesters 5a47c75427 fix: make redactions permanent 2020-06-01 20:58:49 +02:00
timokoesters b519bc6962 fix: only show notifications for messages 2020-06-01 20:16:18 +02:00
Timo Kösters 3aa0c8ed25 Merge pull request 'Room visibility, aliases and redaction' (#40) from alias into master 2020-05-31 10:23:04 +02:00
timokoesters 4e507ef706 feat: room visibility and aliases 2020-05-31 09:46:11 +02:00
timokoesters 9c26e22ad7 improvement: load aliases from database 2020-05-31 08:01:11 +02:00
timokoesters 18bf67748c feat: redaction 2020-05-31 08:01:10 +02:00
Timo Kösters 16538a6c16 Update 'README.md' 2020-05-29 10:04:19 +02:00
Timo Kösters 55842a0e57 Update 'README.md' 2020-05-29 09:54:30 +02:00
Timo Kösters 25ebde5af8 Merge pull request 'fix: /register lowercases user ids' (#28) from lowercase into master 2020-05-27 08:26:32 +02:00
timokoesters ca77c79222 fix: /register lowercases user ids
fixes #24
2020-05-27 07:09:23 +02:00
Timo Kösters dd80a8591d Merge pull request 'Get device_id from body instead of auth data' (#27) from gnieto/conduit:fix/create-device into master 2020-05-27 07:03:21 +02:00
Guillem Nieto 4b3b562347 Get device_id from body instead of auth data
Device_id was retrieved from the auth data instead of login's body and
this was causing that a new device was created on every login.

This is (I guess) provoking that some sytests are failing (for example,
"POST /login returns the same device_id as that in the request").
2020-05-26 21:06:54 +02:00
Timo Kösters d0e5a39d1d Merge pull request 'Move create room test into blacklist - fixes #23' (#26) from jbbouille/conduit:remove_create_public_room_test into master 2020-05-26 16:57:11 +02:00
Jean-Baptiste Petit 43ed80c6c2 Move create room test into blacklist - fixes #23 2020-05-26 16:01:38 +02:00
timokoesters 58683585cc improvement: show more info in public rooms list 2020-05-25 20:16:36 +02:00
Timo Kösters 63c62a4afa Update 'README.md' 2020-05-25 17:36:54 +02:00
Timo Kösters 1096c2847b Merge pull request 'Access control' (#22) from control into master 2020-05-25 16:59:40 +02:00
timokoesters b6c0e9bfb2 feat: access control 2020-05-25 16:40:00 +02:00
timokoesters c8ba9dce01 feat: proper room creation 2020-05-25 16:39:58 +02:00
josias b106d1393b Add logout route and database methods (#21)
Condense keys

Move remove methods to remove_device

Code cleanup

Add method for removing todevice events

Remove unnecessary existence checks

Add logout route and database methods

Co-authored-by: Josias <justjosias@tutanota.com>
2020-05-24 22:10:09 +02:00
timokoesters 1014388a9c fix: one time keys are never removed 2020-05-23 19:17:55 +02:00
timokoesters 5d6542a8a6 improvement: video link in readme 2020-05-21 18:10:04 +02:00
timokoesters d95e8b4880 fix: problem with to-device for all devices 2020-05-21 13:52:54 +02:00
timokoesters 43478a5870 fix: send correct membership events when joining / creating rooms 2020-05-20 09:24:44 +02:00
timokoesters 8df2a1a072 improvement: add room topic to public room dir 2020-05-20 00:12:07 +02:00
timokoesters e0fccffde0 fix: changing avatar url now sends room events 2020-05-19 23:52:02 +02:00
timokoesters ada260bf42 fix: use png for thumbnails 2020-05-19 23:51:37 +02:00
Timo Kösters cf91996336 Merge pull request 'fix: riot sometimes freaks out when refreshing' (#18) from media into master 2020-05-19 23:02:42 +02:00
timokoesters eb4af85765 fix: riot sometimes freaks out when refreshing 2020-05-19 22:56:28 +02:00
Timo Kösters 108d8988d8 Merge pull request 'feat: image thumbnails' (#17) from media into master 2020-05-19 20:01:13 +02:00
timokoesters d544d28b6e feat: image thumbnails 2020-05-19 19:59:52 +02:00
timokoesters 61f4f2c716 improvement: implement GET publicRooms 2020-05-19 16:28:03 +02:00
timokoesters 821c608c6a feat: media 2020-05-18 22:50:42 +02:00
timokoesters 42ae433b25 fix: send devicekeyupdate users in /sync 2020-05-18 12:46:06 +02:00
timokoesters f0aed35ecf improvement: user dir search also searches in displaynames 2020-05-18 10:29:45 +02:00
timokoesters 56dd6cb16f improvement: get state 2020-05-18 09:22:58 +02:00
timokoesters 6215218c3c fix: account data json 2020-05-17 22:05:43 +02:00
timokoesters 7fc71b3968 feat: end to end encryption 2020-05-17 19:56:40 +02:00
timokoesters 4fb79ebb4c chore: update dependencies 2020-05-14 13:56:29 +02:00
timo 86e20e6401 Merge pull request 'fix: only allow valid usernames in /register' (#14) from fix-register into master 2020-05-13 18:00:18 +02:00
timokoesters d08f91d1c3 fix: only allow valid usernames in /register 2020-05-13 12:25:15 +02:00
Rudi Floren 00a9424719 feat: sytests 2020-05-11 14:44:23 +02:00
timokoesters 8e041f90dd refactor: make cargo clippy happier 2020-05-11 12:34:48 +02:00
timokoesters 1dbde0e1c1 improvement: add option to get device id from token 2020-05-10 18:30:12 +02:00
timokoesters ee0d6940bd feat: presence updates 2020-05-09 21:47:09 +02:00
timokoesters 551308e9a8 Update dependencies and send displayname updates again 2020-05-08 21:13:52 +02:00
timokoesters 8f67c01efd refactor: split database into multiple files, more error handling, cleaner code 2020-05-03 21:44:48 +02:00
timokoesters 4b191a9311 improvement: set default push rules on register 2020-05-02 09:24:09 +02:00
timo 3cd0f89729 Add /_matrix/client/r0/register/available endpoint 2020-05-01 23:25:32 +02:00
Marcel 4bc7712ee4 [ClientServer] Add /_matrix/client/r0/register/available endpoint
Took 1 hour 25 minutes
2020-05-01 23:17:25 +02:00
timokoesters 4ca1ada73e update ruma 2020-05-01 21:45:55 +02:00
timokoesters b02c568941 feat: notifications, simple permission systems 2020-05-01 20:28:13 +02:00
timokoesters 169dbe6c37 fix: send full state after joining a room 2020-04-29 12:19:09 +02:00
timo 8087ddd746 Merge pull request 'Federated room list, lots of small tweeks' (#9) from federation into master 2020-04-29 10:35:38 +02:00
timokoesters c769283953 Update readme 2020-04-29 10:27:41 +02:00
timokoesters fd1aea7e36 Update dependencies 2020-04-29 10:27:41 +02:00
timokoesters 1cdf30f38c Add hostname to Rocket.toml config 2020-04-29 10:27:40 +02:00
timokoesters 23cb550d00 forget rooms, load history 2020-04-29 10:27:40 +02:00
timokoesters 4cc0a07092 feat: user renaming 2020-04-29 10:27:40 +02:00
timokoesters 720cc0cffc feat: federated room directory 2020-04-29 10:27:39 +02:00
timokoesters 120b6f4b95 Bump dependencies and fixes 2020-04-29 10:27:39 +02:00
timokoesters 873d191569 fix: http body as content when signing 2020-04-29 10:27:39 +02:00
timokoesters 1af6dd984a More work on federation 2020-04-29 10:27:38 +02:00
timokoesters b0d9ccdb2d Signing, basis for federation 2020-04-29 10:27:38 +02:00
timokoesters 9b79798e56 start work on signing 2020-04-29 10:27:37 +02:00
timokoesters 80ddf80f17 work 2020-04-29 10:27:31 +02:00
timo 4d658b3952 Merge pull request 'Fix typo in password message' (#8) from TheCycoONE/conduit:pwd-message-typo into master 2020-04-15 22:01:45 +02:00
TheCycoONE 6d858c39ca Fix typo in password message 2020-04-15 21:17:33 +02:00
timokoesters 2f63888995 Update README.md 2020-04-14 22:44:45 +02:00
gnieto fa9e127a1e Store hashed passwords (#7)
Use if let instead of unwrap

Default to invalid password if could not calculate

Move hash password methdo and return Result

Rename get_password method

Default to empty password when no pwd is received

Store hashed passwords

Store passwords hashed with Argon2 and verify password with that stored
hash.

Co-authored-by: Guillem Nieto <gnieto.talo@gmail.com>
2020-04-14 22:25:44 +02:00
timokoesters abcce95dd8 feat: invites, better public room dir, user search 2020-04-14 13:59:25 +02:00
timokoesters af1def50ac Update README.md 2020-04-12 22:29:48 +02:00
timokoesters 3debb6203c feat: handle typing events 2020-04-12 21:12:50 +02:00
timokoesters 3b9cadeec2 feat: read receipts 2020-04-11 23:57:56 +02:00
timokoesters ab8c2f1e5e Rename pduid_pdus to pduid_pdu 2020-04-11 09:35:06 +02:00
timokoesters fd829bfa0d move client_server code into own file 2020-04-11 09:30:11 +02:00
timokoesters 040296c711 Add test support and impl dummy /read_markers 2020-04-10 13:36:57 +02:00
timokoesters 93b1d97166 Update readme and cargo.toml 2020-04-10 10:25:33 +02:00
timo 8f41a4d306 Update 'README.md' 2020-04-09 23:23:16 +02:00
timo 3f2bf208a9 Merge pull request 'Add displayname and avatar_url endpoints' (#5) from MTRNord/matrixserver:accountdata into master 2020-04-09 21:26:57 +02:00
Marcel 57264f72e9 Fix avatar_url error message if not starting with mxc://
Took 8 minutes
2020-04-09 21:19:27 +02:00
Marcel 8bcbc983c3 Change and add Comments to the profile endpoints
Add missing docs

Took 9 minutes
2020-04-09 21:11:21 +02:00
Marcel 49fe5e3271 Rename userid_avatar_url to userid_avatarurl and fix debug print
Run cargo fmt

Took 5 minutes
2020-04-09 21:01:39 +02:00
Marcel b1284fd509 Replace profile_* with userid_*
Add a missing dot in the errormessage
Require mxc:// to be present at the start of an avatar_url
Update mxc check TODO
Show displayname or avatar_url if either is available when getting the profile Endpoint
Return the correct data in case of a empty displayname or an empty avatar_url

Took 50 minutes

Took 34 seconds
2020-04-09 20:53:27 +02:00
timo 9f3368daa4 Update 'README.md' 2020-04-09 19:51:52 +02:00
timokoesters cd55220a75 fix: room directory duplicates 2020-04-09 19:39:06 +02:00
Marcel 062c5521f0 Add displayname and avatar_url endpoints
Add PUT and GET /_matrix/client/r0/profile/{userId}/displayname Endpoint
Add PUT and GET /_matrix/client/r0/profile/{userId}/avatar_url Endpoint
Add GET /_matrix/client/r0/profile/{userId} Endpoint

Took 2 hours 16 minutes
2020-04-09 18:49:27 +02:00
timo b12ae15a45 Update 'README.md' 2020-04-09 17:39:45 +02:00
timokoesters 11e75e7081 make room directory work 2020-04-09 14:39:50 +02:00
timokoesters 5ac45eac59 public rooms dir 2020-04-09 12:22:39 +02:00
timokoesters 9214a62dde better room creation 2020-04-09 11:00:58 +02:00
timokoesters a1b2b4e4fe Add liberapay, change pr template 2020-04-09 00:05:37 +02:00
timo 9d40981cce Merge pull request 'UIAA error type' (#3) from jplatte/matrixserver:master into master 2020-04-08 23:41:39 +02:00
Jonas Platte 38ab7c843e Update error type of /register route 2020-04-08 23:25:19 +02:00
Jonas Platte c60402bf0d Update ruma-client-api 2020-04-08 23:13:30 +02:00
timokoesters d0920f0fa3 Add license 2020-04-08 22:28:03 +02:00
timokoesters 8557278b90 better riot.im support 2020-04-08 22:07:31 +02:00
timokoesters fdeee7fdb5 More dummy endpoints 2020-04-08 22:04:30 +02:00
timokoesters 215a31c513 Add a few dummy endpoints to make riot progress further 2020-04-08 22:04:29 +02:00
timokoesters ddcd423e6f feat: random tokens, sessions, guest usernames and device ids 2020-04-08 22:04:29 +02:00
timokoesters 64223b8812 register login flow 2020-04-08 22:04:29 +02:00
timo eb7c5b79be Update 'README.md' 2020-04-06 19:57:04 +02:00
timokoesters e55a63629c feat: state event support 2020-04-06 14:33:02 +02:00
timokoesters 10bb96fcf7 feat: room joining, room based /sync responses 2020-04-06 13:52:46 +02:00
timokoesters 4d4cff7120 Allow all kinds of messages in /send 2020-04-05 23:06:43 +02:00
timokoesters 884dc2867d Move to rocket's async branch 2020-04-05 19:54:08 +02:00
timokoesters 8b8381bcc0 New PduEvent struct 2020-04-04 11:53:37 +02:00
timokoesters f9cfede2a8 fix: deserialize sync event body 2020-04-03 21:17:27 +02:00
timokoesters 2855d1acdf Add README.md 2020-04-03 17:58:38 +02:00
timokoesters fa3226898c feat: save pdus
PDUs are saved in a pduid -> pdus map. roomid -> pduleaves keeps track
of the leaves of the event graph and eventid -> pduid maps event ids to
pdus.
2020-04-03 17:58:38 +02:00
timokoesters 22cca206ba Todo: ruma signatures
This commit will get force pushed away later
2020-03-30 15:38:25 +02:00
timokoesters dba6c46667 Use sled::Tree::prefix_search for deviceids 2020-03-30 13:46:18 +02:00
timokoesters b508b4d1e7 Start work on message events 2020-03-30 00:10:44 +02:00
timokoesters 533260edd8 Add auth 2020-03-29 21:05:20 +02:00
timo 18ed991b93 Merge branch 'master' of jplatte/matrixserver into master 2020-03-29 14:30:59 +02:00
Jonas Platte 1183105f15 Make Endpoint bound work for ruma_wrapper::Ruma 2020-03-29 14:29:12 +02:00
timokoesters 73e04e71d7 Start work on event creation 2020-03-29 13:49:13 +02:00
timokoesters 744e0adfcf Try to impl auth in ruma_wrapper 2020-03-28 23:08:59 +01:00
timokoesters 34a53ce20a Better database structure 2020-03-28 18:50:02 +01:00
timokoesters 6d27f15516 More logging 2020-03-28 15:16:18 +01:00
timokoesters 1679da7784 RUST_LOG=info by default 2020-03-27 21:00:40 +01:00
timokoesters 6fffcecf8e Updates 2020-03-27 21:00:10 +01:00
timokoesters c2c18b4651 feat: database 2020-02-20 10:12:13 +01:00
timokoesters cd777af41c feat: simple endpoint handlers 2020-02-18 22:07:57 +01:00
timokoesters 6264628c11 Initial commit 2020-02-15 22:42:21 +01:00
498 changed files with 53368 additions and 24590 deletions
+26 -8
View File
@@ -1,9 +1,27 @@
servers
compose.yml
node_modules
# Local build and dev artifacts
target
tests
# Docker files
Dockerfile*
# IDE files
.vscode
.idea
*.iml
# Git folder
.git
.gitea
.gitlab
.github
# Dot files
.env
.gitignore
Dockerfile
.svelte-kit
build
output
.git
# Toml files
rustfmt.toml
# Documentation
#*.md
+13 -4
View File
@@ -1,6 +1,15 @@
root = true
[*.{js,ts,svelte}]
charset = utf-8
# EditorConfig is awesome: https://EditorConfig.org
root = true
[*]
charset = utf-8
end_of_line = lf
tab_width = 4
indent_size = 4
indent_style = space
indent_size = 4
insert_final_newline = true
max_line_length = 120
[*.nix]
indent_size = 2
+7
View File
@@ -0,0 +1,7 @@
#!/usr/bin/env bash
use flake
PATH_add bin
dotenv_if_exists
+7
View File
@@ -0,0 +1,7 @@
# .git-blame-ignore-revs
# adds a proper rustfmt.toml and formats the entire codebase
1d1ac065141181438e744e7d8abd0e45f75a2f91
f419c64aca300a338096b4e0db4c73ace54f23d0
# use chain_width 60
162948313c212193965dece50b816ef0903172ba
5998a0d883d31b866f7c8c46433a8857eae51a89
-2
View File
@@ -1,2 +0,0 @@
# Auto detect text files and perform LF normalization
* text=auto
+8
View File
@@ -0,0 +1,8 @@
<!-- Please describe your changes here -->
-----------------------------------------------------------------------------
- [ ] I ran `cargo fmt`, `cargo clippy`, and `cargo test`
- [ ] I agree to release my code and all other changes of this MR under the Apache-2.0 license
+350
View File
@@ -0,0 +1,350 @@
name: CI and Artifacts
on:
pull_request:
push:
# documentation workflow deals with this or is not relevant for this workflow
paths-ignore:
- '*.md'
- 'conduwuit-example.toml'
- 'book.toml'
- '.gitlab-ci.yml'
- '.gitignore'
- 'renovate.json'
- 'docs/**'
- 'debian/**'
- 'docker/**'
branches:
- main
tags:
- '*'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
concurrency:
group: ${{ github.head_ref || github.ref_name }}
cancel-in-progress: true
env:
# Required to make some things output color
TERM: ansi
# Publishing to my nix binary cache
ATTIC_TOKEN: ${{ secrets.ATTIC_TOKEN }}
# Just in case incremental is still being set to true, speeds up CI
CARGO_INCREMENTAL: 0
# Custom nix binary cache if fork is being used
ATTIC_ENDPOINT: ${{ vars.ATTIC_ENDPOINT }}
ATTIC_PUBLIC_KEY: ${{ vars.ATTIC_PUBLIC_KEY }}
permissions:
packages: write
contents: read
jobs:
tests:
name: Test
runs-on: ubuntu-latest
steps:
- name: Sync repository
uses: actions/checkout@v4
- name: Tag comparison check
if: startsWith(github.ref, 'refs/tags/v')
run: |
# Tag mismatch with latest repo tag check to prevent potential downgrades
LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)
if [ $LATEST_TAG != ${{ github.ref_name }} ]; then
echo '# WARNING: Attempting to run this workflow for a tag that is not the latest repo tag. Aborting.'
echo '# WARNING: Attempting to run this workflow for a tag that is not the latest repo tag. Aborting.' >> $GITHUB_STEP_SUMMARY
exit 1
fi
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
- name: Enable Cachix binary cache
run: |
nix profile install nixpkgs#cachix
cachix use crane
cachix use nix-community
- name: Configure Magic Nix Cache
uses: DeterminateSystems/magic-nix-cache-action@main
- name: Apply Nix binary cache configuration
run: |
sudo tee -a /etc/nix/nix.conf > /dev/null <<EOF
extra-substituters = https://attic.kennel.juneis.dog/conduit https://attic.kennel.juneis.dog/conduwuit https://cache.lix.systems
extra-trusted-public-keys = conduit:Isq8FGyEC6FOXH6nD+BOeAA+bKp6X6UIbupSlGEPuOg= conduwuit:lYPVh7o1hLu1idH4Xt2QHaRa49WRGSAqzcfFd94aOTw= cache.lix.systems:aBnZUw8zA7H35Cz2RyKFVs3H4PlGTLawyY5KRbvJR8o=
EOF
- name: Use alternative Nix binary caches if specified
if: ${{ (env.ATTIC_ENDPOINT != '') && (env.ATTIC_PUBLIC_KEY != '') }}
run: |
sudo tee -a /etc/nix/nix.conf > /dev/null <<EOF
extra-substituters = ${{ env.ATTIC_ENDPOINT }}
extra-trusted-public-keys = ${{ env.ATTIC_PUBLIC_KEY }}
EOF
- name: Prepare build environment
run: |
echo 'source $HOME/.nix-profile/share/nix-direnv/direnvrc' > "$HOME/.direnvrc"
nix profile install --impure --inputs-from . nixpkgs#direnv nixpkgs#nix-direnv
direnv allow
nix develop --command true
- name: Run CI tests
run: |
direnv exec . engage > >(tee -a test_output.log)
- name: Sync Complement repository
uses: actions/checkout@v4
with:
repository: 'matrix-org/complement'
path: complement_src
- name: Run Complement tests
run: |
direnv exec . bin/complement 'complement_src' 'complement_test_logs.jsonl' 'complement_test_results.jsonl'
cp -v -f result complement_oci_image.tar.gz
- name: Upload Complement OCI image
uses: actions/upload-artifact@v4
with:
name: complement_oci_image.tar.gz
path: complement_oci_image.tar.gz
if-no-files-found: error
- name: Upload Complement logs
uses: actions/upload-artifact@v4
with:
name: complement_test_logs.jsonl
path: complement_test_logs.jsonl
if-no-files-found: error
- name: Upload Complement results
uses: actions/upload-artifact@v4
with:
name: complement_test_results.jsonl
path: complement_test_results.jsonl
if-no-files-found: error
- name: Diff Complement results with checked-in repo results
# TODO: figure out why our complement results are not 100% consistent so we don't need to allow failures
continue-on-error: true
run: |
diff -u --color=always tests/test_results/complement/test_results.jsonl complement_test_results.jsonl > >(tee -a complement_test_output.log)
- name: Add Complement diff result to Job Summary
run: |
echo '# Complement diff results' >> $GITHUB_STEP_SUMMARY
echo '```diff' >> $GITHUB_STEP_SUMMARY
tail -n 100 complement_test_output.log | sed 's/\x1b\[[0-9;]*m//g' >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
- name: Update Job Summary
if: success() || failure()
run: |
if [ ${{ job.status }} == 'success' ]; then
echo '# ✅ completed suwuccessfully' >> $GITHUB_STEP_SUMMARY
else
echo '```' >> $GITHUB_STEP_SUMMARY
tail -n 20 test_output.log | sed 's/\x1b\[[0-9;]*m//g' >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
fi
build:
name: Build
runs-on: ubuntu-latest
needs: tests
if: github.event.pull_request.draft != true
strategy:
matrix:
include:
- target: aarch64-unknown-linux-musl
- target: aarch64-unknown-linux-musl-jemalloc
- target: x86_64-unknown-linux-musl
- target: x86_64-unknown-linux-musl-jemalloc
steps:
- name: Sync repository
uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
- name: Install and enable Cachix binary cache
run: |
nix profile install nixpkgs#cachix
cachix use crane
cachix use nix-community
- name: Configure Magic Nix Cache
uses: DeterminateSystems/magic-nix-cache-action@main
- name: Apply Nix binary cache configuration
run: |
sudo tee -a /etc/nix/nix.conf > /dev/null <<EOF
extra-substituters = https://attic.kennel.juneis.dog/conduit https://attic.kennel.juneis.dog/conduwuit
extra-trusted-public-keys = conduit:Isq8FGyEC6FOXH6nD+BOeAA+bKp6X6UIbupSlGEPuOg= conduwuit:lYPVh7o1hLu1idH4Xt2QHaRa49WRGSAqzcfFd94aOTw=
EOF
- name: Use alternative Nix binary caches if specified
if: ${{ (env.ATTIC_ENDPOINT != '') && (env.ATTIC_PUBLIC_KEY != '') }}
run: |
sudo tee -a /etc/nix/nix.conf > /dev/null <<EOF
extra-substituters = ${{ env.ATTIC_ENDPOINT }}
extra-trusted-public-keys = ${{ env.ATTIC_PUBLIC_KEY }}
EOF
- name: Prepare build environment
run: |
echo 'source $HOME/.nix-profile/share/nix-direnv/direnvrc' > "$HOME/.direnvrc"
nix profile install --impure --inputs-from . nixpkgs#direnv nixpkgs#nix-direnv
direnv allow
nix develop --command true
- name: Build static ${{ matrix.target }}
run: |
CARGO_DEB_TARGET_TUPLE=$(echo ${{ matrix.target }} | grep -o -E '^([^-]*-){3}[^-]*')
bin/nix-build-and-cache just .#static-${{ matrix.target }}
mkdir -v -p target/release/
mkdir -v -p target/$CARGO_DEB_TARGET_TUPLE/release/
cp -v -f result/bin/conduit target/release/conduwuit
cp -v -f result/bin/conduit target/$CARGO_DEB_TARGET_TUPLE/release/conduwuit
direnv exec . cargo deb --verbose --no-build --no-strip --target=$CARGO_DEB_TARGET_TUPLE --output target/release/${{ matrix.target }}.deb
mv -v target/release/conduwuit static-${{ matrix.target }}
mv -v target/release/${{ matrix.target }}.deb ${{ matrix.target }}.deb
- name: Upload static-${{ matrix.target }}
uses: actions/upload-artifact@v4
with:
name: static-${{ matrix.target }}
path: static-${{ matrix.target }}
if-no-files-found: error
- name: Upload deb ${{ matrix.target }}
uses: actions/upload-artifact@v4
with:
name: deb-${{ matrix.target }}
path: ${{ matrix.target }}.deb
if-no-files-found: error
compression-level: 0
- name: Build OCI image ${{ matrix.target }}
run: |
bin/nix-build-and-cache just .#oci-image-${{ matrix.target }}
cp -v -f result oci-image-${{ matrix.target }}.tar.gz
- name: Upload OCI image ${{ matrix.target }}
uses: actions/upload-artifact@v4
with:
name: oci-image-${{ matrix.target }}
path: oci-image-${{ matrix.target }}.tar.gz
if-no-files-found: error
compression-level: 0
docker:
name: Docker publish
runs-on: ubuntu-latest
needs: build
if: (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main' || (github.event.pull_request.draft != true)) && (vars.DOCKER_USERNAME != '') && (vars.GITLAB_USERNAME != '')
env:
DOCKER_ARM64: docker.io/${{ github.repository }}:${{ (github.head_ref != '' && format('merge-{0}-{1}', github.event.number, github.event.pull_request.user.login)) || github.ref_name }}-${{ github.sha }}-arm64v8
DOCKER_AMD64: docker.io/${{ github.repository }}:${{ (github.head_ref != '' && format('merge-{0}-{1}', github.event.number, github.event.pull_request.user.login)) || github.ref_name }}-${{ github.sha }}-amd64
DOCKER_TAG: docker.io/${{ github.repository }}:${{ (github.head_ref != '' && format('merge-{0}-{1}', github.event.number, github.event.pull_request.user.login)) || github.ref_name }}-${{ github.sha }}
DOCKER_BRANCH: docker.io/${{ github.repository }}:${{ (startsWith(github.ref, 'refs/tags/v') && 'latest') || (github.head_ref != '' && format('merge-{0}-{1}', github.event.number, github.event.pull_request.user.login)) || github.ref_name }}
GHCR_ARM64: ghcr.io/${{ github.repository }}:${{ (github.head_ref != '' && format('merge-{0}-{1}', github.event.number, github.event.pull_request.user.login)) || github.ref_name }}-${{ github.sha }}-arm64v8
GHCR_AMD64: ghcr.io/${{ github.repository }}:${{ (github.head_ref != '' && format('merge-{0}-{1}', github.event.number, github.event.pull_request.user.login)) || github.ref_name }}-${{ github.sha }}-amd64
GHCR_TAG: ghcr.io/${{ github.repository }}:${{ (github.head_ref != '' && format('merge-{0}-{1}', github.event.number, github.event.pull_request.user.login)) || github.ref_name }}-${{ github.sha }}
GHCR_BRANCH: ghcr.io/${{ github.repository }}:${{ (startsWith(github.ref, 'refs/tags/v') && 'latest') || (github.head_ref != '' && format('merge-{0}-{1}', github.event.number, github.event.pull_request.user.login)) || github.ref_name }}
GLCR_ARM64: registry.gitlab.com/conduwuit/conduwuit:${{ (github.head_ref != '' && format('merge-{0}-{1}', github.event.number, github.event.pull_request.user.login)) || github.ref_name }}-${{ github.sha }}-arm64v8
GLCR_AMD64: registry.gitlab.com/conduwuit/conduwuit:${{ (github.head_ref != '' && format('merge-{0}-{1}', github.event.number, github.event.pull_request.user.login)) || github.ref_name }}-${{ github.sha }}-amd64
GLCR_TAG: registry.gitlab.com/conduwuit/conduwuit:${{ (github.head_ref != '' && format('merge-{0}-{1}', github.event.number, github.event.pull_request.user.login)) || github.ref_name }}-${{ github.sha }}
GLCR_BRANCH: registry.gitlab.com/conduwuit/conduwuit:${{ (startsWith(github.ref, 'refs/tags/v') && 'latest') || (github.head_ref != '' && format('merge-{0}-{1}', github.event.number, github.event.pull_request.user.login)) || github.ref_name }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }}
steps:
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to Docker Hub
if: ${{ (vars.DOCKER_USERNAME != '') && (env.DOCKERHUB_TOKEN != '') }}
uses: docker/login-action@v3
with:
registry: docker.io
username: ${{ vars.DOCKER_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitLab Container Registry
if: ${{ (vars.GITLAB_USERNAME != '') && (env.GITLAB_TOKEN != '') }}
uses: docker/login-action@v3
with:
registry: registry.gitlab.com
username: ${{ vars.GITLAB_USERNAME }}
password: ${{ secrets.GITLAB_TOKEN }}
- name: Download artifacts
uses: actions/download-artifact@v4
- name: Move OCI images into position
run: |
mv -v oci-image-x86_64-*-jemalloc/*.tar.gz oci-image-amd64.tar.gz
mv -v oci-image-aarch64-*-jemalloc/*.tar.gz oci-image-arm64v8.tar.gz
- name: Load and push amd64 image
if: ${{ (vars.DOCKER_USERNAME != '') && (env.DOCKERHUB_TOKEN != '') }}
run: |
docker load -i oci-image-amd64.tar.gz
docker tag $(docker images -q conduit:main) ${{ env.DOCKER_AMD64 }}
docker tag $(docker images -q conduit:main) ${{ env.GHCR_AMD64 }}
docker tag $(docker images -q conduit:main) ${{ env.GLCR_AMD64 }}
docker push ${{ env.DOCKER_AMD64 }}
docker push ${{ env.GHCR_AMD64 }}
docker push ${{ env.GLCR_AMD64 }}
- name: Load and push arm64 image
if: ${{ (vars.DOCKER_USERNAME != '') && (env.DOCKERHUB_TOKEN != '') }}
run: |
docker load -i oci-image-arm64v8.tar.gz
docker tag $(docker images -q conduit:main) ${{ env.DOCKER_ARM64 }}
docker tag $(docker images -q conduit:main) ${{ env.GHCR_ARM64 }}
docker tag $(docker images -q conduit:main) ${{ env.GLCR_ARM64 }}
docker push ${{ env.DOCKER_ARM64 }}
docker push ${{ env.GHCR_ARM64 }}
docker push ${{ env.GLCR_ARM64 }}
- name: Create Docker combined manifests
run: |
# Dockerhub Container Registry
docker manifest create ${{ env.DOCKER_TAG }} --amend ${{ env.DOCKER_ARM64 }} --amend ${{ env.DOCKER_AMD64 }}
docker manifest create ${{ env.DOCKER_BRANCH }} --amend ${{ env.DOCKER_ARM64 }} --amend ${{ env.DOCKER_AMD64 }}
# GitHub Container Registry
docker manifest create ${{ env.GHCR_TAG }} --amend ${{ env.GHCR_ARM64 }} --amend ${{ env.GHCR_AMD64 }}
docker manifest create ${{ env.GHCR_BRANCH }} --amend ${{ env.GHCR_ARM64 }} --amend ${{ env.GHCR_AMD64 }}
# GitLab Container Registry
docker manifest create ${{ env.GLCR_TAG }} --amend ${{ env.GLCR_ARM64 }} --amend ${{ env.GCCR_AMD64 }}
docker manifest create ${{ env.GLCR_BRANCH }} --amend ${{ env.GLCR_ARM64 }} --amend ${{ env.GLCR_AMD64 }}
- name: Push manifests to Docker registries
if: ${{ (vars.DOCKER_USERNAME != '') && (env.DOCKERHUB_TOKEN != '') }}
run: |
docker manifest push ${{ env.DOCKER_TAG }}
docker manifest push ${{ env.DOCKER_BRANCH }}
docker manifest push ${{ env.GHCR_TAG }}
docker manifest push ${{ env.GHCR_BRANCH }}
docker manifest push ${{ env.GLCR_TAG }}
docker manifest push ${{ env.GLCR_BRANCH }}
- name: Add Image Links to Job Summary
if: ${{ (vars.DOCKER_USERNAME != '') && (env.DOCKERHUB_TOKEN != '') }}
run: |
echo "- \`docker pull ${{ env.DOCKER_TAG }}\`" >> $GITHUB_STEP_SUMMARY
echo "- \`docker pull ${{ env.GHCR_TAG }}\`" >> $GITHUB_STEP_SUMMARY
echo "- \`docker pull ${{ env.GLCR_TAG }}\`" >> $GITHUB_STEP_SUMMARY
+117
View File
@@ -0,0 +1,117 @@
name: Documentation and GitHub Pages
on:
pull_request:
push:
branches:
- main
tags:
- '*'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
env:
# Required to make some things output color
TERM: ansi
# Publishing to my nix binary cache
ATTIC_TOKEN: ${{ secrets.ATTIC_TOKEN }}
# Custom nix binary cache if fork is being used
ATTIC_ENDPOINT: ${{ vars.ATTIC_ENDPOINT }}
ATTIC_PUBLIC_KEY: ${{ vars.ATTIC_PUBLIC_KEY }}
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
docs:
name: Documentation and GitHub Pages
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Sync repository
uses: actions/checkout@v4
- name: Setup GitHub Pages
if: github.event_name != 'pull_request'
uses: actions/configure-pages@v5
- name: Install Nix (with flakes and nix-command enabled)
uses: cachix/install-nix-action@v27
with:
nix_path: nixpkgs=channel:nixos-unstable
# Add `nix-community`, Crane, upstream Conduit, and conduwuit binary caches
extra_nix_config: |
experimental-features = nix-command flakes
extra-substituters = https://nix-community.cachix.org
extra-trusted-public-keys = nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=
extra-substituters = https://crane.cachix.org
extra-trusted-public-keys = crane.cachix.org-1:8Scfpmn9w+hGdXH/Q9tTLiYAE/2dnJYRJP7kl80GuRk=
extra-substituters = https://attic.kennel.juneis.dog/conduit
extra-trusted-public-keys = conduit:Isq8FGyEC6FOXH6nD+BOeAA+bKp6X6UIbupSlGEPuOg=
extra-substituters = https://attic.kennel.juneis.dog/conduwuit
extra-trusted-public-keys = conduwuit:lYPVh7o1hLu1idH4Xt2QHaRa49WRGSAqzcfFd94aOTw=
- name: Add alternative Nix binary caches if specified
if: ${{ (env.ATTIC_ENDPOINT != '') && (env.ATTIC_PUBLIC_KEY != '') }}
run: |
echo "extra-substituters = ${{ env.ATTIC_ENDPOINT }}" >> /etc/nix/nix.conf
echo "extra-trusted-public-keys = ${{ env.ATTIC_PUBLIC_KEY }}" >> /etc/nix/nix.conf
- name: Pop/push Magic Nix Cache
uses: DeterminateSystems/magic-nix-cache-action@main
- name: Configure `nix-direnv`
run: |
echo 'source $HOME/.nix-profile/share/nix-direnv/direnvrc' > "$HOME/.direnvrc"
- name: Install `direnv` and `nix-direnv`
run: nix-env -f "<nixpkgs>" -iA direnv -iA nix-direnv
# Do this to shorten the logs for the real CI step
- name: Populate `/nix/store`
run: nix develop --command true
- name: Allow direnv
run: direnv allow
- name: Cache CI dependencies
run: |
./bin/nix-build-and-cache ci
- name: Build documentation (book)
run: |
./bin/nix-build-and-cache just .#book
cp -r --dereference result public
- name: Upload generated documentation (book) as normal artifact
uses: actions/upload-artifact@v4
with:
name: public
path: public
if-no-files-found: error
# don't compress again
compression-level: 0
- name: Upload generated documentation (book) as GitHub Pages artifact
if: github.event_name != 'pull_request'
uses: actions/upload-pages-artifact@v3
with:
path: public
- name: Deploy to GitHub Pages
if: github.event_name != 'pull_request'
id: deployment
uses: actions/deploy-pages@v4
+42
View File
@@ -0,0 +1,42 @@
name: Trivy code and vulnerability scanning
on:
pull_request:
push:
branches:
- main
tags:
- '*'
schedule:
- cron: '00 12 * * *'
permissions:
contents: read
jobs:
trivy-scan:
name: Trivy Scan
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
actions: read
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Run Trivy code and vulnerability scanner on repo
uses: aquasecurity/trivy-action@0.20.0
with:
scan-type: repo
format: sarif
output: trivy-results.sarif
severity: CRITICAL,HIGH,MEDIUM,LOW
- name: Run Trivy code and vulnerability scanner on filesystem
uses: aquasecurity/trivy-action@0.20.0
with:
scan-type: fs
format: sarif
output: trivy-results.sarif
severity: CRITICAL,HIGH,MEDIUM,LOW
+96 -3
View File
@@ -1,4 +1,97 @@
node_modules
# Local environment overrides
/.env
servers/*.ign
.parcel-cache
# CMake
cmake-build-*/
# IntelliJ
.idea/
out/
*.iml
modules.xml
*.ipr
# mpeltonen/sbt-idea plugin
.idea_modules/
# Linux backup files
*~
# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*
# KDE directory preferences
.directory
# Linux trash folder which might appear on any partition or disk
.Trash-*
# .nfs files are created when an open file is removed but is still being accessed
.nfs*
# Rust
/target/
### vscode ###
.vscode/*
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace
### Windows ###
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db
# Dump file
*.stackdump
# Folder config file
[Dd]esktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows shortcuts
*.lnk
# Conduit
conduit.toml
conduit.db
# Etc.
**/*.rs.bk
cached_target
# Nix artifacts
/result*
# Direnv cache
/.direnv
test-conduit/
test-conduit.toml
# Gitlab CI cache
/.gitlab-ci.d
# mdbook output
public/
# macOS
.DS_Store
# VS Code
.vscode/
# Zed
.zed/
# idk where you're coming from, but i'm tired of you
rustc-ice-*
# complement test logs are huge
tests/test_results/complement/test_logs.jsonl
+144
View File
@@ -0,0 +1,144 @@
stages:
- ci
- artifacts
- publish
variables:
# Makes some things print in color
TERM: ansi
# Faster cache and artifact compression / decompression
FF_USE_FASTZIP: true
# Print progress reports for cache and artifact transfers
TRANSFER_METER_FREQUENCY: 5s
# Avoid duplicate pipelines
# See: https://docs.gitlab.com/ee/ci/yaml/workflow.html#switch-between-branch-pipelines-and-merge-request-pipelines
workflow:
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
when: never
- if: $CI
before_script:
# Enable nix-command and flakes
- if command -v nix > /dev/null; then echo "experimental-features = nix-command flakes" >> /etc/nix/nix.conf; fi
# Add conduwuit binary cache
- if command -v nix > /dev/null; then echo "extra-substituters = https://attic.kennel.juneis.dog/conduwuit" >> /etc/nix/nix.conf; fi
- if command -v nix > /dev/null; then echo "extra-trusted-public-keys = conduwuit:lYPVh7o1hLu1idH4Xt2QHaRa49WRGSAqzcfFd94aOTw=" >> /etc/nix/nix.conf; fi
- if command -v nix > /dev/null; then echo "extra-substituters = https://attic.kennel.juneis.dog/conduit" >> /etc/nix/nix.conf; fi
- if command -v nix > /dev/null; then echo "extra-trusted-public-keys = conduit:Isq8FGyEC6FOXH6nD+BOeAA+bKp6X6UIbupSlGEPuOg=" >> /etc/nix/nix.conf; fi
# Add alternate binary cache
- if command -v nix > /dev/null && [ -n "$ATTIC_ENDPOINT" ]; then echo "extra-substituters = $ATTIC_ENDPOINT" >> /etc/nix/nix.conf; fi
- if command -v nix > /dev/null && [ -n "$ATTIC_PUBLIC_KEY" ]; then echo "extra-trusted-public-keys = $ATTIC_PUBLIC_KEY" >> /etc/nix/nix.conf; fi
# Add Lix binary cache
- if command -v nix > /dev/null; then echo "extra-substituters = https://cache.lix.systems" >> /etc/nix/nix.conf; fi
- if command -v nix > /dev/null; then echo "extra-trusted-public-keys = cache.lix.systems:aBnZUw8zA7H35Cz2RyKFVs3H4PlGTLawyY5KRbvJR8o=" >> /etc/nix/nix.conf; fi
# Add crane binary cache
- if command -v nix > /dev/null; then echo "extra-substituters = https://crane.cachix.org" >> /etc/nix/nix.conf; fi
- if command -v nix > /dev/null; then echo "extra-trusted-public-keys = crane.cachix.org-1:8Scfpmn9w+hGdXH/Q9tTLiYAE/2dnJYRJP7kl80GuRk=" >> /etc/nix/nix.conf; fi
# Add nix-community binary cache
- if command -v nix > /dev/null; then echo "extra-substituters = https://nix-community.cachix.org" >> /etc/nix/nix.conf; fi
- if command -v nix > /dev/null; then echo "extra-trusted-public-keys = nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" >> /etc/nix/nix.conf; fi
# Install direnv and nix-direnv
- if command -v nix > /dev/null; then nix-env -iA nixpkgs.direnv nixpkgs.nix-direnv; fi
# Allow .envrc
- if command -v nix > /dev/null; then direnv allow; fi
# Set CARGO_HOME to a cacheable path
- export CARGO_HOME="$(git rev-parse --show-toplevel)/.gitlab-ci.d/cargo"
ci:
stage: ci
image: nixos/nix:2.22.1
script:
# Cache CI dependencies
- ./bin/nix-build-and-cache ci
- direnv exec . engage
cache:
key: nix
paths:
- target
- .gitlab-ci.d
rules:
# CI on upstream runners (only available for maintainers)
- if: $CI_PIPELINE_SOURCE == "merge_request_event" && $IS_UPSTREAM_CI == "true"
# Manual CI on unprotected branches that are not MRs
- if: $CI_PIPELINE_SOURCE != "merge_request_event" && $CI_COMMIT_REF_PROTECTED == "false"
when: manual
# Manual CI on forks
- if: $IS_UPSTREAM_CI != "true"
when: manual
- if: $CI
interruptible: true
artifacts:
stage: artifacts
image: nixos/nix:2.22.1
script:
- ./bin/nix-build-and-cache just .#static-x86_64-unknown-linux-musl
- cp result/bin/conduit x86_64-unknown-linux-musl
- mkdir -p target/release
- cp result/bin/conduit target/release
- direnv exec . cargo deb --no-build --no-strip
- mv target/debian/*.deb x86_64-unknown-linux-musl.deb
# Since the OCI image package is based on the binary package, this has the
# fun side effect of uploading the normal binary too. Conduit users who are
# deploying with Nix can leverage this fact by adding our binary cache to
# their systems.
#
# Note that although we have an `oci-image-x86_64-unknown-linux-musl`
# output, we don't build it because it would be largely redundant to this
# one since it's all containerized anyway.
- ./bin/nix-build-and-cache just .#oci-image
- cp result oci-image-amd64.tar.gz
- ./bin/nix-build-and-cache just .#static-aarch64-unknown-linux-musl
- cp result/bin/conduit aarch64-unknown-linux-musl
- ./bin/nix-build-and-cache just .#oci-image-aarch64-unknown-linux-musl
- cp result oci-image-arm64v8.tar.gz
- ./bin/nix-build-and-cache just .#book
# We can't just copy the symlink, we need to dereference it https://gitlab.com/gitlab-org/gitlab/-/issues/19746
- cp -r --dereference result public
artifacts:
paths:
- x86_64-unknown-linux-musl
- aarch64-unknown-linux-musl
- x86_64-unknown-linux-musl.deb
- oci-image-amd64.tar.gz
- oci-image-arm64v8.tar.gz
- public
rules:
# CI required for all MRs
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
# Optional CI on forks
- if: $IS_UPSTREAM_CI != "true"
when: manual
allow_failure: true
- if: $CI
interruptible: true
pages:
stage: publish
dependencies:
- artifacts
only:
- next
script:
- "true"
artifacts:
paths:
- public
+8
View File
@@ -0,0 +1,8 @@
<!-- Please describe your changes here -->
-----------------------------------------------------------------------------
- [ ] I ran `cargo fmt`, `cargo clippy`, and `cargo test`
- [ ] I agree to release my code and all other changes of this MR under the Apache-2.0 license
+3
View File
@@ -0,0 +1,3 @@
# Docs: Map markdown to html files
- source: /docs/(.+)\.md/
public: '\1.html'
+134
View File
@@ -0,0 +1,134 @@
# Contributor Covenant Code of Conduct
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, caste, color, religion, or sexual
identity and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
## Our Standards
Examples of behavior that contributes to a positive environment for our
community include:
* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the overall
community
Examples of unacceptable behavior include:
* The use of sexualized language or imagery, and sexual attention or advances of
any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email address,
without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Enforcement Responsibilities
Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.
Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.
## Scope
This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement over email at
strawberry@puppygock.gay or over Matrix at @strawberry:puppygock.gay.
All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series of
actions.
**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or permanent
ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within the
community.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.1, available at
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
For answers to common questions about this code of conduct, see the FAQ at
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
[https://www.contributor-covenant.org/translations][translations].
[homepage]: https://www.contributor-covenant.org
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
[Mozilla CoC]: https://github.com/mozilla/diversity
[FAQ]: https://www.contributor-covenant.org/faq
[translations]: https://www.contributor-covenant.org/translations
+92
View File
@@ -0,0 +1,92 @@
# Contributing guide
This page is for about contributing to conduwuit. The [development](docs/development.md) page may be of interest for you as well.
If you would like to work on an [issue][issues] that is not assigned, preferably ask in the Matrix room first at [#conduwuit:puppygock.gay][conduwuit-matrix], and comment on it.
### Linting and Formatting
It is mandatory all your changes satisfy the lints (clippy, rustc, rustdoc, etc) and your code is formatted via the **nightly** `cargo fmt`. A lot of the `rustfmt.toml` features depend on nightly toolchain. It would be ideal if they weren't nightly-exclusive features, but they currently still are. CI's rustfmt uses nightly.
If you need to allow a lint, please make sure it's either obvious as to why (e.g. clippy saying redundant clone but it's actually required) or it has a comment saying why. Do not write inefficient code for the sake of satisfying lints. If a lint is wrong and provides a more inefficient solution or suggestion, allow the lint and mention that in a comment.
### Running CI tests locally
conduwuit's CI for tests, linting, formatting, audit, etc use [`engage`][engage]. engage can be installed from nixpkgs or `cargo install engage`. conduwuit's Nix flake devshell has the nixpkgs engage with `direnv`. Use `engage --help` for more usage details.
To test, format, lint, etc that CI would do, install engage, allow the `.envrc` file using `direnv allow`, and run `engage`.
All of the tasks are defined at the [engage.toml][engage.toml] file. You can view all of them neatly by running `engage list`
If you would like to run only a specific engage task group, use `just`:
- `engage just <group>`
- Example: `engage just lints`
If you would like to run a specific engage task in a specific group, use `just <GROUP> [TASK]`: `engage just lints cargo-fmt`
The following binaries are used in [`engage.toml`][engage.toml]:
- [`engage`][engage]
- `nix`
- [`direnv`][direnv]
- `rustc`
- `cargo`
- `cargo-fmt`
- `rustdoc`
- `cargo-clippy`
- [`cargo-audit`][cargo-audit]
- [`cargo-deb`][cargo-deb]
- [`lychee`][lychee]
### Matrix tests
CI runs [Complement][complement], but currently does not fail if results from the checked-in results differ with the new results. If your changes are done to fix Matrix tests, note that in your pull request. If more Complement tests start failing from your changes, please review the logs (they are uploaded as artifacts) and determine if they're intended or not.
If you'd like to run Complement locally using Nix, see the [testing](docs/development/testing.md) page.
[Sytest][sytest] support will come soon.
### Writing documentation
conduwuit's website uses [`mdbook`][mdbook] and deployed via CI using GitHub Pages in the [`documentation.yml`][documentation.yml] workflow file with Nix's mdbook in the devshell. All documentation is in the `docs/` directory at the top level. The compiled mdbook website is also uploaded as an artifact.
To build the documentation using Nix, run: `bin/nix-build-and-cache just .#book`
The output of the mdbook generation is in `result/`. mdbooks can be opened in your browser from the individual HTML files without any web server needed.
### Inclusivity and Diversity
All **MUST** code and write with inclusivity and diversity in mind. See the [following page by Google on writing inclusive code and documentation](https://developers.google.com/style/inclusive-documentation).
This **EXPLICITLY** forbids usage of terms like "blacklist"/"whitelist" and "master"/"slave", [forbids gender-specific words and phrases](https://developers.google.com/style/pronouns#gender-neutral-pronouns), forbids ableist language like "sanity-check", "cripple", or "insane", and forbids culture-specific language (e.g. US-only holidays or cultures).
No exceptions are allowed. Dependencies that may use these terms are allowed but [do not replicate the name in your functions or variables](https://developers.google.com/style/inclusive-documentation#write-around).
In addition to language, write and code with the user experience in mind. This is software that intends to be used by everyone, so make it easy and comfortable for everyone to use. 🏳️‍⚧️
### Variable, comment, function, etc standards
Rust's default style and standards with regards to [function names, variable names, comments](https://rust-lang.github.io/api-guidelines/naming.html), etc applies here.
### Creating pull requests
Please try to keep contributions to the GitHub. While the mirrors of conduwuit allow for pull/merge requests, there is no guarantee I will see them in a timely manner. Additionally, please mark WIP or unfinished or incomplete PRs as drafts. This prevents me from having to ping once in a while to double check the status of it, especially when the CI completed successfully and everything so it *looks* done.
If you open a pull request on one of the mirrors, it is your responsibility to inform me about its existence. In the future I may try to solve this with more repo bots in the conduwuit Matrix room. There is no mailing list or email-patch support on the sr.ht mirror, but if you'd like to email me a git patch you can do so at `strawberry@puppygock.gay`.
Direct all PRs/MRs to the `main` branch.
By sending a pull request or patch, you are agreeing that your changes are allowed to be licenced under the Apache-2.0 licence and all of your conduct is in line with the Contributor's Covenant.
[issues]: https://github.com/girlbossceo/conduwuit/issues
[conduwuit-matrix]: https://matrix.to/#/#conduwuit:puppygock.gay
[complement]: https://github.com/matrix-org/complement/
[engage.toml]: https://github.com/girlbossceo/conduwuit/blob/main/engage.toml
[engage]: https://charles.page.computer.surgery/engage/
[sytest]: https://github.com/matrix-org/sytest/
[cargo-deb]: https://github.com/kornelski/cargo-deb
[lychee]: https://github.com/lycheeverse/lychee
[cargo-audit]: https://github.com/RustSec/rustsec/tree/main/cargo-audit
[direnv]: https://direnv.net/
[mdbook]: https://rust-lang.github.io/mdBook/
[documentation.yml]: https://github.com/girlbossceo/conduwuit/blob/main/.github/workflows/documentation.yml
Generated
+4663
View File
File diff suppressed because it is too large Load Diff
+659
View File
@@ -0,0 +1,659 @@
[package]
# TODO: when can we rename to conduwuit?
name = "conduit"
description = "a very cool fork of Conduit, a Matrix homeserver written in Rust"
license = "Apache-2.0"
authors = [
"strawberry <strawberry@puppygock.gay>",
"timokoesters <timo@koesters.xyz>",
]
homepage = "https://conduwuit.puppyirl.gay/"
repository = "https://github.com/girlbossceo/conduwuit"
readme = "README.md"
version = "0.3.4"
edition = "2021"
# See also `rust-toolchain.toml`
rust-version = "1.77.0"
[dependencies]
# 1.1.17 seems broken on nix from a permission error?
libz-sys = "=1.1.16"
console-subscriber = { version = "0.2", optional = true }
infer = { version = "0.15", default-features = false }
# for hot lib reload
hot-lib-reloader = { version = "^0.7", optional = true }
# Used for secure identifiers
rand = "0.8.5"
# Used for conduit::Error type
thiserror = "1.0.60"
# Used to encode server public key
base64 = "0.22.1"
# Used when hashing the state
ring = "0.17.8"
# Used to find matching events for appservices
regex = "1.10.4"
# Used to load forbidden room/user regex from config
serde_regex = "1.1.0"
# Used to make working with iterators easier, was already a transitive depdendency
itertools = "0.12.1"
# jwt jsonwebtokens
jsonwebtoken = "9.3.0"
# Used for ruma wrapper
serde_html_form = "0.2.6"
# used for TURN server authentication
hmac = "0.12.1"
sha-1 = "0.10.1"
# used for checking if an IP is in specific subnets / CIDR ranges easier
ipaddress = "0.1.3"
# to get the client IP address of requests
#axum-client-ip = "0.4.2"
# to parse user-friendly time durations in admin commands
cyborgtime = "2.1.1"
# all the web/HTTP dependencies
# Used for the http request / response body type for Ruma endpoints used with reqwest
bytes = "1.6.0"
http = "1.1.0"
http-body-util = "0.1.1"
# used to replace the channels of the tokio runtime
loole = "0.3.0"
# Validating urls in config, was already a transitive dependency
url = { version = "2.5.0", features = ["serde"] }
async-trait = "0.1.80"
lru-cache = "0.1.2"
sanitize-filename = "0.5.0"
# standard date and time tools
[dependencies.chrono]
version = "0.4.38"
features = ["alloc"]
default-features = false
# Web framework
[dependencies.axum]
version = "0.7.5"
default-features = false
features = ["form", "http1", "http2", "json", "matched-path"]
[dependencies.axum-extra]
version = "0.9.3"
default-features = false
features = ["typed-header"]
[dependencies.axum-server]
version = "0.6.0"
features = ["tls-rustls"]
[dependencies.tower]
version = "0.4.13"
features = ["util"]
[dependencies.tower-http]
version = "0.5.2"
features = [
"add-extension",
"cors",
"sensitive-headers",
"set-header",
"trace",
"util",
"catch-panic",
]
[dependencies.hyper]
version = "1.3.1"
features = ["server", "http1", "http2"]
[dependencies.hyper-util]
version = "0.1.3"
[dependencies.reqwest]
version = "0.12.4"
default-features = false
features = ["rustls-tls-native-roots", "socks", "hickory-dns"]
# all the serde stuff
# Used for pdu definition
[dependencies.serde]
version = "1.0.201"
features = ["rc"]
# Used for appservice registration files
[dependencies.serde_yaml]
version = "0.9.34"
# Used for ruma wrapper
[dependencies.serde_json]
version = "1.0.117"
features = ["raw_value"]
# Used for password hashing
[dependencies.argon2]
version = "0.5.3"
features = ["alloc", "rand"]
default-features = false
# Used to generate thumbnails for images
[dependencies.image]
version = "0.25.1"
default-features = false
features = ["jpeg", "png", "gif", "webp"]
# logging
[dependencies.log]
version = "0.4.21"
default-features = false
[dependencies.tracing]
version = "0.1.40"
default-features = false
[dependencies.tracing-subscriber]
version = "0.3.18"
features = ["env-filter"]
# optional SHA256 media keys feature
[dependencies.sha2]
version = "0.10.8"
optional = true
# optional opentelemetry, performance measurements, flamegraphs, etc for performance measurements and monitoring
[dependencies.opentelemetry]
version = "0.21.0"
optional = true
[dependencies.tracing-flame]
version = "0.2.0"
optional = true
[dependencies.tracing-opentelemetry]
version = "0.22.0"
optional = true
[dependencies.opentelemetry_sdk]
version = "0.21.2"
optional = true
features = ["rt-tokio"]
[dependencies.opentelemetry-jaeger]
version = "0.20.0"
optional = true
features = ["rt-tokio"]
# optional sentry metrics for crash/panic reporting
[dependencies.sentry]
version = "0.32.3"
optional = true
default-features = false
features = [
"backtrace",
"contexts",
"debug-images",
"panic",
"rustls",
"tower",
"tower-http",
"tracing",
"reqwest",
"log",
]
[dependencies.sentry-tracing]
version = "0.32.3"
optional = true
[dependencies.sentry-tower]
version = "0.32.3"
optional = true
# optional jemalloc usage
[dependencies.tikv-jemalloc-sys]
version = "0.5.4"
optional = true
default-features = false
features = ["stats", "unprefixed_malloc_on_supported_platforms"]
[dependencies.tikv-jemallocator]
version = "0.5.4"
optional = true
default-features = false
features = ["stats", "unprefixed_malloc_on_supported_platforms"]
[dependencies.tikv-jemalloc-ctl]
version = "0.5.4"
optional = true
default-features = false
features = ["use_std"]
# for URL previews
[dependencies.webpage]
version = "2.0.1"
default-features = false
# to support multiple variations of setting a config option
[dependencies.either]
version = "1.11.0"
features = ["serde"]
# to listen on both HTTP and HTTPS if listening on TLS dierctly from conduwuit for complement or sytest
[dependencies.axum-server-dual-protocol]
version = "0.6"
optional = true
# used for conduit's CLI and admin room command parsing
[dependencies.clap]
version = "4.5.4"
default-features = false
features = ["std", "derive", "help", "usage", "error-context", "string"]
[dependencies.futures-util]
version = "0.3.30"
default-features = false
# Used for reading the configuration from conduwuit.toml & environment variables
[dependencies.figment]
version = "0.10.18"
features = ["env", "toml"]
# Used for matrix spec type definitions and helpers
[dependencies.ruma]
git = "https://github.com/girlbossceo/ruma"
branch = "conduwuit-changes"
features = [
"compat",
"rand",
"appservice-api-c",
"client-api",
"federation-api",
"push-gateway-api-c",
"state-res",
"unstable-exhaustive-types",
"ring-compat",
"unstable-unspecified",
"unstable-msc2448",
"unstable-msc2666",
"unstable-msc2867",
"unstable-msc2870",
"unstable-msc3026",
"unstable-msc3061",
"unstable-msc3575",
"unstable-msc4121",
"unstable-msc4125",
"unstable-extensible-events",
]
[dependencies.ruma-identifiers-validation]
git = "https://github.com/girlbossceo/ruma"
branch = "conduwuit-changes"
[dependencies.hickory-resolver]
version = "0.24.1"
default-features = false
[dependencies.rust-rocksdb]
git = "https://github.com/zaidoon1/rust-rocksdb"
branch = "master"
optional = true
default-features = true
features = ["multi-threaded-cf", "zstd"]
[dependencies.rusqlite]
git = "https://github.com/rusqlite/rusqlite"
#branch = "master"
rev = "e00b626e2b1c67347d789fb7f600281705c89381"
optional = true
features = ["bundled"]
# used only by rusqlite
[dependencies.parking_lot]
version = "0.12.2"
optional = true
# used only by rusqlite
[dependencies.thread_local]
version = "1.1.8"
optional = true
# used only by rusqlite and rust-rocksdb
[dependencies.num_cpus]
version = "1.16.0"
[dependencies.tokio]
version = "1.37.0"
features = ["fs", "macros", "sync", "signal"]
# *nix-specific dependencies
[target.'cfg(unix)'.dependencies]
nix = { version = "0.28.0", features = ["resource"] }
sd-notify = { version = "0.4.1", optional = true } # systemd is only available/relevant on *nix platforms
[target.'cfg(all(not(target_env = "msvc"), target_os = "linux"))'.dependencies]
hardened_malloc-rs = { version = "0.1.2", optional = true, features = [
"static",
"gcc",
"light",
], default-features = false }
#hardened_malloc-rs = { optional = true, features = ["static","clang","light"], path = "../hardened_malloc-rs", default-features = false }
# backport of [https://github.com/tokio-rs/tracing/pull/2956] to the 0.1.x branch of tracing.
# we can switch back to upstream if #2956 is merged and backported in the upstream repo.
[patch.crates-io.tracing-subscriber]
git = "https://github.com/girlbossceo/tracing"
branch = "tracing-subscriber/env-filter-clone-0.1.x-backport"
[patch.crates-io.tracing]
git = "https://github.com/girlbossceo/tracing"
branch = "tracing-subscriber/env-filter-clone-0.1.x-backport"
[patch.crates-io.tracing-core]
git = "https://github.com/girlbossceo/tracing"
branch = "tracing-subscriber/env-filter-clone-0.1.x-backport"
[features]
default = [
"backend_rocksdb",
"systemd",
"element_hacks",
"sentry_telemetry",
"gzip_compression",
"brotli_compression",
"zstd_compression",
"release_max_log_level",
"io_uring",
]
backend_sqlite = ["sqlite"]
backend_rocksdb = ["rocksdb"]
rocksdb = ["dep:rust-rocksdb"]
jemalloc = [
"dep:tikv-jemalloc-sys",
"dep:tikv-jemalloc-ctl",
"dep:tikv-jemallocator",
"rust-rocksdb/jemalloc",
]
jemalloc_prof = ["tikv-jemalloc-sys/profiling"]
sqlite = ["dep:rusqlite", "dep:parking_lot", "dep:thread_local"]
systemd = ["dep:sd-notify"]
sentry_telemetry = ["dep:sentry", "dep:sentry-tracing", "dep:sentry-tower"]
gzip_compression = ["tower-http/compression-gzip", "reqwest/gzip"]
zstd_compression = ["tower-http/compression-zstd"]
brotli_compression = ["tower-http/compression-br", "reqwest/brotli"]
sha256_media = ["dep:sha2"]
io_uring = ["rust-rocksdb/io-uring"]
axum_dual_protocol = ["dep:axum-server-dual-protocol"]
perf_measurements = [
"dep:opentelemetry",
"dep:tracing-flame",
"dep:tracing-opentelemetry",
"dep:opentelemetry_sdk",
"dep:opentelemetry-jaeger",
]
# enable the tokio_console server
# incompatible with release_max_log_level
tokio_console = ["dep:console-subscriber", "tokio/tracing"]
hot_reload = ["dep:hot-lib-reloader"]
hardened_malloc = ["dep:hardened_malloc-rs"]
# increases performance, reduces build times, and reduces binary size by not compiling or
# genreating code for log level filters that users will generally not use (debug and trace) only in release builds
#
# the expense is obviously losing those log level filters for usage at runtime. debug builds will still have all log levels
release_max_log_level = [
"tracing/max_level_trace",
"tracing/release_max_level_info",
"log/max_level_trace",
"log/release_max_level_info",
]
# developer feature useful only in debug builds.
dev_release_log_level = []
# client/server interopability hacks
#
## element has various non-spec compliant behaviour
element_hacks = []
[package.metadata.deb]
name = "conduwuit"
maintainer = "strawberry <strawberry@puppygock.gay>"
copyright = "2024, strawberry <strawberry@puppygock.gay>"
license-file = ["LICENSE", "3"]
depends = "$auto, ca-certificates"
extended-description = """\
a cool hard fork of Conduit, a Matrix homeserver written in Rust"""
section = "net"
priority = "optional"
assets = [
[
"debian/README.md",
"usr/share/doc/conduwuit/README.Debian",
"644",
],
[
"README.md",
"usr/share/doc/conduwuit/",
"644",
],
[
"target/release/conduwuit",
"usr/sbin/conduwuit",
"755",
],
[
"conduwuit-example.toml",
"etc/conduwuit/conduwuit.toml",
"640",
],
]
conf-files = ["/etc/conduwuit/conduwuit.toml"]
maintainer-scripts = "debian/"
systemd-units = { unit-name = "conduwuit", start = false }
[profile.dev]
#debug = 0
lto = 'off'
codegen-units = 512
incremental = true
overflow-checks = true
#panic = "abort"
# seems to speed up continuous debug compilations
[profile.dev.build-override]
opt-level = 3
[profile.dev.package."*"] # external dependencies
opt-level = 1
[profile.dev.package."tokio"]
opt-level = 3
# default release profile
[profile.release]
lto = 'thin'
incremental = false
opt-level = 3
strip = "symbols"
control-flow-guard = true # Windows only
debug = 0
# release profile with debug symbols
[profile.release-debuginfo]
inherits = "release"
strip = "none"
debug = "full"
# high performance release profile which uses fat LTO across all crates, 1 codegen unit, max opt-level, and optimises across all crates
[profile.release-high-perf]
inherits = "release"
lto = 'fat'
codegen-units = 1
panic = "abort"
# For releases also try to max optimizations for dependencies:
[profile.release-high-perf.build-override]
debug = 0
opt-level = 3
codegen-units = 1
[profile.release-high-perf.package."*"]
debug = 0
opt-level = 3
codegen-units = 1
[lints]
workspace = true
[workspace.lints.rust]
missing_abi = "warn"
noop_method_call = "warn"
pointer_structural_match = "warn"
explicit_outlives_requirements = "warn"
unused_extern_crates = "warn"
unused_import_braces = "warn"
unused_lifetimes = "warn"
unused_qualifications = "warn"
unused_macro_rules = "warn"
dead_code = "warn"
elided_lifetimes_in_paths = "warn"
macro_use_extern_crate = "warn"
single_use_lifetimes = "warn"
unsafe_op_in_unsafe_fn = "warn"
unreachable_pub = "warn"
# this seems to suggest broken code and is not working correctly
unused_braces = "allow"
# some sadness
missing_docs = "allow"
[workspace.lints.clippy]
# pedantic = "warn"
suspicious = "warn" # assume deny in practice
perf = "warn" # assume deny in practice
redundant_clone = "warn"
cloned_instead_of_copied = "warn"
expl_impl_clone_on_copy = "warn"
unnecessary_cast = "warn"
cast_lossless = "warn"
ptr_as_ptr = "warn"
mut_mut = "warn"
char_lit_as_u8 = "warn"
dbg_macro = "warn"
empty_structs_with_brackets = "warn"
get_unwrap = "warn"
negative_feature_names = "warn"
pub_without_shorthand = "warn"
rc_buffer = "warn"
rc_mutex = "warn"
redundant_feature_names = "warn"
redundant_type_annotations = "warn"
rest_pat_in_fully_bound_structs = "warn"
str_to_string = "warn"
string_to_string = "warn"
tests_outside_test_module = "warn"
undocumented_unsafe_blocks = "warn"
unneeded_field_pattern = "warn"
unseparated_literal_suffix = "warn"
wildcard_dependencies = "warn"
or_fun_call = "warn"
unnecessary_lazy_evaluations = "warn"
assertions_on_result_states = "warn"
default_union_representation = "warn"
deref_by_slicing = "warn"
empty_drop = "warn"
exit = "warn"
filetype_is_file = "warn"
float_cmp_const = "warn"
format_push_string = "warn"
impl_trait_in_params = "warn"
lossy_float_literal = "warn"
mem_forget = "warn"
missing_assert_message = "warn"
mutex_atomic = "warn"
semicolon_outside_block = "warn"
fn_to_numeric_cast = "warn"
fn_to_numeric_cast_with_truncation = "warn"
string_lit_chars_any = "warn"
suspicious_xor_used_as_pow = "warn"
try_err = "warn"
unnecessary_safety_comment = "warn"
unnecessary_safety_doc = "warn"
unnecessary_self_imports = "warn"
verbose_file_reads = "warn"
cast_possible_wrap = "warn"
redundant_closure_for_method_calls = "warn"
large_futures = "warn"
semicolon_if_nothing_returned = "warn"
match_bool = "warn"
struct_excessive_bools = "warn"
must_use_candidate = "warn"
collapsible_else_if = "warn"
inconsistent_struct_constructor = "warn"
manual_string_new = "warn"
zero_sized_map_values = "warn"
unnecessary_box_returns = "warn"
map_unwrap_or = "warn"
implicit_clone = "warn"
match_wildcard_for_single_variants = "warn"
unnecessary_wraps = "warn"
match_same_arms = "warn"
ignored_unit_patterns = "warn"
redundant_else = "warn"
explicit_into_iter_loop = "warn"
used_underscore_binding = "warn"
needless_pass_by_value = "warn"
too_many_lines = "warn"
let_underscore_untyped = "warn"
single_match = "warn"
single_match_else = "warn"
explicit_deref_methods = "warn"
explicit_iter_loop = "warn"
manual_let_else = "warn"
trivially_copy_pass_by_ref = "warn"
wildcard_imports = "warn"
checked_conversions = "warn"
#integer_arithmetic = "warn"
#as_conversions = "warn"
# some sadness
missing_errors_doc = "allow"
missing_panics_doc = "allow"
module_name_repetitions = "allow"
if_not_else = "allow"
doc_markdown = "allow"
cast_possible_truncation = "allow"
cast_precision_loss = "allow"
cast_sign_loss = "allow"
same_name_method = "allow"
mod_module_files = "allow"
unwrap_used = "allow"
expect_used = "allow"
if_then_some_else_none = "allow"
let_underscore_must_use = "allow"
map_err_ignore = "allow"
missing_docs_in_private_items = "allow"
multiple_inherent_impl = "allow"
error_impl_error = "allow"
string_add = "allow"
string_slice = "allow"
ref_patterns = "allow"
+202
View File
@@ -0,0 +1,202 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2023 June
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
+71
View File
@@ -0,0 +1,71 @@
# conduwuit
`main` / stable: [![CI and Artifacts](https://github.com/girlbossceo/conduwuit/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/girlbossceo/conduwuit/actions/workflows/ci.yml)
<!-- ANCHOR: catchphrase -->
### a very cool, featureful fork of [Conduit](https://conduit.rs/)
<!-- ANCHOR_END: catchphrase -->
Visit the [Conduwuit documentation](https://conduwuit.puppyirl.gay/) for more information.
<!-- ANCHOR: body -->
#### What is Matrix?
[Matrix](https://matrix.org) is an open network for secure and decentralized
communication. Users from every Matrix homeserver can chat with users from all
other Matrix servers. You can even use bridges (also called Matrix Appservices)
to communicate with users outside of Matrix, like a community on Discord.
#### What is the goal?
An efficient Matrix homeserver that's easy to set up and just works. You can install
it on a mini-computer like the Raspberry Pi to host Matrix for your family,
friends or company.
#### Can I try it out?
An official conduwuit server ran by me is available at transfem.dev ([element.transfem.dev](https://element.transfem.dev) / [cinny.transfem.dev](https://cinny.transfem.dev))
transfem.dev is a public homeserver that can be used, it is not a "test only homeserver". This means there are rules, so please read the rules: [https://transfem.dev/homeserver_rules.txt](https://transfem.dev/homeserver_rules.txt)
transfem.dev is also listed at [servers.joinmatrix.org](https://servers.joinmatrix.org/)
#### What is the current status?
conduwuit is a hard fork of Conduit which is in beta, meaning you can join and participate in most
Matrix rooms, but not all features are supported and you might run into bugs
from time to time.
<!-- ANCHOR_END: body -->
<!-- ANCHOR: footer -->
#### Contact
If you run into any question, feel free to
- Ask us in `#conduwuit:puppygock.gay` on Matrix
- [Open an issue on GitHub](https://github.com/girlbossceo/conduwuit/issues/new)
#### Donate
- Liberapay: <https://liberapay.com/girlbossceo>
- Ko-fi: <https://ko-fi.com/puppygock>
- GitHub Sponsors: <https://github.com/sponsors/girlbossceo>
#### Logo
Original repo and Matrix room picture was from bran (<3). Current banner image and logo is directly from [this cohost post](https://cohost.org/RatBaby/post/1028290-finally-a-flag-for).
#### Is it conduwuit or Conduwuit?
Both, but I prefer conduwuit.
#### Mirrors of conduwuit
- GitHub: <https://github.com/girlbossceo/conduwuit>
- GitLab: <https://gitlab.com/conduwuit/conduwuit>
- git.girlcock.ceo: <https://git.girlcock.ceo/strawberry/conduwuit>
- git.gay: <https://git.gay/june/conduwuit>
- Codeberg: <https://codeberg.org/girlbossceo/conduwuit>
- sourcehut: <https://git.sr.ht/~girlbossceo/conduwuit>
<!-- ANCHOR_END: footer -->
+2
View File
@@ -0,0 +1,2 @@
[advisories]
ignore = ["RUSTSEC-2020-0016"]
Executable
+43
View File
@@ -0,0 +1,43 @@
#!/usr/bin/env bash
set -euo pipefail
# Path to Complement's source code
#
# The `COMPLEMENT_SRC` environment variable is set in the Nix dev shell, which
# points to a store path containing the Complement source code. It's likely you
# want to just pass that as the first argument to use it here.
COMPLEMENT_SRC="$1"
# A `.jsonl` file to write test logs to
LOG_FILE="$2"
# A `.jsonl` file to write test results to
RESULTS_FILE="$3"
OCI_IMAGE="complement-conduit:main"
toplevel="$(git rev-parse --show-toplevel)"
pushd "$toplevel" > /dev/null
bin/nix-build-and-cache just .#complement
docker load < result
popd > /dev/null
# It's okay (likely, even) that `go test` exits nonzero
set +o pipefail
env \
-C "$COMPLEMENT_SRC" \
COMPLEMENT_BASE_IMAGE="$OCI_IMAGE" \
go test -tags="conduwuit_blacklist" -v -timeout 1h -json ./tests | tee "$LOG_FILE"
set -o pipefail
# Post-process the results into an easy-to-compare format, sorted by Test name for reproducible results
cat "$LOG_FILE" | jq -s -c 'sort_by(.Test)[]' | jq -c '
select(
(.Action == "pass" or .Action == "fail" or .Action == "skip")
and .Test != null
) | {Action: .Action, Test: .Test}
' > "$RESULTS_FILE"
+96
View File
@@ -0,0 +1,96 @@
#!/usr/bin/env bash
set -eo pipefail
toplevel="$(git rev-parse --show-toplevel)"
# Build just the single installable and forward any other arguments too
just() {
# uses nix-output-monitor (nom) if available
if command -v nom &> /dev/null; then
nom build "$@"
else
nix build -L "$@"
fi
if [ -z "$ATTIC_TOKEN" ]; then
echo "\$ATTIC_TOKEN is unset, skipping uploading to the binary cache"
return
fi
# historical "conduit" store for compatibility purposes, same as conduwuit
nix run --inputs-from "$toplevel" attic -- \
login \
conduit \
"${ATTIC_ENDPOINT:-https://attic.kennel.juneis.dog/conduit}" \
"$ATTIC_TOKEN"
# Find all output paths of the installables and their build dependencies
readarray -t derivations < <(nix path-info --derivation "$@")
cache=()
for derivation in "${derivations[@]}"; do
cache+=(
"$(nix-store --query --requisites --include-outputs "$derivation")"
)
done
# Upload them to Attic (conduit store)
#
# Use `xargs` and a here-string because something would probably explode if
# several thousand arguments got passed to a command at once. Hopefully no
# store paths include a newline in them.
(
IFS=$'\n'
nix shell --inputs-from "$toplevel" attic -c xargs \
attic push conduit <<< "${cache[*]}"
)
# main "conduwuit" store
nix run --inputs-from "$toplevel" attic -- \
login \
conduwuit \
"${ATTIC_ENDPOINT:-https://attic.kennel.juneis.dog/conduwuit}" \
"$ATTIC_TOKEN"
# Upload them to Attic (conduwuit store)
#
# Use `xargs` and a here-string because something would probably explode if
# several thousand arguments got passed to a command at once. Hopefully no
# store paths include a newline in them.
(
IFS=$'\n'
nix shell --inputs-from "$toplevel" attic -c xargs \
attic push conduwuit <<< "${cache[*]}"
)
}
# Build and cache things needed for CI
ci() {
cache=(
--inputs-from "$toplevel"
# Keep sorted
"$toplevel#devShells.x86_64-linux.default"
attic#default
nixpkgs#direnv
nixpkgs#jq
nixpkgs#nix-direnv
)
just "${cache[@]}"
}
# Build and cache *all* the package outputs from the flake.nix
packages() {
declare -a cache="($(
nix flake show --json 2> /dev/null |
nix run --inputs-from "$toplevel" nixpkgs#jq -- \
-r \
'.packages."x86_64-linux" | keys | map("'"$toplevel"'#" + .) | @sh'
))"
just "${cache[@]}"
}
eval "$@"
+18
View File
@@ -0,0 +1,18 @@
[book]
title = "conduwuit"
description = "conduwuit, which is a well-maintained fork of Conduit, is a simple, fast and reliable chat server for the Matrix protocol"
language = "en"
multilingual = false
src = "docs"
[build]
build-dir = "public"
create-missing = true
[output.html]
git-repository-url = "https://github.com/girlbossceo/conduwuit"
edit-url-template = "https://github.com/girlbossceo/conduwuit/edit/main/{path}"
git-repository-icon = "fa-github-square"
[output.html.search]
limit-results = 15
+1
View File
@@ -0,0 +1 @@
too-many-lines-threshold = 700
-114
View File
@@ -1,114 +0,0 @@
# podman save --format oci-archive jade-website-frontend:latest | gzip | ssh core@176.126.240.240 -T "zcat | podman load"
# podman compose create
# let containers = podman ps -a --format json | from json | where Labels."com.docker.compose.project" == "jade-website"
# podman compose create; let containers = podman ps -a --format json | from json | where Labels."com.docker.compose.project" == "jade-website"; podman kube generate ($containers | get Id) | save deployment.yml
# echo deployment.yml | ssh core@176.126.240.240 -T "cat > deployment.yml"
# $containers.1.Labels | to yaml
# podman kube generate -s ($containers | get Id) --podman-only | ssh core@176.126.240.240 -T "cat > deployment.yml"
version: '2'
services:
jade-website-frontend:
image: jade-website-frontend:latest
build:
context: .
dockerfile: packages/website/Dockerfile
restart: unless-stopped
# ports:
# - 3000:3000
networks:
- proxy
# deploy:
labels:
- "traefik.enable=true"
- "traefik.docker.network=proxy" # Change this to the name of your Traefik docker proxy network
# - "traefik.http.routers.to-website.rule=Host(`jade.ellis.link`)"
# - "traefik.http.routers.to-website.entrypoints=http"
- "traefik.http.routers.to-website.rule=Host(`jade.ellis.link.localhost`)"
- "traefik.http.routers.to-website.entrypoints=http"
# - "traefik.http.routers.to-website.tls=true"
# - "traefik.http.routers.to-website.tls.certresolver=letsencrypt"
# - "traefik.http.routers.to-website.middlewares=cors-headers@docker"
# - "traefik.http.middlewares.cors-headers.headers.accessControlAllowOriginList=*"
# - "traefik.http.middlewares.cors-headers.headers.accessControlAllowHeaders=Origin, X-Requested-With, Content-Type, Accept, Authorization"
# - "traefik.http.middlewares.cors-headers.headers.accessControlAllowMethods=GET, POST, PUT, DELETE, OPTIONS"
traefik:
image: "traefik:latest"
container_name: "traefik"
restart: "unless-stopped"
# privileged: true
security_opt:
- "label=type:container_runtime_t"
command:
- "--log.level=DEBUG"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.http.address=:8080"
# - "--entrypoints.https.address=:443"
# - "--acme"
# - "--certificatesresolvers.letsencrypt.acme.email='jade@ellis.link'"
# - "--certificatesresolvers.letsencrypt.acme.storage=/certificates/acme.json"
# - "--certificatesresolvers.letsencrypt.acme.httpchallenge=true"
# - "--certificatesresolvers.letsencrypt.acme.httpChallenge.entryPoint=http"
# - "--certificatesresolvers.lets-encrypt.acme.tlschallenge=true"
# - "--entrypoints.http.http.redirections.entryPoint.to=https"
# - "--entrypoints.http.http.redirections.entryPoint.scheme=https"
# - --api.dashboard=true
# - --api.insecure=true
ports:
# - "80:80"
# - "443:443"
- "8080:8080"
volumes:
- "/run/user/1000/podman/podman.sock:/var/run/docker.sock"
# - "/var/run/docker.sock:/var/run/docker.sock:ro"
- "traefik-public-certificates:/certificates"
# - "./traefik_config:/etc/traefik"
# labels:
# - "traefik.enable=true"
# # middleware redirect
# - "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
# # global redirect to https
# - "traefik.http.routers.redirs.rule=hostregexp(`{host:.+}`)"
# - "traefik.http.routers.redirs.entrypoints=http"
# - "traefik.http.routers.redirs.middlewares=redirect-to-https"
networks:
- proxy
networks:
proxy:
# external: true
enable_ipv6: true
volumes:
traefik-public-certificates:
# mkdir -p ~/.config/containers/systemd
# nano ~/.config/containers/systemd/deployment.kube
# [Unit]
# Description=Deployment via kubernetes
# Before=local-fs.target
# [Kube]
# Yaml=/var/home/core/deployment.yml
# [Install]
# # Start by default on boot
# WantedBy=multi-user.target default.target
# systemctl --user daemon-reload
# systemctl --user start deployment.service
+743
View File
@@ -0,0 +1,743 @@
# =============================================================================
# This is the official example config for conduwuit.
# If you use it for your server, you will need to adjust it to your own needs.
# At the very least, change the server_name field!
#
# This documentation can also be found at https://conduwuit.puppyirl.gay/configuration.html
# =============================================================================
[global]
# The server_name is the pretty name of this server. It is used as a suffix for user
# and room ids. Examples: matrix.org, conduit.rs
# The Conduit server needs all /_matrix/ requests to be reachable at
# https://your.server.name/ on port 443 (client-server) and 8448 (federation).
# If that's not possible for you, you can create /.well-known files to redirect
# requests (delegation). See
# https://spec.matrix.org/latest/client-server-api/#getwell-knownmatrixclient
# and
# https://spec.matrix.org/v1.9/server-server-api/#getwell-knownmatrixserver
# for more information
# YOU NEED TO EDIT THIS
#server_name = "your.server.name"
# Servers listed here will be used to gather public keys of other servers (notary trusted key servers).
#
# The default behaviour for conduwuit is to attempt to query trusted key servers before querying the individual servers.
# This is done for performance reasons, but if you would like to query individual servers before the notary servers
# configured below, set to
#
# (Currently, conduwuit doesn't support batched key requests, so this list should only contain Synapse servers)
# Defaults to `matrix.org`
# trusted_servers = ["matrix.org"]
# Sentry.io crash/panic reporting, performance monitoring/metrics, etc. This is NOT enabled by default.
# conduwuit's default Sentry reporting endpoint is o4506996327251968.ingest.us.sentry.io
#
# Defaults to *false*
#sentry = false
# Sentry reporting URL if a custom one is desired
#
# Defaults to conduwuit's default Sentry endpoint: "https://fe2eb4536aa04949e28eff3128d64757@o4506996327251968.ingest.us.sentry.io/4506996334657536"
#sentry_endpoint = ""
# Report your Conduwuit server_name in Sentry.io crash reports and metrics
#
# Defaults to false
#sentry_send_server_name = false
# Performance monitoring/tracing sample rate for Sentry.io
#
# Note that too high values may impact performance, and can be disabled by setting it to 0.0
#
# Defaults to 0.15
#sentry_traces_sample_rate = 0.15
### Database configuration
# This is the only directory where conduwuit will save its data, including media.
# Note: this was previously "/var/lib/matrix-conduit"
database_path = "/var/lib/conduwuit"
# Database backend: Only rocksdb and sqlite are supported. Please note that sqlite
# will perform significantly worse than rocksdb as it is not intended to be used the
# way it is by conduwuit. sqlite only exists for historical reasons.
database_backend = "rocksdb"
### Network
# The port(s) conduwuit will be running on. You need to set up a reverse proxy such as
# Caddy or Nginx so all requests to /_matrix on port 443 and 8448 will be
# forwarded to the conduwuit instance running on this port
# Docker users: Don't change this, you'll need to map an external port to this.
# To listen on multiple ports, specify a vector e.g. [8080, 8448]
port = 6167
# default address (IPv4 or IPv6) conduwuit will listen on. Generally you want this to be
# localhost (127.0.0.1 / ::1). If you are using Docker or a container NAT networking setup, you
# likely need this to be 0.0.0.0.
address = "127.0.0.1"
# Max request size for file uploads
max_request_size = 20_000_000 # in bytes
# Uncomment unix_socket_path to listen on a UNIX socket at the specified path.
# If listening on a UNIX socket, you must remove/comment the 'address' key if defined and add your
# reverse proxy to the 'conduwuit' group, unless world RW permissions are specified with unix_socket_perms (666 minimum).
#unix_socket_path = "/run/conduwuit/conduwuit.sock"
#unix_socket_perms = 660
# Set this to true for conduwuit to compress HTTP response bodies using zstd.
# This option does nothing if conduwuit was not built with `zstd_compression` feature.
# Please be aware that enabling HTTP compression may weaken TLS.
# Most users should not need to enable this.
# See https://breachattack.com/ and https://wikipedia.org/wiki/BREACH before deciding to enable this.
zstd_compression = false
# Set this to true for conduwuit to compress HTTP response bodies using gzip.
# This option does nothing if conduwuit was not built with `gzip_compression` feature.
# Please be aware that enabling HTTP compression may weaken TLS.
# Most users should not need to enable this.
# See https://breachattack.com/ and https://wikipedia.org/wiki/BREACH before deciding to enable this.
gzip_compression = false
# Set this to true for conduwuit to compress HTTP response bodies using brotli.
# This option does nothing if conduwuit was not built with `brotli_compression` feature.
# Please be aware that enabling HTTP compression may weaken TLS.
# Most users should not need to enable this.
# See https://breachattack.com/ and https://wikipedia.org/wiki/BREACH before deciding to enable this.
brotli_compression = false
# Vector list of IPv4 and IPv6 CIDR ranges / subnets *in quotes* that you do not want conduwuit to send outbound requests to.
# Defaults to RFC1918, unroutable, loopback, multicast, and testnet addresses for security.
#
# To disable, set this to be an empty vector (`[]`).
# Please be aware that this is *not* a guarantee. You should be using a firewall with zones as doing this on the application layer may have bypasses.
#
# Currently this does not account for proxies in use like Synapse does.
ip_range_denylist = [
"127.0.0.0/8",
"10.0.0.0/8",
"172.16.0.0/12",
"192.168.0.0/16",
"100.64.0.0/10",
"192.0.0.0/24",
"169.254.0.0/16",
"192.88.99.0/24",
"198.18.0.0/15",
"192.0.2.0/24",
"198.51.100.0/24",
"203.0.113.0/24",
"224.0.0.0/4",
"::1/128",
"fe80::/10",
"fc00::/7",
"2001:db8::/32",
"ff00::/8",
"fec0::/10",
]
### Moderation / Privacy / Security
# Set to true to allow user type "guest" registrations. Element attempts to register guest users automatically.
# Defaults to false
allow_guest_registration = false
# Set to true to log guest registrations in the admin room.
# Defaults to false as it may be noisy or unnecessary.
log_guest_registrations = false
# Set to true to allow guest registrations/users to auto join any rooms specified in `auto_join_rooms`
# Defaults to false
allow_guests_auto_join_rooms = false
# Vector list of servers that conduwuit will refuse to download remote media from.
# No default.
# prevent_media_downloads_from = ["example.com", "example.local"]
# Enables registration. If set to false, no users can register on this
# server.
# If set to true without a token configured, users can register with no form of 2nd-
# step only if you set
# `yes_i_am_very_very_sure_i_want_an_open_registration_server_prone_to_abuse` to
# true in your config. If you would like
# registration only via token reg, please configure the `registration_token` key.
allow_registration = false
# Please note that an open registration homeserver with no second-step verification
# is highly prone to abuse and potential defederation by homeservers, including
# matrix.org.
# A static registration token that new users will have to provide when creating
# an account. If unset and `allow_registration` is true, registration is open
# without any condition. YOU NEED TO EDIT THIS.
registration_token = "change this token for something specific to your server"
# controls whether federation is allowed or not
# defaults to true
# allow_federation = true
# controls whether users are allowed to create rooms.
# appservices and admins are always allowed to create rooms
# defaults to true
# allow_room_creation = true
# controls whether non-admin local users are forbidden from sending room invites (local and remote),
# and if non-admin users can receive remote room invites. admins are always allowed to send and receive all room invites.
# defaults to false
# block_non_admin_invites = false
# List of forbidden username patterns/strings. Values in this list are matched as *contains*.
# This is checked upon username availability check, registration, and startup as warnings if any local users in your database
# have a forbidden username.
# No default.
# forbidden_usernames = []
# List of forbidden room aliases and room IDs as patterns/strings. Values in this list are matched as *contains*.
# This is checked upon room alias creation, custom room ID creation if used, and startup as warnings if any room aliases
# in your database have a forbidden room alias/ID.
# No default.
# forbidden_alias_names = []
# List of forbidden server names that we will block all client room joins, incoming federated room directory requests, incoming federated invites for, and incoming federated joins. This check is applied on the room ID, room alias, sender server name, and sender user's server name.
# Basically "global" ACLs. For our user (client) checks, admin users are allowed.
# No default.
# forbidden_remote_server_names = []
# List of forbidden server names that we will block all outgoing federated room directory requests for. Useful for preventing our users from wandering into bad servers or spaces.
# No default.
# forbidden_remote_room_directory_server_names = []
# Set this to true to allow your server's public room directory to be federated.
# Set this to false to protect against /publicRooms spiders, but will forbid external users
# from viewing your server's public room directory. If federation is disabled entirely
# (`allow_federation`), this is inherently false.
allow_public_room_directory_over_federation = false
# Set this to true to allow your server's public room directory to be queried without client
# authentication (access token) through the Client APIs. Set this to false to protect against /publicRooms spiders.
allow_public_room_directory_without_auth = false
# Set this to true to lock down your server's public room directory and only allow admins to publish rooms to the room directory.
# Unpublishing is still allowed by all users with this enabled.
#
# Defaults to false
lockdown_public_room_directory = false
# Set this to true to allow federating device display names / allow external users to see your device display name.
# If federation is disabled entirely (`allow_federation`), this is inherently false. For privacy, this is best disabled.
allow_device_name_federation = false
# Vector list of domains allowed to send requests to for URL previews. Defaults to none.
# Note: this is a *contains* match, not an explicit match. Putting "google.com" will match "https://google.com" and "http://mymaliciousdomainexamplegoogle.com"
# Setting this to "*" will allow all URL previews. Please note that this opens up significant attack surface to your server, you are expected to be aware of the risks by doing so.
url_preview_domain_contains_allowlist = []
# Vector list of explicit domains allowed to send requests to for URL previews. Defaults to none.
# Note: This is an *explicit* match, not a contains match. Putting "google.com" will match "https://google.com", "http://google.com", but not "https://mymaliciousdomainexamplegoogle.com"
# Setting this to "*" will allow all URL previews. Please note that this opens up significant attack surface to your server, you are expected to be aware of the risks by doing so.
url_preview_domain_explicit_allowlist = []
# Vector list of URLs allowed to send requests to for URL previews. Defaults to none.
# Note that this is a *contains* match, not an explicit match. Putting "google.com" will match "https://google.com/", "https://google.com/url?q=https://mymaliciousdomainexample.com", and "https://mymaliciousdomainexample.com/hi/google.com"
# Setting this to "*" will allow all URL previews. Please note that this opens up significant attack surface to your server, you are expected to be aware of the risks by doing so.
url_preview_url_contains_allowlist = []
# Vector list of explicit domains not allowed to send requests to for URL previews. Defaults to none.
# Note: This is an *explicit* match, not a contains match. Putting "google.com" will match "https://google.com", "http://google.com", but not "https://mymaliciousdomainexamplegoogle.com"
# The denylist is checked first before allowlist. Setting this to "*" will not do anything.
url_preview_domain_explicit_denylist = []
# Maximum amount of bytes allowed in a URL preview body size when spidering. Defaults to 384KB (384_000 bytes)
url_preview_max_spider_size = 384_000
# Option to decide whether you would like to run the domain allowlist checks (contains and explicit) on the root domain or not. Does not apply to URL contains allowlist. Defaults to false.
# Example: If this is enabled and you have "wikipedia.org" allowed in the explicit and/or contains domain allowlist, it will allow all subdomains under "wikipedia.org" such as "en.m.wikipedia.org" as the root domain is checked and matched.
# Useful if the domain contains allowlist is still too broad for you but you still want to allow all the subdomains under a root domain.
url_preview_check_root_domain = false
# Config option to allow or disallow incoming federation requests that obtain the profiles
# of our local users from `/_matrix/federation/v1/query/profile`
#
# This is inherently false if `allow_federation` is disabled
#
# Defaults to true
allow_profile_lookup_federation_requests = true
# Config option to automatically deactivate the account of any user who attempts to join a:
# - banned room
# - forbidden room alias
# - room alias or ID with a forbidden server name
#
# This may be useful if all your banned lists consist of toxic rooms or servers that no good faith user would ever attempt to join, and
# to automatically remediate the problem without any admin user intervention.
#
# This will also make the user leave all rooms. Federation (e.g. remote room invites) are ignored here.
#
# Defaults to false as rooms can be banned for non-moderation-related reasons
#auto_deactivate_banned_room_attempts = false
### Misc
# max log level for conduwuit. allows debug, info, warn, or error
# see also: https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives
# **Caveat**:
# For release builds, the tracing crate is configured to only implement levels higher than error to avoid unnecessary overhead in the compiled binary from trace macros.
# For debug builds, this restriction is not applied.
#
# Defaults to "info"
#log = "info"
# controls whether encrypted rooms and events are allowed (default true)
#allow_encryption = false
# if enabled, conduwuit will send a simple GET request periodically to `https://pupbrain.dev/check-for-updates/stable`
# for any new announcements made. Despite the name, this is not an update check
# endpoint, it is simply an announcement check endpoint.
# Defaults to false.
#allow_check_for_updates = false
# Set to false to disable users from joining or creating room versions that aren't 100% officially supported by conduwuit.
# conduwuit officially supports room versions 6 - 10. conduwuit has experimental/unstable support for 3 - 5, and 11.
# Defaults to true.
#allow_unstable_room_versions = true
# Option to control adding arbitrary text to the end of the user's displayname upon registration with a space before the text.
# This was the lightning bolt emoji option, just replaced with support for adding your own custom text or emojis.
# To disable, set this to "" (an empty string)
# Defaults to "🏳️‍⚧️" (trans pride flag)
#new_user_displayname_suffix = "🏳️‍⚧️"
# Option to control whether conduwuit will query your list of trusted notary key servers (`trusted_servers`) for
# remote homeserver signing keys it doesn't know *first*, or query the individual servers first before falling back to the trusted
# key servers.
#
# The former/default behaviour makes federated/remote rooms joins generally faster because we're querying a single (or list of) server
# that we know works, is reasonably fast, and is reliable for just about all the homeserver signing keys in the room. Querying individual
# servers may take longer depending on the general infrastructure of everyone in there, how many dead servers there are, etc.
#
# However, this does create an increased reliance on one single or multiple large entities as `trusted_servers` should generally
# contain long-term and large servers who know a very large number of homeservers.
#
# If you don't know what any of this means, leave this and `trusted_servers` alone to their defaults.
#
# Defaults to true as this is the fastest option for federation.
#query_trusted_key_servers_first = true
# List/vector of room **IDs** that conduwuit will make newly registered users join.
# The room IDs specified must be rooms that you have joined at least once on the server, and must be public.
#
# No default.
#auto_join_rooms = []
# Retry failed and incomplete messages to remote servers immediately upon startup. This is called bursting.
# If this is disabled, said messages may not be delivered until more messages are queued for that server.
# Do not change this option unless server resources are extremely limited or the scale of the server's
# deployment is huge. Do not disable this unless you know what you are doing.
#startup_netburst = true
# Limit the startup netburst to the most recent (default: 50) messages queued for each remote server. All older
# messages are dropped and not reattempted. The `startup_netburst` option must be enabled for this value to have
# any effect. Do not change this value unless you know what you are doing. Set this value to -1 to reattempt
# every message without trimming the queues; this may consume significant disk. Set this value to 0 to drop all
# messages without any attempt at redelivery.
#startup_netburst_keep = 50
# If the 'perf_measurements' feature is enabled, enables collecting folded stack trace profile of tracing spans using
# tracing_flame. The resulting profile can be visualized with inferno[1], speedscope[2], or a number of other tools.
# [1]: https://github.com/jonhoo/inferno
# [2]: www.speedscope.app
# tracing_flame = false
# If 'tracing_flame' is enabled, sets a filter for which events will be included in the profile.
# Supported syntax is documented at https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives
# tracing_flame_filter = "trace,h2=off"
# If 'tracing_flame' is enabled, set the path to write the generated profile.
# tracing_flame_output_path = "./tracing.folded"
### Generic database options
# Set this to any float value to multiply conduwuit's in-memory LRU caches with.
# May be useful if you have significant memory to spare to increase performance.
# Defaults to 1.0.
#conduit_cache_capacity_modifier = 1.0
# Set this to any float value in megabytes for conduwuit to tell the database engine that this much memory is available for database-related caches.
# May be useful if you have significant memory to spare to increase performance.
# Defaults to 256.0
#db_cache_capacity_mb = 256.0
# Interval in seconds when conduwuit will run database cleanup operations.
#
# For SQLite: this will flush the WAL by executing `PRAGMA wal_checkpoint(RESTART)` (https://www.sqlite.org/pragma.html#pragma_wal_checkpoint)
# For RocksDB: this will run `flush_opt` to flush database memtables to SST files on disk (https://docs.rs/rocksdb/latest/rocksdb/struct.DBCommon.html#method.flush_opt)
# These operations always run on shutdown.
#
# Defaults to 30 minutes (1800 seconds) to avoid IO amplification from too frequent cleanups
#cleanup_second_interval = 1800
### RocksDB options
# Set this to true to use RocksDB config options that are tailored to HDDs (slower device storage)
#
# It is worth noting that by default, conduwuit will use RocksDB with Direct IO enabled. *Generally* speaking this improves performance as it bypasses buffered I/O (system page cache).
# However there is a potential chance that Direct IO may cause issues with database operations if your setup is uncommon. This has been observed with FUSE filesystems, and possibly ZFS filesystem.
# RocksDB generally deals/corrects these issues but it cannot account for all setups.
# If you experience any weird RocksDB issues, try enabling this option as it turns off Direct IO and feel free to report in the conduwuit Matrix room if this option fixes your DB issues.
# See https://github.com/facebook/rocksdb/wiki/Direct-IO for more information.
#
# Defaults to false
#rocksdb_optimize_for_spinning_disks = false
# Enables direct-io to increase database performance. This is enabled by default. Set this option to false if the
# database resides on a filesystem which does not support direct-io.
#rocksdb_direct_io = true
# RocksDB log level. This is not the same as conduwuit's log level. This is the log level for the RocksDB engine/library
# which show up in your database folder/path as `LOG` files. Defaults to error. conduwuit will typically log RocksDB errors as normal.
#rocksdb_log_level = "error"
# Max RocksDB `LOG` file size before rotating in bytes. Defaults to 4MB.
#rocksdb_max_log_file_size = 4194304
# Time in seconds before RocksDB will forcibly rotate logs. Defaults to 0.
#rocksdb_log_time_to_roll = 0
# Amount of threads that RocksDB will use for parallelism on database operatons such as cleanup, sync, flush, compaction, etc. Set to 0 to use all your logical threads.
#
# Defaults to your CPU logical thread count.
#rocksdb_parallelism_threads = 0
# Enables idle IO priority for compaction thread. This prevents any unexpected lag in the server's operation and
# is usually a good idea. Enabled by default.
#rocksdb_compaction_ioprio_idle = true
# Enables idle CPU priority for compaction thread. This is not enabled by default to prevent compaction from
# falling too far behind on busy systems.
#rocksdb_compaction_prio_idle = false
# Maximum number of LOG files RocksDB will keep. This must *not* be set to 0. It must be at least 1.
# Defaults to 3 as these are not very useful.
#rocksdb_max_log_files = 3
# Type of RocksDB database compression to use.
# Available options are "zstd", "zlib", "bz2", "lz4", or "none"
# It is best to use ZSTD as an overall good balance between speed/performance, storage, IO amplification, and CPU usage.
# For more performance but less compression (more storage used) and less CPU usage, use LZ4.
# See https://github.com/facebook/rocksdb/wiki/Compression for more details.
#
# "none" will disable compression.
#
# Defaults to "zstd"
#rocksdb_compression_algo = "zstd"
# Level of compression the specified compression algorithm for RocksDB to use.
# Default is 32767, which is internally read by RocksDB as the default magic number and
# translated to the library's default compression level as they all differ.
# See their `kDefaultCompressionLevel`.
#
#rocksdb_compression_level = 32767
# Level of compression the specified compression algorithm for the bottommost level/data for RocksDB to use.
# Default is 32767, which is internally read by RocksDB as the default magic number and
# translated to the library's default compression level as they all differ.
# See their `kDefaultCompressionLevel`.
#
# Since this is the bottommost level (generally old and least used data), it may be desirable to have a very
# high compression level here as it's lesss likely for this data to be used. Research your chosen compression algorithm.
#
#rocksdb_bottommost_compression_level = 32767
# Whether to enable RocksDB "bottommost_compression".
# At the expense of more CPU usage, this will further compress the database to reduce more storage.
# It is recommended to use ZSTD compression with this for best compression results.
# See https://github.com/facebook/rocksdb/wiki/Compression for more details.
#
# Defaults to false as this uses more CPU when compressing.
#rocksdb_bottommost_compression = false
# Database recovery mode (for RocksDB WAL corruption)
#
# Use this option when the server reports corruption and refuses to start. Set mode 2 (PointInTime)
# to cleanly recover from this corruption. The server will continue from the last good state,
# several seconds or minutes prior to the crash. Clients may have to run "clear-cache & reload" to
# account for the rollback. Upon success, you may reset the mode back to default and restart again.
# Please note in some cases the corruption error may not be cleared for at least 30 minutes of
# operation in PointInTime mode.
#
# As a very last ditch effort, if PointInTime does not fix or resolve anything, you can try mode
# 3 (SkipAnyCorruptedRecord) but this will leave the server in a potentially inconsistent state.
#
# The default mode 1 (TolerateCorruptedTailRecords) will automatically drop the last entry in the
# database if corrupted during shutdown, but nothing more. It is extraordinarily unlikely this will
# desynchronize clients. To disable any form of silent rollback set mode 0 (AbsoluteConsistency).
#
# The options are:
# 0 = AbsoluteConsistency
# 1 = TolerateCorruptedTailRecords (default)
# 2 = PointInTime (use me if trying to recover)
# 3 = SkipAnyCorruptedRecord (you now voided your Conduwuit warranty)
#
# See https://github.com/facebook/rocksdb/wiki/WAL-Recovery-Modes for more information
#
# Defaults to 1 (TolerateCorruptedTailRecords)
#rocksdb_recovery_mode = 1
# Controls whether memory buffers are written to storage at the fixed interval set by `cleanup_period_interval`
# even when they are not full. Setting this will increase load on the storage backplane and is never advised
# under normal circumstances.
#rocksdb_periodic_cleanup = false
### Domain Name Resolution and Caching
# Maximum entries stored in DNS memory-cache. The size of an entry may vary so please take care if
# raising this value excessively. Only decrease this when using an external DNS cache. Please note
# that systemd does *not* count as an external cache, even when configured to do so.
#dns_cache_entries = 32768
# Minimum time-to-live in seconds for entries in the DNS cache. The default may appear high to most
# administrators; this is by design. Only decrease this if you are using an external DNS cache.
#dns_min_ttl = 10800
# Minimum time-to-live in seconds for NXDOMAIN entries in the DNS cache. This value is critical for
# the server to federate efficiently. NXDOMAIN's are assumed to not be returning to the federation
# and aggressively cached rather than constantly rechecked.
#
# Defaults to 3 days as these are *very rarely* false negatives.
#dns_min_ttl_nxdomain = 259200
# The number of seconds to wait for a reply to a DNS query. Please note that recursive queries can
# take up to several seconds for some domains, so this value should not be too low.
#dns_timeout = 10
# Number of retries after a timeout.
#dns_attempts = 10
# Fallback to TCP on DNS errors. Set this to false if unsupported by nameserver.
#dns_tcp_fallback = true
# Enable to query all nameservers until the domain is found. Referred to as "trust_negative_responses" in hickory_resolver.
# This can avoid useless DNS queries if the first nameserver responds with NXDOMAIN or an empty NOERROR response.
#
# The default is to query one nameserver and stop (false).
#query_all_nameservers = true
# Enables using *only* TCP for querying your specified nameservers instead of UDP.
#
# You very likely do *not* want this. hickory-resolver already falls back to TCP on UDP errors.
# Defaults to false
#query_over_tcp_only = false
# DNS A/AAAA record lookup strategy
#
# Takes a number of one of the following options:
# 1 - Ipv4Only (Only query for A records, no AAAA/IPv6)
# 2 - Ipv6Only (Only query for AAAA records, no A/IPv4)
# 3 - Ipv4AndIpv6 (Query for A and AAAA records in parallel, uses whatever returns a successful response first)
# 4 - Ipv6thenIpv4 (Query for AAAA record, if that fails then query the A record)
# 5 - Ipv4thenIpv6 (Query for A record, if that fails then query the AAAA record)
#
# If you don't have IPv6 networking, then for better performance it may be suitable to set this to Ipv4Only (1) as
# you will never ever use the AAAA record contents even if the AAAA record is successful instead of the A record.
#
# Defaults to 5 - Ipv4ThenIpv6 as this is the most compatible and IPv4 networking is currently the most prevalent.
#ip_lookup_strategy = 5
### Request Timeouts, Connection Timeouts, and Connection Pooling
## Request Timeouts are HTTP response timeouts
## Connection Timeouts are TCP connection timeouts
##
## Connection Pooling Timeouts are timeouts for keeping an open idle connection alive.
## Connection pooling and keepalive is very useful for federation or other places where for performance reasons,
## we want to keep connections open that we will re-use frequently due to TCP and TLS 1.3 overhead/expensiveness.
##
## Generally these defaults are the best, but if you find a reason to need to change these they are here.
# Default/base connection timeout.
# This is used only by URL previews and update/news endpoint checks
#
# Defaults to 10 seconds
#request_conn_timeout = 10
# Default/base request timeout. The time waiting to receive more data from another server.
# This is used only by URL previews, update/news, and misc endpoint checks
#
# Defaults to 35 seconds
#request_timeout = 35
# Default/base request total timeout. The time limit for a whole request. This is set very high to not
# cancel healthy requests while serving as a backstop.
# This is used only by URL previews and update/news endpoint checks
#
# Defaults to 320 seconds
#request_total_timeout = 320
# Default/base idle connection pool timeout
# This is used only by URL previews and update/news endpoint checks
#
# Defaults to 5 seconds
#request_idle_timeout = 5
# Default/base max idle connections per host
# This is used only by URL previews and update/news endpoint checks
#
# Defaults to 1 as generally the same open connection can be re-used
#request_idle_per_host = 1
# Federation well-known resolution connection timeout
#
# Defaults to 6 seconds
#well_known_conn_timeout = 6
# Federation HTTP well-known resolution request timeout
#
# Defaults to 10 seconds
#well_known_timeout = 10
# Federation client request timeout
# You most definitely want this to be high to account for extremely large room joins, slow homeservers, your own resources etc.
#
# Defaults to 300 seconds
#federation_timeout = 300
# Federation client idle connection pool timeout
#
# Defaults to 25 seconds
#federation_idle_timeout = 25
# Federation client max idle connections per host
#
# Defaults to 1 as generally the same open connection can be re-used
#federation_idle_per_host = 1
# Federation sender request timeout
# The time it takes for the remote server to process sent transactions can take a while.
#
# Defaults to 180 seconds
#sender_timeout = 180
# Federation sender idle connection pool timeout
#
# Defaults to 180 seconds
#sender_idle_timeout = 180
# Federation sender transaction retry backoff limit
#
# Defaults to 86400 seconds
#sender_retry_backoff_limit = 86400
# Appservice URL request connection timeout
#
# Defaults to 35 seconds as generally appservices are hosted within the same network
#appservice_timeout = 35
# Appservice URL idle connection pool timeout
#
# Defaults to 300 seconds
#appservice_idle_timeout = 300
# Notification gateway pusher idle connection pool timeout
#
# Defaults to 15 seconds
#pusher_idle_timeout = 15
### Presence / Typing Indicators / Read Receipts
# Config option to control local (your server only) presence updates/requests. Defaults to true.
# Note that presence on conduwuit is very fast unlike Synapse's.
# If using outgoing presence, this MUST be enabled.
#
#allow_local_presence = true
# Config option to control incoming federated presence updates/requests. Defaults to true.
# This option receives presence updates from other servers, but does not send any unless `allow_outgoing_presence` is true.
# Note that presence on conduwuit is very fast unlike Synapse's.
#
#allow_incoming_presence = true
# Config option to control outgoing presence updates/requests. Defaults to true.
# This option sends presence updates to other servers, but does not receive any unless `allow_incoming_presence` is true.
# Note that presence on conduwuit is very fast unlike Synapse's.
# If using outgoing presence, you MUST enable `allow_local_presence` as well.
#
#allow_outgoing_presence = true
# Config option to enable the presence idle timer for remote users. Disabling is offered as an optimization for
# servers participating in many large rooms or when resources are limited. Disabling it may cause incorrect
# presence states (i.e. stuck online) to be seen for some remote users. Defaults to true.
#presence_timeout_remote_users = true
# Config option to control how many seconds before presence updates that you are idle. Defaults to 5 minutes.
#presence_idle_timeout_s = 300
# Config option to control how many seconds before presence updates that you are offline. Defaults to 30 minutes.
#presence_offline_timeout_s = 1800
# Config option to control whether we should receive remote incoming read receipts.
# Defaults to true.
#allow_incoming_read_receipts = true
# Config option to control whether we should send read receipts to remote servers.
# Defaults to true.
#allow_outgoing_read_receipts = true
# Config option to control outgoing typing updates to federation. Defaults to true.
#allow_outgoing_typing = true
# Config option to control incoming typing updates from federation. Defaults to true.
#allow_incoming_typing = true
# Config option to control maximum time federation user can indicate typing.
#typing_federation_timeout_s = 30
# Config option to control minimum time local client can indicate typing. This does not override
# a client's request to stop typing. It only enforces a minimum value in case of no stop request.
#typing_client_timeout_min_s = 15
# Config option to control maximum time local client can indicate typing.
#typing_client_timeout_max_s = 45
# Other options not in [global]:
#
#
# Enables running conduwuit with direct TLS support
# It is strongly recommended you use a reverse proxy instead. This is primarily relevant for test suites like complement that require a private CA setup.
# [global.tls]
# certs = "/path/to/my/certificate.crt"
# key = "/path/to/my/private_key.key"
#
# Whether to listen and allow for HTTP and HTTPS connections (insecure!)
# This config option is only available if conduwuit was built with `axum_dual_protocol` feature (not default feature)
# Defaults to false
#dual_protocol = false
# If you are using delegation via well-known files and you cannot serve them from your reverse proxy, you can
# uncomment these to serve them directly from conduwuit. This requires proxying all requests to conduwuit, not just `/_matrix` to work.
#
#[global.well_known]
#server = "matrix.example.com:443"
#client = "https://matrix.example.com"
#
# A single contact and/or support page for /.well-known/matrix/support
# All options here are strings. Currently only supports 1 single contact.
# No default.
#
#support_page = ""
#support_role = ""
#support_email = ""
#support_mxid = ""
+22
View File
@@ -0,0 +1,22 @@
# conduwuit for Debian
Information about downloading and deploying the Debian package. This may also be referenced for other `apt`-based distros such as Ubuntu.
### Installation
It is recommended to see the [generic deployment guide](../deploying/generic.md) for further information if needed as usage of the Debian package is generally related.
### Configuration
When installed, the example config is placed at `/etc/conduwuit/conduwuit.toml` as the default config. At the minimum, you will need to change your `server_name` here.
You can tweak more detailed settings by uncommenting and setting the config options
in `/etc/conduwuit/conduwuit.toml`.
### Running
The package uses the [`conduwuit.service`](../configuration.md#example-systemd-unit-file) systemd unit file to start and stop conduwuit. The binary is installed at `/usr/sbin/conduwuit`.
This package assumes by default that conduwuit will be placed behind a reverse proxy. The default config options apply (listening on `localhost` and TCP port `6167`). Matrix federation requires a valid domain name and TLS, so you will need to set up TLS certificates and renewal for it to work properly if you intend to federate.
Consult various online documentation and guides on setting up a reverse proxy and TLS. Caddy is documented at the [generic deployment guide](../deploying/generic.md#setting-up-the-reverse-proxy) as it's the easiest and most user friendly.
+64
View File
@@ -0,0 +1,64 @@
[Unit]
Description=conduwuit Matrix homeserver
Documentation=https://conduwuit.puppyirl.gay/
After=network-online.target
[Service]
DynamicUser=yes
User=conduwuit
Group=conduwuit
Type=notify
Environment="CONDUWUIT_CONFIG=/etc/conduwuit/conduwuit.toml"
ExecStart=/usr/sbin/conduwuit
ReadWritePaths=/var/lib/conduwuit /etc/conduwuit
AmbientCapabilities=
CapabilityBoundingSet=
DevicePolicy=closed
LockPersonality=yes
MemoryDenyWriteExecute=yes
NoNewPrivileges=yes
ProcSubset=pid
ProtectClock=yes
ProtectControlGroups=yes
ProtectHome=yes
ProtectHostname=yes
ProtectKernelLogs=yes
ProtectKernelModules=yes
ProtectKernelTunables=yes
ProtectProc=invisible
ProtectSystem=strict
PrivateDevices=yes
PrivateMounts=yes
PrivateTmp=yes
PrivateUsers=yes
PrivateIPC=yes
RemoveIPC=yes
RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX
RestrictNamespaces=yes
RestrictRealtime=yes
RestrictSUIDSGID=yes
SystemCallArchitectures=native
SystemCallFilter=@system-service @resources
SystemCallFilter=~@clock @debug @module @mount @reboot @swap @cpu-emulation @obsolete @timer @chown @setuid @privileged @keyring @ipc
SystemCallErrorNumber=EPERM
#StateDirectory=conduwuit
RuntimeDirectory=conduwuit
RuntimeDirectoryMode=0750
Restart=on-failure
RestartSec=5
TimeoutStopSec=2m
TimeoutStartSec=2m
StartLimitInterval=1m
StartLimitBurst=5
[Install]
WantedBy=multi-user.target
+18
View File
@@ -0,0 +1,18 @@
#!/bin/sh
set -e
# TODO: implement debconf support that is maintainable without duplicating the config
# Source debconf library.
#. /usr/share/debconf/confmodule
#
## Ask for the Matrix homeserver name, address and port.
#db_input high conduwuit/hostname || true
#db_go
#
#db_input low conduwuit/address || true
#db_go
#
#db_input medium conduwuit/port || true
#db_go
exit 0
+44
View File
@@ -0,0 +1,44 @@
#!/bin/sh
set -e
# TODO: implement debconf support that is maintainable without duplicating the config
#. /usr/share/debconf/confmodule
CONDUWUIT_DATABASE_PATH=/var/lib/conduwuit
CONDUWUIT_CONFIG_PATH=/etc/conduwuit
CONDUWUIT_CONFIG_FILE="${CONDUWUIT_CONFIG_PATH}/conduwuit.toml"
case "$1" in
configure)
# Create the `conduwuit` user if it does not exist yet.
if ! getent passwd conduwuit > /dev/null ; then
echo 'Adding system user for the conduwuit Matrix homeserver' 1>&2
adduser --system --group --quiet \
--home "$CONDUWUIT_DATABASE_PATH" \
--disabled-login \
--shell "/usr/sbin/nologin" \
--verbose \
conduwuit
fi
# Create the database path if it does not exist yet and fix up ownership
# and permissions for the config.
mkdir -v -p "$CONDUWUIT_DATABASE_PATH"
# symlink the previous location for compatibility
ln -s -v "$CONDUWUIT_DATABASE_PATH" "/var/lib/matrix-conduit"
chown -v conduwuit:conduwuit -R "$CONDUWUIT_DATABASE_PATH"
chown -v conduwuit:conduwuit -R "$CONDUWUIT_CONFIG_PATH"
chmod -v 740 "$CONDUWUIT_DATABASE_PATH"
echo ''
echo 'Make sure you edit the example config at /etc/conduwuit/conduwuit.toml before starting!'
echo 'To start the server, run: systemctl start conduwuit.service'
echo ''
;;
esac
#DEBHELPER#
+27
View File
@@ -0,0 +1,27 @@
#!/bin/sh
set -e
#. /usr/share/debconf/confmodule
CONDUWUIT_CONFIG_PATH=/etc/conduwuit
CONDUWUIT_DATABASE_PATH=/var/lib/conduwuit
case $1 in
purge)
# Remove debconf changes from the db
db_purge
# Per https://www.debian.org/doc/debian-policy/ch-files.html#behavior
# "configuration files must be preserved when the package is removed, and
# only deleted when the package is purged."
if [ -d "$CONDUWUIT_CONFIG_PATH" ]; then
rm -v -r "$CONDUWUIT_CONFIG_PATH"
fi
if [ -d "$CONDUWUIT_DATABASE_PATH" ]; then
rm -v -r "$CONDUWUIT_DATABASE_PATH"
fi
;;
esac
#DEBHELPER#
+10
View File
@@ -0,0 +1,10 @@
(import
(
let lock = builtins.fromJSON (builtins.readFile ./flake.lock); in
fetchTarball {
url = lock.nodes.flake-compat.locked.url or "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
sha256 = lock.nodes.flake-compat.locked.narHash;
}
)
{ src = ./.; }
).defaultNix
-2
View File
@@ -1,2 +0,0 @@
podman build . -f packages/website/Dockerfile -t jade-website-frontend:latest;
podman save --format oci-archive jade-website-frontend:latest | gzip | ssh fedora@213.32.25.24 -T "sudo sh -c ' zcat > /opt/images/jade-website-frontend'"
+18
View File
@@ -0,0 +1,18 @@
# Summary
- [Introduction](introduction.md)
- [Differences from upstream Conduit](differences.md)
- [Example configuration](configuration.md)
- [Deploying](deploying.md)
- [Generic](deploying/generic.md)
- [NixOS](deploying/nixos.md)
- [Docker](deploying/docker.md)
- [Arch Linux](deploying/arch-linux.md)
- [Debian](deploying/debian.md)
- [TURN](turn.md)
- [Appservices](appservices.md)
- [Maintenance](maintenance.md)
- [Troubleshooting](troubleshooting.md)
- [Development](development.md)
- [Contributing](contributing.md)
- [Testing](development/testing.md)
+61
View File
@@ -0,0 +1,61 @@
# Setting up Appservices
## Getting help
If you run into any problems while setting up an Appservice: ask us in [#conduwuit:puppygock.gay](https://matrix.to/#/#conduwuit:puppygock.gay) or [open an issue on GitHub](https://github.com/girlbossceo/conduwuit/issues/new).
## Set up the appservice - general instructions
Follow whatever instructions are given by the appservice. This usually includes
downloading, changing its config (setting domain, homeserver url, port etc.)
and later starting it.
At some point the appservice guide should ask you to add a registration yaml
file to the homeserver. In Synapse you would do this by adding the path to the
homeserver.yaml, but in Conduit you can do this from within Matrix:
First, go into the #admins room of your homeserver. The first person that
registered on the homeserver automatically joins it. Then send a message into
the room like this:
@conduit:your.server.name: register-appservice
```
paste
the
contents
of
the
yaml
registration
here
```
You can confirm it worked by sending a message like this:
`@conduit:your.server.name: appservices list`
The `@conduit` bot should answer with `Appservices (1): your-bridge`
Then you are done. Conduit will send messages to the appservices and the
appservice can send requests to the homeserver. You don't need to restart
Conduit, but if it doesn't work, restarting while the appservice is running
could help.
## Appservice-specific instructions
### Remove an appservice
To remove an appservice go to your admin room and execute
`@conduit:your.server.name: appservices unregister <name>`
where `<name>` one of the output of `appservices list`.
### Tested appservices
These appservices have been tested and work with Conduit without any extra steps:
- [matrix-appservice-discord](https://github.com/Half-Shot/matrix-appservice-discord)
- [mautrix-hangouts](https://github.com/mautrix/hangouts/)
- [mautrix-telegram](https://github.com/mautrix/telegram/)
- [mautrix-signal](https://github.com/mautrix/signal/) from version `0.2.2` forward.
- [heisenbridge](https://github.com/hifi/heisenbridge/)
+11
View File
@@ -0,0 +1,11 @@
# Example configuration
``` toml
{{#include ../conduwuit-example.toml}}
```
# Example systemd unit file
```
{{#include ../debian/conduwuit.service}}
```
+1
View File
@@ -0,0 +1 @@
{{#include ../CONTRIBUTING.md}}
+3
View File
@@ -0,0 +1,3 @@
# Deploying
This chapter describes various ways to deploy Conduwuit.
+8
View File
@@ -0,0 +1,8 @@
# conduwuit for Arch Linux
Currently conduwuit is only on the Arch User Repository (AUR).
The conduwuit AUR packages are community maintained and are not maintained by conduwuit development team, but the AUR package maintainers are in the Matrix room. Please attempt to verify your AUR package's PKGBUILD file looks fine before asking for support.
- [conduwuit](https://aur.archlinux.org/packages/conduwuit) - latest tagged conduwuit
- [conduwuit-git](https://aur.archlinux.org/packages/conduwuit-git) - latest git conduwuit from `main` branch
+1
View File
@@ -0,0 +1 @@
{{#include ../../debian/README.md}}
@@ -0,0 +1,60 @@
# conduwuit - Behind Traefik Reverse Proxy
version: '2.4' # uses '2.4' for cpuset
services:
homeserver:
### If you already built the conduduwit image with 'docker build' or want to use the Docker Hub image,
### then you are ready to go.
image: girlbossceo/conduwuit:latest
restart: unless-stopped
volumes:
- db:/var/lib/conduwuit
#- ./conduwuit.toml:/etc/conduwuit.toml
networks:
- proxy
environment:
CONDUWUIT_SERVER_NAME: your.server.name # EDIT THIS
CONDUWUIT_DATABASE_PATH: /var/lib/conduwuit
CONDUWUIT_DATABASE_BACKEND: rocksdb
CONDUWUIT_PORT: 6167
CONDUWUIT_MAX_REQUEST_SIZE: 20_000_000 # in bytes, ~20 MB
CONDUWUIT_ALLOW_REGISTRATION: 'true'
CONDUWUIT_ALLOW_FEDERATION: 'true'
CONDUWUIT_ALLOW_CHECK_FOR_UPDATES: 'true'
CONDUWUIT_TRUSTED_SERVERS: '["matrix.org"]'
#CONDUWUIT_LOG: warn,state_res=warn
CONDUWUIT_ADDRESS: 0.0.0.0
#CONDUWUIT_CONFIG: './conduwuit.toml' # Uncomment if you mapped config toml above
#cpuset: "0-4" # Uncomment to limit to specific CPU cores
# We need some way to server the client and server .well-known json. The simplest way is to use a nginx container
# to serve those two as static files. If you want to use a different way, delete or comment the below service, here
# and in the docker compose override file.
well-known:
image: nginx:latest
restart: unless-stopped
volumes:
- ./nginx/matrix.conf:/etc/nginx/conf.d/matrix.conf # the config to serve the .well-known/matrix files
- ./nginx/www:/var/www/ # location of the client and server .well-known-files
### Uncomment if you want to use your own Element-Web App.
### Note: You need to provide a config.json for Element and you also need a second
### Domain or Subdomain for the communication between Element and conduwuit
### Config-Docs: https://github.com/vector-im/element-web/blob/develop/docs/config.md
# element-web:
# image: vectorim/element-web:latest
# restart: unless-stopped
# volumes:
# - ./element_config.json:/app/config.json
# networks:
# - proxy
# depends_on:
# - homeserver
volumes:
db:
networks:
# This is the network Traefik listens to, if your network has a different
# name, don't forget to change it here and in the docker-compose.override.yml
proxy:
external: true
@@ -0,0 +1,45 @@
# conduwuit - Traefik Reverse Proxy Labels
version: '2.4' # uses '2.4' for cpuset
services:
homeserver:
labels:
- "traefik.enable=true"
- "traefik.docker.network=proxy" # Change this to the name of your Traefik docker proxy network
- "traefik.http.routers.to-conduwuit.rule=Host(`<SUBDOMAIN>.<DOMAIN>`)" # Change to the address on which conduwuit is hosted
- "traefik.http.routers.to-conduwuit.tls=true"
- "traefik.http.routers.to-conduwuit.tls.certresolver=letsencrypt"
- "traefik.http.routers.to-conduwuit.middlewares=cors-headers@docker"
- "traefik.http.middlewares.cors-headers.headers.accessControlAllowOriginList=*"
- "traefik.http.middlewares.cors-headers.headers.accessControlAllowHeaders=Origin, X-Requested-With, Content-Type, Accept, Authorization"
- "traefik.http.middlewares.cors-headers.headers.accessControlAllowMethods=GET, POST, PUT, DELETE, OPTIONS"
# We need some way to server the client and server .well-known json. The simplest way is to use a nginx container
# to serve those two as static files. If you want to use a different way, delete or comment the below service, here
# and in the docker compose file.
well-known:
labels:
- "traefik.enable=true"
- "traefik.docker.network=proxy"
- "traefik.http.routers.to-matrix-wellknown.rule=Host(`<SUBDOMAIN>.<DOMAIN>`) && PathPrefix(`/.well-known/matrix`)"
- "traefik.http.routers.to-matrix-wellknown.tls=true"
- "traefik.http.routers.to-matrix-wellknown.tls.certresolver=letsencrypt"
- "traefik.http.routers.to-matrix-wellknown.middlewares=cors-headers@docker"
- "traefik.http.middlewares.cors-headers.headers.accessControlAllowOriginList=*"
- "traefik.http.middlewares.cors-headers.headers.accessControlAllowHeaders=Origin, X-Requested-With, Content-Type, Accept, Authorization"
- "traefik.http.middlewares.cors-headers.headers.accessControlAllowMethods=GET, POST, PUT, DELETE, OPTIONS"
### Uncomment this if you uncommented Element-Web App in the docker-compose.yml
# element-web:
# labels:
# - "traefik.enable=true"
# - "traefik.docker.network=proxy" # Change this to the name of your Traefik docker proxy network
# - "traefik.http.routers.to-element-web.rule=Host(`<SUBDOMAIN>.<DOMAIN>`)" # Change to the address on which Element-Web is hosted
# - "traefik.http.routers.to-element-web.tls=true"
# - "traefik.http.routers.to-element-web.tls.certresolver=letsencrypt"
@@ -0,0 +1,86 @@
# conduwuit - Behind Traefik Reverse Proxy
version: '2.4' # uses '2.4' for cpuset
services:
homeserver:
### If you already built the conduwuit image with 'docker build' or want to use the Docker Hub image,
### then you are ready to go.
image: girlbossceo/conduwuit:latest
restart: unless-stopped
volumes:
- db:/srv/conduwuit/.local/share/conduwuit
#- ./conduwuit.toml:/etc/conduwuit.toml
networks:
- proxy
environment:
CONDUWUIT_SERVER_NAME: your.server.name # EDIT THIS
CONDUWUIT_TRUSTED_SERVERS: '["matrix.org"]'
CONDUWUIT_ALLOW_REGISTRATION : 'true'
#CONDUWUIT_CONFIG: './conduwuit.toml' # Uncomment if you mapped config toml above
### Uncomment and change values as desired
# CONDUWUIT_ADDRESS: 0.0.0.0
# CONDUWUIT_PORT: 6167
# CONDUWUIT_LOG: info # default is: "warn,state_res=warn"
# CONDUWUIT_ALLOW_JAEGER: 'false'
# CONDUWUIT_ALLOW_ENCRYPTION: 'true'
# CONDUWUIT_ALLOW_FEDERATION: 'true'
# CONDUWUIT_ALLOW_CHECK_FOR_UPDATES: 'true'
# CONDUWUIT_DATABASE_PATH: /srv/conduwuit/.local/share/conduwuit
# CONDUWUIT_WORKERS: 10
# CONDUWUIT_MAX_REQUEST_SIZE: 20000000 # in bytes, ~20 MB
#cpuset: "0-4" # Uncomment to limit to specific CPU cores
# We need some way to server the client and server .well-known json. The simplest way is to use a nginx container
# to serve those two as static files. If you want to use a different way, delete or comment the below service, here
# and in the docker compose override file.
well-known:
image: nginx:latest
restart: unless-stopped
volumes:
- ./nginx/matrix.conf:/etc/nginx/conf.d/matrix.conf # the config to serve the .well-known/matrix files
- ./nginx/www:/var/www/ # location of the client and server .well-known-files
### Uncomment if you want to use your own Element-Web App.
### Note: You need to provide a config.json for Element and you also need a second
### Domain or Subdomain for the communication between Element and conduwuit
### Config-Docs: https://github.com/vector-im/element-web/blob/develop/docs/config.md
# element-web:
# image: vectorim/element-web:latest
# restart: unless-stopped
# volumes:
# - ./element_config.json:/app/config.json
# networks:
# - proxy
# depends_on:
# - homeserver
traefik:
image: "traefik:latest"
container_name: "traefik"
restart: "unless-stopped"
ports:
- "80:80"
- "443:443"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
# - "./traefik_config:/etc/traefik"
- "acme:/etc/traefik/acme"
labels:
- "traefik.enable=true"
# middleware redirect
- "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
# global redirect to https
- "traefik.http.routers.redirs.rule=hostregexp(`{host:.+}`)"
- "traefik.http.routers.redirs.entrypoints=http"
- "traefik.http.routers.redirs.middlewares=redirect-to-https"
networks:
- proxy
volumes:
db:
acme:
networks:
proxy:
+45
View File
@@ -0,0 +1,45 @@
# conduwuit
version: '2.4' # uses '2.4' for cpuset
services:
homeserver:
### If you already built the conduwuit image with 'docker build' or want to use a registry image,
### then you are ready to go.
image: girlbossceo/conduwuit:latest
restart: unless-stopped
ports:
- 8448:6167
volumes:
- db:/var/lib/conduwuit
#- ./conduwuit.toml:/etc/conduwuit.toml
environment:
CONDUWUIT_SERVER_NAME: your.server.name # EDIT THIS
CONDUWUIT_DATABASE_PATH: /var/lib/conduwuit
CONDUWUIT_DATABASE_BACKEND: rocksdb
CONDUWUIT_PORT: 6167
CONDUWUIT_MAX_REQUEST_SIZE: 20_000_000 # in bytes, ~20 MB
CONDUWUIT_ALLOW_REGISTRATION: 'true'
CONDUWUIT_ALLOW_FEDERATION: 'true'
CONDUWUIT_ALLOW_CHECK_FOR_UPDATES: 'true'
CONDUWUIT_TRUSTED_SERVERS: '["matrix.org"]'
#CONDUWUIT_LOG: warn,state_res=warn
CONDUWUIT_ADDRESS: 0.0.0.0
#CONDUWUIT_CONFIG: './conduwuit.toml' # Uncomment if you mapped config toml above
#cpuset: "0-4" # Uncomment to limit to specific CPU cores
#
### Uncomment if you want to use your own Element-Web App.
### Note: You need to provide a config.json for Element and you also need a second
### Domain or Subdomain for the communication between Element and conduwuit
### Config-Docs: https://github.com/vector-im/element-web/blob/develop/docs/config.md
# element-web:
# image: vectorim/element-web:latest
# restart: unless-stopped
# ports:
# - 8009:80
# volumes:
# - ./element_config.json:/app/config.json
# depends_on:
# - homeserver
volumes:
db:
+113
View File
@@ -0,0 +1,113 @@
# conduwuit for Docker
## Docker
To run conduwuit with Docker you can either build the image yourself or pull it from a registry.
### Use a registry
OCI images for conduwuit are available in the registries listed below.
| Registry | Image | Size | Notes |
| --------------- | --------------------------------------------------------------- | ----------------------------- | ---------------------- |
| GitHub Registry | [ghcr.io/girlbossceo/conduwuit:latest][gh] | ![Image Size][shield-latest] | Stable tagged image. |
| GitLab Registry | [registry.gitlab.com/conduwuit/conduwuit:latest][gl] | ![Image Size][shield-latest] | Stable tagged image. |
| Docker Hub | [docker.io/girlbossceo/conduwuit:latest][dh] | ![Image Size][shield-latest] | Stable tagged image. |
| GitHub Registry | [ghcr.io/girlbossceo/conduwuit:main][gh] | ![Image Size][shield-main] | Stable main branch. |
| GitLab Registry | [registry.gitlab.com/conduwuit/conduwuit:main][gl] | ![Image Size][shield-main] | Stable main branch. |
| Docker Hub | [docker.io/girlbossceo/conduwuit:main][dh] | ![Image Size][shield-main] | Stable main branch. |
[dh]: https://hub.docker.com/repository/docker/girlbossceo/conduwuit
[gh]: https://github.com/girlbossceo/conduwuit/pkgs/container/conduwuit
[gl]: https://gitlab.com/conduwuit/conduwuit/container_registry/6351657
[shield-latest]: https://img.shields.io/docker/image-size/girlbossceo/conduwuit/latest
[shield-main]: https://img.shields.io/docker/image-size/girlbossceo/conduwuit/main
Use
```bash
docker image pull <link>
```
to pull it to your machine.
### Run
When you have the image you can simply run it with
```bash
docker run -d -p 8448:6167 \
-v db:/var/lib/conduwuit/ \
-e CONDUIT_SERVER_NAME="your.server.name" \
-e CONDUIT_DATABASE_BACKEND="rocksdb" \
-e CONDUIT_ALLOW_REGISTRATION=false \
-e CONDUIT_ALLOW_FEDERATION=true \
-e CONDUIT_MAX_REQUEST_SIZE="40000000" \
-e CONDUIT_TRUSTED_SERVERS="[\"matrix.org\"]" \
-e CONDUIT_LOG="warn,ruma_state_res=warn" \
--name conduit <link>
```
or you can use [docker compose](#docker-compose).
The `-d` flag lets the container run in detached mode. You may supply an optional `conduwuit.toml` config file, the example config can be found [here](../configuration.md).
You can pass in different env vars to change config values on the fly. You can even configure conduwuit completely by using env vars. For an overview of possible
values, please take a look at the [`docker-compose.yml`](docker-compose.yml) file.
If you just want to test conduwuit for a short time, you can use the `--rm` flag, which will clean up everything related to your container after you stop it.
### Docker-compose
If the `docker run` command is not for you or your setup, you can also use one of the provided `docker-compose` files.
Depending on your proxy setup, you can use one of the following files;
- If you already have a `traefik` instance set up, use [`docker-compose.for-traefik.yml`](docker-compose.for-traefik.yml)
- If you don't have a `traefik` instance set up (or any other reverse proxy), use [`docker-compose.with-traefik.yml`](docker-compose.with-traefik.yml)
- For any other reverse proxy, use [`docker-compose.yml`](docker-compose.yml)
When picking the traefik-related compose file, rename it so it matches `docker-compose.yml`, and
rename the override file to `docker-compose.override.yml`. Edit the latter with the values you want
for your server.
Additional info about deploying conduwuit can be found [here](generic.md).
### Build
To build the conduwuit image with docker-compose, you first need to open and modify the `docker-compose.yml` file. There you need to comment the `image:` option and uncomment the `build:` option. Then call docker compose with:
```bash
docker compose up
```
This will also start the container right afterwards, so if want it to run in detached mode, you also should use the `-d` flag.
### Run
If you already have built the image or want to use one from the registries, you can just start the container and everything else in the compose file in detached mode with:
```bash
docker compose up -d
```
> **Note:** Don't forget to modify and adjust the compose file to your needs.
### Use Traefik as Proxy
As a container user, you probably know about Traefik. It is a easy to use reverse proxy for making
containerized app and services available through the web. With the two provided files,
[`docker-compose.for-traefik.yml`](docker-compose.for-traefik.yml) (or
[`docker-compose.with-traefik.yml`](docker-compose.with-traefik.yml)) and
[`docker-compose.override.yml`](docker-compose.override.yml), it is equally easy to deploy
and use conduwuit, with a little caveat. If you already took a look at the files, then you should have
seen the `well-known` service, and that is the little caveat. Traefik is simply a proxy and
loadbalancer and is not able to serve any kind of content, but for conduwuit to federate, we need to
either expose ports `443` and `8448` or serve two endpoints `.well-known/matrix/client` and
`.well-known/matrix/server`.
With the service `well-known` we use a single `nginx` container that will serve those two files.
## Voice communication
See the [TURN](../turn.md) page.
+135
View File
@@ -0,0 +1,135 @@
# Generic deployment documentation
> ## Getting help
>
> If you run into any problems while setting up conduwuit, ask us
> in `#conduwuit:puppygock.gay` or [open an issue on GitHub](https://github.com/girlbossceo/conduwuit/issues/new).
## Installing conduwuit
You may simply download the binary that fits your machine. Run `uname -m` to see what you need.
Prebuilt binaries can be downloaded from the latest tagged release [here](https://github.com/girlbossceo/conduwuit/releases/latest).
The latest tagged release also includes the Debian packages.
Alternatively, you may compile the binary yourself. We recommend using [Lix](https://lix.systems) to build conduwuit as this has the most guaranteed
reproducibiltiy and easiest to get a build environment and output going.
Otherwise, follow standard Rust project build guides (installing git and cloning the repo, getting the Rust toolchain via rustup, installing LLVM toolchain + libclang, installing liburing for io_uring and RocksDB, etc).
## Adding a conduwuit user
While conduwuit can run as any user it is better to use dedicated users for different services. This also allows
you to make sure that the file permissions are correctly set up.
In Debian or RHEL, you can use this command to create a conduwuit user:
```bash
sudo adduser --system conduwuit --group --disabled-login --no-create-home
```
For distros without `adduser`:
```bash
sudo useradd -r --shell /usr/bin/nologin --no-create-home conduwuit
```
## Forwarding ports in the firewall or the router
conduwuit uses the ports 443 and 8448 both of which need to be open in the firewall.
If conduwuit runs behind a router or in a container and has a different public IP address than the host system these public ports need to be forwarded directly or indirectly to the port mentioned in the config.
## Setting up a systemd service
The systemd unit for conduwuit can be found [here](../configuration.md#example-systemd-unit-file). You may need to change the `ExecStart=` path to where you placed the conduwuit binary.
## Creating the conduwuit configuration file
Now we need to create the conduwuit's config file in `/etc/conduwuit/conduwuit.toml`. The example config can be found at [conduwuit-example.toml](../configuration.md).**Please take a moment to read it. You need to change at least the server name.**
RocksDB (`rocksdb`) is the only supported database backend. SQLite only exists for historical reasons and is not recommended. Any performance issues, storage issues, database issues, etc will not be assisted if using SQLite and you will be asked to migrate to RocksDB first.
## Setting the correct file permissions
If you are using a dedicated user for conduwuit, you will need to allow it to read the config. To do that you can run this command on
Debian or RHEL:
```bash
sudo chown -R root:root /etc/conduwuit
sudo chmod 755 /etc/conduwuit
```
If you use the default database path you also need to run this:
```bash
sudo mkdir -p /var/lib/conduwuit/
sudo chown -R conduwuit:conduwuit /var/lib/conduwuit/
sudo chmod 700 /var/lib/conduwuit/
```
## Setting up the Reverse Proxy
Refer to the documentation or various guides online of your chosen reverse proxy software. A [Caddy](https://caddyserver.com/) example will be provided as this is the recommended reverse proxy for new users and is very trivial to use (handles TLS, reverse proxy headers, etc transparently with proper defaults).
### Caddy
Create `/etc/caddy/conf.d/conduwuit_caddyfile` and enter this (substitute for your server name).
```caddy
your.server.name, your.server.name:8448 {
# TCP
reverse_proxy 127.0.0.1:6167
# UNIX socket
#reverse_proxy unix//run/conduwuit/conduwuit.sock
}
```
That's it! Just start and enable the service and you're set.
```bash
$ sudo systemctl enable --now caddy
```
## You're done!
Now you can start conduwuit with:
```bash
$ sudo systemctl start conduwuit
```
Set it to start automatically when your system boots with:
```bash
$ sudo systemctl enable conduwuit
```
## How do I know it works?
You can open [a Matrix client](https://matrix.org/ecosystem/clients), enter your homeserver and try to register.
You can also use these commands as a quick health check.
```bash
$ curl https://your.server.name/_conduwuit/server_version
# If using port 8448
$ curl https://your.server.name:8448/_conduwuit/server_version
```
- To check if your server can talk with other homeservers, you can use the [Matrix Federation Tester](https://federationtester.matrix.org/).
If you can register but cannot join federated rooms check your config again and also check if the port 8448 is open and forwarded correctly.
# What's next?
## Audio/Video calls
For Audio/Video call functionality see the [TURN Guide](../turn.md).
## Appservices
If you want to set up an appservice, take a look at the [Appservice Guide](../appservices.md).
+31
View File
@@ -0,0 +1,31 @@
# conduwuit for NixOS
conduwuit can be acquired by [Lix][lix] from various places:
* The `flake.nix` at the root of the repo
* The `default.nix` at the root of the repo
* From conduwuit's binary cache
A binary cache for conduwuit that the CI/CD publishes to is available at the
following places (both are the same just different names):
```
https://attic.kennel.juneis.dog/conduit
conduit:Isq8FGyEC6FOXH6nD+BOeAA+bKp6X6UIbupSlGEPuOg=
https://attic.kennel.juneis.dog/conduwuit
conduwuit:lYPVh7o1hLu1idH4Xt2QHaRa49WRGSAqzcfFd94aOTw=
```
If specifying a URL in your flake, please use the GitHub remote: `github:girlbossceo/conduwuit`
The `flake.nix` and `default.nix` do not (currently) provide a NixOS module, so
(for now) [`services.matrix-conduit`][module] from Nixpkgs should be used to
configure conduwuit.
If you want to run the latest code, you should get Conduwuit from the `flake.nix`
or `default.nix` and set [`services.matrix-conduit.package`][package]
appropriately.
[lix]: https://lix.systems/
[module]: https://search.nixos.org/options?channel=unstable&query=services.matrix-conduit
[package]: https://search.nixos.org/options?channel=unstable&query=services.matrix-conduit.package
+23
View File
@@ -0,0 +1,23 @@
# Development
Information about developing the project. If you are only interested in using
it, you can safely ignore this section. If you plan on contributing, see the
[contributor's guide](contributing.md).
## Debugging with `tokio-console`
[`tokio-console`][1] can be a useful tool for debugging and profiling. To make
a `tokio-console`-enabled build of Conduwuit, enable the `tokio_console` feature,
disable the default `release_max_log_level` feature, and set the
`--cfg tokio_unstable` flag to enable experimental tokio APIs. A build might
look like this:
```bash
RUSTFLAGS="--cfg tokio_unstable" cargo build \
--release \
--no-default-features \
--features
backend_rocksdb,systemd,element_hacks,sentry_telemetry,gzip_compression,brotli_compression,zstd_compression,tokio_console
```
[1]: https://docs.rs/tokio-console/latest/tokio_console/
+20
View File
@@ -0,0 +1,20 @@
# Testing
## Complement
Have a look at [Complement's repository][complement] for an explanation of what
it is.
To test against Complement, with [Lix][lix] and direnv installed and set up, you can:
* Run `./bin/complement "$COMPLEMENT_SRC" ./path/to/logs.jsonl ./path/to/results.jsonl`
to build a Complement image, run the tests, and output the logs and results
to the specified paths. This will also output the OCI image at `result`
* Run `nix build .#complement` from the root of the repository to just build a
Complement OCI image outputted to `result` (it's a `.tar.gz` file)
* Or download the latest Complement OCI image from the CI workflow artifacts output
from the commit/revision you want to test (e.g. from main) [here][ci-workflows]
[lix]: https://lix.systems/
[ci-workflows]: https://github.com/girlbossceo/conduwuit/actions/workflows/ci.yml?query=event%3Apush+is%3Asuccess+actor%3Agirlbossceo
[complement]: https://github.com/matrix-org/complement
+159
View File
@@ -0,0 +1,159 @@
#### **Note: This list may not up to date. There are rapidly more and more improvements, fixes, changes, etc being made that it is becoming more difficult to maintain this list. I recommend that you give conduwuit a try and see the differences for yourself. If you have any concerns, feel free to join the conduwuit Matrix room and ask any pre-usage questions.**
### list of features, bug fixes, etc that conduwuit does that Conduit does not:
Outgoing typing indicators, outgoing read receipts, **and** outgoing presence!
## Performance:
- Concurrency support for key fetching for faster remote room joins and room joins that will error less frequently
- Send `Cache-Control` response header with `immutable` and 1 year cache length for all media requests (download and thumbnail) to instruct clients to cache media, and reduce server load from media requests that could be otherwise cached
- Add feature flags and config options to enable/build with zstd, brotli, and/or gzip HTTP body compression (response and request)
- Eliminate all usage of the thread-blocking `getaddrinfo(3)` call upon DNS queries, significantly improving federation latency/ping and cache DNS results (NXDOMAINs, successful queries, etc) using hickory-dns / hickory-resolver
- Vastly improve RocksDB default settings to use new features that help with performance significantly, uses settings tailored to SSDs, various ways to tweak RocksDB, and a conduwuit setting to tell RocksDB to use settings that are tailored to HDDs or slow spinning rust storage or buggy filesystems.
- Add a Cargo build profile for aggressive build-time performance optimisations for release builds (1 codegen unit, no debug, fat LTO, etc, and optimise all crates with same)
- Implement database flush and cleanup conduwuit operations when using RocksDB
- Implement RocksDB write buffer corking and coalescing in database write-heavy areas
- Perform connection pooling and keepalives where necessary to significantly improve federation performance and latency
- Various config options to tweak connection pooling, request timeouts, connection timeouts, DNS timeouts and settings, etc with good defaults which also help huge with performance via reusing connections and retrying where needed
- Implement building conduwuit with jemalloc (which extends to the RocksDB jemalloc feature for maximum gains) or hardened_malloc light variant, and produce CI builds with jemalloc for performance (Nix doesn't seem to build [hardened_malloc-rs](https://github.com/girlbossceo/hardened_malloc-rs) properly)
- Add support for caching DNS results with hickory-dns / hickory-resolver in conduwuit (not a replacement for a proper resolver cache, but still far better than nothing)
- Add config option for using DNS over TCP, and config option for controlling A/AAAA record lookup strategy (e.g. don't query AAAA records if you don't have IPv6 connectivity)
- Overall significant database, Client-Server, and federation performance and latency improvements (check out the ping room leaderboards if you don't believe me :>)
- Add config options for RocksDB compression and bottommost compression, including choosing the algorithm and compression level
- Use [loole](https://github.com/mahdi-shojaee/loole) MPSC channels instead of tokio MPSC channels for huge performance boosts in sending channels (mainly relevant for federation) and presence channels
- Use `tracing`/`log`'s `release_max_level_info` feature to improve performance, build speeds, binary size, and CPU usage in release builds by avoid compiling debug/trace log level macros that users will generally never use (can be disabled with a build-time feature flag)
- Enable RocksDB async read I/O via `io_uring` by default
## General Fixes:
- Raise and improve all the various request timeouts making some things like room joins and client bugs error less or none at all than they should, and make them all user configurable
- Add missing `reason` field to user ban events (`/ban`)
- Fixed spec compliance issue with room version 8 - 11 joins (https://github.com/matrix-org/synapse/issues/16717 / https://github.com/matrix-org/matrix-spec/issues/1708)
- Safer and cleaner shutdowns on both database side as we run cleanup on shutdown and exits database loop better (no potential hanging issues in database loop), overall cleaner shutdown logic
- Stop sending `make_join` requests on room joins if 15 servers respond with `M_UNSUPPORTED_ROOM_VERSION` or `M_INVALID_ROOM_VERSION`
- Stop sending `make_join` requests if 50 servers cannot provide `make_join` for us
- Respect *most* client parameters for `/media/` requests (`allow_redirect` still needs work)
- Increased graceful shutdown timeout from a low 60 seconds to 180 seconds to avoid killing connections and let the remaining ones finish processing
- Return joined member count of rooms for push rules/conditions instead of a hardcoded value of 10
- Make `CONDUIT_CONFIG` optional, relevant for container users that configure only by environment variables and no longer need to set `CONDUIT_CONFIG` to an empty string.
- Allow HEAD and PATCH (MSC4138) HTTP requests in CORS for clients (despite not being explicity mentioned in Matrix spec, HTTP spec says all HEAD requests need to behave the same as GET requests, Synapse supports HEAD requests)
- Resolve and remove some "features" from upstream that result in concurrency hazards, exponential backoff issues, or arbitrary performance limiters
- Find more servers for outbound federation `/hierarchy` requests instead of just the room ID server name
- Support for suggesting servers to join through at `/_matrix/client/v3/directory/room/{roomAlias}`
- Support for suggesting servers to join through us at `/_matrix/federation/v1/query/directory`
- Add workaround for [Out Of Your Element](https://gitdab.com/cadence/out-of-your-element) appservice bridge to make it functional on conduwuit (bug has already been reported)
## Moderation:
- (Also see [Admin Room](#admin-room) for all the admin commands pertaining to moderation, there's a lot!)
- Add support for room banning/blocking by ID using admin command
- Add support for serving `support` well-known from `[well_known.support]` (MSC1929)
- Config option to forbid publishing rooms to the room directory (`lockdown_public_room_directory`) except for admins
- Admin commands to delete room aliases and unpublish rooms from our room directory
- For all [`/report`](https://spec.matrix.org/v1.9/client-server-api/#post_matrixclientv3roomsroomidreporteventid) requests: check if the reported event ID belongs to the reported room ID, raise report reasoning character limit to 750, fix broken formatting, make a small delayed random response per spec suggestion on privacy, and check if the sender user is in the reported room.
- Support blocking servers from downloading remote media from, returning a 404
- Don't allow `m.call.invite` events to be sent in public rooms (prevents calling the entire room)
- On new public room creations, only allow moderators to send `m.call.invite`, `org.matrix.msc3401.call`, and `org.matrix.msc3401.call.member` events
- Add support for a "global ACLs" feature (`forbidden_remote_server_names`) that blocks inbound remote room invites, room joins by room ID on server name, room joins by room alias on server name, incoming federated joins, and incoming federated room directory requests. This is very helpful for blocking servers that are purely toxic/bad and serve no value in allowing our users to suffer from things like room invite spam or such. Please note that this is not a substitute for room ACLs.
- Add support for a config option to forbid our local users from sending federated room directory requests for (`forbidden_remote_room_directory_server_names`). Similar to above, useful for blocking servers that help prevent our users from wandering into bad areas of Matrix via room directories of those malicious servers.
- Add config option for auto remediating/deactivating local non-admin users who attempt to join bad/forbidden rooms (`auto_deactivate_banned_room_attempts`)
## Privacy/Security:
- Add config option for device name federation with a privacy-friendly default (disabled)
- Add config option for requiring authentication to the `/publicRooms` endpoint (room directory) with a default enabled for privacy
- Add config option for federating `/publicRooms` endpoint (room directory) to other servers with a default disabled for privacy
- Uses proper `argon2` crate by RustCrypto instead of questionable `rust-argon2` crate
- Generate passwords with 25 characters instead of 15
- Config option `ip_range_denylist` to support refusing to send requests (typically federation) to specific IP ranges, typically RFC 1918, non-routable, testnet, etc addresses like Synapse for security (note: this is not a guaranteed protection, and you should be using a firewall with zones if you want guaranteed protection as doing this on the application level is prone to bypasses).
- Config option to block non-admin users from sending room invites or receiving remote room invites. Admin users are still allowed.
- Config option to disable incoming and/or outgoing remote read receipts
- Config option to disable incoming and/or outgoing remote typing indicators
- Config option to disable incoming, outgoing, and/or local presence
- Sanitise file names for the `Content-Disposition` header for all media requests (thumbnails, downloads, uploads)
- Return `inline` or `attachment` based on the detected file MIME type for the `Content-Disposition` and only allow images/videos/text/audio to be `inline`
- Send secure default HTTP headers such as a strong restrictive CSP, deny iframes, disable `X-XSS-Protection`, disable interest cohort in `Permission-Policy`, etc to mitigate any potential attack surface such as from untrusted media
## Administration/Logging:
- Commandline argument to specify the path to a config file instead of relying on `CONDUIT_CONFIG`
- Revamped admin room infrastructure and commands
- Substantially clean up, improve, and fix logging (less noisy dead server logging, registration attempts, more useful troubleshooting logging, proper error propagation, etc)
- Configurable RocksDB logging (`LOG` files) with proper defaults (rotate, max size, verbosity, etc) to stop LOG files from accumulating so much
- Explicit startup error if your configuration allows open registration without a token or such like Synapse with a way to bypass it if needed
- Replace the lightning bolt emoji option with support for setting any arbitrary text (e.g. another emoji) to suffix to all new user registrations, with a conduwuit default of 🏳️‍⚧️
- Implement config option to auto join rooms upon registration
- Warn on unknown config options specified
- Add `/_conduwuit/server_version` route to return the version of conduwuit without relying on the federation API `/_matrix/federation/v1/version`
- Add configurable RocksDB recovery modes to aid in recovering corrupted RocksDB databases
- Support config options via `CONDUWUIT_` prefix and accessing non-global struct config options with the `__` split (e.g. `CONDUWUIT_WELL_KNOWN__SERVER`)
- Add support for listening on multiple TCP ports
- Disable update check by default as it's not useful for conduwuit
- **Opt-in** Sentry.io telemetry and metrics, mainly used for crash reporting
## Maintenance/Stability:
- GitLab CI ported to GitHub Actions
- Repo is mirrored to GitHub, GitLab, git.gay, git.girlcock.ceo, sourcehut, and Codeberg (see README.md for their links)
- Docker container images published to GitLab Container Registry, GitHub Container Registry, and Dockerhub
- Extensively revamp the example config to be extremely helpful and useful to both new users and power users
- Fixed every single clippy (default lints) and rustc warnings, including some that were performance related or potential safety issues / unsoundness
- Add a **lot** of other clippy and rustc lints and a rustfmt.toml file
- Has [Renovate](https://docs.renovatebot.com/), [Trivy](https://github.com/aquasecurity/trivy-action), and keeps ALL dependencies as up to date as possible
- Attempts and interest in removing extreme and unnecessary panics/unwraps/expects that can lead to denial of service or such (upstream and upstream contributors want this unusual behaviour for some reason)
- Purge unmaintained/irrelevant/broken database backends (heed, sled, persy) and other unnecessary code or overhead
- webp support for images
- Add cargo audit support to CI
- CI tests with all features
- Add timestamp by commit date support to building OCI images for keeping image build reproducibility and still have a meaningful "last modified date" for OCI image metadata
- Update rusqlite/sqlite (not that you should be using it)
- Startup check if conduwuit running in a container and is listening on 127.0.0.1 (generally containers are using NAT networking and 0.0.0.0 is the intended listening address)
## Admin Room:
- Fix admin room handler to not panic/crash if the admin room command response fails (e.g. too large message)
- Add command to dynamically change conduwuit's tracing log level filter on the fly
- Add admin command to fetch a server's `/.well-known/matrix/support` file
- Add debug admin command to force update user device lists (could potentially resolve some E2EE flukes)
- Implement **RocksDB online backups**, listing RocksDB backups, and listing database file counts all via admin commands
- Add various database visibility commands such as being able to query the getters and iterators used in conduwuit, a very helpful online debugging utility
- Forbid the admin room from being made public or world readable history
- Add `!admin` as a way to call the admin bot
- Extend clear cache admin command to support clearing more caches such as DNS and TLS name overrides
- Admin debug command to send a federation request/ping to a server's `/_matrix/federation/v1/version` endpoint and measures the latency it took
- Add admin command to bulk delete media via a codeblock list of MXC URLs.
- Add admin command to delete both the thumbnail and media MXC URLs from an event ID (e.g. from an abuse report)
- Add admin command to list all the rooms a local user is joined in
- Add admin command to delete all remote media in the past X minutes as a form of deleting media that you don't want on your server that a remote user posted in a room
- Add admin command to return a room's state
- Admin debug command to fetch a PDU from a remote server and inserts it into our database/timeline as backfill
- Add admin command to delete media via a specific MXC. This deletes the MXC from our database, and the file locally.
- Add admin commands for banning (blocking) room IDs from our local users joining (admins are always allowed) and evicts all our local users from that room, in addition to bulk room banning support, and blocks room invites (remote and local) to the banned room, as a moderation feature
- Add admin commands to output jemalloc memory stats and memory usage
- Add admin command to get conduwuit's uptime
- Add admin command to get rooms a *remote* user shares with us
## Misc:
- Support for creating rooms with custom room IDs like Maunium Synapse (`room_id` request body field to `/createRoom`)
- Query parameter `?format=event|content` for returning either the room state event's content (default) for the full room state event on ` /_matrix/client/v3/rooms/{roomId}/state/{eventType}[/{stateKey}]` requests (see https://github.com/matrix-org/matrix-spec/issues/1047)
- Add **optional** feature flag to use SHA256 key names for media instead of base64 to overcome filesystem file name length limitations (OS error file name too long)
- Send a User-Agent on all of our requests
- Send `avatar_url` on invite room membership events/changes
- Support sending [`well_known` response to client login responses](https://spec.matrix.org/v1.10/client-server-api/#post_matrixclientv3login) if using config option `[well_known.client]`
- Implement `include_state` search criteria support for `/search` requests (response now can include room states)
- Declare various missing Matrix versions and features at `/_matrix/client/versions`
- Implement legacy Matrix `/v1/` media endpoints that some clients and servers may still call
- Config option to change Conduit's behaviour of homeserver key fetching (`query_trusted_key_servers_first`). This option sets whether conduwuit will query trusted notary key servers first before the individual homeserver(s), or vice versa which may help in joining certain rooms.
- Implement unstable MSC2666 support for querying mutual rooms with a user
- Assume well-knowns are broken if they exceed past 10000 characters.
- Add support for the Matrix spec compliance test suite [Complement](https://github.com/matrix-org/complement/) via the Nix flake and various other fixes for it
- Add support for listening on both HTTP and HTTPS if using direct TLS with conduwuit for usecases such as Complement
- Implement running and diff'ing Complement results in CI
- Interest in supporting other operating systems such as macOS, BSDs, and Windows, and getting them added into CI and doing builds for them
- Add config option for disabling RocksDB Direct IO if needed
- Add various documentation on maintaining conduwuit, using RocksDB online backups, some troubleshooting, using admin commands, etc
- (Developers): Add support for tokio-console
- (Developers): Add support for tracing flame graphs
- Add `release-debuginfo` Cargo build profile
- No cryptocurrency donations allowed, conduwuit is fully maintained by independent queer maintainers, and with a strong priority on inclusitivity and comfort for protected groups 🏳️‍⚧️
+21
View File
@@ -0,0 +1,21 @@
# Conduwuit
{{#include ../README.md:catchphrase}}
{{#include ../README.md:body}}
#### What's different about your fork than upstream Conduit?
See the [differences](differences.md) page
#### How can I deploy my own?
- [Deployment options](deploying.md)
If you want to connect an Appservice to Conduwuit, take a look at the [appservices documentation](appservices.md).
#### How can I contribute?
See the [contributor's guide](contributing.md)
{{#include ../README.md:footer}}
+63
View File
@@ -0,0 +1,63 @@
# Maintaining your conduwuit setup
## Moderation
conduwuit has moderation through admin room commands. "binary commands" (medium priority) and an admin API (low priority) is planned. Some moderation-related config options are available in the example config such as "global ACLs" and blocking media requests to certain servers. See the example config for the moderation config options under the "Moderation / Privacy / Security" section.
conduwuit has moderation admin commands for:
- managing room aliases (`!admin rooms alias`)
- managing room directory (`!admin rooms directory`)
- managing room banning/blocking and user removal (`!admin rooms moderation`)
- managing user accounts (`!admin users`)
- fetching `/.well-known/matrix/support` from servers (`!admin federation`)
- blocking incoming federation for certain rooms (not the same as room banning) (`!admin federation`)
- deleting media (see [the media section](#media))
Any commands with `-list` in them will require a codeblock in the message with each object being newline delimited. An example of doing this is:
````
!admin rooms moderation ban-list-of-rooms
```
!roomid1:server.name
!roomid2:server.name
!roomid3:server.name
```
````
## Database
If using RocksDB, there's very little you need to do. Compaction is ran automatically based on various defined thresholds tuned for conduwuit to be high performance with the least I/O amplifcation or overhead. Manually running compaction is not recommended, or compaction via a timer. RocksDB is built with io_uring support via liburing for async read I/O.
Some RocksDB settings can be adjusted such as the compression method chosen. See the RocksDB section in the [example config](configuration.md). btrfs users may benefit from disabling compression on RocksDB if CoW is in use.
RocksDB troubleshooting can be found [in the RocksDB section of troubleshooting](troubleshooting.md).
## Backups
Currently only RocksDB supports online backups. If you'd like to backup your database online without any downtime, see the `!admin server` command for the backup commands and the `database_backup_path` config options in the example config. Please note that the format of the database backup is not the exact same. This is unfortunately a bad design choice by Facebook as we are using the database backup engine API from RocksDB, however the data is still there and can still be joined together.
To restore a backup from an online RocksDB backup:
- shutdown conduwuit
- create a new directory for merging together the data
- in the online backup created, copy all `.sst` files in `$DATABASE_BACKUP_PATH/shared_checksum` to your new directory
- trim all the strings so instead of `######_sxxxxxxxxx.sst`, it reads `######.sst`. A way of doing this with sed and bash is `for file in *.sst; do mv "$file" "$(echo "$file" | sed 's/_s.*/.sst/')"; done`
- copy all the files in `$DATABASE_BACKUP_PATH/1` to your new directory
- set your `database_path` config option to your new directory, or replace your old one with the new one you crafted
- start up conduwuit again and it should open as normal
If you'd like to do an offline backup, shutdown conduwuit and copy your `database_path` directory elsewhere. This can be restored with no modifications needed.
Backing up media is also just copying the `media/` directory from your database directory.
## Media
Media still needs various work, however conduwuit implements media deletion via:
- MXC URI
- Delete list of MXC URIs
- Delete remote media in the past `N` seconds/minutes
See the `!admin media` command for further information. All media in conduwuit is stored at `$DATABASE_DIR/media`. This will be configurable soon.
If you are finding yourself needing extensive granular control over media, we recommend looking into [Matrix Media Repo](https://github.com/t2bot/matrix-media-repo). conduwuit intends to implement various utilities for media, but MMR is dedicated to extensive media management.
Built-in S3 support is also planned, but for now using a "S3 filesystem" on `media/` works. conduwuit also sends a `Cache-Control` header of 1 year and immutable for all media requests (download and thumbnail) to reduce unnecessary media requests from browsers.
+62
View File
@@ -0,0 +1,62 @@
# Troubleshooting conduwuit
> ## Docker users ⚠️
>
> Docker is extremely UX unfriendly. Because of this, a ton of issues or support is actually Docker support, not conduwuit support. We also cannot document the ever-growing list of Docker issues here.
>
> If you intend on asking for support and you are using Docker, **PLEASE** triple validate your issues are **NOT** because you have a misconfiguration in your Docker setup.
>
> If there are things like Compose file issues or Dockerhub image issues, those can still be mentioned as long as they're something we can fix.
## Rocksdb / database issues
#### Direct IO
Some filesystems may not like RocksDB using [Direct IO](https://github.com/facebook/rocksdb/wiki/Direct-IO). Direct IO is for non-buffered I/O which improves conduwuit performance, but at least FUSE is a filesystem potentially known to not like this. See the [example config](configuration.md) for disabling it if needed. Issues from Direct IO on unsupported filesystems are usually shown as startup errors.
#### Database corruption
If your database is corrupted and is failing to start (e.g. checksum mismatch), it may be recoverable but careful steps must be taken, and there is no guarantee it may be recoverable.
RocksDB has the following recovery modes:
- `TolerateCorruptedTailRecords`
- `AbsoluteConsistency`
- `PointInTime`
- `SkipAnyCorruptedRecord`
By default, conduwuit uses `TolerateCorruptedTailRecords` as generally these may be due to bad federation and we can re-fetch the correct data over federation. The RocksDB default is `PointInTime` which will attempt to restore a "snapshot" of the data when it was last known to be good. This data can be either a few seconds old, or multiple minutes prior. `PointInTime` may not be suitable for default usage due to clients and servers possibly not being able to handle sudden "backwards time travels", and `AbsoluteConsistency` may be too strict.
`AbsoluteConsistency` will fail to start the database if any sign of corruption is detected. `SkipAnyCorruptedRecord` will skip all forms of corruption unless it forbids the database from opening (e.g. too severe). Usage of `SkipAnyCorruptedRecord` voids any support as this may cause more damage and/or leave your database in a permanently inconsistent state, but it may do something if `PointInTime` does not work as a last ditch effort.
With this in mind:
- First start conduwuit with the `PointInTime` recovery method. See the [example config](configuration.md) for how to do this using `rocksdb_recovery_mode`
- If your database successfully opens, clients are recommended to clear their client cache to account for the rollback
- Leave your conduwuit running in `PointInTime` for at least 30-60 minutes so as much possible corruption is restored
- If all goes will, you should be able to restore back to using `TolerateCorruptedTailRecords` and you have successfully recovered your database
## Media
#### "File name too long"
If you are running into the "file name is too long" OS error for media requests, your filesystem cannot handle file name lengths >=255 characters. This is unfortuntely due to Conduit (upstream) using base64 for file name keys which is very problematic for some filesystems as the base64 input is untrusted and long file names or specific inputs can cause this. If you would like to avoid this, you may build conduwuit yourself with the `sha256_media` feature. **This will lose database compatibility with upstream**.
## Debugging
Note that users should not really be debugging things. If you find yourself debugging and find the issue, please let us know and/or how we can fix it. Various debug commands can be found in `!admin debug`.
#### Debug/Trace log level
conduwuit builds without debug or trace log levels by default for at least performance reasons. This may change in the future and/or binaries providing such configurations may be provided. If you need to access debug/trace log levels, you will need to build without the `release_max_log_level` feature.
#### Changing log level dynamically
conduwuit supports changing the tracing log environment filter on-the-fly using the admin command `!admin debug change-log-level`. This accepts a string **without quotes** the same format as the `log` config option.
#### Pinging servers
conduwuit can ping other servers using `!admin debug ping`. This takes a server name and goes through the server discovery process and queries `/_matrix/federation/v1/version`. Errors are outputted.
#### Allocator memory stats
If using jemalloc (for now) and built with jemallocator's `stats` feature, you can see conduwuit's jemalloc memory stats by using `!admin debug memory-stats`
+55
View File
@@ -0,0 +1,55 @@
# Setting up TURN/STURN
In order to make or receive calls, a TURN server is required. conduwuit suggests using [Coturn](https://github.com/coturn/coturn) for this purpose, which is also available as a Docker image.
### Configuration
Create a configuration file called `coturn.conf` containing:
```conf
use-auth-secret
static-auth-secret=<a secret key>
realm=<your server domain>
```
A common way to generate a suitable alphanumeric secret key is by using `pwgen -s 64 1`.
These same values need to be set in conduwuit. You can either modify conduwuit.toml to include these lines:
```
turn_uris = ["turn:<your server domain>?transport=udp", "turn:<your server domain>?transport=tcp"]
turn_secret = "<secret key from coturn configuration>"
```
or append the following to the docker environment variables dependig on which configuration method you used earlier:
```yml
CONDUIT_TURN_URIS: '["turn:<your server domain>?transport=udp", "turn:<your server domain>?transport=tcp"]'
CONDUIT_TURN_SECRET: "<secret key from coturn configuration>"
```
Restart conduwuit to apply these changes.
### Run
Run the [Coturn](https://hub.docker.com/r/coturn/coturn) image using
```bash
docker run -d --network=host -v $(pwd)/coturn.conf:/etc/coturn/turnserver.conf coturn/coturn
```
or docker-compose. For the latter, paste the following section into a file called `docker-compose.yml`
and run `docker compose up -d` in the same directory.
```yml
version: 3
services:
turn:
container_name: coturn-server
image: docker.io/coturn/coturn
restart: unless-stopped
network_mode: "host"
volumes:
- ./coturn.conf:/etc/coturn/turnserver.conf
```
To understand why the host networking mode is used and explore alternative configuration options, please visit [Coturn's Docker documentation](https://github.com/coturn/coturn/blob/master/docker/coturn/README.md).
For security recommendations see Synapse's [Coturn documentation](https://element-hq.github.io/synapse/latest/turn-howto.html).
+147
View File
@@ -0,0 +1,147 @@
interpreter = ["bash", "-euo", "pipefail", "-c"]
[[task]]
name = "engage"
group = "versions"
script = "engage --version"
[[task]]
name = "nix"
group = "versions"
script = "nix --version"
[[task]]
name = "direnv"
group = "versions"
script = "direnv --version"
[[task]]
name = "rustc"
group = "versions"
script = "rustc --version"
[[task]]
name = "cargo"
group = "versions"
script = "cargo --version"
[[task]]
name = "cargo-fmt"
group = "versions"
script = "cargo fmt --version"
[[task]]
name = "rustdoc"
group = "versions"
script = "rustdoc --version"
[[task]]
name = "cargo-clippy"
group = "versions"
script = "cargo clippy -- --version"
[[task]]
name = "cargo-audit"
group = "versions"
script = "cargo audit --version"
[[task]]
name = "cargo-deb"
group = "versions"
script = "cargo deb --version"
[[task]]
name = "lychee"
group = "versions"
script = "lychee --version"
[[task]]
name = "cargo-audit"
group = "security"
script = "cargo audit -D warnings -D unmaintained -D unsound -D yanked --ignore RUSTSEC-2020-0016"
[[task]]
name = "cargo-fmt"
group = "lints"
script = "cargo fmt --check -- --color=always"
[[task]]
name = "cargo-doc"
group = "lints"
script = """
RUSTDOCFLAGS="-D warnings" cargo doc \
--workspace \
--all-features \
--no-deps \
--document-private-items \
--color always
"""
[[task]]
name = "clippy/default"
group = "lints"
script = """
cargo clippy \
--workspace \
--all-targets \
--color=always \
-- \
-D warnings
"""
[[task]]
name = "clippy/all"
group = "lints"
script = """
cargo clippy \
--workspace \
--all-targets \
--all-features \
--color=always \
-- \
-D warnings
"""
[[task]]
name = "clippy/jemalloc"
group = "lints"
script = """
cargo clippy \
--workspace \
--features jemalloc \
--all-targets \
--color=always \
-- \
-D warnings
"""
[[task]]
name = "clippy/hardened_malloc"
group = "lints"
script = """
cargo clippy \
--workspace \
--features hardened_malloc \
--all-targets \
--color=always \
-- \
-D warnings
"""
[[task]]
name = "lychee"
group = "lints"
script = "lychee --verbose --offline docs *.md"
[[task]]
name = "cargo"
group = "tests"
script = """
cargo test \
--workspace \
--all-targets \
--all-features \
--color=always \
-- \
--color=always
"""
Generated
+303
View File
@@ -0,0 +1,303 @@
{
"nodes": {
"attic": {
"inputs": {
"crane": "crane",
"flake-compat": "flake-compat",
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs",
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1711742460,
"narHash": "sha256-0O4v6e4a1toxXZ2gf5INhg4WPE5C5T+SVvsBt+45Mcc=",
"owner": "zhaofengli",
"repo": "attic",
"rev": "4dbdbee45728d8ce5788db6461aaaa89d98081f0",
"type": "github"
},
"original": {
"owner": "zhaofengli",
"ref": "main",
"repo": "attic",
"type": "github"
}
},
"complement": {
"flake": false,
"locked": {
"lastModified": 1715700731,
"narHash": "sha256-cie+b5N/TQAFD8vF/XbqfyFJkFU0qUPDbtJQDm/TfQc=",
"owner": "matrix-org",
"repo": "complement",
"rev": "8587fb3cbe746754b2c883ff6c818ca4d987d0a5",
"type": "github"
},
"original": {
"owner": "matrix-org",
"ref": "main",
"repo": "complement",
"type": "github"
}
},
"crane": {
"inputs": {
"nixpkgs": [
"attic",
"nixpkgs"
]
},
"locked": {
"lastModified": 1702918879,
"narHash": "sha256-tWJqzajIvYcaRWxn+cLUB9L9Pv4dQ3Bfit/YjU5ze3g=",
"owner": "ipetkov",
"repo": "crane",
"rev": "7195c00c272fdd92fc74e7d5a0a2844b9fadb2fb",
"type": "github"
},
"original": {
"owner": "ipetkov",
"repo": "crane",
"type": "github"
}
},
"crane_2": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1715274763,
"narHash": "sha256-3Iv1PGHJn9sV3HO4FlOVaaztOxa9uGLfOmUWrH7v7+A=",
"owner": "ipetkov",
"repo": "crane",
"rev": "27025ab71bdca30e7ed0a16c88fd74c5970fc7f5",
"type": "github"
},
"original": {
"owner": "ipetkov",
"ref": "master",
"repo": "crane",
"type": "github"
}
},
"fenix": {
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"rust-analyzer-src": "rust-analyzer-src"
},
"locked": {
"lastModified": 1715322226,
"narHash": "sha256-ezoe/FwfJpA7sskLoLP2iwfwkYnscEFCP6Vk5kPwh9k=",
"owner": "nix-community",
"repo": "fenix",
"rev": "297c756ba6249d483c1dafe42378560458842173",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "main",
"repo": "fenix",
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1673956053,
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_2": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
"owner": "edolstra",
"ref": "master",
"repo": "flake-compat",
"type": "github"
}
},
"flake-utils": {
"locked": {
"lastModified": 1667395993,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_2": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github"
},
"original": {
"owner": "numtide",
"ref": "main",
"repo": "flake-utils",
"type": "github"
}
},
"nix-filter": {
"locked": {
"lastModified": 1710156097,
"narHash": "sha256-1Wvk8UP7PXdf8bCCaEoMnOT1qe5/Duqgj+rL8sRQsSM=",
"owner": "numtide",
"repo": "nix-filter",
"rev": "3342559a24e85fc164b295c3444e8a139924675b",
"type": "github"
},
"original": {
"owner": "numtide",
"ref": "main",
"repo": "nix-filter",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1711401922,
"narHash": "sha256-QoQqXoj8ClGo0sqD/qWKFWezgEwUL0SUh37/vY2jNhc=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "07262b18b97000d16a4bdb003418bd2fb067a932",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1711460390,
"narHash": "sha256-akSgjDZL6pVHEfSE6sz1DNSXuYX6hq+P/1Z5IoYWs7E=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "44733514b72e732bd49f5511bd0203dea9b9a434",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-23.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1715266358,
"narHash": "sha256-doPgfj+7FFe9rfzWo1siAV2mVCasW+Bh8I1cToAXEE4=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "f1010e0469db743d14519a1efd37e23f8513d714",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"rocksdb": {
"flake": false,
"locked": {
"lastModified": 1714770052,
"narHash": "sha256-NCPYF2wYBsB9OHEkZSOYoPlxjC9BBMhJp8EM5M1o3Mc=",
"owner": "girlbossceo",
"repo": "rocksdb",
"rev": "db6df0b185774778457dabfcbd822cb81760cade",
"type": "github"
},
"original": {
"owner": "girlbossceo",
"ref": "v9.1.1",
"repo": "rocksdb",
"type": "github"
}
},
"root": {
"inputs": {
"attic": "attic",
"complement": "complement",
"crane": "crane_2",
"fenix": "fenix",
"flake-compat": "flake-compat_2",
"flake-utils": "flake-utils_2",
"nix-filter": "nix-filter",
"nixpkgs": "nixpkgs_2",
"rocksdb": "rocksdb"
}
},
"rust-analyzer-src": {
"flake": false,
"locked": {
"lastModified": 1715255944,
"narHash": "sha256-vLLgYpdtKBaGYTamNLg1rbRo1bPXp4Jgded/gnprPVw=",
"owner": "rust-lang",
"repo": "rust-analyzer",
"rev": "5bf2f85c8054d80424899fa581db1b192230efb5",
"type": "github"
},
"original": {
"owner": "rust-lang",
"ref": "nightly",
"repo": "rust-analyzer",
"type": "github"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}
+191
View File
@@ -0,0 +1,191 @@
{
inputs = {
attic.url = "github:zhaofengli/attic?ref=main";
complement = { url = "github:matrix-org/complement?ref=main"; flake = false; };
crane = { url = "github:ipetkov/crane?ref=master"; inputs.nixpkgs.follows = "nixpkgs"; };
fenix = { url = "github:nix-community/fenix?ref=main"; inputs.nixpkgs.follows = "nixpkgs"; };
flake-compat = { url = "github:edolstra/flake-compat?ref=master"; flake = false; };
flake-utils.url = "github:numtide/flake-utils?ref=main";
nix-filter.url = "github:numtide/nix-filter?ref=main";
nixpkgs.url = "github:NixOS/nixpkgs?ref=nixos-unstable";
# https://github.com/girlbossceo/rocksdb/commit/db6df0b185774778457dabfcbd822cb81760cade
rocksdb = { url = "github:girlbossceo/rocksdb?ref=v9.1.1"; flake = false; };
};
outputs = inputs:
inputs.flake-utils.lib.eachDefaultSystem (system:
let
pkgsHost = inputs.nixpkgs.legacyPackages.${system};
# The Rust toolchain to use
toolchain = inputs.fenix.packages.${system}.fromToolchainFile {
file = ./rust-toolchain.toml;
# See also `rust-toolchain.toml`
sha256 = "sha256-+syqAd2kX8KVa8/U2gz3blIQTTsYYt3U63xBWaGOSc8";
};
scope = pkgs: pkgs.lib.makeScope pkgs.newScope (self: {
book = self.callPackage ./nix/pkgs/book {};
complement = self.callPackage ./nix/pkgs/complement {};
craneLib = ((inputs.crane.mkLib pkgs).overrideToolchain toolchain);
inherit inputs;
main = self.callPackage ./nix/pkgs/main {};
oci-image = self.callPackage ./nix/pkgs/oci-image {};
rocksdb = pkgs.rocksdb.overrideAttrs (old: {
src = inputs.rocksdb;
version = pkgs.lib.removePrefix
"v"
(builtins.fromJSON (builtins.readFile ./flake.lock))
.nodes.rocksdb.original.ref;
});
});
scopeHost = (scope pkgsHost);
in
{
packages = {
default = scopeHost.main;
jemalloc = scopeHost.main.override { features = ["jemalloc"]; };
hmalloc = scopeHost.main.override { features = ["hardened_malloc"]; };
oci-image = scopeHost.oci-image;
oci-image-jemalloc = scopeHost.oci-image.override {
main = scopeHost.main.override {
features = ["jemalloc"];
};
};
oci-image-hmalloc = scopeHost.oci-image.override {
main = scopeHost.main.override {
features = ["hardened_malloc"];
};
};
book = scopeHost.book;
complement = scopeHost.complement;
}
//
builtins.listToAttrs
(builtins.concatLists
(builtins.map
(crossSystem:
let
binaryName = "static-${crossSystem}";
pkgsCrossStatic =
(import inputs.nixpkgs {
inherit system;
crossSystem = {
config = crossSystem;
};
}).pkgsStatic;
scopeCrossStatic = scope pkgsCrossStatic;
in
[
# An output for a statically-linked binary
{
name = binaryName;
value = scopeCrossStatic.main;
}
# An output for a statically-linked binary with jemalloc
{
name = "${binaryName}-jemalloc";
value = scopeCrossStatic.main.override {
features = ["jemalloc"];
};
}
# An output for a statically-linked binary with hardened_malloc
{
name = "${binaryName}-hmalloc";
value = scopeCrossStatic.main.override {
features = ["hardened_malloc"];
};
}
# An output for an OCI image based on that binary
{
name = "oci-image-${crossSystem}";
value = scopeCrossStatic.oci-image;
}
# An output for an OCI image based on that binary with jemalloc
{
name = "oci-image-${crossSystem}-jemalloc";
value = scopeCrossStatic.oci-image.override {
main = scopeCrossStatic.main.override {
features = ["jemalloc"];
};
};
}
# An output for an OCI image based on that binary with hardened_malloc
{
name = "oci-image-${crossSystem}-hmalloc";
value = scopeCrossStatic.oci-image.override {
main = scopeCrossStatic.main.override {
features = ["hardened_malloc"];
};
};
}
]
)
[
"x86_64-unknown-linux-musl"
"aarch64-unknown-linux-musl"
]
)
);
devShells.default = pkgsHost.mkShell {
env = scopeHost.main.env // {
# Rust Analyzer needs to be able to find the path to default crate
# sources, and it can read this environment variable to do so. The
# `rust-src` component is required in order for this to work.
RUST_SRC_PATH = "${toolchain}/lib/rustlib/src/rust/library";
# Convenient way to access a pinned version of Complement's source
# code.
COMPLEMENT_SRC = inputs.complement.outPath;
};
# Development tools
packages = [
# Always use nightly rustfmt because most of its options are unstable
#
# This needs to come before `toolchain` in this list, otherwise
# `$PATH` will have stable rustfmt instead.
inputs.fenix.packages.${system}.latest.rustfmt
toolchain
]
++ (with pkgsHost; [
engage
cargo-audit
# Needed for producing Debian packages
cargo-deb
# Needed for Complement
go
olm
# Needed for our script for Complement
jq
# Needed for finding broken markdown links
lychee
# Useful for editing the book locally
mdbook
])
++ (if !pkgsHost.stdenv.isDarwin then [
# Needed for building with io_uring
pkgsHost.liburing
] else [])
++
scopeHost.main.nativeBuildInputs;
};
});
}
-2
View File
@@ -1,2 +0,0 @@
podman build -t misc-webserver -f "Dockerfile"
podman save --format oci-archive localhost/misc-webserver:latest | gzip | ssh fedora@213.32.25.24 -T "zcat | sudo podman load"
+33
View File
@@ -0,0 +1,33 @@
{ inputs
# Dependencies
, main
, mdbook
, stdenv
}:
stdenv.mkDerivation {
inherit (main) pname version;
src = inputs.nix-filter {
root = inputs.self;
include = [
"book.toml"
"conduwuit-example.toml"
"CONTRIBUTING.md"
"README.md"
"debian/conduwuit.service"
"debian/README.md"
"docs"
];
};
nativeBuildInputs = [
mdbook
];
buildPhase = ''
mdbook build
mv public $out
'';
}
+19
View File
@@ -0,0 +1,19 @@
[global]
address = "0.0.0.0"
allow_device_name_federation = true
allow_guest_registration = true
allow_public_room_directory_over_federation = true
allow_public_room_directory_without_auth = true
allow_registration = true
allow_unstable_room_versions = true
database_backend = "rocksdb"
database_path = "/database"
log = "trace"
port = [8008, 8448]
trusted_servers = []
yes_i_am_very_very_sure_i_want_an_open_registration_server_prone_to_abuse = true
[global.tls]
certs = "/certificate.crt"
dual_protocol = true
key = "/private_key.key"
+92
View File
@@ -0,0 +1,92 @@
# Dependencies
{ bashInteractive
, buildEnv
, coreutils
, dockerTools
, gawk
, lib
, main
, openssl
, stdenv
, tini
, writeShellScriptBin
}:
let
main' = main.override {
profile = "dev";
features = ["axum_dual_protocol"];
};
start = writeShellScriptBin "start" ''
set -euxo pipefail
${lib.getExe openssl} genrsa -out private_key.key 2048
${lib.getExe openssl} req \
-new \
-sha256 \
-key private_key.key \
-subj "/C=US/ST=CA/O=MyOrg, Inc./CN=$SERVER_NAME" \
-out signing_request.csr
cp ${./v3.ext} v3.ext
echo "DNS.1 = $SERVER_NAME" >> v3.ext
echo "IP.1 = $(${lib.getExe gawk} 'END{print $1}' /etc/hosts)" \
>> v3.ext
${lib.getExe openssl} x509 \
-req \
-extfile v3.ext \
-in signing_request.csr \
-CA /complement/ca/ca.crt \
-CAkey /complement/ca/ca.key \
-CAcreateserial \
-out certificate.crt \
-days 1 \
-sha256
${lib.getExe' coreutils "env"} \
CONDUIT_SERVER_NAME="$SERVER_NAME" \
CONDUIT_WELL_KNOWN_SERVER="$SERVER_NAME:8448" \
CONDUIT_WELL_KNOWN_SERVER="$SERVER_NAME:8008" \
${lib.getExe main'}
'';
in
dockerTools.buildImage {
name = "complement-${main.pname}";
tag = "main";
copyToRoot = buildEnv {
name = "root";
pathsToLink = [
"/bin"
];
paths = [
bashInteractive
coreutils
main'
start
];
};
config = {
Cmd = [
"${lib.getExe start}"
];
Entrypoint = if !stdenv.isDarwin
# Use the `tini` init system so that signals (e.g. ctrl+c/SIGINT)
# are handled as expected
then [ "${lib.getExe' tini "tini"}" "--" ]
else [];
Env = [
"SSL_CERT_FILE=/complement/ca/ca.crt"
"CONDUWUIT_CONFIG=${./config.toml}"
];
ExposedPorts = {
"8008/tcp" = {};
"8448/tcp" = {};
};
};
}
+6
View File
@@ -0,0 +1,6 @@
authorityKeyIdentifier=keyid,issuer
basicConstraints=CA:FALSE
keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment
subjectAltName = @alt_names
[alt_names]
+100
View File
@@ -0,0 +1,100 @@
{ lib
, pkgsBuildHost
, rust
, stdenv
}:
lib.optionalAttrs stdenv.hostPlatform.isStatic {
ROCKSDB_STATIC = "";
}
//
{
CARGO_BUILD_RUSTFLAGS =
lib.concatStringsSep
" "
([]
# This disables PIE for static builds, which isn't great in terms
# of security. Unfortunately, my hand is forced because nixpkgs'
# `libstdc++.a` is built without `-fPIE`, which precludes us from
# leaving PIE enabled.
++ lib.optionals
stdenv.hostPlatform.isStatic
[ "-C" "relocation-model=static" ]
++ lib.optionals
(stdenv.buildPlatform.config != stdenv.hostPlatform.config)
[ "-l" "c" ]
++ lib.optionals
# This check has to match the one [here][0]. We only need to set
# these flags when using a different linker. Don't ask me why,
# though, because I don't know. All I know is it breaks otherwise.
#
# [0]: https://github.com/NixOS/nixpkgs/blob/5cdb38bb16c6d0a38779db14fcc766bc1b2394d6/pkgs/build-support/rust/lib/default.nix#L37-L40
(
# Nixpkgs doesn't check for x86_64 here but we do, because I
# observed a failure building statically for x86_64 without
# including it here. Linkers are weird.
(stdenv.hostPlatform.isAarch64 || stdenv.hostPlatform.isx86_64)
&& stdenv.hostPlatform.isStatic
&& !stdenv.isDarwin
&& !stdenv.cc.bintools.isLLVM
)
[
"-l"
"stdc++"
"-L"
"${stdenv.cc.cc.lib}/${stdenv.hostPlatform.config}/lib"
]
);
}
# What follows is stolen from [here][0]. Its purpose is to properly
# configure compilers and linkers for various stages of the build, and
# even covers the case of build scripts that need native code compiled and
# run on the build platform (I think).
#
# [0]: https://github.com/NixOS/nixpkgs/blob/5cdb38bb16c6d0a38779db14fcc766bc1b2394d6/pkgs/build-support/rust/lib/default.nix#L57-L80
//
(
let
inherit (rust.lib) envVars;
in
lib.optionalAttrs
(stdenv.targetPlatform.rust.rustcTarget
!= stdenv.hostPlatform.rust.rustcTarget)
(
let
inherit (stdenv.targetPlatform.rust) cargoEnvVarTarget;
in
{
"CC_${cargoEnvVarTarget}" = envVars.ccForTarget;
"CXX_${cargoEnvVarTarget}" = envVars.cxxForTarget;
"CARGO_TARGET_${cargoEnvVarTarget}_LINKER" =
envVars.linkerForTarget;
}
)
//
(
let
inherit (stdenv.hostPlatform.rust) cargoEnvVarTarget rustcTarget;
in
{
"CC_${cargoEnvVarTarget}" = envVars.ccForHost;
"CXX_${cargoEnvVarTarget}" = envVars.cxxForHost;
"CARGO_TARGET_${cargoEnvVarTarget}_LINKER" = envVars.linkerForHost;
CARGO_BUILD_TARGET = rustcTarget;
}
)
//
(
let
inherit (stdenv.buildPlatform.rust) cargoEnvVarTarget;
in
{
"CC_${cargoEnvVarTarget}" = envVars.ccForBuild;
"CXX_${cargoEnvVarTarget}" = envVars.cxxForBuild;
"CARGO_TARGET_${cargoEnvVarTarget}_LINKER" = envVars.linkerForBuild;
HOST_CC = "${pkgsBuildHost.stdenv.cc}/bin/cc";
HOST_CXX = "${pkgsBuildHost.stdenv.cc}/bin/c++";
}
)
)
+108
View File
@@ -0,0 +1,108 @@
# Dependencies (keep sorted)
{ craneLib
, inputs
, lib
, libiconv
, pkgsBuildHost
, rocksdb
, rust
, stdenv
# Options (keep sorted)
, default_features ? true
, features ? []
, profile ? "release"
}:
let
buildDepsOnlyEnv =
let
rocksdb' = rocksdb.override {
enableJemalloc = builtins.elem "jemalloc" features;
};
in
{
CARGO_PROFILE = profile;
ROCKSDB_INCLUDE_DIR = "${rocksdb'}/include";
ROCKSDB_LIB_DIR = "${rocksdb'}/lib";
}
//
(import ./cross-compilation-env.nix {
# Keep sorted
inherit
lib
pkgsBuildHost
rust
stdenv;
});
buildPackageEnv = {
CONDUWUIT_VERSION_EXTRA = inputs.self.shortRev or inputs.self.dirtyShortRev or "";
} // buildDepsOnlyEnv;
commonAttrs = {
inherit
(craneLib.crateNameFromCargoToml {
cargoToml = "${inputs.self}/Cargo.toml";
})
pname
version;
src = let filter = inputs.nix-filter.lib; in filter {
root = inputs.self;
# Keep sorted
include = [
"Cargo.lock"
"Cargo.toml"
"hot_lib"
"src"
];
};
nativeBuildInputs = [
# bindgen needs the build platform's libclang. Apparently due to "splicing
# weirdness", pkgs.rustPlatform.bindgenHook on its own doesn't quite do the
# right thing here.
pkgsBuildHost.rustPlatform.bindgenHook
]
++ lib.optionals stdenv.isDarwin [
# https://github.com/NixOS/nixpkgs/issues/206242
libiconv
# https://stackoverflow.com/questions/69869574/properly-adding-darwin-apple-sdk-to-a-nix-shell
# https://discourse.nixos.org/t/compile-a-rust-binary-on-macos-dbcrossbar/8612
pkgsBuildHost.darwin.apple_sdk.frameworks.Security
];
};
in
craneLib.buildPackage ( commonAttrs // {
cargoArtifacts = craneLib.buildDepsOnly (commonAttrs // {
env = buildDepsOnlyEnv;
});
cargoExtraArgs = ""
+ lib.optionalString
(!default_features)
"--no-default-features "
+ lib.optionalString
(features != [])
"--features " + (builtins.concatStringsSep "," features);
# This is redundant with CI
cargoTestCommand = "";
cargoCheckCommand = "";
doCheck = false;
# https://crane.dev/faq/rebuilds-bindgen.html
NIX_OUTPATH_USED_AS_RANDOM_SEED = "aaaaaaaaaa";
env = buildPackageEnv;
passthru = {
env = buildPackageEnv;
};
meta.mainProgram = commonAttrs.pname;
})
+28
View File
@@ -0,0 +1,28 @@
{ inputs
# Dependencies
, dockerTools
, lib
, main
, stdenv
, tini
}:
dockerTools.buildLayeredImage {
name = main.pname;
tag = "main";
created = "@${toString inputs.self.lastModified}";
contents = [
dockerTools.caCertificates
];
config = {
Entrypoint = if !stdenv.isDarwin
# Use the `tini` init system so that signals (e.g. ctrl+c/SIGINT)
# are handled as expected
then [ "${lib.getExe' tini "tini"}" "--" ]
else [];
Cmd = [
"${lib.getExe main}"
];
};
}
-10
View File
@@ -1,10 +0,0 @@
{
"name": "workspace-root",
"private": true,
"pnpm": {
"patchedDependencies": {
"mdsvex@0.11.2": "patches/mdsvex@0.11.2.patch"
}
},
"packageManager": "pnpm@9.0.6+sha512.f6d863130973207cb7a336d6b439a242a26ac8068077df530d6a86069419853dc1ffe64029ec594a9c505a3a410d19643c870aba6776330f5cfddcf10a9c1617"
}
-2
View File
@@ -1,2 +0,0 @@
dist
node_modules
-43
View File
@@ -1,43 +0,0 @@
{
"name": "remark-callouts",
"version": "1.0.0",
"description": "",
"type": "module",
"main": "dist/index.esm.js",
"exports": {
"import": "./dist/index.esm.js",
"require": "./dist/index.cjs.js",
"types": "./dist/index.d.ts"
},
"types": "dist/index.d.ts",
"scripts": {
"build": "rollup -c",
"prepublish": "rollup -c",
"dev": "rollup -c -w",
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@rollup/plugin-typescript": "^11.1.6",
"@types/mdast": "^4.0.4",
"@types/node": "^20.14.2",
"@types/svg-parser": "^2.0.6",
"@types/trim": "^0.1.3",
"@types/unist": "^3.0.2",
"mdast": "^3.0.0",
"rollup": "^4.18.0",
"rollup-plugin-dts": "^6.1.1",
"unified": "^6.2.0"
},
"files": [
"dist"
],
"dependencies": {
"mdast-util-from-markdown": "^1.3.1",
"svg-parser": "^2.0.4",
"trim": "^0.0.1",
"unist-util-visit": "^4.1.2"
}
}
-20
View File
@@ -1,20 +0,0 @@
// rollup.config.js
import typescript from '@rollup/plugin-typescript';
import { dts } from "rollup-plugin-dts";
import pkg from './package.json' with { type: "json" };
export default [
{
input: 'src/index.ts',
output: [
{ file: pkg.exports.require, format: 'cjs' },
{ file: pkg.exports.import, format: 'es' }
],
plugins: [typescript()]
},
{
input: 'src/index.ts',
output: [{ file: pkg.exports.types, format: 'es' }],
plugins: [dts()],
}
];
-324
View File
@@ -1,324 +0,0 @@
import { visit } from "unist-util-visit";
import { fromMarkdown } from "mdast-util-from-markdown";
// @ts-ignore
import type { Plugin } from "unified";
import type { Node, Data, Parent } from "unist";
import type { Blockquote, Heading, Text, BlockContent } from "mdast";
import { parse } from "svg-parser";
// import { calloutTypes } from "./calloutTypes";
// escape regex special characters
function escapeRegExp(s: string) {
return s.replace(new RegExp(`[-[\\]{}()*+?.\\\\^$|/]`, "g"), "\\$&");
}
import tok from "./tokeniseCallout"
function trim(str: string){
return str.replace(/^\s*|\s*$/g, '');
}
export interface Config {
// classNameMaps: {
// block: ClassNameMap;
// title: ClassNameMap;
// };
// dataMaps: {
// block: (data: Data) => Data;
// title: (data: Data) => Data;
// };
// types: { [index: string]: string | object };
}
export const defaultConfig: Config = {
// classNameMaps: {
// block: "callout",
// title: "callout-title",
// },
// dataMaps: {
// block: (data) => data,
// title: (data) => data,
// },
// types: { ...calloutTypes },
};
type ClassNames = string | string[];
type ClassNameMap = ClassNames | ((title: string) => ClassNames);
function formatClassNameMap(gen: ClassNameMap) {
return (title: string) => {
const classNames = typeof gen == "function" ? gen(title) : gen;
return typeof classNames == "object" ? classNames.join(" ") : classNames;
};
}
export const callouts: Plugin = function (providedConfig?: Partial<Config>) {
const config: Config = { ...defaultConfig, ...providedConfig };
// const defaultKeywords: string = Object.keys(config.types)
// .map(escapeRegExp)
// .join("|");
// @ts-ignore
const Parser = this.Parser
const blockTokenizers = Parser.prototype.blockTokenizers
const blockMethods = Parser.prototype.blockMethods
// console.log(blockMethods, blockTokenizers)
blockTokenizers.callout = tok
// console.log(blockTokenizers.blockquote.toString())
var insertPoint = blockMethods.indexOf('fencedCode') + 1
blockMethods.splice(insertPoint, 0, 'callout')
// @ts-ignore
const Compiler = this.Compiler
if (Compiler != null) {
const visitors = Compiler.prototype.visitors
if (visitors) {
visitors.callout = function (node: { keyword: string; title: string; }) {
var values = this.block(node).split('\n');
var result = [];
var length = values.length;
var index = -1;
var value;
while (++index < length) {
value = values[index];
result[index] = (value ? ' ' : '') + value;
}
return '> [!'+node.keyword+'] ' + node.title + '\n' + result.join('\n>');
}
}
}
// return function (tree) {
// visit(tree, (node: Node, index, parent: Parent) => {
// // Filter required elems
// if (node.type !== "blockquote") return;
// /** add breaks to text without needing spaces or escapes (turns enters into <br>)
// * code taken directly from remark-breaks,
// * see https://github.com/remarkjs/remark-breaks for more info on what this does.
// */
// // visit(node, "text", (node: Text, index: number, parent: Parent) => {
// // const result = [];
// // let start = 0;
// // find.lastIndex = 0;
// // let match = find.exec(node.value);
// // while (match) {
// // const position = match.index;
// // if (start !== position) {
// // result.push({
// // type: "text",
// // value: node.value.slice(start, position),
// // });
// // }
// // result.push({ type: "break" });
// // start = position + match[0].length;
// // match = find.exec(node.value);
// // }
// // if (result.length > 0 && parent && typeof index === "number") {
// // if (start < node.value.length) {
// // result.push({ type: "text", value: node.value.slice(start) });
// // }
// // parent.children.splice(index, 1, ...result);
// // return index + result.length;
// // }
// // });
// /** add classnames to headings within blockquotes,
// * mainly to identify when using other plugins that
// * might interfere. for eg, rehype-auto-link-headings.
// */
// visit(node, "heading", (node) => {
// const heading = node as Heading;
// heading.data = {
// hProperties: {
// className: "blockquote-heading",
// },
// };
// });
// // wrap blockquote in a div
// const wrapper = {
// ...node,
// type: "element",
// tagName: "div",
// data: {
// hProperties: {},
// },
// children: [node],
// };
// parent.children.splice(Number(index), 1, wrapper);
// const blockquote = wrapper.children[0] as Blockquote;
// blockquote.data = {
// hProperties: {
// className: "blockquote",
// },
// };
// console.log(blockquote)
// // check for callout syntax starts here
// if (
// blockquote.children.length <= 0 ||
// blockquote.children[0].type !== "paragraph"
// )
// return;
// const paragraph = blockquote.children[0];
// console.log(paragraph)
// if (
// paragraph.children.length <= 0 ||
// paragraph.children[0].type !== "text"
// )
// return;
// const [t, ...rest] = paragraph.children;
// const regex = new RegExp(
// `^\\[!(?<keyword>(.*?))\\][\t\f ]?(?<title>.*?)$`,
// "gi"
// );
// const m = regex.exec(t.value);
// // if no callout syntax, forget about it.
// if (!m) return;
// const [key, title] = [m.groups?.keyword, m.groups?.title];
// // if there's nothing inside the brackets, is it really a callout ?
// if (!key) return;
// const keyword = key.toLowerCase();
// // const isOneOfKeywords: boolean = new RegExp(defaultKeywords).test(
// // keyword
// // );
// if (title) {
// const mdast = fromMarkdown(title.trim()).children[0];
// if (mdast.type === "heading") {
// mdast.data = {
// ...mdast.data,
// hProperties: {
// className: "blockquote-heading",
// },
// };
// }
// blockquote.children.unshift(mdast as BlockContent);
// } else {
// t.value =
// typeof keyword.charAt(0) === "string"
// ? keyword.charAt(0).toUpperCase() + keyword.slice(1)
// : keyword;
// }
// const entry: { [index: string]: string } = {};
// // if (isOneOfKeywords) {
// // if (typeof config?.types[keyword] === "string") {
// // const e = String(config?.types[keyword]);
// // Object.assign(entry, config?.types[e]);
// // } else {
// // Object.assign(entry, config?.types[keyword]);
// // }
// // } else {
// // Object.assign(entry, config?.types["note"]);
// // }
// let parsedSvg;
// if (entry && entry.svg) {
// parsedSvg = parse(entry.svg);
// }
// // create icon and title node wrapped in div
// const titleNode: object = {
// type: "element",
// children: [
// {
// type: "element",
// tagName: "span",
// data: {
// hName: "span",
// hProperties: {
// style: `color:${entry?.color}`,
// className: "callout-icon",
// },
// hChildren: parsedSvg?.children ? parsedSvg.children : [],
// },
// },
// {
// type: "element",
// children: title ? [blockquote.children[0]] : [t],
// data: {
// hName: "strong",
// },
// },
// ],
// data: {
// ...blockquote.children[0]?.data,
// hProperties: {
// className: `${formatClassNameMap(config.classNameMaps.title)(
// keyword
// )} ${"note"}`,
// style: `background-color: ${entry?.color}1a;`,
// },
// },
// };
// // remove the callout paragraph from the content body
// if (title) {
// blockquote.children.shift();
// }
// if (rest.length > 0) {
// rest.shift();
// paragraph.children = rest;
// } else {
// blockquote.children.shift();
// }
// // wrap blockquote content in div
// const contentNode: object = {
// type: "element",
// children: blockquote.children,
// data: {
// hProperties: {
// className: "callout-content",
// style:
// parent.type !== "root"
// ? `border-right:1px solid ${entry?.color}33;
// border-bottom:1px solid ${entry?.color}33;`
// : "",
// },
// },
// };
// if (blockquote.children.length > 0)
// blockquote.children = [contentNode] as BlockContent[];
// blockquote.children.unshift(titleNode as BlockContent);
// // Add classes for the callout block
// blockquote.data = config.dataMaps.block({
// ...blockquote.data,
// hProperties: {
// className: formatClassNameMap(config.classNameMaps.block)(
// keyword.toLowerCase()
// ),
// style: `border-left-color:${entry?.color};`,
// },
// });
// });
// };
};
export default callouts;
@@ -1,245 +0,0 @@
'use strict';
import trim from "trim";
export default blockquote;
var C_NEWLINE = '\n';
var C_TAB = '\t';
var C_SPACE = ' ';
var C_GT = '>';
// TODO:
// - Grow/shrink support
// - Customise AST output
/* Tokenise a blockquote. */
function blockquote(eat: { (arg0: string): any; (arg0: string): any; now: any; }, value: string, silent: boolean) {
var self = this;
var offsets = self.offset;
var tokenizers = self.blockTokenizers;
var interruptors = [
['indentedCode', { commonmark: true }],
['fencedCode', { commonmark: true }],
['atxHeading', { commonmark: true }],
['setextHeading', { commonmark: true }],
['thematicBreak', { commonmark: true }],
['html', { commonmark: true }],
['list', { commonmark: true }],
['definition', { commonmark: false }],
['footnote', { commonmark: false }]
];
var now = eat.now();
var currentLine = now.line;
var length = value.length;
var values = [];
var contents = [];
var indents = [];
var add;
var index = 0;
var character;
var rest;
var nextIndex;
var content;
var line;
var startIndex;
var prefixed;
var exit;
while (index < length) {
character = value.charAt(index);
if (character !== C_SPACE && character !== C_TAB) {
break;
}
index++;
}
if (value.charAt(index) !== C_GT) {
return;
}
const regex = /^>\s*\[!(?<keyword>(.*?))\][\t\f ]?(?<title>.*?)$/i;
nextIndex = value.indexOf(C_NEWLINE, index);
content = value.slice(index, nextIndex);
const m = regex.exec(content); // value.slice(index)
if (!m) {
return;
}
if (!m.groups?.keyword) return;
if (silent) {
return true;
}
index = 0;
let titleLine = true
while (index < length) {
nextIndex = value.indexOf(C_NEWLINE, index);
startIndex = index;
prefixed = false;
if (nextIndex === -1) {
nextIndex = length;
}
while (index < length) {
character = value.charAt(index);
if (character !== C_SPACE && character !== C_TAB) {
break;
}
index++;
}
if (value.charAt(index) === C_GT) {
index++;
prefixed = true;
if (value.charAt(index) === C_SPACE) {
index++;
}
} else {
index = startIndex;
}
// regex.lastIndex = index
content = value.slice(index, nextIndex);
if (!prefixed && !trim(content)) {
index = startIndex;
break;
}
if (!prefixed) {
rest = value.slice(index);
/* Check if the following code contains a possible
* block. */
if (interrupt(interruptors, tokenizers, self, [eat, rest, true])) {
break;
}
}
line = startIndex === index ? content : value.slice(startIndex, nextIndex);
indents.push(index - startIndex);
values.push(line);
if (titleLine) {
titleLine = false
} else {
contents.push(content);
}
index = nextIndex + 1;
}
index = -1;
length = indents.length;
add = eat(values.join(C_NEWLINE));
while (++index < length) {
offsets[currentLine] = (offsets[currentLine] || 0) + indents[index];
currentLine++;
}
exit = self.enterBlock();
const title = self.tokenizeInline(m.groups?.title, now);
contents = self.tokenizeBlock(contents.join(C_NEWLINE), now);
exit();
// console.log(title,)
return add({
type: 'callout',
children: [{
type: "heading",
children: title,
data: { hName: 'svelte:fragment',
hProperties: {
slot: "title"
} }
}, {
type: "block",
children: contents,
data: { hName: 'svelte:fragment',
hProperties: {
slot: "body"
} }
}],
keyword: m.groups?.keyword,
data: {
hName: 'Components.Callout',
hProperties: {
"calloutType": m.groups?.keyword
},
}
});
// return add({
// type: 'callout',
// children: [{
// type: "heading",
// children: title,
// data: { hName: 'div',
// hProperties: {
// className: "callout-title"
// } }
// }, {
// type: "block",
// children: contents,
// data: { hName: 'div',
// hProperties: {
// className: "callout-content"
// } }
// }],
// keyword: m.groups?.keyword,
// data: {
// hName: 'div',
// hProperties: {
// className: "callout",
// "data-callout": m.groups?.keyword
// },
// }
// });
}
function interrupt(interruptors, tokenizers, ctx, params) {
var bools = ['pedantic', 'commonmark'];
var count = bools.length;
var length = interruptors.length;
var index = -1;
var interruptor;
var config;
var fn;
var offset;
var bool;
var ignore;
while (++index < length) {
interruptor = interruptors[index];
config = interruptor[1] || {};
fn = interruptor[0];
offset = -1;
ignore = false;
while (++offset < count) {
bool = bools[offset];
if (config[bool] !== undefined && config[bool] !== ctx.options[bool]) {
ignore = true;
break;
}
}
if (ignore) {
continue;
}
if (tokenizers[fn].apply(ctx, params)) {
return true;
}
}
return false;
}
-14
View File
@@ -1,14 +0,0 @@
{
"compilerOptions": {
"target": "es2020",
"module": "esnext",
"strict": true,
"esModuleInterop": true,
"moduleResolution": "node",
"skipLibCheck": true,
"noImplicitAny": true,
"allowJs": true,
"noEmit": true,
"resolveJsonModule": true
}
}
@@ -1,2 +0,0 @@
dist
node_modules
@@ -1,38 +0,0 @@
{
"name": "vite-plugin-thumbhash-svg",
"version": "1.0.0",
"description": "",
"type": "module",
"main": "dist/index.esm.js",
"exports": {
"import": "./dist/index.esm.js",
"require": "./dist/index.cjs.js",
"types": "./dist/index.d.ts"
},
"types": "dist/index.d.ts",
"scripts": {
"build": "rollup -c",
"prepublish": "rollup -c",
"dev": "rollup -c -w",
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@rollup/plugin-typescript": "^11.1.6",
"@types/node": "^20.14.2",
"rollup": "^4.18.0",
"rollup-plugin-dts": "^6.1.1",
"vite": "^5.3.1"
},
"files": [
"dist"
],
"dependencies": {
"@napi-rs/canvas": "^0.1.53",
"@resvg/resvg-js": "^2.6.2",
"@rollup/pluginutils": "^5.1.0",
"thumbhash-node": "^0.1.3"
}
}
@@ -1,20 +0,0 @@
// rollup.config.js
import typescript from '@rollup/plugin-typescript';
import { dts } from "rollup-plugin-dts";
import pkg from './package.json' with { type: "json" };
export default [
{
input: 'src/index.ts',
output: [
{ file: pkg.exports.require, format: 'cjs' },
{ file: pkg.exports.import, format: 'es' }
],
plugins: [typescript()]
},
{
input: 'src/index.ts',
output: [{ file: pkg.exports.types, format: 'es' }],
plugins: [dts()],
}
];
@@ -1,236 +0,0 @@
import { createFilter } from '@rollup/pluginutils'
import { basename } from 'node:path'
import { relative } from 'node:path/posix'
import { readFile, access } from 'node:fs/promises'
import { constants } from 'node:fs'
import { extname } from 'node:path';
import { loadImage, createCanvas, ImageData } from '@napi-rs/canvas'
import { Resvg } from '@resvg/resvg-js'
import { rgbaToThumbHash, thumbHashToRGBA } from 'thumbhash-node'
import type { Plugin, ResolvedConfig } from 'vite'
export type OutputExtension = 'png' | 'jpg' | 'webp' | 'avif'
export type Options =
| {
include?: Array<string | RegExp> | string | RegExp
exclude?: Array<string | RegExp> | string | RegExp
outputExtension?: OutputExtension
}
| undefined
interface LoaderParams {
thumbSrc: string
thumbWidth: number
thumbHeight: number
originalSrc: string
originalWidth: number
originalHeight: number
}
const loader = (params: LoaderParams) => {
return `export default ${JSON.stringify(params)}`
}
async function loadImageAndConvertToRgba(path: string) {
const maxSize = 100
const imgPath = path
let image;
// console.log(path, extname(path))
if (extname(path) === ".svg") {
const svg = await readFile(imgPath);
const resvg = new Resvg(svg)
const render = resvg.render()
image = await loadImage(render.asPng())
} else {
// canvas handles all file loading for us
image = await loadImage(imgPath)
}
const width = image.width
const height = image.height
const scale = maxSize / Math.max(width, height)
const resizedWidth = Math.round(width * scale)
const resizedHeight = Math.round(height * scale)
const canvas = createCanvas(resizedWidth, resizedHeight)
const ctx = canvas.getContext('2d')
ctx.drawImage(image, 0, 0, resizedWidth, resizedHeight)
const imageData = ctx.getImageData(0, 0, resizedWidth, resizedHeight)
const rgba = new Uint8Array(imageData.data)
return {
originalWidth: width,
originalHeight: height,
height: imageData.height,
width: imageData.width,
rgba,
}
}
const fromRGBAToImageBuffer = (
rgba: Uint8Array,
mimeType: MimeType,
width: number,
height: number
) => {
const thumb = rgbaToThumbHash(width, height, rgba)
const transformedRgba = thumbHashToRGBA(thumb)
const imageData = new ImageData(
new Uint8ClampedArray(transformedRgba.rgba),
transformedRgba.width,
transformedRgba.height
)
const canvas = createCanvas(transformedRgba.width, transformedRgba.height)
const context = canvas.getContext('2d')
//@ts-ignore
context.putImageData(imageData, 0, 0)
//@ts-ignore
const buffer = canvas.toBuffer(mimeType)
return buffer
}
type MimeType = 'image/webp' | 'image/jpeg' | 'image/avif' | 'image/png'
const extToMimeTypeMap: Record<OutputExtension, MimeType> = {
avif: 'image/avif',
jpg: 'image/jpeg',
png: 'image/png',
webp: 'image/webp',
}
export const blurRE = /(?:\?|&)th(umb)?(?:&|$)/
const isThumbHash = (id: string) => {
return !!id.match(blurRE)
}
const cleanId = (id: string) => id.replace(blurRE, '')
const buildViteAsset = (referenceId: string) => `__VITE_ASSET__${referenceId}__`
const buildDataURL = (buf: Buffer, mimeType: MimeType) => {
const dataPrefix = `data:${mimeType};base64,`
const dataURL = `${dataPrefix}${buf.toString('base64')}`
return dataURL
}
async function exists(path: string) {
try {
await access(path, constants.F_OK)
return true
} catch {
return false
}
}
const thumbHash = (options: Options = {}): Plugin => {
const { include, exclude, outputExtension = 'png' } = options
const bufferMimeType = extToMimeTypeMap[outputExtension]
const filter = createFilter(include, exclude)
let config: ResolvedConfig
const cache = new Map<string, importItem>()
type importItem = {
thumbSrc: string;
thumbWidth: number;
thumbHeight: number;
originalSrc: string;
originalWidth: number;
originalHeight: number;
}
return {
name: 'vite-plugin-thumbhash',
enforce: 'pre',
configResolved(cfg) {
config = cfg
},
async load(id) {
if (!filter(id)) {
return null
}
if (isThumbHash(id)) {
const cleanedId = cleanId(id)
if (cache.has(id)) {
let loadedSource = cache.get(id) as importItem
if (config.command !== 'serve') {
const originalRefId = this.emitFile({
type: 'asset',
name: basename(cleanedId),
source: await readFile(cleanedId),
})
loadedSource.originalSrc = buildViteAsset(originalRefId);
}
return loader(loadedSource)
}
const { rgba, width, height, originalHeight, originalWidth } =
await loadImageAndConvertToRgba(cleanedId)
const buffer = fromRGBAToImageBuffer(
rgba,
bufferMimeType,
width,
height
)
const dataURL = buildDataURL(buffer, bufferMimeType)
// const referenceId = this.emitFile({
// type: 'asset',
// name: basename(cleanedId).replace(
// /\.(jpg)|(jpeg)|(png)|(webp)|(avif)|(svg)/g,
// `.${outputExtension}`
// ),
// source: buffer,
// })
const originalSrc = relative(config.root, cleanedId);
const loadedSource = {
thumbSrc: dataURL,
thumbWidth: width,
thumbHeight: height,
originalSrc,
originalWidth: originalWidth,
originalHeight: originalHeight,
}
cache.set(id, loadedSource)
if (config.command !== 'serve') {
const originalRefId = this.emitFile({
type: 'asset',
name: basename(cleanedId),
source: await readFile(cleanedId),
})
loadedSource.originalSrc = buildViteAsset(originalRefId);
}
return loader(loadedSource)
// import.meta.ROLLUP_FILE_URL_
}
return null
},
}
}
export { thumbHash }
@@ -1,14 +0,0 @@
{
"compilerOptions": {
"target": "es2020",
"module": "esnext",
"strict": true,
"esModuleInterop": true,
"moduleResolution": "node",
"skipLibCheck": true,
"noImplicitAny": true,
"allowJs": true,
"noEmit": true,
"resolveJsonModule": true
}
}
-14
View File
@@ -1,14 +0,0 @@
.DS_Store
node_modules
/build
/.svelte-kit
/package
.env
.env.*
!.env.example
.vercel
.output
vite.config.js.timestamp-*
vite.config.ts.timestamp-*
output
Dockerfile
-20
View File
@@ -1,20 +0,0 @@
.DS_Store
node_modules
/build
/.svelte-kit
/package
.env.sentry-build-plugin
.env
.env.*.local
!.env.example
.vercel
.output
vite.config.js.timestamp-*
vite.config.ts.timestamp-*
output
Notes-1.0.0.tgz
# Sentry Config File
.sentryclirc
# Sentry Config File
.env.sentry-build-plugin
-1
View File
@@ -1 +0,0 @@
engine-strict=true
-33
View File
@@ -1,33 +0,0 @@
# build the sapper app
FROM node:latest AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
ENV CI=1
RUN corepack enable
COPY ./../.. /app/
WORKDIR /app
# FROM base AS prod-deps
# RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile
FROM base AS deps
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
# RUN cd packages/website; --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
FROM deps as build
ENV NODE_OPTIONS="--max-old-space-size=4096"
RUN cd packages/website; pnpm run build
RUN cd packages/website; node server-esbuild.js
FROM node:alpine
WORKDIR /app
COPY --from=build /app/packages/website/output .
COPY --from=build /app/packages/website/build/client ./client/
COPY --from=build /app/packages/website/build/prerendered ./prerendered/
COPY --from=base /app/packages/website/package.json ./package.json
ENV NODE_ENV production
EXPOSE 3000
CMD ["node", "."]
-44
View File
@@ -1,44 +0,0 @@
<div
style={{
display: 'flex',
height: '100%',
width: '100%',
padding: '10px 20px',
// alignItems: 'center',
justifyContent: 'center',
flexDirection: 'column',
backgroundImage: 'linear-gradient(to bottom, #dbf4ff, #eff3fc)',
fontSize: 60,
// letterSpacing: -2,
fontWeight: 700,
// textAlign: 'center',
}}
>
<div style={{
fontSize: 15,
fontWeight: 600,
textTransform: 'uppercase',
letterSpacing: 1,
margin: '25px 0 10px',
color: 'gray',
}}>jade.ellis.link
</div>
<div
style={{
backgroundImage: 'linear-gradient(90deg, rgb(30, 42, 85), rgb(22, 61, 120))',
backgroundClip: 'text',
'-webkit-background-clip': 'text',
color: 'transparent',
}}>The Potential Pitfalls of Pagination</div>
<aside style={{
fontSize: 20,
fontWeight: 500,
color:'#202020',
margin: '10px 0 10px',
}}>
Published on
· By Jade Ellis
· 4 min read
</aside>
</div>
-30
View File
@@ -1,30 +0,0 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.0/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
},
"files": {
"ignoreUnknown": false,
"ignore": []
},
"formatter": {
"enabled": true,
"indentStyle": "tab"
},
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
},
"javascript": {
"formatter": {
"quoteStyle": "double"
}
}
}
-68
View File
@@ -1,68 +0,0 @@
const rootDomain = process.env.VITE_DOMAIN; // or your server IP for dev
import { SENTRY_HOST } from './src/lib/config.js';
import { SENTRY_REPORT_URL } from './src/lib/config.js';
const self = "'self'";
const none = "'none'";
/**
* @type {import("@sveltejs/kit").CspDirectives}
*/
const cspDirectives = {
'base-uri': [self],
'child-src': [self, "blob:"],
'connect-src': [self, "https://*.google-analytics.com", "https://" + SENTRY_HOST],
// 'connect-src': [self, 'ws://localhost:*', 'https://hcaptcha.com', 'https://*.hcaptcha.com'],
'img-src': [self, 'data:',
'https://*.googletagmanager.com'],
'font-src': [self, 'data:'],
'form-action': [self],
'frame-ancestors': [self],
'frame-src': [
self,
// "https://*.stripe.com",
// "https://*.facebook.com",
// "https://*.facebook.net",
// 'https://hcaptcha.com',
// 'https://*.hcaptcha.com',
],
'manifest-src': [self],
'media-src': [self, 'data:'],
'object-src': [none],
'style-src': [self, "unsafe-inline"],
// 'style-src': [self, "'unsafe-inline'", 'https://hcaptcha.com', 'https://*.hcaptcha.com'],
'default-src': [
'self',
...(rootDomain ? [rootDomain, `ws://${rootDomain}`] : []),
// 'https://*.google.com',
// 'https://*.googleapis.com',
// 'https://*.firebase.com',
// 'https://*.gstatic.com',
// 'https://*.cloudfunctions.net',
// 'https://*.algolia.net',
// 'https://*.facebook.com',
// 'https://*.facebook.net',
// 'https://*.stripe.com',
// 'https://*.sentry.io',
],
'script-src': [
self,
// "unsafe-inline", // chrome suggestion
'https://*.googletagmanager.com'
// 'https://*.stripe.com',
// 'https://*.facebook.com',
// 'https://*.facebook.net',
// 'https://hcaptcha.com',
// 'https://*.hcaptcha.com',
// 'https://*.sentry.io',
// 'https://polyfill.io',
],
'worker-src': [self, "blob:"],
// remove report-to & report-uri if you do not want to use Sentry reporting
'report-to': ["csp-endpoint"],
'report-uri': [
SENTRY_REPORT_URL,
],
};
export default cspDirectives;
-387
View File
@@ -1,387 +0,0 @@
// https://github.com/String10/Hakuba/blob/master/package.json
// import { defineMDSveXConfig as defineConfig } from "mdsvex";
// import type { Plugin, Settings } from 'unified';
import remarkGfm from "remark-gfm";
import remarkFrontmatter from "remark-frontmatter";
import remarkWikiLink from "remark-wiki-link";
import remarkMath from "remark-math"
// @ts-ignore
import remarkAbbr from "remark-abbr"
import remarkFootnotes from 'remark-footnotes'
import remarkCallouts from "remark-callouts";
import rehypeKatexSvelte from 'rehype-katex-svelte';
// import github from "remark-github";
import rehypeSlug from 'rehype-slug';
import remarkReadingTime from "remark-reading-time";
// import rehypeToc from '@jsdevtools/rehype-toc';
import { createHighlighter } from "@bitmachina/highlighter";
import { parse, format } from "node:path";
import slugify from 'slugify';
export const NOTE_ICON = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="2" x2="22" y2="6"></line><path d="M7.5 20.5 19 9l-4-4L3.5 16.5 2 22z"></path></svg>';
export const QUOTE_ICON = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 21c3 0 7-1 7-8V5c0-1.25-.756-2.017-2-2H4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2 1 0 1 0 1 1v1c0 1-1 2-2 2s-1 .008-1 1.031V20c0 1 0 1 1 1z"></path><path d="M15 21c3 0 7-1 7-8V5c0-1.25-.757-2.017-2-2h-4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2h.75c0 2.25.25 4-2.75 4v3c0 1 0 1 1 1z"></path></svg>';
export const INFO_ICON = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="16" x2="12" y2="12"></line><line x1="12" y1="8" x2="12.01" y2="8"></line></svg>';
export const ICONS = {
note: NOTE_ICON,
quote: QUOTE_ICON,
info: INFO_ICON,
};
import { globSync } from 'glob'
import { readFileSync } from "node:fs";
import { fileURLToPath } from "node:url";
const projects = globSync('node_modules/Notes/Projects/*.md')
.map((filepath) => {
return parse(filepath)
})
.map((path) => {
return format({
// ...path,
name: slugify(path.name, { lower: true }),
// base: undefined,
// root: "",
// ext: undefined,
// dir: path.dir.replace("/node_modules/Notes/Projects", "")
})
})
/**
* @type {string[]}
*/
const permalinks = projects.map((p) => "/projects/" + p)
// console.log(permalinks)
/**
* @param {string} pageName
* @returns {string[]}
*/
function pageResolver(pageName) {
const slug = slugify(pageName, { lower: true });
return ["/", "/projects/"].map((p) => p + slug);
}
import { grammars } from 'tm-grammars'
// console.log()
/**
* @param {string} name
*/
function getGrammar(name) {
const metadata = grammars.find((grammar) => grammar.name == name)
if (!metadata) {
throw "Grammar not found"
}
return {
...metadata,
id: name,
grammar: JSON.parse(readFileSync(fileURLToPath(import.meta.resolve('tm-grammars/grammars/' + name + '.json')), 'utf8')),
}
}
const hrefTemplate = (/** @type {string} */ permalink) => permalink
// function customizeTOC(toc) {
// // console.log(toc)
// return {
// type: 'root',
// children: [{
// type: "element",
// // tagName: "svelte:component",
// // properties: { this: "{tocComponent}" },
// tagName: "div",
// properties: {},
// children: [toc],
// }]
// };
// }
/**
* @param {{level: number, title: string}[]} headings
*/
function buildNestedHeadings(headings) {
/**
* @type {{level: number, title: string, children: unknown}[]}
*/
const result = [];
const stack = [{ level: 0, children: result }];
for (const heading of headings) {
while (
stack.length > 1 &&
heading.level <= stack[stack.length - 1].level
) {
stack.pop();
}
const parent = stack[stack.length - 1];
const newHeading = {
...heading,
children: [],
level: heading.level,
};
parent.children.push(newHeading);
stack.push(newHeading);
}
return result;
}
import { visit } from 'unist-util-visit';
import { toString as mdast_tree_to_string } from 'mdast-util-to-string'
import GithubSlugger from 'github-slugger'
/**
* @param {{ prefix?: string; }} opts
*/
function add_toc_remark(opts) {
const slugs = new GithubSlugger()
const prefix = opts?.prefix || "";
return async function transformer(tree, vFile) {
slugs.reset()
vFile.data.flattenedHeadings = [];
visit(tree, 'heading', (node) => {
const title = mdast_tree_to_string(node);
vFile.data.flattenedHeadings.push({
level: node.depth,
title,
id: prefix + slugs.slug(title)
});
});
if (!vFile.data.fm) vFile.data.fm = {};
vFile.data.fm.flattenedHeadings = vFile.data.flattenedHeadings;
vFile.data.fm.headings = buildNestedHeadings(vFile.data.flattenedHeadings);
};
}
function add_data_to_fm(_opts) {
return async function transformer(tree, vFile) {
if (!vFile.data.fm) vFile.data.fm = {};
vFile.data.fm.readingTime = vFile.data.readingTime;
};
}
import { toString as hast_tree_to_string } from 'hast-util-to-string'
/**
* Determines whether the given node is an HTML element.
*/
function isHtmlElementNode(node) {
return typeof node === "object" &&
node.type === "element" &&
typeof node.tagName === "string" &&
"properties" in node &&
typeof node.properties === "object";
}
const HEADINGS = ["h1", "h2", "h3", "h4", "h5", "h6"]
/**
* Determines whether the given node is an HTML heading node, according to the specified options
*/
function isHeadingNode(node) {
return isHtmlElementNode(node) && HEADINGS.includes(node.tagName);
}
function add_toc_rehype(self, opts) {
return async function transformer(tree, vFile) {
// console.log(tree)
vFile.data.headings = [];
visit(tree, isHeadingNode, (node) => {
// console.log(node)
vFile.data.headings.push({
level: node.depth,
title: hast_tree_to_string(node),
});
});
if (!vFile.data.fm) vFile.data.fm = {};
vFile.data.fm.headings = vFile.data.headings;
};
}
import toCamel from "just-camel-case";
const RE_SCRIPT_START =
/<script(?:\s+?[a-zA-z]+(=(?:["']){0,1}[a-zA-Z0-9]+(?<!module)(?:["']){0,1}){0,1})*\s*?>/;
function vite_images_rehype(opts) {
return async function transformer(tree, vFile) {
const urls = new Map();
const url_count = new Map();
/**
* @param {string} url
*/
function transformUrl(url) {
// url = decodeURIComponent(url)
// console.log("decoded", url)
// filenames can start with digits,
// prepend underscore to guarantee valid module name
let camel = `_${toCamel(url)}`;
const count = url_count.get(camel);
const dupe = urls.get(url);
if (count && !dupe) {
url_count.set(camel, count + 1);
camel = `${camel}_${count}`;
} else if (!dupe) {
url_count.set(camel, 1);
}
urls.set(url, {
path: url,
id: camel
});
return camel;
}
// console.log(tree)
// vFile.data.headings = [];
// console.log(tree)
visit(tree, { tagName: "img" }, (node) => {
let url = node.properties.src;
url = (url.includes("?") ? url + "&" : url + "?") + "url";
node.properties.src = `{${transformUrl(url)}}`
// new URL('./img.png', import.meta.url).href
// vFile.data.headings.push({
// level: node.depth,
// title: hast_tree_to_string(node),
// });
});
visit(tree, { tagName: "Components.img" }, (node) => {
let url = node.properties.src;
const thumb = (url.includes("?") ? url + "&" : url + "?") + "thumb";
url = (url.includes("?") ? url + "&" : url + "?") + "url";
node.properties.src = `{${transformUrl(url)}}`
node.properties.thumb = `{${transformUrl(thumb)}}`
// node.properties.src = `{new URL('${url}', import.meta.url)}`
// new URL('./img.png', import.meta.url).href
// vFile.data.headings.push({
// level: node.depth,
// title: hast_tree_to_string(node),
// });
});
let scripts = "";
urls.forEach((x) => (scripts += `import ${x.id} from "./${x.path}";\n`));
// urls.forEach((x) => (scripts += `const ${x.id} = new URL("${x.path}", import.meta.url);\n`));
// console.log(scripts)
// urls.forEach((x) => {
// if (x.meta) {
// let a = ["src", "width", "height"]
// scripts += `import {${a.map((a) => a + " as " + x.id + "_" + a).join(",")}} from "${x.path.includes("?") ? x.path + "&as=metadata" : x.path + "?as=metadata:src;width;height"}";\n`
// }
// });
let is_script = false;
visit(tree, { type: "raw" }, (node) => {
// console.log(node)
if (RE_SCRIPT_START.test(node.value)) {
// console.log("inserting")
is_script = true;
node.value = node.value.replace(RE_SCRIPT_START, (script) => {
return `${script}\n${scripts}`;
});
}
});
if (!is_script) {
tree.children.push({
type: 'raw',
value: `<script>\n${scripts}</script>`,
})
}
};
}
/**
* @type {import("mdsvex").MdsvexOptions}
*/
const config = {
extensions: [".svelte.md", ".md", ".svx"],
// fences: true,
// ruleSpaces: false,
smartypants: {
dashes: "oldschool",
},
layout: {
_: "./src/lib/mdlayouts/default.svelte"
},
highlight: {
// @ts-ignore
highlighter: await createHighlighter({ theme: "github-dark", langs: ["http", "jsx", "javascript", "typescript", "rust"].map(getGrammar) }),
alias: {
ts: "typescript",
mdx: "markdown",
svelte: "svelte",
svx: "svx",
mdsvex: "svx",
sig: "ts",
}
},
remarkPlugins: [
// remarkFrontmatter,
// [github, {repository}],
remarkMath,
remarkAbbr,
[remarkFootnotes, { inlineNotes: true }],
remarkGfm,
[remarkCallouts, {}],
[remarkWikiLink, {
// @ts-ignore
aliasDivider: "|",
permalinks,
pageResolver,
hrefTemplate,
// wikiLinkClassName,
// newClassName,
}],
// [citePlugin, {
// syntax: {
// // see micromark-extension-cite
// enableAltSyntax: false,
// enablePandocSyntax: true,
// },
// toMarkdown: {
// // see mdast-util-cite
// standardizeAltSyntax: false,
// enableAuthorSuppression: true,
// useNodeValue: false,
// },
// }],
// [remarkBibliography, { bibliography }],
// [remarkMermaid, {}]
remarkReadingTime,
add_data_to_fm,
[add_toc_remark, { prefix: "h-" }]
],
rehypePlugins: [
// @ts-ignore
rehypeKatexSvelte,
// @ts-ignore
[rehypeSlug, { prefix: "h-" }],
vite_images_rehype
],
};
export default config;
-111
View File
@@ -1,111 +0,0 @@
{
"name": "website",
"version": "0.0.1",
"scripts": {
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"fix": "biome lint --write . && biome format --write . && biome check . --write"
},
"devDependencies": {
"@biomejs/biome": "1.9.4",
"@bitmachina/highlighter": "1.0.0-alpha.6",
"@fontsource/fira-mono": "^5.1.0",
"@json-feed-types/1_1": "^1.0.2",
"@rollup/pluginutils": "^5.1.3",
"@sentry/esbuild-plugin": "^2.22.6",
"@sveltejs/adapter-auto": "^3.3.1",
"@sveltejs/adapter-node": "^5.2.9",
"@sveltejs/kit": "^2.8.2",
"@sveltejs/vite-plugin-svelte": "^4.0.1",
"@types/fnv-plus": "^1.3.2",
"@types/node": "^20.17.7",
"@types/polka": "^0.5.7",
"@types/sharedworker": "^0.0.115",
"dotenv": "^16.4.5",
"esbuild": "^0.23.1",
"github-slugger": "^2.0.0",
"glob": "^10.4.5",
"hast-util-to-string": "^3.0.1",
"just-camel-case": "^6.2.0",
"mdast-util-to-string": "^4.0.0",
"mdsvex": "^0.11.2",
"rehype-katex-svelte": "~1.2.0",
"rehype-slug": "^6.0.0",
"remark-abbr": "^1.4.2",
"remark-callouts": "workspace:^",
"remark-footnotes": "^2.0.0",
"remark-frontmatter": "^5.0.0",
"remark-gfm": "^4.0.0",
"remark-github": "^12.0.0",
"remark-math": "^3.0.1",
"remark-reading-time": "^2.0.1",
"remark-wiki-link": "^0.0.4",
"rollup": "^4.27.4",
"rollup-plugin-type-as-json-schema": "^0.2.6",
"rollup-plugin-visualizer": "^5.12.0",
"schema-dts": "^1.1.2",
"sharp": "^0.33.5",
"svelte": "^5.2.7",
"svelte-check": "^4.1.0",
"svelte-seo": "^1.6.1",
"sveltekit-html-minifier": "^1.0.4",
"svgo": "^3.3.2",
"tm-grammars": "^1.19.5",
"tslib": "^2.8.1",
"typescript": "^5.7.2",
"unified": "^11.0.5",
"unist-util-visit": "^5.0.0",
"vite": "^5.4.2",
"vite-plugin-image-optimizer": "^1.1.8",
"vite-plugin-thumbhash": "^0.1.6",
"vite-plugin-thumbhash-svg": "workspace:^"
},
"type": "module",
"dependencies": {
"@babel/preset-typescript": "^7.26.0",
"@codemirror/commands": "^6.7.1",
"@codemirror/lang-javascript": "^6.2.2",
"@codemirror/language": "^6.10.3",
"@codemirror/lint": "^6.8.3",
"@codemirror/state": "^6.4.1",
"@codemirror/view": "^6.35.0",
"@isaacs/ttlcache": "^1.4.1",
"@lezer/highlight": "^1.2.1",
"@octokit/types": "^13.6.1",
"@resvg/resvg-js": "^2.6.2",
"@sentry/sveltekit": "^8.40.0",
"@steeze-ui/svelte-icon": "^1.6.2",
"@tabler/icons-svelte": "^3.22.0",
"@tusbar/cache-control": "^1.0.2",
"@uiw/codemirror-theme-github": "^4.23.6",
"Notes": "file:Notes-1.0.0.tgz",
"acorn": "^8.14.0",
"codemirror": "^6.0.1",
"fnv-plus": "^1.3.1",
"magic-string": "^0.30.13",
"octokit": "^3.2.1",
"satori": "^0.10.14",
"slugify": "^1.6.6",
"super-sitemap": "^0.14.20",
"svelte-codemirror-editor": "^1.4.1",
"terser": "^5.36.0",
"xmlbuilder2": "^3.1.1"
},
"targets": {
"module": {
"context": "node",
"engines": {
"node": ">= 20"
},
"outputFormat": "esmodule",
"optimize": true,
"includeNodeModules": true
}
},
"@parcel/resolver-default": {
"packageExports": true
}
}
-60
View File
@@ -1,60 +0,0 @@
import { sentryEsbuildPlugin } from "@sentry/esbuild-plugin";
import esbuild from "esbuild";
// https://github.com/evanw/esbuild/pull/2067
const ESM_REQUIRE_SHIM = `
await (async () => {
const { dirname } = await import("path");
const { fileURLToPath } = await import("url");
/**
* Shim entry-point related paths.
*/
if (typeof globalThis.__filename === "undefined") {
globalThis.__filename = fileURLToPath(import.meta.url);
}
if (typeof globalThis.__dirname === "undefined") {
globalThis.__dirname = dirname(globalThis.__filename);
}
/**
* Shim require if needed.
*/
if (typeof globalThis.require === "undefined") {
const { default: module } = await import("module");
globalThis.require = module.createRequire(import.meta.url);
}
})();
`;
const banner = {
"js": ESM_REQUIRE_SHIM
};
esbuild.build({
sourcemap: true, // Source map generation must be turned on
platform: "node", // Node.js platform
target: "node22.0", // Node.js version
entryPoints: ["./build/index.js"], // Entry point file
outdir: "./output", // Output directory
bundle: true, // Generate an external bundle
splitting: true, // Enable code splitting
format: "esm", // Output format
loader: {
".node": "copy",
},
alias: {
"perf_hooks": "node:perf_hooks",
},
banner,
plugins: [
// Put the Sentry esbuild plugin after all other plugins
sentryEsbuildPlugin({
org: "jade-ellis",
project: "jade-website-sveltekit",
authToken: process.env.SENTRY_AUTH_TOKEN,
sourcemaps: {
// Specify the directory containing build artifacts
assets: "./output/**",
}
}),
],
});
-15
View File
@@ -1,15 +0,0 @@
// See https://kit.svelte.dev/docs/types#app
// for information about these interfaces
import type { Middleware } from "polka"
type Req = Parameters<Middleware>[0]
declare global {
namespace App {
// interface Error {}
// interface Locals {}
// interface PageData {}
// interface PageState {}
interface Platform {
req: Req
}
}
}
-12
View File
@@ -1,12 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
%sveltekit.head%
<script async defer src="https://www.googletagmanager.com/gtag/js?id=G-Q2R5PQL59Z"></script>
</head>
<body data-sveltekit-preload-data="hover">
<div style="display: contents">%sveltekit.body%</div>
</body>
</html>
-30
View File
@@ -1,30 +0,0 @@
import { SENTRY_DSN } from '$lib/config';
import { init as initSentry, handleErrorWithSentry, makeBrowserOfflineTransport, makeFetchTransport, feedbackIntegration } from '@sentry/sveltekit';
initSentry({
dsn: SENTRY_DSN,
environment: import.meta.env.MODE,
tracesSampleRate: 1.0,
// This sets the sample rate to be 10%. You may want this to be 100% while
// in development and sample at a lower rate in production
replaysSessionSampleRate: 0.0,
// If the entire session is not sampled, use the below sample rate to sample
// sessions when an error occurs.
replaysOnErrorSampleRate: 1.0,
integrations: [feedbackIntegration({
autoInject: false,
})],
// replay:
// - https://github.com/getsentry/sentry-javascript/tree/develop/packages/replay-worker
// https://docs.sentry.io/platforms/javascript/guides/solidstart/session-replay/configuration/#using-a-custom-compression-worker
// To enable offline events caching, use makeBrowserOfflineTransport to wrap
// existing transports and queue events using the browsers' IndexedDB storage
transport: makeBrowserOfflineTransport(makeFetchTransport),
});
// If you have a custom error handler, pass it to `handleErrorWithSentry`
export const handleError = handleErrorWithSentry();
-61
View File
@@ -1,61 +0,0 @@
import { sequence } from '@sveltejs/kit/hooks';
import { init as initSentry, handleErrorWithSentry, sentryHandle } from '@sentry/sveltekit';
import type { Handle } from "@sveltejs/kit";
import { randomBytes } from 'crypto';
import { SENTRY_DSN, SENTRY_REPORT_URL } from '$lib/config';
// import { nodeProfilingIntegration } from "@sentry/profiling-node";
initSentry({
dsn: SENTRY_DSN,
environment: import.meta.env.MODE,
tracesSampleRate: 1.0,
// profilesSampleRate: 1.0,
integrations: [
],
})
const securityHeaders = {
'X-Content-Type-Options': 'nosniff',
'X-XSS-Protection': '0',
"Referrer-Policy": "no-referrer-when-downgrade",
"Permissions-Policy": "payment=(), geolocation=(self), fullscreen=(self)",
'Cross-Origin-Embedder-Policy': 'require-corp',
'Cross-Origin-Opener-Policy': 'same-origin',
'Cross-Origin-Resource-Policy': 'same-origin',
'Report-To': '{"group":"csp-endpoint","max_age":10886400,"endpoints":[{"url":"' + SENTRY_REPORT_URL + '"}],"include_subdomains":true}',
}
export const handle: Handle = async (input) => {
const sentryNonce = randomBytes(16).toString('hex');
return await sequence(
sentryHandle({
// injectFetchProxyScript: false,
fetchProxyScriptNonce: sentryNonce,
}),
async ({ event, resolve }) => {
const response = await resolve(event);
const csp = response.headers.get("Content-Security-Policy");
if (csp) {
response.headers.set("Content-Security-Policy", csp.replace("script-src", "script-src 'nonce-" + sentryNonce + "'"));
}
Object.entries(securityHeaders).forEach(
([header, value]) => {
if (!response.headers.has(header)) {
response.headers.set(header, value)
}
}
);
response.headers.delete("x-sveltekit-page")
return response;
}
)(input)
}
export const handleError = handleErrorWithSentry();
-37
View File
@@ -1,37 +0,0 @@
<script lang="ts">
import { IconExclamationCircle } from "@tabler/icons-svelte";
interface Props {
calloutType: string;
icon?: import('svelte').Snippet;
title?: import('svelte').Snippet;
body?: import('svelte').Snippet;
}
let {
calloutType,
icon,
title,
body
}: Props = $props();
</script>
<div class="callout" data-callout={calloutType}>
<div class="callout-title">
{#if icon}
<div class="callout-icon">{@render icon?.()}</div>
{:else}
<div class="callout-icon"><IconExclamationCircle /></div>
{/if}
<div class="callout-title-inner">
{#if title}{@render title()}{:else}{calloutType.replace(/\w\S*/g, function (txt) {
return (
txt.charAt(0).toUpperCase() +
txt.substring(1).toLowerCase()
);
})}{/if}
</div>
</div>
{#if body}
<div class="callout-body">{@render body?.()}</div>
{/if}
</div>
-301
View File
@@ -1,301 +0,0 @@
<script lang="ts" module>
type Attrs = {
[name: string]: string;
};
type AttrSource = Attrs | ((view: EditorView) => Attrs | null);
</script>
<script lang="ts">
import { run } from 'svelte/legacy';
// look at https://github.com/sveltejs/learn.svelte.dev/blob/main/src/routes/tutorial/%5Bslug%5D/Editor.svelte
// import { javascript } from "@codemirror/lang-javascript";
import { onDestroy, onMount, createEventDispatcher } from "svelte";
import { theme } from "$lib/theme";
import { githubLight, githubDark } from "$lib/themes/github";
import { EditorView } from "@codemirror/view";
import {
EditorState,
StateEffect,
type Extension,
} from "@codemirror/state";
import { type LanguageSupport } from "@codemirror/language";
import { get_base_extensions } from "./editorExtensions";
interface Props {
value?: string;
contentAttributes?: AttrSource | null;
lang?: LanguageSupport | null;
useTab?: boolean;
tabSize?: number;
lineWrapping?: boolean;
editable?: boolean;
readonly?: boolean;
placeholder?: string | HTMLElement | null | undefined;
header?: import('svelte').Snippet;
}
let {
value = $bindable(""),
contentAttributes = null,
lang = null,
useTab = true,
tabSize = 2,
lineWrapping = false,
editable = true,
readonly = false,
placeholder = undefined,
header
}: Props = $props();
const is_browser = typeof window !== "undefined";
let element: HTMLDivElement = $state();
let view: EditorView = $state();
let update_from_prop = false;
let update_from_state = false;
let first_config = true;
let first_update = true;
let langPlugin = null;
let extensions: Extension[] = [];
if (langPlugin !== null) extensions.push(langPlugin);
if (contentAttributes !== null)
extensions.push(EditorView.contentAttributes.of(contentAttributes));
onMount(() => {
view = create_editor_view();
dispatch("ready", view);
});
onDestroy(() => view?.destroy());
const dispatch = createEventDispatcher<{
change: string;
ready: EditorView;
reconfigure: EditorView;
}>();
function create_editor_view(): EditorView {
return new EditorView({
parent: element,
state: create_editor_state(value),
dispatch(transaction) {
view.update([transaction]);
if (!update_from_prop && transaction.docChanged) {
on_change();
}
},
});
}
function reconfigure(): void {
if (first_config) {
first_config = false;
return;
}
view.dispatch({
effects: StateEffect.reconfigure.of(state_extensions),
});
dispatch("reconfigure", view);
}
function update(value: string | null | undefined): void {
if (first_update) {
first_update = false;
return;
}
if (update_from_state) {
update_from_state = false;
return;
}
update_from_prop = true;
if (value === undefined) {
return;
}
const currentValue = view ? view.state.doc.toString() : "";
if (view && value !== currentValue) {
view.dispatch({
changes: {
from: 0,
to: currentValue.length,
insert: value || "",
},
});
}
update_from_prop = false;
}
function handle_change(): void {
const new_value = view.state.doc.toString();
if (new_value === value) return;
update_from_state = true;
value = new_value;
dispatch("change", value);
}
function create_editor_state(
value: string | null | undefined,
): EditorState {
return EditorState.create({
doc: value ?? undefined,
extensions: state_extensions,
});
}
// $: console.log(value)
// import { linter, lintGutter } from "@codemirror/lint";
// import * as eslint from "eslint-linter-browserify";
// lintGutter(),
// linter(esLint(new eslint.Linter(), config)),
run(() => {
view && update(value);
});
let state_extensions = $derived([
...get_base_extensions(
useTab,
tabSize,
lineWrapping,
placeholder,
editable,
readonly,
lang,
),
$theme == "dark" ? githubDark : githubLight,
...extensions,
]);
run(() => {
view && state_extensions && reconfigure();
});
let on_change = $derived(handle_change);
</script>
<div class="editor-wrapper card" class:no-header={!header}>
{#if header}
<div class="header">
{@render header?.()}
</div>
{/if}
{#if is_browser}
<div class="codemirror-wrapper editor" bind:this={element}></div>
{:else}
<div class="scm-waiting editor">
<div class="scm-waiting__loading scm-loading">
<div class="scm-loading__spinner"></div>
<p class="scm-loading__text">Loading editor...</p>
</div>
<div class="cm-editor"><pre class="scm-pre">{value}</pre></div>
</div>
{/if}
<!-- <CodeMirror
{value}
class="editor"
theme={$theme == "dark" ? githubDark : githubLight}
{extensions}
{readonly}
on:change
/> -->
</div>
<!-- <CodeMirror basic={true} bind:value lang={javascript({})} class="editor" /> -->
<style>
.editor-wrapper {
/* min-height: 200px; */
position: relative;
z-index: 1;
background-color: var(--surface-secondary-color);
}
.codemirror-wrapper :global(.cm-focused) {
outline: none;
}
.scm-waiting {
position: relative;
}
.scm-waiting__loading {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
background-color: var(--shadow-color);
}
.scm-loading {
display: flex;
align-items: center;
justify-content: center;
}
.scm-loading__spinner {
width: 1rem;
height: 1rem;
border-radius: 100%;
border: solid 2px var(--theme);
border-top-color: transparent;
margin-right: 0.75rem;
animation: spin 1s linear infinite;
}
.scm-loading__text {
font-family: sans-serif;
}
.scm-pre {
font-size: 0.85rem;
margin: 0;
padding: 4px 2px 4px 6px;
font-family: monospace;
tab-size: 2;
-moz-tab-size: 2;
resize: none;
pointer-events: none;
user-select: none;
overflow: auto;
}
@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
:global(.editor-wrapper .cm-scroller, .editor-wrapper .cm-editor) {
min-height: 200px;
border-bottom-left-radius: var(--border-radius);
border-bottom-right-radius: var(--border-radius);
/* box-shadow: var(--shadow);
background-color: var(--surface-color); */
}
:global(
.editor-wrapper.no-header .cm-scroller,
.editor-wrapper.no-header .cm-editor
) {
border-radius: var(--border-radius);
}
:global(pre.cm-editor) {
margin: 0;
}
</style>
-16
View File
@@ -1,16 +0,0 @@
<script lang="ts">
import manifest from "./site.webmanifest?url";
import logo from "./logo.svg?url";
</script>
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/svg+xml" href={logo}>
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href={manifest}>
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#0064e0">
<meta name="msapplication-TileColor" content="#1e2a55">
<meta name="theme-color" content="#1e2a55">
-137
View File
@@ -1,137 +0,0 @@
<script lang="ts">
import * as Sentry from "@sentry/sveltekit";
import url from "./logo.svg?url";
import { SITE_URL } from "$lib/metadata";
/** @type {Record<string, { href: string; title: string; }[]>} */
const links = {
Connect: [
{
href: "https://matrix.to/#/@jade:ellis.link",
title: "Matrix",
},
{ href: "https://github.com/JadedBlueEyes", title: "GitHub" },
{ href: "https://tech.lgbt/@JadedBlueEyes", title: "Mastodon" },
{
href: "https://bsky.app/profile/jade.ellis.link",
title: "Bluesky",
},
{
href: "https://www.linkedin.com/in/jadedblueeyes",
title: "LinkedIn",
},
],
Feeds: [
{ href: SITE_URL + "/blog/rss.xml", title: "RSS (Atom)" },
{ href: SITE_URL + "/blog/feed.json", title: "JSON Feed" },
]
};
const sendFeedback = async () => {
const feedback = Sentry.getFeedback();
if (!feedback) {
return;
}
const form = await feedback.createForm({});
form.appendToDom();
form.open();
};
</script>
<div class="background">
<footer class="container">
<div class="logo">
<a class="footer-link-home" href={SITE_URL}>
<img
src={url}
class="footer-logo"
alt=""
width="28"
height="28"
/>
<span class="site-name">Jade Ellis</span>
</a>
<button onclick={sendFeedback} class="feedback-button">Report a bug</button>
</div>
{#each Object.entries(links) as [title, inner_links]}
<div class="links">
<h2>{title}</h2>
{#each inner_links as { href, title }}
<a {href}>{title}</a>
{/each}
</div>
{/each}
<div class="copyright">© 2024 Jade Ellis</div>
<!-- <div class="feedback">
</div> -->
</footer>
</div>
<style>
.background {
background-color: var(--surface-color);
margin-block-start: 4em;
}
footer {
padding: 12px var(--spacing);
margin: 0 auto;
display: grid;
grid-template-columns: repeat(2, 1fr);
grid-template-rows: 1fr;
grid-row-gap: 6rem;
}
.container {
--container-max-width: calc(var(--page-width) + 6rem + 16px);
}
footer h2 {
font-size: var(--sk-text-m);
padding-bottom: 1rem;
}
.links a {
display: block;
line-height: 1.8;
}
.copyright {
grid-column: span 2;
}
@media (min-width: 500px) {
footer {
grid-template-columns: repeat(3, 1fr);
}
footer .logo {
display: block;
}
.copyright {
grid-column: span 1;
}
.feedback {
display: block;
}
}
.footer-logo {
width: 3rem;
height: 100%;
}
.footer-link-home {
display: flex;
gap: 4px;
align-items: center;
padding: 8px;
font-weight: 700;
}
.feedback-button {
margin: 8px;
}
</style>
@@ -1,43 +0,0 @@
<script lang="ts">
import type { Endpoints } from "@octokit/types";
import { browser } from "$app/environment";
interface Props {
releaseData: Endpoints["GET /repos/{owner}/{repo}/releases/latest"]["response"]["data"];
}
let { releaseData }: Props = $props();
// console.log(releaseData);
</script>
<div class="release">
{#if releaseData?.assets && browser && navigator}
{#if navigator.platform.startsWith("Win")}
{@const asset = (releaseData?.assets || []).filter((a) =>
a.name.endsWith(".exe"),
)[0]}
{#if asset}
<a href={asset.browser_download_url}>Download for Windows</a>
{/if}
{:else if navigator.platform.startsWith("Mac")}
{@const asset = (releaseData?.assets || []).filter((a) =>
a.name.endsWith(".dmg"),
)[0]}
{#if asset}
<a href={asset.browser_download_url}>Download for MacOS</a>
{/if}
{:else if navigator.platform.startsWith("Linux") && navigator.platform.includes("x86_64")}
{@const asset = (releaseData?.assets || []).filter((a) =>
a.name.endsWith(".AppImage"),
)[0]}
{#if asset}
<a href={asset.browser_download_url}>Download AppImage</a>
{/if}
{:else}
<span>No download found for your device</span>
{/if}
{:else if releaseData?.assets}
<span>Finding download for your device</span>
{/if}
<p>Latest release: <a href={releaseData.html_url}>{releaseData.name}</a></p>
</div>
-123
View File
@@ -1,123 +0,0 @@
<script lang="ts">
import { preventDefault } from 'svelte/legacy';
import url from "./logo.svg?url";
import { SITE_URL } from "$lib/metadata";
let logo: HTMLDivElement = $state();
let wiggleCount = 0;
function wiggle() {
wiggleCount++;
logo.style.animationPlayState = "running";
}
function wiggleIteration() {
wiggleCount--;
if (wiggleCount === 0) {
logo.style.animationPlayState = "paused";
}
}
</script>
<div class="hero card edge h-card">
<div
class="logo"
onclick={preventDefault(wiggle)}
onanimationiteration={wiggleIteration}
bind:this={logo}
>
<a href={SITE_URL} class="u-url u-uid" rel="me"
><img class="u-photo" src={url} alt="Logo" width="128" height="128" /></a
>
</div>
<div class="content">
<div>
<h1 class="title p-name">
<span class="p-given-name">Jade</span>
<span class="p-family-name">Ellis</span>
</h1>
<div role="doc-subtitle">
<span class="p-nickname">JadedBlueEyes</span>
</div>
</div>
<div class="description p-note">
Student, Computer Scientist and Creative
</div>
</div>
</div>
<style>
.hero {
display: flex;
justify-content: center;
flex-direction: column;
align-items: center;
gap: var(--spacing);
margin: 48px auto;
max-width: 320px;
padding: 3rem 0.5rem;
}
.logo {
width: 160px;
height: 160px;
flex-shrink: 0;
}
.content {
display: flex;
flex-direction: column;
gap: calc(var(--spacing) / 2);
}
.title {
text-align: center;
font-size: 32px;
margin: 0;
}
[role="doc-subtitle"] {
padding-block-start: 0;
font-size: 18px;
font-weight: 600;
text-align: center;
}
.description {
text-align: center;
}
@media screen and (min-width: 540px) {
.hero {
flex-direction: row;
margin: 96px auto;
max-width: 520px;
}
.title,
[role="doc-subtitle"],
.description {
text-align: left;
}
}
@keyframes wiggle {
0% {
transform: rotate(0deg);
}
25% {
transform: rotate(5deg);
}
75% {
transform: rotate(-5deg);
}
100% {
transform: rotate(0deg);
}
}
.logo {
animation-name: wiggle;
animation-duration: 0.2s;
/* animation-iteration-count: 1; */
animation-iteration-count: infinite;
animation-play-state: paused;
}
</style>
-91
View File
@@ -1,91 +0,0 @@
<script lang="ts">
import url from "./logo.svg?url";
import { SITE_URL } from "$lib/metadata";
// https://www.aleksandrhovhannisyan.com/
// https://github.com/AleksandrHovhannisyan/aleksandrhovhannisyan.com/tree/master
</script>
<header id="navbar">
<div class="container">
<nav aria-label="Primary">
<a href="#page-content" class="screen-reader-only skip-navigation"
>Skip to content</a
>
<ul class="navbar-links">
<li>
<a class="navbar-link-home" href={SITE_URL}>
<img
src={url}
class="navbar-logo"
alt=""
width="28"
height="28"
/>
<span class="site-name">Jade Ellis</span>
</a>
</li>
<!-- <li><a href="/about/" class="navbar-link">About</a></li>
<li><a href="/art/" class="navbar-link">Art</a></li> -->
<li><a href="/blog" class="navbar-link">Blog</a></li>
</ul>
</nav>
</div>
</header>
<style>
#navbar {
flex-shrink: 0;
width: 100%;
padding-block: 12px;
background-color: var(--surface-color);
overflow-x: auto;
color: #fff;
}
.container {
--container-max-width: calc(var(--page-width) + 6rem + 16px);
}
#navbar a {
text-decoration: none;
}
#navbar nav {
white-space: nowrap;
flex: 1 0 auto;
position: relative;
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
}
.navbar-logo {
width: 3rem;
height: 100%;
}
.navbar-links {
width: 100%;
display: flex;
align-items: center;
gap: 0.25em;
list-style: none;
margin: 0;
padding: 0;
}
.navbar-links > :first-child {
margin-inline-end: auto;
}
.navbar-link-home {
display: flex;
gap: 4px;
align-items: center;
padding: 8px;
font-weight: 700;
}
.skip-navigation {
top: 50%;
transform: translate(8px, -50%);
padding: 8px;
background-color: var(--color-navbar-bg);
}
</style>
-81
View File
@@ -1,81 +0,0 @@
<script lang="ts">
import TocItem from "./TocItem.svelte";
type FlatHeading = { level: number; title: string };
interface Props {
headings: nestedListNode[];
class?: string;
}
let { headings }: Props = $props();
// creates a `class` property, even
// though it is a reserved word
export const listType = "ul";
let open = $state(false);
/** @type {import('./$types').Snapshot<string>} */
export const snapshot = {
capture: () => open,
restore: (value: boolean) => (open = value),
};
// console.log(headings);
</script>
{#if headings?.length > 0}
<aside class="toc">
<details bind:open>
<summary accesskey="c" title="(Alt + C)">Table of Contents</summary>
<div class="inner">
<svelte:element
this={listType}
class="toc-level {'toc-level-' + headings[0].level}"
>
{#each headings as node}
<TocItem {node} {listType} />
{/each}
</svelte:element>
</div>
</details>
</aside>
{/if}
<style>
aside {
margin-block: calc(var(--spacing) / 4);
}
details {
/* margin: var(--spacing) 2px; */
margin: 0 2px;
border: 1px solid var(--surface-secondary-color);
background: var(--surface-color);
border-radius: var(--border-radius);
padding: 0.4em;
}
details summary {
cursor: zoom-in;
margin-inline-start: 10px;
user-select: none;
}
details[open] summary {
cursor: zoom-out;
}
summary {
font-weight: 500;
}
.inner {
padding: 0 10px;
opacity: 0.9;
margin-block-start: calc(var(--spacing) / 4);
margin-block-end: calc(var(--spacing) / 2);
margin-inline: calc(var(--spacing) / 2);
}
.inner :global(ul) {
margin: 0;
margin-inline-start: calc(var(--spacing));
padding: 0;
}
summary:focus {
outline: 0;
}
</style>
-21
View File
@@ -1,21 +0,0 @@
<script lang="ts">
import TocItem from './TocItem.svelte';
interface Props {
node: nestedListNode;
}
let { node }: Props = $props();
export const listType = "ul"
</script>
<li class="toc-item {"toc-item-" + node.level}">
<a href={"#" + node.id} class="toc-link {"toc-link-" + node.level}">{node.title}</a>
{#if node.children.length > 0}
<svelte:element this={listType} class="toc-level {"toc-level-" + node.children[0].level}">
{#each node.children as nodes}
<TocItem node={nodes} {listType} />
{/each}
</svelte:element>
{/if}
</li>

Some files were not shown because too many files have changed in this diff Show More