Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Database restructure #458

Draft
wants to merge 29 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
4684f16
unify migrations
aumetra Dec 16, 2023
f99fc76
fix statements
aumetra Dec 19, 2023
452b73d
format and continue refactor
aumetra Jan 19, 2024
22dd2c4
add formatter
aumetra Jan 20, 2024
b3a1c5d
finish formatting
aumetra Jan 21, 2024
d6ae181
maintain names as constants
aumetra Jan 21, 2024
f5e26ea
structure
aumetra Jan 21, 2024
284d390
add activitypub table for accounts, link accounts and users via a pkf…
aumetra Jan 21, 2024
194e264
move cryptographic keys out
aumetra Jan 21, 2024
70943b9
rename to account_type
aumetra Jan 21, 2024
224ae91
remove keys from accounts table
aumetra Jan 21, 2024
0b5f5f3
add shutdown log
aumetra Jan 21, 2024
5dbf813
update benchmark
aumetra Jan 21, 2024
45081d9
rename constraints, move queries around
aumetra Jan 21, 2024
a7388b0
update schema
aumetra Mar 9, 2024
8baef20
add diesel-cli-ext to the flake
aumetra Jun 1, 2024
3144db6
remove blurhash
aumetra Jun 1, 2024
df95bf9
refactor unique constraint positions
aumetra Jun 2, 2024
550db4a
store keys in der format
aumetra Jun 2, 2024
8cfb169
add comment
aumetra Jun 2, 2024
ecb04f7
add domain table
aumetra Jun 4, 2024
5955566
add fk constraint
aumetra Jun 4, 2024
a1190d4
add protocol marker
aumetra Jun 4, 2024
014ac58
make roles an own table
aumetra Jun 4, 2024
9f641df
add unique constraint
aumetra Jun 4, 2024
1e58c71
use standard conformant syntax
aumetra Jun 4, 2024
aeb1028
up
aumetra Jun 12, 2024
d694cae
Merge branch 'main' into aumetra/db-restructure
aumetra Jul 12, 2024
91b89eb
up
aumetra Jul 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
638 changes: 376 additions & 262 deletions Cargo.lock

Large diffs are not rendered by default.

