This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

[Module] Let's Encrypt
#7
RE: [Module] Let's Encrypt
(03-22-2019, 02:40 PM)Bizarrus Wrote: Normally im using the latest Certbot release from GitHub. But the restrictions of permissions makes it hart to interact with Shell-Scripts, thats why im using an simple (but effective) Web-API.

The renewal process will be added to the default cron, that was my first things.

I hope the module will work on most users with older PHP versions, i had seen, that on CentOS, PHP 5.6 will be installed and on Debian is PHP 5.4 presented. But my code style is a little bit newer (For sample [] as Arrays instead of array()).

On further releases, Wildcards will be implemented with an direct interaction of DNS. The ACME-Challenges will be stored as TXT record and i will try to check out if it possible to interact here with post processesif the DNS records are published.

Im new on Sentora, im not an consumer/user of Sentora, i had written these module for a friend. Sentora seems very old, the template engine is very annoying with only minimal informations and that is, why i had crying two hours with their special and restricted syntax Big Grin

Looking at the code in LetsEncrypt.php more closely, there seems to be an issue with adding the www to domains.

Sentora always creates a www Alias entry for a vhost for any domain that doesn't begin with www, so for example, if I have:

mydomain.com

on my Sentora server, Sentora will add an Alias entry for:

www.mydomain.com

as well.

The LetsEncrypt.php seems to do something quite bizarre and check how many sections a domain name has to determine whether to include a www version as a Subject Alternative Name entry. This falls down if a domain name has a two-section TLD, such as .co.uk. If I had the domain:

mydomain.co.uk

on my server, your module will see the three sections of the domain name and not include:

www.mydomain.co.uk

in the SSL certificate, even though Sentora listens for this.

I propose simply detecting whether the domain begins with www. or not, so change this section of code:

Code:
if(!(count(explode('.', $domain)) > 2)) {
$config['www.' . $domain] = [
'challenge' => 'http-01',
'docroot' => sprintf('%s%s/public_html/%s/', $this->host_path, $this->account, str_replace('.', '_', $domain))
];
}

to this:

Code:
if (!(strpos($domain, 'www.') === 0)) {
$config['www.' . $domain] = [
'challenge' => 'http-01',
'docroot' => sprintf('%s%s/public_html/%s/', $this->host_path, $this->account, str_replace('.', '_', $domain))
];
}

Keith
Reply
Thanks given by:


