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(env = "KANIDM_ROLE", global = true, help = "Specify the server role")]
27 pub role: Option<crate::config::ServerRole>,
28
29 #[clap(
30 env = "KANIDM_DB_PATH",
31 global = true,
32 help = "Specify the database path"
33 )]
34 pub db_path: Option<std::path::PathBuf>,
35
36 #[clap(
37 env = "KANIDM_DB_FS_TYPE",
38 global = true,
39 help = "Specify the database filesystem type, either zfs or generic"
40 )]
41 pub db_fs_type: Option<FsType>,
42
43 #[clap(
44 env = "KANIDM_DB_ARC_SIZE",
45 global = true,
46 help = "Specify the database ARC size in bytes"
47 )]
48 pub db_arc_size: Option<usize>,
49
50 #[clap(
51 env = "KANIDM_SERVER_ADMIN_BIND_PATH",
52 global = true,
53 help = "Specify the admin bind path"
54 )]
55 pub admin_bind_path: Option<String>,
56
57 #[clap(
59 env = "KANIDM_TLS_CHAIN",
60 global = true,
61 help = "Specify the TLS chain file path"
62 )]
63 pub tls_chain: Option<std::path::PathBuf>,
64 #[clap(
65 env = "KANIDM_TLS_KEY",
66 global = true,
67 help = "Specify the TLS key file path"
68 )]
69 pub tls_key: Option<std::path::PathBuf>,
70
71 #[clap(
72 env = "KANIDM_TLS_CLIENT_CA",
73 global = true,
74 help = "Specify the TLS client CA file path"
75 )]
76 pub tls_client_ca: Option<std::path::PathBuf>,
77
78 #[clap(
80 env = "KANIDM_BINDADDRESS",
81 global = true,
82 help = "Specify the HTTPS server bind address(es)"
83 )]
84 pub bindaddress: Option<String>,
85
86 #[clap(
87 env = "KANIDM_LDAPBINDADDRESS",
88 global = true,
89 help = "Specify the LDAP bind address(es)"
90 )]
91 pub ldapbindaddress: Option<String>,
92
93 #[clap(
94 global = true,
95 hide = true,
96 env = "KANIDM_TRUST_X_FORWARDED_FOR",
97 help = "Whether to blindly trust the X-Forwarded-For header, regardless of source IP"
98 )]
99 pub trust_all_x_forwarded_for: Option<bool>,
100
101 #[clap(
103 env = "KANIDM_REPLICATION_ORIGIN",
104 global = true,
105 help = "Specify the replication origin URL"
106 )]
107 pub replication_origin: Option<url::Url>,
108
109 #[clap(
110 env = "KANIDM_REPLICATION_BINDADDRESS",
111 global = true,
112 help = "Specify the replication bind address"
113 )]
114 pub replication_bindaddress: Option<std::net::SocketAddr>,
115
116 #[clap(
117 env = "KANIDM_REPLICATION_TASK_POLL_INTERVAL",
118 global = true,
119 help = "Specify the replication task poll interval in seconds"
120 )]
121 pub replication_task_poll_interval: Option<u64>,
122
123 #[clap(
125 env = "KANIDM_ONLINE_BACKUP_PATH",
126 global = true,
127 help = "Specify the online backup path"
128 )]
129 pub online_backup_path: Option<std::path::PathBuf>,
130
131 #[clap(
132 global = true,
133 env = "KANIDM_ONLINE_BACKUP_VERSIONS",
134 help = "Number of online backup versions to keep"
135 )]
136 pub online_backup_versions: Option<usize>,
137
138 #[clap(
139 global = true,
140 env = "KANIDM_ONLINE_BACKUP_SCHEDULE",
141 help = "Cron schedule for online backups",
142 last = true
143 )]
144 pub online_backup_schedule: Option<String>,
145}