Update deps
This commit is contained in:
parent
ca52201880
commit
39ebfcb1db
4 changed files with 754 additions and 639 deletions
1382
Cargo.lock
generated
1382
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
32
Cargo.toml
32
Cargo.toml
|
|
@ -5,31 +5,31 @@ edition = "2024"
|
|||
|
||||
[dependencies]
|
||||
# CLI options
|
||||
argp = "0.4.0"
|
||||
argp = "0.4.1"
|
||||
# Templates
|
||||
askama = "0.12.1"
|
||||
askama = "0.16.0"
|
||||
async-lock = "3.4.2"
|
||||
base64-turbo = "0.1.3"
|
||||
base64-turbo = "0.2.0"
|
||||
# TOML parser
|
||||
boml = "1.0.2"
|
||||
boml = "2.0.0"
|
||||
#flate2 = "1.1.8"
|
||||
# request parsing
|
||||
form_urlencoded = "1.2.2"
|
||||
# Code highlight
|
||||
giallo = { version = "0.3.1", features = ["dump"] }
|
||||
log = "0.4.29"
|
||||
rand = "0.9.2"
|
||||
serde = { version = "1.0.228", features = ["derive"] }
|
||||
sha2 = "0.10.9"
|
||||
giallo = { version = "0.5.0", features = ["dump"] }
|
||||
log = "0.4.33"
|
||||
rand = "0.10.2"
|
||||
serde = { version = "1.0.229", features = ["derive"] }
|
||||
sha2 = "0.11.0"
|
||||
simplelog = "0.12.2"
|
||||
#tar = "0.4.44"
|
||||
# Web server
|
||||
trillium = "0.2.20"
|
||||
trillium-askama = "0.3.2"
|
||||
trillium-caching-headers = "0.2.3"
|
||||
trillium-client = { version = "0.6.2", features = ["json"] }
|
||||
trillium-native-tls = "0.4.0"
|
||||
trillium-router = "0.4.1"
|
||||
trillium-smol = "0.4.2"
|
||||
trillium = "1.3.0"
|
||||
trillium-askama = "0.5.0"
|
||||
trillium-caching-headers = "0.4.2"
|
||||
trillium-client = { version = "0.9.13", features = ["serde_json"] }
|
||||
trillium-native-tls = "0.6.3"
|
||||
trillium-router = "0.5.2"
|
||||
trillium-smol = "0.7.0"
|
||||
#trillium-static-compiled = "0.5.2"
|
||||
url = "2.5.8"
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ use crate::{
|
|||
repo::{RepoMetadata, WriteRepoMetadataError},
|
||||
};
|
||||
|
||||
use rand::Rng;
|
||||
use rand::RngExt;
|
||||
use serde::Deserialize;
|
||||
use sha2::Digest;
|
||||
use trillium_client::Client;
|
||||
|
|
|
|||
|
|
@ -1,25 +1,15 @@
|
|||
use crate::{
|
||||
cache,
|
||||
config::Config,
|
||||
repo::{ReadRepoMetadataError, RepoMetadataEntry},
|
||||
templates,
|
||||
};
|
||||
use crate::{cache, config::Config, repo::ReadRepoMetadataError, templates};
|
||||
|
||||
use askama::Template;
|
||||
use async_lock::Mutex;
|
||||
use log::error;
|
||||
use std::{
|
||||
collections::{BTreeMap, BTreeSet, HashMap},
|
||||
io::{ErrorKind, Read},
|
||||
path::PathBuf,
|
||||
};
|
||||
use trillium::{Conn, Handler};
|
||||
use trillium_router::{Router, RouterConnExt};
|
||||
|
||||
pub async fn hello_world(conn: Conn) -> Conn {
|
||||
conn.ok("hello world!")
|
||||
}
|
||||
|
||||
pub fn make_router(config: &'static Config) -> impl Handler {
|
||||
let mut hl_registry = giallo::Registry::builtin().unwrap();
|
||||
hl_registry.link_grammars();
|
||||
|
|
@ -45,10 +35,11 @@ pub fn make_router(config: &'static Config) -> impl Handler {
|
|||
conn.ok(crate::templates::Home {}.render().unwrap())
|
||||
})
|
||||
.post("/fetch", move |mut conn: Conn| async move {
|
||||
if let Ok(request_body) = conn.request_body().await.with_max_len(8192).await {
|
||||
if let Ok(request_body) = conn.request_body().with_max_len(8192).read_bytes().await
|
||||
{
|
||||
let mut repo_url = None;
|
||||
let mut commit_hash = None;
|
||||
for (key, val) in form_urlencoded::parse(request_body.as_bytes()) {
|
||||
for (key, val) in form_urlencoded::parse(&request_body) {
|
||||
match key.as_ref() {
|
||||
"repo-url" => {
|
||||
repo_url = Some(val);
|
||||
|
|
|
|||
Loading…
Reference in a new issue