Avançar para o conteúdo principal

qweqwe


Nearly out of time! Some final adjustments were made this week, documentation was accordingly updated and preparations are being made to the deliver GSoC's official final submission. Check out the latest changes in this week's blogpost!

Events

Code

1 - prosodyctl: fixed a typo
2 - util.startup: changed the way util.paths.complement_lua_path was being accessed
3 - util.paths: fixed another typo
4 - util.pluginloader: Added a new path to the variable local_names
5 - core.configmanager: Removed code related to complement_lua_path
6 - prosodyctl: install, remove and list commands now use the call_luarocks function
7 - util.prosodyctl: Removed the check_flags and execute_command functions
8 - util.prosodyctl: call_luarocks function now sets the directory variable itself

Documentation

These are planned changes to the already existing documentation that you can access at prosody's website. For example, you can check prosodyctl's page through the link:  https://prosody.im/doc/prosodyctl
Changes:
doc.prosodyctl: Got rid of the text related to the --tree flag, which has been removed
doc.depends: Added Luarocks as a dependency, and related info
doc.plugins_directory: Added info related to the plugin installer's directory configuration
doc.plugin_installer: Gave the .md extension and rewrote this file
doc.installing_modules: Added info about the plugin installer's directory and which paths it checks

Difficulties/Considerations

After talking with my mentor, we ended up removing the --tree flag from the installer, for now, as it was not clear how useful it would be.
Initially we though it would be nice to also give the user the possibility of specifying the working directory from the command line. Why would him want to have new plugins at different directories for the same prosody server though, since he can use the installer now to easily list and install/remove them, while have everything organized at a single directory?
Behind the scenes, it would also require more work than what I had done. When started, the prosody server goes through a startup process. Some of the things it does are:
  • complement lua's package.path and package.cpath
  • check for plugins in a number of directories, that are part of the default/configured plugin paths
When using commands with the --tree flag, prosody would have to go through these startup tasks again, so that these new paths are taken into consideration, in future operations. We would need to, in a way, reload prosody each time one of these commands were run, so that all the paths could be updated.
At the end of the day, it seems to be too much hassle for a seemingly redundant feature in project that is meant to be lightweight and simple.
This might be a thing to reconsider in the future, but, for now, the user can use the default path for community modules or set a new one at the configuration file, similar to what we already do for the core plugin directories.

See it in action!

You can check this video out, were I install mod_message_logging. I'm using this one here, because it is simple to demonstrate that the plugin is really installed and being used by the software.

Future goals

GSoC's final submission is in demand, so this week we are tackling that, so that everything is nicely presented at the end. See you soon!

Comentários

Mensagens populares deste blogue

Sailing!

After some fusion dance, we have some stuff working neatly! Last week was all about the lua environment and improvements aimed at user-friendliness, which you can check down below with latest changesets and demos. Events prosodyctl Removed most development / experimental commands Created a script that is automatically setting up a ready to be served repository will rockspecs for all of prosody's plugins ( demo ) Various improvements/updates to the main commands: list - demo install demos: installing a prosody plugin installing a luarocks library Installation also prints configuration help   remove - demo prosody uses a separate folder to deal with non-standard plugins - demo Users can configure their own path, and override it at any time from the command line if needed - demo Updated the startup utility script regarding management of default/custom installer directories and lua environment Difficulties The greatest obstacles this past week were ...
Prosody's plugin installer is making use of Luarocks to get things working. Therefore, it makes sense that we look a bit into Luarocks to see how it works. Concepts Here is what you need to know. Luarocks uses files, called rockspecs, to get things installed around. These are basically instruction files and they tell the program how to do the work. We can pack the sources and the rockspecs into a single file, called a rock. We can install libraries from both rocks and rockspec files. The code is installed in what is called a rock tree, which is a folder with a specific structure inside, organized in a way to help with the required management of libraries and servers. Installing, removing and list If you are working on debian you can just use: sudo apt-get install luarocks Now, there might be some trouble here and there, depending on your machine, or if you are in a different OS, but the guys at luarocks have tips for almost every possible situation, just che...
Prosody's plugin installer is making use of Luarocks to work underneath the hood. Therefore, it makes sense that we look a bit into Luarocks to see how it works. Concepts Here is what you need to know. From the perspective of Luarocks, Lua Libraries are files called Rocks. Rock files are like a zip file, in the sense that inside there are many files. Most of those files are the sources, which means those are the files that have all the code itself. And then there is a rockspec file. This is like an instruction file, written in Lua, which contains the important information that Luarocks needs to do its job. Things like the location of sources, dependencies and build instructions. The code is then installed in what is called a rock tree. A normal folder, in other words. But this folder is referenced on luarocks documentation, for example, so that things know where to look for when they need to use a particular library. Installing, removing as list If you ...