Node-RED Project Support for Private GitHub Repos

The Node-RED Projects feature doesn't seem to support private GitHub repos - or I'm just not figuring out how to make it work. I did see this thread but it appears to have been closed without an obvious resolution.

In my case, if I used the Projects feature with a public repo, everything works fine. If I switch the repo over to being private, the Push button doesn't appear to do anything (i.e., I click the Push button and nothing gets pushed but no visible error message). If I attempt to view the remote branches, I get the following error message:

If I switch the repo back to public, then everything starts working just fine again.

I am using a Personal Access Token to get access to the repo. If it makes any difference, I am running Node-RED on a Raspberry Pi 4 running Raspbian.

Are private repos supported and, if so, how do I configure everything properly for it to work? If they are not supported, is this on a backlog somewhere (just curious)?

--- Jeff

Hi @jbramwell

I'm pretty sure I tested with private repos when I developed the projects feature originally and I don't recall any particular extra configuration needed for them.

That said, I can't claim to have tested every possible configuration option. I suspect I'm more likely to have spent my time testing with ssh keys rather than http auth access. There are lots of edge cases through-out the authentication code.

I'll do some testing to see if I can get it working.

@knolleary Thanks! I appreciate it. Please let me know if I can provide any further details.

Aren't git in the process of turning off http access (according to an email I got the other day) ? Maybe they started with private repos first ?

1 Like

Not as far I know. They are removing the ability to use your account's password with the api over http. You have to create and use an access token instead.

1 Like

Yeah, I'm using an access token to make this work (for public repos). I created an SSH key in Git but not sure where/how to make use of that in Node-RED. At one point, there was a text field I was able to paste the SSH key into but I can't seem to find where that was. If SSH keys work for private repos, I'm happy to make use of one... I just don't know how :slight_smile:

Personal access tokens take the place of your password when doing http access. They aren't used for ssh access - you use your keys for that and there shouldn't be any difference between public and private.

Yes, I understand what the two are used for (and that they are not the same). Based on what I've seen/read, I was of the understanding that Node-RED Projects supported the use of SSH keys instead of a password/token. If this were the case (i.e. SSH keys could be used by Node-RED Projects) then I was simply stating I'd be willing to try that instead of a token in case the underlying implementation worked differently. Based on your response, I am assuming SSH keys can't be used by Node-RED Projects and I simply misunderstood something along the way.

Yes you can use ssh keys.

OK, so it took me a while to figure out the intricacies of setting up SSH keys, updating the known_hosts file, etc. but... once I did get it all figured out, Node-RED Projects can Push to a private repo without any issue. So it appears to only be an issue with using an access token for HTTPS credentials (for private repos).

Since you've nudged me in the direction of using SSH keys, I suppose I have no reason to continue down my previous path of using an access token so I am good to go! That said, there might be others that run into this in the future so it might be worth figuring out why it doesn't work for private repos?

Regardless, THANKS for the help! I really appreciate it.

Hello, since you've gone through this process, would you mind briefly outlining the process? Or point us towards helpful materials that let you accomplish this?

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.