From 5d60e3c39f54f01b1bddb151e78b866ce7dff82c Mon Sep 17 00:00:00 2001 From: flameshikari Date: Mon, 19 Aug 2024 00:52:37 +0500 Subject: [PATCH] feat: populate lists at buildtime --- Dockerfile | 8 ++++++-- docker-compose.yml | 2 -- rootfs/init.sh | 4 ---- .../config/custom/{.keep => exclude-hosts-custom.txt} | 0 .../root/antizapret/config/custom/exclude-ips-custom.txt | 0 .../antizapret/config/custom/include-hosts-custom.txt | 0 .../root/antizapret/config/custom/include-ips-custom.txt | 0 7 files changed, 6 insertions(+), 8 deletions(-) rename rootfs/root/antizapret/config/custom/{.keep => exclude-hosts-custom.txt} (100%) create mode 100644 rootfs/root/antizapret/config/custom/exclude-ips-custom.txt create mode 100644 rootfs/root/antizapret/config/custom/include-hosts-custom.txt create mode 100644 rootfs/root/antizapret/config/custom/include-ips-custom.txt diff --git a/Dockerfile b/Dockerfile index 8dd6283..be5c07e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -50,8 +50,6 @@ RUN <<-"EOT" bash -ex mkdir easyrsa && curl -s -L $EASYRSA_URL | tar -zxv --strip-components=1 -C $_ EOT -COPY rootfs / - RUN <<-"EOT" bash -ex OPENVPN_VER=2.6.12 LIBS="libnl-genl-3-dev libssl-dev libcap-ng-dev liblz4-dev libsystemd-dev" @@ -86,6 +84,8 @@ RUN <<-"EOT" bash -ex EOT +COPY rootfs / + RUN <<-"EOF" bash -ex systemctl enable \ antizapret-update.service \ @@ -103,6 +103,10 @@ RUN <<-"EOF" bash -ex done for list in antizapret/config/*-custom.txt; do rm -f $list; done + ln -sf /root/antizapret/doall.sh /usr/bin/doall + + /root/antizapret/doall.sh + rm -frv /tmp/* EOF diff --git a/docker-compose.yml b/docker-compose.yml index 949356d..0a30ede 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -19,8 +19,6 @@ services: volumes: - /etc/localtime:/etc/localtime:ro - ./keys:/etc/openvpn - - ./temp:/root/antizapret/temp - - ./result:/root/antizapret/result - ./config:/root/antizapret/config/custom logging: driver: json-file diff --git a/rootfs/init.sh b/rootfs/init.sh index 4b2d2c4..316c1ad 100755 --- a/rootfs/init.sh +++ b/rootfs/init.sh @@ -28,10 +28,6 @@ DNS_RU=$(resolve $DNS_RU 77.88.8.8) EOF -# add a symlink for quick access -ln -sf /root/antizapret/doall.sh /usr/bin/doall - - # autoload vars when logging in into shell with 'bash -l' ln -sf /etc/default/antizapret /etc/profile.d/antizapret.sh diff --git a/rootfs/root/antizapret/config/custom/.keep b/rootfs/root/antizapret/config/custom/exclude-hosts-custom.txt similarity index 100% rename from rootfs/root/antizapret/config/custom/.keep rename to rootfs/root/antizapret/config/custom/exclude-hosts-custom.txt diff --git a/rootfs/root/antizapret/config/custom/exclude-ips-custom.txt b/rootfs/root/antizapret/config/custom/exclude-ips-custom.txt new file mode 100644 index 0000000..e69de29 diff --git a/rootfs/root/antizapret/config/custom/include-hosts-custom.txt b/rootfs/root/antizapret/config/custom/include-hosts-custom.txt new file mode 100644 index 0000000..e69de29 diff --git a/rootfs/root/antizapret/config/custom/include-ips-custom.txt b/rootfs/root/antizapret/config/custom/include-ips-custom.txt new file mode 100644 index 0000000..e69de29