Update dependencies

This commit is contained in:
Quentin Boyer 2024-12-30 21:19:19 +01:00
parent dec027f258
commit 53ec443972
18 changed files with 1342 additions and 1870 deletions

4
.envrc
View file

@ -6,3 +6,7 @@ use flake
export REGALADE_JWT_SECRET=B50D8FB3A6DC3073259062EFFD03A283416A81ED3183C44DEE179AFF76C00B58
export REGALADE_DATABASE_URL=postgres://traxys/regalade?host=/var/run/postgresql
export DATABASE_URL=$REGALADE_DATABASE_URL
if [[ -f secrets.sh ]]; then
source secrets.sh
fi

2794
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -5,36 +5,36 @@ authors = ["traxys <quentin@familleboyer.net>"]
edition = "2021"
[workspace]
members = [".", "api", "gui", "migration", "web"]
members = [".", "api", "migration"]
[dependencies]
anyhow = "1.0.79"
axum = { version = "0.7.4" }
base64 = "0.21.7"
jwt-simple = "0.12.7"
serde = { version = "1.0.195", features = ["derive"] }
anyhow = "1.0.95"
axum = { version = "0.7.9" }
base64 = "0.22.1"
jwt-simple = "0.12.11"
serde = { version = "1.0.217", features = ["derive"] }
tokio = { version = "1", features = ["macros", "rt", "rt-multi-thread"] }
tracing = "0.1.40"
tracing-subscriber = "0.3.18"
tracing = "0.1.41"
tracing-subscriber = "0.3.19"
api = { path = "./api" }
migration = { path = "./migration" }
thiserror = "1.0.56"
tower-http = { version = "0.5.1", features = ["cors", "fs"] }
thiserror = "2.0.9"
tower-http = { version = "0.6.2", features = ["cors", "fs"] }
sha2 = "0.10"
uuid = { version = "1.7", features = ["v4"] }
sea-query = "0.30"
openidconnect = "3.4.0"
uuid = { version = "1.11", features = ["v4"] }
sea-query = "0.32"
openidconnect = "3.5.0"
envious = "0.2.2"
parking_lot = "0.12.1"
parking_lot = "0.12.3"
urlencoding = "2.1.3"
tower-sessions = "0.10.0"
tower = "0.4.13"
time = "0.3.31"
tower-sessions = "0.13.0"
tower = "0.5.2"
time = "0.3.37"
maud = { version = "0.26.0", features = ["axum"] }
pulldown-cmark = "0.9.3"
ammonia = "3.3.0"
tower-sessions-sqlx-store = { version = "0.10.0", features = ["postgres"] }
pulldown-cmark = "0.12.2"
ammonia = "4.0.0"
tower-sessions-sqlx-store = { version = "0.14.2", features = ["postgres"] }
[dependencies.sea-orm]
version = "0.12"
version = "1.1"
features = ["runtime-tokio-rustls", "sqlx-postgres", "sqlx-sqlite"]

View file

@ -6,5 +6,5 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
serde = { version = "1.0.195", features = ["derive"] }
uuid = { version = "1.7.0", features = ["serde"] }
serde = { version = "1.0.217", features = ["derive"] }
uuid = { version = "1.11.0", features = ["serde"] }

93
flake.lock generated
View file

