From 1e98359ebb413ae100f3e755848d3f889f2c8337 Mon Sep 17 00:00:00 2001 From: Reckless_Satoshi Date: Sat, 2 Nov 2024 18:23:18 +0000 Subject: [PATCH] Add Over the Moon to self-hosted backend --- frontend/static/federation.json | 10 +-- nodeapp/coordinators/exp/upstreams.conf | 9 --- .../coordinators/{exp => moon}/locations.conf | 32 ++++----- nodeapp/coordinators/moon/upstreams.conf | 9 +++ .../coordinators/satstralia/locations.conf | 67 ------------------- .../coordinators/satstralia/upstreams.conf | 9 --- nodeapp/nginx.conf | 12 ++-- nodeapp/robosats-client.sh | 38 ++++------- 8 files changed, 47 insertions(+), 139 deletions(-) delete mode 100644 nodeapp/coordinators/exp/upstreams.conf rename nodeapp/coordinators/{exp => moon}/locations.conf (74%) create mode 100644 nodeapp/coordinators/moon/upstreams.conf delete mode 100644 nodeapp/coordinators/satstralia/locations.conf delete mode 100644 nodeapp/coordinators/satstralia/upstreams.conf diff --git a/frontend/static/federation.json b/frontend/static/federation.json index 5169b46d4..6e32862d5 100644 --- a/frontend/static/federation.json +++ b/frontend/static/federation.json @@ -142,14 +142,14 @@ "mainnetNodesPubkeys": ["02c5b5972b05fba2cd2c2d9269a47bc478f73fae0f248a85cb1e5af60a07c1919d"], "testnetNodesPubkeys": ["032b698c8143f293d138c0926594f11d119194ddedb513f63a944d14c094d0e54a"] }, - "overthemoon": { + "moon": { "longAlias": "Over the moon", - "shortAlias": "overthemoon", - "identifier": "overthemoon", + "shortAlias": "moon", + "identifier": "moon", "description": "Forget \"to the moon\", at Over the Moon we are here to take no-KYC, p2p exchange to the next level! Our goal is to further decentralise the RoboSats federation whilst providing the maximum level of privacy and security for our users. *Trade amounts increase by 30% every 2016 blocks (~2 weeks).", "motto": "Bene videtur hinc", "color": "#eeeee4", - "established": "2024-11-15", + "established": "2024-11-01", "nostrHexPubkey": "7af6f7cfc3bfdf8aa65df2465aa7841096fa8ee6b2d4d14fc43d974e5db9ab96", "contact": { "email": "otmoon@proton.me", @@ -163,7 +163,7 @@ "badges": { "isFounder": false, "donatesToDevFund": 25, - "hasGoodOpSec": false, + "hasGoodOpSec": true, "robotsLove": false, "hasLargeLimits": false }, diff --git a/nodeapp/coordinators/exp/upstreams.conf b/nodeapp/coordinators/exp/upstreams.conf deleted file mode 100644 index 8628e8b43..000000000 --- a/nodeapp/coordinators/exp/upstreams.conf +++ /dev/null @@ -1,9 +0,0 @@ -# Experimental Coordinator Mainnet -upstream mainnet_exp { - server localhost:101; -} - -# Experimental Coordinator Testnet -upstream testnet_exp { - server localhost:1001; -} \ No newline at end of file diff --git a/nodeapp/coordinators/exp/locations.conf b/nodeapp/coordinators/moon/locations.conf similarity index 74% rename from nodeapp/coordinators/exp/locations.conf rename to nodeapp/coordinators/moon/locations.conf index 6a31d01cc..7156cdbd1 100644 --- a/nodeapp/coordinators/exp/locations.conf +++ b/nodeapp/coordinators/moon/locations.conf @@ -1,9 +1,9 @@ -# Experimental Coordinator Mainnet Locations -location /mainnet/exp/static/assets/avatars/ { - proxy_pass http://mainnet_exp/static/assets/avatars/; +# Over the Moon Mainnet Locations +location /mainnet/moon/static/assets/avatars/ { + proxy_pass http://mainnet_moon/static/assets/avatars/; } -location /mainnet/exp/api/ { +location /mainnet/moon/api/ { # if ($request_method = 'OPTIONS') { # add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; # add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range'; @@ -22,44 +22,44 @@ location /mainnet/exp/api/ { # add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range'; # add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range'; # } - proxy_pass http://mainnet_exp/api/; + proxy_pass http://mainnet_moon/api/; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; proxy_set_header Host $host; } -location /mainnet/exp/ws/ { - proxy_pass http://mainnet_exp/ws/; +location /mainnet/moon/ws/ { + proxy_pass http://mainnet_moon/ws/; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; proxy_set_header Host $host; } -location /mainnet/exp/nostr/ { - proxy_pass http://mainnet_exp/nostr/; +location /mainnet/moon/nostr/ { + proxy_pass http://mainnet_moon/nostr/; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; proxy_set_header Host $host; } -# Experimental Coordinator Testnet Locations -location /test/exp/static/assets/avatars/ { - proxy_pass http://testnet_exp/static/assets/avatars/; +# Over the Moon Coordinator Testnet Locations +location /test/moon/static/assets/avatars/ { + proxy_pass http://testnet_moon/static/assets/avatars/; } -location /testnet/exp/api/ { - proxy_pass http://testnet_exp/api/; +location /testnet/moon/api/ { + proxy_pass http://testnet_moon/api/; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; proxy_set_header Host $host; } -location /testnet/exp/ws/ { - proxy_pass http://testnet_exp/ws/; +location /testnet/moon/ws/ { + proxy_pass http://testnet_moon/ws/; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; diff --git a/nodeapp/coordinators/moon/upstreams.conf b/nodeapp/coordinators/moon/upstreams.conf new file mode 100644 index 000000000..a56a057ed --- /dev/null +++ b/nodeapp/coordinators/moon/upstreams.conf @@ -0,0 +1,9 @@ +# Over the Moon Coordinator Mainnet +upstream mainnet_moon { + server localhost:106; +} + +# Over the Moon Coordinator Testnet +upstream testnet_moon { + server localhost:1006; +} \ No newline at end of file diff --git a/nodeapp/coordinators/satstralia/locations.conf b/nodeapp/coordinators/satstralia/locations.conf deleted file mode 100644 index 4d17e5da4..000000000 --- a/nodeapp/coordinators/satstralia/locations.conf +++ /dev/null @@ -1,67 +0,0 @@ -# Satstralia Mainnet Locations -location /mainnet/satstralia/static/assets/avatars/ { - proxy_pass http://mainnet_satstralia/static/assets/avatars/; -} - -location /mainnet/satstralia/api/ { - # if ($request_method = 'OPTIONS') { - # add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; - # add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range'; - # add_header 'Access-Control-Max-Age' 1728000; - # add_header 'Content-Type' 'text/plain; charset=utf-8'; - # add_header 'Content-Length' 0; - # return 204; - # } - # if ($request_method = 'POST') { - # add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; - # add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range'; - # add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range'; - # } - # if ($request_method = 'GET') { - # add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; - # add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range'; - # add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range'; - # } - proxy_pass http://mainnet_satstralia/api/; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "Upgrade"; - proxy_set_header Host $host; -} - -location /mainnet/satstralia/ws/ { - proxy_pass http://mainnet_satstralia/ws/; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "Upgrade"; - proxy_set_header Host $host; -} - -location /mainnet/satstralia/nostr/ { - proxy_pass http://mainnet_satstralia/nostr/; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "Upgrade"; - proxy_set_header Host $host; -} - -# Satstralia Coordinator Testnet Locations -location /test/satstralia/static/assets/avatars/ { - proxy_pass http://testnet_satstralia/static/assets/avatars/; -} - -location /testnet/satstralia/api/ { - proxy_pass http://testnet_satstralia/api/; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "Upgrade"; - proxy_set_header Host $host; -} - -location /testnet/satstralia/ws/ { - proxy_pass http://testnet_satstralia/ws/; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "Upgrade"; - proxy_set_header Host $host; -} \ No newline at end of file diff --git a/nodeapp/coordinators/satstralia/upstreams.conf b/nodeapp/coordinators/satstralia/upstreams.conf deleted file mode 100644 index fb116b78e..000000000 --- a/nodeapp/coordinators/satstralia/upstreams.conf +++ /dev/null @@ -1,9 +0,0 @@ -# Satstralia Coordinator Mainnet -upstream mainnet_satstralia { - server localhost:103; -} - -# Satstralia Coordinator Testnet -upstream testnet_satstralia { - server localhost:1003; -} \ No newline at end of file diff --git a/nodeapp/nginx.conf b/nodeapp/nginx.conf index 6b0eedd52..612ebe217 100644 --- a/nodeapp/nginx.conf +++ b/nodeapp/nginx.conf @@ -28,16 +28,14 @@ http { # Every robosat coordinators socat tor bridge is an upstream. # Coordinators in the federation: - # Experimental - include /etc/nginx/conf.d/exp/upstreams.conf; # Temple of Sats include /etc/nginx/conf.d/temple/upstreams.conf; - # Satstralia - include /etc/nginx/conf.d/satstralia/upstreams.conf; # TheBigLake include /etc/nginx/conf.d/lake/upstreams.conf; # BitcoinVeneto include /etc/nginx/conf.d/veneto/upstreams.conf; + # Over the Moon + include /etc/nginx/conf.d/moon/upstreams.conf; server { @@ -70,16 +68,14 @@ http { # Proxy API, WS and Avatarts to the coordinator(s) socat bridges - # Experimental - include /etc/nginx/conf.d/exp/locations.conf; # Temple of Sats include /etc/nginx/conf.d/temple/locations.conf; - # Satstralia - include /etc/nginx/conf.d/satstralia/locations.conf; # TheBigLake include /etc/nginx/conf.d/lake/locations.conf; # BitcoinVeneto include /etc/nginx/conf.d/veneto/locations.conf; + # Over the Moon + include /etc/nginx/conf.d/moon/locations.conf; # do not log healtchecks made against "/selfhosted" location /selfhosted { diff --git a/nodeapp/robosats-client.sh b/nodeapp/robosats-client.sh index f3d7376b4..98fa7fed0 100644 --- a/nodeapp/robosats-client.sh +++ b/nodeapp/robosats-client.sh @@ -8,18 +8,6 @@ # Every robosat coordinators needs a tor socat bridge. -############################### -# Experimental -# Mainnet -mainnet_exp_onion=robosats6tkf3eva7x2voqso3a5wcorsnw34jveyxfqi2fu7oyheasid.onion -mainnet_exp_port=101 -# Testnet -testnet_exp_onion=robotestagw3dcxmd66r4rgksb4nmmr43fh77bzn2ia2eucduyeafnyd.onion -testnet_exp_port=1001 -# socat cmd -mainnet_exp_socat="socat tcp4-LISTEN:${mainnet_exp_port},reuseaddr,fork,keepalive,bind=127.0.0.1 SOCKS4A:${TOR_PROXY_IP:-127.0.0.1}:${mainnet_exp_onion}:80,socksport=${TOR_PROXY_PORT:-9050}" -testnet_exp_socat="socat tcp4-LISTEN:${testnet_exp_port},reuseaddr,fork,keepalive,bind=127.0.0.1 SOCKS4A:${TOR_PROXY_IP:-127.0.0.1}:${testnet_exp_onion}:80,socksport=${TOR_PROXY_PORT:-9050}" - ################################ # Temple of Sats # Mainnet @@ -32,18 +20,6 @@ testnet_temple_port=1002 mainnet_temple_socat="socat tcp4-LISTEN:${mainnet_temple_port},reuseaddr,fork,keepalive,bind=127.0.0.1 SOCKS4A:${TOR_PROXY_IP:-127.0.0.1}:${mainnet_temple_onion}:80,socksport=${TOR_PROXY_PORT:-9050}" testnet_temple_socat="socat tcp4-LISTEN:${testnet_temple_port},reuseaddr,fork,keepalive,bind=127.0.0.1 SOCKS4A:${TOR_PROXY_IP:-127.0.0.1}:${testnet_temple_onion}:80,socksport=${TOR_PROXY_PORT:-9050}" -################################ -# Satstralia -# Mainnet -mainnet_satstralia_onion=satstraoq35jffvkgpfoqld32nzw2siuvowanruindbfojowpwsjdgad.onion -mainnet_satstralia_port=103 -# Testnet -testnet_satstralia_onion=testraliar7xkhos2gipv2k65obykofb4jqzl5l4danfryacifi4t7qd.onion -testnet_satstralia_port=1003 -# socat cmd -mainnet_satstralia_socat="socat tcp4-LISTEN:${mainnet_satstralia_port},reuseaddr,fork,keepalive,bind=127.0.0.1 SOCKS4A:${TOR_PROXY_IP:-127.0.0.1}:${mainnet_satstralia_onion}:80,socksport=${TOR_PROXY_PORT:-9050}" -testnet_satstralia_socat="socat tcp4-LISTEN:${testnet_satstralia_port},reuseaddr,fork,keepalive,bind=127.0.0.1 SOCKS4A:${TOR_PROXY_IP:-127.0.0.1}:${testnet_satstralia_onion}:80,socksport=${TOR_PROXY_PORT:-9050}" - ################################ # TheBigLake # Mainnet @@ -68,6 +44,18 @@ testnet_veneto_port=1005 mainnet_veneto_socat="socat tcp4-LISTEN:${mainnet_veneto_port},reuseaddr,fork,keepalive,bind=127.0.0.1 SOCKS4A:${TOR_PROXY_IP:-127.0.0.1}:${mainnet_veneto_onion}:80,socksport=${TOR_PROXY_PORT:-9050}" testnet_veneto_socat="socat tcp4-LISTEN:${testnet_veneto_port},reuseaddr,fork,keepalive,bind=127.0.0.1 SOCKS4A:${TOR_PROXY_IP:-127.0.0.1}:${testnet_veneto_onion}:80,socksport=${TOR_PROXY_PORT:-9050}" +################################ +# Over the Moon +# Mainnet +mainnet_moon_onion=otmoonrndnrddqdlhu6b36heunmbyw3cgvadqo2oqeau3656wfv7fwad.onion +mainnet_moon_port=106 +# Testnet +testnet_moon_onion=otmtestgbj3kqo3nre6oksusuqfb4ids5zg2y5z2qza2jogeu67stwid.onion +testnet_moon_port=1006 +# socat cmd +mainnet_moon_socat="socat tcp4-LISTEN:${mainnet_moon_port},reuseaddr,fork,keepalive,bind=127.0.0.1 SOCKS4A:${TOR_PROXY_IP:-127.0.0.1}:${mainnet_moon_onion}:80,socksport=${TOR_PROXY_PORT:-9050}" +testnet_moon_socat="socat tcp4-LISTEN:${testnet_moon_port},reuseaddr,fork,keepalive,bind=127.0.0.1 SOCKS4A:${TOR_PROXY_IP:-127.0.0.1}:${testnet_moon_onion}:80,socksport=${TOR_PROXY_PORT:-9050}" + # RUN! -$mainnet_exp_socat & $testnet_exp_socat & $mainnet_temple_socat & $testnet_temple_socat & $mainnet_satstralia_socat & $testnet_satstralia_socat & $mainnet_lake_socat & $testnet_lake_socat & $mainnet_veneto_socat & $testnet_veneto_socat & nginx \ No newline at end of file +$mainnet_temple_socat & $testnet_temple_socat & $mainnet_lake_socat & $testnet_lake_socat & $mainnet_veneto_socat & $testnet_veneto_socat & $mainnet_moon_socat & $testnet_moon_socat & nginx \ No newline at end of file