From 8500e495b00117651449896f6289fc8aec8c4b21 Mon Sep 17 00:00:00 2001
From: tteckster <tteckster@gmail.com>
Date: Thu, 23 Mar 2023 07:07:49 -0400
Subject: [PATCH] add Docker LXCs to build.func & tweaks

---
 ct/casaos.sh               |  2 +-
 ct/docker.sh               |  2 +-
 ct/homeassistant.sh        |  1 +
 ct/paperless-ngx.sh        |  1 -
 ct/photoprism.sh           |  1 -
 ct/pihole.sh               |  1 -
 ct/plex.sh                 |  1 -
 ct/podman-homeassistant.sh |  1 -
 ct/podman.sh               |  1 -
 ct/postgresql.sh           |  1 -
 ct/prometheus.sh           |  1 -
 ct/prowlarr.sh             |  1 -
 ct/radarr.sh               |  1 -
 ct/readarr.sh              |  1 -
 ct/rockylinux.sh           |  1 -
 ct/sabnzbd.sh              |  1 -
 ct/scrypted.sh             |  1 -
 ct/shinobi.sh              |  1 -
 ct/sonarr.sh               |  1 -
 ct/syncthing.sh            |  1 -
 ct/tdarr.sh                |  1 -
 ct/technitiumdns.sh        |  1 -
 ct/transmission.sh         |  1 -
 ct/trilium.sh              |  1 -
 ct/ubuntu.sh               |  1 -
 ct/umbrel.sh               |  3 +--
 ct/unifi.sh                |  1 -
 ct/uptimekuma.sh           |  1 -
 ct/vaultwarden.sh          |  1 -
 ct/whisparr.sh             |  1 -
 ct/whoogle.sh              |  1 -
 ct/wikijs.sh               |  1 -
 ct/wireguard.sh            |  1 -
 ct/yunohost.sh             |  1 -
 ct/zigbee2mqtt.sh          |  1 -
 ct/zwave-js-ui.sh          |  1 -
 misc/build.func            | 34 ++++++++++++++++++++++++++++++----
 37 files changed, 34 insertions(+), 40 deletions(-)

diff --git a/ct/casaos.sh b/ct/casaos.sh
index e7bcf8e2e..c98a025d0 100644
--- a/ct/casaos.sh
+++ b/ct/casaos.sh
@@ -1,5 +1,5 @@
 #!/usr/bin/env bash
-source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/docker.func)
+source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/build.func)
 # Copyright (c) 2021-2023 tteck
 # Author: tteck (tteckster)
 # License: MIT
diff --git a/ct/docker.sh b/ct/docker.sh
index 37ca38085..1805787c1 100644
--- a/ct/docker.sh
+++ b/ct/docker.sh
@@ -1,5 +1,5 @@
 #!/usr/bin/env bash
-source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/docker.func)
+source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/build.func)
 # Copyright (c) 2021-2023 tteck
 # Author: tteck (tteckster)
 # License: MIT
diff --git a/ct/homeassistant.sh b/ct/homeassistant.sh
index 590a9bf67..ac667247e 100644
--- a/ct/homeassistant.sh
+++ b/ct/homeassistant.sh
@@ -46,6 +46,7 @@ function default_settings() {
   MAC=""
   VLAN=""
   SSH="no"
+  FUSE="no"
   VERB="no"
   echo_default
 }