@ -5,29 +5,11 @@
"systems": "systems"
},
"locked": {
"lastModified": 1709126324,
"narHash": "sha256-q6EQdSeUZOG26WelxqkmR7kArjgWCdw5sfJVHPH/7j8=",
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "d465f4819400de7c8d874d50b982301f28a84605",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_2": {
"inputs": {
"systems": "systems_2"
},
"locked": {
"lastModified": 1705309234,
"narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
@ -41,11 +23,11 @@
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1698420672,
"narHash": "sha256-/TdeHMPRjjdJub7p7+w55vyABrsJlt5QkznPYy55vKA=",
"lastModified": 1733346208,
"narHash": "sha256-a4WZp1xQkrnA4BbnKrzJNr+dYoQr5Xneh2syJoddFyE=",
"owner": "nix-community",
"repo": "naersk",
"rev": "aeb58d5e8faead8980a807c840232697982d47b9",
"rev": "378614f37a6bee5a3f2ef4f825a73d948d3ae921",
"type": "github"
},
"original": {
@ -56,12 +38,10 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1709294055,
"narHash": "sha256-7EECkQYoNKJZOf2+miJdrMpxpvsn/qZFwIhUI3fQpLs=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "ec869190b56a1b4677d24a8bdbcfe80ccea2ece6",
"type": "github"
"lastModified": 0,
"narHash": "sha256-NYVcA06+blsLG6wpAbSPTCyLvxD/92Hy4vlY9WxFI1M=",
"path": "/nix/store/zgzjib5vbxl9l2ridhjfvs1ll6lil8s6-source",
"type": "path"
},
"original": {
"id": "nixpkgs",
@ -70,11 +50,11 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1709294055,
"narHash": "sha256-7EECkQYoNKJZOf2+miJdrMpxpvsn/qZFwIhUI3fQpLs=",
"lastModified": 1735523292,
"narHash": "sha256-opBsbR/nrGxiiF6XzlVluiHYb6yN/hEwv+lBWTy9xoM=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "ec869190b56a1b4677d24a8bdbcfe80ccea2ece6",
"rev": "6d97d419e5a9b36e6293887a89a078cf85f5a61b",
"type": "github"
},
"original": {
@ -86,11 +66,11 @@
},
"nixpkgs_3": {
"locked": {
"lastModified": 1706487304,
"narHash": "sha256-LE8lVX28MV2jWJsidW13D2qrHU/RUUONendL2Q/WlJg=",
"lastModified": 1728538411,
"narHash": "sha256-f0SBJz1eZ2yOuKUr5CA9BHULGXVSn6miBuUWdTyhUhU=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "90f456026d284c22b3e3497be980b2e47d0b28ac",
"rev": "b69de56fac8c2b6f8fd27f2eca01dcda8e0a4221",
"type": "github"
},
"original": {
@ -105,21 +85,19 @@
"flake-utils": "flake-utils",
"naersk": "naersk",
"nixpkgs": "nixpkgs_2",
"rust-overlay": "rust-overlay",
"trunk": "trunk"
"rust-overlay": "rust-overlay"
}
},
"rust-overlay": {
"inputs": {
"flake-utils": "flake-utils_2",
"nixpkgs": "nixpkgs_3"
},
"locked": {
"lastModified": 1709345349,
"narHash": "sha256-E2tsnkM97cGuzHKOqdkUXfmI+K1wS4dNTJJu5QH2Vuk=",
"lastModified": 1735525800,
"narHash": "sha256-pcN8LAL021zdC99a9F7iEiFCI1wmrE4DpIYUgKpB/jY=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "6e6fde31711e699be2e7fb67aae1c7e23ef606e0",
"rev": "10faa81b4c0135a04716cbd1649260d82b2890cd",
"type": "github"
},
"original": {
@ -142,37 +120,6 @@
"repo": "default",
"type": "github"
}
},
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"trunk": {
"flake": false,
"locked": {
"lastModified": 1709278132,
"narHash": "sha256-aBW4tq2809fZmB6s5qnoqEPBeLtoCv2Xxdcb3UTB5gQ=",
"owner": "thedodd",
"repo": "trunk",
"rev": "e8a6de8deb2d5f75a560546a1739d4b13ff6817f",
"type": "github"
},
"original": {
"owner": "thedodd",
"repo": "trunk",
"type": "github"
}
}
},
"root": "root",

116
flake.nix
View file

