Compare commits

..

No commits in common. "14efcc579b2f2112fc034ecf0a24dad1cc8a7176" and "812e09c0442517cf6c5e21599736547089300cb4" have entirely different histories.

2 changed files with 8 additions and 14 deletions

21
init.sh
View File

@ -690,21 +690,16 @@ initUsers()
sudo systemctl restart docker sudo systemctl restart docker
isSuccessful "User $sudo_user_name created successfully." isSuccessful "User $sudo_user_name created successfully."
fi fi
# Manager-user sudo lives in a validated /etc/sudoers.d drop-in, not appended local sudoers_file="/etc/sudoers"
# to /etc/sudoers — a malformed line in the main file locks out sudo entirely. local sudo_entry="$sudo_user_name ALL=(ALL) NOPASSWD: ALL"
# The grant is broad for now; this single drop-in is what gets tightened to a if ! grep -q "$sudo_entry" $sudoers_file; then
# scoped command allowlist once the runtime no longer needs broad root. echo "" | sudo tee -a "$sudoers_file" > /dev/null
local sudoers_dropin="/etc/sudoers.d/${sudo_user_name}" echo "$sudo_entry" | sudo tee -a "$sudoers_file" > /dev/null
local sudoers_tmp sudo visudo -c > /dev/null
sudoers_tmp=$(mktemp) isSuccessful "Added passwordless sudo entry for user $sudo_user_name."
printf '%s ALL=(ALL) NOPASSWD: ALL\n' "$sudo_user_name" > "$sudoers_tmp"
if sudo visudo -cf "$sudoers_tmp" >/dev/null 2>&1; then
sudo install -m 0440 -o root -g root "$sudoers_tmp" "$sudoers_dropin"
isSuccessful "Configured passwordless sudo for $sudo_user_name (/etc/sudoers.d/${sudo_user_name})."
else else
isError "Refusing to install an invalid sudoers drop-in for $sudo_user_name." isSuccessful "Passwordless sudo entry already setup."
fi fi
rm -f "$sudoers_tmp"
} }
initFolders() initFolders()

View File

@ -24,7 +24,6 @@ source_scripts=(
"source/files/arrays/files_restore.sh" "source/files/arrays/files_restore.sh"
"source/files/arrays/files_setup.sh" "source/files/arrays/files_setup.sh"
"source/files/arrays/files_source.sh" "source/files/arrays/files_source.sh"
"source/files/arrays/files_ssh.sh"
"source/files/arrays/files_start.sh" "source/files/arrays/files_start.sh"
"source/files/arrays/files_update.sh" "source/files/arrays/files_update.sh"
"source/files/arrays/files_webui.sh" "source/files/arrays/files_webui.sh"