Install and Upgrade Modules Offline (No internet access)

Where can we download the latest release versions for all the modules that are signed? Downloading from the Github and installing that causes the “unsigned/altered” warning on the FreePBX GUI.

Once downloaded, what is the best way to install/upgrade those modules onto a system that does not have internet access? I see in the Module Admin an option to upload module, but that seems like it will have to be done for each module individually. Using console, I know there is the option to use “fwconsole ma installlocal <url>” - that also looks like will have to be done for each module individually. Is there a folder we could create on the FreePBX machine and copy the signed modules into and have FreePBX use that folder to install all the packages that exist?


1 Like

After digging into the code, I was able to find out the source and come up with a way on how to install and upgrade modules offline. Adding those details here if anyone else is looking for something similar.

Downloading the latest version of the module
The URL to download is of the following format:<modulename>/<modulename>-<version>.tgz.gpg
You can easily generate the list of modules that are currently on your FreePBX using the command fwconsole ma list

In my case, I had FreePBX installed on a system that has internet access, upgrade all the modules, captured the module names and the corresponding version. From that list, ran a batch download command to download the signed version of all the modules.

Installing/Upgrading modules
There are 2 ways I can think of installing the modules on a FreePBX that does not have internet access using the downloaded versions above:

  1. Using the “Upload Modules” option in the Module Admin - This would be very time consuming to do it manually for each module since there are many
  2. In order to make it quicker to upgrade, I am going to move all the downloaded modules into a folder /var/www/html/cachedmodules/. Since the FreePBX already has a webserver, I can run the following command to upgrade the module:
    fwconsole ma downloadinstall http://localhost/cachedmodules/<modulefilename>
    Note: The sequence in which each module is installed/upgraded is important because there might be dependencies. I’ll be working on it and will share it here once I have it finalized.

If there is a better/easier way of doing it, I’d definitely be interested in knowing more.

1 Like

if scripting you may be interested in

fwconsole ma list --format json

So this provides the list of installed modules and the version. Definitely helpful to have it in json format.
Any way to get a similar payload but instead of the installed versions, get the version value of the latest that is available?

listonline also accepts the json format arg:

fwconsole ma listonline --format json

This is exactly what was looking for.

Now all I need is a better way of upgrading all the modules without having to them one at a time. I was thinking maybe modifying the FreePBX module repository URL to a local one. However, I believe there has to be some kind of file that it looks for in the root which tells which modules have an upgrade available. Thoughts anyone?

for x in $( fwconsole ma list | grep -i installed | cut and cut some more ) ; do fwconsole ma install /path/to/$x.tgz.gpg ; done

or similar :slight_smile:

What about modules that have other modules as dependencies? I’m gonna assume that order will matter, right?

you can just put all the modules in /var/www/html/admin/modules/_cache/ then when you go to install the module it will look there first before downloading

Yeah, I was considering it myself. But isn’t there another text file that has the list of all the modules and their latest version values? Or the upgrade process just goes in that folder, extracts the module version value out of the files and assess if it is an upgrade?

So I tried using fwconsole ma install backup and had manually copied the backup.tgz.gpg into the _cache folder but got the error Unable to install module backup: - Cannot find module

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.