]> git.proxmox.com Git - proxmox-backup.git/blame - src/lib.rs
move RRD code into proxmox-rrd crate
[proxmox-backup.git] / src / lib.rs
CommitLineData
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
6use std::path::PathBuf;
7
09340f28
DM
8use proxmox::tools::fs::CreateOptions;
9
450105b0
WB
10use pbs_buildcfg::configdir;
11use pbs_tools::cert::CertInfo;
09340f28 12use proxmox_rrd::RRDCache;
450105b0 13
8f973f81 14#[macro_use]
51b499db
DM
15pub mod tools;
16
7e21da6e 17#[macro_use]
882594c5 18pub mod server;
16b48b81 19
986bef16 20#[macro_use]
cbdd8c54 21pub mod backup;
35cf5daa 22
a8f268af 23pub mod config;
678d72df 24
576e3bf2 25pub mod api2;
e8edbbd4 26
6c30068e 27pub mod auth_helpers;
7d817b03
DM
28
29pub mod auth;
6359dc89 30
8c15560b 31pub mod tape;
f2f526b6
WB
32
33pub mod acme;
01a08021
WB
34
35pub mod client_helpers;
450105b0
WB
36
37/// Get the server's certificate info (from `proxy.pem`).
38pub fn cert_info() -> Result<CertInfo, anyhow::Error> {
39 CertInfo::from_path(PathBuf::from(configdir!("/proxy.pem")))
40}
09340f28
DM
41
42lazy_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}