Skip to content
Snippets Groups Projects
Unverified Commit 35410207 authored by Massimiliano Adamo's avatar Massimiliano Adamo
Browse files

just a few cosmetic changes

parent 9cc630e9
Branches
Tags
No related merge requests found
Pipeline #967 passed
...@@ -17,7 +17,7 @@ acme-downloader --vault-token=<VAULT-TOKEN> --redis-token=<REDIS_TOKEN> \ ...@@ -17,7 +17,7 @@ acme-downloader --vault-token=<VAULT-TOKEN> --redis-token=<REDIS_TOKEN> \
--cert-name=foo-ev-cert.geant.org --team-name=swd --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`: You can check all the options using `--help`:
...@@ -27,13 +27,13 @@ ACME Downloader: ...@@ -27,13 +27,13 @@ ACME Downloader:
Usage: 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 --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 -v | --version
acme-downloader -b | --build acme-downloader -b | --build
acme-downloader -h | --help
Options: Options:
-h --help Show this screen -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 -b --build Print version and build information and exit
--redis-token=REDISTOKEN Redis access token --redis-token=REDISTOKEN Redis access token
--vault-token=VAULTTOKEN Vault access token --vault-token=VAULTTOKEN Vault access token
...@@ -45,12 +45,12 @@ Options: ...@@ -45,12 +45,12 @@ Options:
--fullchain-destination=FULLCHAINDESTINATION Full Chain Destination[default: /etc/ssl/certs/<cert-name>_fullchain.crt] --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] --key-destination=KEYDESTINATION Key Destination [default: /etc/ssl/private/<cert-name>.key]
--ca-destination=CADESTINATION CA Destination [default: /etc/ssl/certs/COMODO_<type>.crt] --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 ## compatibility
Maybe 43 different platforms but tested only on Linux and Windows. Maybe 43 different platforms but tested on Linux and Windows only.
## build ## build
......
...@@ -43,7 +43,6 @@ var ( ...@@ -43,7 +43,6 @@ var (
tmpCaDestination string tmpCaDestination string
tmpKeyDestination string tmpKeyDestination string
certTmpDir string certTmpDir string
opensslBinary string
key *x509.Certificate key *x509.Certificate
cert *x509.Certificate cert *x509.Certificate
) )
...@@ -306,12 +305,12 @@ func main() { ...@@ -306,12 +305,12 @@ func main() {
GroupName = "root" GroupName = "root"
} else if OSRelease == "unknown" { } else if OSRelease == "unknown" {
if runtime.GOOS == "windows" { if runtime.GOOS == "windows" {
CertBase = "DRIVE:\\PATH\\TO\\CERTIFICATE" CertBase = "C:\\ACME\\certificates"
KeyBase = "DRIVE:\\PATH\\TO\\KEY" KeyBase = "C:\\ACME\\private"
GroupName = "root" GroupName = "root"
} else { } else {
CertBase = "/PATH/TO/CERTIFICATE" CertBase = "/etc/acme/certs"
KeyBase = "/PATH/TO/PRIV/KEY" KeyBase = "/etc/acme/private"
GroupName = "root" GroupName = "root"
} }
} }
...@@ -327,7 +326,7 @@ Usage: ...@@ -327,7 +326,7 @@ Usage:
Options: Options:
-h --help Show this screen -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 -b --build Print version and build information and exit
--redis-token=REDISTOKEN Redis access token --redis-token=REDISTOKEN Redis access token
--vault-token=VAULTTOKEN Vault access token --vault-token=VAULTTOKEN Vault access token
...@@ -350,14 +349,12 @@ Options: ...@@ -350,14 +349,12 @@ Options:
} }
if runtime.GOOS == "windows" { if runtime.GOOS == "windows" {
opensslBinary = "openssl.exe"
tmpCertificateDestination = "C:\\tmp\\acme-downloader\\cert\\amce_cert.pem" tmpCertificateDestination = "C:\\tmp\\acme-downloader\\cert\\amce_cert.pem"
tmpFullchainDestination = "C:\\tmp\\acme-downloader\\cert\\amce_fullchain.pem" tmpFullchainDestination = "C:\\tmp\\acme-downloader\\cert\\amce_fullchain.pem"
tmpCaDestination = "C:\\tmp\\acme-downloader\\cert\\amce_ca.pem" tmpCaDestination = "C:\\tmp\\acme-downloader\\cert\\amce_ca.pem"
tmpKeyDestination = "C:\\tmp\\acme-downloader\\key\\amce_key.pem" tmpKeyDestination = "C:\\tmp\\acme-downloader\\key\\amce_key.pem"
GroupID = 0 // just a fake one GroupID = 0 // just a fake one
} else { } else {
opensslBinary = "openssl"
tmpCertificateDestination = "/tmp/acme-downloader/cert/amce_cert.pem" tmpCertificateDestination = "/tmp/acme-downloader/cert/amce_cert.pem"
tmpFullchainDestination = "/tmp/acme-downloader/cert/amce_fullchain.pem" tmpFullchainDestination = "/tmp/acme-downloader/cert/amce_fullchain.pem"
tmpCaDestination = "/tmp/acme-downloader/cert/amce_ca.pem" tmpCaDestination = "/tmp/acme-downloader/cert/amce_ca.pem"
...@@ -444,8 +441,8 @@ Options: ...@@ -444,8 +441,8 @@ Options:
moveFile(tmpCaDestination, caDestination, GroupID, 0644, 0755) moveFile(tmpCaDestination, caDestination, GroupID, 0644, 0755)
moveFile(tmpKeyDestination, keyDestination, GroupID, 0640, 0750) moveFile(tmpKeyDestination, keyDestination, GroupID, 0640, 0750)
// Exit 64: it means that the certificate was replaced // Exit 64: it means that the certificate was replaced and the
// in this case you can reloaded the application to read the new certificate // application can be reloaded to make use of the new certificate
appExit(64) appExit(64)
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment