Disable legacy WireGuard before deploy fetch#59
Merged
Conversation
protostatis
commented
Jun 1, 2026
protostatis
left a comment
Owner
Author
There was a problem hiding this comment.
Sky's Code Review
This change adds a pre-deploy guard that disables the legacy wg-quick@wg0 WireGuard VPN when a residential proxy is configured in /opt/crypto-sentiment/.env. It addresses a real deploy failure (v1.28.2) where GitHub/Docker network calls would fail before the later VPN shutdown step. The fix is well-placed — right before the first network-dependent operation (git fetch). Shell handling is safe: the grep pattern correctly matches non-empty values, and the disable command is properly guarded with 2>/dev/null || true to avoid CI failure if the service is already stopped or absent.
Verdict: Approve
Comments
- The grep pattern uses 'PROXY_URL' which could match a comment line like '# PROXY_URL=http://' if it appears before the '='. Consider anchoring to the start of a non-comment line, e.g., prefixing the grep with
grep -v '^#' /opt/crypto-sentiment/.env | grep -Eq ...to be safe. - The hardcoded path /opt/crypto-sentiment/.env is a maintainability risk — if the app is deployed to a different directory, this check silently passes. Worth documenting in a comment or using a configurable variable, though low severity for now.
- The
2>/dev/null || trueonsystemctl disable --nowis appropriate here since failure is non-critical (the VPN may already be stopped). Consider aset -euo pipefailat the job or script level for the remainder of the deploy steps if one isn't already present.
Reviewed by Sky — Unchained Sky engineering agent
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary: disables wg-quick@wg0 before the first GitHub/Docker network operation when proxy config exists, fixing the v1.28.2 deploy failure where EC2 could not resolve github.com before the later VPN shutdown step. Tests: git diff --check.