Giter Club home page Giter Club logo

Comments (5)

rarkins avatar rarkins commented on May 18, 2024

I quite like option 3 because it means one less manual step using the GitHub web interface. i.e. user only needs to generate access token for designated bot account and not also mess with SSH keys if they're not familiar with them.

This would work well for most environments, e.g. the script could look for ~/.ssh/id_rsa.pub` and upload that via GitHub API the first run.

We could perhaps make it fail gracefully or with non-error warning message if the user doesn't want to grant key read/write permissions for the API. In a way then option 1 would be backwards compatible with option 3.

AWS lambda doesn't have the concept of a full user directory with .ssh directory, but it could pull the key pair from a secure S3 prior to run.

from renovate.

rarkins avatar rarkins commented on May 18, 2024

Conclusion:

  1. Assume we will use ~/.ssh/id_rsa for now and users will manually add that public key to GitHub
  2. Add functionality later to attempt adding public key automatically using API

Leaving this issue open for part 2

from renovate.

rarkins avatar rarkins commented on May 18, 2024

I realised a problem just now. I was attempting to add my public key (id_rsa.pub) to a bot account I'd set up, but GitHub gives me this error message:
image

i.e. public keys are used to identify GitHub users, so you can't add it to more than one GitHub account.

This makes me more inclined to generate a custom key pair just for this tool/bot, to avoid any such conflict.

from renovate.

rarkins avatar rarkins commented on May 18, 2024

In theory it would be possible to generate a temporary key pair every run, then add it to the GitHub account, then remove it at the end.

One problem of course would be if the program crashes and doesn't remove the key, but GitHub's API lets you give a "title" to each key so we could name it renovate for example and have a first step that deletes it if found.

A second problem might be latency - e.g. does it work instantly once you add it via API, or is there a delay until it's active? This needs to be tested as it would be a problem for the first run of the script regardless.

from renovate.

rarkins avatar rarkins commented on May 18, 2024

In that case, the logic would be approximately:

  1. Delete "renovate" key if exists
  2. Generate temporary key pair
  3. Add temporary public key via GitHub API, with title "renovate"
  4. [Rest of script]
  5. Delete renovate key

from renovate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.