virtualmin / virtualmin-gpl

Virtualmin web hosting control panel for Webmin
https://www.virtualmin.com
GNU General Public License v3.0
320 stars 102 forks source link

Installing Virtualmin Module From GPL Download Directory at Virtualmin.com Installs Pro Version #597

Closed MSSEsq closed 1 year ago

MSSEsq commented 1 year ago

Installing the Virtualmin module into Webmin by using the Webmin Configuration Install Module page to download from https://software.virtualmin.com/vm/7/gpl/wbm/virtual-server-7.7.gpl-3.wbm.gz installs the Pro version rather than the GPL version. The Dashboard lists Virtualmin version 7.7 Pro and displays:

 Warning! A problem was detected with your Virtualmin license : An error occurred checking the licence : Missing serial number A renewal can be purchased at Virtualmin Shop (https://virtualmin.com/shop/)

Refreshing the license information changes nothing. I first reported essentially this same problem on October 3, 2021 in the Virtualmin Forum: https://forum.virtualmin.com/t/virtualmin-virtual-server-module-6-17-3-released/112354/12.

Operating system FreeBSD 13.2-RELEASE-p1 on amd64 Webmin version 2.021 Virtualmin version 7.7 Pro [Should be GPL version] Authentic theme version 20.21

swelljoe commented 1 year ago

Oh, dang. Thanks for the heads up. I guess the create-module.pl script isn't respecting the --exclude flag. I'm looking into it.

swelljoe commented 1 year ago

Hmm...actually, my theory was wrong. I'm not sure what's happening. Maybe it's looking for a license file in /etc/virtualmin-license (which would be populated with GPL for both SerialNumber and LicenseKey in an install with the install script). It shouldn't do that, but maybe that's what's happening.

I don't see any evidence the Pro version is what's in that path (when I download it and untar it, I don't see any Pro code and the version is 7.7, not 7.7 Pro). Very confusing.

I'll have to check with Jamie why this would be detected as Pro. The get_module_version_and_type function is maybe doing something wrong in the absence of GPL in the version in the module.info file or somewhere else. It's not clear to me how it tries to figure out, but it's detecting wrong rather than actually being the Pro version (if it were the Pro package, it'd have all those missing library functions).

MSSEsq commented 1 year ago

Joe,

There is no “virtualmin-license” file in /etc or in /usr/local/etc, the latter being appropriate on FreeBSD. I also scanned the /usr/local/etc/webmin directory for any file named “module.info” and found none.

Michael

On Jul 25, 2023, at 10:50 PM, Joe Cooper @.***> wrote:

Hmm...actually, my theory was wrong. I'm not sure what's happening. Maybe it's looking for a license file in /etc/virtualmin-license (which would be populated with GPL for both SerialNumber and LicenseKey in an install with the install script). It shouldn't do that, but maybe that's what's happening.

I don't see any evidence the Pro version is what's in that path (when I download it and untar it, I don't see any Pro code and the version is 7.7, not 7.7 Pro). Very confusing.

I'll have to check with Jamie why this would be detected as Pro. The get_module_version_and_type function is maybe doing something wrong in the absence of GPL in the version in the module.info file or somewhere else. It's not clear to me how it tries to figure out, but it's detecting wrong rather than actually being the Pro version (if it were the Pro package, it'd have all those missing library functions).

swelljoe commented 1 year ago

module.info would be in /usr/local/webmin/virtual-server, which is where the module version string comes from. But, there may be some other magic happening. It's bug-like, though, for sure.

iliajie commented 1 year ago

module.info would be in /usr/local/webmin/virtual-server, which is where the module version string comes from. But, there may be some other magic happening. It's bug-like, though, for sure.

Authentic theme is using this file and version key to detect if the installed Virtualmin version is Pro or GPL. I made it a long time ago, and there is probably a better way of doing it..

However, I expected module.info file format to be consistent.

For example, .deb and .rpm GPL versions of Virtualmin have version key set to:

version=7.7.gpl-3

The Virtualmin Pro package when installed with .deb and .rpm has it set to:

version=7.7

This .wbm.gz Virtualmin module in question has it set to:

version=7.7

I would expect it to be set similarly, i.e.:

version=7.7.gpl
swelljoe commented 1 year ago

That's not right. The wbm or from source installation of GPL would have a version of 7.7. That's always been so.

swelljoe commented 1 year ago

Also, version detection shouldn't be happening in multiple places in different ways. Theme should be getting the info from upstream.

iliajie commented 1 year ago

Alright, agreed. Fixed for both Authentic theme and Virtualmin. Also added support for semantic Virtualmin versions.

MSSEsq commented 1 year ago

From the Dashboard, I initiated Webmin self-update to version 2.100, then initiated Authentic theme self-update to version 21.02, and then confirmed that the updated authentic-lib.pl, authentic-init.pl, and virtual-server-lib-funcs.pl files were included in the upgrades. These updates eliminated the problem warning message quoted in my original post, but the dashboard still lists: “Virtualmin version 7.7 Pro.” Clicking the Re-Check License button opens that page which reports:

Now re-checking your Virtualmin license ..

.. license is valid. It is valid for unlimited Virtualmin domains, and for use on unlimited systems.

However, a temporary problem occurred during this license check : An error occurred checking the licence : Missing serial number .

.. invalid expiry date :

iliajie commented 1 year ago

You're right. Here is another fix. Jamie, I don't know why you changed it back in time but it seems that we should only test for pro rather than looking for gpl ..

Thank you @MSSEsq!

MSSEsq commented 1 year ago

I manually updated the installed virtual-server-lib.pl file to the version from the latest fix. The Dashboard is now behaving as it should in the GPL version. Thanks for fixing this.