Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accessing linguaCafe externally #229

Open
onsosb opened this issue Apr 29, 2024 · 9 comments
Open

Accessing linguaCafe externally #229

onsosb opened this issue Apr 29, 2024 · 9 comments

Comments

@onsosb
Copy link

onsosb commented Apr 29, 2024

First, I do apologize for this question as I am not sure if it is relevant. I like to be able to access to LinguaCafe from outside of my host. I want to be able to say mydomaine.org:9191 to get to the login page.
I am trying to have a virtual host defined, but could not figure out the document root.

Any hint and help would be truly appreciated. If someone has already done it, the configuration files would be a life and time saver for me.
Thanks

@simjanos-dev
Copy link
Owner

simjanos-dev commented Apr 29, 2024

Are you trying to deploy it without docker? There are some hard coded url-s in linguacafe, which are set to the docker container's name so the webserver can access the python server. You won't be able to run it without docker, unless you change those hardcoded url-s in the code.

Also a note: linguacafe still runs on Laravel 8. I don't know the security implications of it, it will be updated to 11 sometime soon-ish. Still have some refactoring to do before.

If you are trying to set up remote access with docker: I can reach my linguacafe from my local network, even from lingua.cafe domain which is redirected to localhost ip in my hosts file. I think it should just work remotely the same way as well.

@onsosb
Copy link
Author

onsosb commented Apr 29, 2024

I want to set up remote access the docker based implementation as it is, accessing locally is not an issue, as you mentioned, I am trying to set up it so that I can access my machine from outside of home.

@simjanos-dev
Copy link
Owner

The default vhost file accepts requests from any ip:

<VirtualHost *:80>

I think if you have let requests for 9191 port through your firewall, you should be able to access it with the default configuration, you don't have to modify the vhost file.

@sergiolaverde0 Am I correct?

@onsosb
Copy link
Author

onsosb commented Apr 29, 2024

I don't know, I will try when I get home will let you know

@simjanos-dev
Copy link
Owner

Okay. I can test it sometime at the end of the week as well.

@sergiolaverde0
Copy link
Contributor

I am trying to set up it so that I can access my machine from outside of home

Well that is quite the rabbit hole you have gotten yourself into, since doing it in a secure way is not so trivial and just opening ports in the firewall is not a good idea.

Cloudflare tunnels are probably the easiest way that is still secure, see their official docs or this other guide.

A more manual solution that doesn't involve Cloudflare is rolling your own VPN with WireGuard, probably with the support of wireGuard Easy and a Dynamic DNS hostname so you don't have connection issues every time your IP lease expires.

@onsosb
Copy link
Author

onsosb commented Apr 29, 2024

I am trying to set up it so that I can access my machine from outside of home

Well that is quite the rabbit hole you have gotten yourself into, since doing it in a secure way is not so trivial and just opening ports in the firewall is not a good idea.

Cloudflare tunnels are probably the easiest way that is still secure, see their official docs or this other guide.

A more manual solution that doesn't involve Cloudflare is rolling your own VPN with WireGuard, probably with the support of wireGuard Easy and a Dynamic DNS hostname so you don't have connection issues every time your IP lease expires.

Your are right, it is over my head. The idea is/was that I can access it when I am outside through my notepad. I do have a domain name and fixed ip address where the server is located. I got it working, and the beauty of it is you don't need to specify 9191 port.
Here is the apache config file for it:

<VirtualHost *:80>
    ServerName xxxxxx.duckdns.org
</VirtualHost>

<VirtualHost *:443>
    ServerName xxxxx.duckdns.org
    ProxyPreserveHost On
    ProxyPass / http://192.168.1.62:9191/
    ProxyPassReverse / http://192.168.1.62:9191/
    # SSL configuration
     Include /etc/letsencrypt/options-ssl-apache.conf
     Header always set Strict-Transport-Security "max-age=31536000"
     ServerAlias xxxxxx.duckdns.org
     SSLCertificateFile /etc/letsencrypt/live/xxxxxx.duckdns.org/fullchain.pem
     SSLCertificateKeyFile /etc/letsencrypt/live/xxxxxx.duckdns.org/privkey.pem
</VirtualHost>


to access it I just type xxxxxx.duckdns.org and it takes me to the logon page of Linguacafe

@etherealite
Copy link

@onsosb

You could do what I do the access it remotely.

Signup for a free tailscale.com account, install the client on your devices and you're good. Everything worked out of the box for me, no configuration. No Docker networking, Apache VHOST or DNS finagling required, punches through even double NAT'd networks.

@onsosb
Copy link
Author

onsosb commented Apr 30, 2024

@onsosb

You could do what I do the access it remotely.

Signup for a free tailscale.com account, install the client on your devices and you're good. Everything worked out of the box for me, no configuration. No Docker networking, Apache VHOST or DNS finagling required, punches through even double NAT'd networks.

Thanks for the info, I did not know about this service.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants