]>
Commit | Line | Data |
---|---|---|
254b1f22 SR |
1 | //! See the different modules for documentation on their usage. |
2 | //! | |
3 | //! The [backup](backup/index.html) module contains some detailed information | |
4 | //! on the inner workings of the backup server regarding data storage. | |
5 | ||
450105b0 WB |
6 | use std::path::PathBuf; |
7 | ||
09340f28 DM |
8 | use proxmox::tools::fs::CreateOptions; |
9 | ||
450105b0 WB |
10 | use pbs_buildcfg::configdir; |
11 | use pbs_tools::cert::CertInfo; | |
09340f28 | 12 | use proxmox_rrd::RRDCache; |
450105b0 | 13 | |
8f973f81 | 14 | #[macro_use] |
51b499db DM |
15 | pub mod tools; |
16 | ||
7e21da6e | 17 | #[macro_use] |
882594c5 | 18 | pub mod server; |
16b48b81 | 19 | |
986bef16 | 20 | #[macro_use] |
cbdd8c54 | 21 | pub mod backup; |
35cf5daa | 22 | |
a8f268af | 23 | pub mod config; |
678d72df | 24 | |
576e3bf2 | 25 | pub mod api2; |
e8edbbd4 | 26 | |
6c30068e | 27 | pub mod auth_helpers; |
7d817b03 DM |
28 | |
29 | pub mod auth; | |
6359dc89 | 30 | |
8c15560b | 31 | pub mod tape; |
f2f526b6 WB |
32 | |
33 | pub mod acme; | |
01a08021 WB |
34 | |
35 | pub mod client_helpers; | |
450105b0 WB |
36 | |
37 | /// Get the server's certificate info (from `proxy.pem`). | |
38 | pub fn cert_info() -> Result<CertInfo, anyhow::Error> { | |
39 | CertInfo::from_path(PathBuf::from(configdir!("/proxy.pem"))) | |
40 | } | |
09340f28 DM |
41 | |
42 | lazy_static::lazy_static!{ | |
43 | /// Proxmox Backup Server RRD cache instance | |
44 | pub static ref RRD_CACHE: RRDCache = { | |
45 | let backup_user = pbs_config::backup_user().unwrap(); | |
46 | let file_options = CreateOptions::new() | |
47 | .owner(backup_user.uid) | |
48 | .group(backup_user.gid); | |
49 | ||
50 | let dir_options = CreateOptions::new() | |
51 | .owner(backup_user.uid) | |
52 | .group(backup_user.gid); | |
53 | ||
54 | RRDCache::new( | |
55 | "/var/lib/proxmox-backup/rrdb", | |
56 | Some(file_options), | |
57 | Some(dir_options), | |
58 | ) | |
59 | }; | |
60 | } |