Semro / syncwatch

Browser extension to watch videos together
MIT License
135 stars 19 forks source link

Self hosting configuration #36

Closed mayankwadhwani closed 1 year ago

mayankwadhwani commented 1 year ago

Hi - can you provide the heroku configuration used to run the server ? Further if we wish to run this on local LAN - will there be any change required in the server js ?

Semro commented 1 year ago

Hi. In Heroku I have config var HEROKU=true, it enabels pinging server itself (so server will not sleep if its free dyno) , but address hardcoded here https://github.com/Semro/syncwatch/blob/2aa16e42a5bbda122dbfdf1bb133da709aea442e/server.js#L53, so you might change it, or better to pull it out in environment variable as well. To run server locally, executing command npm run start should be enough.

mayankwadhwani commented 1 year ago

Hi Semro. I hope you are doing good. so, you're saying that I can self host it on a rpi ? i can provide the IP address here ? If not, what is the source code running at "http://syncevent.herokuapp.com". Further, what changes in extension would be required to connect to the self hosted server?

Semro commented 1 year ago

Yes, you can self-host it. Open extension options, put URL in it and save it. After that it should connect to your server. image

mayankwadhwani commented 1 year ago

Read through the code. Verified the wakeserver actually works when working on heroku. I am running the server on a raspberry pi - running on IP 192.168.29.101 and the server runs at port 8080 . I entered http://192.168.29.101:8080, http://192.168.29.101 in the extension - but always get connection errors. Any suggestions on this @Semro ?

Semro commented 1 year ago

Could you try opening http://192.168.29.101:8080/ in the browser? It should output Cannot GET / that means you reach the server.

mayankwadhwani commented 1 year ago

@Semro - Yes - I am able to open the url in the browser. but the extension is not able to connect to the server. It says connection error.

mayankwadhwani commented 1 year ago

Screenshot from 2022-11-03 00-57-01

mayankwadhwani commented 1 year ago

Disabling and re-enabling the extension made it work. Thanks @Semro for the help here on selfhosting config.