Merge pull request #13 from sbts/1.5_don't_write_to_server_dir

drop need to write config file to /srv/ledgersmb
This commit is contained in:
Erik Huelsmann 2017-07-09 08:39:58 +02:00 committed by GitHub
commit 9499b6ffc1
2 changed files with 15 additions and 11 deletions

View File

@ -81,8 +81,5 @@ RUN mkdir -p /tmp && \
# Internal Port Expose
EXPOSE 5762
# If ledgersmb.conf does not exist, www-data user needs to be able to create it.
RUN chown www-data /srv/ledgersmb
USER www-data
CMD ["start.sh"]

View File

@ -4,14 +4,20 @@ update_ssmtp.sh
cd /srv/ledgersmb
if [[ ! -f ledgersmb.conf ]]; then
cp conf/ledgersmb.conf.default ledgersmb.conf
sed -i \
-e "s/\(cache_templates = \).*\$/cache_templates = 1/g" \
-e "s/\(host = \).*\$/\1$POSTGRES_HOST/g" \
-e "s/\(port = \).*\$/\1$POSTGRES_PORT/g" \
-e "s/\(default_db = \).*\$/\1$DEFAULT_DB/g" \
-e "s%\(sendmail = \).*%\1/usr/sbin/ssmtp%g" \
/srv/ledgersmb/ledgersmb.conf
cat <<EOF >/tmp/ledgersmb.conf
[main]
cache_templates = 1
[database]
host = $POSTGRES_HOST
port = $POSTGRES_PORT
default_db = $DEFAULT_DB
[mail]
sendmail = /usr/sbin/ssmtp
EOF
export LSMB_CONFIG_FILE='/tmp/ledgersmb.conf'
fi
if [ ! -f "/tmp/ledgersmb" ]; then
@ -26,6 +32,7 @@ fi
# Needed for modules loaded by cpanm
export PERL5LIB
for PerlLib in /usr/lib/perl5* /usr/local/lib/perl5*/site_perl/* ; do
[[ -d "$PerlLib" ]] && {
PERL5LIB="$PerlLib";