]>
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 | ||
4fdf13f9 TL |
19 | /// logfile for all API reuests handled by the proxy and privileged API daemons. Note that not all |
20 | /// failed logins can be logged here with full information, use the auth log for that. | |
346a488e | 21 | pub const API_ACCESS_LOG_FN: &str = concat!(PROXMOX_BACKUP_LOG_DIR_M!(), "/api/access.log"); |
8e7e2223 | 22 | |
4fdf13f9 TL |
23 | /// logfile for any failed authentication, via ticket or via token, and new successfull ticket |
24 | /// creations. This file can be useful for fail2ban. | |
25 | pub const API_AUTH_LOG_FN: &str = concat!(PROXMOX_BACKUP_LOG_DIR_M!(), "/api/auth.log"); | |
26 | ||
04b053d8 TL |
27 | /// the PID filename for the unprivileged proxy daemon |
28 | pub const PROXMOX_BACKUP_PROXY_PID_FN: &str = concat!(PROXMOX_BACKUP_RUN_DIR_M!(), "/proxy.pid"); | |
29 | ||
30 | /// the PID filename for the privileged api daemon | |
31 | pub const PROXMOX_BACKUP_API_PID_FN: &str = concat!(PROXMOX_BACKUP_RUN_DIR_M!(), "/api.pid"); | |
32 | ||
99be8844 DM |
33 | /// Prepend configuration directory to a file name |
34 | /// | |
35 | /// This is a simply way to get the full path for configuration files. | |
36 | /// #### Example: | |
37 | /// ``` | |
38 | /// # #[macro_use] extern crate proxmox_backup; | |
39 | /// let cert_path = configdir!("/proxy.pfx"); | |
40 | /// ``` | |
9f4962d3 WB |
41 | #[macro_export] |
42 | macro_rules! configdir { | |
4a7de56e | 43 | ($subdir:expr) => (concat!("/etc/proxmox-backup", $subdir)) |
9f4962d3 | 44 | } |