admiracloud / admiracloud/narnia

Properly handling staging and production certificates

Offen
#2 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
bug good first issue help wanted
Vorherrschende Sprache
JavaScript
Sterne
0
Forks
0
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

When using the `--staging` flag in the command `narnia ssl vistaviva.com.br --generate --staging`, the `narnia` library seems to forget about the staging scenario and it wrongly saves the certificates and updates the Nginx configuration for the informed domain.

But what it should do instead is to not update Nginx config for the informed domain, nor it should save the certificates. If it needs to save the certificates because of possible needs like verification of the generated certs, it still should erase such certificates before concluding the staging test.

The problem becomes evident when we try to execute `narnia ssl vistaviva.com.br --generate` after a successful `narnia ssl vistaviva.com.br --generate --staging`, as per the following output:

```
root@independent ~ # narnia ssl vistaviva.com.br --generate --staging
Successfully generated certificate for vistaviva.com.br
root@independent ~ # narnia ssl vistaviva.com.br --generate
Certificate for vistaviva.com.br still valid for 89 days
```

When the user asks for a "production" certificate, it wrongly considers the staging certificate files as production ones and inform that `Certificate for vistaviva.com.br still valid for 89 days`.

Initially, I see two possible solutions:

- first solution: when asking for a production certificate, try to identify if the existing one is a "staging" one
- second solution: completely erase the staging certificate after successfully generating it, and do not update Nginx configuration for the specified domain I cordially ask for your help on this issue.

I'm inclined more towards the second one.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.