Добавил инфу по чтению сертификата из nodejs без поломки nginx
This commit is contained in:
parent
7ad3b00c49
commit
eb0c36dd98
1 changed files with 22 additions and 0 deletions
22
two.md
22
two.md
|
|
@ -685,3 +685,25 @@
|
|||
|
||||
Из плюсов: рабочий лагин погоды, компактная шапка в Тунаре, дерево папок в детальном посмотре (как в Nemo)<br>
|
||||
`sudo add-apt-repository ppa:xubuntu-dev/staging`
|
||||
|
||||
|
||||
- ### certbot сгенерировал ключи и сертификаты, но они недоступны из nodejs
|
||||
|
||||
#### отредачить файл судоеров
|
||||
```
|
||||
sudo visudo -f /etc/sudoers.d/chaiman-cert-access
|
||||
```
|
||||
|
||||
Добавить строку
|
||||
```
|
||||
chaiman ALL=(root) NOPASSWD: /usr/bin/cat /etc/letsencrypt/live/4aiman.top/privkey.pem, /usr/bin/cat /etc/letsencrypt/live/4aiman.top/fullchain.pem
|
||||
```
|
||||
|
||||
Это позволит судоеру `chaiman` читать сертификаты без запроса пароля (но всё ещё через sudo)
|
||||
|
||||
А в nodejs сделать что-то такое:
|
||||
```
|
||||
const { execSync } = require('child_process');
|
||||
const privateKey = execSync('sudo -n cat /etc/letsencrypt/live/4aiman.top/privkey.pem', {encoding: 'utf8'});
|
||||
const privateCert = execSync('sudo -n cat /etc/letsencrypt/live/4aiman.top/fullchain.pem', {encoding: 'utf8'});
|
||||
```
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue