diff options
Diffstat (limited to 'nlnet/task1')
-rw-r--r-- | nlnet/task1/Dockerfile | 32 | ||||
-rwxr-xr-x | nlnet/task1/start.sh | 15 |
2 files changed, 47 insertions, 0 deletions
diff --git a/nlnet/task1/Dockerfile b/nlnet/task1/Dockerfile new file mode 100644 index 0000000..498d54a --- /dev/null +++ b/nlnet/task1/Dockerfile @@ -0,0 +1,32 @@ +FROM debian:stable + +RUN apt-get update +RUN apt-get install -y openjdk-17-jre git python3-pip curl jq sqlite3 +RUN pip3 install click requests + +# Installation +RUN git clone git://git.taler.net/libeufin +WORKDIR /libeufin +RUN git fetch && git checkout 9c7079e5323eed4d16e24c1c4245d6586cecac53 # amounts zero-check fixed. +RUN ./bootstrap +RUN ./configure --prefix=/usr/local +RUN make install + +# Reverse proxy +RUN apt-get install -y nginx + +# Importing the UI. +RUN git clone -b prebuilt git://git.taler.net/wallet-core +RUN git -C wallet-core checkout 75af013b348b08b8fb9e65cc9270f2fde964979b # checkout rates fixed. +RUN cp /libeufin/debian/etc/nginx/sites-available/libeufin-sandbox /etc/nginx/sites-enabled/ +RUN mkdir -p /usr/share/libeufin/demobank-ui/ +RUN mkdir -p /etc/libeufin/ +RUN cp /libeufin/debian/usr/share/libeufin/demobank-ui/demobank-ui-settings.js /etc/libeufin/ +RUN cp wallet-core/demobank/* /usr/share/libeufin/demobank-ui/ + +# Default place for the database. +RUN mkdir /libeufin-data + +COPY start.sh / +# ENTRYPOINT /start.sh +CMD /start.sh diff --git a/nlnet/task1/start.sh b/nlnet/task1/start.sh new file mode 100755 index 0000000..18bf9b8 --- /dev/null +++ b/nlnet/task1/start.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +set -eu + +export LIBEUFIN_SANDBOX_ADMIN_PASSWORD=${LIBEUFIN_SANDBOX_ADMIN_PASSWORD:-admin} +export LIBEUFIN_SANDBOX_DB_CONNECTION="jdbc:sqlite:/libeufin-data/libeufin.sqlite" +libeufin-sandbox config --without-registrations --currency ${CURRENCY:-EUR} default +if test -z $LIBEUFIN_EXPOSED_PORT; then + echo ERROR: LIBEUFIN_EXPOSED_PORT is an empty string. + exit 1 +fi + +sed -i "s/localhost/localhost:$LIBEUFIN_EXPOSED_PORT/" /etc/libeufin/demobank-ui-settings.js +service nginx start +libeufin-sandbox serve --port 5016 --no-localhost-only |