Skip to content

Commit

Permalink
Switched certs sync to use rsync to match file removals
Browse files Browse the repository at this point in the history
  • Loading branch information
acaranta committed Apr 22, 2021
1 parent a77dbf1 commit bae5fe5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ ENV DEBIAN_FRONTEND noninteractive
ENV INITRD No

RUN apt-get update -y
RUN apt-get install --force-yes -y haproxy inotify-tools python-pip curl lua-socket lua-json lua-http && \
pip install envtpl supervisor supervisor-logging
RUN apt-get install --force-yes -y haproxy inotify-tools python-pip curl lua-socket lua-json lua-http rsync
RUN pip install envtpl supervisor supervisor-logging

#Fetch and build haproxy from github, compile it with prometheus exporter
RUN cd /tmp && \
Expand Down
6 changes: 4 additions & 2 deletions inotifreload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,15 @@ while true; do
if [ -d /hacfg/certs ]; then
if [ ! -d /etc/haproxy/certs ]; then
mkdir /etc/haproxy/certs
cp -rf /hacfg/certs/* /etc/haproxy/certs/
rsync -ad /hacfg/certs /tmp --delete
#cp -rf /hacfg/certs/* /etc/haproxy/certs/
fi
diff /hacfg/certs /etc/haproxy/certs 2>&1 >/dev/null
if [ $? -gt 0 ]; then
echo "$(date) - Found changes in /hacfg/certs file..."
#if it changed, then copy it and reload properly haproxy
cp -rf /hacfg/certs/* /etc/haproxy/certs/
rsync -ad /hacfg/certs /tmp --delete
#cp -rf /hacfg/certs/* /etc/haproxy/certs/
RELOAD=1
fi

Expand Down

0 comments on commit bae5fe5

Please sign in to comment.