.
This commit is contained in:
@@ -4,34 +4,35 @@
|
|||||||
# Implements 2FA for SSH, Cockpit, and Webmin services
|
# Implements 2FA for SSH, Cockpit, and Webmin services
|
||||||
# Uses Google Authenticator (TOTP) for time-based tokens
|
# Uses Google Authenticator (TOTP) for time-based tokens
|
||||||
|
|
||||||
# Script can be called from different contexts, so use absolute path resolution
|
|
||||||
SCRIPT_DIR="$(dirname "$(realpath "${BASH_SOURCE[0]}")")"
|
|
||||||
PROJECT_ROOT="$(dirname "$(dirname "$(dirname "$SCRIPT_DIR")")")"
|
|
||||||
|
|
||||||
# Set up framework variables expected by includes
|
#####
|
||||||
export PROJECT_ROOT_PATH="$PROJECT_ROOT"
|
#Core framework functions...
|
||||||
|
#####
|
||||||
|
|
||||||
export PROJECT_ROOT_PATH
|
export PROJECT_ROOT_PATH
|
||||||
PROJECT_ROOT_PATH="$(realpath ../../../)"
|
PROJECT_ROOT_PATH="$(realpath ../../../)"
|
||||||
|
|
||||||
|
#Framework variables are read from hee
|
||||||
|
|
||||||
|
|
||||||
export GIT_VENDOR_PATH_ROOT
|
export GIT_VENDOR_PATH_ROOT
|
||||||
GIT_VENDOR_PATH_ROOT="$PROJECT_ROOT_PATH/vendor/git@git.knownelement.com/29418/"
|
GIT_VENDOR_PATH_ROOT="$PROJECT_ROOT_PATH/vendor/git@git.knownelement.com/29418/"
|
||||||
|
|
||||||
export KNELShellFrameworkRoot
|
export KNELShellFrameworkRoot
|
||||||
KNELShellFrameworkRoot="$GIT_VENDOR_PATH_ROOT/KNEL/KNELShellFramework"
|
KNELShellFrameworkRoot="$GIT_VENDOR_PATH_ROOT/KNEL/KNELShellFramework"
|
||||||
|
|
||||||
#Framework variables are read from hee
|
|
||||||
source $KNELShellFrameworkRoot/Framework-ConfigFiles/FrameworkVars
|
source $KNELShellFrameworkRoot/Framework-ConfigFiles/FrameworkVars
|
||||||
|
|
||||||
# Source framework functions
|
|
||||||
for framework_include_file in $KNELShellFrameworkRoot/Framework-Includes/*; do
|
for framework_include_file in $KNELShellFrameworkRoot/Framework-Includes/*; do
|
||||||
source "$framework_include_file"
|
source "$framework_include_file"
|
||||||
done
|
done
|
||||||
|
|
||||||
for project_include_file in ../Project-Includes/*; do
|
for project_include_file in ../../../Project-Includes/*; do
|
||||||
source "$project_include_file"
|
source "$project_include_file"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
#Framework variables are read from hee
|
||||||
|
source $KNELShellFrameworkRoot/Framework-ConfigFiles/FrameworkVars
|
||||||
|
|
||||||
# 2FA Configuration
|
# 2FA Configuration
|
||||||
BACKUP_DIR="/root/backup/2fa"
|
BACKUP_DIR="/root/backup/2fa"
|
||||||
|
@@ -9,6 +9,7 @@ PROJECT_ROOT_PATH="$(realpath ../../../)"
|
|||||||
|
|
||||||
#Framework variables are read from hee
|
#Framework variables are read from hee
|
||||||
|
|
||||||
|
|
||||||
export GIT_VENDOR_PATH_ROOT
|
export GIT_VENDOR_PATH_ROOT
|
||||||
GIT_VENDOR_PATH_ROOT="$PROJECT_ROOT_PATH/vendor/git@git.knownelement.com/29418/"
|
GIT_VENDOR_PATH_ROOT="$PROJECT_ROOT_PATH/vendor/git@git.knownelement.com/29418/"
|
||||||
|
|
||||||
@@ -25,6 +26,9 @@ for project_include_file in ../../../Project-Includes/*; do
|
|||||||
source "$project_include_file"
|
source "$project_include_file"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
#Framework variables are read from hee
|
||||||
|
source $KNELShellFrameworkRoot/Framework-ConfigFiles/FrameworkVars
|
||||||
|
|
||||||
|
|
||||||
# We don't want to run this on the wazuh server, otherwise bad things happen...
|
# We don't want to run this on the wazuh server, otherwise bad things happen...
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user