Add resolved service and DNS server
This commit is contained in:
15
release/config/sing-box-split-dns.xml
Normal file
15
release/config/sing-box-split-dns.xml
Normal file
@@ -0,0 +1,15 @@
|
||||
<!DOCTYPE busconfig PUBLIC
|
||||
"-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
|
||||
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
|
||||
<busconfig>
|
||||
<policy user="root">
|
||||
<allow own="org.freedesktop.resolve1"/>
|
||||
<allow send_destination="org.freedesktop.resolve1"/>
|
||||
<allow receive_sender="org.freedesktop.resolve1"/>
|
||||
</policy>
|
||||
<policy user="sing-box">
|
||||
<allow own="org.freedesktop.resolve1"/>
|
||||
<allow send_destination="org.freedesktop.resolve1"/>
|
||||
<allow receive_sender="org.freedesktop.resolve1"/>
|
||||
</policy>
|
||||
</busconfig>
|
||||
8
release/config/sing-box.rules
Normal file
8
release/config/sing-box.rules
Normal file
@@ -0,0 +1,8 @@
|
||||
polkit.addRule(function(action, subject) {
|
||||
if ((action.id == "org.freedesktop.resolve1.set-domains" ||
|
||||
action.id == "org.freedesktop.resolve1.set-default-route" ||
|
||||
action.id == "org.freedesktop.resolve1.set-dns-servers") &&
|
||||
subject.user == "sing-box") {
|
||||
return polkit.Result.YES;
|
||||
}
|
||||
});
|
||||
@@ -4,6 +4,8 @@ Documentation=https://sing-box.sagernet.org
|
||||
After=network.target nss-lookup.target network-online.target
|
||||
|
||||
[Service]
|
||||
User=sing-box
|
||||
StateDirectory=sing-box
|
||||
CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_RAW CAP_NET_BIND_SERVICE CAP_SYS_PTRACE CAP_DAC_READ_SEARCH
|
||||
AmbientCapabilities=CAP_NET_ADMIN CAP_NET_RAW CAP_NET_BIND_SERVICE CAP_SYS_PTRACE CAP_DAC_READ_SEARCH
|
||||
ExecStart=/usr/bin/sing-box -D /var/lib/sing-box -C /etc/sing-box run
|
||||
|
||||
1
release/config/sing-box.sysusers
Normal file
1
release/config/sing-box.sysusers
Normal file
@@ -0,0 +1 @@
|
||||
u sing-box - "sing-box Service"
|
||||
@@ -4,6 +4,8 @@ Documentation=https://sing-box.sagernet.org
|
||||
After=network.target nss-lookup.target network-online.target
|
||||
|
||||
[Service]
|
||||
User=sing-box
|
||||
StateDirectory=sing-box-%i
|
||||
CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_RAW CAP_NET_BIND_SERVICE CAP_SYS_PTRACE CAP_DAC_READ_SEARCH
|
||||
AmbientCapabilities=CAP_NET_ADMIN CAP_NET_RAW CAP_NET_BIND_SERVICE CAP_SYS_PTRACE CAP_DAC_READ_SEARCH
|
||||
ExecStart=/usr/bin/sing-box -D /var/lib/sing-box-%i -c /etc/sing-box/%i.json run
|
||||
|
||||
Reference in New Issue
Block a user