diff --git a/.gitignore b/.gitignore index 25c2fc6..1e402ed 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -compose/env \ No newline at end of file +/compose/env +/web/tor \ No newline at end of file diff --git a/compose/env-sample/lndtn/robosats.env b/compose/env-sample/lndtn/robosats.env index 03c0ece..da9517a 100644 --- a/compose/env-sample/lndtn/robosats.env +++ b/compose/env-sample/lndtn/robosats.env @@ -106,9 +106,11 @@ DEVFUND = 0.2 # Coordinator activity limits MAX_PUBLIC_ORDERS = 100 -# Trade limits in satoshis -MIN_TRADE = 20000 -MAX_TRADE = 5000000 +# Coordinator Order size limits in Satoshi +# Minimum order size (must be bigger than DB constrain in /robosats/settings.py MIN_TRADE, currently 20_000 Sats) +MIN_ORDER_SIZE = 20000 +# Minimum order size (must be smaller than DB constrain in /robosats/settings.py MAX_TRADE, currently 5_000_000 Sats) +MAX_ORDER_SIZE = 500000 # For CLTV_expiry calculation # Assume 8 min/block assumed diff --git a/web/.gitignore b/web/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/web/custom_nginx.conf b/web/custom_nginx.conf new file mode 100644 index 0000000..6aa227d --- /dev/null +++ b/web/custom_nginx.conf @@ -0,0 +1,60 @@ +daemon off; + +user nginx; +worker_processes auto; + +error_log /var/log/nginx/error.log notice; +pid /var/run/nginx.pid; + +events { + worker_connections 1024; +} + +http { + + include /etc/nginx/mime.types; + default_type application/octet-stream; + large_client_header_buffers 4 64K; + + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; + + access_log /dev/stdout main; + error_log /dev/stderr warn; + + sendfile on; + keepalive_timeout 65; + + server { + + listen 80; + server_name robosats_web_client; + + # Add your custom verify files by editing location and alias + location /clearnetonion_verify { + alias /serve_misc/; + } + + location / { + root /usr/src/robosats; + try_files $uri $uri/ /basic.html; + index basic.html; + } + + location /pro { + root /usr/src/robosats; + try_files $uri $uri/ /pro.html; + index pro.html; + } + + location /static/ { + alias /usr/src/robosats/static/; + autoindex on; + } + + location = /favicon.ico { + alias /usr/src/robosats/static/assets/images/favicon-96x96.png; + } + } +} \ No newline at end of file diff --git a/web/docker-compose.yml b/web/docker-compose.yml new file mode 100644 index 0000000..048c7e5 --- /dev/null +++ b/web/docker-compose.yml @@ -0,0 +1,23 @@ +version: '3.9' +services: + robosats: + build: . + image: recksato/robosats-web:latest + container_name: robosats + restart: always + network_mode: service:tor + volumes: + - ./serve_misc:/serve_misc/ + - ./custom_nginx.conf:/etc/nginx/nginx.conf + tor: + build: ../compose/tor + container_name: tor + restart: always + environment: + LOCAL_USER_ID: 1000 + LOCAL_GROUP_ID: 1000 + ports: + - 80:80 + volumes: + - ./tor:/var/lib/tor + - ./torrc:/etc/tor/torrc \ No newline at end of file diff --git a/web/readme.md b/web/readme.md new file mode 100644 index 0000000..c5258a4 --- /dev/null +++ b/web/readme.md @@ -0,0 +1,7 @@ +# Host a RoboSat web client + +This docker app is intended for hosting a web client for public use. Example the docker nginx server bundled with all static is built in https://github.com/RoboSats/robosats/tree/main/web + +Works similarly to `/nodeapp`, but simpler. It does not use the selfhosted flags nor torify connections to coordinators. The browser itself must support Tor. + +Drop your service vanity key into a new folder named `tor`, make sure the folder is named `roboweb` or edit the `torrc` accordingly. \ No newline at end of file diff --git a/web/serve_misc/readme.md b/web/serve_misc/readme.md new file mode 100644 index 0000000..db003d9 --- /dev/null +++ b/web/serve_misc/readme.md @@ -0,0 +1 @@ +If you set up a clearnetonion.eu.org clearnet tunnel, you can drop in this folder you clearnetonion_verify_*.txt file. \ No newline at end of file diff --git a/web/torrc b/web/torrc new file mode 100644 index 0000000..27d80d2 --- /dev/null +++ b/web/torrc @@ -0,0 +1,17 @@ +Log notice file /var/log/tor/notices.log + +## The directory for keeping all the keys/etc. By default, we store +## things in $HOME/.tor on Unix, and in Application Data\tor on Windows. +DataDirectory /var/lib/tor +DataDirectoryGroupReadable 1 + +## Enable ControlPort +#ControlPort 9051 +#CookieAuthentication 1 +#CookieAuthFileGroupReadable 1 +#CookieAuthFile /var/lib/tor/control_auth_cookie + +# Robosats LND Testnet Onion Service +HiddenServiceDir /var/lib/tor/roboweb/ +HiddenServiceVersion 3 +HiddenServicePort 80 127.0.0.1:80 \ No newline at end of file