]> Raphaël G. Git Repositories - acme/commitdiff
Add man page documentation
authorRaphaël Gertz <git@rapsys.eu>
Wed, 5 Apr 2017 20:23:51 +0000 (22:23 +0200)
committerRaphaël Gertz <git@rapsys.eu>
Wed, 5 Apr 2017 20:23:51 +0000 (22:23 +0200)
Fix package name
Rename to acme prefixed command name
Email change

Acme.pm
acmecert [moved from letscert with 92% similarity]
acmecert.1 [new file with mode: 0644]
acmeconf [moved from letsconf with 94% similarity]
acmeconf.1 [new file with mode: 0644]
acmecron [moved from letscron with 87% similarity]
acmecron.1 [new file with mode: 0644]

diff --git a/Acme.pm b/Acme.pm
index bff7defc82c0d0252a627f824623b90dcc4bcac8..2ce7e0346d4ff7a9a67a872335616b7ffc3a5861 100644 (file)
--- a/Acme.pm
+++ b/Acme.pm
@@ -15,8 +15,8 @@
 #
 # Copyright (C) 2016 - 2017 Raphaël Gertz <acmepl@rapsys.eu>
 
 #
 # Copyright (C) 2016 - 2017 Raphaël Gertz <acmepl@rapsys.eu>
 
-# acme package
-package acme;
+# Acme package
+package Acme;
 
 # Best practice
 use strict;
 
 # Best practice
 use strict;
similarity index 92%
rename from letscert
rename to acmecert
index 7c843c6e123bff50614dd3b1e375423be7f0a1e5..f8694cbf7d0eb5562897b36f77b4a60b8649ee5a 100755 (executable)
--- a/letscert
+++ b/acmecert
@@ -13,7 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
-# Copyright (C) 2016 - 2017 Raphaël Gertz <acmepl@rapsys.eu>
+# Copyright (C) 2016 - 2017 Raphaël Gertz <acme@rapsys.eu>
 
 # Best practice
 use strict;
 
 # Best practice
 use strict;
@@ -44,7 +44,7 @@ if (scalar(@ARGV) < 2) {
 }
 
 # Create new object
 }
 
 # Create new object
-my $acme = acme->new(shift @ARGV, $debug, $prod, @ARGV);
+my $acme = Acme->new(shift @ARGV, $debug, $prod, @ARGV);
 
 # Prepare environement
 $acme->prepare();
 
 # Prepare environement
 $acme->prepare();
diff --git a/acmecert.1 b/acmecert.1
new file mode 100644 (file)
index 0000000..cbacb9b
--- /dev/null
@@ -0,0 +1,31 @@
+.\" Manpage for acmecert.
+.\" Contact acme@rapsys.eu to correct errors or typos.
+.TH man 1 "05 Apr 2017" "0.7" "acmecert man page"
+.SH NAME
+acmecert \- generate a single certificate
+.SH SYNOPSIS
+acmecert [-(r|-redhat|d|-debian)] [example.com[,www.example.com,...]] [...]
+.SH DESCRIPTION
+acmecert is a basic script generating a single certificate based on parameters.
+.SH OPTIONS
+The acmecert takes options.
+
+Use -d for debug directive.
+
+Use -p for production mode.
+
+These directives require to be followed by an email address and the domain and alternative domain list.
+.SH EXAMPLE 1
+.TP
+.B acmecert -d webmaster@example.com example.com www.example.com ssl.example.com
+will generate a certificate for example.com with www.example.com and ssl.example.com alternatives domains with debug mode active.
+.SH EXAMPLE 2
+.TP
+.B acmecert -p webmaster@example.com example.com www.example.com ssl.example.com
+will generate a certificate for example.com with www.example.com and ssl.example.com alternatives domains with production mode active.
+.SH SEE ALSO
+acmecron(1),acmecert(1)
+.SH BUGS
+No known bugs.
+.SH AUTHOR
+Raphaël Gertz (rapsys) <acme@rapsys.eu>
similarity index 94%
rename from letsconf
rename to acmeconf
index cc0f0774c32436220c1cc7a74ad7b8c979a2f953..c5b9134e382e8088282101c135806263484c7a24 100755 (executable)
--- a/letsconf
+++ b/acmeconf
@@ -13,7 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
-# Copyright (C) 2016 - 2017 Raphaël Gertz <acmepl@rapsys.eu>
+# Copyright (C) 2016 - 2017 Raphaël Gertz <acme@rapsys.eu>
 
 # Best practice
 use strict;
 
 # Best practice
 use strict;
