Peertube: OpenSSL missing in production Dockerfile

Created on 27 Jan 2020  路  2Comments  路  Source: Chocobozzz/PeerTube

What happened?
I used the buster Dockerfile from support/docker/production/ and built the image to run a instance. This went well so far, but only after having spent some effort setting things up I noticed that no RSA key pairs were generated during the initialization of the instance.
I did not see any warnings in the UI that something was wrong, only in the logs, I later discovered that some interactions threw errors concerning them missing keys.

I did not find a way to add the keys after the initialization and didn't wanted to start over, so I dug around and was able to create the keys with openssl and put them manually into the database, which seems to work so far.

What do you expect to happen instead?
The Dockerfile should have included the openssl package in the apt install part. After adding openssl to the docker image I was successful in creating a test instance where the key were generated as intended.

Additionally I would have expected the "Configure your Instance"-welcome screen to warn that something isn't right, as the simplest way to fix it is probably to re-initialize with openssl installed. (which isn't fun when you allready started using the instance)

It may be possible, that I missed something by not using docker-compose, since my target platform was Kubernetes.

But for those ending up in the same situation,.. the key can be generated with:

openssl genrsa -out private1.pem 2048
openssl rsa -in private1.pem -outform PEM -pubout -out public1.pem

..and added to the db with something like:

UPDATE actor SET "privateKey"=E'-----BEGIN RSA PRIVATE KEY-----\nMIIEpAIBAA...'  WHERE id=1;

Steps to reproduce:

  1. docker build -t peertube . -f ./support/docker/production/Dockerfile.buster

Additional information
Log of the failed Key generation:

[test.local:80] 2020-01-27 09:21:06.779 error: Cannot set public/private keys of actor NaN. {
  "err": {
    "stack": "Error: Could not find openssl on your system on this path: openssl\n    at /app/node_modules/pem/lib/openssl.js:237:23\n    at F (/app/node_modules/which/which.js:68:16)\n    at E (/app/node_modules/which/which.js:80:29)\n    at /app/node_modules/which/which.js:89:16\n    at /app/node_modules/isexe/index.js:42:5\n    at /app/node_modules/isexe/mode.js:8:5\n    at FSReqWrap.oncomplete (fs.js:153:21)",
    "message": "Could not find openssl on your system on this path: openssl"
  }
}
[test.local:80] 2020-01-27 09:21:06.780 error: Cannot set public/private keys of actor NaN. {
  "err": {
    "stack": "Error: Could not find openssl on your system on this path: openssl\n    at /app/node_modules/pem/lib/openssl.js:237:23\n    at F (/app/node_modules/which/which.js:68:16)\n    at E (/app/node_modules/which/which.js:80:29)\n    at /app/node_modules/which/which.js:89:16\n    at /app/node_modules/isexe/index.js:42:5\n    at /app/node_modules/isexe/mode.js:8:5\n    at FSReqWrap.oncomplete (fs.js:153:21)",
    "message": "Could not find openssl on your system on this path: openssl"
  }
}

Component Type

All 2 comments

FYI I rebuilt the image and pushed it on docker cloud/hub.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zilti picture zilti  路  3Comments

Angedestenebres picture Angedestenebres  路  3Comments

roipoussiere picture roipoussiere  路  3Comments

gegeweb picture gegeweb  路  3Comments

JohnXLivingston picture JohnXLivingston  路  3Comments