Commit 0c30cf25 authored by Romain Maliach-Auguste's avatar Romain Maliach-Auguste 🌵
Browse files

Default empty APIKEY.txt, init will fait for it

parent 94330f9b
......@@ -7,4 +7,5 @@ COPY ./delete_after_delay.pl ./delete_after_delay ./cpanfile.snapshot ./cpanfile
WORKDIR /opt/delete_after_delay
RUN carton install
COPY ./docker/init /
RUN touch /APIKEY.txt
CMD /init
#!/bin/bash
if [ ! -f "/APIKEY.txt" ] ; then >&2 echo "/APIKEY.txt must contain the etherpad instance's API key. Copy (or mount) it. It is generated by etherpad-lite at startup and placed in its root (usually /opt/etherpad-lite/APIKEY.txt). Aborting."; exit 1; fi
export CF=/etc/delete_after_delay.yml
let retries=5
while [ $retries -gt 0 ] && [ -v "/APIKEY.txt" ] ; do >&2 echo "/APIKEY.txt must contain the etherpad instance's API key. Copy (or mount) it. It is generated by etherpad-lite at startup and placed in its root (usually /opt/etherpad-lite/APIKEY.txt). We'll trying again $retries more times, after having slept 10 seconds."; sleep 10; let retries--; done
if [ $retries == 0 ] ; then >&2 echo "Failed to find /APIKEY.txt, aborting."; exit 1; fi
CF=/etc/delete_after_delay.yml
echo 'instanceD:' > $CF
echo " key: $(cat /APIKEY.txt)" >> $CF
echo " dir: $DIR" >> $CF
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment