Self-hosting: encypted npmToken #8655
-
I have create a private and public key as described here: https://docs.renovatebot.com/self-hosted-configuration/#privatekey I have save a copy of https://renovatebot.com/encryp, replaced with my public key and created the base64 encrypted version of my npm token and configured it in renovate.json:
I have added "privateKey" the renovatebot config:
but when I am running renovatebot I am getting:
I have looked at the code https://github.com/renovatebot/renovate/blob/master/lib/config/decrypt.ts and extracted the part responsible for decrypting:
When I run this it works and I get the decrypted string. Any Ideas what I am doing wrong - why is the renovatebot not able to decrypt? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
It would have been super helpful if decrypt.ts did not swallow the "err" here but log it:
then one would have seen that the problem is:
this might bring you here openssl/openssl#8815 which tells you that the javascript `` template syntax in combination with the IDE - which adds spaces before each line - is breaking the private certificate. I fixed it by adding "privateKey" in the renovatebot config as a string in one line like this: privateKey: '-----BEGIN RSA PRIVATE KEY-----\nXXXXXXXXXXXXXXXXX\n-----END RSA PRIVATE KEY-----', XXXXXXXXXXXXXXXXX represents the private key data. The linebreaks after -----BEGIN RSA PRIVATE KEY----- and before -----END RSA PRIVATE KEY----- are important. |
Beta Was this translation helpful? Give feedback.
It would have been super helpful if decrypt.ts did not swallow the "err" here but log it:
then one would have seen that the problem is:
this might bring you here openssl/openssl#8815 which tells you that the javascript `` template syntax in combination with the IDE - which adds spaces before each line - is breaking the private cert…