Custom script installer for Virtualmin: can not get newer versions

5 posts / 0 new
Last post
#1 Mon, 09/18/2017 - 15:51
Seyfin

Custom script installer for Virtualmin: can not get newer versions

Hi,

I am developing a custom script installer that is aimed to install X-Cart PHP script.

The custom script installer works great. But I can not get newer versions of my custom script installer for some reason. I can not figure out what is wrong.

When I go to "Install Scripts >> Installed Scripts" page in Virtualmin, it shows a newer version available for phpMyAdmin script. However, it shows NO new versions for X-Cart script.

So, for X-Cart script, it shows that version 5.3.2.1 is "Latest". But in fact, there a newer version 5.3.3.3 available on the test site (http://xcart5-php7.tk/download.html).

Please let me know - how can I get the message "Version 5.3.3.3 is available" for my custom script installer? What am I probably doing wrong?

Also, please descibe the function "script_scriptname_latest" in your developer docs (https://www.virtualmin.com/documentation/developer/scripts).

Also, when my script installer for X-Cart PHP script is ready, how can I add it to the default Virtualmin distribution? Is it possible?

Thank you!

Sergey Fomin,

Chief support group engineer at X-Cart

Site: https://www.x-cart.com/ Email: seyfin@x-cart.com

Mon, 09/18/2017 - 17:02
Joe
Joe's picture

You're doing great! I don't think you're doing anything wrong. The problem is that the script_scriptname_latest hook is actually something that runs on our updates server to fetch the latest scripts...it doesn't run on every Virtualmin host.

I don't actually know how it works, but I've pinged Jamie about it to see if there's a way to use it for custom scripts. It looks like the check-scripts.pl command is where the magic happens (but I might be wrong, I haven't actually read it). It's probably possible to tweak it just a little for use for your custom scripts. But, if you're willing to contribute it to be included in the Virtualmin core distribution it'll be included in our regular updates check, and the hook should function. It'd be nice if we had an easy way to test if it's right before contributing it. I'll ask Jamie about that, too.

As for adding it to the Virtualmin core distribution, you can make a pull request to add your script at https://github.com/virtualmin/virtualmin-gpl and if you ever need to make changes, you can make future pull requests at the same place.

--

Check out the forum guidelines!

Tue, 09/19/2017 - 04:50
Seyfin

Thank you for your reply!

When I run the "check-scripts.pl" command via SSH, it reports that the new version for X-Cart script is found, something like that:


Checking xcart 5.3.2.1 ..
Trying http://xcart5-php7.tk/download/x-cart-5.3.2.1-en.tgz ..
.. OK
Checking xcart website for 5.3.2.1 ..
.. found newer version 5.3.3.3

So, the "script_scriptname_latest" hook appears to work perfectly when using the "check-scripts.pl" command.

However, the new version of X-Cart script never shows up on the "Install Scripts" page in Virtualmin, unfortunately. In fact, it still shows the previous (older) version as the latest one, for example:


X-Cart 5.3.2.1 ... Latest

Basically, when there is a newer version of the X-Cart script available on the site (for example, at the URL http://xcart5-php7.tk/download.html, as defined by the "script_xcart_latest" function of my custom script installer "xcart.pl"), I expect Virtualmin to detect the new version automatically and show something like this:


X-Cart 5.3.2.1 ... Version 5.3.3.3 is available

It would be also great if the "check-scripts.pl" command would allow getting newer versions of both built-in and custom scripts (with the help of the "script_scriptname_latest" hook).

I will also try to make a pull request as you suggested when the script is ready.

Of cause, I would like to contribute my custom script installer ("xcart.pl") to be included in the Virtualmin core distribution. When the script is ready, I will be glad to send the script to you to test it.

What is the best way to sent the script to you, possibly by email?

Look forward to hearing from you soon.

Best regards,
Sergey

===

Chief support group engineer at X-Cart
Site: https://www.x-cart.com/
Email: seyfin@x-cart.com

Sergey Fomin

Tue, 09/19/2017 - 08:25
Seyfin

Thank your for your reply!

I hope my previous comment will pass your validation successfully :)

Best wishes,

Sergey Fomin

Wed, 09/20/2017 - 04:06
Joe
Joe's picture

No need to post multiple times if you get caught in the moderation queue. I approve them when I see them. Our spam filter is stupid. We'll be moving to a better forum at some point in the next few months.

It sounds like everything is working as well as it can given the current limits of the way updates are handled (they always come from our server, which is sup-optimal, and I'll talk to Jamie about whether it's possible to allow multiple scripts repos). But, if you're contributing it upstream, to our repo, we run the check update script regularly and update what's in our repository, so it'll Just Work, as long as the update check continues to work.

--

Check out the forum guidelines!

Topic locked