diff --git a/nodeapp/coordinators/freedomsats/locations.conf b/nodeapp/coordinators/freedomsats/locations.conf new file mode 100644 index 00000000..83d140d8 --- /dev/null +++ b/nodeapp/coordinators/freedomsats/locations.conf @@ -0,0 +1,70 @@ +# Libre freedomsats Mainnet Locations +location /mainnet/freedomsats/static/assets/avatars/ { + proxy_pass http://mainnet_freedomsats/static/assets/avatars/; +} + +location /mainnet/freedomsats/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_freedomsats/api/; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + proxy_set_header Host $host; +} + +location /mainnet/freedomsats/ws/ { + proxy_pass http://mainnet_freedomsats/ws/; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + proxy_set_header Host $host; +} + +location /mainnet/freedomsats/relay/ { + proxy_pass http://mainnet_freedomsats/relay/; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + proxy_set_header Origin $http_origin; + proxy_set_header Host $host; + + add_header Access-Control-Allow-Origin *; +} + +# BitcoinVeneto Coordinator Testnet Locations +location /test/freedomsats/static/assets/avatars/ { + proxy_pass http://testnet_freedomsats/static/assets/avatars/; +} + +location /testnet/freedomsats/api/ { + proxy_pass http://testnet_freedomsats/api/; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + proxy_set_header Host $host; +} + +location /testnet/freedomsats/ws/ { + proxy_pass http://testnet_freedomsats/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/freedomsats/upstreams.conf b/nodeapp/coordinators/freedomsats/upstreams.conf new file mode 100644 index 00000000..f6835060 --- /dev/null +++ b/nodeapp/coordinators/freedomsats/upstreams.conf @@ -0,0 +1,9 @@ +# Libre freedomsats Coordinator Mainnet +upstream mainnet_freedomsats { + server localhost:108; +} + +# Libre freedomsats Coordinator Testnet +upstream testnet_freedomsats { + server localhost:1008; +} \ No newline at end of file diff --git a/nodeapp/nginx.conf b/nodeapp/nginx.conf index 9a3ab96e..c32ac00c 100644 --- a/nodeapp/nginx.conf +++ b/nodeapp/nginx.conf @@ -38,6 +38,8 @@ http { include /etc/nginx/conf.d/moon/upstreams.conf; # Libre Bazaar include /etc/nginx/conf.d/bazaar/upstreams.conf; + # FreedomSats + include /etc/nginx/conf.d/freedomsats/upstreams.conf; server { @@ -80,6 +82,8 @@ http { include /etc/nginx/conf.d/moon/locations.conf; # Libre Bazaar include /etc/nginx/conf.d/bazaar/locations.conf; + # FreedomSats + include /etc/nginx/conf.d/freedomsats/locations.conf; # do not log healtchecks made against "/selfhosted" location /selfhosted { diff --git a/nodeapp/robosats-client.sh b/nodeapp/robosats-client.sh index 95f556d2..1da2f320 100644 --- a/nodeapp/robosats-client.sh +++ b/nodeapp/robosats-client.sh @@ -69,5 +69,18 @@ mainnet_bazaar_socat="socat tcp4-LISTEN:${mainnet_bazaar_port},reuseaddr,fork,ke testnet_bazaar_socat="socat tcp4-LISTEN:${testnet_bazaar_port},reuseaddr,fork,keepalive,bind=127.0.0.1 SOCKS4A:${TOR_PROXY_IP:-127.0.0.1}:${testnet_bazaar_onion}:80,socksport=${TOR_PROXY_PORT:-9050}" +################################ +# Freedomsats +# Mainnet +mainnet_freedomsats_onion=dqmmejfmtlve7d4ccohk4usriifdtci6xk4wv7igxn2fyaduh25s6did.onion +mainnet_freedomsats_port=108 +# Testnet +testnet_freedomsats_onion=dqmmejfmtlve7d4ccohk4usriifdtci6xk4wv7igxn2fyaduh25s6did.onion +testnet_freedomsats_port=1008 +# socat cmd +mainnet_freedomsats_socat="socat tcp4-LISTEN:${mainnet_freedomsats_port},reuseaddr,fork,keepalive,bind=127.0.0.1 SOCKS4A:${TOR_PROXY_IP:-127.0.0.1}:${mainnet_freedomsats_onion}:80,socksport=${TOR_PROXY_PORT:-9050}" +testnet_freedomsats_socat="socat tcp4-LISTEN:${testnet_freedomsats_port},reuseaddr,fork,keepalive,bind=127.0.0.1 SOCKS4A:${TOR_PROXY_IP:-127.0.0.1}:${testnet_freedomsats_onion}:80,socksport=${TOR_PROXY_PORT:-9050}" + + # RUN! -$mainnet_temple_socat & $testnet_temple_socat & $mainnet_lake_socat & $testnet_lake_socat & $mainnet_veneto_socat & $testnet_veneto_socat & $mainnet_moon_socat & $testnet_moon_socat & $mainnet_bazaar_socat & $testnet_bazaar_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 & $mainnet_bazaar_socat & $testnet_bazaar_socat & $mainnet_freedomsats_socat & $testnet_freedomsats_socat & nginx