From 02bb4bb8a42c52d4879857a4f6d0180522edf568 Mon Sep 17 00:00:00 2001 From: madeny Date: Thu, 31 Jan 2019 23:11:24 +0100 Subject: [PATCH 01/18] =?UTF-8?q?=EF=A3=BF=208=20quick=20fix|updates...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lh | 1 + 1 file changed, 1 insertion(+) diff --git a/lh b/lh index f855e78..f1be045 100755 --- a/lh +++ b/lh @@ -1,6 +1,7 @@ #! /usr/bin/env php Date: Fri, 1 Feb 2019 00:04:54 +0100 Subject: [PATCH 02/18] =?UTF-8?q?=EF=A3=BF=208=20quick=20fix|updates...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lh | 2 +- tests/.CreateTest.php.swp | Bin 0 -> 1024 bytes tests/CreateTest.php | 20 ++++++++++++++++++++ tests/CreateTest.php.save | 20 ++++++++++++++++++++ 4 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 tests/.CreateTest.php.swp create mode 100644 tests/CreateTest.php create mode 100644 tests/CreateTest.php.save diff --git a/lh b/lh index f1be045..83308c6 100755 --- a/lh +++ b/lh @@ -6,7 +6,7 @@ require __DIR__ . '/src/command/CreatorCommand.php'; use Symfony\Component\Console\Application; use Madeny\lhttps\CreatorCommand; -die(var_dump(new CreatorCommand)); +#die(var_dump(new CreatorCommand)); $app = new Application("Local https Version 1.0"); $app->add(new CreatorCommand); diff --git a/tests/.CreateTest.php.swp b/tests/.CreateTest.php.swp new file mode 100644 index 0000000000000000000000000000000000000000..b58f8d0d487d45f52f4033f1ba84bce89f668f34 GIT binary patch literal 1024 zcmYc?$V<%2S1{5u)iY*50&_wc7;+O+Qu8X21aUB(a!Lz|GV@AsNW+EoGxBp&^&zI} u=VX+W6cp>1q!yPH>pK^vCYGdz0NHv483k|+qm0oI7!3hxh5#^EqXGbrsTsEb literal 0 HcmV?d00001 diff --git a/tests/CreateTest.php b/tests/CreateTest.php new file mode 100644 index 0000000..1559338 --- /dev/null +++ b/tests/CreateTest.php @@ -0,0 +1,20 @@ +assertEquals(1, $error()); + + + } +} \ No newline at end of file diff --git a/tests/CreateTest.php.save b/tests/CreateTest.php.save new file mode 100644 index 0000000..be08e28 --- /dev/null +++ b/tests/CreateTest.php.save @@ -0,0 +1,20 @@ +assertEquals(1, $error()); + + + } +} From 141a750b02a49b2052b0bbbcc8bbaa740247e435 Mon Sep 17 00:00:00 2001 From: madeny Date: Fri, 1 Feb 2019 00:16:20 +0100 Subject: [PATCH 03/18] =?UTF-8?q?=EF=A3=BF=208=20quick=20fix|updates...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lh | 2 +- tests/CreateTest.php | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 tests/CreateTest.php diff --git a/lh b/lh index f1be045..83308c6 100755 --- a/lh +++ b/lh @@ -6,7 +6,7 @@ require __DIR__ . '/src/command/CreatorCommand.php'; use Symfony\Component\Console\Application; use Madeny\lhttps\CreatorCommand; -die(var_dump(new CreatorCommand)); +#die(var_dump(new CreatorCommand)); $app = new Application("Local https Version 1.0"); $app->add(new CreatorCommand); diff --git a/tests/CreateTest.php b/tests/CreateTest.php new file mode 100644 index 0000000..adf80a6 --- /dev/null +++ b/tests/CreateTest.php @@ -0,0 +1,17 @@ +assertEquals(0, $error); + + } + +} From a63de9aef2b69b0ac1be732e347bea9bf2092c5d Mon Sep 17 00:00:00 2001 From: madeny Date: Fri, 1 Feb 2019 00:20:56 +0100 Subject: [PATCH 04/18] =?UTF-8?q?=EF=A3=BF=2013=20quick=20fix|updates...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/.CreateTest.php.swp | Bin 1024 -> 0 bytes tests/CreateTest.php | 15 --------------- 2 files changed, 15 deletions(-) delete mode 100644 tests/.CreateTest.php.swp diff --git a/tests/.CreateTest.php.swp b/tests/.CreateTest.php.swp deleted file mode 100644 index b58f8d0d487d45f52f4033f1ba84bce89f668f34..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1024 zcmYc?$V<%2S1{5u)iY*50&_wc7;+O+Qu8X21aUB(a!Lz|GV@AsNW+EoGxBp&^&zI} u=VX+W6cp>1q!yPH>pK^vCYGdz0NHv483k|+qm0oI7!3hxh5#^EqXGbrsTsEb diff --git a/tests/CreateTest.php b/tests/CreateTest.php index 40e6bce..adf80a6 100644 --- a/tests/CreateTest.php +++ b/tests/CreateTest.php @@ -6,7 +6,6 @@ class CreateTest extends TestCase { /** @test */ -<<<<<<< HEAD public function single_create_command () { exec("php lh create test.dev", $output, $error); @@ -16,17 +15,3 @@ public function single_create_command () { } } -======= - public function create_test() { - - exec("php lh create test.dev", $output, $error); - - - var_dump($error); - - $this->assertEquals(1, $error()); - - - } -} ->>>>>>> 8551acea69fff97acb96d2b8be229c5c4e054f11 From f1920151d79150b7d27dd41c0374fb3677822059 Mon Sep 17 00:00:00 2001 From: madeny Date: Sat, 16 Nov 2019 01:40:56 +0000 Subject: [PATCH 05/18] clean some --- src/@eaDir/Factory.php@SynoResource | Bin 0 -> 741 bytes src/Factory.php | 5 ----- 2 files changed, 5 deletions(-) create mode 100755 src/@eaDir/Factory.php@SynoResource diff --git a/src/@eaDir/Factory.php@SynoResource b/src/@eaDir/Factory.php@SynoResource new file mode 100755 index 0000000000000000000000000000000000000000..0145e69136ffae14be01d9b95f30ce87ae2f5eca GIT binary patch literal 741 zcmZQz6=P>$V!#BvKp|!z-UgLoVPIg~3T1OJFfi2u*#bb!31s&IX$2tW2C@$VX`nm< zP(Kq)Js*(05hw;UgMlB&UJGJ3xVVM^*(ZT)h6YbRe<1rJm>nGH2V~!bu*2$r?1vyW b5CGlD^c2DzC5J%>s3!4z0(ql>#(n_+Jj4=3 literal 0 HcmV?d00001 diff --git a/src/Factory.php b/src/Factory.php index 329abad..9985844 100644 --- a/src/Factory.php +++ b/src/Factory.php @@ -37,11 +37,6 @@ public static function trust($path, $OS, $option) return new TrustTheRootSSLCertificate($path, $OS, $option); } - // public static function deply($file, $path) - // { - // exec("sudo cp {$file} {$path}"); - // } - } From c0671c8721f254bebd34905f85b68d0e4eb07a85 Mon Sep 17 00:00:00 2001 From: madeny Date: Sat, 16 Nov 2019 01:44:14 +0000 Subject: [PATCH 06/18] add Compliance badge --- @eaDir/README.md@SynoResource | Bin 0 -> 741 bytes README.md | 1 + 2 files changed, 1 insertion(+) create mode 100755 @eaDir/README.md@SynoResource diff --git a/@eaDir/README.md@SynoResource b/@eaDir/README.md@SynoResource new file mode 100755 index 0000000000000000000000000000000000000000..0145e69136ffae14be01d9b95f30ce87ae2f5eca GIT binary patch literal 741 zcmZQz6=P>$V!#BvKp|!z-UgLoVPIg~3T1OJFfi2u*#bb!31s&IX$2tW2C@$VX`nm< zP(Kq)Js*(05hw;UgMlB&UJGJ3xVVM^*(ZT)h6YbRe<1rJm>nGH2V~!bu*2$r?1vyW b5CGlD^c2DzC5J%>s3!4z0(ql>#(n_+Jj4=3 literal 0 HcmV?d00001 diff --git a/README.md b/README.md index 530c41c..c0cc4c5 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ * Create a Certifcate Authority that can be use to issue certificate for domains. [![Build Status](https://travis-ci.org/madeny/lhttps.svg?branch=master)](https://travis-ci.org/madeny/lhttps)  [![CircleCI](https://circleci.com/gh/madeny/lhttps.svg?style=svg)](https://circleci.com/gh/madeny/lhttps) +[![BCH compliance](https://bettercodehub.com/edge/badge/madeny/lhttps?branch=master)](https://bettercodehub.com/) --- Sometimes you need https on your local machine to test some functionality of your application, like payment system, but some of them require a valid https. Like stripe. And you can’t use localhost to request a certificate from issuer like Let’s Encrypt, so your option is to create a self signed certificate authority (CA). This tool make it easy. From db6bb96fc02d6f8ada6a43c86a0b2f3e1c47cfb6 Mon Sep 17 00:00:00 2001 From: madeny Date: Sat, 16 Nov 2019 02:44:31 +0000 Subject: [PATCH 07/18] some refactory --- cert/readme.md | 1 - src/@eaDir/Config.php@SynoResource | Bin 0 -> 741 bytes .../CreateDomainCertificate.php@SynoResource | Bin 0 -> 741 bytes src/@eaDir/DomainProvider.php@SynoResource | Bin 0 -> 741 bytes src/@eaDir/Openssl.php@SynoResource | Bin 0 -> 741 bytes src/Config.php | 4 +-- src/CreateDomainCertificate.php | 4 +-- src/DomainProvider.php | 23 +++++------------- src/Factory.php | 4 +-- src/Openssl.php | 5 ++-- .../@eaDir/CreatorCommand.php@SynoResource | Bin 0 -> 741 bytes src/command/CreatorCommand.php | 7 +++--- ...eateDomainCertificateTest.php@SynoResource | Bin 0 -> 741 bytes tests/@eaDir/CustomTestCase.php@SynoResource | Bin 0 -> 741 bytes tests/@eaDir/FactoryTest.php@SynoResource | Bin 0 -> 741 bytes tests/CreateDomainCertificateTest.php | 4 +-- tests/CustomTestCase.php | 4 +-- tests/FactoryTest.php | 12 ++++----- 18 files changed, 28 insertions(+), 40 deletions(-) delete mode 100644 cert/readme.md create mode 100644 src/@eaDir/Config.php@SynoResource create mode 100644 src/@eaDir/CreateDomainCertificate.php@SynoResource create mode 100644 src/@eaDir/DomainProvider.php@SynoResource create mode 100644 src/@eaDir/Openssl.php@SynoResource create mode 100755 src/command/@eaDir/CreatorCommand.php@SynoResource create mode 100755 tests/@eaDir/CreateDomainCertificateTest.php@SynoResource create mode 100755 tests/@eaDir/CustomTestCase.php@SynoResource create mode 100755 tests/@eaDir/FactoryTest.php@SynoResource diff --git a/cert/readme.md b/cert/readme.md deleted file mode 100644 index 126c402..0000000 --- a/cert/readme.md +++ /dev/null @@ -1 +0,0 @@ -# Output files here \ No newline at end of file diff --git a/src/@eaDir/Config.php@SynoResource b/src/@eaDir/Config.php@SynoResource new file mode 100644 index 0000000000000000000000000000000000000000..718eb175901ad5be5eec863526e39a7117fa6e57 GIT binary patch literal 741 zcmZQz6=P>$V!#BvKp|!z-UgLoVPIg~3T1OJFfi2u*#bb!31s&IX$2tW2C@$VX`nm< zP(Kq)Js*(05hw;UgMlB&UJGJ3xVVM^*(ZT)h6YbRe<1rJm>nGH2V~!bu*2$r?1vyW b5CGlD^c2DzC5J%>s3uA50C}T<#(n_+Dyk9} literal 0 HcmV?d00001 diff --git a/src/@eaDir/CreateDomainCertificate.php@SynoResource b/src/@eaDir/CreateDomainCertificate.php@SynoResource new file mode 100644 index 0000000000000000000000000000000000000000..718eb175901ad5be5eec863526e39a7117fa6e57 GIT binary patch literal 741 zcmZQz6=P>$V!#BvKp|!z-UgLoVPIg~3T1OJFfi2u*#bb!31s&IX$2tW2C@$VX`nm< zP(Kq)Js*(05hw;UgMlB&UJGJ3xVVM^*(ZT)h6YbRe<1rJm>nGH2V~!bu*2$r?1vyW b5CGlD^c2DzC5J%>s3uA50C}T<#(n_+Dyk9} literal 0 HcmV?d00001 diff --git a/src/@eaDir/DomainProvider.php@SynoResource b/src/@eaDir/DomainProvider.php@SynoResource new file mode 100644 index 0000000000000000000000000000000000000000..718eb175901ad5be5eec863526e39a7117fa6e57 GIT binary patch literal 741 zcmZQz6=P>$V!#BvKp|!z-UgLoVPIg~3T1OJFfi2u*#bb!31s&IX$2tW2C@$VX`nm< zP(Kq)Js*(05hw;UgMlB&UJGJ3xVVM^*(ZT)h6YbRe<1rJm>nGH2V~!bu*2$r?1vyW b5CGlD^c2DzC5J%>s3uA50C}T<#(n_+Dyk9} literal 0 HcmV?d00001 diff --git a/src/@eaDir/Openssl.php@SynoResource b/src/@eaDir/Openssl.php@SynoResource new file mode 100644 index 0000000000000000000000000000000000000000..718eb175901ad5be5eec863526e39a7117fa6e57 GIT binary patch literal 741 zcmZQz6=P>$V!#BvKp|!z-UgLoVPIg~3T1OJFfi2u*#bb!31s&IX$2tW2C@$VX`nm< zP(Kq)Js*(05hw;UgMlB&UJGJ3xVVM^*(ZT)h6YbRe<1rJm>nGH2V~!bu*2$r?1vyW b5CGlD^c2DzC5J%>s3uA50C}T<#(n_+Dyk9} literal 0 HcmV?d00001 diff --git a/src/Config.php b/src/Config.php index 74888ff..41c266d 100644 --- a/src/Config.php +++ b/src/Config.php @@ -27,8 +27,8 @@ function __construct() } } - public static function file($path, $domainOne, $domainTwo) + public static function file($path, $domain) { - return new Openssl($path, $domainOne, $domainTwo); + return new Openssl($path, $domain); } } diff --git a/src/CreateDomainCertificate.php b/src/CreateDomainCertificate.php index a64b2c3..e13be18 100644 --- a/src/CreateDomainCertificate.php +++ b/src/CreateDomainCertificate.php @@ -7,9 +7,9 @@ class CreateDomainCertificate{ protected $output; - function __construct($path, $domainOne) + function __construct($path, $domain) { - exec("openssl req -new -sha256 -nodes -out {$path}/csr/{$domainOne}.csr -newkey rsa:2048 -keyout {$path}/live/{$domainOne}.ssl.key -config {$path}/cnf/openssl.cnf 2>>{$path}/logs/log", $output, $error); + exec("openssl req -new -sha256 -nodes -out {$path}/csr/{$domain}.csr -newkey rsa:2048 -keyout {$path}/live/{$domain}.ssl.key -config {$path}/cnf/openssl.cnf 2>>{$path}/logs/log", $output, $error); $this->error = $error; diff --git a/src/DomainProvider.php b/src/DomainProvider.php index 4d61dca..f494d05 100644 --- a/src/DomainProvider.php +++ b/src/DomainProvider.php @@ -3,29 +3,18 @@ class DomainProvider { - protected $domainOne; - protected $domainTwo; + protected $domain; - public function getDomainOne() + public function getdomain() { - $this->domainOne = trim(preg_replace('/\s\s+/', ' ', $this->domainOne)); + $this->domain = trim(preg_replace('/\s\s+/', ' ', $this->domain)); - return $this->domainOne; + return $this->domain; } - public function getDomainTwo() + public function setdomain($domain) { - $this->domainTwo = 'www.'.$this->domainOne; - - return $this->domainTwo; - } - public function setDomainOne($domainOne) - { - if (!$domainOne) { - $this->domainOne = "localhost"; - }else{ - $this->domainOne = $domainOne; - } + !$domain ? $this->domain = "localhost" : $this->domain = $domain; } } \ No newline at end of file diff --git a/src/Factory.php b/src/Factory.php index 9985844..1cfeb8d 100644 --- a/src/Factory.php +++ b/src/Factory.php @@ -20,9 +20,9 @@ public static function create($path) } - public static function domain($path, $domainOne, $domainTwo) + public static function domain($path, $domain) { - return new CreateDomainCertificate($path, $domainOne, $domainTwo); + return new CreateDomainCertificate($path, $domain); } diff --git a/src/Openssl.php b/src/Openssl.php index 2567f3a..aabb1d6 100644 --- a/src/Openssl.php +++ b/src/Openssl.php @@ -4,7 +4,7 @@ class Openssl { - public function __construct($path, $domainOne, $domainTwo) + public function __construct($path, $domain) { $v3 = [ @@ -13,8 +13,7 @@ public function __construct($path, $domainOne, $domainTwo) 'keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment', 'subjectAltName = @alt_names', "[alt_names]", - "DNS.1 = {$domainOne}", - "DNS.2 = {$domainTwo}" + "DNS.1 = {$domain}" ]; $str = implode("\n", $v3); diff --git a/src/command/@eaDir/CreatorCommand.php@SynoResource b/src/command/@eaDir/CreatorCommand.php@SynoResource new file mode 100755 index 0000000000000000000000000000000000000000..718eb175901ad5be5eec863526e39a7117fa6e57 GIT binary patch literal 741 zcmZQz6=P>$V!#BvKp|!z-UgLoVPIg~3T1OJFfi2u*#bb!31s&IX$2tW2C@$VX`nm< zP(Kq)Js*(05hw;UgMlB&UJGJ3xVVM^*(ZT)h6YbRe<1rJm>nGH2V~!bu*2$r?1vyW b5CGlD^c2DzC5J%>s3uA50C}T<#(n_+Dyk9} literal 0 HcmV?d00001 diff --git a/src/command/CreatorCommand.php b/src/command/CreatorCommand.php index be9fbbe..5b2b5c3 100644 --- a/src/command/CreatorCommand.php +++ b/src/command/CreatorCommand.php @@ -40,13 +40,14 @@ protected function execute(InputInterface $input, OutputInterface $output) $path = Path::all(); (new Config); + $domain = new DomainProvider(); $domainName = $input->getArgument('domainName'); - $domain->setDomainOne($domainName); + $domain->setdomain($domainName); - Config::file($path, $domain->getDomainOne(), $domain->getDomainTwo()); + Config::file($path, $domain->getdomain()); // generate a root certificate key. Factory::keygen($path); @@ -55,7 +56,7 @@ protected function execute(InputInterface $input, OutputInterface $output) Factory::create($path); // Create cert key for a domain. - Factory::domain($path, $domain->getDomainOne(), $domain->getDomainTwo()); + Factory::domain($path, $domain->getdomain()); // Request a certificate sign from root certificate authority. diff --git a/tests/@eaDir/CreateDomainCertificateTest.php@SynoResource b/tests/@eaDir/CreateDomainCertificateTest.php@SynoResource new file mode 100755 index 0000000000000000000000000000000000000000..718eb175901ad5be5eec863526e39a7117fa6e57 GIT binary patch literal 741 zcmZQz6=P>$V!#BvKp|!z-UgLoVPIg~3T1OJFfi2u*#bb!31s&IX$2tW2C@$VX`nm< zP(Kq)Js*(05hw;UgMlB&UJGJ3xVVM^*(ZT)h6YbRe<1rJm>nGH2V~!bu*2$r?1vyW b5CGlD^c2DzC5J%>s3uA50C}T<#(n_+Dyk9} literal 0 HcmV?d00001 diff --git a/tests/@eaDir/CustomTestCase.php@SynoResource b/tests/@eaDir/CustomTestCase.php@SynoResource new file mode 100755 index 0000000000000000000000000000000000000000..718eb175901ad5be5eec863526e39a7117fa6e57 GIT binary patch literal 741 zcmZQz6=P>$V!#BvKp|!z-UgLoVPIg~3T1OJFfi2u*#bb!31s&IX$2tW2C@$VX`nm< zP(Kq)Js*(05hw;UgMlB&UJGJ3xVVM^*(ZT)h6YbRe<1rJm>nGH2V~!bu*2$r?1vyW b5CGlD^c2DzC5J%>s3uA50C}T<#(n_+Dyk9} literal 0 HcmV?d00001 diff --git a/tests/@eaDir/FactoryTest.php@SynoResource b/tests/@eaDir/FactoryTest.php@SynoResource new file mode 100755 index 0000000000000000000000000000000000000000..718eb175901ad5be5eec863526e39a7117fa6e57 GIT binary patch literal 741 zcmZQz6=P>$V!#BvKp|!z-UgLoVPIg~3T1OJFfi2u*#bb!31s&IX$2tW2C@$VX`nm< zP(Kq)Js*(05hw;UgMlB&UJGJ3xVVM^*(ZT)h6YbRe<1rJm>nGH2V~!bu*2$r?1vyW b5CGlD^c2DzC5J%>s3uA50C}T<#(n_+Dyk9} literal 0 HcmV?d00001 diff --git a/tests/CreateDomainCertificateTest.php b/tests/CreateDomainCertificateTest.php index 5cd2a40..2e6b2cb 100644 --- a/tests/CreateDomainCertificateTest.php +++ b/tests/CreateDomainCertificateTest.php @@ -9,7 +9,7 @@ class CreateDomainCertificateTest extends CustomTestCase{ public function it_can_create_domain_certificate() { $domainCertificate = - new CreateDomainCertificate($this->path, $this->domain->getDomainOne()); + new CreateDomainCertificate($this->path, $this->domain->getdomain()); $this->assertEquals(0, $domainCertificate->getError()); } @@ -24,7 +24,7 @@ public function it_can_report_an_error() /** @test */ public function it_can_return_array_of_output() { - $domainCertificate = new CreateDomainCertificate($this->path, $this->domain->getDomainOne()); + $domainCertificate = new CreateDomainCertificate($this->path, $this->domain->getdomain()); $this->assertEquals(0, count($domainCertificate->getOutput())); } diff --git a/tests/CustomTestCase.php b/tests/CustomTestCase.php index 99815d4..ee3d4f8 100644 --- a/tests/CustomTestCase.php +++ b/tests/CustomTestCase.php @@ -20,9 +20,9 @@ public function setUp() $this->domain = new DomainProvider; - $this->domain->setDomainOne('example.com'); + $this->domain->setdomain('example.com'); - Config::file($this->path, $this->domain->getDomainOne(), $this->domain->getDomainTwo()); + Config::file($this->path, $this->domain->getdomain()); $this->factory = new Factory(); } diff --git a/tests/FactoryTest.php b/tests/FactoryTest.php index b9ead40..3213ebb 100644 --- a/tests/FactoryTest.php +++ b/tests/FactoryTest.php @@ -52,14 +52,14 @@ public function a_user_can_create_root_certificate_authority() /** @test */ public function a_user_can_create_certificate_key_for_domain() { - $domainkey = file_exists($this->path.'/live/'.$this->domain->getDomainOne().'.ssl.key'); - $domaincsr = file_exists($this->path.'/csr/'.$this->domain->getDomainOne().'.csr'); + $domainkey = file_exists($this->path.'/live/'.$this->domain->getdomain().'.ssl.key'); + $domaincsr = file_exists($this->path.'/csr/'.$this->domain->getdomain().'.csr'); if ($domainkey && $domaincsr) { echo "\n You already have a key for this domain we can sign this \n"; }else{ - Factory::domain($this->path, $this->domain->getDomainOne(), $this->domain->getDomainTwo()); + Factory::domain($this->path, $this->domain->getdomain()); $domainkey = true; $domaincsr = true; @@ -68,7 +68,7 @@ public function a_user_can_create_certificate_key_for_domain() $this->assertEquals($domainkey, true); $this->assertEquals($domaincsr, true); - $this->assertEquals($this->factory->domain($this->path, $this->domain->getDomainOne(), $this->domain->getDomainTwo() )->getError(), 0); + $this->assertEquals($this->factory->domain($this->path, $this->domain->getdomain() )->getError(), 0); } @@ -76,7 +76,7 @@ public function a_user_can_create_certificate_key_for_domain() /** @test */ public function a_user_can_sign_a_domain_cert_with_root_certificate_authority() { - $request = Factory::request($this->path, $this->domain->getDomainOne()); + $request = Factory::request($this->path, $this->domain->getdomain()); $log = file_get_contents(realpath($this->path.'/logs/log')); @@ -88,7 +88,7 @@ public function a_user_can_sign_a_domain_cert_with_root_certificate_authority() } $this->assertEquals($request->getError(), 0); - $this->assertEquals($this->factory->request($this->path, $this->domain->getDomainOne())->getError(), 0); + $this->assertEquals($this->factory->request($this->path, $this->domain->getdomain())->getError(), 0); } /** @test */ From 07f2141a7b0917aa5423d6700f599813dc638bab Mon Sep 17 00:00:00 2001 From: madeny Date: Sat, 16 Nov 2019 02:47:48 +0000 Subject: [PATCH 08/18] Guideline explanation --- .gitignore | 3 +++ example.env | 16 ++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 example.env diff --git a/.gitignore b/.gitignore index 468a737..aba229f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,12 @@ /vendor/ /deply/ /.readme +/.env /cert/cnf/ /cert/config/ /cert/csr/ /cert/keys/ /cert/logs/ /cert/live/ +/@eaDir +./@eaDir diff --git a/example.env b/example.env new file mode 100644 index 0000000..da16dbf --- /dev/null +++ b/example.env @@ -0,0 +1,16 @@ +# .env +#Subject information +R="[req]" +D="default_bits = 2048" +P="prompt = no" +DM="default_md = sha256" +DN="distinguished_name = dn" +D2="[dn]" +COUNTRY=C=LH +STATE="ST=LC" +LOCALITY=L="Local Citry" +ORGANIZATION=O=LOCALHTTPS +ORGANIZATION_UNIT=OU="localhttps" +EMAILADDRESS=emailAddress=local@https.local +COMMONNAME=CN=com.local.https + From 2ebf74cfcc57ab3df289fffbd24b287a578024a6 Mon Sep 17 00:00:00 2001 From: madeny Date: Sat, 16 Nov 2019 02:48:31 +0000 Subject: [PATCH 09/18] Guideline explanation --- .env | 16 ---------------- @eaDir/README.md@SynoResource | Bin 741 -> 0 bytes 2 files changed, 16 deletions(-) delete mode 100644 .env delete mode 100755 @eaDir/README.md@SynoResource diff --git a/.env b/.env deleted file mode 100644 index da16dbf..0000000 --- a/.env +++ /dev/null @@ -1,16 +0,0 @@ -# .env -#Subject information -R="[req]" -D="default_bits = 2048" -P="prompt = no" -DM="default_md = sha256" -DN="distinguished_name = dn" -D2="[dn]" -COUNTRY=C=LH -STATE="ST=LC" -LOCALITY=L="Local Citry" -ORGANIZATION=O=LOCALHTTPS -ORGANIZATION_UNIT=OU="localhttps" -EMAILADDRESS=emailAddress=local@https.local -COMMONNAME=CN=com.local.https - diff --git a/@eaDir/README.md@SynoResource b/@eaDir/README.md@SynoResource deleted file mode 100755 index 0145e69136ffae14be01d9b95f30ce87ae2f5eca..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 741 zcmZQz6=P>$V!#BvKp|!z-UgLoVPIg~3T1OJFfi2u*#bb!31s&IX$2tW2C@$VX`nm< zP(Kq)Js*(05hw;UgMlB&UJGJ3xVVM^*(ZT)h6YbRe<1rJm>nGH2V~!bu*2$r?1vyW b5CGlD^c2DzC5J%>s3!4z0(ql>#(n_+Jj4=3 From 135474042133818727d7b602080a964608b5b13d Mon Sep 17 00:00:00 2001 From: madeny Date: Sat, 16 Nov 2019 02:57:30 +0000 Subject: [PATCH 10/18] fix ci issue --- .circleci/@eaDir/config.yml@SynoResource | Bin 0 -> 741 bytes .circleci/config.yml | 1 + .travis.yml | 3 ++- 3 files changed, 3 insertions(+), 1 deletion(-) create mode 100755 .circleci/@eaDir/config.yml@SynoResource diff --git a/.circleci/@eaDir/config.yml@SynoResource b/.circleci/@eaDir/config.yml@SynoResource new file mode 100755 index 0000000000000000000000000000000000000000..718eb175901ad5be5eec863526e39a7117fa6e57 GIT binary patch literal 741 zcmZQz6=P>$V!#BvKp|!z-UgLoVPIg~3T1OJFfi2u*#bb!31s&IX$2tW2C@$VX`nm< zP(Kq)Js*(05hw;UgMlB&UJGJ3xVVM^*(ZT)h6YbRe<1rJm>nGH2V~!bu*2$r?1vyW b5CGlD^c2DzC5J%>s3uA50C}T<#(n_+Dyk9} literal 0 HcmV?d00001 diff --git a/.circleci/config.yml b/.circleci/config.yml index c739144..c0b0ccc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -37,6 +37,7 @@ jobs: key: v1-dependencies-{{ checksum "composer.json" }} # run tests! + - run: cp ./example.env ./.env - run: composer dump-autoload -o - run: php lh create --a - run: ./vendor/bin/phpunit diff --git a/.travis.yml b/.travis.yml index 57f21fa..c79578d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,7 +19,8 @@ matrix: install: - composer install --prefer-dist --no-suggest -# before_script: +before_script: + - cp ./example.env ./.env # - composer self-update # - composer install --no-interaction From 85d21dd6ae1340780ca094bb1359f3665ac995a4 Mon Sep 17 00:00:00 2001 From: madeny Date: Sat, 16 Nov 2019 03:04:16 +0000 Subject: [PATCH 11/18] Fix cert folder issue --- cert/@eaDir/README.md@SynoResource | Bin 0 -> 741 bytes cert/README.md | 1 + 2 files changed, 1 insertion(+) create mode 100755 cert/@eaDir/README.md@SynoResource create mode 100644 cert/README.md diff --git a/cert/@eaDir/README.md@SynoResource b/cert/@eaDir/README.md@SynoResource new file mode 100755 index 0000000000000000000000000000000000000000..bb647c06615e86f531857ce2bf8170f553d57645 GIT binary patch literal 741 zcmZQz6=P>$V!#BvKp|!z-UgLoVPIg~3T1OJFfi2u*#bb!31s&IX$2tW2C@$VX`nm< zP(Kq)Js*(05hw;UgMlB&UJGJ3xVVM^*(ZT)h6YbRe<1rJm>nGH2V~!bu*2$r?1vyW b5CGlD^c2DzC5J%>s3s{VfV|NFB4`Kz3{(-y literal 0 HcmV?d00001 diff --git a/cert/README.md b/cert/README.md new file mode 100644 index 0000000..cd527f8 --- /dev/null +++ b/cert/README.md @@ -0,0 +1 @@ +# This is where certificate reside. \ No newline at end of file From f58f5bb0c947a21928c7667501f347adb984e157 Mon Sep 17 00:00:00 2001 From: madeny Date: Sat, 16 Nov 2019 03:06:45 +0000 Subject: [PATCH 12/18] Fix cert folder issues --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index aba229f..3d7eb39 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ /.readme /.env /cert/cnf/ +./cert/@eaDir /cert/config/ /cert/csr/ /cert/keys/ From ef08d18713f51bb547dfde869a24cb5de84588dd Mon Sep 17 00:00:00 2001 From: madeny Date: Sat, 16 Nov 2019 03:31:56 +0000 Subject: [PATCH 13/18] Fix lines occurring --- ...CertificateAuthorityCreator.php@SynoResource | Bin 0 -> 741 bytes .../CertificateKeyCreator.php@SynoResource | Bin 0 -> 741 bytes src/CertificateAuthorityCreator.php | 16 +++------------- src/CertificateKeyCreator.php | 14 ++------------ ...ificateAuthorityCreatorTest.php@SynoResource | Bin 0 -> 741 bytes .../CertificateKeyCreatorTest.php@SynoResource | Bin 0 -> 741 bytes tests/CertificateAuthorityCreatorTest.php | 6 +++--- tests/CertificateKeyCreatorTest.php | 6 +++--- tests/FactoryTest.php | 4 ++-- 9 files changed, 13 insertions(+), 33 deletions(-) create mode 100644 src/@eaDir/CertificateAuthorityCreator.php@SynoResource create mode 100644 src/@eaDir/CertificateKeyCreator.php@SynoResource create mode 100755 tests/@eaDir/CertificateAuthorityCreatorTest.php@SynoResource create mode 100755 tests/@eaDir/CertificateKeyCreatorTest.php@SynoResource diff --git a/src/@eaDir/CertificateAuthorityCreator.php@SynoResource b/src/@eaDir/CertificateAuthorityCreator.php@SynoResource new file mode 100644 index 0000000000000000000000000000000000000000..718eb175901ad5be5eec863526e39a7117fa6e57 GIT binary patch literal 741 zcmZQz6=P>$V!#BvKp|!z-UgLoVPIg~3T1OJFfi2u*#bb!31s&IX$2tW2C@$VX`nm< zP(Kq)Js*(05hw;UgMlB&UJGJ3xVVM^*(ZT)h6YbRe<1rJm>nGH2V~!bu*2$r?1vyW b5CGlD^c2DzC5J%>s3uA50C}T<#(n_+Dyk9} literal 0 HcmV?d00001 diff --git a/src/@eaDir/CertificateKeyCreator.php@SynoResource b/src/@eaDir/CertificateKeyCreator.php@SynoResource new file mode 100644 index 0000000000000000000000000000000000000000..718eb175901ad5be5eec863526e39a7117fa6e57 GIT binary patch literal 741 zcmZQz6=P>$V!#BvKp|!z-UgLoVPIg~3T1OJFfi2u*#bb!31s&IX$2tW2C@$VX`nm< zP(Kq)Js*(05hw;UgMlB&UJGJ3xVVM^*(ZT)h6YbRe<1rJm>nGH2V~!bu*2$r?1vyW b5CGlD^c2DzC5J%>s3uA50C}T<#(n_+Dyk9} literal 0 HcmV?d00001 diff --git a/src/CertificateAuthorityCreator.php b/src/CertificateAuthorityCreator.php index 59c12b4..ade96a5 100644 --- a/src/CertificateAuthorityCreator.php +++ b/src/CertificateAuthorityCreator.php @@ -2,27 +2,17 @@ namespace Madeny\lhttps; class CertificateAuthorityCreator{ - protected $error; + public $errors; - protected $output; + public $output; public function __construct($path) { exec("openssl req -x509 -new -nodes -passin pass:none -key {$path}/keys/root.key -sha256 -days 1024 -out {$path}/csr/root.pem -config {$path}/cnf/openssl.cnf 2>>{$path}/logs/log", $output, $error); - $this->error = $error; + $this->errors = $error; $this->output = $output; } - - public function getError() - { - return $this->error; - } - - public function getOutput() - { - return $this->output; - } } diff --git a/src/CertificateKeyCreator.php b/src/CertificateKeyCreator.php index 0362cd8..a79a47e 100644 --- a/src/CertificateKeyCreator.php +++ b/src/CertificateKeyCreator.php @@ -3,8 +3,8 @@ class CertificateKeyCreator{ - protected $output; - protected $errors; + public $output; + public $errors; public function __construct($path) { @@ -13,14 +13,4 @@ public function __construct($path) $this->errors = $errors; $this->output = $output; } - - public function getError() - { - return $this->errors; - } - - public function getOutput() - { - return $this->output; - } } \ No newline at end of file diff --git a/tests/@eaDir/CertificateAuthorityCreatorTest.php@SynoResource b/tests/@eaDir/CertificateAuthorityCreatorTest.php@SynoResource new file mode 100755 index 0000000000000000000000000000000000000000..718eb175901ad5be5eec863526e39a7117fa6e57 GIT binary patch literal 741 zcmZQz6=P>$V!#BvKp|!z-UgLoVPIg~3T1OJFfi2u*#bb!31s&IX$2tW2C@$VX`nm< zP(Kq)Js*(05hw;UgMlB&UJGJ3xVVM^*(ZT)h6YbRe<1rJm>nGH2V~!bu*2$r?1vyW b5CGlD^c2DzC5J%>s3uA50C}T<#(n_+Dyk9} literal 0 HcmV?d00001 diff --git a/tests/@eaDir/CertificateKeyCreatorTest.php@SynoResource b/tests/@eaDir/CertificateKeyCreatorTest.php@SynoResource new file mode 100755 index 0000000000000000000000000000000000000000..718eb175901ad5be5eec863526e39a7117fa6e57 GIT binary patch literal 741 zcmZQz6=P>$V!#BvKp|!z-UgLoVPIg~3T1OJFfi2u*#bb!31s&IX$2tW2C@$VX`nm< zP(Kq)Js*(05hw;UgMlB&UJGJ3xVVM^*(ZT)h6YbRe<1rJm>nGH2V~!bu*2$r?1vyW b5CGlD^c2DzC5J%>s3uA50C}T<#(n_+Dyk9} literal 0 HcmV?d00001 diff --git a/tests/CertificateAuthorityCreatorTest.php b/tests/CertificateAuthorityCreatorTest.php index 91103cb..795eb07 100644 --- a/tests/CertificateAuthorityCreatorTest.php +++ b/tests/CertificateAuthorityCreatorTest.php @@ -12,7 +12,7 @@ public function it_can_create_certificate_authority() $certificateAuthority = new CertificateAuthorityCreator($this->path); - $this->assertEquals(0, $certificateAuthority->getError()); + $this->assertEquals(0, $certificateAuthority->errors); } /** @test */ @@ -20,7 +20,7 @@ public function it_can_return_an_error() { $certificateAuthority = new CertificateAuthorityCreator("fake/path"); - $this->assertEquals(2, $certificateAuthority->getError()); + $this->assertEquals(2, $certificateAuthority->errors); } /** @test */ @@ -28,7 +28,7 @@ public function it_can_return_array_of_output() { $certificateAuthority = new CertificateAuthorityCreator($this->path); - $this->assertEquals(0, count($certificateAuthority->getOutput())); + $this->assertEquals(0, count($certificateAuthority->output)); } } \ No newline at end of file diff --git a/tests/CertificateKeyCreatorTest.php b/tests/CertificateKeyCreatorTest.php index dc278d8..3fec0cc 100644 --- a/tests/CertificateKeyCreatorTest.php +++ b/tests/CertificateKeyCreatorTest.php @@ -9,7 +9,7 @@ public function it_can_generate_a_RSA_2048_key() { $rsa = new CertificateKeyCreator($this->path); - $this->assertEquals(0, $rsa->getError()); + $this->assertEquals(0, $rsa->errors); } /** @test */ @@ -17,7 +17,7 @@ public function it_can_generate_an_error() { $rsa = new CertificateKeyCreator("fake/path"); - $this->assertEquals(2, $rsa->getError()); + $this->assertEquals(2, $rsa->errors); } /** @test */ @@ -25,7 +25,7 @@ public function it_can_ouput_logs() { $rsa = new CertificateKeyCreator($this->path); - $output = count($rsa->getOutput()); + $output = count($rsa->output); $this->assertEquals(0, $output); } diff --git a/tests/FactoryTest.php b/tests/FactoryTest.php index 3213ebb..2f8aa4f 100644 --- a/tests/FactoryTest.php +++ b/tests/FactoryTest.php @@ -24,7 +24,7 @@ public function a_user_can_generate_root_certificate_key() } $this->assertEquals($rootkey, true); - $this->assertEquals($this->factory->keygen($this->path)->getError(), 0); + $this->assertEquals($this->factory->keygen($this->path)->errors, 0); } /** @test */ @@ -46,7 +46,7 @@ public function a_user_can_create_root_certificate_authority() $rootCA = file_exists($this->path.'/csr/root.pem'); $this->assertEquals($rootCA, true); - $this->assertEquals($this->factory->create($this->path)->getError(), 0); + $this->assertEquals($this->factory->create($this->path)->errors, 0); } /** @test */ From 6c380e076557ccbe9eff532ed8073020677d7dd1 Mon Sep 17 00:00:00 2001 From: madeny Date: Sat, 16 Nov 2019 03:36:29 +0000 Subject: [PATCH 14/18] Fix lines occurring --- .../TrustTheRootSSLCertificate.php@SynoResource | Bin 0 -> 741 bytes src/TrustTheRootSSLCertificate.php | 6 ------ 2 files changed, 6 deletions(-) create mode 100644 src/@eaDir/TrustTheRootSSLCertificate.php@SynoResource diff --git a/src/@eaDir/TrustTheRootSSLCertificate.php@SynoResource b/src/@eaDir/TrustTheRootSSLCertificate.php@SynoResource new file mode 100644 index 0000000000000000000000000000000000000000..718eb175901ad5be5eec863526e39a7117fa6e57 GIT binary patch literal 741 zcmZQz6=P>$V!#BvKp|!z-UgLoVPIg~3T1OJFfi2u*#bb!31s&IX$2tW2C@$VX`nm< zP(Kq)Js*(05hw;UgMlB&UJGJ3xVVM^*(ZT)h6YbRe<1rJm>nGH2V~!bu*2$r?1vyW b5CGlD^c2DzC5J%>s3uA50C}T<#(n_+Dyk9} literal 0 HcmV?d00001 diff --git a/src/TrustTheRootSSLCertificate.php b/src/TrustTheRootSSLCertificate.php index 01ba4e9..81bf05f 100644 --- a/src/TrustTheRootSSLCertificate.php +++ b/src/TrustTheRootSSLCertificate.php @@ -10,14 +10,8 @@ class TrustTheRootSSLCertificate{ function __construct($path, $checker, $option) { - // if (strpos($checker, "Darwin") !== false) { exec("sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain {$path}/csr/root.pem 2>>{$path}/logs/log", $output, $error); $this->error = $error; - - // }else{ - // return $this->error = 1; - // } - } public function getError() From 740e40defe3582744a40485f186ed906c60b8070 Mon Sep 17 00:00:00 2001 From: madeny Date: Sat, 16 Nov 2019 03:44:00 +0000 Subject: [PATCH 15/18] Fist test on php 7.3 --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index c79578d..1201dd6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,7 @@ addons: php: - 7.1 - 7.2 + - 7.3 - nightly env: global: From 8120fa0ce6aafe47675a0505196366282bfd5b61 Mon Sep 17 00:00:00 2001 From: madeny Date: Sat, 16 Nov 2019 15:48:05 +0000 Subject: [PATCH 16/18] =?UTF-8?q?=EF=A3=BF=2010=20quick=20fix|updates...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LICENSE | 0 README.md | 0 cert/@eaDir/README.md@SynoResource | Bin 741 -> 0 bytes cert/README.md | 1 - composer.json | 0 composer.lock | 0 example.env | 0 lhttps.svg | 0 phpunit.xml | 0 src/Config.php | 8 +++++++- src/Path.php | 5 +++-- src/command/CreatorCommand.php | 9 +++++---- 12 files changed, 15 insertions(+), 8 deletions(-) mode change 100644 => 100755 LICENSE mode change 100644 => 100755 README.md delete mode 100755 cert/@eaDir/README.md@SynoResource delete mode 100644 cert/README.md mode change 100644 => 100755 composer.json mode change 100644 => 100755 composer.lock mode change 100644 => 100755 example.env mode change 100644 => 100755 lhttps.svg mode change 100644 => 100755 phpunit.xml diff --git a/LICENSE b/LICENSE old mode 100644 new mode 100755 diff --git a/README.md b/README.md old mode 100644 new mode 100755 diff --git a/cert/@eaDir/README.md@SynoResource b/cert/@eaDir/README.md@SynoResource deleted file mode 100755 index bb647c06615e86f531857ce2bf8170f553d57645..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 741 zcmZQz6=P>$V!#BvKp|!z-UgLoVPIg~3T1OJFfi2u*#bb!31s&IX$2tW2C@$VX`nm< zP(Kq)Js*(05hw;UgMlB&UJGJ3xVVM^*(ZT)h6YbRe<1rJm>nGH2V~!bu*2$r?1vyW b5CGlD^c2DzC5J%>s3s{VfV|NFB4`Kz3{(-y diff --git a/cert/README.md b/cert/README.md deleted file mode 100644 index cd527f8..0000000 --- a/cert/README.md +++ /dev/null @@ -1 +0,0 @@ -# This is where certificate reside. \ No newline at end of file diff --git a/composer.json b/composer.json old mode 100644 new mode 100755 diff --git a/composer.lock b/composer.lock old mode 100644 new mode 100755 diff --git a/example.env b/example.env old mode 100644 new mode 100755 diff --git a/lhttps.svg b/lhttps.svg old mode 100644 new mode 100755 diff --git a/phpunit.xml b/phpunit.xml old mode 100644 new mode 100755 diff --git a/src/Config.php b/src/Config.php index 41c266d..300a74b 100644 --- a/src/Config.php +++ b/src/Config.php @@ -15,7 +15,12 @@ function __construct() foreach ($folders as $key => $value) { if (file_exists(Path::all()."/".$value)) { - echo "\n ... checking output folders \n"; + echo "Path to your certificates >> ".Path::all()."/live"."\n"; + exec("ls ".Path::all()."/live", $outpout, $error); + foreach ($outpout as $value) { + echo $value."\n"; + } + echo "----------------------- \n"; return; }else { while ($i < 6) { @@ -32,3 +37,4 @@ public static function file($path, $domain) return new Openssl($path, $domain); } } + diff --git a/src/Path.php b/src/Path.php index 1d1dc14..16f1a17 100644 --- a/src/Path.php +++ b/src/Path.php @@ -5,10 +5,11 @@ class Path{ - +// need refactory. public static function all() { - return realpath(__DIR__.'/../cert'); + $path = realpath(__DIR__.'/../cert'); + return $path; } } \ No newline at end of file diff --git a/src/command/CreatorCommand.php b/src/command/CreatorCommand.php index 5b2b5c3..3cba6a6 100644 --- a/src/command/CreatorCommand.php +++ b/src/command/CreatorCommand.php @@ -26,7 +26,8 @@ protected function configure() 'a', null, InputOption::VALUE_NONE, - 'This will add your root certificate on your OS trusted list?' + // 'This will add your root certificate on your OS trusted list?' + 'Config your certificate for trust policy.' ); @@ -74,11 +75,11 @@ protected function execute(InputInterface $input, OutputInterface $output) // Disply error messages. if ( $trust->getError() == 2) { - $output->writeln('Sorry this host not support!'); + $output->writeln('Sorry this host is not support!'); }elseif ($trust->getError() == 1) { - $output->writeln('Fail to add your certificate to trust list you can do it manually'); + $output->writeln('Fail to config your certificate for trust policy. see help for more information'); }elseif ($trust->getError() == 0) { - $output->writeln('Your certificate is added to your trust list'); + $output->writeln('Your certificate is configured'); } } From 5fac6f887dc44aa6bada890bf5268a70451ba439 Mon Sep 17 00:00:00 2001 From: madeny Date: Sat, 16 Nov 2019 15:48:33 +0000 Subject: [PATCH 17/18] =?UTF-8?q?=EF=A3=BF=2010=20quick=20fix|updates...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/@eaDir/Path.php@SynoResource | Bin 0 -> 741 bytes src/@eaDir/bash@SynoResource | Bin 0 -> 741 bytes src/bash/@eaDir/script.sh@SynoResource | Bin 0 -> 741 bytes src/bash/script.sh | 14 ++++++++++++++ 4 files changed, 14 insertions(+) create mode 100644 src/@eaDir/Path.php@SynoResource create mode 100644 src/@eaDir/bash@SynoResource create mode 100755 src/bash/@eaDir/script.sh@SynoResource create mode 100755 src/bash/script.sh diff --git a/src/@eaDir/Path.php@SynoResource b/src/@eaDir/Path.php@SynoResource new file mode 100644 index 0000000000000000000000000000000000000000..718eb175901ad5be5eec863526e39a7117fa6e57 GIT binary patch literal 741 zcmZQz6=P>$V!#BvKp|!z-UgLoVPIg~3T1OJFfi2u*#bb!31s&IX$2tW2C@$VX`nm< zP(Kq)Js*(05hw;UgMlB&UJGJ3xVVM^*(ZT)h6YbRe<1rJm>nGH2V~!bu*2$r?1vyW b5CGlD^c2DzC5J%>s3uA50C}T<#(n_+Dyk9} literal 0 HcmV?d00001 diff --git a/src/@eaDir/bash@SynoResource b/src/@eaDir/bash@SynoResource new file mode 100644 index 0000000000000000000000000000000000000000..d414abf2cd3ff8a80cda4b187d5273218ea39ef2 GIT binary patch literal 741 zcmZQz6=P>$V!#BvKp|!z-UgLoVPIg~3T1OJFfi2u*#bb!31s&IX$2tW2C@$VX`nm< zP(Kq)Js*(05hw;UgMlB&UJGJ3xVVM^*(ZT)h6YbRe<1rJm>nGH2V~!bu*2$r?1vyW b5CGlD^c2DzC5J%>s3slN1$m=^#(n_+IKdJ* literal 0 HcmV?d00001 diff --git a/src/bash/@eaDir/script.sh@SynoResource b/src/bash/@eaDir/script.sh@SynoResource new file mode 100755 index 0000000000000000000000000000000000000000..eac236da595935442d61e337905be40ea446bcb4 GIT binary patch literal 741 zcmZQz6=P>$V!#BvKp|!z-UgLoVPIg~3T1OJFfi2u*#bb!31s&IX$2tW2C@$VX`nm< zP(Kq)Js*(05hw;UgMlB&UJGJ3xVVM^*(ZT)h6YbRe<1rJm>nGH2V~!bu*2$r?1vyW b5CGlD^c2DzC5J%>s3sll19_u?#(n_+Uj`DI literal 0 HcmV?d00001 diff --git a/src/bash/script.sh b/src/bash/script.sh new file mode 100755 index 0000000..3321dc6 --- /dev/null +++ b/src/bash/script.sh @@ -0,0 +1,14 @@ +# !/usr/bin/env bash +# Generate the private key. +openssl genrsa -des3 -passout pass:none -out ../../cert/keys/root.key 2048 2>> ../../cert/logs/log.key; + +# Create root CA from private key. +openssl req -x509 -new -nodes -passin pass:none -key ../../cert/keys/root.key -sha256 -days 1024 -out ../../cert/csr/root.pem -config ../../cert/cnf/openssl.cnf 2>> ../../cert/logs/log.CA; + +# Create domain certificate +openssl req -new -sha256 -nodes -out ../../cert/csr/byrun.csr -newkey rsa:2048 -keyout ../../cert/live/byrun.ssl.key -config ../../cert/cnf/openssl.cnf 2>> ../../cert/logs/log.domain + +# Certificate sign request +openssl x509 -req -in ../../cert/csr/byrun.csr -CA ../../cert/csr/root.pem -CAkey ../../cert/keys/root.key -CAcreateserial -out ../../cert/live/byrun.ssl.crt -days 500 -sha256 -extfile ../../cert/cnf/v3.ext -passin pass:none 2>>../../cert/logs/log.sign + + From 7f9c0101ea8ad9f4a894d71b643018dd2573c986 Mon Sep 17 00:00:00 2001 From: madeny Date: Sat, 16 Nov 2019 15:49:25 +0000 Subject: [PATCH 18/18] =?UTF-8?q?=EF=A3=BF=2010=20quick=20fix|updates...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cert/readme.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 cert/readme.md diff --git a/cert/readme.md b/cert/readme.md new file mode 100644 index 0000000..e69de29