Simplify and optimize nodeapp (#565)

* Simplify and optimize nodeapp

* Add pro frontend
This commit is contained in:
Reckless_Satoshi 2023-05-11 16:22:01 +00:00 committed by GitHub
parent ba529349b3
commit 2092a33f88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 221 additions and 68 deletions

View File

@ -56,6 +56,10 @@ const NavBar = ({ width, height }: NavBarProps): JSX.Element => {
useEffect(() => {
// change tab (page) into the current route
const pathPage: Page = location.pathname.split('/')[1];
if (pathPage == 'index.html') {
navigate('/robot');
setPage('robot');
}
if (pathPage) {
setPage(pathPage);
}

View File

@ -308,8 +308,9 @@ const icons = {
'data:image/webp;base64,UklGRkADAABXRUJQVlA4IDQDAADQEQCdASpQAFAAPo08mEelI6KhL1K+IKARiWoAzq2W3Z5yfgOTo6XjCOzH6f856l9sR5jf2I9a70c7yb6ADK9BgdjsYEq+GkeTTJiuBT6z1thVjZjfpxyMEcE0ziWqVC1tLYc3+CKS/qEBYHsPU78qRxX1J+9GGNIb9i3BBpHRx4X9znhy+dEuT60ktFe5Lkpqa7c8qA4AAP779gj/zMwfpgfiDEegKmPgpD/X4/N/q0Fz/5MlD10n/hUhWSDzfO+kQ/57LFLU4gcwO3+9CUejN6iaD5qGfgEx/cRChuP3iKS2kLC8wUXpefZWN9P3Q+nc3Ki3XyIwlSFzU/QOK9IrZLO17t16TKjrFaUKhRQ71HdfyVpxXzq3szOpWKFnDh/xffDsIXr76jvXDTPR1cuPNOlb/hA4oMeEYHmhCR89oBZAvINxyBu9GJoXbqIngaB5kDK6fF5gueRmPC+2ro/xzTtAQ1QgwS1Er+fU2fuASnRgRa6QNptR921XQSH1wGqXO4RLPDijeUH9pY0knOV8op9Pn7nh4tTYz/pwGDrdBNGInSX1x8Zb8wgTuG8GOpIKb3ZfLTEeUrPilRO75pyBWRx1x5r1nxsqp2jlt7laLu5lAcYH6/29n2aX+dJMhIP5yIqco5hcPAwqYVtwBbE4D9sdTtu6Mx0PVt530cHvfnFYkM0A9D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fdtv4nazGj9F5TznjU4+Qch+7QAB347nvH82hffXJL5mwZBLdRwmO+P9iPCFB1s7M83Suwl+k0kCl2FprzS/carq2h8UseWPXnauHd8LS0vonxajtm7DwBAAA',
},
rakuten: {
title: 'rakuten',

View File

@ -71,7 +71,7 @@ export interface fetchRobotProps {
export type TorStatus = 'NOTINIT' | 'STARTING' | '"Done"' | 'DONE';
const entryPage: Page | '' =
let entryPage: Page | '' | 'index.html' =
window.NativeRobosats === undefined ? window.location.pathname.split('/')[1] : '';
export const closeAll = {
@ -146,7 +146,9 @@ export const useAppStore = () => {
const [order, setOrder] = useState<Order | undefined>(undefined);
const [badOrder, setBadOrder] = useState<string | undefined>(undefined);
const [page, setPage] = useState<Page>(entryPage == '' ? 'robot' : entryPage);
const [page, setPage] = useState<Page>(
entryPage == '' || entryPage == 'index.html' ? 'robot' : entryPage,
);
const [slideDirection, setSlideDirection] = useState<SlideDirection>({
in: undefined,
out: undefined,

View File

@ -1,17 +1,16 @@
FROM node:18-bullseye-slim
FROM alpine:3.18.0
RUN mkdir -p /usr/src/robosats
WORKDIR /usr/src/robosats
COPY . .
COPY ./nginx/local.conf /etc/nginx/conf.d/local.conf
RUN touch ./selfhosted
COPY ./nginx.conf /etc/nginx/nginx.conf
RUN apt-get update
RUN apt-get install -y socat nginx curl
RUN npm install http-server
RUN apk -U --no-cache upgrade \
&& apk --no-cache add socat \
&& apk --no-cache add nginx
EXPOSE 12596
HEALTHCHECK CMD curl --fail http://localhost:12596/selfhosted || exit 1
CMD ["bash", "robosats-client.sh"]
CMD ["sh", "robosats-client.sh"]

View File

@ -1,12 +1,12 @@
# RoboSats client app for sovereign nodes
RoboSats app for soverign nodes ( Umbrel, Citadel, Start9 ...). This app serves the RoboSats frontend app directly from your own node and redirects all API requests to RoboSats P2P market coordinator through your node's TOR proxy.
RoboSats app for sovereign nodes ( Umbrel, Citadel, Start9 ...). This app serves the RoboSats frontend app directly from your own node and redirects all API requests to RoboSats P2P market coordinator through your node's TOR proxy.
At the moment it has no special integration with your local lightning wallet (e.g. LND). This can be achieved easily by installing a WebLN compatible extension in your browser (e.g. getAlby).
# How it works
The container launches two processes: 1) A `socat` that will expose RoboSats coordinator API over HTTP on localhost:81 using the docker orchestration TOR socks proxy and 2) a `http-server` that serves all static files (including the Javascript client app) directly from your own node (should reduce loading times by a lot). Every request that cannot be served by your node http-server will be forwarded to the RoboSats coordinator (that is: API calls and Robot avatar images). Nginx is used to bypass `http-server` for websockets directly into the `socat` bridge as `http-server` does not support websockets connections.
The container launches two processes: 1) A set of `socat` that will expose RoboSats coordinators API over HTTP on localhost:81 using the docker orchestration TOR socks proxy and 2) Nginx, used to direct every request where needed and serve the client app locally.
# Why host your own RoboSats client
@ -18,4 +18,4 @@ Advantages over a full over-the-internet RoboSats experience:
# Future upgrades
1. Increase availability by procesing API requests via I2P when TOR is not available.
1. Increase availability by processing API requests via I2P when TOR is not available.

59
nodeapp/basic.html Normal file
View File

@ -0,0 +1,59 @@
<!DOCTYPE html>
<html>
<head>
<link rel="shortcut icon" href="/static/assets/images/favicon-96x96.png" />
<link rel="icon" type="image/png" href="/static/assets/images/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="/static/assets/images/favicon-96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="/static/assets/images/favicon-192x192.png" sizes="192x192">
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="A simple and private way to exchange bitcoin for national currencies. Robosats simplifies the peer-to-peer user experience and uses lightning hold invoices to minimize custody and trust requirements. No user registration required.">
<title>RoboSats - Simple and Private Bitcoin Exchange</title>
<link rel="stylesheet" href="/static/css/fonts.css"/>
<link rel="stylesheet" type="text/css" href="/static/css/loader.css"/>
<link rel="stylesheet" type="text/css" href="/static/css/index.css"/>
</head>
<body>
<noscript>
<div>
This site requires JavaScript. This message is only visible if you have it disabled. <br/><br/>
If you are using TOR browser set the "Security Level" to "Standard". If you keep seeing this message clear cache and storage of TOR browser app and retry.<br/><br/>
If the problem persists, ask for support in the RoboSats telegram group<a href="https://t.me/robosats"> (t.me/robosats)</a>
</div>
</noscript>
<div id="main">
<div id="app">
<div class="loaderCenter">
<div class="loaderSpinner"></div>
<div class="content-slider">
<div class="slider">
<div class="mask">
<ul>
<li class="anim1">
<div class="quote">Looking for robot parts ...</div>
</li>
<li class="anim2">
<div class="quote">Adding layers to the onion ...</div>
</li>
<li class="anim3">
<div class="quote">Winning at game theory ...</div>
</li>
<li class="anim4">
<div class="quote">Moving Sats at light speed ...</div>
</li>
<li class="anim5">
<div class="quote">Hiding in 2^256 bits of entropy...</div>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<script src="/static/frontend/main.js"></script>
</body>
</html>

View File

@ -16,9 +16,10 @@ services:
environment:
TOR_PROXY_IP: 127.0.0.1
TOR_PROXY_PORT: 9050
ROBOSATS_ONION: robosats6tkf3eva7x2voqso3a5wcorsnw34jveyxfqi2fu7oyheasid.onion
network_mode: service:tor
volumes:
- ./:/usr/src/robosats/
- ./nginx.conf:/etc/nginx/nginx.conf
- ../frontend/static:/usr/src/robosats/static
tor:

View File

@ -9,7 +9,6 @@ services:
environment:
TOR_PROXY_IP: 127.0.0.1
TOR_PROXY_PORT: 9050
ROBOSATS_ONION: robosats6tkf3eva7x2voqso3a5wcorsnw34jveyxfqi2fu7oyheasid.onion
network_mode: service:tor
tor:
build: ../docker/tor

69
nodeapp/nginx.conf Normal file
View File

@ -0,0 +1,69 @@
worker_processes auto;
events {
worker_connections 1024;
}
http {
# Every robosat coordinators socat tor bridge is an upstream.
# So far only the experimental coordinator is available.
upstream experimental_coordinator {
server localhost:81;
}
server {
listen 12596;
server_name robosats_client;
include /etc/nginx/mime.types;
location / {
root /usr/src/robosats;
try_files $uri $uri/ /basic.html;
}
location /pro/ {
root /usr/src/robosats;
try_files $uri $uri/ /pro.html;
}
location /static/ {
alias /usr/src/robosats/static/;
autoindex on;
}
# we pass avatars, websockets and api to the coordinator(s) socat bridges
location /static/assets/avatars/ {
proxy_pass http://experimental_coordinator;
}
location /api/ {
proxy_pass http://experimental_coordinator;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
}
location /ws/ {
proxy_pass http://experimental_coordinator;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
}
location = /favicon.ico {
alias /usr/src/robosats/static/assets/images/favicon-96x96.png;
}
# do not log healtchecks made against "/selfhosted"
location /selfhosted {
access_log off;
return 200 "OK";
}
}
}

View File

@ -1,44 +0,0 @@
# first we declare our upstream server, which is our http-server application
upstream robosats_http_server {
server localhost:9000;
}
upstream robosats_websocket {
server localhost:81;
}
# now we declare our main server
server {
listen 12596;
server_name robosats_client;
location / {
# requests are passed to npm Http-Server
proxy_pass http://robosats_http_server;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_redirect off;
}
# websockets are passed to socat bridge
location /ws/ {
proxy_pass http://robosats_websocket;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
}
location = /favicon.ico {
alias /usr/src/robosats/static/assets/images/favicon-96x96.png;
}
# do not log healtchecks made against "/selfhosted"
location /selfhosted {
access_log off;
return 200 "OK";
}
}

61
nodeapp/pro.html Normal file
View File

@ -0,0 +1,61 @@
<!DOCTYPE html>
<html>
<head>
<link rel="shortcut icon" href="/static/assets/images/favicon-96x96.png" />
<link rel="icon" type="image/png" href="/static/assets/images/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="/static/assets/images/favicon-96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="/static/assets/images/favicon-192x192.png" sizes="192x192">
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="A simple and private way to exchange bitcoin for national currencies. Robosats simplifies the peer-to-peer user experience and uses lightning hold invoices to minimize custody and trust requirements. No user registration required.">
<title>RoboSats PRO - Simple and Private Bitcoin Exchange</title>
<link rel="stylesheet" href="/static/css_pro/fonts.css"/>
<link rel="stylesheet" type="text/css" href="/static/css/loader.css"/>
<link rel="stylesheet" type="text/css" href="/static/css/index.css"/>
<link rel="stylesheet" type="text/css" href="/css_pro/react-grid-layout.css"/>
<link rel="stylesheet" type="text/css" href="/css_pro/react-resizable.css"/>
</head>
<body>
<noscript>
<div>
This site requires JavaScript. This message is only visible if you have it disabled. <br/><br/>
If you are using TOR browser set the "Security Level" to "Standard". If you keep seeing this message clear cache and storage of TOR browser app and retry.<br/><br/>
If the problem persists, ask for support in the RoboSats telegram group<a href="https://t.me/robosats"> (t.me/robosats)</a>
</div>
</noscript>
<div id="main">
<div id="app">
<div class="loaderCenter">
<div class="loaderSpinner"></div>
<div class="content-slider">
<div class="slider">
<div class="mask">
<ul>
<li class="anim1">
<div class="quote">Looking for robot parts ...</div>
</li>
<li class="anim2">
<div class="quote">Adding layers to the onion ...</div>
</li>
<li class="anim3">
<div class="quote">Winning at game theory ...</div>
</li>
<li class="anim4">
<div class="quote">Moving Sats at light speed ...</div>
</li>
<li class="anim5">
<div class="quote">Hiding in 2^256 bits of entropy...</div>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<script src="/static/frontend/pro.js"></script>
</body>
</html>

View File

@ -1,11 +1,13 @@
#!/bin/bash
#!/bin/sh
# Runs three simple services on a single container (why? simpler deployment)
# 1) http-server: serves client app and static files within the image. Sends API requests to socat bridge.
# 2) socat: exposes remote RoboSats backend from TOR socks to http//localhost:81.
# 3) nginx: is just a hack to bypass http-server directly to socat for websocket connections (http-server does not support WS)
# Runs two simple services on a single container.
# 1) socat: exposes remote RoboSats backend from TOR socks to http//localhost:81.
# Every robosat coordinators needs a tor bridge
# 2) nginx: does the magic of redirecting every request to either local (the app, static,
# languages) or remote (for each coordinator, either API or WS, and static avatar)
client_server="npm exec http-server -- . -p 9000 -P http://127.0.0.1:81 -i false -d false"
backend_tor_bridge="socat tcp4-LISTEN:81,reuseaddr,fork,keepalive,bind=127.0.0.1 SOCKS4A:${TOR_PROXY_IP:-127.0.0.1}:${ROBOSATS_ONION:-robosats6tkf3eva7x2voqso3a5wcorsnw34jveyxfqi2fu7oyheasid.onion}:80,socksport=${TOR_PROXY_PORT:-9050}"
# Every robosat coordinators needs a tor bridge. So far only experimental coordinator available.
experimental_onion=robosats6tkf3eva7x2voqso3a5wcorsnw34jveyxfqi2fu7oyheasid.onion
experimental_socat="socat tcp4-LISTEN:81,reuseaddr,fork,keepalive,bind=127.0.0.1 SOCKS4A:${TOR_PROXY_IP:-127.0.0.1}:${experimental_onion}:80,socksport=${TOR_PROXY_PORT:-9050}"
$client_server & $backend_tor_bridge & nginx -g "daemon off;"
$experimental_socat & nginx -g "daemon off;"