Messages In This Thread
[Module] Let's Encrypt - by Bizarrus - 03-22-2019, 05:47 AM
RE: [Module] Let's Encrypt - by fearworks - 03-22-2019, 07:11 AM
RE: [Module] Let's Encrypt - by Bizarrus - 03-22-2019, 07:14 AM
RE: [Module] Let's Encrypt - by fearworks - 03-22-2019, 11:13 AM
RE: [Module] Let's Encrypt - by Bizarrus - 03-22-2019, 02:40 PM
RE: [Module] Let's Encrypt - by fearworks - 03-22-2019, 03:29 PM
RE: [Module] Let's Encrypt - by fearworks - 03-22-2019, 04:43 PM
RE: [Module] Let's Encrypt - by Bizarrus - 03-22-2019, 05:41 PM
RE: [Module] Let's Encrypt - by Bizarrus - 03-22-2019, 08:25 PM
RE: [Module] Let's Encrypt - by fearworks - 03-22-2019, 09:09 PM
RE: [Module] Let's Encrypt - by Bizarrus - 03-22-2019, 10:30 PM
RE: [Module] Let's Encrypt - by fearworks - 03-23-2019, 02:05 AM
RE: [Module] Let's Encrypt - by Bizarrus - 03-23-2019, 02:12 AM
RE: [Module] Let's Encrypt - by fearworks - 03-23-2019, 03:20 AM
RE: [Module] Let's Encrypt - by Ron-e - 03-23-2019, 04:22 PM
RE: [Module] Let's Encrypt - by andresfmg - 05-08-2019, 02:39 AM
RE: [Module] Let's Encrypt - by Bizarrus - 03-23-2019, 07:04 PM
RE: [Module] Let's Encrypt - by Ron-e - 03-24-2019, 08:52 PM
RE: [Module] Let's Encrypt - by Bizarrus - 03-24-2019, 09:05 PM
RE: [Module] Let's Encrypt - by Bizarrus - 03-24-2019, 06:13 AM
RE: [Module] Let's Encrypt - by fearworks - 03-24-2019, 06:17 AM
RE: [Module] Let's Encrypt - by Bizarrus - 03-24-2019, 06:19 AM
RE: [Module] Let's Encrypt - by fearworks - 03-24-2019, 06:32 AM
RE: [Module] Let's Encrypt - by Bizarrus - 03-24-2019, 06:37 AM
RE: [Module] Let's Encrypt - by Bizarrus - 03-25-2019, 06:51 AM
RE: [Module] Let's Encrypt - by fearworks - 03-25-2019, 11:03 AM
RE: [Module] Let's Encrypt - by Bizarrus - 03-25-2019, 03:30 PM
RE: [Module] Let's Encrypt - by fearworks - 03-25-2019, 05:06 PM
RE: [Module] Let's Encrypt - by Bizarrus - 03-25-2019, 06:11 PM
RE: [Module] Let's Encrypt - by fearworks - 03-29-2019, 11:34 PM
RE: [Module] Let's Encrypt - by drrob - 03-29-2019, 12:55 AM
RE: [Module] Let's Encrypt - by Bizarrus - 03-29-2019, 09:34 PM
RE: [Module] Let's Encrypt - by Bizarrus - 03-30-2019, 03:15 AM
RE: [Module] Let's Encrypt - by fearworks - 03-30-2019, 11:37 AM
RE: [Module] Let's Encrypt - by Bizarrus - 03-30-2019, 06:35 PM
RE: [Module] Let's Encrypt - by fearworks - 04-25-2019, 01:45 AM
RE: [Module] Let's Encrypt - by Bizarrus - 05-08-2019, 04:00 AM
RE: [Module] Let's Encrypt - by fearworks - 06-03-2019, 07:59 PM
RE: [Module] Let's Encrypt - by goldenfish - 08-04-2019, 05:32 PM
RE: [Module] Let's Encrypt - by vishnupc - 08-08-2019, 10:34 PM
RE: [Module] Let's Encrypt - by TGates - 08-14-2019, 06:38 AM
RE: [Module] Let's Encrypt - by zustudios - 12-23-2019, 03:50 AM
RE: [Module] Let's Encrypt - by harpreet - 01-02-2020, 12:57 AM
RE: [Module] Let's Encrypt - by TGates - 01-05-2020, 04:39 AM
RE: [Module] Let's Encrypt - by zustudios - 01-14-2020, 04:16 AM
RE: [Module] Let's Encrypt - by TGates - 01-15-2020, 10:01 AM
RE: [Module] Let's Encrypt - by zustudios - 01-22-2020, 05:23 AM
RE: [Module] Let's Encrypt - by TGates - 01-28-2020, 08:43 AM
RE: [Module] Let's Encrypt - by snakeice - 02-20-2020, 06:38 AM
RE: [Module] Let's Encrypt - by Bizarrus - 02-21-2020, 12:27 AM
RE: [Module] Let's Encrypt - by muratkaragoz - 05-24-2020, 03:44 PM
RE: [Module] Let's Encrypt - by spoonman - 01-31-2021, 11:48 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
[MODULE] phpMyAdmin-AU (Auto-Update) TGates 14 40 ,880 06-15-2021, 06:54 AM
Last Post: TGates
[MODULE] SenBrand - Basic Branding module for Sentora TGates 20 43 ,734 06-04-2021, 11:47 AM
Last Post: ccr1969
[MODULE] CoinCorner BitCoin Module Xversion 4 13 ,163 06-03-2021, 05:02 AM
Last Post: zHostingSolutions

Forum Jump:


Users browsing this thread: 2 Guest(s)