]> git.proxmox.com Git - proxmox-backup.git/blobdiff - src/api/config.rs
src/bin/proxmox-backup-proxy.rs: implement unpriviledged server
[proxmox-backup.git] / src / api / config.rs
index b395668b82fa67caeff80b509104064d9a7979eb..2bb9e86e692436a41d3af95c75a7ae77ed5d6d65 100644 (file)
@@ -9,15 +9,17 @@ pub struct ApiConfig {
     basedir: PathBuf,
     router: &'static Router,
     aliases: HashMap<String, PathBuf>,
+    env_type: RpcEnvironmentType,
 }
 
 impl ApiConfig {
 
-    pub fn new<B: Into<PathBuf>>(basedir: B, router: &'static Router) -> Self {
+    pub fn new<B: Into<PathBuf>>(basedir: B, router: &'static Router, env_type: RpcEnvironmentType) -> Self {
         Self {
             basedir: basedir.into(),
             router: router,
             aliases: HashMap::new(),
+            env_type,
         }
     }
 
@@ -58,4 +60,8 @@ impl ApiConfig {
     {
         self.aliases.insert(alias.into(), path.into());
     }
+
+    pub fn env_type(&self) -> RpcEnvironmentType {
+        self.env_type
+    }
 }