15 changes: 9 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ resolver = "2"
askama = { version = "0.12.1", default-features = false, features = [
"with-axum",
] }
clap = { version = "4.5.7", features = ["derive", "wrap_help"] }
clap = { version = "4.5.9", features = ["derive", "wrap_help"] }
diesel = { version = "2.2.1", default-features = false, features = [
"32-column-tables",
"with-deprecated",
Expand All @@ -97,17 +97,17 @@ fred = { version = "9.0.3", features = [
"i-scripts",
"sha-1",
] }
garde = { version = "0.19.2", features = [
garde = { version = "0.20.0", features = [
"derive",
"email",
"email-idna",
"regex",
"serde",
] }
itertools = { version = "0.13.0", default-features = false }
moka = { version = "0.12.7", features = ["sync"] }
moka = { version = ">= 0.12.7", features = ["sync"] }
simdutf8 = { version = "0.1.4", features = ["aarch64_neon"] }
sonic-rs = "0.3.7"
sonic-rs = "0.3.8"
triomphe = { version = "0.1.13", default-features = false, features = [
"unsize",
] }
Expand Down Expand Up @@ -213,8 +213,11 @@ diesel-async = { git = "https://github.com/weiznich/diesel_async.git", rev = "3b
scraper = { git = "https://github.com/causal-agent/scraper.git", rev = "d67111f5cc0b7da6e6ff10e4549d87cf09ba3e5b" }
tokio-postgres-rustls = { git = "https://github.com/jbg/tokio-postgres-rustls.git", rev = "b16c1bc0f5d4f91324174fd1bd839d743a70f86a" }

# SIMD runtime detection
sonic-rs = { git = "https://github.com/aumetra/sonic-rs.git", rev = "317ff37a8ab88e653ee01bbc00a974d41f3b151a" }
# Patch potential unsoundness. Scary...
async-stream = { git = "https://github.com/tokio-rs/async-stream.git", rev = "40a8deb7d41d3ac0e563f9a0fd7f600c23189987" }

# SIMD runtime detection and generic I/O wrapper
sonic-rs = { git = "https://github.com/aumetra/sonic-rs.git", rev = "7e3bd236d82c5ccf85b3506f5a8cd2794e53451a" }

# TCP nodelay for `axum::serve`
axum = { git = "https://github.com/tokio-rs/axum.git", rev = "8d0c5c05eb75eb779591c8000705e785123868a0" }
Expand Down
8 changes: 4 additions & 4 deletions crates/kitsune-activitypub/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ version.workspace = true
license.workspace = true

[dependencies]
async-trait = "0.1.80"
async-trait = "0.1.81"
base64-simd = "0.8.0"
diesel = { workspace = true }
diesel-async = { workspace = true }
Expand All @@ -30,8 +30,8 @@ kitsune-url = { workspace = true }
kitsune-util = { workspace = true }
kitsune-wasm-mrf = { workspace = true }
mime = "0.3.17"
mime_guess = { version = "2.0.4", default-features = false }
serde = "1.0.203"
mime_guess = { version = "2.0.5", default-features = false }
serde = "1.0.204"
sha2 = "0.10.8"
sonic-rs = { workspace = true }
speedy-uuid = { workspace = true }
Expand All @@ -45,7 +45,7 @@ sha2 = { version = "0.10.8", features = ["asm"] }

[dev-dependencies]
http-body-util = "0.1.2"
hyper = "1.3.1"
hyper = "1.4.1"
kitsune-config = { workspace = true }
kitsune-test = { workspace = true }
kitsune-webfinger = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion crates/kitsune-cache/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ enum_dispatch = "0.3.13"
fred = { workspace = true }
kitsune-error = { workspace = true }
moka = { workspace = true }
serde = "1.0.203"
serde = "1.0.204"
sonic-rs = { workspace = true }
tracing = "0.1.40"
triomphe = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion crates/kitsune-captcha/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ enum_dispatch = "0.3.13"
http = "1.1.0"
kitsune-error = { workspace = true }
kitsune-http-client = { workspace = true }
serde = { version = "1.0.203", features = ["derive"] }
serde = { version = "1.0.204", features = ["derive"] }
serde_urlencoded = "0.7.1"
sonic-rs = { workspace = true }
strum = { version = "0.26.3", features = ["derive"] }
Expand Down
2 changes: 1 addition & 1 deletion crates/kitsune-config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ license.workspace = true
eyre = "0.6.12"
human-size = { version = "0.4.3", features = ["serde"] }
isolang = { version = "2.4.0", features = ["serde"] }
serde = { version = "1.0.203", features = ["derive"] }
serde = { version = "1.0.204", features = ["derive"] }
smol_str = { version = "0.2.2", features = ["serde"] }
tokio = { version = "1.38.0", features = ["fs"] }
toml = { version = "0.8.14", default-features = false, features = ["parse"] }
Expand Down
6 changes: 3 additions & 3 deletions crates/kitsune-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ license.workspace = true
build = "build.rs"

[dependencies]
async-trait = "0.1.80"
async-trait = "0.1.81"
const_format = "0.2.32"
kitsune-db = { workspace = true }
kitsune-error = { workspace = true }
paste = "1.0.15"
serde = { version = "1.0.203", features = ["derive"] }
serde = { version = "1.0.204", features = ["derive"] }
triomphe = { workspace = true }
typed-builder = "0.18.2"
unsize = "1.1.0"

[build-dependencies]
vergen = { version = "8.3.1", features = ["build", "git", "gitcl"] }
vergen-gitcl = { version = "1.0.0", features = ["build"] }

[lints]
workspace = true
12 changes: 7 additions & 5 deletions crates/kitsune-core/build.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use std::env;
use vergen::EmitBuilder;
use vergen_gitcl::{Emitter, GitclBuilder};

const PRIMARY_PACKAGE_KEY: &str = "CARGO_PRIMARY_PACKAGE";
const PRIMARY_PACKAGE_FALLBACK_VALUE: &str = "kitsune";
Expand All @@ -9,9 +9,11 @@ fn main() {
println!("cargo:rustc-env={PRIMARY_PACKAGE_KEY}={PRIMARY_PACKAGE_FALLBACK_VALUE}");
}

EmitBuilder::builder()
.all_git()
.git_sha(true)
.emit_and_set()
let gitcl = GitclBuilder::default().sha(true).build().unwrap();

Emitter::new()
.add_instructions(&gitcl)
.unwrap()
.emit()
.unwrap();
}
6 changes: 3 additions & 3 deletions crates/kitsune-db/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ kitsune-language = { workspace = true }
kitsune-type = { workspace = true }
num-derive = "0.4.2"
num-traits = "0.2.19"
rustls = { version = "0.23.10", default-features = false, features = [
rustls = { version = "0.23.11", default-features = false, features = [
"logging",
"ring",
"std",
"tls12",
] }
rustls-native-certs = "0.7.0"
serde = { version = "1.0.203", features = ["derive"] }
rustls-native-certs = "0.7.1"
serde = { version = "1.0.204", features = ["derive"] }
sonic-rs = { workspace = true }
speedy-uuid = { workspace = true, features = ["diesel"] }
tokio = { version = "1.38.0", features = ["rt"] }
Expand Down

This file was deleted.

198 changes: 0 additions & 198 deletions crates/kitsune-db/migrations/2023-05-19-192931_initial_tables/up.sql

This file was deleted.

This file was deleted.

Loading
Loading