@ -4,26 +4,24 @@
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.naersk.url = "github:nix-community/naersk";
inputs.rust-overlay.url = "github:oxalica/rust-overlay";
inputs.trunk = {
url = "github:thedodd/trunk";
flake = false;
};
outputs = {
outputs =
{
self,
nixpkgs,
flake-utils,
naersk,
rust-overlay,
trunk,
}:
(flake-utils.lib.eachDefaultSystem (system: let
(flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [(import rust-overlay)];
overlays = [ (import rust-overlay) ];
};
rust = pkgs.rust-bin.stable.latest.default.override {
targets = ["wasm32-unknown-unknown"];
targets = [ "wasm32-unknown-unknown" ];
};
naersk' = pkgs.callPackage naersk {
cargo = rust;
@ -33,14 +31,13 @@
cargo = rust;
rustc = rust;
};
in {
in
{
devShell = pkgs.mkShell {
nativeBuildInputs = [
rustPlatform.bindgenHook
pkgs.cmake
rust
self.packages.${system}.dioxus
(naersk'.buildPackage trunk)
pkgs.httpie
pkgs.sea-orm-cli
];
@ -49,101 +46,10 @@
};
packages = {
dioxus = pkgs.callPackage ({
rustPlatform,
pkg-config,
cacert,
openssl,
coreutils-full,
}:
rustPlatform.buildRustPackage rec {
pname = "dioxus-cli";
version = "0.4.0";
src = pkgs.fetchCrate {
inherit version pname;
hash = "sha256-4BIuD/rrA398hPEoNt5PwWylPAR0fA1UKc90xyH5Fd0=";
};
nativeBuildInputs = [pkg-config cacert coreutils-full];
buildInputs = [openssl];
OPENSSL_NO_VENDOR = 1;
cargoHash = "sha256-ok+fjvwz4k0/M5j7wut2A2AK6tuO3UfZtgoCXaCaHXY=";
}) {};
server = naersk'.buildPackage ./.;
frontend = let
pkg = {
stdenv,
makeRustPlatform,
wasm-bindgen-cli,
apiServerBase ? "http://localhost:8085",
frontendRoot ? "http://localhost:8080",
fetchzip,
bootstrap ? let
version = "5.3.1";
in
fetchzip {
url = "https://github.com/twbs/bootstrap/releases/download/v${version}/bootstrap-${version}-dist.zip";
hash = "sha256-BKtQB7IaslmmW6cLF4m/uUJQaBDndRf7tJ9gjItKVI4=";
},
bootstrapIcons ? let
version = "1.10.5";
in
fetchzip {
url = "https://github.com/twbs/icons/releases/download/v${version}/bootstrap-icons-${version}.zip";
hash = "sha256-o+owSIRMIXOH/GvQlVNlnCv/hcWD6kmoXNwm7F1Dmxs=";
},
}: let
rustPlatformWasm = makeRustPlatform {
rustc = rust;
cargo = rust;
};
in
stdenv.mkDerivation {
pname = "regalade-web";
version = "0.1.0";
src = ./.;
cargoDeps = rustPlatformWasm.importCargoLock {lockFile = ./Cargo.lock;};
REGALADE_API_SERVER_BASE = apiServerBase;
REGALADE_FRONTEND_DOMAIN = frontendRoot;
nativeBuildInputs = [
self.packages.${system}.dioxus
wasm-bindgen-cli
rustPlatformWasm.cargoSetupHook
rustPlatformWasm.cargoBuildHook
];
buildPhase = ''
runHook preBuild
export XDG_DATA_HOME=/build/data
mkdir -p $XDG_DATA_HOME
cd web
dx build --release
runHook postBuild
'';
installPhase = ''
runHook preInstall
cp -R dist $out
ln -s ${bootstrap} $out/bootstrap
ln -s ${bootstrapIcons} $out/bootstrap-icons
runHook postInstall
'';
};
in
pkgs.callPackage pkg {};
};
}))
}
))
// {
nixosModules.default = import ./nixos self;
};

View file

@ -6,19 +6,19 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
ammonia = "3.3.0"
anyhow = "1.0.79"
ammonia = "4.0.0"
anyhow = "1.0.95"
api = { version = "0.1.0", path = "../api" }
dioxus = "0.4.3"
dioxus-router = { version = "0.4.3", features = ["web"] }
dioxus-web = "0.4.3"
gloo-net = { version = "0.5.0", features = ["json"] }
dioxus = "0.6.1"
dioxus-router = { version = "0.6.1", features = ["web"] }
dioxus-web = "0.6.1"
gloo-net = { version = "0.6.0", features = ["json"] }
gloo-storage = "0.3.0"
gloo-utils = "0.2.0"
itertools = "0.12.0"
log = "0.4.20"
pulldown-cmark = "0.9.3"
serde = { version = "1.0.195", features = ["derive"] }
itertools = "0.13.0"
log = "0.4.22"
pulldown-cmark = "0.12.2"
serde = { version = "1.0.217", features = ["derive"] }
urlencoding = "2.1.3"
uuid = "1.7.0"
wasm-bindgen = "0.2.90"
uuid = "1.11.0"
wasm-bindgen = "0.2.99"

View file

@ -12,5 +12,5 @@ path = "src/lib.rs"
async-std = { version = "1", features = ["attributes", "tokio1"] }
[dependencies.sea-orm-migration]
version = "0.12"
version = "1.1"
features = ["runtime-tokio-rustls", "sqlx-postgres", "sqlx-sqlite"]

View file

