I am developing a new VNC module and it needs to modify the xdmcp setting in /etc/gdm/custom.conf. I have perl code to do this but it requires the perl module “Config::IniFiles” to run. How do I add that perl module to the list of suggested or required perl modules for Webmin?
I started to reply with a general answer for any third-party Perl modules, but then when I got to the end, I realized you’re talking about a module that is already included with Webmin. You don’t need to do anything. Webmin already bundles Config::IniFiles in its vendor_perl. (Though I can’t figure out why, we don’t use it anywhere in Webmin…so maybe don’t bet on that staying there forever. I’m trying to figure out why @Ilia added it. So maybe do keep reading for how to bundle it in your module instead.)
You have a few options.
You can’t add it to the list of suggested/required modules for Webmin, because Webmin is not your package. But, you can add it as a dependency to your packages (assuming you build a deb and RPM of your module). Webmin wbm.gz modules don’t have the ability to depend on anything outside of Webmin (they can only depend on other Webmin modules).
If the module is pure Perl and not huge, which I believe is true of Config::IniFiles, you may just want to bundle it and its dependencies in your module. That’s how we handle the problem for several modules. See GitHub - virtualmin/virtualmin-gpl: Virtualmin web hosting control panel for Webmin for examples of that. Note that IDNA and Net contain third-party Perl modules.
Since Config::IniFiles has some additional deps, so you may want to do something like we do in the Webmin repo, which has its own vendor_perl directory for modules, if the dependencies are not in Perl core. webmin/vendor_perl at master · webmin/webmin · GitHub
Edit: I figured out why Ilia added Config::IniFiles. I used it in the Jailkit module, though I think we probably should have bundled it in that module, instead of putting it in Webmin, if we won’t be using it elsewhere.
Also, it is used by Webmin’s “Jailkit Jail Manager” when installed. However, since we manage it during the Virtualmin installation, I believe we can simply remove it.
@barryn To distribute Config::IniFiles, simply place it in vendor_perl in your module, and use use lib to load it.
I really don’t like that! While it’s convenient for Webmin to load, all modules should be placed in the dedicated directory!
Please do not remove it. The new Webmin VNC client module uses it currently and I will probably be using the Config::IniFiles perl module with other modules that need to modify or edit config files. I may even use it to make a generic form driven config file editor.
I’d recommend you bundle it into vendor_perl in your module and use lib to load it, like Ilia suggested. (And we should probably do the same in the Jailkit module.)
Unless a Webmin core module gets a module that uses it, I don’t see any reason for Webmin to have it. We are trying to reduce the size of the Webmin package (though this particular module is tiny and probably not really relevant to that problem).