add web-bitdeals

This commit is contained in:
2025-05-08 12:16:23 +03:00
parent 02e65bdc40
commit ebef104401
5 changed files with 16 additions and 22 deletions

View File

@@ -89,14 +89,8 @@ RUN su -l --shell /bin/bash $UNAME -c 'cd '$UHOME' ; \
cd $UHOME/apostol-dm/cmake-build-release ;\ cd $UHOME/apostol-dm/cmake-build-release ;\
make install make install
## Download "build" directory from web-build repository ## to get web-bitdeals /app directory
RUN su -l --shell /bin/bash $UNAME -c 'cd '$UHOME' ; \ FROM registry.bitdeals.org/web-bitdeals as web-bitdeals
mkdir web-build ;\
cd web-build ;\
git init ;\
git remote add -f origin https://git.bitdeals.org/private/web-build/ ;\
echo build >> .git/info/sparse-checkout ;\
git pull origin master'
FROM updated-debian FROM updated-debian
@@ -108,11 +102,11 @@ ENV UHOME=$UHOME
COPY --from=development /usr/local/ /usr/local/ COPY --from=development /usr/local/ /usr/local/
COPY --from=development /etc/dm/ /etc/dm/ COPY --from=development /etc/dm/ /etc/dm/
COPY --from=development /usr/sbin/dm /usr/sbin/dm COPY --from=development /usr/sbin/dm /usr/sbin/dm
COPY --from=development --chown=www-data:www-data $UHOME/web-build/build /var/www/web
COPY --from=development --chown=$UNAME:$UNAME $UHOME/apostol-dm/docker/bitdeals-testnet.asc /etc/dm/bitdeals-testnet.asc COPY --from=development --chown=$UNAME:$UNAME $UHOME/apostol-dm/docker/bitdeals-testnet.asc /etc/dm/bitdeals-testnet.asc
COPY --from=development --chown=$UNAME:$UNAME $UHOME/apostol-dm/docker/bitdeals.asc /etc/dm/bitdeals.asc COPY --from=development --chown=$UNAME:$UNAME $UHOME/apostol-dm/docker/bitdeals.asc /etc/dm/bitdeals.asc
COPY --from=development $UHOME/apostol-dm/docker/run.sh /run.sh COPY --from=development $UHOME/apostol-dm/docker/run.sh /run.sh
COPY --from=development $UHOME/apostol-dm/docker/dm /opt COPY --from=development $UHOME/apostol-dm/docker/dm /opt
COPY --from=web-bitdeals --chown=www-data:www-data /app /var/www/app
COPY ./docker/nginx.conf /etc/nginx/sites-enabled/default COPY ./docker/nginx.conf /etc/nginx/sites-enabled/default
## Generate bx testnet config ## Generate bx testnet config

View File

@@ -23,13 +23,12 @@ Here are some example snippets to help you get started creating a container at l
version: "3" version: "3"
services: services:
bitdeals-module: bitdeals-module:
image: bitdeals/apostol-dm image: registry.bitdeals.org/apostol-dm
environment: environment:
- DM_TESTNET=true - DM_TESTNET=true
- DM_BITCOIN=<address> - DM_BITCOIN=<address>
- DM_FEE=<0.1%> - DM_FEE=<0.1%>
- DM_FORWEB=http://127.0.0.1 - DM_FORWEB=http://127.0.0.1
- DM_WEBAUTH=false
- | - |
DM_PGP_SEC= DM_PGP_SEC=
-----BEGIN PGP PRIVATE KEY BLOCK----- -----BEGIN PGP PRIVATE KEY BLOCK-----
@@ -54,13 +53,11 @@ docker run -d \
-e DM_BITCOIN=<address> \ -e DM_BITCOIN=<address> \
-e DM_FEE=0.1% \ -e DM_FEE=0.1% \
-e DM_PGP_SEC="$(gpg2 --armor --export-secret-key Account_URL)" \ -e DM_PGP_SEC="$(gpg2 --armor --export-secret-key Account_URL)" \
-e DM_LC_ALL=ru_RU.UTF-8 \
-e DM_WEB_LANG=ru \
-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 \
-p 127.0.0.1:443:443 \ -p 127.0.0.1:443:443 \
-v /home/dm/:/home/dm/ \ -v /home/dm/:/home/dm/ \
bitdeals/apostol-dm registry.bitdeals.org/apostol-dm
``` ```
# Parameters # Parameters
@@ -82,6 +79,7 @@ Container images are configured using parameters passed at runtime.
|-e DM_PGP_SEC=|Variable with ASCII armored PGP user secret key. Will be created if empty (with Account_URL in the key details).| |-e DM_PGP_SEC=|Variable with ASCII armored PGP user secret key. Will be created if empty (with Account_URL in the key details).|
|-e DM_TESTNET=|Enable bitcoin testnet mode. Default: `false`| |-e DM_TESTNET=|Enable bitcoin testnet mode. Default: `false`|
|-e DM_TZ=|Set timezone for dm. Default: `Etc/UTC`| |-e DM_TZ=|Set timezone for dm. Default: `Etc/UTC`|
|-e DM_WEBAUTH=|Enable Web app authorization on bitdeals.org for account info access. Default: `false`| |-e DM_PRIVATEDASH=|Enable Web app authorization on bitdeals.org for account private dashboard access. Default: `false`|
|-e DM_WEB_LANG=|Set interface language for dm WebUI. Default: `en`| |-e DM_PRIVACY_MODE=|Block currency rates from coinbase.com. Default: `false`|
|-e DM_WEB_LANG=|Set interface language for dm WebUI: `ru` or `en`. Default: `en`|

