]> git.proxmox.com Git - proxmox-backup.git/blob - src/buildcfg.rs
tape: remove MediaLabelInfo, use MediaId instead
[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
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. 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");
22
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
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
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 /// ```
41 #[macro_export]
42 macro_rules! configdir {
43 ($subdir:expr) => (concat!("/etc/proxmox-backup", $subdir))
44 }