-
Notifications
You must be signed in to change notification settings - Fork 59
t2950: Fix quality-debt in setup.sh from PR #2936 review feedback #2994
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
dad309d
e633c8f
d420988
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -770,7 +770,7 @@ main() { | |||||
| # Also check legacy .conf user override | ||||||
| if [[ -z "$_pulse_user_config" && -f "${FEATURE_TOGGLES_USER:-$HOME/.config/aidevops/feature-toggles.conf}" ]]; then | ||||||
| local _legacy_val | ||||||
| _legacy_val=$(grep -E '^supervisor_pulse=' "${FEATURE_TOGGLES_USER:-$HOME/.config/aidevops/feature-toggles.conf}" 2>/dev/null | tail -1 | cut -d= -f2) | ||||||
| _legacy_val=$(grep -E '^supervisor_pulse=' "${FEATURE_TOGGLES_USER:-$HOME/.config/aidevops/feature-toggles.conf}" | tail -1 | cut -d= -f2) | ||||||
| if [[ -n "$_legacy_val" ]]; then | ||||||
| _pulse_user_config="$_legacy_val" | ||||||
| fi | ||||||
|
|
@@ -812,13 +812,13 @@ main() { | |||||
| _do_install=true | ||||||
| # Record explicit consent | ||||||
| if type cmd_set &>/dev/null; then | ||||||
| cmd_set "orchestration.supervisor_pulse" "true" 2>/dev/null || true | ||||||
| cmd_set "orchestration.supervisor_pulse" "true" || true | ||||||
| fi | ||||||
| else | ||||||
| _do_install=false | ||||||
| # Record explicit decline so we never re-prompt on updates | ||||||
| if type cmd_set &>/dev/null; then | ||||||
| cmd_set "orchestration.supervisor_pulse" "false" 2>/dev/null || true | ||||||
| cmd_set "orchestration.supervisor_pulse" "false" || true | ||||||
| fi | ||||||
| print_info "Skipped. Enable later: aidevops config set orchestration.supervisor_pulse true && ./setup.sh" | ||||||
| fi | ||||||
|
|
@@ -921,7 +921,7 @@ PLIST | |||||
| # Remove old-style cron entries (direct opencode invocation) | ||||||
| ( | ||||||
| crontab -l 2>/dev/null | grep -v 'aidevops: supervisor-pulse' | ||||||
| echo "*/2 * * * * OPENCODE_BIN=${opencode_bin} PULSE_DIR=${_aidevops_dir} /bin/bash ${wrapper_script} >> $HOME/.aidevops/logs/pulse-wrapper.log 2>&1 # aidevops: supervisor-pulse" | ||||||
| echo "*/2 * * * * OPENCODE_BIN='${opencode_bin}' PULSE_DIR='${_aidevops_dir}' /bin/bash '${wrapper_script}' >> '$HOME/.aidevops/logs/pulse-wrapper.log' 2>&1 # aidevops: supervisor-pulse" | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While single-quoting variables is a good improvement to handle paths with spaces, this is still vulnerable if any of the path variables contain a single quote. This could lead to parsing issues or command injection in the crontab. To make this fully robust, you should also escape any single quotes within the variables. The standard way to do this in shell is to replace each
Suggested change
|
||||||
| ) | crontab - 2>/dev/null || true | ||||||
|
coderabbitai[bot] marked this conversation as resolved.
Outdated
|
||||||
| if crontab -l 2>/dev/null | grep -qF "aidevops: supervisor-pulse"; then | ||||||
| print_info "Supervisor pulse enabled (cron, every 2 min). Disable: crontab -e and remove the supervisor-pulse line" | ||||||
|
|
||||||
Uh oh!
There was an error while loading. Please reload this page.