Skip to content
This repository has been archived by the owner on Dec 12, 2020. It is now read-only.

Trying to encrypt npmrc which is too long according to https://app.renovatebot.com/encrypt #737

Closed
paazmaya opened this issue Jul 3, 2020 · 6 comments

Comments

@paazmaya
Copy link

paazmaya commented Jul 3, 2020

Which Renovate are you using?

WhiteSource Renovate App

Which platform are you using?

GitHub Enterprise

Have you checked the logs? Don't forget to include them if relevant

No access to them

What would you like to do?

Increase the maximum input size for the encryption tool.

The npmrc in question looks something like this, the tokens are not included:

@finnair:registry=https://nexus.development.tool.clouds.finnair.com/nexus/repository/npm/
@fcom:registry=https://nexus.development.tool.clouds.finnair.com/nexus/repository/npm/
@finnairoyj:registry=https://npm.pkg.github.com
always-auth=true
//npm.pkg.github.com/:_authToken=......
//nexus.development.tool.clouds.finnair.com/nexus/repository/npm/:_auth=.....
email=needs-to-be-included-here@finnair.com
@rarkins
Copy link
Collaborator

rarkins commented Jul 3, 2020

Unfortunately this may be a use case we don't have a solution for just yet. Normally you could configure just an encrypted npmToken with an unencrypted npmrc however I notice that you have two tokens, so a single token wouldn't work.

@viceice
Copy link
Member

viceice commented Jul 3, 2020

for the _authToken lines he can use hostRules

{
  "hostType": "npm",
  "baseUrl": "npm.pkg.github.com",
  "encrypted": { "token": "...." }
}

@rarkins
Copy link
Collaborator

rarkins commented Jul 3, 2020

I note there's both _authToken= and _auth usage there and I think we support _authToken only right now

@viceice
Copy link
Member

viceice commented Jul 3, 2020

Nope, for the auth part (if only one of them) he can use the encryped npmToken.

{
  "encrypted": {
    "npmToken": "XXXXXXXXXX=="
  },
  "npmrc": "@finnair:registry=https://nexus.development.tool.clouds.finnair.com/nexus/repository/npm/\n//nexus.development.tool.clouds.finnair.com/nexus/repository/npm:_auth=${NPM_TOKEN}",
  "hostRules": [
    {
      "hostType": "npm",
      "baseUrl": "npm.pkg.github.com",
      "encrypted": { "token": "YYYYYYY==" }
    }
  ]
}

⬆️ need to add all registries

@stale
Copy link

stale bot commented Jul 6, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed soon if no further activity occurs.

@stale stale bot added the pending-closure label Jul 6, 2020
@paazmaya
Copy link
Author

paazmaya commented Jul 6, 2020

Thank you for the help, I got the authentication with several registries sorted out!
Little did I realise how powerful could https://docs.renovatebot.com/configuration-options/#hostrules be...

@paazmaya paazmaya closed this as completed Jul 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants