Skip to content

Commit

Permalink
feat(init): append chnlist to chinadns-ng
Browse files Browse the repository at this point in the history
Closes: #77
  • Loading branch information
1715173329 authored Feb 20, 2024
1 parent 5a535f1 commit f387ede
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions root/etc/homeproxy/scripts/update_resources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ case "$1" in
;;
"china_list")
check_list_update "$1" "Loyalsoldier/v2ray-rules-dat" "release" "direct-list.txt"
sed -i -e "s/full://g" -e "/:/d" "$RESOURCES_DIR/china_list.txt"
;;
*)
echo -e "Usage: $0 <china_ip4 / china_ip6 / gfw_list / china_list>"
Expand Down
4 changes: 3 additions & 1 deletion root/etc/init.d/homeproxy
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ start_service() {
fi
;;
"proxy_mainland_china")
sed -r -e "s/full://g" -e "/:/d" -e "s/(.*)/server=\/\1\/127.0.0.1#$dns_port/g" \
sed -r -e "s/(.*)/server=\/\1\/127.0.0.1#$dns_port/g" \
"$HP_DIR/resources/china_list.txt" > "$DNSMASQ_DIR/china_list.conf"
;;
"custom"|"global")
Expand Down Expand Up @@ -192,11 +192,13 @@ start_service() {
procd_append_param command --trust-dns "127.0.0.1#$dns_port"
procd_append_param command --ipset-name4 "inet@fw4@homeproxy_mainland_addr_v4"
procd_append_param command --ipset-name6 "inet@fw4@homeproxy_mainland_addr_v6"
procd_append_param command --chnlist-file "$HP_DIR/resources/china_list.txt"
procd_append_param command --gfwlist-file "$HP_DIR/resources/gfw_list.txt"
[ "$ipv6_support" -eq "1" ] || procd_append_param command --no-ipv6=tC

if [ -x "/sbin/ujail" ]; then
procd_add_jail "chinadns-ng" log
procd_add_jail_mount "$HP_DIR/resources/china_list.txt"
procd_add_jail_mount "$HP_DIR/resources/gfw_list.txt"
procd_set_param capabilities "/etc/capabilities/homeproxy.json"
procd_set_param no_new_privs 1
Expand Down

0 comments on commit f387ede

Please sign in to comment.