Working on nethserver-moodle module

Hi,

I’ve pushed an initial commit to nethserver-moodle.git repository. I haven’t tested it yet but wanted you to see quickly what we already have. I am running the make-rpms command and am downloading the chroot tree that mock uses to build the rpm packages based on the tree pushed. It will take a while because I am using a slow Internet connection but as soon as I have any progress on testing the packages will notify you.

Suggestions and collaborations are welcome. This is my first attempt to build something to NethServer and might contain errors. The work is based on nethserver-nextcloud package.

Best regards,

5 Likes

I did some comments in github :slight_smile:

Good work :slight_smile:

2 Likes

Thanks for the github comments. :+1: Feel free to send pull requests as well. :wink:

I’ve ushed a few more changes up to nethserver-moodle.git repository and built the nethserver-moodle-0.0.4-1.ns7.noarch.rpm package based on them. Could you test this package and report issues please?

To test the package run the following command as root:

yum localinstall ./nethserver-moodle-0.0.4-1.ns7.noarch.rpm

It should install all required dependencies as described in README.rst

2 Likes

Very good points @stephdl. Here is an update with a few of your suggestions:

1 Like

you still miss a line in your spec file

Requires : php-soap, php-pecl-zendopcache, php-ldap

good work, these rpm will be needed to give a cache and use ldap

I didn’t include the lines intentionally because those are dependencies of the moodle package not the nethserver-moodle package. Shouldn’t those dependencies be in the moodle spec?

A lot of moodle implementations don’t use ldap authentication. They are just online services where you need to create an account in the moodle database. Or they use some kind of open authentication, facebook or G+.
The upstream maintainer probable left php-ldap out since it is not always used ??

If it is not in the epel package, we sure need those php packages…

These rpm are needed by moodle…it is the orange warnings you get at the installation that you stated we can pass safelly :slight_smile:

Php-ldap it is needed if we want to authenticate by ldap or samba4. It is the next nfr to do

Welcome in the new world! :heart_eyes: Thanks for accepting my invite to jump into the action! :top:

I have only a blank page with this rpm, do I’m alone ???

got it in fact you must respect the url in /var/www/moodle/web/config.php

$CFG->wwwroot = ‘https://ns7dev2.mysomainname/moodle’;

this url wasn’t reachable on my network

$CFG->wwwroot = ‘https://$SystemName.$DomainName/moodle’;

1 Like

The default URL in /var/www/moodle/web/config.php was http://localhost/moodle and it didn’t work when I tried to access the application from a host other than localhost itself. So it was necessary to reconfigure the default URL to match the FQDN of the host which is accessible from remote hosts. In my testing infrastructure the HTTP service is accessible using the server FQDN from both red and green networks.

Another issue to note here is that the URL in config.php must be specified using https:// and not http://. Otherwise CSS and Javascripts aren’t loaded. In this case the application doesn’t work as expected. It seems the URL in config.php must match the schema used to call the application in first place. In our case, the one set by Moodle Box at NethServer Applications.

I guess the default Moodle configuration (as distributed by EPEL) was conceived to be prepared in localhost by the system administrator and later customized (by the system administrator as well) so it can be served in a public address when ready. Note the fact that, initially, the /etc/httpd/conf.d/moodle.conf file doesn’t allow access from hosts other than localhost and we had to change it in order to do so.

How can we handle to choose te url we want moodle to be avaikable on?. I think this should be possible to define during install of the module.
For instance, when clicking the install button for moodle in software center, you first get a prompt to choose an url in the form of subdomain.domain.tld/moodle
It would be nice if a DNS entry is created for that url. Then Moodle would be accessable on that url from the local LAN. If you need external access you need to set an A or CNAME record in your DNS settings of your domain privider and forward on your gateway.
I only don’t know if this is possible if the NS where you install Moodle on is not the DNS server for your network…
Alternatively you could manually create the DNS entry for you LAN.
Ideas?

an action can be launched to create a new db property in the host database, but I guess that you cannot change the default url given at the installation. The fact that the stylesheet is not displayed is maybe a symptom for me…

else we could imagine $CFG->wwwroot = ${moodle}{newurl} || $SystemName.$DomaineName and trigger an action to create the new dns entry

Can you elaborate on why you can’t change the default url during install? It would be highly limiting if this is not possible. Imo you should be able to use any url and install moodle in a vhost for apache. The only thing to do is tell the document root for the moodle install.

I recall something similar with wordpress (If i’m not wrong) where the url is stored in the database and you cannot change it once created. The only manner is to change it manually by the wordpress settings.

But it is the development game now, a lot of problems that you won’t have if you watched the TV, however it is fun.

What database are you talking now? The esmith or the moodle mysql database?

all is stored under the mysql database with moodle

Ok, clear. But if it is the mysql database, then entering a custom url shouldn’t be the hardest thing, or is it?

1 Like

some new of the front, thank to @areguera who find the bug I pushed with my commit :slight_smile:

The rpm is near to be ready to go out, now the big part is the authentication against Samba4/ldap

1 Like