Skip to content

Pass residential proxy secret during deploy#60

Merged
protostatis merged 1 commit into
mainfrom
fix/deploy-residential-proxy-secret
Jun 1, 2026
Merged

Pass residential proxy secret during deploy#60
protostatis merged 1 commit into
mainfrom
fix/deploy-residential-proxy-secret

Conversation

@protostatis

Copy link
Copy Markdown
Owner

Summary: disables legacy WireGuard unconditionally before deploy network operations, passes the RESIDENTIAL_PROXY repository secret to the EC2 SSH step, and injects it into the crawler container. Also set the repository RESIDENTIAL_PROXY secret from the existing searchagentsky.com value without logging it. Tests: git diff --check.

@protostatis protostatis left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sky's Code Review

This PR unconditionally disables the legacy WireGuard VPN during deploy, passes the RESIDENTIAL_PROXY GitHub secret through to the EC2 SSH step via appleboy/ssh-action env/envs, and injects it into the crawler Docker container as an environment variable. The WireGuard change is a net reliability improvement — the old conditional check could silently skip if the env file drifted, and the unconditional disable with || true is safe. The main concern is that passing a secret via docker run -e RESIDENTIAL_PROXY=... exposes the value in docker inspect and ps output on the EC2 host, where any user on the machine could read it.

Verdict: Comment

Comments

  • No shell syntax issues. The set -e at script scope provides adequate error handling, and || true on the systemctl disable prevents failure when the WireGuard service doesn't exist.
  • The diff doesn't show the full docker run command, so Docker resource limits (--memory, --cpus), healthchecks, or log rotation are outside scope of this change. Verify they exist elsewhere in the script or in the Dockerfile/compose config.
  • PR mentions setting the repository-level RESIDENTIAL_PROXY secret from searchagentsky.com — make sure this is done in GitHub repo settings (Settings → Secrets and variables → Actions), not committed or printed anywhere.
  • The git diff --check self-test mentioned in the description would only catch trailing whitespace / trailing newline issues, not functional correctness. Consider whether a shellcheck or shell-lint step would add value for this deploy script.

Reviewed by Sky — Unchained Sky engineering agent

CRAWLER_ENV_ARGS=""
CRAWLER_SECRET_ENV_ARGS=""
if [ -n "$RESIDENTIAL_PROXY" ]; then
echo "Residential proxy secret available for crawler."

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Secrets passed via docker run -e VAR=value are visible in docker inspect, docker logs (occasionally), and the host's /proc/*/environ. On a shared EC2 instance, any user with SSH access can read this value. Consider writing it to a file with restrictive permissions (e.g., chmod 600) and using --env-file instead, or sourcing it via an existing env file that already has limited permissions. This is lower risk on a single-tenant server, but worth flagging.


CRAWLER_ENV_ARGS=""
CRAWLER_SECRET_ENV_ARGS=""
if [ -n "$RESIDENTIAL_PROXY" ]; then

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The echo confirms the secret's presence but doesn't leak the value — good. Consider omitting it entirely in deploy scripts to reduce noise and prevent accidental exposure in CI logs if someone later changes the echo.

fi
# Disable the legacy Reddit VPN before the first GitHub/Docker
# network operation. This deploy path now uses an app-level proxy.
echo "Disabling legacy WireGuard before network operations."

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously, WireGuard was only disabled if RESIDENTIAL_PROXY or PROXY_URL was set in /opt/crypto-sentiment/.env. Now it's unconditionally disabled on every deploy. This is a net improvement for reliability — the old check could silently fail if the env file was removed or drifted. Still worth noting in case a future operator expects the conditional behavior (e.g., if WireGuard is ever needed for something else on this host).


- name: Deploy to EC2
uses: appleboy/ssh-action@v1.0.3
env:

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using env: + envs: together is the correct pattern for appleboy/ssh-action — env makes the variable available to the action process, and envs (comma-separated) tells the action which variables to forward to the remote SSH session. This looks correct.

@protostatis
protostatis merged commit 084d8a9 into main Jun 1, 2026
3 checks passed
@protostatis
protostatis deleted the fix/deploy-residential-proxy-secret branch June 1, 2026 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant