aidevops 3.14.58 → 3.14.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/VERSION +1 -1
- package/aidevops.sh +1 -1
- package/package.json +1 -1
- package/setup.sh +50 -5
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
3.14.
|
|
1
|
+
3.14.60
|
package/aidevops.sh
CHANGED
package/package.json
CHANGED
package/setup.sh
CHANGED
|
@@ -12,7 +12,7 @@ shopt -s inherit_errexit 2>/dev/null || true
|
|
|
12
12
|
# AI Assistant Server Access Framework Setup Script
|
|
13
13
|
# Helps developers set up the framework for their infrastructure
|
|
14
14
|
#
|
|
15
|
-
# Version: 3.14.
|
|
15
|
+
# Version: 3.14.60
|
|
16
16
|
#
|
|
17
17
|
# Quick Install:
|
|
18
18
|
# npm install -g aidevops && aidevops update (recommended)
|
|
@@ -839,16 +839,60 @@ _setup_lock_owner_age() {
|
|
|
839
839
|
return 0
|
|
840
840
|
}
|
|
841
841
|
|
|
842
|
+
_setup_command_key_looks_secret() {
|
|
843
|
+
local key="$1"
|
|
844
|
+
key="${key#--}"
|
|
845
|
+
key="${key#-}"
|
|
846
|
+
case "$key" in
|
|
847
|
+
*password*|*passwd*|*secret*|*token*|*credential*|*api-key*|*api_key*|*apikey*|*access-key*|*access_key*|*private-key*|*private_key*|bearer)
|
|
848
|
+
return 0
|
|
849
|
+
;;
|
|
850
|
+
esac
|
|
851
|
+
return 1
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
_setup_redact_secret_like_command_values() {
|
|
855
|
+
local command_text="$1"
|
|
856
|
+
local redacted=""
|
|
857
|
+
local separator=""
|
|
858
|
+
local word=""
|
|
859
|
+
local lower_word=""
|
|
860
|
+
local key_part=""
|
|
861
|
+
local redact_next=false
|
|
862
|
+
|
|
863
|
+
for word in $command_text; do
|
|
864
|
+
lower_word=$(printf '%s' "$word" | tr '[:upper:]' '[:lower:]')
|
|
865
|
+
if [[ "$redact_next" == "true" ]]; then
|
|
866
|
+
word="[redacted]"
|
|
867
|
+
redact_next=false
|
|
868
|
+
elif [[ "$lower_word" == *=* ]]; then
|
|
869
|
+
key_part="${lower_word%%=*}"
|
|
870
|
+
if _setup_command_key_looks_secret "$key_part"; then
|
|
871
|
+
word="${word%%=*}=[redacted]"
|
|
872
|
+
fi
|
|
873
|
+
elif _setup_command_key_looks_secret "$lower_word"; then
|
|
874
|
+
redact_next=true
|
|
875
|
+
fi
|
|
876
|
+
redacted="${redacted}${separator}${word}"
|
|
877
|
+
separator=" "
|
|
878
|
+
done
|
|
879
|
+
|
|
880
|
+
printf '%s' "$redacted"
|
|
881
|
+
return 0
|
|
882
|
+
}
|
|
883
|
+
|
|
842
884
|
_setup_acquire_noninteractive_setup_lock() {
|
|
843
885
|
local lock_dir="${AIDEVOPS_SETUP_LOCK_DIR:-$HOME/.aidevops/locks/setup-noninteractive.lock.d}"
|
|
844
886
|
# Max seconds to wait for a live, non-stale owner before timing out.
|
|
845
|
-
local wait_ceiling="${AIDEVOPS_SETUP_WAIT_TIMEOUT_S:-
|
|
887
|
+
local wait_ceiling="${AIDEVOPS_SETUP_WAIT_TIMEOUT_S:-900}"
|
|
846
888
|
# Max seconds a live owner may hold the lock before it is treated as
|
|
847
889
|
# stale and reclaimed (0 disables stale-live reclaim).
|
|
848
890
|
local stale_ceiling="${AIDEVOPS_SETUP_STALE_TIMEOUT_S:-1800}"
|
|
849
891
|
local owner_pid="" owner_cmd="" owner_age=0
|
|
850
892
|
local reclaim_attempts=0 waited=0
|
|
851
893
|
local _diag_stl="$HOME/.aidevops/logs/setup-stage-timings.log"
|
|
894
|
+
local _diag_interval_s="${AIDEVOPS_SETUP_LOCK_DIAG_INTERVAL_S:-60}"
|
|
895
|
+
[[ "$_diag_interval_s" =~ ^[0-9]+$ && "$_diag_interval_s" -gt 0 ]] || _diag_interval_s=60
|
|
852
896
|
mkdir -p "$(dirname "$lock_dir")" 2>/dev/null || true
|
|
853
897
|
while true; do
|
|
854
898
|
if mkdir "$lock_dir" 2>/dev/null; then
|
|
@@ -916,6 +960,7 @@ _setup_acquire_noninteractive_setup_lock() {
|
|
|
916
960
|
owner_age=$(_setup_lock_owner_age "$lock_dir" "$owner_pid")
|
|
917
961
|
owner_cmd=""
|
|
918
962
|
[[ -r "$lock_dir/command" ]] && owner_cmd=$(tr '\n' ' ' <"$lock_dir/command" 2>/dev/null || true)
|
|
963
|
+
[[ -n "$owner_cmd" ]] && owner_cmd=$(_setup_redact_secret_like_command_values "$owner_cmd")
|
|
919
964
|
local _diag_stage=""
|
|
920
965
|
if [[ -r "$_diag_stl" ]]; then
|
|
921
966
|
local _diag_cur_stage=""
|
|
@@ -941,11 +986,11 @@ _setup_acquire_noninteractive_setup_lock() {
|
|
|
941
986
|
return 75
|
|
942
987
|
fi
|
|
943
988
|
|
|
944
|
-
# Emit diagnostics on first block and every
|
|
989
|
+
# Emit diagnostics on first block and every diagnostic interval thereafter.
|
|
945
990
|
if [[ "$waited" -eq 0 ]]; then
|
|
946
991
|
print_info "Another setup.sh --non-interactive is running (pid ${owner_pid}, age ${owner_age}s${_diag_stage}${owner_cmd:+, command: ${owner_cmd}}). Waiting up to ${wait_ceiling}s (AIDEVOPS_SETUP_WAIT_TIMEOUT_S). Diagnose: ${_diag_stl}"
|
|
947
|
-
elif [[ $(( waited %
|
|
948
|
-
print_info "Still waiting for setup lock (owner pid ${owner_pid}, age ${owner_age}s, waited ${waited}s of ${wait_ceiling}s max)."
|
|
992
|
+
elif [[ $(( waited % _diag_interval_s )) -eq 0 ]]; then
|
|
993
|
+
print_info "Still waiting for setup lock (owner pid ${owner_pid}, age ${owner_age}s${_diag_stage}${owner_cmd:+, command: ${owner_cmd}}, waited ${waited}s of ${wait_ceiling}s max). Diagnose: ${_diag_stl}"
|
|
949
994
|
fi
|
|
950
995
|
|
|
951
996
|
sleep 10
|