admiracloud / admiracloud/narnia
Properly handling staging and production certificates
- Linguagem predominante
- JavaScript
- Estrelas
- 0
- Forks
- 0
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Descrição
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.
Guia de contribuição
Nenhum guia de contribuição indexado para este repositório
Direção de pesquisa
Reproduce the issue with `narnia ssl vistaviva.com.br --generate --staging`, then trace the SSL generation flow from the CLI entry point through certificate persistence and Nginx configuration updates. Verify that staging leaves no production certificate or Nginx changes, and that a subsequent production command generates or recognizes the correct production certificate.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- javascript, nginx
- Domínio
- cli, devops, security
- Tipo de issue
- Bug
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Status de atividade
- Estagnada
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 45/100