Fix Reality target validation and deployment reliability - #1
Merged
Conversation
ziyue67
commented
Jul 14, 2026
Owner
- validate Reality TLS targets before generating config
- use a stable default target and refresh stale target selections
- force IPv4 DNS/direct egress for VLESS
- validate config before restart and apply TCP throughput tuning
- normalize the installer script to LF line endings
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Pull request overview
This PR aims to improve “Reality” target correctness and overall deployment reliability by validating TLS reachability of targets, biasing DNS/egress toward IPv4, validating generated config before restarting the service, and applying sysctl throughput tuning.
Changes:
- Add TLS-handshake validation for Reality targets and change the default target to
gateway.icloud.com. - Force IPv4-only DNS strategy and IPv4-only direct outbound domain strategy (with legacy env toggles).
- Validate config before restart, apply throughput sysctl tuning, and make deployment/redeploy paths fail fast on service start issues.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| sing-box-plus.sh | Adds Reality target validation/selection changes, IPv4-only DNS/direct egress knobs, sysctl throughput tuning, and stricter deploy/redeploy restart flow. |
| README.md | Updates the example Reality SNI and adds a note about Reality target TLS handshake validation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
549
to
+552
| pick_reality(){ | ||
| local arr=($REALITY_SERVERS); local n=${#arr[@]} | ||
| (( n == 0 )) && { printf '%s' "$REALITY_SERVER"; return; } | ||
| printf '%s' "${arr[$((RANDOM % n))]}" | ||
| local serve | ||
| for server in $REALITY_SERVERS; do | ||
| if validate_reality_target "$server"; then |
Comment on lines
+596
to
+600
| # Revalidate targets on every config generation so stale persisted domains | ||
| # cannot produce non-working Reality links. | ||
| RS_VR=$(pick_reality) | ||
| RS_GR=$(pick_reality) | ||
| RS_TR=$(pick_reality) |
Comment on lines
1289
to
1292
| write_systemd | ||
| systemctl restart "${SYSTEMD_SERVICE}" >/dev/null 2>&1 || true | ||
| apply_throughput_tuning | ||
| systemctl restart "${SYSTEMD_SERVICE}" || die "服务启动失败" | ||
| open_firewall |
Comment on lines
+1319
to
+1322
| write_systemd | ||
| apply_throughput_tuning | ||
| open_firewall | ||
| systemctl restart "${SYSTEMD_SERVICE}" || die "服务启动失败" |
Comment on lines
+292
to
+294
| # A Reality target must be reachable from the VPS. Keep the default stable; | ||
| # custom targets are checked before any generated configuration is used. | ||
| REALITY_SERVERS=${REALITY_SERVERS:-"gateway.icloud.com"} |
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.