My Face

Configuring a MoodleNet instance

Last year I participated in MoodleNet's user testing, and now that v1.0beta is approaching it's a good time to deploy my own instance. I have been running my Mastodon instance-of-one for a couple of years, and that's the same approach I will follow for MoodleNet.

In contrast to last year I am employed by Moodle now. But I joined the Moodle Apps team, so I am doing this of my own volition as a side-project.

Activity

Task started

After some tinkering, I've managed to get my instance up and running. You can find it at learn.noeldemartin.social.

I have to say it's been quite easy to set up. Following the instructions works for the most part. There is only one thing that didn't work for me, and that was running the backend in console mode. But I could work around it executing commands in a running container like this: docker-compose exec backend ./bin/moodle_net rpc "MoodleNet.Access.create_register_email(\"myemail@domain.com\")". It's also not specified in the instructions, but I made sure to use the stable image for the backend container.

Other than this, there were a couple of things I had to do that are particular to my use-case.

Since I am configuring an instance-of-one, I don't really care about emails so I didn't bother configuring them. The only problem I had with that is activating my account after signing up. Looking at the source code I found a way to do it programatically calling MoodleNet.ReleaseTasks.user_set_email_confirmed("username").

Something else I had to configure differently is the networking, given that I am serving multiple websites from the same server. I already faced this problem installing Mastodon, so I did the same and ended up using nginx-agora.

Finally, I wanted to set up automatic backups. Again, I had already faced this installing my Solid POD. So I used rireki to upload daily backups to DigitalOcean spaces.

At one point I had issues building the image in the server. I was getting out-of-memory errors because I didn't have enough RAM on the server, and I thought I'd have to resize my droplet. But looking for alternatives I found a way to share docker images without a repository. I have to say, Docker is awesome and it took me a while to get the hang of it. But now that I've been using it for years it's been a life saver countless times.

I also did some small modifications to the code, most of which I've reported as issues to be discussed in the main repo. You can find my fork with these modifications here.

I'd say this task is done now, but I'll leave it open for a couple of days to see if something comes up using it in production.

I've been tinkering some more and I think I have a fair grasp of the current status of the project, so that'll be it for this task.

Something I found is a built-in GraphQL console that can be opened at /api/graphql. It's currently not working in the official Moodle instance, so I assume it can be disabled. I don't mind leaving it open, after all authentication is required to perform any priviledged operations. And it's not like it'd be impossible to run GraphQL queries without it. As I've said before, I'm not a fan of security through obscurity.

One of the things I've been testing is federation. It's not supposed to be ready yet because that's planned for Federation testing, an upcoming milestone. But I was curious to see where it's at.

Some things are working, I had a conversation with myself across Mastodon and MoodleNet. For normal users that's it though. The feature I was the most interested in is Remote Follows (following Users/Communities/Collections from other MoodleNet instances). It's actually implemented in the backend, but not exposed through the UI. I tried to call it from the GraphQL console, but I didn't manage to get it working. Looking at the server logs I can tell remote actors were retrieved successfully, but eventually there was an invalid function call error. I suppose there are some things to iron out (or I was doing something wrong).

Still, something came out of this. I had a chance to look at the backend and read some Elixir code. It was my first time reading Elixir and I have to say it seems easy to understand. I also realized there is more to the backend than you'd think looking at the UI. So I don't think the project is too far from having functioning federation. Of course, take anything I say with a grain of salt because I'm not qualified to know. I also didn't try connecting with the mothership which is also an important piece for discoverability.

Task completed