Introduce a Wrapper for Install Scripts to support remote operations via FTP/SFTP

According to the docs, the API currently works such as that it runs the corresponding commands locally:

However, when it comes to installing web apps, one extremely popular feature is being able to remotely install scripts, possibly on servers that may not even be running virtualmin/webmin. Thus, webmin's clustering or RPC feature would be of little use here.

The need for simple wizard-guided installations of web apps has resulted in a plethora of products and web services being offered, such as e.g.:

All of these support remote-installation of scripts by asking the user to provide FTP/SFTP and mySQL access credentials.

According to the docs, it seems that this is a workflow that could also be supported by webmin/vmin, i.e. by working over SSH/SFTP instead of having the assumption that all operations are local.

Obviously, local operations would still be supported by simply ssh'ing into localhost by default.

In addition, reworking the installer APIs accordingly would also prepare them for supporting migrations over SSH/SFTP.



Installing scripts on a remote system isn't something that Virtualmin is likely to support any time soon..

The main reason is that a script is heavily integrated with the local webserver, the domain's home directory, Unix user and possibly email aliases. None of these exist on a remote system.

What would be the use case for this kind of remote installation?

I see, good point actually, I am obviously not aware of the webmin-specifics here...

On the other hand, this is a pretty popular feature (see simplescripts etc), and there are quite a few solutions in existence today supporting this, i.e. remote-installs of scripts via FTP/SFTP.

Use-case wise, simplescripts et al already solve the problem obviously, but they're also fairly limited, i.e. only really support installation itself, but not management (updates/changes) or migrations to new servers - a limitation that virtualmin's "install script" feature also seems to have, as discussed in the "extended custom fields" issue - presumably because of the same reasons that you mentioned: config files being "patched" with hardcoded values.

Like you rightly say, installation scripts are obviously TIGHTLY integrated with a corresponding runtime environment - but as I tried to point out today, hardcoding/patching configuration values into the script is pretty fragile when it comes to actually updating/managing an installed script, no matter if it's changes or literally migrations to a new server:

Which is why I brought up the idea of extending the concept of "custom fields" in virtualmin/webmin and making them also accessible to server-side scripts - either via runtime variables or via the RPC API.

The point being that there doesn't need to be any editing or "patching" of files involved as long as the corresponding hooks are added to retrieve the corresponding config values directly from webmin in some shape or form.

These files would only ever need to be patched/edited if the installed script is moved to a non-webmin environment (ironically, one of the use-cases discussed here).

And at that point, renaming/moving folders would be straightforward, and even migrating to a new server would become possible, because webmin would actually have a concept of what is entailed, i.e. requires changing - because none of the config values would be directly written to the config files, but instead dynamically looked up. So that all that needs changing are custom fields (their values).

Use-case wise it also isn't uncommon for people to eventually move to another hosting provider and ask for assistance with migrating things - where webmin/virtualmin may not necessarily be available. And overall, opensource applications tend to be much better at being "open", i.e. not "lock-in" products. So, I would very much appreciate having an option to easily migrate an "installed script" to another server via SSH/SFTP.

Just to clarify, based on your familiarity with webmin and its code, are you saying that it would not be a good idea to base something like this on webmin, but instead come up with a custom solution or use a 3rd party tool ?

Like I said, I looked around quite a bit, but have really only found solutions like "simplescripts" that are "install-once", but that do not support managing/migrating things afterwards. So when I checked out the "Install Scripts" APIs, it seemed that generalizing the concept and working through SFTP could be an elegant solution to the problem at hand ?

Thanks again for taking the time to comment, it's really appreciated!