@@ -26,9 +26,6 @@ use Tie::IxHash;
 # Load POSIX
 use POSIX qw(EXIT_SUCCESS EXIT_FAILURE);
 
 # Load POSIX
 use POSIX qw(EXIT_SUCCESS EXIT_FAILURE);
 
-# XXX: Debug
-use Data::Dumper;
-
 # Init redhat
 my @redhat = ();
 
 # Init redhat
 my @redhat = ();
 
@@ -91,6 +88,9 @@ for my $key (@redhat) {
                # Private key
                #XXX: required
                key => '/etc/pki/tls/private/'.$domain.'.pem',
                # Private key
                #XXX: required
                key => '/etc/pki/tls/private/'.$domain.'.pem',
+               # Private account key
+               #XXX: required
+               account => '/etc/acme/account.pem',
                # Mail address
                #XXX: required
                mail => 'webmaster@'.$domain,
                # Mail address
                #XXX: required
                mail => 'webmaster@'.$domain,
@@ -118,6 +118,9 @@ for my $key (@debian) {
                # Private key
                #XXX: required
                key => '/etc/ssl/private/'.$domain.'.key',
                # Private key
                #XXX: required
                key => '/etc/ssl/private/'.$domain.'.key',
+               # Private account key
+               #XXX: required
+               account => '/etc/acme/account.pem',
                # Mail address
                #XXX: required
                mail => 'webmaster@'.$domain,
                # Mail address
                #XXX: required
                mail => 'webmaster@'.$domain,
diff --git a/acmeconf.1 b/acmeconf.1
new file mode 100644 (file)
index 0000000..4fdc92a
--- /dev/null
@@ -0,0 +1,31 @@
+.\" Manpage for acmeconf.
+.\" Contact acme@rapsys.eu to correct errors or typos.
+.TH man 1 "05 Apr 2017" "0.7" "acmeconf man page"
+.SH NAME
+acmeconf \- create a new configuration template
+.SH SYNOPSIS
+acmeconf [-(r|-redhat|d|-debian)] [example.com[,www.example.com,...]] [...]
+.SH DESCRIPTION
+acmeconf is a basic script generating a template configuration for generating letsencrypt certificate.
+.SH OPTIONS
+The acmeconf takes options.
+
+Use -r or --redhat directive for a distribution using redhat certificate path (/etc/pki/tls).
+
+Use -d or --debian for a distribution using debian like certificate base path (/etc/ssl).
+
+These directives can be followed by domain and alternative(s) domain(s) list each separated by a coma, the first one of the list will be used as principal domain name.
+.SH EXAMPLE 1
+.TP
+.B acmeconf -r example.com,www.example.com,ssl.example.com > /etc/acme/config
+will generate redhat like template configuration file for example.com as principal domain and www.example.com with ssl.example.com as alternatives domains.
+.SH EXAMPLE 2
+.TP
+.B acmeconf -r example.com,www.example.com -r webmail.example.com,imap.example.com,smtp.example.com | sudo tee /etc/acme/config
+will generate redhat like template configuration file for example.com as principal domain and www.example.com with ssl.example.com as alternatives domains and an other one for the mail.example.com domain with example.com and smtp.example.com as alternatives domain.
+.SH SEE ALSO
+acmecron(1),acmecert(1)
+.SH BUGS
+No known bugs.
+.SH AUTHOR
+Raphaël Gertz (rapsys) <acme@rapsys.eu>
similarity index 87%
rename from letscron
rename to acmecron
index 9a9635503422d0efa381415f2e9f7c5a09f35281..0ffeaad1e02da368ccbdc1869152bc78355b1311 100755 (executable)
--- a/letscron
+++ b/acmecron
@@ -13,7 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
-# Copyright (C) 2016 - 2017 Raphaël Gertz <acmepl@rapsys.eu>
+# Copyright (C) 2016 - 2017 Raphaël Gertz <acme@rapsys.eu>
 
 # Best practice
 use strict;
 
 # Best practice
 use strict;
@@ -31,7 +31,7 @@ use File::Spec;
 use File::Slurp qw(read_file write_file);
 use JSON qw(decode_json);
 use IPC::System::Simple qw(capturex $EXITVAL);
 use File::Slurp qw(read_file write_file);
 use JSON qw(decode_json);
 use IPC::System::Simple qw(capturex $EXITVAL);
-use Acme qw(CERT_DIR CONFIG DS KEY_DIR SERVER_CRT SERVER_KEY);
+use Acme qw(CERT_DIR CONFIG DS KEY_DIR SERVER_CRT SERVER_KEY ACCOUNT_KEY);
 
 # Load POSIX
 use POSIX qw(strftime EXIT_SUCCESS EXIT_FAILURE);
 
 # Load POSIX
 use POSIX qw(strftime EXIT_SUCCESS EXIT_FAILURE);
@@ -119,6 +119,20 @@ foreach (@{$config->{certificates}}) {
                next;
        }
 
                next;
        }
 
+       # Unlink if is a symlink
+       if (-l KEY_DIR.DS.ACCOUNT_KEY) {
+               unless(unlink(KEY_DIR.DS.ACCOUNT_KEY)) {
+                       carp('unlink '.KEY_DIR.DS.ACCOUNT_KEY.' failed: '.$!);
+                       next;
+               }
+       }
+
+       # Symlink to key
+       unless(symlink($_->{account}, KEY_DIR.DS.ACCOUNT_KEY)) {
+               carp('symlink '.$_->{account}.' to '.KEY_DIR.DS.ACCOUNT_KEY.' failed: '.$!);
+               next;
+       }
+
        # Init args
        my @args = @{$_->{domains}};
 
        # Init args
        my @args = @{$_->{domains}};
 
@@ -135,13 +149,13 @@ foreach (@{$config->{certificates}}) {
                unshift(@args, '-d');
        }
 
                unshift(@args, '-d');
        }
 
