webmin / authentic-theme

Official theme for the best server management panel of the 21st Century
https://authentic-theme.com
MIT License
947 stars 163 forks source link

Convert LWP::Simple to http_download function calls #125

Closed virtualmin closed 9 years ago

virtualmin commented 9 years ago

The dependency on LWP::Simple is causing some folks problems; if it's missing the page indefinitely hangs with the spinner.

There is no need for an external dependency for making simple web requests, as the Webmin library already has a relatively simple function for downloading a remote file.

http://doxfer.webmin.com/Webmin/API_Webmin-Core#http_download.28host.2C_port.2C_page.2C_destfile.2C_.5B.26error.5D.2C_.5B.26callback.5D.2C_.5Bsslmode.5D.2C_.5Buser.2C_pass.5D.2C_.5Btimeout.5D.2C_.5Bosdn-convert.5D.2C_.5Bno-cache.5D.2C_.5B.26headers.5D.29

I see only three instances of this library being needed, all in sysinfo.cgi. You can also kill a couple of lines of code by using the Webmin function (normally using popular CPAN libraries is good Perl practice, but Webmin has a very strong desire to require as few external dependencies as possible, especially for functionality that already exists in the standard Webmin library).

iliajie commented 9 years ago

Alright, Joe. All dependencies are going to _be removed_ in version 10.30. Theme will only wish for Net::SSLeay to make updates work (as they only can be access by https connection made to GitHub) but theme will never fail with error message again. Webmin also requires Net::SSLeay to establish https connections by the way, so it should be installed anyway.

jcameron commented 9 years ago

Regarding updates, does the theme have the ability to download updates to itself separately from Webmin's regular update process?

iliajie commented 9 years ago

No, theme when update is ready shows the notice and if user clicks update it will update itself by Webmin means, meaning Webmin->Webmin Configuration->Themes.

iliajie commented 9 years ago

On the local version, change version number in VERSION.txt to see how it works. If you disable the spinner you will see what is happening. After update is clicked by a user, JavaScrit inserts a link to Theme module, and clicks download and install. New version, 10.30, will have an option to disable notification updates completely.

I understand your concern.

rvanlaak commented 9 years ago

Would it be possible to force an update? We do not have Net::SSLeay installed, so that means updates do not work at the moment.

iliajie commented 9 years ago

You can always update manually. You need SSL simply because you can't make non https request to GitHub. For the future, automatic updates will not work at all (without Net::SSLeay), just as much you will not be able to access Webmin using https without this Perl module. There is not a single reason not to have it installed, right? Can you install it?

rvanlaak commented 9 years ago

After installing Net::SSLeay the updates still do not work. Any place where I can debug it? A 'force update' link / url would be nice :+1:

iliajie commented 9 years ago

What version you're on?

iliajie commented 9 years ago

I mean theme version?

iliajie commented 9 years ago

Try refreshing System Information.

rvanlaak commented 9 years ago

Theme version is Authentic Theme 10.1.2

iliajie commented 9 years ago

You need more dependencies for this version. Version 11 is out and it's only needs Net::SSLeay. Update manually this time.