stackdot / NodeJS-Git-Server

A multi-tenant git server using NodeJS
387 stars 103 forks source link

Adding a user after starting git-server #22

Open spideynn opened 9 years ago

spideynn commented 9 years ago

Is it possible to add a git user after the server is started?

GOYUSO commented 8 years ago

I have the same problem.

jsdario commented 8 years ago

+1 same here

xpepermint commented 7 years ago

+1

jsdario commented 7 years ago

Hi, some time ago a colleague and I started a fork of this repo allowing users to be created on demand:

https://github.com/netbeast/gitbox

It has also more features and part of the code was refactored.

TobiasNickel commented 7 years ago

when you use a file like the example, I think you can just push new users to the array:

repoOne = {
  name: 'stackdot',
  anonRead: false,
  users: [
    {
      user: {
        username: 'demo',
        password: 'demo'
      },
      permissions: ['R', 'W']
    }
  ]
};

setTimeout(function(){
    repoOne.users.push({
      user: {
        username: 'demo',
        password: 'demo'
      },
      permissions: ['R', 'W']
    });
})

instat of the timeout you could watch a file, listen on redis or what ever. inside the event you could manage the array. You can not replace the array. but you can reve all users and add completely new.