diff --git a/frontend/src/basic/NavBar/NavBar.tsx b/frontend/src/basic/NavBar/NavBar.tsx index 8eed0c29..9ba781d4 100644 --- a/frontend/src/basic/NavBar/NavBar.tsx +++ b/frontend/src/basic/NavBar/NavBar.tsx @@ -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); } diff --git a/frontend/src/components/PaymentMethods/Icons/index.tsx b/frontend/src/components/PaymentMethods/Icons/index.tsx index 99afac52..103ddc4b 100644 --- a/frontend/src/components/PaymentMethods/Icons/index.tsx +++ b/frontend/src/components/PaymentMethods/Icons/index.tsx @@ -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/pwGDrdBNGInSX1x8Zb8wgTuG8GOpIKb3ZfLTEeUrPilRO75pyB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EW79tbDO+Qscm2QVGnp/bOsxUhPg8vAVu6WbgK+uYKiz5d9LXwVYgsAE6Pt0R2rKRiNKs57b41GF/n/xcWzQvjG/mIu31fdtv4nazGj9F5TznjU4+Qch+7QAB347nvH82hffXJL5mwZBLdRwmO+P9iPCFB1s7M83Suwl+k0kCl2FprzS/carq2h8UseWPXnauHd8LS0vonxajtm7DwBAAA', }, rakuten: { title: 'rakuten', diff --git a/frontend/src/contexts/AppContext.ts b/frontend/src/contexts/AppContext.ts index 26797527..9cddc0c5 100644 --- a/frontend/src/contexts/AppContext.ts +++ b/frontend/src/contexts/AppContext.ts @@ -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(undefined); const [badOrder, setBadOrder] = useState(undefined); - const [page, setPage] = useState(entryPage == '' ? 'robot' : entryPage); + const [page, setPage] = useState( + entryPage == '' || entryPage == 'index.html' ? 'robot' : entryPage, + ); const [slideDirection, setSlideDirection] = useState({ in: undefined, out: undefined, diff --git a/nodeapp/Dockerfile b/nodeapp/Dockerfile index defc6b9e..df1b15f9 100644 --- a/nodeapp/Dockerfile +++ b/nodeapp/Dockerfile @@ -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"] \ No newline at end of file +CMD ["sh", "robosats-client.sh"] \ No newline at end of file diff --git a/nodeapp/README.md b/nodeapp/README.md index 68a1cca4..bde66f8c 100644 --- a/nodeapp/README.md +++ b/nodeapp/README.md @@ -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. \ No newline at end of file +1. Increase availability by processing API requests via I2P when TOR is not available. \ No newline at end of file diff --git a/nodeapp/basic.html b/nodeapp/basic.html new file mode 100644 index 00000000..df5b4786 --- /dev/null +++ b/nodeapp/basic.html @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + RoboSats - Simple and Private Bitcoin Exchange + + + + + + + +
+
+
+
+
+
+
+
    +
  • +
    Looking for robot parts ...
    +
  • +
  • +
    Adding layers to the onion ...
    +
  • +
  • +
    Winning at game theory ...
    +
  • +
  • +
    Moving Sats at light speed ...
    +
  • +
  • +
    Hiding in 2^256 bits of entropy...
    +
  • +
+
+
+
+
+
+ + + \ No newline at end of file diff --git a/nodeapp/docker-compose-dev.yml b/nodeapp/docker-compose-dev.yml index 700d7bfa..7e84a6b6 100644 --- a/nodeapp/docker-compose-dev.yml +++ b/nodeapp/docker-compose-dev.yml @@ -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: diff --git a/nodeapp/docker-compose.yml b/nodeapp/docker-compose.yml index 339dae1a..56e017df 100644 --- a/nodeapp/docker-compose.yml +++ b/nodeapp/docker-compose.yml @@ -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 diff --git a/nodeapp/nginx.conf b/nodeapp/nginx.conf new file mode 100644 index 00000000..957f2db7 --- /dev/null +++ b/nodeapp/nginx.conf @@ -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"; + } + + } +} \ No newline at end of file diff --git a/nodeapp/nginx/local.conf b/nodeapp/nginx/local.conf deleted file mode 100644 index 47882866..00000000 --- a/nodeapp/nginx/local.conf +++ /dev/null @@ -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"; - } -} \ No newline at end of file diff --git a/nodeapp/pro.html b/nodeapp/pro.html new file mode 100644 index 00000000..b8629fd1 --- /dev/null +++ b/nodeapp/pro.html @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + RoboSats PRO - Simple and Private Bitcoin Exchange + + + + + + + + + +
+
+
+
+
+
+
+
    +
  • +
    Looking for robot parts ...
    +
  • +
  • +
    Adding layers to the onion ...
    +
  • +
  • +
    Winning at game theory ...
    +
  • +
  • +
    Moving Sats at light speed ...
    +
  • +
  • +
    Hiding in 2^256 bits of entropy...
    +
  • +
+
+
+
+
+
+ + + \ No newline at end of file diff --git a/nodeapp/robosats-client.sh b/nodeapp/robosats-client.sh index 0b9e76f5..d61f2d75 100644 --- a/nodeapp/robosats-client.sh +++ b/nodeapp/robosats-client.sh @@ -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;" \ No newline at end of file +$experimental_socat & nginx -g "daemon off;" \ No newline at end of file