Cannot get content from repository.

Post Reply
pkihl
Posts: 2
Joined: Sun Mar 15, 2020 10:34 am

Cannot get content from repository.

Post by pkihl »

Hi

I have a 10 pages site that I have created with WonderCMS 2.6. I recently discovered that there now is a 3.0 version available. I am interested in upgrading and started to follow the upgrade guide.
The download and installation of the base package (version 3.0.6) in a separate folder was no problem, but as soon as I signed in to edit mode I faced this error message: ”Cannot get content from repository.”

In the php file I found the address to a git repository with two files with addresses to repositories with themes and plugins. I copied the address for the theme I have used in the older version and added it manually. That went well, but when I click on install I get this error message ”Error opening ZIP file. Error description: Failed to connect to github.com port 443: Connection refused”

Is it possible that my hosting provider has locked the possibility for WonderCMS to reach Git? I do find a setting ”HTTP Outgoing connections” = ”Not allowed” which I can not change.
Are there any alternative way to setup the connection,?
Is it possible to install the themes and extensions I am interested in by downloading files from Git to my local computer, unzip them and upload them to my installation? Are there any instructions on how to handle that?

The Web Server should be Apache and the PHP version 7.2.28 with the three required extensions installed

Thanks in advance

Peter

User avatar
StephanStanisic
Support/Developer
Posts: 23
Joined: Fri Jul 05, 2019 8:51 pm

Re: Cannot get content from repository.

Post by StephanStanisic »

Hi Peter,

The build in installer in WonderCMS contacts github via http(s) in order to get a list of available themes/plugins and to download and install plugins/themes.

You could download and install plugins and themes manually, by downloading the zip file from github and extracting it in the plugins and themes directory respectively.
WonderCMS will still go looking for updates and new themes/plugins, so you will have to disable that. You can edit the following lines in index.php to disable all outgoing http connections: (line 685)

Code: Select all

/**
 * Get content of a file from master branch
 *
 * @param string $file the file we want
 * @param string $repo
 * @return string
 */
public function getFileFromRepo(string $file, string $repo = self::WCMS_REPO): string
{
	$repo = str_replace('https://github.com/', 'https://raw.githubusercontent.com/', $repo);
	$ch = curl_init();
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
	curl_setopt($ch, CURLOPT_URL, $repo . $file);
	$content = curl_exec($ch);
	if (false === $content) {
		$this->alert('danger', 'Cannot get content from repository.');
	}
	curl_close($ch);

	return (string)$content;
}

Code: Select all

/**
 * Get content of a file from master branch
 *
 * @param string $file the file we want
 * @param string $repo
 * @return string
 */
public function getFileFromRepo(string $file, string $repo = self::WCMS_REPO): string
{
	return "";
}
The fact that your hosting provider is blocking outgoing connections feels really sketchy to me, is this one of those free hosting providers?
I would seriously consider choosing a different hosting provider, you can get some really good packages for prices as low as 50 cents a month.

Hopefully this helps you out!

Stephan
wonder.stanisic.nl • My WonderCMS creations
stephanstanisic.nl • My personal site

pkihl
Posts: 2
Joined: Sun Mar 15, 2020 10:34 am

Re: Cannot get content from repository.

Post by pkihl »

Thank you Stephan for your explanation. I will consider the options.

Are there any thread here in the forum where we discuss hosting providers? If the price is 50 cents I might consider switching.

Peter

wiz
Admin
Posts: 432
Joined: Sat Oct 30, 2010 12:23 am

Re: Cannot get content from repository.

Post by wiz »

pkihl, we can discuss them here, feel free to have an open discussion.
We're currently hosted by Linode, but the price isn't 50 cents. I think Stephan can give better suggestions on that front.

Post Reply