]> git.proxmox.com Git - proxmox-backup.git/blame - src/buildcfg.rs
depend on libjs-qrcodejs
[proxmox-backup.git] / src / buildcfg.rs
CommitLineData
99be8844
DM
1//! Exports configuration data from the build system
2
3/// The configured configuration directory
653b1ca1 4pub const CONFIGDIR: &str = "/etc/proxmox-backup";
4a7de56e 5pub const JS_DIR: &str = "/usr/share/javascript/proxmox-backup";
9f4962d3 6
346a488e
TL
7#[macro_export]
8macro_rules! PROXMOX_BACKUP_RUN_DIR_M { () => ("/run/proxmox-backup") }
9
10#[macro_export]
11macro_rules! PROXMOX_BACKUP_LOG_DIR_M { () => ("/var/log/proxmox-backup") }
12
13/// namespaced directory for in-memory (tmpfs) run state
14pub const PROXMOX_BACKUP_RUN_DIR: &str = PROXMOX_BACKUP_RUN_DIR_M!();
04b053d8 15
346a488e
TL
16/// namespaced directory for persistent logging
17pub 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 21pub 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.
25pub 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
28pub 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
31pub 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]
42macro_rules! configdir {
4a7de56e 43 ($subdir:expr) => (concat!("/etc/proxmox-backup", $subdir))
9f4962d3 44}
96918252
WB
45
46/// Prepend the run directory to a file name.
47///
48/// This is a simply way to get the full path for files in `/run`.
49#[macro_export]
50macro_rules! rundir {
51 ($subdir:expr) => {
52 concat!(PROXMOX_BACKUP_RUN_DIR_M!(), $subdir)
53 };
54}