mirror of
https://github.com/casjaysdevdocker/ifconfig
synced 2025-06-27 09:48:59 -04:00
🗃️ Committing everything that changed 🗃️
Some checks failed
release-tag / release-image (push) Failing after 1m43s
Some checks failed
release-tag / release-image (push) Failing after 1m43s
Dockerfile rootfs/opt/echoip/html/index.html rootfs/usr/local/etc/docker/bin/echoip-cli rootfs/usr/local/etc/docker/init.d/zz-echoip.sh
This commit is contained in:
parent
748e52ad9b
commit
cb8b97ae4d
@ -138,6 +138,10 @@ RUN echo "Updating system files "; \
|
||||
|
||||
RUN echo "Custom Settings"; \
|
||||
$SHELL_OPTS; \
|
||||
wget "https://github.com/P3TERX/GeoLite.mmdb/raw/download/GeoLite2-ASN.mmdb" -O "/tmp/GeoLite2-ASN.mmdb" || rm -Rf "/tmp/GeoLite2-ASN.mmdb" \
|
||||
wget "https://github.com/P3TERX/GeoLite.mmdb/raw/download/GeoLite2-City.mmdb" -O "/tmp/GeoLite2-City.mmdb" || rm -Rf "/tmp/GeoLite2-City.mmdb" \
|
||||
wget "https://github.com/P3TERX/GeoLite.mmdb/raw/download/GeoLite2-Country.mmdb" -O "/tmp/GeoLite2-Country.mmdb" || rm -Rf "/tmp/GeoLite2-Country.mmdb" \
|
||||
for mmdb in GeoLite2-ASN.mmdb GeoLite2-City.mmdb GeoLite2-Country.mmdb; do [ -f "/tmp/$mmdb" ] && mv -f "/tmp/$mmdb" "/opt/echoip/geoip/$mmdb"; done \
|
||||
echo ""
|
||||
|
||||
RUN echo "Setting up users and scripts "; \
|
||||
|
@ -343,10 +343,10 @@
|
||||
</p>
|
||||
<br /><br /><br />
|
||||
<h5 class="center">
|
||||
hosted on REPLACE_HOST_NAME<br />
|
||||
hosted on: REPLACE_HOST_NAME<br />
|
||||
Server IPV4: REPLACE_CURRENT_IP_4<br />
|
||||
Server IPV6: REPLACE_CURRENT_IP_6<br />
|
||||
Last updated on REPLACE_MODIFIED
|
||||
Server IPV6: REPLACE_CURRENT_IP_6<br /><br />
|
||||
Last updated on: REPLACE_MODIFIED<br />
|
||||
</h5>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,4 +1,11 @@
|
||||
#!/usr/bin/env sh
|
||||
[ -n "$SERVICE_PORT" ] || SERVICE_PORT="80"
|
||||
[ -n "$WORK_DIR" ] || WORK_DIR="/opt/echoip"
|
||||
/opt/echoip/echoip -r -s -p -l :$SERVICE_PORT -H X-Real-IP -H x-forwarded-for -t $WORK_DIR/html -a $WORK_DIR/geoip/GeoLite2-ASN.mmdb -c $WORK_DIR/geoip/GeoLite2-City.mmdb -f $WORK_DIR/geoip/GeoLite2-Country.mmdb
|
||||
[ -n "$WORK_DIR" ] && [ -d "$WORK_DIR" ] || WORK_DIR="/opt/echoip"
|
||||
/opt/echoip/echoip -r -s -p \
|
||||
-l :$SERVICE_PORT \
|
||||
-H X-Real-IP \
|
||||
-H x-forwarded-for \
|
||||
-t $WORK_DIR/html \
|
||||
-a $WORK_DIR/geoip/GeoLite2-ASN.mmdb \
|
||||
-c $WORK_DIR/geoip/GeoLite2-City.mmdb \
|
||||
-f $WORK_DIR/geoip/GeoLite2-Country.mmdb
|
||||
|
@ -201,15 +201,15 @@ __update_conf_files() {
|
||||
[ -d "/data/echoip" ] && cp -Rf "/data/echoip/." "/opt/echoip/"
|
||||
sed -i "s|REPLACE_HOST_NAME|$sysname|g" /opt/echoip/html/index.html
|
||||
sed -i "s|REPLACE_MODIFIED|$(date +'%Y-%m-%d at %H:%M')|g" /opt/echoip/html/index.html
|
||||
if [ -n "$host_ip_4" ]; then
|
||||
sed -i "s|REPLACE_CURRENT_IP_4|$host_ip_4|g" /opt/echoip/html/index.html
|
||||
else
|
||||
if [ -z "$host_ip_4" ]; then
|
||||
sed -i '/REPLACE_CURRENT_IP_4/d' /opt/echoip/html/index.html
|
||||
fi
|
||||
if [ -n "$host_ip_6" ]; then
|
||||
sed -i "s|REPLACE_CURRENT_IP_6|$host_ip_6|g" /opt/echoip/html/index.html
|
||||
else
|
||||
sed -i "s|REPLACE_CURRENT_IP_4|$host_ip_4|g" /opt/echoip/html/index.html
|
||||
fi
|
||||
if [ -z "$host_ip_6" ]; then
|
||||
sed -i '/REPLACE_CURRENT_IP_6/d' /opt/echoip/html/index.html
|
||||
else
|
||||
sed -i "s|REPLACE_CURRENT_IP_6|$host_ip_6|g" /opt/echoip/html/index.html
|
||||
fi
|
||||
return $exitCode
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user