]>
Commit | Line | Data |
---|---|---|
99be8844 DM |
1 | //! Exports configuration data from the build system |
2 | ||
3 | /// The configured configuration directory | |
653b1ca1 | 4 | pub const CONFIGDIR: &str = "/etc/proxmox-backup"; |
4a7de56e | 5 | pub const JS_DIR: &str = "/usr/share/javascript/proxmox-backup"; |
9f4962d3 | 6 | |
346a488e TL |
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!(); | |
04b053d8 | 15 | |
346a488e TL |
16 | /// namespaced directory for persistent logging |
17 | pub const PROXMOX_BACKUP_LOG_DIR: &str = PROXMOX_BACKUP_LOG_DIR_M!(); | |
18 | ||
19 | /// logfile for all API reuests handled by the proxy and privileged API daemons | |
20 | pub const API_ACCESS_LOG_FN: &str = concat!(PROXMOX_BACKUP_LOG_DIR_M!(), "/api/access.log"); | |
8e7e2223 | 21 | |
04b053d8 TL |
22 | /// the PID filename for the unprivileged proxy daemon |
23 | pub const PROXMOX_BACKUP_PROXY_PID_FN: &str = concat!(PROXMOX_BACKUP_RUN_DIR_M!(), "/proxy.pid"); | |
24 | ||
25 | /// the PID filename for the privileged api daemon | |
26 | pub const PROXMOX_BACKUP_API_PID_FN: &str = concat!(PROXMOX_BACKUP_RUN_DIR_M!(), "/api.pid"); | |
27 | ||
99be8844 DM |
28 | /// Prepend configuration directory to a file name |
29 | /// | |
30 | /// This is a simply way to get the full path for configuration files. | |
31 | /// #### Example: | |
32 | /// ``` | |
33 | /// # #[macro_use] extern crate proxmox_backup; | |
34 | /// let cert_path = configdir!("/proxy.pfx"); | |
35 | /// ``` | |
9f4962d3 WB |
36 | #[macro_export] |
37 | macro_rules! configdir { | |
4a7de56e | 38 | ($subdir:expr) => (concat!("/etc/proxmox-backup", $subdir)) |
9f4962d3 | 39 | } |