Compare commits
167 Commits
1.0.1
...
b24642b10d
Author | SHA1 | Date | |
---|---|---|---|
b24642b10d | |||
ce45d841b2 | |||
1b4e5eda9d | |||
bb1917d1b4 | |||
b285323bd7 | |||
ecb161ee82 | |||
00c6ae338b | |||
814046146c | |||
f52e992d84 | |||
dc73882347 | |||
5ed8c42b99 | |||
0fcb902e9e | |||
cfafbda77b | |||
dace42aef2 | |||
67401e8faf | |||
77a278bd53 | |||
6df43fcc0e | |||
8add37fc42 | |||
bfde6531c2 | |||
5f6ac7bcfd | |||
c01f1ca484 | |||
c6975c2097 | |||
2d079403c5 | |||
2d408871ad | |||
22fd077380 | |||
0fba1caf62 | |||
7e99cfc086 | |||
511011bb4b | |||
dfca6a04bc | |||
4f639522b9 | |||
7d9af6af64 | |||
e1136926a1 | |||
4206d9529b | |||
b606aed10e | |||
9a2ceb9804 | |||
f6bd7b1061 | |||
34460500a0 | |||
72afa3df62 | |||
e74f7d6f6d | |||
5b09aec93a | |||
9f93f76d8e | |||
211369a1b2 | |||
d7c4cd6635 | |||
4f78e99f65 | |||
4309a19f24 | |||
67a0436d02 | |||
5ff169d8c2 | |||
541f7cbe95 | |||
166ac5c8c2 | |||
0b53037140 | |||
901f6b0e6f | |||
fc5f9735bf | |||
094ff457ac | |||
ffbbd14ac3 | |||
e4447e9dcb | |||
973190f5b9 | |||
ededf48977 | |||
9a5211812e | |||
6f589f3ee4 | |||
499c5cb81e | |||
d72cdbf3cd | |||
7ab60c6fe6 | |||
bf28d1c926 | |||
07ca3aa80e | |||
4cc18d407d | |||
7bcafd782f | |||
404fa716f5 | |||
43bbb444db | |||
71a139af59 | |||
c40b4acf7a | |||
41a228484f | |||
9965de686d | |||
3cf808df1c | |||
40b41688e0 | |||
124b0b825c | |||
8e4bed012d | |||
ff79fd968e | |||
ac26065f10 | |||
b8b172f17d | |||
12fe1abb0f | |||
acfacf574b | |||
d0e426bbbc | |||
92a9a5741c | |||
9a480dfa98 | |||
f8eafe31bd | |||
4330e64489 | |||
fd5730cfce | |||
76acf07b17 | |||
315e11a2bb | |||
5722ccc2c4 | |||
71718151d0 | |||
9efd8db8cf | |||
fc0c86bf8b | |||
1a8c3ff9ff | |||
4cb05b375e | |||
f67ccc7cda | |||
8a08ff53df | |||
2607ac7355 | |||
e644aa1390 | |||
e015f01539 | |||
37aed38174 | |||
aa3677a787 | |||
549193632c | |||
407aeaaf6e | |||
36d269dde7 | |||
0c4f352815 | |||
e1abc68292 | |||
bb0226577d | |||
9fcd16784a | |||
d6e0eccb00 | |||
dc621984fb | |||
b2878510d6 | |||
a059076323 | |||
f594802523 | |||
747d2d819b | |||
a52868a3fb | |||
fce38386eb | |||
cb88a19352 | |||
c6c34efebd | |||
eed9637f1e | |||
3a64b2b09c | |||
8d2f0cb38a | |||
5b1cf61832 | |||
6cd5d5f93a | |||
fc409b2584 | |||
5a1942cb15 | |||
4af8904294 | |||
0d1605169d | |||
346ea8db11 | |||
f534a9c61b | |||
2ef056da30 | |||
af16091fab | |||
28f81248bf | |||
cc43f6c78b | |||
060ff08c1e | |||
57ce643163 | |||
7a536ac850 | |||
685eef5c5b | |||
180126d22a | |||
e29f01bc62 | |||
f2abdfe302 | |||
598286d1cb | |||
30f196aa7a | |||
08f1ec6d4d | |||
d31a568c00 | |||
1b25c07e50 | |||
96f1640378 | |||
ccb4ae22f8 | |||
d66e2b9bf7 | |||
0660066941 | |||
7476924e0e | |||
65c3c534f4 | |||
995e1fa07e | |||
1735077db3 | |||
31bb956a29 | |||
ff0e548422 | |||
837835da7e | |||
2d262bb4c9 | |||
f594ebfbaa | |||
57a9c03308 | |||
7b9db9c7c3 | |||
b7720df305 | |||
445c1b014e | |||
aa732af571 | |||
c365f959e7 | |||
9a4c6d2de2 | |||
3c20cca915 |
358
central_backend/Cargo.lock
generated
358
central_backend/Cargo.lock
generated
@ -1,6 +1,6 @@
|
||||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
version = 3
|
||||
version = 4
|
||||
|
||||
[[package]]
|
||||
name = "actix"
|
||||
@ -492,24 +492,34 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "anyhow"
|
||||
version = "1.0.90"
|
||||
version = "1.0.95"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "37bf3594c4c988a53154954629820791dde498571819ae4ca50ca811e060cc95"
|
||||
checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04"
|
||||
|
||||
[[package]]
|
||||
name = "arbitrary"
|
||||
version = "1.4.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dde20b3d026af13f561bdd0f15edf01fc734f0dafcedbaf42bba506a9517f223"
|
||||
dependencies = [
|
||||
"derive_arbitrary",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "asn1"
|
||||
version = "0.17.0"
|
||||
version = "0.20.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "147a10032de7d9e6f21c3f1cb1c9c0f94cf30ef67f38310588fe6cfa53e0d3f0"
|
||||
checksum = "2d8b84b4ea1de2bf1dcd2a759737ddb328fb6695b2a95eb7e44fed67e3406f32"
|
||||
dependencies = [
|
||||
"asn1_derive",
|
||||
"itoa",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "asn1_derive"
|
||||
version = "0.17.0"
|
||||
version = "0.20.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3df30ecdcaf8338675a1413460a1b11df89789e1fcc6a10dc52f6e38b6982aa2"
|
||||
checksum = "a200809d0138620b3dba989f1d08d0620e76248bc1e62a2ec1b2df5eb1ee08ad"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
@ -644,10 +654,31 @@ dependencies = [
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cc"
|
||||
version = "1.1.30"
|
||||
name = "bzip2"
|
||||
version = "0.4.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b16803a61b81d9eabb7eae2588776c4c1e584b738ede45fdbb4c972cec1e9945"
|
||||
checksum = "bdb116a6ef3f6c3698828873ad02c3014b3c85cadb88496095628e3ef1e347f8"
|
||||
dependencies = [
|
||||
"bzip2-sys",
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bzip2-sys"
|
||||
version = "0.1.11+1.0.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc"
|
||||
dependencies = [
|
||||
"cc",
|
||||
"libc",
|
||||
"pkg-config",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cc"
|
||||
version = "1.1.31"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c2e7962b54006dcfcc61cb72735f4d89bb97061dd6a7ed882ec6b8ee53714c6f"
|
||||
dependencies = [
|
||||
"jobserver",
|
||||
"libc",
|
||||
@ -656,7 +687,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "central_backend"
|
||||
version = "0.1.0"
|
||||
version = "1.0.2"
|
||||
dependencies = [
|
||||
"actix",
|
||||
"actix-cors",
|
||||
@ -692,10 +723,12 @@ dependencies = [
|
||||
"serde",
|
||||
"serde_json",
|
||||
"serde_yml",
|
||||
"thiserror",
|
||||
"thiserror 2.0.11",
|
||||
"tokio",
|
||||
"tokio_schedule",
|
||||
"uuid",
|
||||
"walkdir",
|
||||
"zip",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -706,9 +739,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
||||
|
||||
[[package]]
|
||||
name = "chrono"
|
||||
version = "0.4.38"
|
||||
version = "0.4.39"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401"
|
||||
checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825"
|
||||
dependencies = [
|
||||
"android-tzdata",
|
||||
"iana-time-zone",
|
||||
@ -730,9 +763,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "clap"
|
||||
version = "4.5.20"
|
||||
version = "4.5.26"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b97f376d85a664d5837dbae44bf546e6477a679ff6610010f17276f686d867e8"
|
||||
checksum = "a8eb5e908ef3a6efbe1ed62520fb7287959888c88485abe072543190ecc66783"
|
||||
dependencies = [
|
||||
"clap_builder",
|
||||
"clap_derive",
|
||||
@ -740,9 +773,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "clap_builder"
|
||||
version = "4.5.20"
|
||||
version = "4.5.26"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "19bc80abd44e4bed93ca373a0704ccbd1b710dc5749406201bb018272808dc54"
|
||||
checksum = "96b01801b5fc6a0a232407abc821660c9c6d25a1cafc0d4f85f29fb8d9afc121"
|
||||
dependencies = [
|
||||
"anstream",
|
||||
"anstyle",
|
||||
@ -752,9 +785,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "clap_derive"
|
||||
version = "4.5.18"
|
||||
version = "4.5.24"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab"
|
||||
checksum = "54b755194d6389280185988721fffba69495eed5ee9feeee9a599b53db80318c"
|
||||
dependencies = [
|
||||
"heck",
|
||||
"proc-macro2",
|
||||
@ -764,9 +797,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "clap_lex"
|
||||
version = "0.7.2"
|
||||
version = "0.7.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97"
|
||||
checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6"
|
||||
|
||||
[[package]]
|
||||
name = "colorchoice"
|
||||
@ -774,6 +807,12 @@ version = "1.0.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0"
|
||||
|
||||
[[package]]
|
||||
name = "constant_time_eq"
|
||||
version = "0.3.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6"
|
||||
|
||||
[[package]]
|
||||
name = "convert_case"
|
||||
version = "0.4.0"
|
||||
@ -823,6 +862,21 @@ dependencies = [
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crc"
|
||||
version = "3.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "69e6e4d7b33a94f0991c26729976b10ebde1d34c3ee82408fb536164fa10d636"
|
||||
dependencies = [
|
||||
"crc-catalog",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crc-catalog"
|
||||
version = "2.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5"
|
||||
|
||||
[[package]]
|
||||
name = "crc32fast"
|
||||
version = "1.4.2"
|
||||
@ -923,6 +977,12 @@ dependencies = [
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "deflate64"
|
||||
version = "0.1.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "da692b8d1080ea3045efaab14434d40468c3d8657e42abddfffca87b428f4c1b"
|
||||
|
||||
[[package]]
|
||||
name = "deranged"
|
||||
version = "0.3.11"
|
||||
@ -932,6 +992,17 @@ dependencies = [
|
||||
"powerfmt",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "derive_arbitrary"
|
||||
version = "1.4.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "30542c1ad912e0e3d22a1935c290e12e8a29d704a420177a31faad4a601a0800"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "derive_more"
|
||||
version = "0.99.18"
|
||||
@ -998,6 +1069,17 @@ dependencies = [
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "displaydoc"
|
||||
version = "0.2.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "dotenvy"
|
||||
version = "0.15.7"
|
||||
@ -1031,9 +1113,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "env_logger"
|
||||
version = "0.11.5"
|
||||
version = "0.11.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e13fa619b91fb2381732789fc5de83b45675e882f66623b7d8cb4f643017018d"
|
||||
checksum = "dcaee3d8e3cfc3fd92428d477bc97fc29ec8716d180c0d74c643bb26166660e0"
|
||||
dependencies = [
|
||||
"anstream",
|
||||
"anstyle",
|
||||
@ -1106,9 +1188,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "fs4"
|
||||
version = "0.10.0"
|
||||
version = "0.12.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ec6fcfb3c0c1d71612528825042261419d5dade9678c39a781e05b63677d9b32"
|
||||
checksum = "c29c30684418547d476f0b48e84f4821639119c483b1eccd566c8cd0cd05f521"
|
||||
dependencies = [
|
||||
"rustix",
|
||||
"windows-sys 0.52.0",
|
||||
@ -1387,9 +1469,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4"
|
||||
|
||||
[[package]]
|
||||
name = "hyper"
|
||||
version = "1.4.1"
|
||||
version = "1.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05"
|
||||
checksum = "bbbff0a806a4728c99295b254c8838933b5b082d75e3cb70c8dab21fdfbcfa9a"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"futures-channel",
|
||||
@ -1440,9 +1522,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "hyper-util"
|
||||
version = "0.1.9"
|
||||
version = "0.1.10"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "41296eb09f183ac68eec06e03cdbea2e759633d4067b2f6552fc2e009bcad08b"
|
||||
checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"futures-channel",
|
||||
@ -1498,9 +1580,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "impl-more"
|
||||
version = "0.1.6"
|
||||
version = "0.1.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "206ca75c9c03ba3d4ace2460e57b189f39f43de612c2f85836e65c929701bb2d"
|
||||
checksum = "aae21c3177a27788957044151cc2800043d127acaa460a47ebb9b84dfa2c6aa0"
|
||||
|
||||
[[package]]
|
||||
name = "indexmap"
|
||||
@ -1591,9 +1673,9 @@ checksum = "d4345964bb142484797b161f473a503a434de77149dd8c7427788c6e13379388"
|
||||
|
||||
[[package]]
|
||||
name = "lazy-regex"
|
||||
version = "3.3.0"
|
||||
version = "3.4.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8d8e41c97e6bc7ecb552016274b99fbb5d035e8de288c582d9b933af6677bfda"
|
||||
checksum = "60c7310b93682b36b98fa7ea4de998d3463ccbebd94d935d6b48ba5b6ffa7126"
|
||||
dependencies = [
|
||||
"lazy-regex-proc_macros",
|
||||
"once_cell",
|
||||
@ -1602,9 +1684,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "lazy-regex-proc_macros"
|
||||
version = "3.3.0"
|
||||
version = "3.4.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "76e1d8b05d672c53cb9c7b920bbba8783845ae4f0b076e02a3db1d02c81b4163"
|
||||
checksum = "4ba01db5ef81e17eb10a5e0f2109d1b3a3e29bac3070fdbd7d156bf7dbd206a1"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
@ -1620,9 +1702,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
|
||||
|
||||
[[package]]
|
||||
name = "libc"
|
||||
version = "0.2.161"
|
||||
version = "0.2.169"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1"
|
||||
checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a"
|
||||
|
||||
[[package]]
|
||||
name = "libredox"
|
||||
@ -1677,12 +1759,28 @@ dependencies = [
|
||||
"scopeguard",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "lockfree-object-pool"
|
||||
version = "0.1.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9374ef4228402d4b7e403e5838cb880d9ee663314b0a900d5a6aabf0c213552e"
|
||||
|
||||
[[package]]
|
||||
name = "log"
|
||||
version = "0.4.22"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24"
|
||||
|
||||
[[package]]
|
||||
name = "lzma-rs"
|
||||
version = "0.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "297e814c836ae64db86b36cf2a557ba54368d03f6afcd7d947c266692f71115e"
|
||||
dependencies = [
|
||||
"byteorder",
|
||||
"crc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "memchr"
|
||||
version = "2.7.4"
|
||||
@ -1878,6 +1976,16 @@ version = "1.0.15"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a"
|
||||
|
||||
[[package]]
|
||||
name = "pbkdf2"
|
||||
version = "0.12.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2"
|
||||
dependencies = [
|
||||
"digest",
|
||||
"hmac",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pem"
|
||||
version = "3.0.4"
|
||||
@ -1955,9 +2063,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "proc-macro2"
|
||||
version = "1.0.87"
|
||||
version = "1.0.88"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b3e4daa0dcf6feba26f985457cdf104d4b4256fc5a09547140f3631bb076b19a"
|
||||
checksum = "7c3a7fc5db1e57d5a779a352c8cdb57b29aa4c40cc69c3a68a7fedc815fbf2f9"
|
||||
dependencies = [
|
||||
"unicode-ident",
|
||||
]
|
||||
@ -2018,7 +2126,7 @@ checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43"
|
||||
dependencies = [
|
||||
"getrandom",
|
||||
"libredox",
|
||||
"thiserror",
|
||||
"thiserror 1.0.69",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -2058,9 +2166,9 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c"
|
||||
|
||||
[[package]]
|
||||
name = "reqwest"
|
||||
version = "0.12.8"
|
||||
version = "0.12.12"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f713147fbe92361e52392c73b8c9e48c04c6625bce969ef54dc901e58e042a7b"
|
||||
checksum = "43e734407157c3c2034e0258f5e4473ddb361b1e85f95a66690d67264d7cd1da"
|
||||
dependencies = [
|
||||
"base64 0.22.1",
|
||||
"bytes",
|
||||
@ -2091,6 +2199,7 @@ dependencies = [
|
||||
"system-configuration",
|
||||
"tokio",
|
||||
"tokio-native-tls",
|
||||
"tower",
|
||||
"tower-service",
|
||||
"url",
|
||||
"wasm-bindgen",
|
||||
@ -2178,9 +2287,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "rustls"
|
||||
version = "0.23.14"
|
||||
version = "0.23.15"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "415d9944693cb90382053259f89fbb077ea730ad7273047ec63b19bc9b160ba8"
|
||||
checksum = "5fbb44d7acc4e873d613422379f69f237a1b141928c02f6bc6ccfddddc2d7993"
|
||||
dependencies = [
|
||||
"once_cell",
|
||||
"rustls-pki-types",
|
||||
@ -2200,9 +2309,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "rustls-pki-types"
|
||||
version = "1.9.0"
|
||||
version = "1.10.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0e696e35370c65c9c541198af4543ccd580cf17fc25d8e05c5a242b202488c55"
|
||||
checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b"
|
||||
|
||||
[[package]]
|
||||
name = "rustls-webpki"
|
||||
@ -2276,27 +2385,27 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "semver"
|
||||
version = "1.0.23"
|
||||
version = "1.0.26"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b"
|
||||
checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0"
|
||||
dependencies = [
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde"
|
||||
version = "1.0.210"
|
||||
version = "1.0.217"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a"
|
||||
checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70"
|
||||
dependencies = [
|
||||
"serde_derive",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde_derive"
|
||||
version = "1.0.210"
|
||||
version = "1.0.217"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f"
|
||||
checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
@ -2305,9 +2414,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "serde_json"
|
||||
version = "1.0.129"
|
||||
version = "1.0.140"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6dbcf9b78a125ee667ae19388837dd12294b858d101fdd393cb9d5501ef09eb2"
|
||||
checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373"
|
||||
dependencies = [
|
||||
"itoa",
|
||||
"memchr",
|
||||
@ -2388,6 +2497,12 @@ dependencies = [
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "simd-adler32"
|
||||
version = "0.3.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe"
|
||||
|
||||
[[package]]
|
||||
name = "simple_asn1"
|
||||
version = "0.6.2"
|
||||
@ -2396,7 +2511,7 @@ checksum = "adc4e5204eb1910f40f9cfa375f6f05b68c3abac4b6fd879c8ff5e7ae8a0a085"
|
||||
dependencies = [
|
||||
"num-bigint",
|
||||
"num-traits",
|
||||
"thiserror",
|
||||
"thiserror 1.0.69",
|
||||
"time",
|
||||
]
|
||||
|
||||
@ -2445,9 +2560,9 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292"
|
||||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "2.0.79"
|
||||
version = "2.0.87"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590"
|
||||
checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
@ -2510,18 +2625,38 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "thiserror"
|
||||
version = "1.0.64"
|
||||
version = "1.0.69"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84"
|
||||
checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52"
|
||||
dependencies = [
|
||||
"thiserror-impl",
|
||||
"thiserror-impl 1.0.69",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "thiserror"
|
||||
version = "2.0.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d452f284b73e6d76dd36758a0c8684b1d5be31f92b89d07fd5822175732206fc"
|
||||
dependencies = [
|
||||
"thiserror-impl 2.0.11",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "thiserror-impl"
|
||||
version = "1.0.64"
|
||||
version = "1.0.69"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3"
|
||||
checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "thiserror-impl"
|
||||
version = "2.0.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "26afc1baea8a989337eeb52b6e72a039780ce45c3edfcc9c5b9d112feeb173c2"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
@ -2576,9 +2711,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
|
||||
|
||||
[[package]]
|
||||
name = "tokio"
|
||||
version = "1.40.0"
|
||||
version = "1.43.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998"
|
||||
checksum = "3d61fa4ffa3de412bfea335c6ecff681de2b609ba3c77ef3e00e521813a9ed9e"
|
||||
dependencies = [
|
||||
"backtrace",
|
||||
"bytes",
|
||||
@ -2594,9 +2729,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tokio-macros"
|
||||
version = "2.4.0"
|
||||
version = "2.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752"
|
||||
checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
@ -2658,6 +2793,27 @@ dependencies = [
|
||||
"tokio",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tower"
|
||||
version = "0.5.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9"
|
||||
dependencies = [
|
||||
"futures-core",
|
||||
"futures-util",
|
||||
"pin-project-lite",
|
||||
"sync_wrapper",
|
||||
"tokio",
|
||||
"tower-layer",
|
||||
"tower-service",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tower-layer"
|
||||
version = "0.3.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e"
|
||||
|
||||
[[package]]
|
||||
name = "tower-service"
|
||||
version = "0.3.3"
|
||||
@ -2698,12 +2854,9 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825"
|
||||
|
||||
[[package]]
|
||||
name = "unicase"
|
||||
version = "2.7.0"
|
||||
version = "2.8.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89"
|
||||
dependencies = [
|
||||
"version_check",
|
||||
]
|
||||
checksum = "7e51b68083f157f853b6379db119d1c1be0e6e4dec98101079dec41f6f5cf6df"
|
||||
|
||||
[[package]]
|
||||
name = "unicode-bidi"
|
||||
@ -2773,9 +2926,9 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"
|
||||
|
||||
[[package]]
|
||||
name = "uuid"
|
||||
version = "1.10.0"
|
||||
version = "1.11.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314"
|
||||
checksum = "b913a3b5fe84142e269d63cc62b64319ccaf89b748fc31fe025177f767a756c4"
|
||||
dependencies = [
|
||||
"getrandom",
|
||||
"serde",
|
||||
@ -3079,6 +3232,63 @@ name = "zeroize"
|
||||
version = "1.8.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde"
|
||||
dependencies = [
|
||||
"zeroize_derive",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zeroize_derive"
|
||||
version = "1.4.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zip"
|
||||
version = "2.2.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ae9c1ea7b3a5e1f4b922ff856a129881167511563dc219869afe3787fc0c1a45"
|
||||
dependencies = [
|
||||
"aes",
|
||||
"arbitrary",
|
||||
"bzip2",
|
||||
"constant_time_eq",
|
||||
"crc32fast",
|
||||
"crossbeam-utils",
|
||||
"deflate64",
|
||||
"displaydoc",
|
||||
"flate2",
|
||||
"hmac",
|
||||
"indexmap",
|
||||
"lzma-rs",
|
||||
"memchr",
|
||||
"pbkdf2",
|
||||
"rand",
|
||||
"sha1",
|
||||
"thiserror 2.0.11",
|
||||
"time",
|
||||
"zeroize",
|
||||
"zopfli",
|
||||
"zstd",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zopfli"
|
||||
version = "0.8.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e5019f391bac5cf252e93bbcc53d039ffd62c7bfb7c150414d61369afe57e946"
|
||||
dependencies = [
|
||||
"bumpalo",
|
||||
"crc32fast",
|
||||
"lockfree-object-pool",
|
||||
"log",
|
||||
"once_cell",
|
||||
"simd-adler32",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zstd"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "central_backend"
|
||||
version = "0.1.0"
|
||||
version = "1.0.2"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
@ -10,26 +10,26 @@ lazy_static = "1.5.0"
|
||||
dotenvy = "0.15.7"
|
||||
clap = { version = "4.5.20", features = ["derive", "env"] }
|
||||
anyhow = "1.0.89"
|
||||
thiserror = "1.0.64"
|
||||
thiserror = "2.0.3"
|
||||
openssl = { version = "0.10.66" }
|
||||
openssl-sys = "0.9.102"
|
||||
libc = "0.2.159"
|
||||
foreign-types-shared = "0.1.1"
|
||||
asn1 = "0.17"
|
||||
asn1 = "0.20"
|
||||
actix-web = { version = "4", features = ["openssl"] }
|
||||
futures = "0.3.31"
|
||||
serde = { version = "1.0.210", features = ["derive"] }
|
||||
serde = { version = "1.0.215", features = ["derive"] }
|
||||
reqwest = { version = "0.12.7", features = ["json"] }
|
||||
serde_json = "1.0.128"
|
||||
serde_json = "1.0.131"
|
||||
rand = "0.8.5"
|
||||
actix = "0.13.5"
|
||||
actix-identity = "0.8.0"
|
||||
actix-session = { version = "0.10.1", features = ["cookie-session"] }
|
||||
actix-cors = "0.7.0"
|
||||
actix-multipart = { version ="0.7.2", features = ["derive"] }
|
||||
actix-multipart = { version = "0.7.2", features = ["derive"] }
|
||||
actix-remote-ip = "0.1.0"
|
||||
futures-util = "0.3.31"
|
||||
uuid = { version = "1.10.0", features = ["v4", "serde"] }
|
||||
uuid = { version = "1.11.0", features = ["v4", "serde"] }
|
||||
semver = { version = "1.0.23", features = ["serde"] }
|
||||
lazy-regex = "3.3.0"
|
||||
tokio = { version = "1.40.0", features = ["full"] }
|
||||
@ -41,4 +41,6 @@ prettytable-rs = "0.10.0"
|
||||
chrono = "0.4.38"
|
||||
serde_yml = "0.0.12"
|
||||
bincode = "=2.0.0-rc.3"
|
||||
fs4 = { version = "0.10.0", features = ["sync"] }
|
||||
fs4 = { version = "0.12.0", features = ["sync"] }
|
||||
zip = { version = "2.2.0", features = ["bzip2"] }
|
||||
walkdir = "2.5.0"
|
@ -10,7 +10,7 @@ pub enum ConsumptionHistoryType {
|
||||
}
|
||||
|
||||
/// Electrical consumption fetcher backend
|
||||
#[derive(Subcommand, Debug, Clone)]
|
||||
#[derive(Subcommand, Debug, Clone, serde::Serialize)]
|
||||
pub enum ConsumptionBackend {
|
||||
/// Constant consumption value
|
||||
Constant {
|
||||
@ -49,7 +49,7 @@ pub enum ConsumptionBackend {
|
||||
}
|
||||
|
||||
/// Solar system central backend
|
||||
#[derive(Parser, Debug)]
|
||||
#[derive(Parser, Debug, serde::Serialize)]
|
||||
#[command(version, about, long_about = None)]
|
||||
pub struct AppConfig {
|
||||
/// Read arguments from env file
|
||||
@ -110,6 +110,18 @@ pub struct AppConfig {
|
||||
#[arg(short('f'), long, env, default_value_t = 5)]
|
||||
pub energy_fetch_interval: u64,
|
||||
|
||||
/// Custom current consumption title in dashboard
|
||||
#[arg(long, env)]
|
||||
pub dashboard_custom_current_consumption_title: Option<String>,
|
||||
|
||||
/// Custom relays consumption title in dashboard
|
||||
#[arg(long, env)]
|
||||
pub dashboard_custom_relays_consumption_title: Option<String>,
|
||||
|
||||
/// Custom cached consumption title in dashboard
|
||||
#[arg(long, env)]
|
||||
pub dashboard_custom_cached_consumption_title: Option<String>,
|
||||
|
||||
/// Consumption backend provider
|
||||
#[clap(subcommand)]
|
||||
pub consumption_backend: Option<ConsumptionBackend>,
|
||||
|
@ -120,7 +120,7 @@ enum GenCertificatSubjectReq<'a> {
|
||||
CSR { csr: &'a X509Req },
|
||||
}
|
||||
|
||||
impl<'a> Default for GenCertificatSubjectReq<'a> {
|
||||
impl Default for GenCertificatSubjectReq<'_> {
|
||||
fn default() -> Self {
|
||||
Self::Subject { cn: "" }
|
||||
}
|
||||
|
@ -71,7 +71,11 @@ pub async fn get_curr_consumption() -> anyhow::Result<EnergyConsumption> {
|
||||
let response = match curl {
|
||||
false => reqwest::get(url).await?.json::<FroniusResponse>().await?,
|
||||
true => {
|
||||
let res = std::process::Command::new("curl").arg(url).output()?;
|
||||
let res = std::process::Command::new("curl")
|
||||
.arg("--connect-timeout")
|
||||
.arg("1.5")
|
||||
.arg(url)
|
||||
.output()?;
|
||||
|
||||
if !res.status.success() {
|
||||
return Err(ConsumptionError::CurlReqFailed.into());
|
||||
|
@ -25,7 +25,14 @@ impl EnergyActor {
|
||||
pub async fn new() -> anyhow::Result<Self> {
|
||||
let consumption_cache_size =
|
||||
AppConfig::get().refresh_interval / AppConfig::get().energy_fetch_interval;
|
||||
let curr_consumption = consumption::get_curr_consumption().await?;
|
||||
let curr_consumption = match consumption::get_curr_consumption().await {
|
||||
Ok(v) => v,
|
||||
Err(e) => {
|
||||
log::warn!("Failed to fetch consumption, using default value! {e}");
|
||||
constants::FALLBACK_PRODUCTION_VALUE
|
||||
}
|
||||
};
|
||||
log::info!("Initial consumption value: {curr_consumption}");
|
||||
let mut consumption_cache = ConsumptionCache::new(consumption_cache_size as usize);
|
||||
consumption_cache.add_value(curr_consumption);
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
use crate::app_config::AppConfig;
|
||||
use crate::devices::device::{DeviceRelay, DeviceRelayID};
|
||||
use crate::utils::files_utils;
|
||||
use crate::utils::time_utils::{day_number, time_start_of_day};
|
||||
use crate::utils::time_utils::{day_number, time_secs, time_start_of_day};
|
||||
|
||||
const TIME_INTERVAL: usize = 30;
|
||||
|
||||
@ -128,9 +128,20 @@ pub fn relay_total_runtime_adjusted(relay: &DeviceRelay) -> usize {
|
||||
.unwrap_or(0);
|
||||
|
||||
let time_start_day = time_start_of_day().unwrap_or(1726696800);
|
||||
let start_time = time_start_day + reset_time as u64;
|
||||
let end_time = time_start_day + 3600 * 24 + reset_time as u64;
|
||||
relay_total_runtime(relay.id, start_time, end_time).unwrap_or(3600 * 24)
|
||||
|
||||
// Check if we have reached reset_time today yet or not
|
||||
if time_start_day + reset_time as u64 <= time_secs() {
|
||||
let start_time = time_start_day + reset_time as u64;
|
||||
let end_time = time_start_day + 3600 * 24 + reset_time as u64;
|
||||
relay_total_runtime(relay.id, start_time, end_time).unwrap_or(3600 * 24)
|
||||
}
|
||||
// If we have not reached reset time yet, we need to focus on previous day
|
||||
else {
|
||||
let time_start_yesterday = time_start_day - 3600 * 24;
|
||||
let start_time = time_start_yesterday + reset_time as u64;
|
||||
let end_time = time_start_day + reset_time as u64;
|
||||
relay_total_runtime(relay.id, start_time, end_time).unwrap_or(3600 * 24)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
@ -35,7 +35,7 @@ pub fn save_log(
|
||||
.as_bytes(),
|
||||
)?;
|
||||
file.flush()?;
|
||||
file.unlock()?;
|
||||
fs4::fs_std::FileExt::unlock(&file)?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ use actix_web::HttpResponse;
|
||||
use std::error::Error;
|
||||
use std::fmt::{Display, Formatter};
|
||||
use std::io::ErrorKind;
|
||||
use zip::result::ZipError;
|
||||
|
||||
/// Custom error to ease controller writing
|
||||
#[derive(Debug)]
|
||||
@ -109,6 +110,18 @@ impl From<openssl::error::ErrorStack> for HttpErr {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<ZipError> for HttpErr {
|
||||
fn from(value: ZipError) -> Self {
|
||||
HttpErr::Err(std::io::Error::new(ErrorKind::Other, value.to_string()).into())
|
||||
}
|
||||
}
|
||||
|
||||
impl From<walkdir::Error> for HttpErr {
|
||||
fn from(value: walkdir::Error) -> Self {
|
||||
HttpErr::Err(std::io::Error::new(ErrorKind::Other, value.to_string()).into())
|
||||
}
|
||||
}
|
||||
|
||||
impl From<HttpResponse> for HttpErr {
|
||||
fn from(value: HttpResponse) -> Self {
|
||||
HttpErr::HTTPResponse(value)
|
||||
|
@ -243,6 +243,11 @@ pub async fn secure_server(energy_actor: EnergyActorAddr) -> anyhow::Result<()>
|
||||
"/web_api/relay/{id}/status",
|
||||
web::get().to(relays_controller::status_single),
|
||||
)
|
||||
// Management API
|
||||
.route(
|
||||
"/web_api/management/download_storage",
|
||||
web::get().to(management_controller::download_storage),
|
||||
)
|
||||
// Devices API
|
||||
.route(
|
||||
"/devices_api/utils/time",
|
||||
|
@ -9,14 +9,20 @@ use actix_web::HttpResponse;
|
||||
|
||||
#[derive(serde::Serialize)]
|
||||
struct Consumption {
|
||||
consumption: i32,
|
||||
consumption: Option<i32>,
|
||||
}
|
||||
|
||||
/// Get current energy consumption
|
||||
pub async fn curr_consumption() -> HttpResult {
|
||||
let consumption = consumption::get_curr_consumption().await?;
|
||||
|
||||
Ok(HttpResponse::Ok().json(Consumption { consumption }))
|
||||
Ok(match consumption::get_curr_consumption().await {
|
||||
Ok(v) => HttpResponse::Ok().json(Consumption {
|
||||
consumption: Some(v),
|
||||
}),
|
||||
Err(e) => {
|
||||
log::error!("Failed to fetch current consumption! {e}");
|
||||
HttpResponse::Ok().json(Consumption { consumption: None })
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/// Get curr consumption history
|
||||
@ -34,7 +40,9 @@ pub async fn curr_consumption_history() -> HttpResult {
|
||||
pub async fn cached_consumption(energy_actor: WebEnergyActor) -> HttpResult {
|
||||
let consumption = energy_actor.send(energy_actor::GetCurrConsumption).await?;
|
||||
|
||||
Ok(HttpResponse::Ok().json(Consumption { consumption }))
|
||||
Ok(HttpResponse::Ok().json(Consumption {
|
||||
consumption: Some(consumption),
|
||||
}))
|
||||
}
|
||||
|
||||
/// Get current relays consumption
|
||||
@ -42,7 +50,9 @@ pub async fn relays_consumption(energy_actor: WebEnergyActor) -> HttpResult {
|
||||
let consumption =
|
||||
energy_actor.send(energy_actor::RelaysConsumption).await? as EnergyConsumption;
|
||||
|
||||
Ok(HttpResponse::Ok().json(Consumption { consumption }))
|
||||
Ok(HttpResponse::Ok().json(Consumption {
|
||||
consumption: Some(consumption),
|
||||
}))
|
||||
}
|
||||
|
||||
pub async fn relays_consumption_history() -> HttpResult {
|
||||
|
66
central_backend/src/server/web_api/management_controller.rs
Normal file
66
central_backend/src/server/web_api/management_controller.rs
Normal file
@ -0,0 +1,66 @@
|
||||
use crate::app_config::AppConfig;
|
||||
use crate::server::custom_error::HttpResult;
|
||||
use crate::utils::time_utils::current_day;
|
||||
use actix_web::HttpResponse;
|
||||
use anyhow::Context;
|
||||
use std::fs::File;
|
||||
use std::io::{Cursor, Read, Write};
|
||||
use walkdir::WalkDir;
|
||||
use zip::write::SimpleFileOptions;
|
||||
|
||||
/// Download a full copy of the storage data
|
||||
pub async fn download_storage() -> HttpResult {
|
||||
let mut zip_buff = Cursor::new(Vec::new());
|
||||
let mut zip = zip::ZipWriter::new(&mut zip_buff);
|
||||
|
||||
let options = SimpleFileOptions::default()
|
||||
.compression_method(zip::CompressionMethod::Bzip2)
|
||||
.unix_permissions(0o700);
|
||||
|
||||
let storage = AppConfig::get().storage_path();
|
||||
|
||||
let mut file_buff = Vec::new();
|
||||
for entry in WalkDir::new(&storage) {
|
||||
let entry = entry?;
|
||||
|
||||
let path = entry.path();
|
||||
let name = path.strip_prefix(&storage).unwrap();
|
||||
let path_as_string = name
|
||||
.to_str()
|
||||
.map(str::to_owned)
|
||||
.with_context(|| format!("{name:?} Is a Non UTF-8 Path"))?;
|
||||
|
||||
// Write file or directory explicitly
|
||||
// Some unzip tools unzip files with directory paths correctly, some do not!
|
||||
if path.is_file() {
|
||||
log::debug!("adding file {path:?} as {name:?} ...");
|
||||
zip.start_file(path_as_string, options)?;
|
||||
let mut f = File::open(path)?;
|
||||
|
||||
f.read_to_end(&mut file_buff)?;
|
||||
zip.write_all(&file_buff)?;
|
||||
file_buff.clear();
|
||||
} else if !name.as_os_str().is_empty() {
|
||||
// Only if not root! Avoids path spec / warning
|
||||
// and mapname conversion failed error on unzip
|
||||
log::debug!("adding dir {path_as_string:?} as {name:?} ...");
|
||||
zip.add_directory(path_as_string, options)?;
|
||||
}
|
||||
}
|
||||
|
||||
// Inject runtime configuration
|
||||
zip.start_file("/app_config.json", options)?;
|
||||
zip.write_all(&serde_json::to_vec_pretty(&AppConfig::get())?)?;
|
||||
|
||||
zip.finish()?;
|
||||
|
||||
let filename = format!("storage-{}.zip", current_day());
|
||||
|
||||
Ok(HttpResponse::Ok()
|
||||
.content_type("application/zip")
|
||||
.insert_header((
|
||||
"content-disposition",
|
||||
format!("attachment; filename=\"{filename}\""),
|
||||
))
|
||||
.body(zip_buff.into_inner()))
|
||||
}
|
@ -2,6 +2,7 @@ pub mod auth_controller;
|
||||
pub mod devices_controller;
|
||||
pub mod energy_controller;
|
||||
pub mod logging_controller;
|
||||
pub mod management_controller;
|
||||
pub mod ota_controller;
|
||||
pub mod relays_controller;
|
||||
pub mod server_controller;
|
||||
|
@ -13,6 +13,10 @@ struct ServerConfig {
|
||||
auth_disabled: bool,
|
||||
constraints: StaticConstraints,
|
||||
unsecure_origin: String,
|
||||
backend_version: &'static str,
|
||||
dashboard_custom_current_consumption_title: Option<&'static str>,
|
||||
dashboard_custom_relays_consumption_title: Option<&'static str>,
|
||||
dashboard_custom_cached_consumption_title: Option<&'static str>,
|
||||
}
|
||||
|
||||
impl Default for ServerConfig {
|
||||
@ -21,6 +25,16 @@ impl Default for ServerConfig {
|
||||
auth_disabled: AppConfig::get().unsecure_disable_login,
|
||||
constraints: Default::default(),
|
||||
unsecure_origin: AppConfig::get().unsecure_origin(),
|
||||
backend_version: env!("CARGO_PKG_VERSION"),
|
||||
dashboard_custom_current_consumption_title: AppConfig::get()
|
||||
.dashboard_custom_current_consumption_title
|
||||
.as_deref(),
|
||||
dashboard_custom_relays_consumption_title: AppConfig::get()
|
||||
.dashboard_custom_relays_consumption_title
|
||||
.as_deref(),
|
||||
dashboard_custom_cached_consumption_title: AppConfig::get()
|
||||
.dashboard_custom_cached_consumption_title
|
||||
.as_deref(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
use chrono::prelude::*;
|
||||
use std::time::{SystemTime, UNIX_EPOCH};
|
||||
|
||||
/// Get the current time since epoch
|
||||
/// Get the current time since epoch, in seconds
|
||||
pub fn time_secs() -> u64 {
|
||||
SystemTime::now()
|
||||
.duration_since(UNIX_EPOCH)
|
||||
@ -41,6 +41,12 @@ pub fn time_start_of_day() -> anyhow::Result<u64> {
|
||||
Ok(local.timestamp() as u64)
|
||||
}
|
||||
|
||||
/// Get formatted string containing current day information
|
||||
pub fn current_day() -> String {
|
||||
let dt = Local::now();
|
||||
format!("{}-{:0>2}-{:0>2}", dt.year(), dt.month(), dt.day())
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use crate::utils::time_utils::day_number;
|
||||
|
2494
central_frontend/package-lock.json
generated
2494
central_frontend/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -10,34 +10,34 @@
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
"@emotion/react": "^11.13.3",
|
||||
"@emotion/react": "^11.14.0",
|
||||
"@emotion/styled": "^11.13.0",
|
||||
"@fontsource/roboto": "^5.1.0",
|
||||
"@fontsource/roboto": "^5.1.1",
|
||||
"@mdi/js": "^7.4.47",
|
||||
"@mdi/react": "^1.6.1",
|
||||
"@mui/icons-material": "^6.1.3",
|
||||
"@mui/material": "^6.1.3",
|
||||
"@mui/x-charts": "^7.20.0",
|
||||
"@mui/x-date-pickers": "^7.20.0",
|
||||
"@mui/icons-material": "^6.3.0",
|
||||
"@mui/material": "^6.3.0",
|
||||
"@mui/x-charts": "^7.21.0",
|
||||
"@mui/x-date-pickers": "^7.23.3",
|
||||
"@types/semver": "^7.5.8",
|
||||
"date-and-time": "^3.6.0",
|
||||
"dayjs": "^1.11.13",
|
||||
"filesize": "^10.1.6",
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1",
|
||||
"react-router-dom": "^6.27.0",
|
||||
"react": "^19.0.0",
|
||||
"react-dom": "^19.0.0",
|
||||
"react-router-dom": "^7.1.1",
|
||||
"semver": "^7.6.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/react": "^18.3.11",
|
||||
"@types/react-dom": "^18.3.1",
|
||||
"@typescript-eslint/eslint-plugin": "^8.8.0",
|
||||
"@typescript-eslint/parser": "^8.8.0",
|
||||
"@types/react": "^19.0.0",
|
||||
"@types/react-dom": "^19.0.0",
|
||||
"@typescript-eslint/eslint-plugin": "^8.18.2",
|
||||
"@typescript-eslint/parser": "^8.18.2",
|
||||
"@vitejs/plugin-react": "^4.3.2",
|
||||
"eslint": "^8.57.1",
|
||||
"eslint": "^9.17.0",
|
||||
"eslint-plugin-react-hooks": "^5.0.0",
|
||||
"eslint-plugin-react-refresh": "^0.4.12",
|
||||
"typescript": "^5.6.3",
|
||||
"vite": "^5.4.8"
|
||||
"vite": "^6.0.6"
|
||||
}
|
||||
}
|
||||
|
@ -16,6 +16,7 @@ import { PendingDevicesRoute } from "./routes/PendingDevicesRoute";
|
||||
import { RelaysListRoute } from "./routes/RelaysListRoute";
|
||||
import { BaseAuthenticatedPage } from "./widgets/BaseAuthenticatedPage";
|
||||
import { OTARoute } from "./routes/OTARoute";
|
||||
import { ManagementRoute } from "./routes/ManagementRoute";
|
||||
|
||||
export function App() {
|
||||
if (!AuthApi.SignedIn && !ServerApi.Config.auth_disabled)
|
||||
@ -31,6 +32,7 @@ export function App() {
|
||||
<Route path="relays" element={<RelaysListRoute />} />
|
||||
<Route path="ota" element={<OTARoute />} />
|
||||
<Route path="logs" element={<LogsRoute />} />
|
||||
<Route path="management" element={<ManagementRoute />} />
|
||||
<Route path="*" element={<NotFoundRoute />} />
|
||||
</Route>
|
||||
)
|
||||
|
@ -4,6 +4,10 @@ export interface ServerConfig {
|
||||
auth_disabled: boolean;
|
||||
constraints: ServerConstraint;
|
||||
unsecure_origin: string;
|
||||
backend_version: string;
|
||||
dashboard_custom_current_consumption_title?: string;
|
||||
dashboard_custom_relays_consumption_title?: string;
|
||||
dashboard_custom_cached_consumption_title?: string;
|
||||
}
|
||||
|
||||
export interface ServerConstraint {
|
||||
|
@ -81,7 +81,7 @@ function ValidatedDevicesList(p: {
|
||||
<Table sx={{ minWidth: 650 }} aria-label="simple table">
|
||||
<TableHead>
|
||||
<TableRow>
|
||||
<TableCell>#</TableCell>
|
||||
<TableCell>Name</TableCell>
|
||||
<TableCell align="center">Model</TableCell>
|
||||
<TableCell align="center">Version</TableCell>
|
||||
<TableCell align="center">Max relays</TableCell>
|
||||
@ -99,7 +99,7 @@ function ValidatedDevicesList(p: {
|
||||
onDoubleClick={() => navigate(DeviceURL(dev))}
|
||||
>
|
||||
<TableCell component="th" scope="row">
|
||||
{dev.id}
|
||||
{dev.name}
|
||||
</TableCell>
|
||||
<TableCell align="center">{dev.info.reference}</TableCell>
|
||||
<TableCell align="center">{dev.info.version}</TableCell>
|
||||
|
@ -2,6 +2,7 @@ import React from "react";
|
||||
import { EnergyApi } from "../../api/EnergyApi";
|
||||
import { useSnackbar } from "../../hooks/context_providers/SnackbarProvider";
|
||||
import StatCard from "../../widgets/StatCard";
|
||||
import { ServerApi } from "../../api/ServerApi";
|
||||
|
||||
export function CachedConsumptionWidget(): React.ReactElement {
|
||||
const snackbar = useSnackbar();
|
||||
@ -26,6 +27,12 @@ export function CachedConsumptionWidget(): React.ReactElement {
|
||||
});
|
||||
|
||||
return (
|
||||
<StatCard title="Cached consumption" value={val?.toString() ?? "Loading"} />
|
||||
<StatCard
|
||||
title={
|
||||
ServerApi.Config.dashboard_custom_cached_consumption_title ??
|
||||
"Cached consumption"
|
||||
}
|
||||
value={val?.toString() ?? "Loading"}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ import React from "react";
|
||||
import { EnergyApi } from "../../api/EnergyApi";
|
||||
import { useSnackbar } from "../../hooks/context_providers/SnackbarProvider";
|
||||
import StatCard from "../../widgets/StatCard";
|
||||
import { ServerApi } from "../../api/ServerApi";
|
||||
|
||||
export function CurrConsumptionWidget(): React.ReactElement {
|
||||
const snackbar = useSnackbar();
|
||||
@ -29,7 +30,10 @@ export function CurrConsumptionWidget(): React.ReactElement {
|
||||
|
||||
return (
|
||||
<StatCard
|
||||
title="Current consumption"
|
||||
title={
|
||||
ServerApi.Config.dashboard_custom_current_consumption_title ??
|
||||
"Current consumption"
|
||||
}
|
||||
data={history ?? []}
|
||||
interval="Last day"
|
||||
value={val?.toString() ?? "Loading"}
|
||||
|
@ -2,6 +2,7 @@ import React from "react";
|
||||
import { EnergyApi } from "../../api/EnergyApi";
|
||||
import { useSnackbar } from "../../hooks/context_providers/SnackbarProvider";
|
||||
import StatCard from "../../widgets/StatCard";
|
||||
import { ServerApi } from "../../api/ServerApi";
|
||||
|
||||
export function RelayConsumptionWidget(): React.ReactElement {
|
||||
const snackbar = useSnackbar();
|
||||
@ -29,7 +30,10 @@ export function RelayConsumptionWidget(): React.ReactElement {
|
||||
|
||||
return (
|
||||
<StatCard
|
||||
title="Relays consumption"
|
||||
title={
|
||||
ServerApi.Config.dashboard_custom_relays_consumption_title ??
|
||||
"Relays consumption"
|
||||
}
|
||||
data={history ?? []}
|
||||
interval="Last day"
|
||||
value={val?.toString() ?? "Loading"}
|
||||
|
31
central_frontend/src/routes/ManagementRoute.tsx
Normal file
31
central_frontend/src/routes/ManagementRoute.tsx
Normal file
@ -0,0 +1,31 @@
|
||||
import { Button } from "@mui/material";
|
||||
import { useConfirm } from "../hooks/context_providers/ConfirmDialogProvider";
|
||||
import { SolarEnergyRouteContainer } from "../widgets/SolarEnergyRouteContainer";
|
||||
import { APIClient } from "../api/ApiClient";
|
||||
|
||||
export function ManagementRoute(): React.ReactElement {
|
||||
const confirm = useConfirm();
|
||||
|
||||
const downloadBackup = async () => {
|
||||
try {
|
||||
if (
|
||||
!(await confirm(
|
||||
`Do you really want to download a copy of the storage? It will contain sensitive information!`
|
||||
))
|
||||
)
|
||||
return;
|
||||
|
||||
location.href = APIClient.backendURL() + "/management/download_storage";
|
||||
} catch (e) {
|
||||
console.error(`Failed to donwload a backup of the storage! Error: ${e}`);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<SolarEnergyRouteContainer label="Management">
|
||||
<Button variant="outlined" onClick={downloadBackup}>
|
||||
Download a backup of storage
|
||||
</Button>
|
||||
</SolarEnergyRouteContainer>
|
||||
);
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
import {
|
||||
mdiChip,
|
||||
mdiCog,
|
||||
mdiElectricSwitch,
|
||||
mdiHome,
|
||||
mdiMonitorArrowDown,
|
||||
@ -12,9 +13,11 @@ import {
|
||||
ListItemButton,
|
||||
ListItemIcon,
|
||||
ListItemText,
|
||||
Typography,
|
||||
} from "@mui/material";
|
||||
import { useLocation } from "react-router-dom";
|
||||
import { RouterLink } from "./RouterLink";
|
||||
import { ServerApi } from "../api/ServerApi";
|
||||
|
||||
export function SolarEnergyNavList(): React.ReactElement {
|
||||
return (
|
||||
@ -52,6 +55,18 @@ export function SolarEnergyNavList(): React.ReactElement {
|
||||
uri="/logs"
|
||||
icon={<Icon path={mdiNotebookMultiple} size={1} />}
|
||||
/>
|
||||
<NavLink
|
||||
label="Management"
|
||||
uri="/management"
|
||||
icon={<Icon path={mdiCog} size={1} />}
|
||||
/>
|
||||
<Typography
|
||||
variant="caption"
|
||||
component="div"
|
||||
style={{ textAlign: "center", width: "100%", marginTop: "30px" }}
|
||||
>
|
||||
Version {ServerApi.Config.backend_version}
|
||||
</Typography>
|
||||
</List>
|
||||
);
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ export function timeDiff(a: number, b: number): string {
|
||||
diff = Math.floor(diff / 60);
|
||||
|
||||
if (diff === 1) return "1 minute";
|
||||
if (diff < 24) {
|
||||
if (diff < 60) {
|
||||
return `${diff} minutes`;
|
||||
}
|
||||
|
||||
|
1725
custom_consumption/Cargo.lock
generated
1725
custom_consumption/Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@ -7,6 +7,6 @@ edition = "2021"
|
||||
env_logger = "0.11.5"
|
||||
log = "0.4.22"
|
||||
clap = { version = "4.5.18", features = ["derive", "env"] }
|
||||
egui = "0.28.1"
|
||||
eframe = "0.28.1"
|
||||
egui = "0.29.1"
|
||||
eframe = "0.29.1"
|
||||
lazy_static = "1.5.0"
|
||||
|
@ -1,7 +1,6 @@
|
||||
use std::time::{SystemTime, UNIX_EPOCH};
|
||||
|
||||
/// Get the current time since epoch
|
||||
|
||||
pub fn time_millis() -> u128 {
|
||||
SystemTime::now()
|
||||
.duration_since(UNIX_EPOCH)
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Configure project for production
|
||||
|
||||
Note: This guide assumes that you use the default hostname, `central.internal` as hostname for your central system.
|
||||
|
||||
## Create production build
|
||||
|
||||
### Central
|
||||
@ -44,6 +46,70 @@ The OTA update is then located in `build/main.bin`
|
||||
* A server running a recent Linux (Debian / Ubuntu preferred) with `central` as hostname
|
||||
* DHCP configured on the network
|
||||
|
||||
## Configure DNS server
|
||||
|
||||
If you need to setup a DNS server / proxy to point `central.internal` to the central server IP, you can follow this guide.
|
||||
|
||||
### Retrieve DNS server binary
|
||||
Use [DNSProxy](https://gitlab.com/pierre42100/dnsproxy) as DNS server. Get and compile the sources:
|
||||
|
||||
```bash
|
||||
git clone https://gitlab.com/pierre42100/dnsproxy
|
||||
cd dnsproxy
|
||||
cargo build --release
|
||||
scp target/release/dns_proxy USER@CENTRAL_IP:/home/USER
|
||||
```
|
||||
|
||||
Then, on the target server, install the binary to its final destination:
|
||||
|
||||
```bash
|
||||
sudo mv dns_proxy /usr/local/bin/
|
||||
```
|
||||
|
||||
### Configure DNS server
|
||||
Configure the server as a service `/etc/systemd/system/dns.service`:
|
||||
|
||||
```conf
|
||||
[Unit]
|
||||
Description=DNS server
|
||||
After=syslog.target
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
RestartSec=2s
|
||||
Type=simple
|
||||
User=root
|
||||
Group=root
|
||||
WorkingDirectory=/tmp
|
||||
ExecStart=/usr/local/bin/dns_proxy -l "CENTRAL_IP:53" -c "central.internal. A CENTRAL_IP"
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
```
|
||||
|
||||
Enable and start the new service:
|
||||
|
||||
```bash
|
||||
sudo systemctl enable dns
|
||||
sudo systemctl start dns
|
||||
```
|
||||
|
||||
Check that it works correctly:
|
||||
|
||||
```bash
|
||||
dig central.internal. @CENTRAL_IP
|
||||
```
|
||||
|
||||
You should get an entry like this if it works:
|
||||
|
||||
```
|
||||
;; ANSWER SECTION:
|
||||
central.internal. 0 IN A CENTRAL_IP
|
||||
```
|
||||
|
||||
Then, in your DHCP service, define the central as the DNS server.
|
||||
|
||||
## Configure server
|
||||
|
||||
### Create a user dedicated to the central
|
||||
@ -82,7 +148,7 @@ COOKIE_SECURE=true
|
||||
LISTEN_ADDRESS=0.0.0.0:443
|
||||
ADMIN_USERNAME=admin
|
||||
ADMIN_PASSWORD=FIXME
|
||||
HOSTNAME=central.local
|
||||
HOSTNAME=central.internal
|
||||
STORAGE=/home/central/storage
|
||||
FRONIUS_ORIG=http://10.0.0.10
|
||||
```
|
||||
|
@ -2,6 +2,11 @@
|
||||
|
||||
ESP32 client device, using `W32-ETH01` device
|
||||
|
||||
## Pins for relays
|
||||
The pins are the following (in the order of definition): 4, 14, 15, 2
|
||||
|
||||
**WARNING!** The Pin 2 MUST be disconnect to reflash the card!
|
||||
|
||||
## Some commands
|
||||
|
||||
Create a new firmware build:
|
||||
|
@ -8,7 +8,7 @@
|
||||
/**
|
||||
* Backend unsecure API URL
|
||||
*/
|
||||
#define BACKEND_UNSECURE_URL "http://devweb.internal:8080"
|
||||
#define BACKEND_UNSECURE_URL "http://central.internal:8080"
|
||||
|
||||
/**
|
||||
* Device name len
|
||||
|
@ -9,7 +9,7 @@ static const char *TAG = "relays";
|
||||
/**
|
||||
* Device relays GPIO ids
|
||||
*/
|
||||
static int DEVICE_GPIO_IDS[3] = {4, 14, 15};
|
||||
static int DEVICE_GPIO_IDS[4] = {4, 14, 15, 2};
|
||||
|
||||
int relays_count()
|
||||
{
|
||||
|
@ -1 +1 @@
|
||||
1.0.0
|
||||
1.0.2
|
Reference in New Issue
Block a user