add rescanning

master
lza_menace 2 years ago
parent fef75d3b4e
commit 6e0f915dd1

@ -3,9 +3,6 @@ init:
git clone https://github.com/lalanza808/docker-monero-node
git clone https://github.com/CryptoGrampy/mymonero-web-js
build:
docker-compose build
release:
docker-compose -f dev.compose.yaml build
docker tag monero-lw_mymonero-web lalanza808/mymonero-web:latest
@ -14,3 +11,21 @@ release:
docker push lalanza808/mymonero-web
docker push lalanza808/lws
docker push lalanza808/lwsadmin
prod-up:
docker-compose -f prod.compose.yaml up -d
prod-down:
docker-compose -f prod.compose.yaml down --remove-orphans
prod-logs:
docker-compose -f prod.compose.yaml logs -f
dev-up:
docker-compose -f dev.compose.yaml up -d
dev-down:
docker-compose -f dev.compose.yaml down --remove-orphans
dev-logs:
docker-compose -f dev.compose.yaml logs -f

@ -1,29 +0,0 @@
FROM node:16-alpine as build
ENV NETTYPE 0
ENV SERVER_URL http://localhost
ENV APP_NAME MyMonero-Self-Hosted
WORKDIR /srv/mymonero
COPY mymonero-web-js .
RUN adduser \
-S \
-s /bin/ash \
-g 'mymonero' \
-D \
-h /srv/mymonero \
mymonero
RUN chown -R mymonero .
USER mymonero
RUN npm install
RUN npm run build
COPY mymonero-entrypoint.sh .
RUN chmod +x entrypoint.sh
RUN rm .env.defaults
EXPOSE 9110
CMD ["./entrypoint.sh"]

@ -10,47 +10,47 @@ volumes:
lwsadmin:
mymonero:
services:
lwsadmin:
container_name: lwsadmin
build:
context: lwsadmin
dockerfile: Dockerfile
restart: unless-stopped
depends_on:
- monero-lws
environment:
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:
- lwsadmin:/srv/lwsadmin
user: "1000:1000"
command:
./.venv/bin/poetry run start
<<: *log-config
mymonero-web:
container_name: mymonero-web
build:
context: mymonero-web-js
dockerfile: Dockerfile
restart: unless-stopped
environment:
MYMONERO_WEB_NETTYPE: 0
MYMONERO_WEB_SERVER_URL: localhost:8080
MYMONERO_WEB_APP_NAME: MyMonero-SelfHosted
depends_on:
- monero-lws
expose:
- 80/tcp
ports:
- 127.0.0.1:8000:80
volumes:
- mymonero:/app
<<: *log-config
# lwsadmin:
# container_name: lwsadmin
# build:
# context: lwsadmin
# dockerfile: Dockerfile
# restart: unless-stopped
# depends_on:
# - monero-lws
# environment:
# 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:
# - lwsadmin:/srv/lwsadmin
# user: "1000:1000"
# command:
# ./.venv/bin/poetry run start
# <<: *log-config
# mymonero-web:
# container_name: mymonero-web
# build:
# context: mymonero-web-js
# dockerfile: Dockerfile
# restart: unless-stopped
# environment:
# MYMONERO_WEB_NETTYPE: 0
# MYMONERO_WEB_SERVER_URL: localhost:8080
# MYMONERO_WEB_APP_NAME: MyMonero-SelfHosted
# depends_on:
# - monero-lws
# expose:
# - 80/tcp
# ports:
# - 127.0.0.1:8000:80
# volumes:
# - mymonero:/app
# <<: *log-config
monero-lws:
container_name: monero-lws
build:

@ -17,3 +17,4 @@ QUART_AUTH_DURATION = int(env.get('QUART_AUTH_DURATION', 60 * 60)) # 1 hour
LWS_URL = env.get("LWS_URL", "http://127.0.0.1:8080")
LWS_ADMIN_URL = env.get("LWS_ADMIN_URL", "http://127.0.0.1:8081")
#

@ -10,11 +10,9 @@ from lws import config
bp = Blueprint("meta", "meta")
@bp.route("/")
@login_required
async def index():
admin = User.select().first()
if not admin:
await flash("must setup admin first")
return redirect("/setup")
lws.init(admin.view_key)
accounts = lws.list_accounts()
if 'hidden' in accounts:

@ -39,27 +39,19 @@ async def add():
return await render_template("wallet/add.html")
# @bp.route("/wallet/<id>")
# @login_required
# async def show(id):
# wallet = Wallet.select().where(Wallet.id == id).first()
# if not wallet:
# await flash("wallet does not exist")
# return redirect("/")
# return await render_template(
# "wallet/show.html",
# wallet=wallet
# )
# @bp.route("/wallet/<id>/rescan")
# @login_required
# async def rescan(id):
# wallet = Wallet.select().where(Wallet.id == id).first()
# if not wallet:
# await flash("wallet does not exist")
# return redirect("/")
# wallet.rescan()
# return redirect(f"/wallet/{id}")
@bp.route("/wallet/rescan")
@login_required
async def rescan():
address = request.args.get('address')
height = request.args.get('height')
if not address or not height:
await flash("you need to provide both address and height")
return redirect("/")
if lws.rescan(address, int(height)):
await flash(f"rescanning {address} from block {height}")
else:
await flash("probz")
return redirect(f"/")
@bp.route("/wallet/<address>/disable")

@ -33,7 +33,15 @@
{% endif %}
</td>
<td>{{ account['address'] | shorten }}</td>
<td>{{ account['scan_height'] }}</td>
<td>
<form method="get" action="{{ url_for('wallet.rescan') }}">
{{ account['scan_height'] }}
<input type="integer" name="height" style="width: 5em; display: inline;" />
<input type="hidden" name="address" value="{{ account['address'] }}" />
<button type="submit">Rescan</button>
</form>
</td>
</tr>
{% endfor %}
{% endfor %}

@ -1,5 +0,0 @@
#!/bin/sh
env > .env.defaults
node server.js

@ -17,13 +17,12 @@ services:
depends_on:
- monero-lws
environment:
LWS_URL: http://monero-lws:8080
LWS_ADMIN_URL: http://monero-lws:8081
LWS_URL: http://127.0.0.1:8080
LWS_ADMIN_URL: http://127.0.0.1:8081
QUART_ENV: production
HOST: 0.0.0.0
HOST: 127.0.0.1
DEBUG: 0
ports:
- 127.0.0.1:5000:5000
network_mode: host
volumes:
- lwsadmin:/srv/lwsadmin
user: "1000:1000"
@ -52,5 +51,5 @@ services:
volumes:
- lws:/home/monero-lws/.bitmonero/light_wallet_server
command:
--scan-threads 4 --rest-threads 4 --rest-server http://127.0.0.1:8080/lws --admin-rest-server http://127.0.0.1:8081 --log-level 1 --daemon=tcp://127.0.0.1:18082 --sub=tcp://127.0.0.1:18083 --access-control-origin "${DOMAIN}"
--scan-threads 4 --rest-threads 2 --rest-server http://127.0.0.1:8080/lws --admin-rest-server http://127.0.0.1:8081 --log-level 0 --daemon=tcp://127.0.0.1:18082 --sub=tcp://127.0.0.1:18085 --access-control-origin "${DOMAIN}"
<<: *log-config
Loading…
Cancel
Save