openware / opendax

Open-Source Cloud-Native Digital Asset & Cryptocurrency Exchange Platform
https://www.openware.com/products/opendax
Apache License 2.0
614 stars 533 forks source link

How to point OpenDAX at an IP address? #232

Open abwdev opened 3 years ago

abwdev commented 3 years ago

Hi All,

Sorry if this has been answered before but I could not see a solution. I am currently testing a build of OpenDAX but I do not want to point it to a domain name because I want the DAX to be invisible until it is ready to launch.

I am hosting the DAX on a DigitalOcean droplet that has a public IP address. Is there a way to make the DAX resolve only to the IP address (but NOT a domain name). I would appreciate a set of config tasks that are required to the app.yaml file and (if necessary) any config tasks that may be required on the server host file (I'm not sure if that is required).

Thanks!

phuongdev89 commented 3 years ago

why not using a sub-domain except www.yourdomain.com? It can be subdomain.yourdomain.com

alinetskyi commented 3 years ago

Hi, if you only developing on your own I suggest you run it locally instead of deploying. There are instructions in the README on how you can do so. Otherwise, unfortunately, it's not possible to deploy remotely without DNS, so I can suggest you setting up some firewall rules for only your IP to be able to access it.

ahmadidev commented 3 years ago

Because of the microservices architecture, we need a reverse proxy tool (Traefik is used in OpenDAX) to proxy different requests (app.local/api, app.local/tower, etc.) to different backends. So using a Virtual Host is critical to make reverse proxy works. But requesting a backend using a Virtual Host is not dependent to use a DNS system to resolve that Virtual Host to an IP.

So in short, you can't be 100% sure that your instance is unreachable from the outside world. For example, if your instance is deployed on 10.0.0.1, and configured domain in config/app.yml is app.local, one could reach your instance using this curl command without querying DNS for app.local IP:

curl 10.0.0.1/ -H "Host: app.local"

I suggest using a more convenient solution, like blocking requests originating IPs other than yours. Or applying a Basic Auth so only you can pass the reverse proxy. You can apply the above solutions in the Traefik component.

dc199411 commented 1 year ago

when you install opendax on vm or AWS or whatever you are automatically given an i.p address to point a domain to that IP address find out what the IP address is and go to your domain dns provider settings create a new A record under the name put your domains name and under IP put the IP address which you installed opendax on then go back to the opendax install and edit the config/app.yml file and input your domain where it says to save the file and run rake render:config and run rake service:all when that's finished you should be able to see your exchange at your domain