In case of invalid networking DNS settings disable MagicDNS to enable the app to start up#662
In case of invalid networking DNS settings disable MagicDNS to enable the app to start up#662lmagyar wants to merge 1 commit into
Conversation
… the app to start up
WalkthroughThe PR adds DNS preflight validation in the stage2 hook to detect MagicDNS servers and automatically enable userspace_networking when detected, while reformatting an existing fatal error log call in the init script for consistency. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@tailscale/rootfs/etc/s6-overlay/scripts/stage2_hook.sh`:
- Line 95: Change the unguarded Supervisor write so a failed
bashio::addon.option 'userspace_networking' 'true' does not abort startup and
also record the intended setting in a shell variable; specifically, call
bashio::addon.option in a way that ignores failure (so set -e won't exit) and
set a variable like forced_userspace_networking=true when you attempt the write,
then replace later checks that currently use bashio::config.true
"userspace_networking" (at the pruning logic) with a guard that accepts either
the Supervisor config or the local variable, e.g. use bashio::config.true
"userspace_networking" || bashio::var.true "${forced_userspace_networking}" so
removals are gated by either the persisted config or the recorded intended
state.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 79439d36-6732-452d-b0d0-6f20fef7387b
📒 Files selected for processing (2)
tailscale/rootfs/etc/s6-overlay/s6-rc.d/init-magicdns-ingress-proxy/runtailscale/rootfs/etc/s6-overlay/scripts/stage2_hook.sh
Proposed Changes
Currently the app intentionally can't start if MagicDNS is configured in network settings as DNS server and MagicDNS is enabled (ie. userspace networking is disabled).
With this change, if invalid config is detected, userspace networking will be enabled, ie. MagicDNS will be disabled, and a long warning is logged, but the app can start at least.
Related Issues
fixes #659 #651
Summary by CodeRabbit
Release Notes
Bug Fixes
Refactor