fix 'listen' address in Docker entrypoint

This commit is contained in:
2023-01-13 18:39:43 +03:00
parent fc404d4790
commit 8e1e3c6808
2 changed files with 21 additions and 11 deletions

View File

@@ -37,7 +37,7 @@ services:
-----END PGP PRIVATE KEY BLOCK----- -----END PGP PRIVATE KEY BLOCK-----
volumes: volumes:
- bitdeals-conf:/etc/dm - dm:/etc/dm
ports: ports:
- 4999:4999 - 4999:4999
- 80:80 - 80:80
@@ -56,7 +56,7 @@ docker run -d \
-e DM_LC_ALL=en_US.UTF-8 \ -e DM_LC_ALL=en_US.UTF-8 \
-p 127.0.0.1:4999:4999 \ -p 127.0.0.1:4999:4999 \
-p 127.0.0.1:80:80 \ -p 127.0.0.1:80:80 \
-v ./bitdeals-conf/:/etc/dm \ -v ./dm/:/etc/dm \
bitdeals/apostol-dm bitdeals/apostol-dm
``` ```
@@ -75,4 +75,5 @@ Container images are configured using parameters passed at runtime.
|-e DM_PGP_PASSWORD=|User PGP key password.| |-e DM_PGP_PASSWORD=|User PGP key password.|
|-e DM_WEBAUTH=|Enable web user interface authentication.| |-e DM_WEBAUTH=|Enable web user interface authentication.|
|-e DM_LC_ALL=|Set Deal Module locale.| |-e DM_LC_ALL=|Set Deal Module locale.|
|-e DM_ACCOUNT_URL=|Set Account_URL for a new account non-interactive registration. Format: http[s]://<host>[:<port>]|

View File

@@ -28,7 +28,7 @@ sed -i -e "/\[main\]/,/\[/ s/.*user=.*/user=$UNAME/" \
-e "/\[server\]/,/\[/ s/.*port=.*/port=4999/" $DM_CONF_FILES -e "/\[server\]/,/\[/ s/.*port=.*/port=4999/" $DM_CONF_FILES
## Change dm Website config ## Change dm Website config
sed -i 's/dmHost:.*/dmHost: "http:\/\/127.0.0.1:4999",/' $DM_WEB_CONF_FILE sed -i 's/dmHost:.*/dmHost: "http:\/\/0.0.0.0:4999",/' $DM_WEB_CONF_FILE
if [ "$DM_WEBAUTH" = 1 -o "$DM_WEBAUTH" = true ]; then if [ "$DM_WEBAUTH" = 1 -o "$DM_WEBAUTH" = true ]; then
sed -i 's/confAuthorize:.*/confAuthorize: true,/' $DM_WEB_CONF_FILE sed -i 's/confAuthorize:.*/confAuthorize: true,/' $DM_WEB_CONF_FILE
@@ -101,10 +101,13 @@ then
Name-Comment: ${DM_ACCOUNT_URL:-https://example-$RANDOM$RANDOM.com} Name-Comment: ${DM_ACCOUNT_URL:-https://example-$RANDOM$RANDOM.com}
Expire-Date: 0 Expire-Date: 0
EOF EOF
echo
tput setaf 2 tput setaf 2
gpg -k --keyid-format long 2>/dev/null | tail -n5 cat <<-EOF
gpg --armor --export-secret-keys --passphrase "$DM_PGP_PASSWORD" | tee "$PGP_SEC_FILE"
$(gpg -k --keyid-format long 2>/dev/null | tail -n5)
$(gpg --armor --export-secret-keys --passphrase "$DM_PGP_PASSWORD" | tee "$PGP_SEC_FILE")
EOF
tput sgr0 tput sgr0
gpgconf --kill all gpgconf --kill all
else else
@@ -152,11 +155,17 @@ then
sed -i "/\[module\]/,/\[/ s/^address=.*/address=$BITCOIN/" $DM_CONF_FILES sed -i "/\[module\]/,/\[/ s/^address=.*/address=$BITCOIN/" $DM_CONF_FILES
## Show bitcoin key ## Show bitcoin key
echo -e "\nPlease backup this\tBITCOIN KEY:" cat <<-EOF
echo -e "Private key (raw form):\t$PRIVKEY"
echo -e "Private key (WIF form):\t${B}$PRIVKEYWIF${N}" Please backup this BITCOIN KEY:"
echo -e "Public key:\t$PUBKEY" Private key (raw form): $PRIVKEY"
echo -e "Bitcoin address:\t$BITCOIN\n" Private key (WIF form): ${B}$PRIVKEYWIF${N}"
Public key: $PUBKEY"
Bitcoin address: $BITCOIN\n"
EOF
else
echo -e "NOTE: Your Bitcoin address: $_DM_BITCOIN"
fi fi
## Run the daemon ## Run the daemon