(*≧ω≦*) Preparing for 0.3.0 release!

~ README revised
~ updated Docker files
+ all const are placed in a separate file
+ auto creation for avatars folder
+ automatic retrieval of the latest Figura version for version request in api
This commit is contained in:
Shiroyasha 2024-08-19 22:54:45 +03:00
parent d45a495cbf
commit dabe176e0e
Signed by: shiroyashik
GPG key ID: E4953D3940D7860A
13 changed files with 355 additions and 224 deletions

View file

@ -1,4 +1,4 @@
use std::{sync::Arc, time::Duration};
use std::sync::Arc;
use anyhow::anyhow;
use axum::{
@ -8,12 +8,10 @@ use dashmap::DashMap;
use tracing::{debug, error, trace};
use uuid::Uuid;
use crate::{ApiError, ApiResult, AppState};
use crate::{ApiError, ApiResult, AppState, TIMEOUT, USER_AGENT};
use super::types::*;
const TIMEOUT: Duration = Duration::from_secs(5);
// It's an extractor that pulls a token from the Header.
#[derive(PartialEq, Debug)]
pub struct Token(pub String);
@ -63,7 +61,7 @@ async fn fetch_json(
server_id: &str,
username: &str,
) -> anyhow::Result<anyhow::Result<(Uuid, AuthProvider)>> {
let client = reqwest::Client::builder().timeout(TIMEOUT).build().unwrap();
let client = reqwest::Client::builder().timeout(TIMEOUT).user_agent(USER_AGENT).build().unwrap();
let url = auth_provider.url.clone();
let res = client