mirror of https://github.com/dnomd343/ClearDNS
dnomd343
4 years ago
commit
a893569eb3
9 changed files with 130 additions and 0 deletions
@ -0,0 +1,17 @@ |
|||||
|
FROM alpine as tools |
||||
|
COPY . /tmp/cleardns |
||||
|
RUN apk --update add --no-cache curl wget && \ |
||||
|
sh /tmp/cleardns/tools.sh |
||||
|
|
||||
|
FROM alpine |
||||
|
COPY . /tmp/cleardns |
||||
|
COPY --from=tools /tmp/tools/ /usr/bin/ |
||||
|
RUN mv /tmp/cleardns/overture/ /etc/ && \ |
||||
|
mv /tmp/cleardns/smartdns/ /etc/ && \ |
||||
|
mkdir -p /opt/AdGuardHome && \ |
||||
|
mkdir -p /etc/smartdns/expose && \ |
||||
|
mkdir /etc/cleardns && \ |
||||
|
mv /tmp/cleardns/init.sh / && \ |
||||
|
rm -rf /tmp/cleardns && \ |
||||
|
sed -i '$i\0\t0\t*\t*\t*\t/etc/overture/update.sh' /var/spool/cron/crontabs/root |
||||
|
CMD ["sh","/init.sh"] |
@ -0,0 +1,8 @@ |
|||||
|
[ ! -s "/etc/cleardns/custom.sh" ] && touch /etc/cleardns/custom.sh |
||||
|
sh /etc/cleardns/custom.sh |
||||
|
sh /etc/smartdns/load.sh |
||||
|
sh /etc/overture/update.sh |
||||
|
/usr/sbin/crond |
||||
|
smartdns -c /etc/smartdns/config.conf |
||||
|
overture -c /etc/overture/config.yml > /dev/null 2>&1 & |
||||
|
/usr/bin/AdGuardHome -w /opt/AdGuardHome |
@ -0,0 +1,35 @@ |
|||||
|
bindAddress: :5353 |
||||
|
primaryDNS: |
||||
|
- name: Domestic |
||||
|
address: 127.0.0.1:4053 |
||||
|
protocol: udp |
||||
|
socks5Address: |
||||
|
timeout: 6 |
||||
|
ednsClientSubnet: |
||||
|
policy: disable |
||||
|
externalIP: |
||||
|
noCookie: true |
||||
|
alternativeDNS: |
||||
|
- name: Foreign |
||||
|
address: 127.0.0.1:6053 |
||||
|
protocol: udp |
||||
|
socks5Address: |
||||
|
timeout: 8 |
||||
|
ednsClientSubnet: |
||||
|
policy: disable |
||||
|
externalIP: |
||||
|
noCookie: true |
||||
|
onlyPrimaryDNS: false |
||||
|
ipv6UseAlternativeDNS: false |
||||
|
alternativeDNSConcurrent: false |
||||
|
whenPrimaryDNSAnswerNoneUse: alternativeDNS |
||||
|
ipNetworkFile: |
||||
|
primary: /etc/overture/china_ip_list.txt |
||||
|
alternative: /etc/overture/loopback.txt |
||||
|
domainFile: |
||||
|
primary: /etc/overture/chinalist.txt |
||||
|
alternative: /etc/overture/gfwlist.txt |
||||
|
matcher: suffix-tree |
||||
|
hostsFile: |
||||
|
hostsFile: /etc/overture/hosts |
||||
|
finder: full-map |
@ -0,0 +1 @@ |
|||||
|
127.0.0.1 localhost |
@ -0,0 +1 @@ |
|||||
|
127.0.0.0/8 |
@ -0,0 +1,8 @@ |
|||||
|
rm -f /etc/overture/chinalist.txt |
||||
|
rm -f /etc/overture/gfwlist.txt |
||||
|
rm -f /etc/overture/china_ip_list.txt |
||||
|
wget -P /etc/overture https://res.343.re/Share/chinalist/chinalist.txt |
||||
|
wget -P /etc/overture https://res.343.re/Share/gfwlist/gfwlist.txt |
||||
|
wget -P /etc/overture https://raw.fastgit.org/17mon/china_ip_list/master/china_ip_list.txt |
||||
|
ps -ef | grep overture | grep -v grep | awk '{print $1}' | xargs kill -9 |
||||
|
overture -c /etc/overture/config.yml > /dev/null 2>&1 & |
@ -0,0 +1,8 @@ |
|||||
|
bind :4053 |
||||
|
bind-tcp :4053 |
||||
|
bind :6053 -group foreign |
||||
|
bind-tcp :6053 -group foreign |
||||
|
log-level info |
||||
|
cache-size 65535 |
||||
|
log-size 32MB |
||||
|
log-file /etc/smartdns/expose/smartdns.log |
@ -0,0 +1,26 @@ |
|||||
|
load_domestic(){ |
||||
|
cat>/etc/smartdns/expose/domestic.conf<<EOF |
||||
|
server 223.5.5.5 |
||||
|
server 223.6.6.6 |
||||
|
server 119.29.29.29 |
||||
|
server 119.28.28.28 |
||||
|
server 180.76.76.76 |
||||
|
server 114.114.114.114 |
||||
|
server 114.114.115.115 |
||||
|
EOF |
||||
|
} |
||||
|
|
||||
|
load_foreign(){ |
||||
|
cat>/etc/smartdns/expose/foreign.conf<<EOF |
||||
|
server 8.8.8.8 |
||||
|
EOF |
||||
|
} |
||||
|
|
||||
|
mkdir -p /etc/smartdns/expose/ |
||||
|
[ ! -s "/etc/smartdns/expose/domestic.conf" ] && load_domestic |
||||
|
[ ! -s "/etc/smartdns/expose/foreign.conf" ] && load_foreign |
||||
|
cat /etc/smartdns/expose/domestic.conf >> /etc/smartdns/config.conf |
||||
|
while read -r raw |
||||
|
do |
||||
|
echo "$raw -group foreign -exclude-default-group" >> /etc/smartdns/config.conf |
||||
|
done < /etc/smartdns/expose/foreign.conf |
@ -0,0 +1,26 @@ |
|||||
|
get_github_latest_version() { |
||||
|
VERSION=$(curl --silent "https://api.github.com/repos/$1/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/'); |
||||
|
} |
||||
|
|
||||
|
TARGET_DIR="/tmp/tools" |
||||
|
mkdir -p $TARGET_DIR |
||||
|
|
||||
|
get_github_latest_version "AdguardTeam/AdGuardHome" |
||||
|
wget -P /tmp/tools "https://hub.fastgit.org/AdguardTeam/AdGuardHome/releases/download/$VERSION/AdGuardHome_linux_arm64.tar.gz" |
||||
|
get_github_latest_version "shawn1m/overture" |
||||
|
wget -P /tmp/tools "https://hub.fastgit.org/shawn1m/overture/releases/download/$VERSION/overture-linux-arm64.zip" |
||||
|
get_github_latest_version "pymumu/smartdns" |
||||
|
wget -P /tmp/tools "https://hub.fastgit.org/pymumu/smartdns/releases/download/$VERSION/smartdns-aarch64" |
||||
|
|
||||
|
mkdir $TARGET_DIR/AdGuard |
||||
|
tar xf $TARGET_DIR/AdGuardHome_linux_arm64.tar.gz -C $TARGET_DIR/AdGuard |
||||
|
unzip $TARGET_DIR/overture-linux-arm64.zip -d $TARGET_DIR/overture |
||||
|
mv $TARGET_DIR/AdGuard/AdGuardHome/AdGuardHome $TARGET_DIR/AdGuardHome |
||||
|
mv $TARGET_DIR/overture/overture-linux-arm64 $TARGET_DIR/overture-linux-arm64 |
||||
|
rm -rf $TARGET_DIR/AdGuard |
||||
|
rm -rf $TARGET_DIR/overture |
||||
|
mv $TARGET_DIR/overture-linux-arm64 $TARGET_DIR/overture |
||||
|
mv $TARGET_DIR/smartdns-aarch64 $TARGET_DIR/smartdns |
||||
|
chmod +x $TARGET_DIR/smartdns |
||||
|
rm -f $TARGET_DIR/AdGuardHome_linux_arm64.tar.gz |
||||
|
rm -f $TARGET_DIR/overture-linux-arm64.zip |
Loading…
Reference in new issue