2019-02-16 11:28:50 +00:00
|
|
|
//! Exports configuration data from the build system
|
|
|
|
|
|
|
|
/// The configured configuration directory
|
2019-09-11 10:06:59 +00:00
|
|
|
pub const CONFIGDIR: &str = "/etc/proxmox-backup";
|
2019-09-09 08:51:08 +00:00
|
|
|
pub const JS_DIR: &str = "/usr/share/javascript/proxmox-backup";
|
2019-02-04 14:13:03 +00:00
|
|
|
|
2020-11-02 07:50:56 +00:00
|
|
|
#[macro_export]
|
|
|
|
macro_rules! PROXMOX_BACKUP_RUN_DIR_M { () => ("/run/proxmox-backup") }
|
|
|
|
|
|
|
|
#[macro_export]
|
|
|
|
macro_rules! PROXMOX_BACKUP_LOG_DIR_M { () => ("/var/log/proxmox-backup") }
|
|
|
|
|
|
|
|
/// namespaced directory for in-memory (tmpfs) run state
|
|
|
|
pub const PROXMOX_BACKUP_RUN_DIR: &str = PROXMOX_BACKUP_RUN_DIR_M!();
|
2020-11-02 18:18:36 +00:00
|
|
|
|
2020-11-02 07:50:56 +00:00
|
|
|
/// namespaced directory for persistent logging
|
|
|
|
pub const PROXMOX_BACKUP_LOG_DIR: &str = PROXMOX_BACKUP_LOG_DIR_M!();
|
|
|
|
|
2021-03-10 15:37:09 +00:00
|
|
|
/// logfile for all API requests handled by the proxy and privileged API daemons. Note that not all
|
2020-11-04 15:12:13 +00:00
|
|
|
/// failed logins can be logged here with full information, use the auth log for that.
|
2020-11-02 07:50:56 +00:00
|
|
|
pub const API_ACCESS_LOG_FN: &str = concat!(PROXMOX_BACKUP_LOG_DIR_M!(), "/api/access.log");
|
2020-10-16 09:06:46 +00:00
|
|
|
|
2021-03-10 15:37:09 +00:00
|
|
|
/// logfile for any failed authentication, via ticket or via token, and new successful ticket
|
2020-11-04 15:12:13 +00:00
|
|
|
/// creations. This file can be useful for fail2ban.
|
|
|
|
pub const API_AUTH_LOG_FN: &str = concat!(PROXMOX_BACKUP_LOG_DIR_M!(), "/api/auth.log");
|
|
|
|
|
2020-11-02 18:18:36 +00:00
|
|
|
/// the PID filename for the unprivileged proxy daemon
|
|
|
|
pub const PROXMOX_BACKUP_PROXY_PID_FN: &str = concat!(PROXMOX_BACKUP_RUN_DIR_M!(), "/proxy.pid");
|
|
|
|
|
|
|
|
/// the PID filename for the privileged api daemon
|
|
|
|
pub const PROXMOX_BACKUP_API_PID_FN: &str = concat!(PROXMOX_BACKUP_RUN_DIR_M!(), "/api.pid");
|
|
|
|
|
2019-02-16 11:28:50 +00:00
|
|
|
/// Prepend configuration directory to a file name
|
|
|
|
///
|
|
|
|
/// This is a simply way to get the full path for configuration files.
|
|
|
|
/// #### Example:
|
|
|
|
/// ```
|
|
|
|
/// # #[macro_use] extern crate proxmox_backup;
|
|
|
|
/// let cert_path = configdir!("/proxy.pfx");
|
|
|
|
/// ```
|
2019-02-04 14:13:03 +00:00
|
|
|
#[macro_export]
|
|
|
|
macro_rules! configdir {
|
2019-09-09 08:51:08 +00:00
|
|
|
($subdir:expr) => (concat!("/etc/proxmox-backup", $subdir))
|
2019-02-04 14:13:03 +00:00
|
|
|
}
|
2020-12-14 13:11:32 +00:00
|
|
|
|
|
|
|
/// Prepend the run directory to a file name.
|
|
|
|
///
|
|
|
|
/// This is a simply way to get the full path for files in `/run`.
|
|
|
|
#[macro_export]
|
|
|
|
macro_rules! rundir {
|
|
|
|
($subdir:expr) => {
|
|
|
|
concat!(PROXMOX_BACKUP_RUN_DIR_M!(), $subdir)
|
|
|
|
};
|
|
|
|
}
|