Skip to content

Commit

Permalink
Generate address on first run
Browse files Browse the repository at this point in the history
  • Loading branch information
yshurik committed Nov 22, 2020
1 parent bab52fa commit 955561d
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ COPY --from=build1 /bin/notbit-sendmail /bin/notbit-sendmail
RUN ldd /bin/notbit

COPY entrypoint.sh /entrypoint.sh
COPY firstrun.sh /firstrun.sh

RUN mkdir /data
RUN mkdir /data/notbit
Expand Down
4 changes: 4 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
#!/bin/sh
#/etc/init.d/dovecot start
echo Starting dovecot
dovecot -c /etc/dovecot/dovecot.conf
echo Start first run check
su -l bm -c "sh /firstrun.sh &"
while :
do
echo Starting notbit
su -l bm -c "notbit -s 2525 -D /data/notbit -m /data/maildir -l /data/notbit.log"
sleep 15
#sh nohup.sh
Expand Down
17 changes: 17 additions & 0 deletions firstrun.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh
sleep 30
if [ ! -f /data/notbit/keys.dat ]
then
echo "Generating initial address"
export FIRSTADDR=$(notbit-keygen)
echo $FIRSTADDR

echo -e "From: $FIRSTADDR@bitmessage\\n"\
"To: $FIRSTADDR@bitmessage\\n"\
"Subject: Welcome to Bitmessage system\\n"\
"\\n"\
"Hello from Bitmessage\\n\\n"\
"Your personal address is $FIRSTADDR@bitmessage\\n\\n" | notbit-sendmail

fi

0 comments on commit 955561d

Please sign in to comment.