@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.1
use sea_orm::entity::prelude::*;
@ -12,12 +12,20 @@ pub struct Model {
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {
#[sea_orm(has_many = "super::household_members::Entity")]
HouseholdMembers,
#[sea_orm(has_many = "super::ingredient::Entity")]
Ingredient,
#[sea_orm(has_many = "super::recipe::Entity")]
Recipe,
}
impl Related<super::household_members::Entity> for Entity {
fn to() -> RelationDef {
Relation::HouseholdMembers.def()
}
}
impl Related<super::ingredient::Entity> for Entity {
fn to() -> RelationDef {
Relation::Ingredient.def()

View file

@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.1
use sea_orm::entity::prelude::*;

View file

@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.1
use sea_orm::entity::prelude::*;
@ -22,6 +22,8 @@ pub enum Relation {
on_delete = "Restrict"
)]
Household,
#[sea_orm(has_many = "super::recipe_ingredients::Entity")]
RecipeIngredients,
}
impl Related<super::household::Entity> for Entity {
@ -30,6 +32,12 @@ impl Related<super::household::Entity> for Entity {
}
}
impl Related<super::recipe_ingredients::Entity> for Entity {
fn to() -> RelationDef {
Relation::RecipeIngredients.def()
}
}
impl Related<super::recipe::Entity> for Entity {
fn to() -> RelationDef {
super::recipe_ingredients::Relation::Recipe.def()

View file

@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.1
pub mod prelude;

View file

@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.1
pub use super::household::Entity as Household;
pub use super::household_members::Entity as HouseholdMembers;

View file

@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.1
use sea_orm::entity::prelude::*;
@ -26,6 +26,8 @@ pub enum Relation {
on_delete = "Restrict"
)]
Household,
#[sea_orm(has_many = "super::recipe_ingredients::Entity")]
RecipeIngredients,
}
impl Related<super::household::Entity> for Entity {
@ -34,6 +36,12 @@ impl Related<super::household::Entity> for Entity {
}
}
impl Related<super::recipe_ingredients::Entity> for Entity {
fn to() -> RelationDef {
Relation::RecipeIngredients.def()
}
}
impl Related<super::ingredient::Entity> for Entity {
fn to() -> RelationDef {
super::recipe_ingredients::Relation::Ingredient.def()

View file

@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.1
use sea_orm::entity::prelude::*;

View file

@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.1
use sea_orm::entity::prelude::*;
@ -9,13 +9,22 @@ pub struct Model {
pub id: Uuid,
#[sea_orm(unique)]
pub name: String,
#[sea_orm(column_type = "Binary(BlobSize::Blob(None))", nullable)]
#[sea_orm(column_type = "VarBinary(StringLen::None)", nullable)]
pub password: Option<Vec<u8>>,
pub open_id_subject: Option<String>,
}
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {}
pub enum Relation {
#[sea_orm(has_many = "super::household_members::Entity")]
HouseholdMembers,
}
impl Related<super::household_members::Entity> for Entity {
fn to() -> RelationDef {
Relation::HouseholdMembers.def()
}
}
impl Related<super::household::Entity> for Entity {
fn to() -> RelationDef {

View file

@ -22,6 +22,7 @@ use time::OffsetDateTime;
use tower_http::services::{ServeDir, ServeFile};
use tower_sessions::{session_store::ExpiredDeletion, SessionManagerLayer};
use tower_sessions_sqlx_store::{sqlx::PgPool, PostgresStore};
use tracing::level_filters::LevelFilter;
use tracing_subscriber::EnvFilter;
use uuid::Uuid;
@ -353,9 +354,12 @@ impl OpenidConnector {
#[tokio::main]
async fn main() -> anyhow::Result<()> {
tracing_subscriber::fmt()
.with_max_level(tracing::Level::DEBUG)
.with_test_writer()
.with_env_filter(EnvFilter::from_default_env())
.with_env_filter(
EnvFilter::builder()
.with_default_directive(LevelFilter::INFO.into())
.from_env()?,
)
.init();
let config = Settings::new()?;
@ -416,7 +420,7 @@ async fn main() -> anyhow::Result<()> {
),
};
tracing::info!("Listening on {addr}");
tracing::info!("Listening on http://{addr}");
let listener = tokio::net::TcpListener::bind(&addr).await?;
axum::serve(listener, router).await?;

View file

@ -7,7 +7,7 @@ edition = "2021"
[dependencies]
console_log = "1.0.0"
dioxus-web = "0.4.3"
dioxus-web = "0.6.1"
gloo-utils = "0.2.0"
log = "0.4.20"
log = "0.4.22"
regalade_gui = { path = "../gui" }