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
No related branches found
No related tags found
No related merge requests found
Pipeline #967 passed
......@@ -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
......
......@@ -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)
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment