Dockerfile add jq

This commit is contained in:
2023-04-21 14:20:58 +05:00
parent 21d4e7a647
commit cd9bcb8c13
3 changed files with 10 additions and 8 deletions

View File

@@ -19,7 +19,7 @@ ARG DEBIAN_FRONTEND="noninteractive" \
DEBCONF_NOWARNINGS="yes" DEBCONF_NOWARNINGS="yes"
RUN apt-get update -y ; \ RUN apt-get update -y ; \
apt-get upgrade -y ; \ apt-get upgrade -y ; \
apt-get -y install --no-install-recommends locales ; \ apt-get -y install --no-install-recommends locales jq moreutils; \
apt-get -y install --no-install-recommends gpg gpg-agent ; \ apt-get -y install --no-install-recommends gpg gpg-agent ; \
apt-get -y install --no-install-recommends nginx ; \ apt-get -y install --no-install-recommends nginx ; \
apt-get -y install --no-install-recommends openssl ca-certificates ; \ apt-get -y install --no-install-recommends openssl ca-certificates ; \

View File

@@ -7,10 +7,12 @@ Deal Module (dm) - the Bitdeals daemon that provides a special interfaces for cr
# Running DM docker container # Running DM docker container
On first run the initialization script will create (if it is empty), a new bitcoin and PGP keys and start the daemon. On first run the initialization script will create, a new bitcoin and PGP keys and start the daemon.
Daemon settings may specified by an environment variables. PGP secret key is stored on a Docker volume. Daemon settings may specified by an environment variables. PGP secret key is stored on a Docker volume.
First run example: `docker run -i -t -e DM_TESTNET=1 -p 127.0.0.1:443:443 bitdeals/apostol-dm` - register new user, open WebUI port.
# Usage # Usage
Here are some example snippets to help you get started creating a container at localhost. Here are some example snippets to help you get started creating a container at localhost.

View File

@@ -53,11 +53,12 @@ fi
export LC_ALL="$DM_LC_ALL" export LC_ALL="$DM_LC_ALL"
## Add DM_FORWEB to dm oauth config ## Add DM_FORWEB to dm oauth config
if ! grep -q "$(basename $DM_FORWEB)" $WEB_CONF_SITES; then cat $WEB_CONF_OAUTH | \
sed -i "/\"hosts\":/ s|]|, \"$(basename $DM_FORWEB)\"]|" $WEB_CONF_SITES jq --arg host "$DM_FORWEB" '.web | .redirect_uris=[$host+"/oauth2/code",$host+"/oauth2/callback"]' | \
sed -i -e "/\"redirect_uris\":/ s|$|\n\t\"$DM_FORWEB/oauth2/callback\",|" \ sponge $WEB_CONF_OAUTH
-e "/\"redirect_uris\":/ s|$|\n\t\"$DM_FORWEB/oauth2/code\",|" $WEB_CONF_OAUTH cat $WEB_CONF_SITES | \
fi jq --arg host "$(basename $DM_FORWEB)" '.hosts = [$host]' | \
sponge $WEB_CONF_SITES
## Write the PGP keys locations to dm config ## Write the PGP keys locations to dm config
sed -i "/\[pgp\]/,/\[/ s%^private=.*%private=$PGP_SEC_FILE%" $CONF_FILES sed -i "/\[pgp\]/,/\[/ s%^private=.*%private=$PGP_SEC_FILE%" $CONF_FILES
@@ -175,7 +176,6 @@ then
tee -a $BITCOIN_KEYS_BACKUP <<-EOF tee -a $BITCOIN_KEYS_BACKUP <<-EOF
${B}Please backup this BITCOIN KEY:${N} ${B}Please backup this BITCOIN KEY:${N}
Private key (raw form): $PRIVKEY
Private key (WIF form): $PRIVKEYWIF Private key (WIF form): $PRIVKEYWIF
Public key: $PUBKEY Public key: $PUBKEY
Bitcoin address: $BITCOIN Bitcoin address: $BITCOIN