From 5819a30efc00cf7482c0a5bc800e418ac42677fb Mon Sep 17 00:00:00 2001 From: lza_menace Date: Thu, 4 May 2023 13:02:46 -0700 Subject: [PATCH] minor adjustments to improve dc ops --- README.md | 41 +++++++++++++++++++++++++++++++++++++++-- docker-compose.yaml | 14 ++++++++++++-- init_lws_admin.sh | 8 -------- lws-web/Dockerfile | 1 + lws-web/lws/config.py | 2 +- 5 files changed, 53 insertions(+), 13 deletions(-) delete mode 100755 init_lws_admin.sh diff --git a/README.md b/README.md index 20cca07..33a76a1 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,44 @@ Runs a private `monero-lws` service in the background with an API layer above th Will be adding client side application to tie the whole thing together. -## Links +## Setup + +Works on Linux, built on Ubuntu 22. + +1. Install packages +2. Clone the repo +3. Clone other projects +4. Build container images +5. Run containers +6. Initialize admin - note address and key + +``` +# 1 +sudo apt install docker.io docker-compose python3 python3-venv make + +# 2 +git clone https://git.cloud.lzahq.tech/nerodev/monero-lw && cd monero-lw + +# 3 +git clone --recursive --branch develop https://github.com/vtnerd/monero-lws +git clone https://github.com/lalanza808/docker-monero-node + +# 4 +docker-compose build + +# 5 +docker-compose up -d + +# 6 +docker exec -ti monero-lws monero-lws-admin create_admin +``` + +Proceed to setup your user at http://127.0.0.1:5000/setup - use the LWS admin address and key from `# 6`. + +Start adding wallets. + + +### Links * https://github.com/moneroexamples/openmonero * https://github.com/vtnerd/monero-lws/tree/feature/no_auth_admin @@ -18,7 +55,7 @@ Will be adding client side application to tie the whole thing together. * https://github.com/mymonero/mymonero-utils/tree/master/packages/mymonero-monero-client * https://github.com/mymonero/mymonero-utils/tree/master/packages/mymonero-wallet-manager -## Notes +### Notes ``` accept_requests: {"type": "import"|"create", "addresses":[...]} diff --git a/docker-compose.yaml b/docker-compose.yaml index dbfd669..63f8a00 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -7,6 +7,7 @@ x-log-config: &log-config max-file: "5" volumes: lws: + lws-web: services: lws-web: container_name: lws-web @@ -17,10 +18,16 @@ services: depends_on: - monero-lws environment: - LWS_URL: http://127.0.0.1:8080 - LWS_ADMIN_URL: http://127.0.0.1:8081 + LWS_URL: http://monero-lws:8080 + LWS_ADMIN_URL: http://monero-lws:8081 + QUART_ENV: production + HOST: 0.0.0.0 + DEBUG: 0 ports: - 127.0.0.1:5000:5000 + volumes: + - lws-web:/srv/lws-web + user: "1000:1000" command: ./.venv/bin/poetry run start <<: *log-config @@ -39,6 +46,9 @@ services: ports: - 127.0.0.1:8081:8081 - 127.0.0.1:8080:8080 + expose: + - 8080/tcp + - 8081/tcp volumes: - lws:/home/monero-lws/.bitmonero/light_wallet_server command: diff --git a/init_lws_admin.sh b/init_lws_admin.sh deleted file mode 100755 index 065d8c7..0000000 --- a/init_lws_admin.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -if [[ "$(docker-compose exec -ti monero-lws monero-lws-admin list_admin)" == '{}' ]]; -then - docker-compose exec -ti monero-lws monero-lws-admin create_admin; -else - docker-compose exec -ti monero-lws monero-lws-admin list_admin; -fi \ No newline at end of file diff --git a/lws-web/Dockerfile b/lws-web/Dockerfile index 188254d..02990eb 100644 --- a/lws-web/Dockerfile +++ b/lws-web/Dockerfile @@ -14,6 +14,7 @@ RUN adduser \ lws-web COPY . . RUN chown -R lws-web:lws-web . +USER lws-web RUN python3 -m venv .venv RUN .venv/bin/pip install poetry RUN .venv/bin/poetry install \ No newline at end of file diff --git a/lws-web/lws/config.py b/lws-web/lws/config.py index 1338562..a59ce9e 100644 --- a/lws-web/lws/config.py +++ b/lws-web/lws/config.py @@ -2,7 +2,7 @@ from os import environ as env from secrets import token_urlsafe from dotenv import load_dotenv -load_dotenv() +# load_dotenv() HOST = env.get("HOST", "127.0.0.1") TEMPLATES_AUTO_RELOAD = True