diff --git a/.cargo/config.toml b/.cargo/config.toml index b8728fc8..09f4ef96 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -10,3 +10,6 @@ rustflags = ["-C", "link-arg=-fuse-ld=lld"] [alias] watch-client = ["watch", "--delay", "0.1", "--ignore", "**/common/src/proto/**", "--exec", "build --package client", "--shell", "workspace_manifest=$(cargo locate-project --workspace --message-format plain); exec ${workspace_manifest%Cargo.toml}target/debug/client client"] watch-server = ["watch", "--why", "--delay", "0.1", "--ignore", "**/common/src/proto/**", "--exec", "build --package server", "--shell", "workspace_manifest=$(cargo locate-project --workspace --message-format plain); exec ${workspace_manifest%Cargo.toml}target/debug/server server"] + +[env] +POSTGRESQL_VERSION = "=17.10.0" diff --git a/.env_template b/.env_template index 4a1c2037..ac10e1b8 100644 --- a/.env_template +++ b/.env_template @@ -1,8 +1,16 @@ -DATABASE_URL="postgres://multi_psql_dev:3@localhost:5432/multi_rust_dev" -RUST_DB_NAME=multi_rust_dev -RUST_DB_USER=multi_psql_dev -RUST_DB_PASSWORD=3 -RUST_DB_HOST=localhost -RUST_DB_PORT=5432 +# The default build uses its bundled PostgreSQL. These optional values show the +# defaults; KOMP_AC_POSTGRES_DIR can move its persistent installation and data. +RUST_DB_MODE=embedded +# RUST_DB_NAME=komp_ac +# RUST_DB_USER=postgres +# RUST_DB_PASSWORD= +# RUST_DB_HOST=127.0.0.1 +# RUST_DB_PORT=5433 +# KOMP_AC_POSTGRES_DIR=/var/lib/komp_ac/postgresql + +# For a separately managed database, set RUST_DB_MODE=external and provide all +# five RUST_DB_* connection settings. DATABASE_URL is only used by development +# tools and tests; the server reads RUST_DB_*. +# DATABASE_URL="postgres://multi_psql_dev:password@localhost:5432/multi_rust_dev" JWT_SECRET= diff --git a/Cargo.lock b/Cargo.lock index ed705d32..63855f5f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -128,9 +128,9 @@ checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000" [[package]] name = "anyhow" -version = "1.0.102" +version = "1.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" +checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470" [[package]] name = "anymap3" @@ -163,7 +163,7 @@ dependencies = [ "objc2-foundation", "parking_lot", "percent-encoding", - "windows-sys 0.52.0", + "windows-sys 0.59.0", "x11rb", ] @@ -839,7 +839,7 @@ version = "3.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "519bd3116aeeb42d5372c29d982d16d0170d3d4a5ed85fc7dd91642ffff3c67c" dependencies = [ - "darling 0.20.11", + "darling 0.23.0", "ident_case", "prettyplease", "proc-macro2", @@ -2681,7 +2681,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -2813,6 +2813,16 @@ dependencies = [ "winapi", ] +[[package]] +name = "filetime" +version = "0.2.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c287a33c7f0a620c38e641e7f60827713987b3c0f26e8ddc9462cc69cf75759" +dependencies = [ + "cfg-if", + "libc", +] + [[package]] name = "find-msvc-tools" version = "0.1.9" @@ -5319,6 +5329,12 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + [[package]] name = "pkcs1" version = "0.7.5" @@ -5488,6 +5504,62 @@ dependencies = [ "uuid", ] +[[package]] +name = "postgresql_archive" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "274b4eeb875f1196cc577a69b17c3018a3b189d4017122648b1465066b8b08c1" +dependencies = [ + "async-trait", + "flate2", + "futures-util", + "hex", + "regex-lite", + "reqwest 0.13.4", + "reqwest-middleware", + "reqwest-retry", + "reqwest-tracing", + "rustls", + "semver", + "serde", + "serde_json", + "sha2 0.10.9", + "tar", + "target-triple", + "tempfile", + "tracing", + "url", +] + +[[package]] +name = "postgresql_commands" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66e1f10f6246287203d57775b1be7a9050c6d3f45c9021853eda3cfee3bf95e9" +dependencies = [ + "tokio", + "tracing", +] + +[[package]] +name = "postgresql_embedded" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87673b35bc80ddcc8eb54072d90290c6d2e3777493fd2d0de46cf2e0d6677fe5" +dependencies = [ + "anyhow", + "postgresql_archive", + "postgresql_commands", + "rand 0.10.1", + "semver", + "sqlx", + "target-triple", + "tempfile", + "tokio", + "tracing", + "url", +] + [[package]] name = "potential_utf" version = "0.1.5" @@ -5617,7 +5689,7 @@ version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03da047801ff44bb6a4d407d4860c05fd70bb81714e6b2f3812603d5b145b042" dependencies = [ - "heck 0.4.1", + "heck 0.5.0", "itertools 0.14.0", "log", "multimap", @@ -5768,7 +5840,7 @@ dependencies = [ "once_cell", "socket2", "tracing", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -6059,6 +6131,12 @@ dependencies = [ "regex-syntax 0.6.29", ] +[[package]] +name = "regex-lite" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cab834c73d247e67f4fae452806d17d3c7501756d98c8808d7c9c7aa7d18f973" + [[package]] name = "regex-syntax" version = "0.6.29" @@ -6133,12 +6211,114 @@ dependencies = [ "webpki-roots", ] +[[package]] +name = "reqwest" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "219c5811de6525e5416c7d5d53bb656d3afdbc6c5af816e0802bcfa42dbdc1c3" +dependencies = [ + "base64", + "bytes", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-rustls", + "hyper-util", + "js-sys", + "log", + "percent-encoding", + "pin-project-lite", + "rustls", + "rustls-pki-types", + "rustls-platform-verifier", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper", + "tokio", + "tokio-rustls", + "tokio-util", + "tower", + "tower-http", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-streams", + "web-sys", +] + +[[package]] +name = "reqwest-middleware" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07bc3f1384cffa4f274dad2d4ddd73aed32fed8f786d96c6be8aa4e5fd3c3b58" +dependencies = [ + "anyhow", + "async-trait", + "http", + "reqwest 0.13.4", + "serde", + "thiserror 2.0.18", + "tower-service", +] + +[[package]] +name = "reqwest-retry" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe2412db2af7d2268e7a5406be0431f37d9eb67ff390f35b395716f5f06c2eaa" +dependencies = [ + "anyhow", + "async-trait", + "futures", + "getrandom 0.2.17", + "http", + "hyper", + "reqwest 0.13.4", + "reqwest-middleware", + "retry-policies", + "thiserror 2.0.18", + "tokio", + "tracing", + "wasmtimer", +] + +[[package]] +name = "reqwest-tracing" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e5af0cd6fc3d3c8f703d597af70b6e4e62432c63157b49419fa1ffaf481702" +dependencies = [ + "anyhow", + "async-trait", + "getrandom 0.2.17", + "http", + "matchit", + "reqwest 0.13.4", + "reqwest-middleware", + "tracing", +] + [[package]] name = "resolv-conf" version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e061d1b48cb8d38042de4ae0a7a6401009d6143dc80d2e2d6f31f0bdd6470c7" +[[package]] +name = "retry-policies" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc05fbf560421a0357a750cbe78c7ca19d4923918490daabba313d5dbc871e47" +dependencies = [ + "rand 0.10.1", +] + [[package]] name = "rfc6979" version = "0.4.0" @@ -6344,7 +6524,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -6361,6 +6541,18 @@ dependencies = [ "zeroize", ] +[[package]] +name = "rustls-native-certs" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dab5152771c58876a2146916e53e35057e1a4dfa2b9df0f0305b07f611fdea4d" +dependencies = [ + "openssl-probe", + "rustls-pki-types", + "schannel", + "security-framework", +] + [[package]] name = "rustls-pki-types" version = "1.15.0" @@ -6371,6 +6563,33 @@ dependencies = [ "zeroize", ] +[[package]] +name = "rustls-platform-verifier" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d1e2536ce4f35f4846aa13bff16bd0ff40157cdb14cc056c7b14ba41233ba0" +dependencies = [ + "core-foundation 0.10.1", + "core-foundation-sys", + "jni", + "log", + "once_cell", + "rustls", + "rustls-native-certs", + "rustls-platform-verifier-android", + "rustls-webpki", + "security-framework", + "security-framework-sys", + "webpki-root-certs", + "windows-sys 0.61.2", +] + +[[package]] +name = "rustls-platform-verifier-android" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f87165f0995f63a9fbeea62b64d10b4d9d8e78ec6d7d51fb2125fda7bb36788f" + [[package]] name = "rustls-webpki" version = "0.103.13" @@ -6678,12 +6897,13 @@ dependencies = [ "lazy_static", "once_cell", "phonenumber", + "postgresql_embedded", "prost", "prost-build", "prost-types", "rand 0.10.1", "regex", - "reqwest", + "reqwest 0.12.28", "rstest", "rust-stemmers", "rust_decimal", @@ -6915,7 +7135,7 @@ version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f103c50866b8743da9429b8a581d81a27c2d3a9c4ac7df8f8571c1dd7896eda" dependencies = [ - "heck 0.4.1", + "heck 0.5.0", "proc-macro2", "quote", "syn 2.0.117", @@ -7014,6 +7234,7 @@ dependencies = [ "memchr", "percent-encoding", "rust_decimal", + "rustls", "serde", "serde_json", "sha2 0.10.9", @@ -7025,6 +7246,7 @@ dependencies = [ "tracing", "url", "uuid", + "webpki-roots", ] [[package]] @@ -7610,6 +7832,23 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" +[[package]] +name = "tar" +version = "0.4.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f6221d9a6003c78398e3b239969f352578258df48c8eb051caadae0015bc840" +dependencies = [ + "filetime", + "libc", + "xattr", +] + +[[package]] +name = "target-triple" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3a6bfce3d99adfa72d24750a61f782f3036a81e7f86d8841ee1326deaebd171" + [[package]] name = "tempfile" version = "3.27.0" @@ -7620,7 +7859,7 @@ dependencies = [ "getrandom 0.4.2", "once_cell", "rustix", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -8742,6 +8981,19 @@ dependencies = [ "wasmparser", ] +[[package]] +name = "wasm-streams" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d1ec4f6517c9e11ae630e200b2b65d193279042e28edd4a2cda233e46670bbb" +dependencies = [ + "futures-util", + "js-sys", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + [[package]] name = "wasmparser" version = "0.244.0" @@ -8754,6 +9006,20 @@ dependencies = [ "semver", ] +[[package]] +name = "wasmtimer" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c598d6b99ea013e35844697fc4670d08339d5cda15588f193c6beedd12f644b" +dependencies = [ + "futures", + "js-sys", + "parking_lot", + "pin-utils", + "slab", + "wasm-bindgen", +] + [[package]] name = "weak-table" version = "0.3.2" @@ -8800,6 +9066,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki-root-certs" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b96554aa2acc8ccdb7e1c9a58a7a68dd5d13bccc69cd124cb09406db612a1c9b" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "webpki-roots" version = "1.0.9" @@ -8937,7 +9212,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -9251,6 +9526,16 @@ version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ea6fc2961e4ef194dcbfe56bb845534d0dc8098940c7e5c012a258bfec6701bd" +[[package]] +name = "xattr" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32e45ad4206f6d2479085147f02bc2ef834ac85886624a23575ae137c8aa8156" +dependencies = [ + "libc", + "rustix", +] + [[package]] name = "xdg" version = "3.0.0" diff --git a/flake.nix b/flake.nix index 5c0adb5d..3725af29 100644 --- a/flake.nix +++ b/flake.nix @@ -13,7 +13,7 @@ in { devShells.default = pkgs.mkShell { - LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [ pkgs.openssl ]; + LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [ pkgs.openssl pkgs.krb5 ]; buildInputs = with pkgs; [ mermaid-cli @@ -43,6 +43,7 @@ # OpenSSL for crypto dependencies openssl openssl.dev + krb5 # PostgreSQL for sqlx postgresql diff --git a/server b/server index e17f9278..b79e9a0b 160000 --- a/server +++ b/server @@ -1 +1 @@ -Subproject commit e17f92785a816de2a0fff9d27eea5cb09ffb65a0 +Subproject commit b79e9a0b57a159b7c2bf13db737a77b41f1c213a