]> git.proxmox.com Git - proxmox-backup.git/blob - src/buildcfg.rs
7b61ff26df0e26486c27696a47d2b87ab78e766b
[proxmox-backup.git] / src / buildcfg.rs
1 //! Exports configuration data from the build system
2
3 /// The configured configuration directory
4 pub const CONFIGDIR: &str = "/etc/proxmox-backup";
5 pub const JS_DIR: &str = "/usr/share/javascript/proxmox-backup";
6
7 #[macro_export]
8 macro_rules! PROXMOX_BACKUP_RUN_DIR_M { () => ("/run/proxmox-backup") }
9
10 #[macro_export]
11 macro_rules! PROXMOX_BACKUP_LOG_DIR_M { () => ("/var/log/proxmox-backup") }
12
13 /// namespaced directory for in-memory (tmpfs) run state
14 pub const PROXMOX_BACKUP_RUN_DIR: &str = PROXMOX_BACKUP_RUN_DIR_M!();
15 /// namespaced directory for persistent logging
16 pub const PROXMOX_BACKUP_LOG_DIR: &str = PROXMOX_BACKUP_LOG_DIR_M!();
17
18 /// logfile for all API reuests handled by the proxy and privileged API daemons
19 pub const API_ACCESS_LOG_FN: &str = concat!(PROXMOX_BACKUP_LOG_DIR_M!(), "/api/access.log");
20
21 /// Prepend configuration directory to a file name
22 ///
23 /// This is a simply way to get the full path for configuration files.
24 /// #### Example:
25 /// ```
26 /// # #[macro_use] extern crate proxmox_backup;
27 /// let cert_path = configdir!("/proxy.pfx");
28 /// ```
29 #[macro_export]
30 macro_rules! configdir {
31 ($subdir:expr) => (concat!("/etc/proxmox-backup", $subdir))
32 }