diff --git a/ct/paperless-ngx.sh b/ct/paperless-ngx.sh
index d2a9b9d17..09d46d452 100644
--- a/ct/paperless-ngx.sh
+++ b/ct/paperless-ngx.sh
@@ -8,7 +8,6 @@ source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/build
 function header_info {
   clear
   cat <<"EOF"
-
     ____                        __                                     
    / __ \____ _____  ___  _____/ /__  __________    ____  ____ __  __
   / /_/ / __ `/ __ \/ _ \/ ___/ / _ \/ ___/ ___/___/ __ \/ __ `/ |/_/
diff --git a/ct/photoprism.sh b/ct/photoprism.sh
index d40335e36..231f7d1ed 100644
--- a/ct/photoprism.sh
+++ b/ct/photoprism.sh
@@ -8,7 +8,6 @@ source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/build
 function header_info {
   clear
   cat <<"EOF"
-
     ____  __  ______  __________  ____  ____  _________ __  ___
    / __ \/ / / / __ \/_  __/ __ \/ __ \/ __ \/  _/ ___//  |/  /
   / /_/ / /_/ / / / / / / / / / / /_/ / /_/ // / \__ \/ /|_/ / 
diff --git a/ct/pihole.sh b/ct/pihole.sh
index 7efeb2806..07e786ea9 100644
--- a/ct/pihole.sh
+++ b/ct/pihole.sh
@@ -8,7 +8,6 @@ source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/build
 function header_info {
 clear
 cat <<"EOF"
-
     ____  ____   __  ______  __    ______
    / __ \/  _/  / / / / __ \/ /   / ____/
   / /_/ // /___/ /_/ / / / / /   / __/   
diff --git a/ct/plex.sh b/ct/plex.sh
index 17a8ecea1..48d125052 100644
--- a/ct/plex.sh
+++ b/ct/plex.sh
@@ -8,7 +8,6 @@ source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/build
 function header_info {
 clear
 cat <<"EOF"
-
     ____  __             __  ___         ___          _____                          
    / __ \/ /__  _  __   /  |/  /__  ____/ (_)___ _   / ___/___  ______   _____  _____
   / /_/ / / _ \| |/_/  / /|_/ / _ \/ __  / / __ `/   \__ \/ _ \/ ___/ | / / _ \/ ___/
diff --git a/ct/podman-homeassistant.sh b/ct/podman-homeassistant.sh
index 0f0182e20..be35917e8 100644
--- a/ct/podman-homeassistant.sh
+++ b/ct/podman-homeassistant.sh
@@ -8,7 +8,6 @@ source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/build
 function header_info {
 clear
 cat <<"EOF"
-
                      ____            __                                      
                     / __ \____  ____/ /___ ___  ____ _____                   
                    / /_/ / __ \/ __  / __  __ \/ __  / __ \                  
diff --git a/ct/podman.sh b/ct/podman.sh
index dd25f0579..b4297c51f 100644
--- a/ct/podman.sh
+++ b/ct/podman.sh
@@ -8,7 +8,6 @@ source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/build
 function header_info {
 clear
 cat <<"EOF"
-
     ____            __                    
    / __ \____  ____/ /___ ___  ____ _____ 
   / /_/ / __ \/ __  / __ `__ \/ __ `/ __ \
diff --git a/ct/postgresql.sh b/ct/postgresql.sh
index 754ced8ba..f0b606a1e 100644
--- a/ct/postgresql.sh
+++ b/ct/postgresql.sh
@@ -8,7 +8,6 @@ source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/build
 function header_info {
 clear
 cat <<"EOF"
-
     ____             __                 _____ ____    __ 
    / __ \____  _____/ /_____ _________ / ___// __ \  / / 
   / /_/ / __ \/ ___/ __/ __  / ___/ _ \\__ \/ / / / / /  
diff --git a/ct/prometheus.sh b/ct/prometheus.sh
index 4bc719305..16f177585 100644
--- a/ct/prometheus.sh
+++ b/ct/prometheus.sh
@@ -8,7 +8,6 @@ source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/build
 function header_info {
 clear
 cat <<"EOF"
-
     ____                            __  __                   
    / __ \_________  ____ ___  ___  / /_/ /_  ___  __  _______
   / /_/ / ___/ __ \/ __  __ \/ _ \/ __/ __ \/ _ \/ / / / ___/
diff --git a/ct/prowlarr.sh b/ct/prowlarr.sh
index b0dffde3d..2c3235414 100644
--- a/ct/prowlarr.sh
+++ b/ct/prowlarr.sh
@@ -8,7 +8,6 @@ source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/build
 function header_info {
 clear
 cat <<"EOF"
-
     ____                     __               
    / __ \_________ _      __/ /___  __________
   / /_/ / ___/ __ \ | /| / / / __ `/ ___/ ___/
diff --git a/ct/radarr.sh b/ct/radarr.sh
index 9ddd1b45a..a379e8ac0 100644
--- a/ct/radarr.sh
+++ b/ct/radarr.sh
@@ -8,7 +8,6 @@ source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/build
 function header_info {
 clear
 cat <<"EOF"
-
     ____            __               
    / __ \____ _____/ /___  __________
   / /_/ / __ `/ __  / __ `/ ___/ ___/
diff --git a/ct/readarr.sh b/ct/readarr.sh
index deca401dd..bea527d0d 100644
--- a/ct/readarr.sh
+++ b/ct/readarr.sh
@@ -8,7 +8,6 @@ source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/build
 function header_info {
 clear
 cat <<"EOF"
-
     ____                 __               
    / __ \___  ____ _____/ /___  __________
   / /_/ / _ \/ __ `/ __  / __ `/ ___/ ___/
diff --git a/ct/rockylinux.sh b/ct/rockylinux.sh
index d9c971658..edc69291f 100644
--- a/ct/rockylinux.sh
+++ b/ct/rockylinux.sh
@@ -8,7 +8,6 @@ source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/build
 function header_info {
 clear
 cat <<"EOF"
-
     ____             __            __    _                 
    / __ \____  _____/ /____  __   / /   (_)___  __  ___  __
   / /_/ / __ \/ ___/ //_/ / / /  / /   / / __ \/ / / / |/_/
diff --git a/ct/sabnzbd.sh b/ct/sabnzbd.sh
index 195e79553..ea75032d9 100644
--- a/ct/sabnzbd.sh
+++ b/ct/sabnzbd.sh
@@ -8,7 +8,6 @@ source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/build
 function header_info {
 clear
 cat <<"EOF"
-
    _____ ___    ____              __        __
   / ___//   |  / __ )____  ____  / /_  ____/ /
   \__ \/ /| | / __  / __ \/_  / / __ \/ __  / 
diff --git a/ct/scrypted.sh b/ct/scrypted.sh
index 45de42d48..d307d78c3 100644
--- a/ct/scrypted.sh
+++ b/ct/scrypted.sh
@@ -8,7 +8,6 @@ source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/build
 function header_info {
 clear
 cat <<"EOF"
-
    _____                       __           __
   / ___/____________  ______  / /____  ____/ /
   \__ \/ ___/ ___/ / / / __ \/ __/ _ \/ __  / 
diff --git a/ct/shinobi.sh b/ct/shinobi.sh
index dd27cd590..bc5572e69 100644
--- a/ct/shinobi.sh
+++ b/ct/shinobi.sh
@@ -8,7 +8,6 @@ source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/build
 function header_info {
 clear
 cat <<"EOF"
-
    _____ __    _             __    _ 
   / ___// /_  (_)___  ____  / /_  (_)
   \__ \/ __ \/ / __ \/ __ \/ __ \/ / 
diff --git a/ct/sonarr.sh b/ct/sonarr.sh
index c6bceefa6..ac6f23994 100644
--- a/ct/sonarr.sh
+++ b/ct/sonarr.sh
@@ -8,7 +8,6 @@ source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/build
 function header_info {
 clear
 cat <<"EOF"
-
    _____                            
   / ___/____  ____  ____  __________
   \__ \/ __ \/ __ \/ __ `/ ___/ ___/
diff --git a/ct/syncthing.sh b/ct/syncthing.sh
index d7bf2724b..292cf4db7 100644
--- a/ct/syncthing.sh
+++ b/ct/syncthing.sh
@@ -8,7 +8,6 @@ source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/build
 function header_info {
 clear
 cat <<"EOF"
-
    _____                  __  __    _            
   / ___/__  ______  _____/ /_/ /_  (_)___  ____ _
   \__ \/ / / / __ \/ ___/ __/ __ \/ / __ \/ __ `/
diff --git a/ct/tdarr.sh b/ct/tdarr.sh
index cb1e415af..994ae3db0 100644
--- a/ct/tdarr.sh
+++ b/ct/tdarr.sh
@@ -8,7 +8,6 @@ source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/build
 function header_info {
 clear
 cat <<"EOF"
-
   ______    __               
  /_  __/___/ /___  __________
   / / / __  / __ `/ ___/ ___/
diff --git a/ct/technitiumdns.sh b/ct/technitiumdns.sh
index 7233ca55a..f947cd072 100644
--- a/ct/technitiumdns.sh
+++ b/ct/technitiumdns.sh
@@ -8,7 +8,6 @@ source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/build
 function header_info {
 clear
 cat <<"EOF"
-
   ______          __          _ __  _                    ____  _   _______
  /_  __/__  _____/ /_  ____  (_) /_(_)_  ______ ___     / __ \/ | / / ___/
   / / / _ \/ ___/ __ \/ __ \/ / __/ / / / / __  __ \   / / / /  |/ /\__ \ 
diff --git a/ct/transmission.sh b/ct/transmission.sh
index 8b4c06a01..94e654d6f 100644
--- a/ct/transmission.sh
+++ b/ct/transmission.sh
@@ -8,7 +8,6 @@ source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/build
 function header_info {
 clear
 cat <<"EOF"
-
   ______                                _           _           
  /_  __/________ _____  _________ ___  (_)_________(_)___  ____ 
   / / / ___/ __ `/ __ \/ ___/ __ `__ \/ / ___/ ___/ / __ \/ __ \
diff --git a/ct/trilium.sh b/ct/trilium.sh
index 4ed13fcaf..3e15c458c 100644
--- a/ct/trilium.sh
+++ b/ct/trilium.sh
@@ -8,7 +8,6 @@ source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/build
 function header_info {
 clear
 cat <<"EOF"
-
   ______     _ ___               
  /_  __/____(_) (_)_  ______ ___ 
   / / / ___/ / / / / / / __ `__ \
diff --git a/ct/ubuntu.sh b/ct/ubuntu.sh
index 81501e208..bc2f0cc6d 100644
--- a/ct/ubuntu.sh
+++ b/ct/ubuntu.sh
@@ -8,7 +8,6 @@ source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/build
 function header_info {
 clear
 cat <<"EOF"
-
    __  ____                __       
   / / / / /_  __  ______  / /___  __
  / / / / __ \/ / / / __ \/ __/ / / /
diff --git a/ct/umbrel.sh b/ct/umbrel.sh
index 796693ce5..46ed1aa2e 100644
--- a/ct/umbrel.sh
+++ b/ct/umbrel.sh
@@ -1,5 +1,5 @@
 #!/usr/bin/env bash
-source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/docker.func)
+source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/build.func)
 # Copyright (c) 2021-2023 tteck
 # Author: tteck (tteckster)
 # License: MIT
@@ -8,7 +8,6 @@ source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/docke
 function header_info {
 clear
 cat <<"EOF"
-
    __  __          __              __
   / / / /___ ___  / /_  ________  / /
  / / / / __ `__ \/ __ \/ ___/ _ \/ / 
diff --git a/ct/unifi.sh b/ct/unifi.sh
index 19cb57e29..542f1f871 100644
--- a/ct/unifi.sh
+++ b/ct/unifi.sh
@@ -8,7 +8,6 @@ source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/build
 function header_info {
 clear
 cat <<"EOF"
-
    __  __      _ _____ 
   / / / /__   (_) __(_)
  / / / / __ \/ / /_/ / 
diff --git a/ct/uptimekuma.sh b/ct/uptimekuma.sh
index 467f927cb..4f64ecc34 100644
--- a/ct/uptimekuma.sh
+++ b/ct/uptimekuma.sh
@@ -8,7 +8,6 @@ source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/build
 function header_info {
 clear
 cat <<"EOF"
-
    __  __      __  _                   __ __                     
   / / / /___  / /_(_)___ ___  ___     / //_/_  ______ ___  ____ _
  / / / / __ \/ __/ / __  __ \/ _ \   / ,< / / / / __  __ \/ __  /
diff --git a/ct/vaultwarden.sh b/ct/vaultwarden.sh
index 28d7150c1..8f8879560 100644
--- a/ct/vaultwarden.sh
+++ b/ct/vaultwarden.sh
@@ -8,7 +8,6 @@ source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/build
 function header_info {
   clear
   cat <<"EOF"
-
  _    __            ____ _       __               __         
 | |  / /___ ___  __/ / /| |     / /___ __________/ /__  ____ 
 | | / / __ `/ / / / / __/ | /| / / __ `/ ___/ __  / _ \/ __ \
diff --git a/ct/whisparr.sh b/ct/whisparr.sh
index 4ae3b2497..c616282a1 100644
--- a/ct/whisparr.sh
+++ b/ct/whisparr.sh
@@ -8,7 +8,6 @@ source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/build
 function header_info {
 clear
 cat <<"EOF"
-
  _       ____    _                           
 | |     / / /_  (_)________  ____  __________
 | | /| / / __ \/ / ___/ __ \/ __ `/ ___/ ___/
diff --git a/ct/whoogle.sh b/ct/whoogle.sh
index 488babebd..e93b19d7b 100644
--- a/ct/whoogle.sh
+++ b/ct/whoogle.sh
@@ -8,7 +8,6 @@ source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/build
 function header_info {
 clear
 cat <<"EOF"
-
  _       ____  ______  ____  ________    ______
 | |     / / / / / __ \/ __ \/ ____/ /   / ____/
 | | /| / / /_/ / / / / / / / / __/ /   / __/   
diff --git a/ct/wikijs.sh b/ct/wikijs.sh
index 96a2e4dd2..e1ac98631 100644
--- a/ct/wikijs.sh
+++ b/ct/wikijs.sh
@@ -8,7 +8,6 @@ source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/build
 function header_info {
 clear
 cat <<"EOF"
-
  _       ___ __   _     _     
 | |     / (_) /__(_)   (_)____
 | | /| / / / //_/ /   / / ___/
diff --git a/ct/wireguard.sh b/ct/wireguard.sh
index 02bef5236..553de4e50 100644
--- a/ct/wireguard.sh
+++ b/ct/wireguard.sh
@@ -8,7 +8,6 @@ source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/build
 function header_info {
 clear
 cat <<"EOF"
-
  _       ___           ______                     __
 | |     / (_)_______  / ____/_  ______ __________/ /
 | | /| / / / ___/ _ \/ / __/ / / / __ `/ ___/ __  / 
diff --git a/ct/yunohost.sh b/ct/yunohost.sh
index 1d202995a..221989996 100644
--- a/ct/yunohost.sh
+++ b/ct/yunohost.sh
@@ -8,7 +8,6 @@ source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/build
 function header_info {
 clear
 cat <<"EOF"
-
 __  __                  __  __           __ 
 \ \/ /_  ______  ____  / / / /___  _____/ /_
  \  / / / / __ \/ __ \/ /_/ / __ \/ ___/ __/
diff --git a/ct/zigbee2mqtt.sh b/ct/zigbee2mqtt.sh
index 243b7d7ba..c1c59ff03 100644
--- a/ct/zigbee2mqtt.sh
+++ b/ct/zigbee2mqtt.sh
@@ -8,7 +8,6 @@ source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/build
 function header_info {
   clear
   cat <<"EOF"
-
  _____   _       __             ___   __  _______  ____________
 /__  /  (_)___ _/ /_  ___  ___ |__ \ /  |/  / __ \/_  __/_  __/
   / /  / / __  / __ \/ _ \/ _ \__/ // /|_/ / / / / / /   / /   
diff --git a/ct/zwave-js-ui.sh b/ct/zwave-js-ui.sh
index bfecfad72..ed8c0d64f 100644
--- a/ct/zwave-js-ui.sh
+++ b/ct/zwave-js-ui.sh
@@ -8,7 +8,6 @@ source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/build
 function header_info {
   clear
   cat <<"EOF"
-
  _____                                  _______    __  ______
 /__  /_      ______ __   _____         / / ___/   / / / /  _/
   / /| | /| / / __ `/ | / / _ \   __  / /\__ \   / / / // /  
diff --git a/misc/build.func b/misc/build.func
index 977d4706b..24336f628 100644
--- a/misc/build.func
+++ b/misc/build.func
@@ -87,6 +87,9 @@ echo_default() {
   echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
   echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
   echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
+  if [[ "$APP" == "Docker" || "$APP" == "Umbrel" || "$APP" == "CasaOS" || "$APP" == "Home Assistant" ]]; then
+    echo -e "${DGN}Enable Fuse Overlayfs (ZFS): ${BGN}No${CL}"
+  fi
   echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
   echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 }
@@ -300,6 +303,15 @@ advanced_settings() {
   fi
   echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
 
+  if [[ "$APP" == "Docker" || "$APP" == "Umbrel" || "$APP" == "CasaOS" || "$APP" == "Home Assistant" ]]; then
+    if (whiptail --defaultno --title "FUSE OVERLAYFS" --yesno "(ZFS) Enable Fuse Overlayfs?" 10 58); then
+      FUSE="yes"
+    else
+      FUSE="no"
+    fi
+    echo -e "${DGN}Enable Fuse Overlayfs (ZFS): ${BGN}$FUSE${CL}"
+  fi
+
   if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
     VERB="yes"
   else
@@ -355,15 +367,29 @@ start() {
 
 build_container() {
   if [ "$VERB" == "yes" ]; then set -x; fi
-  if [ "$CT_TYPE" == "1" ]; then
-    FEATURES="nesting=1,keyctl=1"
-  else
-    FEATURES="nesting=1"
+
+  if [[ "$APP" == "Docker" || "$APP" == "Umbrel" || "$APP" == "CasaOS" || "$APP" == "Home Assistant" ]]; then
+    if [ "$FUSE" == "yes" ]; then
+      FEATURES="fuse=1,keyctl=1,nesting=1"
+    else
+      FEATURES="keyctl=1,nesting=1"
+    fi
   fi
+  if [[ "$APP" != "Docker" && "$APP" != "Umbrel" && "$APP" != "CasaOS" && "$APP" != "Home Assistant"]]; then
+    if [ "$CT_TYPE" == "1" ]; then
+      FEATURES="keyctl=1,nesting=1"
+    else
+      FEATURES="nesting=1"
+    fi
+  fi
+
   TEMP_DIR=$(mktemp -d)
   pushd $TEMP_DIR >/dev/null
   export FUNCTIONS_FILE_PATH="$(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/install.func)"
   export tz="$timezone"
+  if [[ "$APP" == "Docker" || "$APP" == "Umbrel" || "$APP" == "CasaOS" || "$APP" == "Home Assistant" ]]; then
+  export ST="$FUSE"
+  fi
   export DISABLEIPV6="$DISABLEIP6"
   export APPLICATION="$APP"
   export VERBOSE="$VERB"