-       # Run letscert with args
-       my @out = capturex([0..1], 'letscert', @args);
+       # Run acmecert with args
+       my @out = capturex([0..1], 'acmecert', @args);
 
        # Deal with error
        if ($EXITVAL != 0) {
                print join("\n", @out) if ($debug);
 
        # Deal with error
        if ($EXITVAL != 0) {
                print join("\n", @out) if ($debug);
-               carp('letscert '.join(', ', @args).' failed: '.$!);
+               carp('acmecert '.join(', ', @args).' failed: '.$!);
                next;
        }
 
                next;
        }
 
diff --git a/acmecron.1 b/acmecron.1
new file mode 100644 (file)
index 0000000..f4d36ab
--- /dev/null
@@ -0,0 +1,17 @@
+.\" Manpage for acmecron.
+.\" Contact acme@rapsys.eu to correct errors or typos.
+.TH man 1 "05 Apr 2017" "0.7" "acmecron man page"
+.SH NAME
+acmecron \- generate all certificate listed in configuration file if required
+.SH SYNOPSIS
+acmecron [-d]
+.SH DESCRIPTION
+acmecron is a basic script generating all certificate listed in configuration if not present or older than 60 days. It will run acmecert with right options for every listed certificate if required.
+.SH OPTIONS
+The acmeconf takes one option for enabling debug mode.
+.SH SEE ALSO
+acmeconf(1),acmecert(1)
+.SH BUGS
+No known bugs.
+.SH AUTHOR
+Raphaël Gertz (rapsys) <acme@rapsys.eu>