Self-hosted fleet management platform for Linux
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: config validation + info logging by default

+90 -292
+15 -285
Cargo.lock
··· 12 12 ] 13 13 14 14 [[package]] 15 - name = "android_system_properties" 16 - version = "0.1.5" 17 - source = "registry+https://github.com/rust-lang/crates.io-index" 18 - checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" 19 - dependencies = [ 20 - "libc", 21 - ] 22 - 23 - [[package]] 24 - name = "ansi_term" 25 - version = "0.12.1" 26 - source = "registry+https://github.com/rust-lang/crates.io-index" 27 - checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" 28 - dependencies = [ 29 - "winapi", 30 - ] 31 - 32 - [[package]] 33 15 name = "anstream" 34 16 version = "1.0.0" 35 17 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 86 68 checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" 87 69 88 70 [[package]] 89 - name = "autocfg" 90 - version = "1.5.0" 91 - source = "registry+https://github.com/rust-lang/crates.io-index" 92 - checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" 93 - 94 - [[package]] 95 71 name = "axum" 96 72 version = "0.8.9" 97 73 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 177 153 ] 178 154 179 155 [[package]] 180 - name = "bumpalo" 181 - version = "3.20.2" 182 - source = "registry+https://github.com/rust-lang/crates.io-index" 183 - checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb" 184 - 185 - [[package]] 186 156 name = "bytes" 187 157 version = "1.11.1" 188 158 source = "registry+https://github.com/rust-lang/crates.io-index" 189 159 checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" 190 160 191 161 [[package]] 192 - name = "cc" 193 - version = "1.2.60" 194 - source = "registry+https://github.com/rust-lang/crates.io-index" 195 - checksum = "43c5703da9466b66a946814e1adf53ea2c90f10063b86290cc9eb67ce3478a20" 196 - dependencies = [ 197 - "find-msvc-tools", 198 - "shlex", 199 - ] 200 - 201 - [[package]] 202 162 name = "cfg-if" 203 163 version = "1.0.4" 204 164 source = "registry+https://github.com/rust-lang/crates.io-index" 205 165 checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" 206 - 207 - [[package]] 208 - name = "chrono" 209 - version = "0.4.44" 210 - source = "registry+https://github.com/rust-lang/crates.io-index" 211 - checksum = "c673075a2e0e5f4a1dde27ce9dee1ea4558c7ffe648f576438a20ca1d2acc4b0" 212 - dependencies = [ 213 - "iana-time-zone", 214 - "num-traits", 215 - "windows-link", 216 - ] 217 166 218 167 [[package]] 219 168 name = "clap" ··· 289 238 version = "0.9.6" 290 239 source = "registry+https://github.com/rust-lang/crates.io-index" 291 240 checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" 292 - 293 - [[package]] 294 - name = "core-foundation-sys" 295 - version = "0.8.7" 296 - source = "registry+https://github.com/rust-lang/crates.io-index" 297 - checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" 298 241 299 242 [[package]] 300 243 name = "cpufeatures" ··· 411 354 checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" 412 355 413 356 [[package]] 414 - name = "find-msvc-tools" 415 - version = "0.1.9" 416 - source = "registry+https://github.com/rust-lang/crates.io-index" 417 - checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" 418 - 419 - [[package]] 420 357 name = "form_urlencoded" 421 358 version = "1.2.2" 422 359 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 584 521 ] 585 522 586 523 [[package]] 587 - name = "iana-time-zone" 588 - version = "0.1.65" 589 - source = "registry+https://github.com/rust-lang/crates.io-index" 590 - checksum = "e31bc9ad994ba00e440a8aa5c9ef0ec67d5cb5e5cb0cc7f8b744a35b389cc470" 591 - dependencies = [ 592 - "android_system_properties", 593 - "core-foundation-sys", 594 - "iana-time-zone-haiku", 595 - "js-sys", 596 - "log", 597 - "wasm-bindgen", 598 - "windows-core", 599 - ] 600 - 601 - [[package]] 602 - name = "iana-time-zone-haiku" 603 - version = "0.1.2" 604 - source = "registry+https://github.com/rust-lang/crates.io-index" 605 - checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" 606 - dependencies = [ 607 - "cc", 608 - ] 609 - 610 - [[package]] 611 524 name = "indexmap" 612 525 version = "2.14.0" 613 526 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 630 543 checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" 631 544 632 545 [[package]] 633 - name = "js-sys" 634 - version = "0.3.95" 635 - source = "registry+https://github.com/rust-lang/crates.io-index" 636 - checksum = "2964e92d1d9dc3364cae4d718d93f227e3abb088e747d92e0395bfdedf1c12ca" 637 - dependencies = [ 638 - "once_cell", 639 - "wasm-bindgen", 640 - ] 641 - 642 - [[package]] 643 546 name = "lazy_static" 644 547 version = "1.5.0" 645 548 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 723 626 724 627 [[package]] 725 628 name = "matchers" 726 - version = "0.0.1" 629 + version = "0.2.0" 727 630 source = "registry+https://github.com/rust-lang/crates.io-index" 728 - checksum = "f099785f7595cc4b4553a174ce30dd7589ef93391ff414dbb67f62392b9e0ce1" 631 + checksum = "d1525a2a28c7f4fa0fc98bb91ae755d1e2d1505079e05539e35bc876b5d65ae9" 729 632 dependencies = [ 730 - "regex-automata 0.1.10", 633 + "regex-automata", 731 634 ] 732 635 733 636 [[package]] ··· 760 663 ] 761 664 762 665 [[package]] 763 - name = "num-traits" 764 - version = "0.2.19" 666 + name = "nu-ansi-term" 667 + version = "0.50.3" 765 668 source = "registry+https://github.com/rust-lang/crates.io-index" 766 - checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" 669 + checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" 767 670 dependencies = [ 768 - "autocfg", 671 + "windows-sys", 769 672 ] 770 673 771 674 [[package]] ··· 839 742 ] 840 743 841 744 [[package]] 842 - name = "regex" 843 - version = "1.12.3" 844 - source = "registry+https://github.com/rust-lang/crates.io-index" 845 - checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276" 846 - dependencies = [ 847 - "aho-corasick", 848 - "memchr", 849 - "regex-automata 0.4.14", 850 - "regex-syntax 0.8.10", 851 - ] 852 - 853 - [[package]] 854 - name = "regex-automata" 855 - version = "0.1.10" 856 - source = "registry+https://github.com/rust-lang/crates.io-index" 857 - checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" 858 - dependencies = [ 859 - "regex-syntax 0.6.29", 860 - ] 861 - 862 - [[package]] 863 745 name = "regex-automata" 864 746 version = "0.4.14" 865 747 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 867 749 dependencies = [ 868 750 "aho-corasick", 869 751 "memchr", 870 - "regex-syntax 0.8.10", 752 + "regex-syntax", 871 753 ] 872 754 873 755 [[package]] 874 756 name = "regex-syntax" 875 - version = "0.6.29" 876 - source = "registry+https://github.com/rust-lang/crates.io-index" 877 - checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" 878 - 879 - [[package]] 880 - name = "regex-syntax" 881 757 version = "0.8.10" 882 758 source = "registry+https://github.com/rust-lang/crates.io-index" 883 759 checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" ··· 890 766 dependencies = [ 891 767 "semver", 892 768 ] 893 - 894 - [[package]] 895 - name = "rustversion" 896 - version = "1.0.22" 897 - source = "registry+https://github.com/rust-lang/crates.io-index" 898 - checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" 899 769 900 770 [[package]] 901 771 name = "ryu" ··· 1005 875 ] 1006 876 1007 877 [[package]] 1008 - name = "shlex" 1009 - version = "1.3.0" 1010 - source = "registry+https://github.com/rust-lang/crates.io-index" 1011 - checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" 1012 - 1013 - [[package]] 1014 878 name = "signal-hook-registry" 1015 879 version = "1.4.8" 1016 880 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1260 1124 1261 1125 [[package]] 1262 1126 name = "tracing-log" 1263 - version = "0.1.4" 1127 + version = "0.2.0" 1264 1128 source = "registry+https://github.com/rust-lang/crates.io-index" 1265 - checksum = "f751112709b4e791d8ce53e32c4ed2d353565a795ce84da2285393f41557bdf2" 1129 + checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" 1266 1130 dependencies = [ 1267 1131 "log", 1268 1132 "once_cell", ··· 1270 1134 ] 1271 1135 1272 1136 [[package]] 1273 - name = "tracing-serde" 1274 - version = "0.1.3" 1275 - source = "registry+https://github.com/rust-lang/crates.io-index" 1276 - checksum = "bc6b213177105856957181934e4920de57730fc69bf42c37ee5bb664d406d9e1" 1277 - dependencies = [ 1278 - "serde", 1279 - "tracing-core", 1280 - ] 1281 - 1282 - [[package]] 1283 1137 name = "tracing-subscriber" 1284 - version = "0.2.25" 1138 + version = "0.3.23" 1285 1139 source = "registry+https://github.com/rust-lang/crates.io-index" 1286 - checksum = "0e0d2eaa99c3c2e41547cfa109e910a68ea03823cccad4a0525dcbc9b01e8c71" 1140 + checksum = "cb7f578e5945fb242538965c2d0b04418d38ec25c79d160cd279bf0731c8d319" 1287 1141 dependencies = [ 1288 - "ansi_term", 1289 - "chrono", 1290 - "lazy_static", 1291 1142 "matchers", 1292 - "regex", 1293 - "serde", 1294 - "serde_json", 1143 + "nu-ansi-term", 1144 + "once_cell", 1145 + "regex-automata", 1295 1146 "sharded-slab", 1296 1147 "smallvec", 1297 1148 "thread_local", 1298 1149 "tracing", 1299 1150 "tracing-core", 1300 1151 "tracing-log", 1301 - "tracing-serde", 1302 1152 ] 1303 1153 1304 1154 [[package]] ··· 1338 1188 checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" 1339 1189 1340 1190 [[package]] 1341 - name = "wasm-bindgen" 1342 - version = "0.2.118" 1343 - source = "registry+https://github.com/rust-lang/crates.io-index" 1344 - checksum = "0bf938a0bacb0469e83c1e148908bd7d5a6010354cf4fb73279b7447422e3a89" 1345 - dependencies = [ 1346 - "cfg-if", 1347 - "once_cell", 1348 - "rustversion", 1349 - "wasm-bindgen-macro", 1350 - "wasm-bindgen-shared", 1351 - ] 1352 - 1353 - [[package]] 1354 - name = "wasm-bindgen-macro" 1355 - version = "0.2.118" 1356 - source = "registry+https://github.com/rust-lang/crates.io-index" 1357 - checksum = "eeff24f84126c0ec2db7a449f0c2ec963c6a49efe0698c4242929da037ca28ed" 1358 - dependencies = [ 1359 - "quote", 1360 - "wasm-bindgen-macro-support", 1361 - ] 1362 - 1363 - [[package]] 1364 - name = "wasm-bindgen-macro-support" 1365 - version = "0.2.118" 1366 - source = "registry+https://github.com/rust-lang/crates.io-index" 1367 - checksum = "9d08065faf983b2b80a79fd87d8254c409281cf7de75fc4b773019824196c904" 1368 - dependencies = [ 1369 - "bumpalo", 1370 - "proc-macro2", 1371 - "quote", 1372 - "syn", 1373 - "wasm-bindgen-shared", 1374 - ] 1375 - 1376 - [[package]] 1377 - name = "wasm-bindgen-shared" 1378 - version = "0.2.118" 1379 - source = "registry+https://github.com/rust-lang/crates.io-index" 1380 - checksum = "5fd04d9e306f1907bd13c6361b5c6bfc7b3b3c095ed3f8a9246390f8dbdee129" 1381 - dependencies = [ 1382 - "unicode-ident", 1383 - ] 1384 - 1385 - [[package]] 1386 - name = "winapi" 1387 - version = "0.3.9" 1388 - source = "registry+https://github.com/rust-lang/crates.io-index" 1389 - checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 1390 - dependencies = [ 1391 - "winapi-i686-pc-windows-gnu", 1392 - "winapi-x86_64-pc-windows-gnu", 1393 - ] 1394 - 1395 - [[package]] 1396 - name = "winapi-i686-pc-windows-gnu" 1397 - version = "0.4.0" 1398 - source = "registry+https://github.com/rust-lang/crates.io-index" 1399 - checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 1400 - 1401 - [[package]] 1402 - name = "winapi-x86_64-pc-windows-gnu" 1403 - version = "0.4.0" 1404 - source = "registry+https://github.com/rust-lang/crates.io-index" 1405 - checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 1406 - 1407 - [[package]] 1408 - name = "windows-core" 1409 - version = "0.62.2" 1410 - source = "registry+https://github.com/rust-lang/crates.io-index" 1411 - checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" 1412 - dependencies = [ 1413 - "windows-implement", 1414 - "windows-interface", 1415 - "windows-link", 1416 - "windows-result", 1417 - "windows-strings", 1418 - ] 1419 - 1420 - [[package]] 1421 - name = "windows-implement" 1422 - version = "0.60.2" 1423 - source = "registry+https://github.com/rust-lang/crates.io-index" 1424 - checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" 1425 - dependencies = [ 1426 - "proc-macro2", 1427 - "quote", 1428 - "syn", 1429 - ] 1430 - 1431 - [[package]] 1432 - name = "windows-interface" 1433 - version = "0.59.3" 1434 - source = "registry+https://github.com/rust-lang/crates.io-index" 1435 - checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" 1436 - dependencies = [ 1437 - "proc-macro2", 1438 - "quote", 1439 - "syn", 1440 - ] 1441 - 1442 - [[package]] 1443 1191 name = "windows-link" 1444 1192 version = "0.2.1" 1445 1193 source = "registry+https://github.com/rust-lang/crates.io-index" 1446 1194 checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" 1447 - 1448 - [[package]] 1449 - name = "windows-result" 1450 - version = "0.4.1" 1451 - source = "registry+https://github.com/rust-lang/crates.io-index" 1452 - checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" 1453 - dependencies = [ 1454 - "windows-link", 1455 - ] 1456 - 1457 - [[package]] 1458 - name = "windows-strings" 1459 - version = "0.5.1" 1460 - source = "registry+https://github.com/rust-lang/crates.io-index" 1461 - checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" 1462 - dependencies = [ 1463 - "windows-link", 1464 - ] 1465 1195 1466 1196 [[package]] 1467 1197 name = "windows-sys"
+1 -1
Cargo.toml
··· 41 41 tokio = { version = "1.48", features = ["macros", "rt-multi-thread", "signal"] } 42 42 tokio-util = "0.7" 43 43 tracing = "0.1" 44 - tracing-subscriber = "0.2" 44 + tracing-subscriber = { version = "0.3", features = ["env-filter"] } 45 45 46 46 [profile.release] 47 47 lto = "fat"
+1 -1
crates/api/build.rs
··· 8 8 .unwrap_or_else(|_| "unknown".to_string()); 9 9 10 10 let git_sha = Command::new("git") 11 - .args(["rev-parse", "HEAD"]) 11 + .args(["rev-parse", "--short", "HEAD"]) 12 12 .output() 13 13 .map(|o| String::from_utf8_lossy(&o.stdout).trim().to_string()) 14 14 .unwrap_or_else(|_| "unknown".to_string());
+1 -1
crates/core/auth/build.rs
··· 8 8 .unwrap_or_else(|_| "unknown".to_string()); 9 9 10 10 let git_sha = Command::new("git") 11 - .args(["rev-parse", "HEAD"]) 11 + .args(["rev-parse", "--short", "HEAD"]) 12 12 .output() 13 13 .map(|o| String::from_utf8_lossy(&o.stdout).trim().to_string()) 14 14 .unwrap_or_else(|_| "unknown".to_string());
+1 -1
crates/core/build.rs
··· 8 8 .unwrap_or_else(|_| "unknown".to_string()); 9 9 10 10 let git_sha = Command::new("git") 11 - .args(["rev-parse", "HEAD"]) 11 + .args(["rev-parse", "--short", "HEAD"]) 12 12 .output() 13 13 .map(|o| String::from_utf8_lossy(&o.stdout).trim().to_string()) 14 14 .unwrap_or_else(|_| "unknown".to_string());
+26
crates/core/crypto/build.rs
··· 1 + use std::process::Command; 2 + 3 + fn main() { 4 + let timestamp = Command::new("date") 5 + .arg("+%Y-%m-%d %H:%M:%S UTC") 6 + .output() 7 + .map(|o| String::from_utf8_lossy(&o.stdout).trim().to_string()) 8 + .unwrap_or_else(|_| "unknown".to_string()); 9 + 10 + let git_sha = Command::new("git") 11 + .args(["rev-parse", "--short", "HEAD"]) 12 + .output() 13 + .map(|o| String::from_utf8_lossy(&o.stdout).trim().to_string()) 14 + .unwrap_or_else(|_| "unknown".to_string()); 15 + 16 + let git_branch = Command::new("git") 17 + .args(["rev-parse", "--abbrev-ref", "HEAD"]) 18 + .output() 19 + .map(|o| String::from_utf8_lossy(&o.stdout).trim().to_string()) 20 + .unwrap_or_else(|_| "unknown".to_string()); 21 + 22 + println!("cargo:rustc-env=BUILD_TIMESTAMP={}", timestamp); 23 + println!("cargo:rustc-env=BUILD_GIT_SHA={}", git_sha); 24 + println!("cargo:rustc-env=BUILD_GIT_BRANCH={}", git_branch); 25 + println!("cargo:rerun-if-changed=build.rs"); 26 + }
+1 -1
crates/database/build.rs
··· 8 8 .unwrap_or_else(|_| "unknown".to_string()); 9 9 10 10 let git_sha = Command::new("git") 11 - .args(["rev-parse", "HEAD"]) 11 + .args(["rev-parse", "--short", "HEAD"]) 12 12 .output() 13 13 .map(|o| String::from_utf8_lossy(&o.stdout).trim().to_string()) 14 14 .unwrap_or_else(|_| "unknown".to_string());
+1 -1
crates/server/build.rs
··· 8 8 .unwrap_or_else(|_| "unknown".to_string()); 9 9 10 10 let git_sha = Command::new("git") 11 - .args(["rev-parse", "HEAD"]) 11 + .args(["rev-parse", "--short", "HEAD"]) 12 12 .output() 13 13 .map(|o| String::from_utf8_lossy(&o.stdout).trim().to_string()) 14 14 .unwrap_or_else(|_| "unknown".to_string());
+35
crates/server/config/src/lib.rs
··· 69 69 pub secrets: SecretsConfig, 70 70 } 71 71 72 + impl LucidConfig { 73 + /// Validate the configuration, returning a list of errors if any issues are found. 74 + pub fn validate(&self) -> Result<(), ConfigError> { 75 + let mut errors = Vec::new(); 76 + 77 + // Validate signing keys 78 + let mut signing_key_ids = std::collections::HashSet::new(); 79 + if self.secrets.signing_keys.is_empty() { 80 + errors.push("At least one signing key must be configured".to_string()); 81 + } 82 + for key in &self.secrets.signing_keys { 83 + if !signing_key_ids.insert(&key.key_id) { 84 + errors.push(format!("Duplicate signing key_id: {}", key.key_id)); 85 + } 86 + } 87 + 88 + // Validate encryption keys 89 + let mut encryption_key_ids = std::collections::HashSet::new(); 90 + if self.secrets.encryption_keys.is_empty() { 91 + errors.push("At least one encryption key must be configured".to_string()); 92 + } 93 + for key in &self.secrets.encryption_keys { 94 + if !encryption_key_ids.insert(&key.key_id) { 95 + errors.push(format!("Duplicate encryption key_id: {}", key.key_id)); 96 + } 97 + } 98 + 99 + if errors.is_empty() { 100 + Ok(()) 101 + } else { 102 + Err(ConfigError { errors }) 103 + } 104 + } 105 + } 106 + 72 107 #[derive(Debug, Config)] 73 108 pub struct ServerConfig { 74 109 /// Address to bind the HTTP server to.
+8 -1
crates/server/src/main.rs
··· 38 38 }; 39 39 } 40 40 41 - tracing_subscriber::fmt::init(); 41 + tracing_subscriber::fmt() 42 + .with_env_filter(tracing_subscriber::EnvFilter::try_from_default_env().unwrap_or_else(|_| "info".into())) 43 + .init(); 42 44 43 45 let config = match lucid_server_config::load(cli.config.as_ref()) { 44 46 Ok(config) => config, ··· 47 49 return ExitCode::FAILURE; 48 50 } 49 51 }; 52 + 53 + if let Err(e) = config.validate() { 54 + error!("Configuration validation failed: {e}"); 55 + return ExitCode::FAILURE; 56 + } 50 57 51 58 lucid_server_config::init(config); 52 59