mirror of
https://github.com/lancachenet/monolithic
synced 2024-11-22 03:53:06 +00:00
Merge pull request #101 from lancachenet/Offline-dns-fix
Fixed offline startup
This commit is contained in:
commit
71ad35816c
2 changed files with 12 additions and 2 deletions
|
@ -21,6 +21,7 @@ RUN mkdir -m 755 -p /data/cachedomains ;\
|
||||||
apt-get update ;\
|
apt-get update ;\
|
||||||
apt-get install -y jq git ;
|
apt-get install -y jq git ;
|
||||||
|
|
||||||
|
RUN git clone --depth=1 --no-single-branch https://github.com/uklans/cache-domains/ /data/cache-domains
|
||||||
|
|
||||||
VOLUME ["/data/logs", "/data/cache", "/data/cachedomains", "/var/www"]
|
VOLUME ["/data/logs", "/data/cache", "/data/cachedomains", "/var/www"]
|
||||||
|
|
||||||
|
|
|
@ -2,16 +2,25 @@
|
||||||
|
|
||||||
IFS=' '
|
IFS=' '
|
||||||
mkdir -p /data/cachedomains
|
mkdir -p /data/cachedomains
|
||||||
cd /data/cachedomains
|
echo "Bootstrapping Monolithic from ${CACHE_DOMAINS_REPO}"
|
||||||
|
|
||||||
export GIT_SSH_COMMAND="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
|
export GIT_SSH_COMMAND="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
|
||||||
|
pushd /data/cachedomains > /dev/null
|
||||||
if [[ ! -d .git ]]; then
|
if [[ ! -d .git ]]; then
|
||||||
git clone ${CACHE_DOMAINS_REPO} .
|
git clone ${CACHE_DOMAINS_REPO} .
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "${NOFETCH:-false}" != "true" ]]; then
|
if [[ "${NOFETCH:-false}" != "true" ]]; then
|
||||||
git fetch origin
|
# Disable error checking whilst we attempt to get latest
|
||||||
|
set +e
|
||||||
|
git remote set-url origin ${CACHE_DOMAINS_REPO}
|
||||||
|
git fetch origin || echo "Failed to update from remote, using local copy of cache_domains"
|
||||||
git reset --hard origin/${CACHE_DOMAINS_BRANCH}
|
git reset --hard origin/${CACHE_DOMAINS_BRANCH}
|
||||||
|
# Reenable error checking
|
||||||
|
set -e
|
||||||
fi
|
fi
|
||||||
|
popd > /dev/null
|
||||||
|
|
||||||
TEMP_PATH=$(mktemp -d)
|
TEMP_PATH=$(mktemp -d)
|
||||||
OUTPUTFILE=${TEMP_PATH}/outfile.conf
|
OUTPUTFILE=${TEMP_PATH}/outfile.conf
|
||||||
echo "map \"\$http_user_agent£££\$http_host\" \$cacheidentifier {" >> $OUTPUTFILE
|
echo "map \"\$http_user_agent£££\$http_host\" \$cacheidentifier {" >> $OUTPUTFILE
|
||||||
|
|
Loading…
Reference in a new issue