update library

auto-generate-config-docs
Felix Ableitner 2021-09-27 11:36:45 +02:00
parent 79a7721867
commit 700f4eeead
5 changed files with 21 additions and 15 deletions

9
Cargo.lock generated
View File

@ -1002,16 +1002,17 @@ checksum = "31ad93652f40969dead8d4bf897a41e9462095152eb21c56e5830537e41179dd"
[[package]]
name = "doku"
version = "0.9.0"
source = "git+https://github.com/anixe/doku?branch=issue/1#97e58175aa2972c003a8155d6f58aca91a9bfe88"
version = "0.10.0"
source = "git+https://github.com/anixe/doku?branch=v0.10#7397e8fac5cd08585b87546a768903365fa8b8c8"
dependencies = [
"doku-derive",
"serde",
]
[[package]]
name = "doku-derive"
version = "0.9.0"
source = "git+https://github.com/anixe/doku?branch=issue/1#97e58175aa2972c003a8155d6f58aca91a9bfe88"
version = "0.10.0"
source = "git+https://github.com/anixe/doku?branch=v0.10#7397e8fac5cd08585b87546a768903365fa8b8c8"
dependencies = [
"darling 0.13.0",
"proc-macro-error",

View File

@ -64,7 +64,7 @@ activitystreams = "0.7.0-alpha.11"
actix-rt = { version = "2.2.0", default-features = false }
serde_json = { version = "1.0.68", features = ["preserve_order"] }
clokwerk = "0.3.5"
doku = { git = "https://github.com/anixe/doku", branch = "issue/1" }
doku = { git = "https://github.com/anixe/doku", branch = "v0.10" }
[dev-dependencies.cargo-husky]
version = "1.5.0"

View File

@ -39,4 +39,4 @@ deser-hjson = "1.0.2"
smart-default = "0.6.0"
webpage = { version = "1.3.0", default-features = false, features = ["serde"] }
jsonwebtoken = "7.2.0"
doku = { git = "https://github.com/anixe/doku", branch = "issue/1" }
doku = { git = "https://github.com/anixe/doku", branch = "v0.10" }

View File

@ -1,8 +1,8 @@
use doku::prelude::*;
use serde::Deserialize;
use serde::{Deserialize, Serialize};
use std::net::{IpAddr, Ipv4Addr};
#[derive(Debug, Deserialize, Clone, SmartDefault, Doku)]
#[derive(Debug, Deserialize, Serialize, Clone, SmartDefault, Document)]
#[serde(default)]
pub struct Settings {
#[serde(default)]
@ -36,7 +36,7 @@ pub struct Settings {
pub actor_name_max_length: usize,
}
#[derive(Debug, Deserialize, Clone, SmartDefault, Doku)]
#[derive(Debug, Deserialize, Serialize, Clone, SmartDefault, Document)]
#[serde(default)]
pub struct CaptchaConfig {
#[default(false)]
@ -45,7 +45,7 @@ pub struct CaptchaConfig {
pub difficulty: String,
}
#[derive(Debug, Deserialize, Clone, SmartDefault, Doku)]
#[derive(Debug, Deserialize, Serialize, Clone, SmartDefault, Document)]
#[serde(default)]
pub struct DatabaseConfig {
#[default("lemmy")]
@ -62,7 +62,7 @@ pub struct DatabaseConfig {
pub pool_size: u32,
}
#[derive(Debug, Deserialize, Clone, Doku)]
#[derive(Debug, Deserialize, Serialize, Clone, Document)]
pub struct EmailConfig {
#[doku(example = "localhost:25")]
pub smtp_server: String,
@ -73,7 +73,7 @@ pub struct EmailConfig {
pub use_tls: bool,
}
#[derive(Debug, Deserialize, Clone, SmartDefault, Doku)]
#[derive(Debug, Deserialize, Serialize, Clone, SmartDefault, Document)]
#[serde(default)]
pub struct FederationConfig {
#[default(false)]
@ -86,7 +86,7 @@ pub struct FederationConfig {
pub strict_allowlist: bool,
}
#[derive(Debug, Deserialize, Clone, SmartDefault, Doku)]
#[derive(Debug, Deserialize, Serialize, Clone, SmartDefault, Document)]
#[serde(default)]
pub struct RateLimitConfig {
#[default(180)]
@ -107,7 +107,7 @@ pub struct RateLimitConfig {
pub image_per_second: i32,
}
#[derive(Debug, Deserialize, Clone, SmartDefault, Doku)]
#[derive(Debug, Deserialize, Serialize, Clone, SmartDefault, Document)]
pub struct SetupConfig {
#[doku(example = "admin")]
pub admin_username: String,

View File

@ -7,6 +7,7 @@ use diesel::{
r2d2::{ConnectionManager, Pool},
PgConnection,
};
use doku::json::{AutoComments, Formatting};
use lemmy_api::match_websocket_operation;
use lemmy_api_common::blocking;
use lemmy_api_crud::match_websocket_operation_crud;
@ -32,7 +33,11 @@ embed_migrations!();
async fn main() -> Result<(), LemmyError> {
let args: Vec<String> = env::args().collect();
if args.len() == 2 && args[1] == "--print-config-docs" {
println!("{}", doku::to_json_val(&Settings::default()));
let fmt = Formatting {
auto_comments: AutoComments::none(),
..Default::default()
};
println!("{}", doku::to_json_fmt_val(&fmt, &Settings::default()));
return Ok(());
}