Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
5c356e8
Preserve Merlin postconf execution
maghuro Sep 27, 2026
8fd8f30
Make Merlin postconf hooks coexist safely
maghuro Sep 27, 2026
9a2cf74
Test Merlin postconf coexistence
maghuro Sep 27, 2026
e16a7fc
Harden Merlin postconf block lifecycle
maghuro Sep 27, 2026
3b0389a
Cover Merlin hook migration edge cases
maghuro Sep 27, 2026
b34a131
Preserve Merlin hook ownership and symlinks
maghuro Sep 27, 2026
7dddf37
Test Merlin hook ownership and symlink safety
maghuro Sep 27, 2026
7198447
Never delete shared Merlin hook files
maghuro Sep 27, 2026
df2be2d
Test conservative Merlin hook cleanup
maghuro Sep 27, 2026
518f1e6
Harden Merlin hook block parsing
maghuro Sep 27, 2026
397e191
Test exact Merlin hook ownership and round trips
maghuro Sep 27, 2026
d2e7540
Fix legacy Merlin postconf fixture
maghuro Sep 27, 2026
3fbfdf6
Preserve legacy separators and hook metadata
maghuro Sep 27, 2026
9306499
Normalize legacy Merlin hook separators
maghuro Sep 27, 2026
fcae247
Test legacy hook fidelity and permissions
maghuro Sep 27, 2026
9cd8802
Track ctrld-owned synthetic Merlin shebang
maghuro Sep 27, 2026
8d4335f
Make Merlin hook installs reversible and preflighted
maghuro Sep 27, 2026
3a8505b
Preflight Merlin hooks before shared writes
maghuro Sep 27, 2026
2b4be57
Test reversible Merlin shebangs and hook preflight
maghuro Sep 27, 2026
05dccdd
Roll back partial Merlin hook writes
maghuro Sep 27, 2026
bcddf97
Test rollback after partial Merlin hook write
maghuro Sep 27, 2026
bc206cd
Make Merlin hook rollback test deterministic
maghuro Sep 27, 2026
f9782e6
Inject Merlin hook write failure in regression test
maghuro Sep 27, 2026
81a6cb2
Extend Merlin setup transaction and revalidate hooks
maghuro Sep 27, 2026
c77595c
Test Merlin hook precommit revalidation
maghuro Sep 27, 2026
b89540e
Narrow Merlin hook coexistence to main postconf
maghuro Sep 27, 2026
1a9f978
Keep SDN hook support out of coexistence patch
maghuro Sep 27, 2026
ac5906f
Keep coexistence tests scoped and portable
maghuro Sep 27, 2026
9201f3e
Sync Merlin hook directory after atomic rename
maghuro Sep 27, 2026
390142b
Tidy Merlin coexistence test imports
maghuro Sep 27, 2026
37f0d7e
Isolate ctrld Merlin hook variables
maghuro Sep 27, 2026
57f4a5d
Test Merlin postconf namespace isolation
maghuro Sep 27, 2026
f6cd94e
Fix Merlin postconf subshell newline
maghuro Sep 27, 2026
4de5592
Test real Merlin subshell line breaks
maghuro Sep 27, 2026
9418d08
Fix Merlin mode-preservation test fixture
maghuro Sep 27, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions internal/router/dnsmasq/dnsmasq.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,21 @@ max-cache-ttl=0
`

const (
MerlinConfPath = "/tmp/etc/dnsmasq.conf"
MerlinJffsConfDir = "/jffs/configs"
MerlinJffsConfPath = "/jffs/configs/dnsmasq.conf"
MerlinPostConfPath = "/jffs/scripts/dnsmasq.postconf"
MerlinConfPath = "/tmp/etc/dnsmasq.conf"
MerlinJffsConfDir = "/jffs/configs"
MerlinJffsConfPath = "/jffs/configs/dnsmasq.conf"
MerlinPostConfPath = "/jffs/scripts/dnsmasq.postconf"
)

const MerlinPostConfMarker = `# GENERATED BY ctrld - EOF`
const MerlinPostConfTmpl = `# GENERATED BY ctrld - DO NOT MODIFY

#!/bin/sh
const (
MerlinPostConfBeginMarker = `# BEGIN ctrld`
MerlinPostConfEndMarker = `# END ctrld`
MerlinSyntheticShebangMarker = `# ctrld: synthetic shebang`
// MerlinPostConfMarker is the legacy end marker used by ctrld <= 1.5.7.
MerlinPostConfMarker = `# GENERATED BY ctrld - EOF`
)

const MerlinPostConfTmpl = `(
config_file="$1"
. /usr/sbin/helper.sh

Expand Down Expand Up @@ -66,9 +70,8 @@ if [ -n "$pid" ] && [ -f "/proc/${pid}/cmdline" ]; then
# Change /etc/resolv.conf, which may be changed by WAN DNS setup
pc_delete "nameserver" /etc/resolv.conf
pc_append "nameserver 127.0.0.1" /etc/resolv.conf

exit 0
fi
)
`

type Upstream struct {
Expand Down
Loading
Loading