View File

@@ -1,10 +1,9 @@
var appConfig = { var appConfig = {
defaultLanguage: "$DM_WEB_LANG", defaultLanguage: "$DM_WEB_LANG",
creditsText: "BitDeals © $YEAR.",
creditsShortText: "BitDeals", creditsShortText: "BitDeals",
confAuthorize: $DM_WEBAUTH, confAuthorize: $DM_PRIVATEDASH,
signIn: "/signin", signIn: "/signin",
signUp: "/signup", signUp: "/signup",
@@ -31,7 +30,7 @@ var appConfig = {
"https://matrix.bitdeals.org/#/room/#chan:matrix.bitdeals.org": "Users chat room", "https://matrix.bitdeals.org/#/room/#chan:matrix.bitdeals.org": "Users chat room",
}, },
confPrivateDash: true, confPrivateDash: $DM_PRIVATEDASH,
confDealModule: true, confDealModule: true,
confAdmin: true, confAdmin: true,
@@ -43,6 +42,8 @@ var appConfig = {
}, },
maxFileSize: 512000, maxFileSize: 512000,
PRIVACY_MODE: $DM_PRIVACY_MODE,
}; };
var appMessages = {}; var appMessages = {};

View File

@@ -9,7 +9,7 @@ server {
rewrite ^/private/$ /dm/ permanent; rewrite ^/private/$ /dm/ permanent;
location / { location / {
root /var/www/web; root /var/www/app;
index index.html; index index.html;
try_files $uri $uri/ /index.html; try_files $uri $uri/ /index.html;
} }

View File

@@ -38,7 +38,8 @@ init_config()
NPROC="$(nproc)" NPROC="$(nproc)"
export WORKERS="${WORKERS:-$NPROC}" export WORKERS="${WORKERS:-$NPROC}"
export PGP_SEC_FILE="$UHOME/pgp-key.sec" export PGP_SEC_FILE="$UHOME/pgp-key.sec"
export DM_WEBAUTH="${DM_WEBAUTH:-false}" export DM_PRIVATEDASH="${DM_PRIVATEDASH:-false}"
export DM_PRIVACY_MODE="${DM_PRIVACY_MODE:-false}"
if [ "$DM_TESTNET" = false ] if [ "$DM_TESTNET" = false ]
then then
@@ -79,7 +80,7 @@ init_config()
envsubst < /opt/oauth2/default.json > /etc/dm/oauth2/default.json envsubst < /opt/oauth2/default.json > /etc/dm/oauth2/default.json
envsubst < /opt/oauth2/service.json > /etc/dm/oauth2/service.json envsubst < /opt/oauth2/service.json > /etc/dm/oauth2/service.json
envsubst < /opt/sites/default.json > /etc/dm/sites/default.json envsubst < /opt/sites/default.json > /etc/dm/sites/default.json
envsubst < /opt/web-config.js > /var/www/web/config.js envsubst < /opt/config.js > /var/www/app/config.js
} }
generate_pgp_key() generate_pgp_key()