stackdot / nodejs-git-server Goto Github PK
View Code? Open in Web Editor NEWA multi-tenant git server using NodeJS
A multi-tenant git server using NodeJS
Hi,
Can you kindly provide an example on how we can push the uncommitted changes from my local git repo to the remote repo created by ?
Can I push to "master" branch?What should be origin here?
"http://127.0.0.1:7000/myrepo.git/" -- This origin doesn't work...
Kindly help.
Thanks in advance.
Subhobrata
After my PR, I think, that it`s ok to publish this module to npm.
Hi, thank you for the lib, but I have a question.
I have got the project and run the example.js by nodejs.
And then what I should do ? I don't know in where to create the repo, I tried to create a dir: NodeJS-Git-Server/tmp/repos/stackdot and use the 'git init' to create .git
Then, I'm clone http://localhost:7000/stackdot.git, The vaily of name and pass is ok. When I add->commit->push file, the server log can print in console.
But,the dir NodeJS-Git-Server/tmp/repos/stackdot has none.
So, I hope know what should I do to build a git system...
Excuse me, I'm a new comer, the technology and english is bad...
Thank you very much !
I know that it is because the port I have chosen is already busy, but it would be wonderful make git-server smart and try to kill the connection to re-start the instance.
Thanks in advance!
Hello, thank you so much for the amazing repo.
I understand that in your implementation, you use git-upload-pack
and git-receive-pack
processes to allow the client and server to talk to each other (figure out what packets the other needs, etc.)
To my knowledge, this git command accepts a local directory, but what if I host all my bare git repositories on a separate server, like an AWS S3 bucket? Could I stream a remote bare repo to these git commands, that then stream the necessary packets to the client?
I don't want to host all my bare git repos on my heroku instance, since the storage is ephemeral and limited. Any guidance would be appreciated!
hay, Give some Readme for better starting.......
Do we need to continue to develop on CoffeeScript? Because developing on plain Javascript is much faster.
I followed instruction on web site.
I got error when I tried to use git clone http://localhost:7000/myrepo.git
the server show log as following:
events.js:72
throw er; // Unhandled 'error' event
^
Error: spawn ENOENT
at errnoException (child_process.js:980:11)
at Process.ChildProcess._handle.onexit (child_process.js:771:34)
I run it on windows 7
I have inspected through the source code but couldn't find a prove
Is it possible to add a git user after the server is started?
Is there any way to read file , commit info etc from git server ?
This command
npm install git-server
Throws this error
npm ERR! code E404
npm ERR! 404 Not Found - GET https://github.com/substack/socket.io-client/tarball/master
npm ERR! 404
npm ERR! 404 'socket.io-client@https://github.com/substack/socket.io-client/tarball/master' is not in this registry.
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/foo/.npm/_logs/2023-09-14T21_17_01_619Z-debug-0.log
Hello,
I'm trying to create an app where I can create repos on the fly. I"m trying the following approach:
// server.js
var repos = [ ... ]
server = new GitServer(repos);
server.createRepo({
name:'MyNewRepo',
anonRead:false,
users: [
{ user:newUser, permissions:['R','W'] }
]
}, function(err, repo) {
console.log(err, repo);
})
When I run node server.js
I get an error message:
{ [Error: ENOENT, open '/tmp/repos/MyNewRepo.git/hooks/.git-emit.port']
errno: -2,
code: 'ENOENT',
path: '/tmp/repos/MyNewRepo.git/hooks/.git-emit.port' } undefined
Am I missing something simple, or does this package not support adding repos on the fly?
filter, reject, some, every, and related functions now expect an error as the first callback argument, rather than just a simple boolean. Pass null as the first argument, or use fs.access instead of fs.exists. (#118, #774, #1028, #1041)
causes
/root/node-distribute/node_modules/git-server/host.js:269
if (results.length > 0) {
^
TypeError: Cannot read property 'length' of null
Hi, thank you very much for posting this project online. It looks immensely helpful.
When i try to make a git push origin master It takes up about 1 hour on upload 5mb...
I don't know why is so slow...
I hope you can help me.
Thank you.
this is an awsome project, would it be nicer with a web gui like github?
i would work on it if community like to and , if some of you want to participate it 'll be awsome!!!
hello, i see this is a very good project, can i know the future enchantment? maybe i could help. i mean like http based API to add users and list etc.
Is it possible to handle authentication manually using this library?
I need to be able to authenticate users with a password hash or key.
is their an active maintainer?
Thank you very much for posting this project online. It looks immensely helpful, and I want to start using it ASAP.
Is there any further documentation beyond what is written, and the commented source code? For example, the docs seem to indicate that you can only create new repos and add users to them. I think this package can do much more but just not sure how to use any of the methods. For example, how do you list existing repos? Would love to learn more.
Thank you.
Hi,
I've been running this module on my dev machine (mac OS) without an issue. But when trying to run it on my windows production machine, I'm running in to problems.
Basically, I've tried this with msysgit (1.9.4) and cygwin (1.8.1.2). With cygwin, I've set the path env variable to the cygwin bin dir, so all necessary executables were available. With msysgit, I've set env paths to msysgit/bin and msysgit/libexec/git-core dirs. The results were always the same.
Also, I've tried versions 0.2.1 and 0.2.0 of this module, with the same results.
Git pull is not an issue, this works great. But as soon as i push, I'm getting this (using longjohn for extended stack trace):
Server:
LOG: Got a PUSH call for myrepo.git
LOG: demo is trying to push on repo: myrepo ...
LOG: demo Successfully did a push on myrepo
D:\node\AppHost2\node_modules\longjohn\dist\long
throw e;
^
Error: read ECONNRESET
at errnoException (net.js:904:11)
at onread (net.js:558:19)
at fireErrorCallbacks (net.js:439:15)
at Socket._destroy (net.js:475:3)
at onread (net.js:558:10)
Client:
Pushing to http://demo:[email protected]:7000/myrepo.git
POST git-receive-pack (658 bytes)
error: RPC failed; result=56, HTTP code = 0
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
Everything up-to-date
I've no clue what to try now. Have you successfully run this module on a windows environment? Do you have any idea?
Counting objects: 3, done.
Delta compression using up to 6 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 715 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To http://demo:demo@localhost:7000/stackdot.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'http://demo:demo@localhost:7000/stackdot.git'
Your app is just what I dream 👍
When a git push is performed, there is a classic log:
Counting objects: 356, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (133/133), done.
Writing objects: 100% (356/356), 46.20 KiB, done.
Total 356 (delta 210), reused 355 (delta 210)
....
* [new branch] master -> master
Can we add some lines to this log?
Thanks!
Any ideas why I'm getting this error when trying to start the server (npm start
) with the following snippet of code?
var GitServer = require('git-server');
var newUser = {
username:'demo',
password:'demo'
}
var newRepo = {
name:'myrepo',
anonRead:false,
users: [
{ user:newUser, permissions:['R','W'] }
]
}
_g = new GitServer([ newRepo ]);
The error
Store.prototype.__proto__ = EventEmitter.prototype;
^
TypeError: Cannot read property 'prototype' of undefined
at Object.<anonymous> (G:\src\web\portal-development\git-wiki\git-wiki-server\git-wiki-server\node_modules\socket.io\lib\store.js:35:42)
at Module._compile (module.js:660:30)
at Object.Module._extensions..js (module.js:671:10)
at Module.load (module.js:573:32)
at tryModuleLoad (module.js:513:12)
at Function.Module._load (module.js:505:3)
at Module.require (module.js:604:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (G:\src\web\portal-development\git-wiki\git-wiki-server\git-wiki-server\node_modules\socket.io\lib\manager.js:14:13)
at Module._compile (module.js:660:30)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `node ./bin/www`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\yaseen\AppData\Roaming\npm-cache\_logs\2018-03-06T18_18_44_411Z-debug.log
You need to add Travis build system, because I can`t do that due to not owning this repo. If you will need help adding it - ask me :)
It seems the server claims success right away and doesn't care about any further data sent.
Git log (german):
$ git push [remote]
[...]
Username for 'http://[server]:[port]': [user]
Password for 'http://[user]@[server]:[port]':
Zähle Objekte: 36652, Fertig.
Delta compression using up to 4 threads.
Komprimiere Objekte: 100% (12361/12361), Fertig.
Schreibe Objekte: 100% (36652/36652), 6.87 MiB | 65.00 KiB/s, Fertig.
Total 36652 (delta 23074), reused 36314 (delta 22736)
error: RPC failed; result=55, HTTP code = 0
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
Everything up-to-date
Server log:
$ node index.js
LOG: Making repos if they dont exist
WARNING: No SSL certs passed in. Running as HTTP and not HTTPS.
Be careful, without HTTPS your user/pass will not be encrypted
LOG: Server listening on [port]
LOG: Got a FETCH call for [repo].git
LOG: Got a FETCH call for [repo].git
LOG: Got a FETCH call for [repo].git
LOG: [user] is trying to fetch on repo: [repo] ...
LOG: [user] Successfully did a fetch on [repo]
LOG: Got a PUSH call for [repo].git
LOG: [user] is trying to push on repo: [repo] ...
LOG: [user] Successfully did a push on [repo]
Hi, so I'm running it and works really really well, I love this project.
However, when I access with the browser, a "not found" message appears, and I was wondering if there is any way I could use an http object to manage this requests.
Thanks!
host.js uses async.reject in makeReposIfNull with a callback function
function(results)
, but it should be
function(error, results).
This leads to an error when reading the property length of the result variable.
events.js:85
throw er; // Unhandled 'error' event
^
Error: read ECONNRESET
at exports._errnoException (util.js:746:11)
at TCP.onread (net.js:559:26)
platform:window 2012 node -v 0.12.6
I used the example but something is wrong.
Can't figure what...
/home/git-server# node index
/home/git-server/node_modules/git-server/host.js:265
if (results.length > 0) {
^
TypeError: Cannot read property 'length' of null
at /home/git-server/node_modules/git-server/host.js:265:22
at /home/git-server/node_modules/git-server/node_modules/async/dist/async.js :3327:9
at /home/git-server/node_modules/git-server/node_modules/async/dist/async.js :421:16
at iteratorCallback (/home/git-server/node_modules/git-server/node_modules/a sync/dist/async.js:998:13)
at /home/git-server/node_modules/git-server/node_modules/async/dist/async.js :906:16
at /home/git-server/node_modules/git-server/node_modules/async/dist/async.js :3319:13
at /home/git-server/node_modules/git-server/node_modules/async/dist/async.js :4256:13
at Object.cb [as oncomplete] (fs.js:169:19)
This happens with node v0.1 to v6. v8 gives me this bug: #41
Any ideas?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.