Exposing local computer's COSMOS instance to the web?
Opened this issue · 4 comments
I am having trouble making my COSMOS instance accessible via external networks. I would like to be able to type MY_LOCAL_IP:2900 or MY_PUBLIC_IP:2900 into my browser on my local computer, or MY_PUBLIC_IP:2900 on another computer, and have COSMOS come up just as it does when I type in localhost:2900 on my local computer.
In compose.yaml I have modified the traefik ports from the default 127.0.0.1:2900:80 and 127.0.0.1:2943:443 to just 2900:80 and 2943:443, so that ip's other than localhost can see COSMOS. I am also having my router port forward 2900 to 2900 and 2943 to 2943. In theory, this should mean that I can type MY_LOCAL_IP:2900 or MY_PUBLIC_IP:2900 and COSMOS should come up. However, in both cases, COSMOS becomes the title of the tab and the COSMOS icon shows up as the tab's icon, but the page itself remains blank, and my browser informs me that my connection to the site isn't secure.
What is the proper way to make my local COSMOS instance accessible to the web?
We have solved this on my team by removing in the index.ejs
and the index-allow-http.ejs
by removing the content security policy line of code. About like 29 on the index.ejs
. You have to remove from both files.
I have made the changes suggested by @mteckes but I still cannot get the deployment to be exposed on my VM on my windows laptop. I am using vmware workstation and trying to get the IP for the VM exposed as described above. Any other suggestions?
See the opening to the network instructions here:
https://github.com/OpenC3/cosmos-project
@ryanmelt thanks for the link. i tried all the options but i am still not able to access the UI unless i am on the guest VM. on the VM, no problem but when i try to access it from the host computers web browser (:2900) it's just a blank screen. I think it has to do something with my VM setup.
I had to use the cosmos repo, the openc3 won't build for me. I get an error that it can't reach the repository to pull images.
Edited: there was something wrong with my VM, i created a new one and now it works.