Skip to content

Commit

Permalink
Add Over the Moon to self-hosted backend
Browse files Browse the repository at this point in the history
  • Loading branch information
Reckless-Satoshi committed Nov 2, 2024
1 parent 865c2b1 commit 1e98359
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 139 deletions.
10 changes: 5 additions & 5 deletions frontend/static/federation.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "[email protected]",
Expand All @@ -163,7 +163,7 @@
"badges": {
"isFounder": false,
"donatesToDevFund": 25,
"hasGoodOpSec": false,
"hasGoodOpSec": true,
"robotsLove": false,
"hasLargeLimits": false
},
Expand Down
9 changes: 0 additions & 9 deletions nodeapp/coordinators/exp/upstreams.conf

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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";
Expand Down
9 changes: 9 additions & 0 deletions nodeapp/coordinators/moon/upstreams.conf
Original file line number Diff line number Diff line change
@@ -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;
}
67 changes: 0 additions & 67 deletions nodeapp/coordinators/satstralia/locations.conf

This file was deleted.

9 changes: 0 additions & 9 deletions nodeapp/coordinators/satstralia/upstreams.conf

This file was deleted.

12 changes: 4 additions & 8 deletions nodeapp/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down Expand Up @@ -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 {
Expand Down
38 changes: 13 additions & 25 deletions nodeapp/robosats-client.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
$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

0 comments on commit 1e98359

Please sign in to comment.