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
Provide an administrative access to the MoodleBox from the Internet #32
Comments
Some things to solve:
|
Alternative to investigate: PageKite. |
Intéressant ! A ton avis cela sera-t-il assez performant pour que le GUI de Moodle tourne bien ainsi ? Merci encore, |
Hi Nicolas,
But you open the MoodleBox with http even if you know the ip address. Moodle uses its config.php and tries to open http://moodlebox.home/ .... but there is no moodlebox.home in the dns server when you connect via ethernet lan. The router can't know that there is a MoodleBox with the ip address 192.168.0.10. Yes, if you set a static name for the ip address in your router then you can connect also from ethernet lan. Ralf |
@ralf-krause: sure, it's a built-in feature to access the MoodleBox this way from the same LAN. The requested feature here is to access from the Internet, e.g. access from your place to my MoodleBox. It's another story :-) |
Impossible à dire: ça dépendra des réseaux disponibles. |
@michel-denis, If you want to get a full MoodleBox access from the lan then you have to define a static ip address with the dns name "moodlebox.home" in your router. You can't use the static ip address because the config.php has configured "moodlebox.home". But it's not so easy to get the access from the internet because the dns name of the MoodleBox is a private name "moodlebox.home". If you want to use a dyndns service to get an offical name like "moodlebox.ddnss.ch" you need to register at the dyndns service and get the dns name. Then you must configure your router to use the dyndns service. Also you need to configure a port forwarding for port 80 to the static address of the MoodleBox. But this is not the only thing! You need to change the dns name inside the MoodleBox to "moodlebox.ddnss.ch". And you also need to change the www address in the Moodle config.php also to "moodlebox.ddnss.ch" and all internal links in Moodle. In this case you must access the MoodleBox with "moodlebox.ddnss.ch" also from the wlan. I think that these changes should not be preconfigured in the MoodleBox. Nicolas should keep it simple. Ralf |
Hi Ralf, thank you for your response and the info. What we need is: from a node on the internet, to login as admin to that remote MoodleBox and perform typical Moodle Admin tasks using the Admin GUI. -michel |
@martignoni The settings in the router must be the same as I wrote before. Ralf |
It seems that Pagekite has an option to do this. I'm still testing for now. |
Hello, An alternative to Pagekite is ngrok (free). Bruno |
hi Bruno, ngrok is free apparently in "exceptions" cases - it's a little bit "hidden" at the bottom of the page : https://ngrok.com/pricing Will it be enough in fonctionality and stability for operations mode ? |
Thanks @BrunoMalaval for ngrok mention. I'll try. Yes @michel-denis it will be enough for such needs. |
So I tested several alternatives. The most promising is ngrok. It works very well (with a free plan), but as Moodle URL is hard coded in its config file "config.php", it doesn't work fully correctly. So I'm afraid it's not possible to do it cleanly without changing "config.php", and this would break the usage on the LAN. I'll try to find any workaround, but don't hold your breath. |
OK, I've found a workaround, but it's very hacky. It involves setting wwwroot in "config.php" by reading the default-server variable from nginx (at runtime), which defaults to the server hostname. It works, but I don't know what will happen with URLs in database. I must say I'm very reluctant to add this as a default feature of the MoodleBox, as it could make more harm than help. For reference, here's my hack of config.php: function wwwroot() {
$wwwroot = $_SERVER['HTTPS'] == 'on' ? 'https' : 'http';
$wwwroot .= '://'.$_SERVER['HTTP_HOST'];
return rtrim( $wwwroot, '/' );
}
$CFG->wwwroot = wwwroot(); |
Hi Nicolas, |
Yes, that's why I wrote this: "It works, but I don't know what will happen with URLs in database." and why I'm so reluctant to do such a hack. Thanks for your input. |
There seems to have no simple and non-hacky way to do this :-(. One has to
I'll close this as "won't fix": anyway, if you're a nerd with enough knowledge to do the above steps, you can hack your own MoodleBox without difficulty. Thanks to all commenters for their input. |
Hello Nicolas Almost a year has passed since this discussion and I wonder if there is still no feasible way to do a remote login into a MoodleBox connected to the internet? I'm having a case in the Philippines with remote islands, where they have to ship the MicroSD-cards for maintenance... Best, Frank |
Hi Frank, You must set up a static ip address for the ethernet lan connection. Therefore you must configure the router dhcp service which sends the ip address on a restart of the MoodleBox. For this static ip address of the MoodleBox you must configure a port forwarding for the router firewall. And you need to configure a dynamic dns for the router if it isn't connected with a static ip address to the internet. Let's use an example: The MoodleBox needs no extra configuration. Best regards, Ralf |
Hi Ralf Thank you for the fast answer. We need remote access to maintain the MoodleBox. This might be due to upgrade Moodle, or to install/change content within Moodle. I assume this can be done using ssh. Another need might be to upgrade the MicroSD-card with a new MoodleBox version. Here I assume, this cannot be done using ssh. Thank you also for the terminal instruction. I have to talk to a network admin for the static ip in order to try it. Best, Frank |
This idea was suggested by Michel Denis.
Could be done via VPN or other network tricks, e.g. SSH tunneling.
The text was updated successfully, but these errors were encountered: