Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 1 addition & 5 deletions apps/app/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,7 @@ path-util = { workspace = true }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
serde_with = { workspace = true }
tauri = { workspace = true, features = [
"devtools",
"macos-private-api",
"protocol-asset",
] }
tauri = { workspace = true, features = ["devtools", "macos-private-api", "protocol-asset"] }
tauri-plugin-deep-link = { workspace = true }
tauri-plugin-dialog = { workspace = true }
tauri-plugin-http = { workspace = true }
Expand Down
18 changes: 7 additions & 11 deletions apps/daedalus_client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ edition.workspace = true

[dependencies]
async_zip = { workspace = true, features = [
"bzip2",
"chrono",
"deflate",
"deflate64",
"tokio-fs",
"zstd",
"bzip2",
"chrono",
"deflate",
"deflate64",
"tokio-fs",
"zstd",
] }
bytes = { workspace = true }
chrono = { workspace = true, features = ["serde"] }
Expand All @@ -20,11 +20,7 @@ dotenvy = { workspace = true }
futures = { workspace = true }
indexmap = { workspace = true, features = ["serde"] }
itertools = { workspace = true }
reqwest = { workspace = true, features = [
"json",
"rustls-tls-native-roots",
"stream",
] }
reqwest = { workspace = true, features = ["json", "rustls-tls-native-roots", "stream"] }
rust-s3 = { workspace = true }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
Expand Down
69 changes: 28 additions & 41 deletions apps/labrinth/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,7 @@ actix-ws = { workspace = true }
arc-swap = { workspace = true }
argon2 = { workspace = true }
ariadne = { workspace = true }
async-stripe = { workspace = true, features = [
"billing",
"checkout",
"connect",
"webhook-events",
] }
async-stripe = { workspace = true, features = ["billing", "checkout", "connect", "webhook-events"] }
async-trait = { workspace = true }
base64 = { workspace = true }
bitflags = { workspace = true }
Expand All @@ -50,21 +45,21 @@ hmac = { workspace = true }
hyper-rustls = { workspace = true }
hyper-util = { workspace = true }
image = { workspace = true, features = [
"avif",
"bmp",
"dds",
"exr",
"ff",
"gif",
"hdr",
"ico",
"jpeg",
"png",
"pnm",
"qoi",
"tga",
"tiff",
"webp",
"avif",
"bmp",
"dds",
"exr",
"ff",
"gif",
"hdr",
"ico",
"jpeg",
"png",
"pnm",
"qoi",
"tga",
"tiff",
"webp",
] }
itertools = { workspace = true }
json-patch = { workspace = true }
Expand All @@ -81,16 +76,8 @@ rand = { workspace = true }
rand_chacha = { workspace = true }
redis = { workspace = true, features = ["ahash", "r2d2", "tokio-comp"] }
regex = { workspace = true }
reqwest = { workspace = true, features = [
"http2",
"json",
"multipart",
"rustls-tls-webpki-roots",
] }
rust_decimal = { workspace = true, features = [
"serde-with-float",
"serde-with-str",
] }
reqwest = { workspace = true, features = ["http2", "json", "multipart", "rustls-tls-webpki-roots"] }
rust_decimal = { workspace = true, features = ["serde-with-float", "serde-with-str"] }
rust_iso3166 = { workspace = true }
rust-s3 = { workspace = true }
rustls.workspace = true
Expand All @@ -104,14 +91,14 @@ sha1 = { workspace = true }
sha2 = { workspace = true }
spdx = { workspace = true, features = ["text"] }
sqlx = { workspace = true, features = [
"chrono",
"json",
"macros",
"migrate",
"postgres",
"runtime-tokio",
"rust_decimal",
"tls-rustls-aws-lc-rs",
"chrono",
"json",
"macros",
"migrate",
"postgres",
"runtime-tokio",
"rust_decimal",
"tls-rustls-aws-lc-rs",
] }
strum = { workspace = true }
thiserror = { workspace = true }
Expand Down Expand Up @@ -145,8 +132,8 @@ iana-time-zone = { workspace = true }
jemalloc_pprof = { workspace = true, features = ["flamegraph"] }
tikv-jemalloc-ctl = { workspace = true, features = ["stats"] }
tikv-jemallocator = { workspace = true, features = [
"profiling",
"unprefixed_malloc_on_supported_platforms",
"profiling",
"unprefixed_malloc_on_supported_platforms",
] }

[features]
Expand Down
711 changes: 690 additions & 21 deletions apps/labrinth/fixtures/delphi-report-2025-11-15.sql

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
CREATE TABLE users_subscriptions_affiliations (
subscription_id BIGINT NOT NULL REFERENCES users_subscriptions(id),
affiliate_code BIGINT NOT NULL REFERENCES affiliate_codes(id),
created_at TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP,
deactivated_at TIMESTAMPTZ,
subscription_id BIGINT NOT NULL REFERENCES users_subscriptions (id),
affiliate_code BIGINT NOT NULL REFERENCES affiliate_codes (id),
created_at TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP,
deactivated_at TIMESTAMPTZ,
UNIQUE (subscription_id)
);

CREATE TABLE users_subscriptions_affiliations_payouts(
id BIGSERIAL PRIMARY KEY,
charge_id BIGINT NOT NULL REFERENCES charges(id),
subscription_id BIGINT NOT NULL REFERENCES users_subscriptions(id),
affiliate_code BIGINT NOT NULL REFERENCES affiliate_codes(id),
payout_value_id BIGSERIAL NOT NULL REFERENCES payouts_values(id),
CREATE TABLE users_subscriptions_affiliations_payouts (
id BIGSERIAL PRIMARY KEY,
charge_id BIGINT NOT NULL REFERENCES charges (id),
subscription_id BIGINT NOT NULL REFERENCES users_subscriptions (id),
affiliate_code BIGINT NOT NULL REFERENCES affiliate_codes (id),
payout_value_id BIGSERIAL NOT NULL REFERENCES payouts_values (id),
UNIQUE (charge_id),
UNIQUE (payout_value_id)
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
ALTER TABLE threads
DROP CONSTRAINT threads_mod_id_fkey,
ADD CONSTRAINT threads_mod_id_fkey
FOREIGN KEY (mod_id) REFERENCES mods(id)
ON DELETE SET NULL;
ADD CONSTRAINT threads_mod_id_fkey FOREIGN KEY (mod_id) REFERENCES mods (id)
ON DELETE SET NULL;
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
ALTER TABLE delphi_reports
ADD COLUMN status delphi_report_issue_status NOT NULL DEFAULT 'pending';
ADD COLUMN status DELPHI_REPORT_ISSUE_STATUS NOT NULL DEFAULT 'pending';
22 changes: 14 additions & 8 deletions apps/labrinth/migrations/20251201171345_store_ids_as_text.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
-- but with `IMMUTABLE` so we can use them in generated columns

CREATE OR REPLACE FUNCTION from_base62(input VARCHAR)
RETURNS BIGINT AS $$
RETURNS BIGINT
AS $$
DECLARE
base INT := 62;
chars VARCHAR := '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
Expand All @@ -22,10 +23,13 @@ BEGIN

RETURN result;
END;
$$ LANGUAGE plpgsql IMMUTABLE;
$$
LANGUAGE plpgsql
IMMUTABLE;

CREATE OR REPLACE FUNCTION to_base62(input BIGINT)
RETURNS VARCHAR AS $$
RETURNS VARCHAR
AS $$
DECLARE
base INT := 62;
chars VARCHAR := '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
Expand All @@ -40,12 +44,14 @@ BEGIN

RETURN result;
END;
$$ LANGUAGE plpgsql IMMUTABLE;
$$
LANGUAGE plpgsql
IMMUTABLE;

ALTER TABLE mods
ADD COLUMN text_id TEXT GENERATED ALWAYS AS (to_base62(id)) STORED,
ADD COLUMN text_id_lower TEXT GENERATED ALWAYS AS (lower(to_base62(id))) STORED;
ADD COLUMN text_id TEXT GENERATED ALWAYS AS (to_base62(id)) STORED,
ADD COLUMN text_id_lower TEXT GENERATED ALWAYS AS (lower(to_base62(id))) STORED;

ALTER TABLE organizations
ADD COLUMN text_id TEXT GENERATED ALWAYS AS (to_base62(id)) STORED,
ADD COLUMN text_id_lower TEXT GENERATED ALWAYS AS (lower(to_base62(id))) STORED;
ADD COLUMN text_id TEXT GENERATED ALWAYS AS (to_base62(id)) STORED,
ADD COLUMN text_id_lower TEXT GENERATED ALWAYS AS (lower(to_base62(id))) STORED;
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@ ALTER TABLE delphi_report_issue_details
DROP COLUMN status;

CREATE TABLE delphi_issue_detail_verdicts (
project_id BIGINT REFERENCES mods(id)
project_id BIGINT REFERENCES mods (id)
ON DELETE SET NULL
ON UPDATE CASCADE,
detail_key TEXT NOT NULL,
verdict delphi_report_issue_status NOT NULL,
detail_key TEXT NOT NULL,
verdict DELPHI_REPORT_ISSUE_STATUS NOT NULL,
PRIMARY KEY (project_id, detail_key)
);

CREATE VIEW delphi_issue_details_with_statuses AS
SELECT
drid.*,
m.id AS project_id,
COALESCE(didv.verdict, 'pending') AS status
FROM delphi_report_issue_details drid
INNER JOIN delphi_report_issues dri ON dri.id = drid.issue_id
INNER JOIN delphi_reports dr ON dr.id = dri.report_id
INNER JOIN files f ON f.id = dr.file_id
INNER JOIN versions v ON v.id = f.version_id
INNER JOIN mods m ON m.id = v.mod_id
LEFT JOIN delphi_issue_detail_verdicts didv
ON m.id = didv.project_id
AND drid.key = didv.detail_key;
SELECT
drid.*,
m.id AS project_id,
COALESCE(didv.verdict, 'pending') AS status
FROM
delphi_report_issue_details AS drid
INNER JOIN delphi_report_issues AS dri ON dri.id = drid.issue_id
INNER JOIN delphi_reports AS dr ON dr.id = dri.report_id
INNER JOIN files AS f ON f.id = dr.file_id
INNER JOIN versions AS v ON v.id = f.version_id
INNER JOIN mods AS m ON m.id = v.mod_id
LEFT JOIN delphi_issue_detail_verdicts AS didv
ON m.id = didv.project_id AND drid.key = didv.detail_key;
70 changes: 31 additions & 39 deletions packages/app-lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,15 @@ edition.workspace = true
ariadne = { workspace = true }
async-compression = { workspace = true, features = ["gzip", "tokio"] }
async-recursion = { workspace = true }
async-tungstenite = { workspace = true, features = [
"tokio-runtime",
"tokio-rustls-webpki-roots",
] }
async-tungstenite = { workspace = true, features = ["tokio-runtime", "tokio-rustls-webpki-roots"] }
async-walkdir = { workspace = true }
async_zip = { workspace = true, features = [
"bzip2",
"chrono",
"deflate",
"deflate64",
"tokio-fs",
"zstd",
"bzip2",
"chrono",
"deflate",
"deflate64",
"tokio-fs",
"zstd",
] }
base64 = { workspace = true }
bytemuck = { workspace = true, features = ["extern_crate_alloc"] }
Expand Down Expand Up @@ -55,16 +52,16 @@ quick-xml = { workspace = true, features = ["async-tokio"] }
rand = { workspace = true }
regex = { workspace = true }
reqwest = { workspace = true, features = [
"brotli",
"charset",
"deflate",
"gzip",
"http2",
"json",
"macos-system-configuration",
"multipart",
"rustls-tls-webpki-roots",
"stream",
"brotli",
"charset",
"deflate",
"gzip",
"http2",
"json",
"macos-system-configuration",
"multipart",
"rustls-tls-webpki-roots",
"stream",
] }
rgb = { workspace = true }
serde = { workspace = true, features = ["derive"] }
Expand All @@ -75,32 +72,27 @@ sha1_smol = { workspace = true }
sha2 = { workspace = true }
shlex = { workspace = true }
sqlx = { workspace = true, features = [
"json",
"macros",
"migrate",
"runtime-tokio",
"sqlite",
"uuid",
"json",
"macros",
"migrate",
"runtime-tokio",
"sqlite",
"uuid",
] }
sysinfo = { workspace = true, features = ["disk", "system"] }
tauri = { workspace = true, features = ["unstable"], optional = true }
tempfile = { workspace = true }
thiserror = { workspace = true }
tokio = { workspace = true, features = [
"fs",
"io-util",
"macros",
"net",
"process",
"sync",
"time",
] }
tokio-util = { workspace = true, features = [
"compat",
"io",
"io-util",
"time",
"fs",
"io-util",
"macros",
"net",
"process",
"sync",
"time",
] }
tokio-util = { workspace = true, features = ["compat", "io", "io-util", "time"] }
tracing = { workspace = true }
tracing-error = { workspace = true }
tracing-subscriber = { workspace = true, features = ["chrono", "env-filter"] }
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ALTER TABLE settings ADD COLUMN version INTEGER NOT NULL DEFAULT 1;
ALTER TABLE settings ADD COLUMN version INTEGER NOT NULL DEFAULT 1;
Loading