From 354102070b37bf43793942afe1b6bb5eb1adbf74 Mon Sep 17 00:00:00 2001 From: Massimiliano Adamo <massimiliano.adamo@geant.org> Date: Mon, 12 Apr 2021 23:47:32 +0200 Subject: [PATCH] just a few cosmetic changes --- README.md | 10 +++++----- main.go | 17 +++++++---------- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index c340b79..e24481e 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ acme-downloader --vault-token=<VAULT-TOKEN> --redis-token=<REDIS_TOKEN> \ --cert-name=foo-ev-cert.geant.org --team-name=swd ``` -<span style="text-decoration: underline">If the certificate is being replaced, the tool throws an exit status equal to 64 and you can reload your application.</span> +<span style="text-decoration: underline">If the certificate is being replaced, the tool throws an exit status equal to 64 and you can reload your application in order to use the new certificate.</span> You can check all the options using `--help`: @@ -27,13 +27,13 @@ ACME Downloader: Usage: acme-downloader --redis-token=REDISTOKEN --vault-token=VAULTTOKEN --cert-name=CERTNAME --team-name=TEAMNAME [--days=DAYS] [--type=TYPE] [--cert-destination=CERTDESTINATION] [--fullchain-destination=FULLCHAINDESTINATION] [--key-destination=KEYDESTINATION] [--ca-destination=CADESTINATION] + acme-downloader -h | --help acme-downloader -v | --version acme-downloader -b | --build - acme-downloader -h | --help Options: -h --help Show this screen - -v --version Print version and exit + -v --version Print version information and exit -b --build Print version and build information and exit --redis-token=REDISTOKEN Redis access token --vault-token=VAULTTOKEN Vault access token @@ -45,12 +45,12 @@ Options: --fullchain-destination=FULLCHAINDESTINATION Full Chain Destination[default: /etc/ssl/certs/<cert-name>_fullchain.crt] --key-destination=KEYDESTINATION Key Destination [default: /etc/ssl/private/<cert-name>.key] --ca-destination=CADESTINATION CA Destination [default: /etc/ssl/certs/COMODO_<type>.crt] - --wildcard The certificate type is wildcard``` + --wildcard The certificate type is wildcard ``` ## compatibility -Maybe 43 different platforms but tested only on Linux and Windows. +Maybe 43 different platforms but tested on Linux and Windows only. ## build diff --git a/main.go b/main.go index ad17bad..ae0a4a7 100644 --- a/main.go +++ b/main.go @@ -43,7 +43,6 @@ var ( tmpCaDestination string tmpKeyDestination string certTmpDir string - opensslBinary string key *x509.Certificate cert *x509.Certificate ) @@ -306,12 +305,12 @@ func main() { GroupName = "root" } else if OSRelease == "unknown" { if runtime.GOOS == "windows" { - CertBase = "DRIVE:\\PATH\\TO\\CERTIFICATE" - KeyBase = "DRIVE:\\PATH\\TO\\KEY" + CertBase = "C:\\ACME\\certificates" + KeyBase = "C:\\ACME\\private" GroupName = "root" } else { - CertBase = "/PATH/TO/CERTIFICATE" - KeyBase = "/PATH/TO/PRIV/KEY" + CertBase = "/etc/acme/certs" + KeyBase = "/etc/acme/private" GroupName = "root" } } @@ -327,7 +326,7 @@ Usage: Options: -h --help Show this screen - -v --version Print version and exit + -v --version Print version information and exit -b --build Print version and build information and exit --redis-token=REDISTOKEN Redis access token --vault-token=VAULTTOKEN Vault access token @@ -350,14 +349,12 @@ Options: } if runtime.GOOS == "windows" { - opensslBinary = "openssl.exe" tmpCertificateDestination = "C:\\tmp\\acme-downloader\\cert\\amce_cert.pem" tmpFullchainDestination = "C:\\tmp\\acme-downloader\\cert\\amce_fullchain.pem" tmpCaDestination = "C:\\tmp\\acme-downloader\\cert\\amce_ca.pem" tmpKeyDestination = "C:\\tmp\\acme-downloader\\key\\amce_key.pem" GroupID = 0 // just a fake one } else { - opensslBinary = "openssl" tmpCertificateDestination = "/tmp/acme-downloader/cert/amce_cert.pem" tmpFullchainDestination = "/tmp/acme-downloader/cert/amce_fullchain.pem" tmpCaDestination = "/tmp/acme-downloader/cert/amce_ca.pem" @@ -444,8 +441,8 @@ Options: moveFile(tmpCaDestination, caDestination, GroupID, 0644, 0755) moveFile(tmpKeyDestination, keyDestination, GroupID, 0640, 0750) - // Exit 64: it means that the certificate was replaced - // in this case you can reloaded the application to read the new certificate + // Exit 64: it means that the certificate was replaced and the + // application can be reloaded to make use of the new certificate appExit(64) } -- GitLab