1use crate::internal::FsType;
2use clap::Parser;
3
4#[derive(Debug, Parser, Clone)]
5pub struct KanidmdCli {
6 #[clap(
7 env = "KANIDM_LOG_LEVEL",
8 global = true,
9 help = "Specify the log level (info, debug, trace)"
10 )]
11 pub log_level: Option<sketching::LogLevel>,
12
13 #[clap(
14 env = "KANIDM_OTEL_GRPC_URL",
15 global = true,
16 help = "Specify the OpenTelemetry gRPC URL"
17 )]
18 pub otel_grpc_url: Option<String>,
19
20 #[clap(env = "KANIDM_DOMAIN", global = true, help = "Specify the domain")]
21 pub domain: Option<String>,
22
23 #[clap(env = "KANIDM_ORIGIN", global = true, help = "Specify the origin URL")]
24 pub origin: Option<url::Url>,
25
26 #[clap(
27 env = "KANIDM_DB_PATH",
28 global = true,
29 help = "Specify the database path"
30 )]
31 pub db_path: Option<std::path::PathBuf>,
32
33 #[clap(
34 env = "KANIDM_DB_FS_TYPE",
35 global = true,
36 help = "Specify the database filesystem type, either zfs or generic"
37 )]
38 pub db_fs_type: Option<FsType>,
39
40 #[clap(
41 env = "KANIDM_DB_ARC_SIZE",
42 global = true,
43 help = "Specify the database ARC size in bytes"
44 )]
45 pub db_arc_size: Option<usize>,
46
47 #[clap(
48 env = "KANIDM_ADMIN_BIND_PATH",
49 global = true,
50 help = "Specify the admin bind path"
51 )]
52 pub admin_bind_path: Option<String>,
53
54 #[clap(
56 env = "KANIDM_TLS_CHAIN",
57 global = true,
58 help = "Specify the TLS chain file path"
59 )]
60 pub tls_chain: Option<std::path::PathBuf>,
61 #[clap(
62 env = "KANIDM_TLS_KEY",
63 global = true,
64 help = "Specify the TLS key file path"
65 )]
66 pub tls_key: Option<std::path::PathBuf>,
67
68 #[clap(
69 env = "KANIDM_TLS_CLIENT_CA",
70 global = true,
71 help = "Specify the TLS client CA file path"
72 )]
73 pub tls_client_ca: Option<std::path::PathBuf>,
74
75 #[clap(
77 env = "KANIDM_BINDADDRESS",
78 global = true,
79 help = "Specify the HTTPS server bind address(es)"
80 )]
81 pub bindaddress: Option<String>,
82
83 #[clap(
84 env = "KANIDM_LDAPBINDADDRESS",
85 global = true,
86 help = "Specify the LDAP bind address(es)"
87 )]
88 pub ldapbindaddress: Option<String>,
89
90 #[clap(
91 global = true,
92 hide = true,
93 env = "KANIDM_TRUST_X_FORWARDED_FOR",
94 help = "Whether to blindly trust the X-Forwarded-For header, regardless of source IP"
95 )]
96 pub trust_all_x_forwarded_for: Option<bool>,
97
98 #[clap(
100 env = "KANIDM_REPLICATION_ORIGIN",
101 global = true,
102 help = "Specify the replication origin URL"
103 )]
104 pub replication_origin: Option<url::Url>,
105
106 #[clap(
107 env = "KANIDM_REPLICATION_BINDADDRESS",
108 global = true,
109 help = "Specify the replication bind address"
110 )]
111 pub replication_bindaddress: Option<std::net::SocketAddr>,
112
113 #[clap(
114 env = "KANIDM_REPLICATION_TASK_POLL_INTERVAL",
115 global = true,
116 help = "Specify the replication task poll interval in seconds"
117 )]
118 pub replication_task_poll_interval: Option<u64>,
119
120 #[clap(
122 env = "KANIDM_ONLINE_BACKUP_PATH",
123 global = true,
124 help = "Specify the online backup path"
125 )]
126 pub online_backup_path: Option<std::path::PathBuf>,
127
128 #[clap(
129 global = true,
130 env = "KANIDM_ONLINE_BACKUP_VERSIONS",
131 help = "Number of online backup versions to keep"
132 )]
133 pub online_backup_versions: Option<usize>,
134
135 #[clap(
136 global = true,
137 env = "KANIDM_ONLINE_BACKUP_SCHEDULE",
138 help = "Cron schedule for online backups",
139 last = true
140 )]
141 pub online_backup_schedule: Option<String>,
142}