initial commit
0 parents
Showing
7 changed files
with
1655 additions
and
0 deletions
.env.example
0 → 100644
.gitignore
0 → 100644
Cargo.lock
0 → 100644
1 | # This file is automatically @generated by Cargo. | ||
2 | # It is not intended for manual editing. | ||
3 | version = 3 | ||
4 | |||
5 | [[package]] | ||
6 | name = "addr2line" | ||
7 | version = "0.24.2" | ||
8 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
9 | checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" | ||
10 | dependencies = [ | ||
11 | "gimli", | ||
12 | ] | ||
13 | |||
14 | [[package]] | ||
15 | name = "adler2" | ||
16 | version = "2.0.0" | ||
17 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
18 | checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" | ||
19 | |||
20 | [[package]] | ||
21 | name = "aho-corasick" | ||
22 | version = "1.1.3" | ||
23 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
24 | checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" | ||
25 | dependencies = [ | ||
26 | "memchr", | ||
27 | ] | ||
28 | |||
29 | [[package]] | ||
30 | name = "android-tzdata" | ||
31 | version = "0.1.1" | ||
32 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
33 | checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" | ||
34 | |||
35 | [[package]] | ||
36 | name = "android_system_properties" | ||
37 | version = "0.1.5" | ||
38 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
39 | checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" | ||
40 | dependencies = [ | ||
41 | "libc", | ||
42 | ] | ||
43 | |||
44 | [[package]] | ||
45 | name = "ansi_term" | ||
46 | version = "0.12.1" | ||
47 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
48 | checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" | ||
49 | dependencies = [ | ||
50 | "winapi", | ||
51 | ] | ||
52 | |||
53 | [[package]] | ||
54 | name = "anstream" | ||
55 | version = "0.6.18" | ||
56 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
57 | checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" | ||
58 | dependencies = [ | ||
59 | "anstyle", | ||
60 | "anstyle-parse", | ||
61 | "anstyle-query", | ||
62 | "anstyle-wincon", | ||
63 | "colorchoice", | ||
64 | "is_terminal_polyfill", | ||
65 | "utf8parse", | ||
66 | ] | ||
67 | |||
68 | [[package]] | ||
69 | name = "anstyle" | ||
70 | version = "1.0.10" | ||
71 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
72 | checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" | ||
73 | |||
74 | [[package]] | ||
75 | name = "anstyle-parse" | ||
76 | version = "0.2.6" | ||
77 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
78 | checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" | ||
79 | dependencies = [ | ||
80 | "utf8parse", | ||
81 | ] | ||
82 | |||
83 | [[package]] | ||
84 | name = "anstyle-query" | ||
85 | version = "1.1.2" | ||
86 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
87 | checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" | ||
88 | dependencies = [ | ||
89 | "windows-sys 0.59.0", | ||
90 | ] | ||
91 | |||
92 | [[package]] | ||
93 | name = "anstyle-wincon" | ||
94 | version = "3.0.7" | ||
95 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
96 | checksum = "ca3534e77181a9cc07539ad51f2141fe32f6c3ffd4df76db8ad92346b003ae4e" | ||
97 | dependencies = [ | ||
98 | "anstyle", | ||
99 | "once_cell", | ||
100 | "windows-sys 0.59.0", | ||
101 | ] | ||
102 | |||
103 | [[package]] | ||
104 | name = "anyhow" | ||
105 | version = "1.0.95" | ||
106 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
107 | checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04" | ||
108 | |||
109 | [[package]] | ||
110 | name = "array-init" | ||
111 | version = "2.1.0" | ||
112 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
113 | checksum = "3d62b7694a562cdf5a74227903507c56ab2cc8bdd1f781ed5cb4cf9c9f810bfc" | ||
114 | |||
115 | [[package]] | ||
116 | name = "async-trait" | ||
117 | version = "0.1.85" | ||
118 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
119 | checksum = "3f934833b4b7233644e5848f235df3f57ed8c80f1528a26c3dfa13d2147fa056" | ||
120 | dependencies = [ | ||
121 | "proc-macro2", | ||
122 | "quote", | ||
123 | "syn", | ||
124 | ] | ||
125 | |||
126 | [[package]] | ||
127 | name = "atty" | ||
128 | version = "0.2.14" | ||
129 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
130 | checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" | ||
131 | dependencies = [ | ||
132 | "hermit-abi", | ||
133 | "libc", | ||
134 | "winapi", | ||
135 | ] | ||
136 | |||
137 | [[package]] | ||
138 | name = "autocfg" | ||
139 | version = "1.4.0" | ||
140 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
141 | checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" | ||
142 | |||
143 | [[package]] | ||
144 | name = "backtrace" | ||
145 | version = "0.3.74" | ||
146 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
147 | checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" | ||
148 | dependencies = [ | ||
149 | "addr2line", | ||
150 | "cfg-if", | ||
151 | "libc", | ||
152 | "miniz_oxide", | ||
153 | "object", | ||
154 | "rustc-demangle", | ||
155 | "windows-targets", | ||
156 | ] | ||
157 | |||
158 | [[package]] | ||
159 | name = "base64" | ||
160 | version = "0.22.1" | ||
161 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
162 | checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" | ||
163 | |||
164 | [[package]] | ||
165 | name = "bit-vec" | ||
166 | version = "0.6.3" | ||
167 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
168 | checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" | ||
169 | |||
170 | [[package]] | ||
171 | name = "bitflags" | ||
172 | version = "1.3.2" | ||
173 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
174 | checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" | ||
175 | |||
176 | [[package]] | ||
177 | name = "bitflags" | ||
178 | version = "2.8.0" | ||
179 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
180 | checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" | ||
181 | |||
182 | [[package]] | ||
183 | name = "block-buffer" | ||
184 | version = "0.10.4" | ||
185 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
186 | checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" | ||
187 | dependencies = [ | ||
188 | "generic-array", | ||
189 | ] | ||
190 | |||
191 | [[package]] | ||
192 | name = "bumpalo" | ||
193 | version = "3.16.0" | ||
194 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
195 | checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" | ||
196 | |||
197 | [[package]] | ||
198 | name = "byteorder" | ||
199 | version = "1.5.0" | ||
200 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
201 | checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" | ||
202 | |||
203 | [[package]] | ||
204 | name = "bytes" | ||
205 | version = "1.9.0" | ||
206 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
207 | checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" | ||
208 | |||
209 | [[package]] | ||
210 | name = "cc" | ||
211 | version = "1.2.10" | ||
212 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
213 | checksum = "13208fcbb66eaeffe09b99fffbe1af420f00a7b35aa99ad683dfc1aa76145229" | ||
214 | dependencies = [ | ||
215 | "shlex", | ||
216 | ] | ||
217 | |||
218 | [[package]] | ||
219 | name = "cfg-if" | ||
220 | version = "1.0.0" | ||
221 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
222 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" | ||
223 | |||
224 | [[package]] | ||
225 | name = "chrono" | ||
226 | version = "0.4.39" | ||
227 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
228 | checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825" | ||
229 | dependencies = [ | ||
230 | "android-tzdata", | ||
231 | "iana-time-zone", | ||
232 | "js-sys", | ||
233 | "num-traits", | ||
234 | "wasm-bindgen", | ||
235 | "windows-targets", | ||
236 | ] | ||
237 | |||
238 | [[package]] | ||
239 | name = "clap" | ||
240 | version = "2.34.0" | ||
241 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
242 | checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" | ||
243 | dependencies = [ | ||
244 | "ansi_term", | ||
245 | "atty", | ||
246 | "bitflags 1.3.2", | ||
247 | "strsim 0.8.0", | ||
248 | "textwrap", | ||
249 | "unicode-width", | ||
250 | "vec_map", | ||
251 | ] | ||
252 | |||
253 | [[package]] | ||
254 | name = "clap" | ||
255 | version = "4.5.27" | ||
256 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
257 | checksum = "769b0145982b4b48713e01ec42d61614425f27b7058bda7180a3a41f30104796" | ||
258 | dependencies = [ | ||
259 | "clap_builder", | ||
260 | ] | ||
261 | |||
262 | [[package]] | ||
263 | name = "clap_builder" | ||
264 | version = "4.5.27" | ||
265 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
266 | checksum = "1b26884eb4b57140e4d2d93652abfa49498b938b3c9179f9fc487b0acc3edad7" | ||
267 | dependencies = [ | ||
268 | "anstream", | ||
269 | "anstyle", | ||
270 | "clap_lex", | ||
271 | "strsim 0.11.1", | ||
272 | ] | ||
273 | |||
274 | [[package]] | ||
275 | name = "clap_lex" | ||
276 | version = "0.7.4" | ||
277 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
278 | checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" | ||
279 | |||
280 | [[package]] | ||
281 | name = "colorchoice" | ||
282 | version = "1.0.3" | ||
283 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
284 | checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" | ||
285 | |||
286 | [[package]] | ||
287 | name = "core-foundation-sys" | ||
288 | version = "0.8.7" | ||
289 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
290 | checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" | ||
291 | |||
292 | [[package]] | ||
293 | name = "cpufeatures" | ||
294 | version = "0.2.16" | ||
295 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
296 | checksum = "16b80225097f2e5ae4e7179dd2266824648f3e2f49d9134d584b76389d31c4c3" | ||
297 | dependencies = [ | ||
298 | "libc", | ||
299 | ] | ||
300 | |||
301 | [[package]] | ||
302 | name = "crypto-common" | ||
303 | version = "0.1.6" | ||
304 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
305 | checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" | ||
306 | dependencies = [ | ||
307 | "generic-array", | ||
308 | "typenum", | ||
309 | ] | ||
310 | |||
311 | [[package]] | ||
312 | name = "digest" | ||
313 | version = "0.10.7" | ||
314 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
315 | checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" | ||
316 | dependencies = [ | ||
317 | "block-buffer", | ||
318 | "crypto-common", | ||
319 | "subtle", | ||
320 | ] | ||
321 | |||
322 | [[package]] | ||
323 | name = "dotenv" | ||
324 | version = "0.15.0" | ||
325 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
326 | checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f" | ||
327 | dependencies = [ | ||
328 | "clap 2.34.0", | ||
329 | ] | ||
330 | |||
331 | [[package]] | ||
332 | name = "env_filter" | ||
333 | version = "0.1.3" | ||
334 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
335 | checksum = "186e05a59d4c50738528153b83b0b0194d3a29507dfec16eccd4b342903397d0" | ||
336 | dependencies = [ | ||
337 | "log", | ||
338 | "regex", | ||
339 | ] | ||
340 | |||
341 | [[package]] | ||
342 | name = "env_logger" | ||
343 | version = "0.11.6" | ||
344 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
345 | checksum = "dcaee3d8e3cfc3fd92428d477bc97fc29ec8716d180c0d74c643bb26166660e0" | ||
346 | dependencies = [ | ||
347 | "anstream", | ||
348 | "anstyle", | ||
349 | "env_filter", | ||
350 | "humantime", | ||
351 | "log", | ||
352 | ] | ||
353 | |||
354 | [[package]] | ||
355 | name = "fallible-iterator" | ||
356 | version = "0.2.0" | ||
357 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
358 | checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" | ||
359 | |||
360 | [[package]] | ||
361 | name = "futures-channel" | ||
362 | version = "0.3.31" | ||
363 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
364 | checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" | ||
365 | dependencies = [ | ||
366 | "futures-core", | ||
367 | "futures-sink", | ||
368 | ] | ||
369 | |||
370 | [[package]] | ||
371 | name = "futures-core" | ||
372 | version = "0.3.31" | ||
373 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
374 | checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" | ||
375 | |||
376 | [[package]] | ||
377 | name = "futures-macro" | ||
378 | version = "0.3.31" | ||
379 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
380 | checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" | ||
381 | dependencies = [ | ||
382 | "proc-macro2", | ||
383 | "quote", | ||
384 | "syn", | ||
385 | ] | ||
386 | |||
387 | [[package]] | ||
388 | name = "futures-sink" | ||
389 | version = "0.3.31" | ||
390 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
391 | checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" | ||
392 | |||
393 | [[package]] | ||
394 | name = "futures-task" | ||
395 | version = "0.3.31" | ||
396 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
397 | checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" | ||
398 | |||
399 | [[package]] | ||
400 | name = "futures-util" | ||
401 | version = "0.3.31" | ||
402 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
403 | checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" | ||
404 | dependencies = [ | ||
405 | "futures-core", | ||
406 | "futures-macro", | ||
407 | "futures-sink", | ||
408 | "futures-task", | ||
409 | "pin-project-lite", | ||
410 | "pin-utils", | ||
411 | "slab", | ||
412 | ] | ||
413 | |||
414 | [[package]] | ||
415 | name = "generic-array" | ||
416 | version = "0.14.7" | ||
417 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
418 | checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" | ||
419 | dependencies = [ | ||
420 | "typenum", | ||
421 | "version_check", | ||
422 | ] | ||
423 | |||
424 | [[package]] | ||
425 | name = "getrandom" | ||
426 | version = "0.2.15" | ||
427 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
428 | checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" | ||
429 | dependencies = [ | ||
430 | "cfg-if", | ||
431 | "js-sys", | ||
432 | "libc", | ||
433 | "wasi", | ||
434 | "wasm-bindgen", | ||
435 | ] | ||
436 | |||
437 | [[package]] | ||
438 | name = "gimli" | ||
439 | version = "0.31.1" | ||
440 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
441 | checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" | ||
442 | |||
443 | [[package]] | ||
444 | name = "hermit-abi" | ||
445 | version = "0.1.19" | ||
446 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
447 | checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" | ||
448 | dependencies = [ | ||
449 | "libc", | ||
450 | ] | ||
451 | |||
452 | [[package]] | ||
453 | name = "hmac" | ||
454 | version = "0.12.1" | ||
455 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
456 | checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" | ||
457 | dependencies = [ | ||
458 | "digest", | ||
459 | ] | ||
460 | |||
461 | [[package]] | ||
462 | name = "humantime" | ||
463 | version = "2.1.0" | ||
464 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
465 | checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" | ||
466 | |||
467 | [[package]] | ||
468 | name = "iana-time-zone" | ||
469 | version = "0.1.61" | ||
470 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
471 | checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" | ||
472 | dependencies = [ | ||
473 | "android_system_properties", | ||
474 | "core-foundation-sys", | ||
475 | "iana-time-zone-haiku", | ||
476 | "js-sys", | ||
477 | "wasm-bindgen", | ||
478 | "windows-core", | ||
479 | ] | ||
480 | |||
481 | [[package]] | ||
482 | name = "iana-time-zone-haiku" | ||
483 | version = "0.1.2" | ||
484 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
485 | checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" | ||
486 | dependencies = [ | ||
487 | "cc", | ||
488 | ] | ||
489 | |||
490 | [[package]] | ||
491 | name = "is_terminal_polyfill" | ||
492 | version = "1.70.1" | ||
493 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
494 | checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" | ||
495 | |||
496 | [[package]] | ||
497 | name = "js-sys" | ||
498 | version = "0.3.77" | ||
499 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
500 | checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" | ||
501 | dependencies = [ | ||
502 | "once_cell", | ||
503 | "wasm-bindgen", | ||
504 | ] | ||
505 | |||
506 | [[package]] | ||
507 | name = "libc" | ||
508 | version = "0.2.169" | ||
509 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
510 | checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" | ||
511 | |||
512 | [[package]] | ||
513 | name = "lock_api" | ||
514 | version = "0.4.12" | ||
515 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
516 | checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" | ||
517 | dependencies = [ | ||
518 | "autocfg", | ||
519 | "scopeguard", | ||
520 | ] | ||
521 | |||
522 | [[package]] | ||
523 | name = "log" | ||
524 | version = "0.4.25" | ||
525 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
526 | checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f" | ||
527 | dependencies = [ | ||
528 | "serde", | ||
529 | ] | ||
530 | |||
531 | [[package]] | ||
532 | name = "md-5" | ||
533 | version = "0.10.6" | ||
534 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
535 | checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" | ||
536 | dependencies = [ | ||
537 | "cfg-if", | ||
538 | "digest", | ||
539 | ] | ||
540 | |||
541 | [[package]] | ||
542 | name = "memchr" | ||
543 | version = "2.7.4" | ||
544 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
545 | checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" | ||
546 | |||
547 | [[package]] | ||
548 | name = "miniz_oxide" | ||
549 | version = "0.8.3" | ||
550 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
551 | checksum = "b8402cab7aefae129c6977bb0ff1b8fd9a04eb5b51efc50a70bea51cda0c7924" | ||
552 | dependencies = [ | ||
553 | "adler2", | ||
554 | ] | ||
555 | |||
556 | [[package]] | ||
557 | name = "mio" | ||
558 | version = "1.0.3" | ||
559 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
560 | checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" | ||
561 | dependencies = [ | ||
562 | "libc", | ||
563 | "wasi", | ||
564 | "windows-sys 0.52.0", | ||
565 | ] | ||
566 | |||
567 | [[package]] | ||
568 | name = "mmjab" | ||
569 | version = "0.1.0" | ||
570 | dependencies = [ | ||
571 | "anyhow", | ||
572 | "chrono", | ||
573 | "clap 4.5.27", | ||
574 | "dotenv", | ||
575 | "env_logger", | ||
576 | "log", | ||
577 | "tokio", | ||
578 | "tokio-postgres", | ||
579 | "tokio-util", | ||
580 | ] | ||
581 | |||
582 | [[package]] | ||
583 | name = "num-traits" | ||
584 | version = "0.2.19" | ||
585 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
586 | checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" | ||
587 | dependencies = [ | ||
588 | "autocfg", | ||
589 | ] | ||
590 | |||
591 | [[package]] | ||
592 | name = "object" | ||
593 | version = "0.36.7" | ||
594 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
595 | checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" | ||
596 | dependencies = [ | ||
597 | "memchr", | ||
598 | ] | ||
599 | |||
600 | [[package]] | ||
601 | name = "once_cell" | ||
602 | version = "1.20.2" | ||
603 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
604 | checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" | ||
605 | |||
606 | [[package]] | ||
607 | name = "parking_lot" | ||
608 | version = "0.12.3" | ||
609 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
610 | checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" | ||
611 | dependencies = [ | ||
612 | "lock_api", | ||
613 | "parking_lot_core", | ||
614 | ] | ||
615 | |||
616 | [[package]] | ||
617 | name = "parking_lot_core" | ||
618 | version = "0.9.10" | ||
619 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
620 | checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" | ||
621 | dependencies = [ | ||
622 | "cfg-if", | ||
623 | "libc", | ||
624 | "redox_syscall", | ||
625 | "smallvec", | ||
626 | "windows-targets", | ||
627 | ] | ||
628 | |||
629 | [[package]] | ||
630 | name = "percent-encoding" | ||
631 | version = "2.3.1" | ||
632 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
633 | checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" | ||
634 | |||
635 | [[package]] | ||
636 | name = "phf" | ||
637 | version = "0.11.3" | ||
638 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
639 | checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" | ||
640 | dependencies = [ | ||
641 | "phf_shared", | ||
642 | ] | ||
643 | |||
644 | [[package]] | ||
645 | name = "phf_shared" | ||
646 | version = "0.11.3" | ||
647 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
648 | checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" | ||
649 | dependencies = [ | ||
650 | "siphasher", | ||
651 | ] | ||
652 | |||
653 | [[package]] | ||
654 | name = "pin-project-lite" | ||
655 | version = "0.2.16" | ||
656 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
657 | checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" | ||
658 | |||
659 | [[package]] | ||
660 | name = "pin-utils" | ||
661 | version = "0.1.0" | ||
662 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
663 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" | ||
664 | |||
665 | [[package]] | ||
666 | name = "postgres-protocol" | ||
667 | version = "0.6.7" | ||
668 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
669 | checksum = "acda0ebdebc28befa84bee35e651e4c5f09073d668c7aed4cf7e23c3cda84b23" | ||
670 | dependencies = [ | ||
671 | "base64", | ||
672 | "byteorder", | ||
673 | "bytes", | ||
674 | "fallible-iterator", | ||
675 | "getrandom", | ||
676 | "hmac", | ||
677 | "md-5", | ||
678 | "memchr", | ||
679 | "rand", | ||
680 | "sha2", | ||
681 | "stringprep", | ||
682 | ] | ||
683 | |||
684 | [[package]] | ||
685 | name = "postgres-types" | ||
686 | version = "0.2.8" | ||
687 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
688 | checksum = "f66ea23a2d0e5734297357705193335e0a957696f34bed2f2faefacb2fec336f" | ||
689 | dependencies = [ | ||
690 | "array-init", | ||
691 | "bit-vec", | ||
692 | "bytes", | ||
693 | "chrono", | ||
694 | "fallible-iterator", | ||
695 | "postgres-protocol", | ||
696 | ] | ||
697 | |||
698 | [[package]] | ||
699 | name = "ppv-lite86" | ||
700 | version = "0.2.20" | ||
701 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
702 | checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" | ||
703 | dependencies = [ | ||
704 | "zerocopy", | ||
705 | ] | ||
706 | |||
707 | [[package]] | ||
708 | name = "proc-macro2" | ||
709 | version = "1.0.93" | ||
710 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
711 | checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" | ||
712 | dependencies = [ | ||
713 | "unicode-ident", | ||
714 | ] | ||
715 | |||
716 | [[package]] | ||
717 | name = "quote" | ||
718 | version = "1.0.38" | ||
719 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
720 | checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" | ||
721 | dependencies = [ | ||
722 | "proc-macro2", | ||
723 | ] | ||
724 | |||
725 | [[package]] | ||
726 | name = "rand" | ||
727 | version = "0.8.5" | ||
728 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
729 | checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" | ||
730 | dependencies = [ | ||
731 | "libc", | ||
732 | "rand_chacha", | ||
733 | "rand_core", | ||
734 | ] | ||
735 | |||
736 | [[package]] | ||
737 | name = "rand_chacha" | ||
738 | version = "0.3.1" | ||
739 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
740 | checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" | ||
741 | dependencies = [ | ||
742 | "ppv-lite86", | ||
743 | "rand_core", | ||
744 | ] | ||
745 | |||
746 | [[package]] | ||
747 | name = "rand_core" | ||
748 | version = "0.6.4" | ||
749 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
750 | checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" | ||
751 | dependencies = [ | ||
752 | "getrandom", | ||
753 | ] | ||
754 | |||
755 | [[package]] | ||
756 | name = "redox_syscall" | ||
757 | version = "0.5.8" | ||
758 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
759 | checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" | ||
760 | dependencies = [ | ||
761 | "bitflags 2.8.0", | ||
762 | ] | ||
763 | |||
764 | [[package]] | ||
765 | name = "regex" | ||
766 | version = "1.11.1" | ||
767 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
768 | checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" | ||
769 | dependencies = [ | ||
770 | "aho-corasick", | ||
771 | "memchr", | ||
772 | "regex-automata", | ||
773 | "regex-syntax", | ||
774 | ] | ||
775 | |||
776 | [[package]] | ||
777 | name = "regex-automata" | ||
778 | version = "0.4.9" | ||
779 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
780 | checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" | ||
781 | dependencies = [ | ||
782 | "aho-corasick", | ||
783 | "memchr", | ||
784 | "regex-syntax", | ||
785 | ] | ||
786 | |||
787 | [[package]] | ||
788 | name = "regex-syntax" | ||
789 | version = "0.8.5" | ||
790 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
791 | checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" | ||
792 | |||
793 | [[package]] | ||
794 | name = "rustc-demangle" | ||
795 | version = "0.1.24" | ||
796 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
797 | checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" | ||
798 | |||
799 | [[package]] | ||
800 | name = "rustversion" | ||
801 | version = "1.0.19" | ||
802 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
803 | checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" | ||
804 | |||
805 | [[package]] | ||
806 | name = "scopeguard" | ||
807 | version = "1.2.0" | ||
808 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
809 | checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" | ||
810 | |||
811 | [[package]] | ||
812 | name = "serde" | ||
813 | version = "1.0.215" | ||
814 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
815 | checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" | ||
816 | dependencies = [ | ||
817 | "serde_derive", | ||
818 | ] | ||
819 | |||
820 | [[package]] | ||
821 | name = "serde_derive" | ||
822 | version = "1.0.215" | ||
823 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
824 | checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" | ||
825 | dependencies = [ | ||
826 | "proc-macro2", | ||
827 | "quote", | ||
828 | "syn", | ||
829 | ] | ||
830 | |||
831 | [[package]] | ||
832 | name = "sha2" | ||
833 | version = "0.10.8" | ||
834 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
835 | checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" | ||
836 | dependencies = [ | ||
837 | "cfg-if", | ||
838 | "cpufeatures", | ||
839 | "digest", | ||
840 | ] | ||
841 | |||
842 | [[package]] | ||
843 | name = "shlex" | ||
844 | version = "1.3.0" | ||
845 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
846 | checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" | ||
847 | |||
848 | [[package]] | ||
849 | name = "signal-hook-registry" | ||
850 | version = "1.4.2" | ||
851 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
852 | checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" | ||
853 | dependencies = [ | ||
854 | "libc", | ||
855 | ] | ||
856 | |||
857 | [[package]] | ||
858 | name = "siphasher" | ||
859 | version = "1.0.1" | ||
860 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
861 | checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" | ||
862 | |||
863 | [[package]] | ||
864 | name = "slab" | ||
865 | version = "0.4.9" | ||
866 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
867 | checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" | ||
868 | dependencies = [ | ||
869 | "autocfg", | ||
870 | ] | ||
871 | |||
872 | [[package]] | ||
873 | name = "smallvec" | ||
874 | version = "1.13.2" | ||
875 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
876 | checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" | ||
877 | |||
878 | [[package]] | ||
879 | name = "socket2" | ||
880 | version = "0.5.8" | ||
881 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
882 | checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8" | ||
883 | dependencies = [ | ||
884 | "libc", | ||
885 | "windows-sys 0.52.0", | ||
886 | ] | ||
887 | |||
888 | [[package]] | ||
889 | name = "stringprep" | ||
890 | version = "0.1.5" | ||
891 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
892 | checksum = "7b4df3d392d81bd458a8a621b8bffbd2302a12ffe288a9d931670948749463b1" | ||
893 | dependencies = [ | ||
894 | "unicode-bidi", | ||
895 | "unicode-normalization", | ||
896 | "unicode-properties", | ||
897 | ] | ||
898 | |||
899 | [[package]] | ||
900 | name = "strsim" | ||
901 | version = "0.8.0" | ||
902 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
903 | checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" | ||
904 | |||
905 | [[package]] | ||
906 | name = "strsim" | ||
907 | version = "0.11.1" | ||
908 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
909 | checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" | ||
910 | |||
911 | [[package]] | ||
912 | name = "subtle" | ||
913 | version = "2.6.1" | ||
914 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
915 | checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" | ||
916 | |||
917 | [[package]] | ||
918 | name = "syn" | ||
919 | version = "2.0.96" | ||
920 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
921 | checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" | ||
922 | dependencies = [ | ||
923 | "proc-macro2", | ||
924 | "quote", | ||
925 | "unicode-ident", | ||
926 | ] | ||
927 | |||
928 | [[package]] | ||
929 | name = "textwrap" | ||
930 | version = "0.11.0" | ||
931 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
932 | checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" | ||
933 | dependencies = [ | ||
934 | "unicode-width", | ||
935 | ] | ||
936 | |||
937 | [[package]] | ||
938 | name = "tinyvec" | ||
939 | version = "1.8.1" | ||
940 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
941 | checksum = "022db8904dfa342efe721985167e9fcd16c29b226db4397ed752a761cfce81e8" | ||
942 | dependencies = [ | ||
943 | "tinyvec_macros", | ||
944 | ] | ||
945 | |||
946 | [[package]] | ||
947 | name = "tinyvec_macros" | ||
948 | version = "0.1.1" | ||
949 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
950 | checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" | ||
951 | |||
952 | [[package]] | ||
953 | name = "tokio" | ||
954 | version = "1.43.0" | ||
955 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
956 | checksum = "3d61fa4ffa3de412bfea335c6ecff681de2b609ba3c77ef3e00e521813a9ed9e" | ||
957 | dependencies = [ | ||
958 | "backtrace", | ||
959 | "bytes", | ||
960 | "libc", | ||
961 | "mio", | ||
962 | "pin-project-lite", | ||
963 | "signal-hook-registry", | ||
964 | "socket2", | ||
965 | "tokio-macros", | ||
966 | "windows-sys 0.52.0", | ||
967 | ] | ||
968 | |||
969 | [[package]] | ||
970 | name = "tokio-macros" | ||
971 | version = "2.5.0" | ||
972 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
973 | checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" | ||
974 | dependencies = [ | ||
975 | "proc-macro2", | ||
976 | "quote", | ||
977 | "syn", | ||
978 | ] | ||
979 | |||
980 | [[package]] | ||
981 | name = "tokio-postgres" | ||
982 | version = "0.7.12" | ||
983 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
984 | checksum = "3b5d3742945bc7d7f210693b0c58ae542c6fd47b17adbbda0885f3dcb34a6bdb" | ||
985 | dependencies = [ | ||
986 | "async-trait", | ||
987 | "byteorder", | ||
988 | "bytes", | ||
989 | "fallible-iterator", | ||
990 | "futures-channel", | ||
991 | "futures-util", | ||
992 | "log", | ||
993 | "parking_lot", | ||
994 | "percent-encoding", | ||
995 | "phf", | ||
996 | "pin-project-lite", | ||
997 | "postgres-protocol", | ||
998 | "postgres-types", | ||
999 | "rand", | ||
1000 | "socket2", | ||
1001 | "tokio", | ||
1002 | "tokio-util", | ||
1003 | "whoami", | ||
1004 | ] | ||
1005 | |||
1006 | [[package]] | ||
1007 | name = "tokio-util" | ||
1008 | version = "0.7.13" | ||
1009 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
1010 | checksum = "d7fcaa8d55a2bdd6b83ace262b016eca0d79ee02818c5c1bcdf0305114081078" | ||
1011 | dependencies = [ | ||
1012 | "bytes", | ||
1013 | "futures-core", | ||
1014 | "futures-sink", | ||
1015 | "pin-project-lite", | ||
1016 | "tokio", | ||
1017 | ] | ||
1018 | |||
1019 | [[package]] | ||
1020 | name = "typenum" | ||
1021 | version = "1.17.0" | ||
1022 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
1023 | checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" | ||
1024 | |||
1025 | [[package]] | ||
1026 | name = "unicode-bidi" | ||
1027 | version = "0.3.18" | ||
1028 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
1029 | checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5" | ||
1030 | |||
1031 | [[package]] | ||
1032 | name = "unicode-ident" | ||
1033 | version = "1.0.15" | ||
1034 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
1035 | checksum = "11cd88e12b17c6494200a9c1b683a04fcac9573ed74cd1b62aeb2727c5592243" | ||
1036 | |||
1037 | [[package]] | ||
1038 | name = "unicode-normalization" | ||
1039 | version = "0.1.24" | ||
1040 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
1041 | checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" | ||
1042 | dependencies = [ | ||
1043 | "tinyvec", | ||
1044 | ] | ||
1045 | |||
1046 | [[package]] | ||
1047 | name = "unicode-properties" | ||
1048 | version = "0.1.3" | ||
1049 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
1050 | checksum = "e70f2a8b45122e719eb623c01822704c4e0907e7e426a05927e1a1cfff5b75d0" | ||
1051 | |||
1052 | [[package]] | ||
1053 | name = "unicode-width" | ||
1054 | version = "0.1.12" | ||
1055 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
1056 | checksum = "68f5e5f3158ecfd4b8ff6fe086db7c8467a2dfdac97fe420f2b7c4aa97af66d6" | ||
1057 | |||
1058 | [[package]] | ||
1059 | name = "utf8parse" | ||
1060 | version = "0.2.2" | ||
1061 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
1062 | checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" | ||
1063 | |||
1064 | [[package]] | ||
1065 | name = "vec_map" | ||
1066 | version = "0.8.2" | ||
1067 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
1068 | checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" | ||
1069 | |||
1070 | [[package]] | ||
1071 | name = "version_check" | ||
1072 | version = "0.9.5" | ||
1073 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
1074 | checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" | ||
1075 | |||
1076 | [[package]] | ||
1077 | name = "wasi" | ||
1078 | version = "0.11.0+wasi-snapshot-preview1" | ||
1079 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
1080 | checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" | ||
1081 | |||
1082 | [[package]] | ||
1083 | name = "wasite" | ||
1084 | version = "0.1.0" | ||
1085 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
1086 | checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" | ||
1087 | |||
1088 | [[package]] | ||
1089 | name = "wasm-bindgen" | ||
1090 | version = "0.2.100" | ||
1091 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
1092 | checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" | ||
1093 | dependencies = [ | ||
1094 | "cfg-if", | ||
1095 | "once_cell", | ||
1096 | "rustversion", | ||
1097 | "wasm-bindgen-macro", | ||
1098 | ] | ||
1099 | |||
1100 | [[package]] | ||
1101 | name = "wasm-bindgen-backend" | ||
1102 | version = "0.2.100" | ||
1103 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
1104 | checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" | ||
1105 | dependencies = [ | ||
1106 | "bumpalo", | ||
1107 | "log", | ||
1108 | "proc-macro2", | ||
1109 | "quote", | ||
1110 | "syn", | ||
1111 | "wasm-bindgen-shared", | ||
1112 | ] | ||
1113 | |||
1114 | [[package]] | ||
1115 | name = "wasm-bindgen-macro" | ||
1116 | version = "0.2.100" | ||
1117 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
1118 | checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" | ||
1119 | dependencies = [ | ||
1120 | "quote", | ||
1121 | "wasm-bindgen-macro-support", | ||
1122 | ] | ||
1123 | |||
1124 | [[package]] | ||
1125 | name = "wasm-bindgen-macro-support" | ||
1126 | version = "0.2.100" | ||
1127 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
1128 | checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" | ||
1129 | dependencies = [ | ||
1130 | "proc-macro2", | ||
1131 | "quote", | ||
1132 | "syn", | ||
1133 | "wasm-bindgen-backend", | ||
1134 | "wasm-bindgen-shared", | ||
1135 | ] | ||
1136 | |||
1137 | [[package]] | ||
1138 | name = "wasm-bindgen-shared" | ||
1139 | version = "0.2.100" | ||
1140 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
1141 | checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" | ||
1142 | dependencies = [ | ||
1143 | "unicode-ident", | ||
1144 | ] | ||
1145 | |||
1146 | [[package]] | ||
1147 | name = "web-sys" | ||
1148 | version = "0.3.77" | ||
1149 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
1150 | checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" | ||
1151 | dependencies = [ | ||
1152 | "js-sys", | ||
1153 | "wasm-bindgen", | ||
1154 | ] | ||
1155 | |||
1156 | [[package]] | ||
1157 | name = "whoami" | ||
1158 | version = "1.5.2" | ||
1159 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
1160 | checksum = "372d5b87f58ec45c384ba03563b03544dc5fadc3983e434b286913f5b4a9bb6d" | ||
1161 | dependencies = [ | ||
1162 | "redox_syscall", | ||
1163 | "wasite", | ||
1164 | "web-sys", | ||
1165 | ] | ||
1166 | |||
1167 | [[package]] | ||
1168 | name = "winapi" | ||
1169 | version = "0.3.9" | ||
1170 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
1171 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" | ||
1172 | dependencies = [ | ||
1173 | "winapi-i686-pc-windows-gnu", | ||
1174 | "winapi-x86_64-pc-windows-gnu", | ||
1175 | ] | ||
1176 | |||
1177 | [[package]] | ||
1178 | name = "winapi-i686-pc-windows-gnu" | ||
1179 | version = "0.4.0" | ||
1180 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
1181 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" | ||
1182 | |||
1183 | [[package]] | ||
1184 | name = "winapi-x86_64-pc-windows-gnu" | ||
1185 | version = "0.4.0" | ||
1186 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
1187 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" | ||
1188 | |||
1189 | [[package]] | ||
1190 | name = "windows-core" | ||
1191 | version = "0.52.0" | ||
1192 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
1193 | checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" | ||
1194 | dependencies = [ | ||
1195 | "windows-targets", | ||
1196 | ] | ||
1197 | |||
1198 | [[package]] | ||
1199 | name = "windows-sys" | ||
1200 | version = "0.52.0" | ||
1201 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
1202 | checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" | ||
1203 | dependencies = [ | ||
1204 | "windows-targets", | ||
1205 | ] | ||
1206 | |||
1207 | [[package]] | ||
1208 | name = "windows-sys" | ||
1209 | version = "0.59.0" | ||
1210 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
1211 | checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" | ||
1212 | dependencies = [ | ||
1213 | "windows-targets", | ||
1214 | ] | ||
1215 | |||
1216 | [[package]] | ||
1217 | name = "windows-targets" | ||
1218 | version = "0.52.6" | ||
1219 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
1220 | checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" | ||
1221 | dependencies = [ | ||
1222 | "windows_aarch64_gnullvm", | ||
1223 | "windows_aarch64_msvc", | ||
1224 | "windows_i686_gnu", | ||
1225 | "windows_i686_gnullvm", | ||
1226 | "windows_i686_msvc", | ||
1227 | "windows_x86_64_gnu", | ||
1228 | "windows_x86_64_gnullvm", | ||
1229 | "windows_x86_64_msvc", | ||
1230 | ] | ||
1231 | |||
1232 | [[package]] | ||
1233 | name = "windows_aarch64_gnullvm" | ||
1234 | version = "0.52.6" | ||
1235 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
1236 | checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" | ||
1237 | |||
1238 | [[package]] | ||
1239 | name = "windows_aarch64_msvc" | ||
1240 | version = "0.52.6" | ||
1241 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
1242 | checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" | ||
1243 | |||
1244 | [[package]] | ||
1245 | name = "windows_i686_gnu" | ||
1246 | version = "0.52.6" | ||
1247 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
1248 | checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" | ||
1249 | |||
1250 | [[package]] | ||
1251 | name = "windows_i686_gnullvm" | ||
1252 | version = "0.52.6" | ||
1253 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
1254 | checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" | ||
1255 | |||
1256 | [[package]] | ||
1257 | name = "windows_i686_msvc" | ||
1258 | version = "0.52.6" | ||
1259 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
1260 | checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" | ||
1261 | |||
1262 | [[package]] | ||
1263 | name = "windows_x86_64_gnu" | ||
1264 | version = "0.52.6" | ||
1265 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
1266 | checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" | ||
1267 | |||
1268 | [[package]] | ||
1269 | name = "windows_x86_64_gnullvm" | ||
1270 | version = "0.52.6" | ||
1271 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
1272 | checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" | ||
1273 | |||
1274 | [[package]] | ||
1275 | name = "windows_x86_64_msvc" | ||
1276 | version = "0.52.6" | ||
1277 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
1278 | checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" | ||
1279 | |||
1280 | [[package]] | ||
1281 | name = "zerocopy" | ||
1282 | version = "0.7.35" | ||
1283 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
1284 | checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" | ||
1285 | dependencies = [ | ||
1286 | "byteorder", | ||
1287 | "zerocopy-derive", | ||
1288 | ] | ||
1289 | |||
1290 | [[package]] | ||
1291 | name = "zerocopy-derive" | ||
1292 | version = "0.7.35" | ||
1293 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
1294 | checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" | ||
1295 | dependencies = [ | ||
1296 | "proc-macro2", | ||
1297 | "quote", | ||
1298 | "syn", | ||
1299 | ] |
Cargo.toml
0 → 100644
1 | [package] | ||
2 | name = "mmjab" | ||
3 | version = "0.1.0" | ||
4 | edition = "2021" | ||
5 | |||
6 | [dependencies] | ||
7 | chrono = "0.4.26" | ||
8 | tokio = { version = "*", features = ["macros", "signal", "rt-multi-thread"] } | ||
9 | tokio-util = { version = "0.7.10", features = ["io"] } | ||
10 | tokio-postgres = { version = "0.7.12", features= ["runtime","array-impls","js","with-bit-vec-0_6", "with-chrono-0_4"] } | ||
11 | log = {version = "0.4.25", features = ["std","serde"] } | ||
12 | anyhow = "1.0.95" | ||
13 | clap = { version = "4.5.27", features = ["env"] } | ||
14 | env_logger = "0.11.6" | ||
15 | dotenv = { version = "0.15.0", features = ["clap", "cli"] } | ||
16 | |||
17 | [profile.release] | ||
18 | lto = true | ||
19 | opt-level = 3 | ||
20 | codegen-units = 1 |
README.md
0 → 100644
1 | ### Mattermost Team version Jabis'd cleanup utilities | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
src/main.rs
0 → 100644
1 | use anyhow::{Result, Context}; | ||
2 | use tokio_postgres::{Client, NoTls}; | ||
3 | use log::{error, info, warn, trace}; | ||
4 | use std::{fs,env}; | ||
5 | use std::path::Path; | ||
6 | use chrono::Utc; | ||
7 | use clap::{Arg, Command}; | ||
8 | use dotenv::dotenv; | ||
9 | |||
10 | #[tokio::main] | ||
11 | async fn main() { | ||
12 | if env::var("RUST_LOG").is_err() { | ||
13 | env::set_var("RUST_LOG", "info") | ||
14 | } | ||
15 | env_logger::init(); | ||
16 | dotenv().ok(); | ||
17 | let matches = Command::new("Clean Utility") | ||
18 | .version("1.0") | ||
19 | .about("Cleans old files and database rows based on retention policies") | ||
20 | .arg( | ||
21 | Arg::new("data_dir") | ||
22 | .long("data-dir") | ||
23 | .env("MATTERMOST_DATA_DIRECTORY") | ||
24 | .help("Path to the Mattermost data directory") | ||
25 | .required(true) | ||
26 | ) | ||
27 | .arg( | ||
28 | Arg::new("db_name") | ||
29 | .short('n') | ||
30 | .long("db-name") | ||
31 | .env("DATABASE_NAME") | ||
32 | .help("Database name") | ||
33 | .required(true) | ||
34 | ) | ||
35 | .arg( | ||
36 | Arg::new("db_user") | ||
37 | .short('u') | ||
38 | .long("db-user") | ||
39 | .env("DATABASE_USER") | ||
40 | .help("Database user") | ||
41 | .required(true) | ||
42 | ) | ||
43 | .arg( | ||
44 | Arg::new("db_password") | ||
45 | .short('p') | ||
46 | .long("db-password") | ||
47 | .env("PGPASSWORD") | ||
48 | .help("Database password") | ||
49 | .required(true), | ||
50 | ) | ||
51 | .arg( | ||
52 | Arg::new("db_host") | ||
53 | .short('h') | ||
54 | .long("db-host") | ||
55 | .env("DATABASE_HOST") | ||
56 | .help("Database host") | ||
57 | .required(true) | ||
58 | ) | ||
59 | .arg( | ||
60 | Arg::new("db_port") | ||
61 | .short('P') | ||
62 | .long("db-port") | ||
63 | .env("DATABASE_PORT") | ||
64 | .help("Database port") | ||
65 | .required(true) | ||
66 | ) | ||
67 | .arg( | ||
68 | Arg::new("retention_days") | ||
69 | .short('D') | ||
70 | .long("retention-days") | ||
71 | .env("RETENTION_DAYS") | ||
72 | .help("Number of days to retain data") | ||
73 | .required(true) | ||
74 | ) | ||
75 | .arg( | ||
76 | Arg::new("file_batch_size") | ||
77 | .short('b') | ||
78 | .long("file-batch-size") | ||
79 | .env("FILE_BATCH_SIZE") | ||
80 | .help("Batch size for file deletion") | ||
81 | .required(true), | ||
82 | ) | ||
83 | .arg( | ||
84 | Arg::new("remove_posts") | ||
85 | .long("remove-posts") | ||
86 | .help("Wipe posts older than timestamp") | ||
87 | .required(false) | ||
88 | ) | ||
89 | .arg( | ||
90 | Arg::new("dry_run") | ||
91 | .long("dry-run") | ||
92 | .help("Perform a dry run without making any changes") | ||
93 | .required(false) | ||
94 | ) | ||
95 | .get_matches(); | ||
96 | |||
97 | let mattermost_data_directory = matches.get_one::<String>("data_dir").unwrap(); | ||
98 | let database_name = matches.get_one::<String>("db_name").unwrap(); | ||
99 | let database_user = matches.get_one::<String>("db_user").unwrap(); | ||
100 | let database_password = matches.get_one::<String>("db_password").unwrap(); | ||
101 | let database_host = matches.get_one::<String>("db_host").unwrap(); | ||
102 | let database_port = matches.get_one::<String>("db_port").unwrap(); | ||
103 | let retention_days = matches.get_one::<String>("retention_days").unwrap(); | ||
104 | let file_batch_size = matches.get_one::<String>("file_batch_size").unwrap(); | ||
105 | let remove_posts = matches.contains_id("remove_posts"); | ||
106 | let dry_run = matches.contains_id("dry_run"); | ||
107 | |||
108 | let retention_days = retention_days.parse::<i64>().expect("fucking hell retention"); | ||
109 | let file_batch_size = file_batch_size.parse::<usize>().expect("fucking hell retention"); | ||
110 | //let file_batch_size = file_batch_size.parse::<usize>().expect("fucking hell retention"); | ||
111 | if let Err(err) = clean( | ||
112 | mattermost_data_directory, | ||
113 | database_name, | ||
114 | database_user, | ||
115 | database_password, | ||
116 | database_host, | ||
117 | database_port, | ||
118 | retention_days, | ||
119 | file_batch_size, | ||
120 | remove_posts, | ||
121 | dry_run, | ||
122 | ).await { | ||
123 | error!("Cleaning operation failed: {}", err); | ||
124 | } else { | ||
125 | info!("Cleaning operation completed successfully."); | ||
126 | } | ||
127 | } | ||
128 | |||
129 | pub async fn clean( | ||
130 | mattermost_data_directory: &str, | ||
131 | database_name: &str, | ||
132 | database_user: &str, | ||
133 | database_password: &str, | ||
134 | database_host: &str, | ||
135 | database_port: &str, | ||
136 | retention_days: i64, | ||
137 | file_batch_size: usize, | ||
138 | remove_posts: bool, | ||
139 | dry_run: bool, | ||
140 | ) -> Result<()> { | ||
141 | validate( | ||
142 | mattermost_data_directory, | ||
143 | database_name, | ||
144 | database_user, | ||
145 | database_host, | ||
146 | retention_days, | ||
147 | file_batch_size, | ||
148 | )?; | ||
149 | |||
150 | let connection_string = format!( | ||
151 | "postgres://{}:{}@{}:{}/{}?sslmode=disable", | ||
152 | database_user, database_password, database_host, database_port, database_name | ||
153 | ); | ||
154 | trace!("Connection string: {}", &connection_string); | ||
155 | let (client, connection) = tokio_postgres::connect(&connection_string, NoTls).await.context("Failed to connect to the database")?; | ||
156 | |||
157 | tokio::spawn(async move { | ||
158 | if let Err(e) = connection.await { | ||
159 | warn!("error happened at spawn {e}"); | ||
160 | eprintln!("connection error: {}", e); | ||
161 | } | ||
162 | }); | ||
163 | info!("Connection established: OK"); | ||
164 | let millisecond_epoch = (Utc::now() - chrono::Duration::days(retention_days)).timestamp_millis(); | ||
165 | |||
166 | clean_files(&client, millisecond_epoch, mattermost_data_directory, file_batch_size, dry_run).await?; | ||
167 | delete_file_info_rows(&client, millisecond_epoch, dry_run).await?; | ||
168 | if remove_posts { | ||
169 | delete_post_rows(&client, millisecond_epoch, dry_run).await?; | ||
170 | } else { | ||
171 | info!("Skipping posts removal") | ||
172 | } | ||
173 | |||
174 | Ok(()) | ||
175 | } | ||
176 | |||
177 | async fn clean_files( | ||
178 | client: &Client, | ||
179 | millisecond_epoch: i64, | ||
180 | mattermost_data_directory: &str, | ||
181 | file_batch_size: usize, | ||
182 | dry_run: bool, | ||
183 | ) -> Result<()> { | ||
184 | let mut batch = 0; | ||
185 | let mut more_results = true; | ||
186 | |||
187 | while more_results { | ||
188 | more_results = clean_files_batch( | ||
189 | client, | ||
190 | millisecond_epoch, | ||
191 | mattermost_data_directory, | ||
192 | file_batch_size, | ||
193 | batch, | ||
194 | dry_run, | ||
195 | ).await?; | ||
196 | batch += 1; | ||
197 | } | ||
198 | |||
199 | Ok(()) | ||
200 | } | ||
201 | |||
202 | async fn clean_files_batch( | ||
203 | client: &Client, | ||
204 | millisecond_epoch: i64, | ||
205 | mattermost_data_directory: &str, | ||
206 | file_batch_size: usize, | ||
207 | batch: usize, | ||
208 | dry_run: bool, | ||
209 | ) -> Result<bool> { | ||
210 | let query = " | ||
211 | SELECT path, thumbnailpath, previewpath | ||
212 | FROM fileinfo | ||
213 | WHERE createat < $1 | ||
214 | OFFSET $2 | ||
215 | LIMIT $3; | ||
216 | "; | ||
217 | trace!("Querying: {}",&query); | ||
218 | let offset = (batch * file_batch_size) as i64; | ||
219 | let limit = file_batch_size as i64; | ||
220 | trace!("params: {} {} {}",&millisecond_epoch, &offset, &limit); | ||
221 | let rows = client | ||
222 | .query(query, &[&millisecond_epoch, &offset, &limit]) | ||
223 | .await.context("Failed to fetch file info rows")?; | ||
224 | |||
225 | let mut more_results = false; | ||
226 | |||
227 | for row in rows { | ||
228 | more_results = true; | ||
229 | let path: String = row.get("path"); | ||
230 | let thumbnail_path: String = row.get("thumbnailpath"); | ||
231 | let preview_path: String = row.get("previewpath"); | ||
232 | |||
233 | if dry_run { | ||
234 | info!("[DRY RUN] Would remove: {:?}, {:?}, {:?}", path, thumbnail_path, preview_path); | ||
235 | } else { | ||
236 | remove_files(mattermost_data_directory, &path, &thumbnail_path, &preview_path).context("Failed to remove files")?; | ||
237 | } | ||
238 | } | ||
239 | |||
240 | Ok(more_results) | ||
241 | } | ||
242 | |||
243 | fn remove_files(base_dir: &str, path: &str, thumbnail_path: &str, preview_path: &str) -> Result<()> { | ||
244 | let files = [path, thumbnail_path, preview_path]; | ||
245 | let mut num_deleted = 0; | ||
246 | for file in files { | ||
247 | if !file.is_empty() { | ||
248 | let full_path = Path::new(base_dir).join(file); | ||
249 | if full_path.exists() { | ||
250 | fs::remove_file(full_path.clone()).context(format!("Failed to delete file: {:?}", &full_path))?; | ||
251 | trace!("Removed: {:#?} ", &full_path); | ||
252 | num_deleted += 1; | ||
253 | } else { | ||
254 | trace!("Path does not exist: {:#?} ", &full_path); | ||
255 | } | ||
256 | } | ||
257 | } | ||
258 | if num_deleted > 0 { | ||
259 | info!("Deleted: {} files. Main file: {}",num_deleted,path); | ||
260 | } else { | ||
261 | trace!("No files to be deleted"); | ||
262 | } | ||
263 | Ok(()) | ||
264 | } | ||
265 | |||
266 | async fn delete_file_info_rows(client: &Client, millisecond_epoch: i64, dry_run: bool) -> Result<()> { | ||
267 | let query = " | ||
268 | DELETE FROM fileinfo | ||
269 | WHERE createat < $1; | ||
270 | "; | ||
271 | trace!("Querying: {}",&query); | ||
272 | trace!("Params: {:#?}",&millisecond_epoch); | ||
273 | if dry_run { | ||
274 | info!("[DRY RUN] Would delete file info rows older than {}", millisecond_epoch); | ||
275 | return Ok(()); | ||
276 | } | ||
277 | let result = client.execute(query, &[&millisecond_epoch]).await.context("Failed to delete file info rows")?; | ||
278 | info!("Removed {} file information rows", result); | ||
279 | Ok(()) | ||
280 | } | ||
281 | |||
282 | async fn delete_post_rows(client: &Client, millisecond_epoch: i64, dry_run: bool) -> Result<()> { | ||
283 | let query = " | ||
284 | DELETE FROM posts | ||
285 | WHERE createat < $1; | ||
286 | "; | ||
287 | trace!("Querying: {}",&query); | ||
288 | trace!("Params: {:#?}",&millisecond_epoch); | ||
289 | if dry_run { | ||
290 | info!("[DRY RUN] Would delete post rows older than {}", millisecond_epoch); | ||
291 | return Ok(()); | ||
292 | } | ||
293 | let result = client.execute(query, &[&millisecond_epoch]).await.context("Failed to delete post rows")?; | ||
294 | info!("Removed {} post rows", result); | ||
295 | Ok(()) | ||
296 | } | ||
297 | |||
298 | fn validate( | ||
299 | mattermost_data_directory: &str, | ||
300 | database_name: &str, | ||
301 | database_user: &str, | ||
302 | database_host: &str, | ||
303 | retention_days: i64, | ||
304 | file_batch_size: usize, | ||
305 | ) -> Result<()> { | ||
306 | if mattermost_data_directory.is_empty() | ||
307 | || database_name.is_empty() | ||
308 | || database_user.is_empty() | ||
309 | || database_host.is_empty() | ||
310 | || retention_days <= 0 | ||
311 | || file_batch_size == 0 | ||
312 | { | ||
313 | anyhow::bail!("Invalid input parameters"); | ||
314 | } | ||
315 | Ok(()) | ||
316 | } |
-
Please register or sign in to post a comment