1 //! Exports configuration data from the build system
3 /// The configured configuration directory
4 pub const CONFIGDIR
: &str = "/etc/proxmox-backup";
5 pub const JS_DIR
: &str = "/usr/share/javascript/proxmox-backup";
8 macro_rules
! PROXMOX_BACKUP_RUN_DIR_M { () => ("/run/proxmox-backup") }
11 macro_rules
! PROXMOX_BACKUP_LOG_DIR_M { () => ("/var/log/proxmox-backup") }
13 /// namespaced directory for in-memory (tmpfs) run state
14 pub const PROXMOX_BACKUP_RUN_DIR
: &str = PROXMOX_BACKUP_RUN_DIR_M
!();
16 /// namespaced directory for persistent logging
17 pub const PROXMOX_BACKUP_LOG_DIR
: &str = PROXMOX_BACKUP_LOG_DIR_M
!();
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.
21 pub const API_ACCESS_LOG_FN
: &str = concat
!(PROXMOX_BACKUP_LOG_DIR_M
!(), "/api/access.log");
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");
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");
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");
33 /// Prepend configuration directory to a file name
35 /// This is a simply way to get the full path for configuration files.
38 /// # #[macro_use] extern crate proxmox_backup;
39 /// let cert_path = configdir!("/proxy.pfx");
42 macro_rules
! configdir
{
43 ($subdir
:expr
) => (concat
!("/etc/proxmox-backup", $subdir
))