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/lalanza808/docker-monero-node
git clone https://github.com/CryptoGrampy/mymonero-web-js git clone https://github.com/CryptoGrampy/mymonero-web-js
build:
docker-compose build
release: release:
docker-compose -f dev.compose.yaml build docker-compose -f dev.compose.yaml build
docker tag monero-lw_mymonero-web lalanza808/mymonero-web:latest docker tag monero-lw_mymonero-web lalanza808/mymonero-web:latest
@ -13,4 +10,22 @@ release:
docker tag monero-lw_lwsadmin lalanza808/lwsadmin:latest docker tag monero-lw_lwsadmin lalanza808/lwsadmin:latest
docker push lalanza808/mymonero-web docker push lalanza808/mymonero-web
docker push lalanza808/lws docker push lalanza808/lws
docker push lalanza808/lwsadmin 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: lwsadmin:
mymonero: mymonero:
services: services:
lwsadmin: # lwsadmin:
container_name: lwsadmin # container_name: lwsadmin
build: # build:
context: lwsadmin # context: lwsadmin
dockerfile: Dockerfile # dockerfile: Dockerfile
restart: unless-stopped # restart: unless-stopped
depends_on: # depends_on:
- monero-lws # - monero-lws
environment: # environment:
LWS_URL: http://monero-lws:8080 # LWS_URL: http://monero-lws:8080
LWS_ADMIN_URL: http://monero-lws:8081 # LWS_ADMIN_URL: http://monero-lws:8081
QUART_ENV: production # QUART_ENV: production
HOST: 0.0.0.0 # HOST: 0.0.0.0
DEBUG: 0 # DEBUG: 0
ports: # ports:
- 127.0.0.1:5000:5000 # - 127.0.0.1:5000:5000
volumes: # volumes:
- lwsadmin:/srv/lwsadmin # - lwsadmin:/srv/lwsadmin
user: "1000:1000" # user: "1000:1000"
command: # command:
./.venv/bin/poetry run start # ./.venv/bin/poetry run start
<<: *log-config # <<: *log-config
mymonero-web: # mymonero-web:
container_name: mymonero-web # container_name: mymonero-web
build: # build:
context: mymonero-web-js # context: mymonero-web-js
dockerfile: Dockerfile # dockerfile: Dockerfile
restart: unless-stopped # restart: unless-stopped
environment: # environment:
MYMONERO_WEB_NETTYPE: 0 # MYMONERO_WEB_NETTYPE: 0
MYMONERO_WEB_SERVER_URL: localhost:8080 # MYMONERO_WEB_SERVER_URL: localhost:8080
MYMONERO_WEB_APP_NAME: MyMonero-SelfHosted # MYMONERO_WEB_APP_NAME: MyMonero-SelfHosted
depends_on: # depends_on:
- monero-lws # - monero-lws
expose: # expose:
- 80/tcp # - 80/tcp
ports: # ports:
- 127.0.0.1:8000:80 # - 127.0.0.1:8000:80
volumes: # volumes:
- mymonero:/app # - mymonero:/app
<<: *log-config # <<: *log-config
monero-lws: monero-lws:
container_name: monero-lws container_name: monero-lws
build: 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_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") 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 = Blueprint("meta", "meta")
@bp.route("/") @bp.route("/")
@login_required
async def index(): async def index():
admin = User.select().first() admin = User.select().first()
if not admin:
await flash("must setup admin first")
return redirect("/setup")
lws.init(admin.view_key) lws.init(admin.view_key)
accounts = lws.list_accounts() accounts = lws.list_accounts()
if 'hidden' in accounts: if 'hidden' in accounts:

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

@ -30,10 +30,18 @@
<a href="/wallet/{{ account['address'] }}/disable" class="">disable</a> <a href="/wallet/{{ account['address'] }}/disable" class="">disable</a>
{% else %} {% else %}
<a href="/wallet/{{ account['address'] }}/enable" class="">enable</a> <a href="/wallet/{{ account['address'] }}/enable" class="">enable</a>
{% endif %} {% endif %}
</td> </td>
<td>{{ account['address'] | shorten }}</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> </tr>
{% endfor %} {% endfor %}
{% endfor %} {% endfor %}

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

@ -17,13 +17,12 @@ services:
depends_on: depends_on:
- monero-lws - monero-lws
environment: environment:
LWS_URL: http://monero-lws:8080 LWS_URL: http://127.0.0.1:8080
LWS_ADMIN_URL: http://monero-lws:8081 LWS_ADMIN_URL: http://127.0.0.1:8081
QUART_ENV: production QUART_ENV: production
HOST: 0.0.0.0 HOST: 127.0.0.1
DEBUG: 0 DEBUG: 0
ports: network_mode: host
- 127.0.0.1:5000:5000
volumes: volumes:
- lwsadmin:/srv/lwsadmin - lwsadmin:/srv/lwsadmin
user: "1000:1000" user: "1000:1000"
@ -52,5 +51,5 @@ services:
volumes: volumes:
- lws:/home/monero-lws/.bitmonero/light_wallet_server - lws:/home/monero-lws/.bitmonero/light_wallet_server
command: 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 <<: *log-config
Loading…
Cancel
Save