All Projects → gabrielcsapo → Node Git Server

gabrielcsapo / Node Git Server

Licence: mit
🎡 A configurable git server written in Node.js

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Node Git Server

Start Server And Test
Starts server, waits for URL, then runs test command; when the tests end, shuts down server
Stars: ✭ 879 (+439.26%)
Mutual labels:  utility, server
Backslide
💦 CLI tool for making HTML presentations with Remark.js using Markdown
Stars: ✭ 679 (+316.56%)
Mutual labels:  utility, server
Licia
Useful utility collection with zero dependencies
Stars: ✭ 1,984 (+1117.18%)
Mutual labels:  utility
Turnstile
An authentication framework for Swift.
Stars: ✭ 163 (+0%)
Mutual labels:  server
Bnetlauncher
Launcher utility to help start battle.net games with the steam overlay.
Stars: ✭ 161 (-1.23%)
Mutual labels:  utility
Server Date
Make the server's clock available in the browser.
Stars: ✭ 157 (-3.68%)
Mutual labels:  server
Lru Cache
💫 A feature complete LRU cache implementation in C++
Stars: ✭ 162 (-0.61%)
Mutual labels:  server
Gophertunnel
Toolbox for Minecraft software written in Go
Stars: ✭ 156 (-4.29%)
Mutual labels:  server
Simplenet
An easy-to-use, event-driven, asynchronous network application framework compiled with Java 11.
Stars: ✭ 164 (+0.61%)
Mutual labels:  server
Zero
A Lightweight Socket Service with heartbeat, Can be easily used in TCP server development.
Stars: ✭ 161 (-1.23%)
Mutual labels:  server
Myserver
MyServer is your own localhost web server. you can setup PHP, Apache, Nginx and MySQL servers on your android devices or linux like Ubuntu etc. MyServer is Developed for android terminal like Termux or GNURoot Debian terminal.
Stars: ✭ 160 (-1.84%)
Mutual labels:  server
Graphtage
A semantic diff utility and library for tree-like files such as JSON, JSON5, XML, HTML, YAML, and CSV.
Stars: ✭ 2,062 (+1165.03%)
Mutual labels:  utility
Router
⚡️ A lightning fast HTTP router
Stars: ✭ 158 (-3.07%)
Mutual labels:  server
Poseidon
Poseidon Server Framework (refactor WIP)
Stars: ✭ 162 (-0.61%)
Mutual labels:  server
String Inflection
underscore -> UPCASE -> CamelCase conversion of names
Stars: ✭ 157 (-3.68%)
Mutual labels:  utility
Falcon
A high-performance web server for Ruby, supporting HTTP/1, HTTP/2 and TLS.
Stars: ✭ 2,058 (+1162.58%)
Mutual labels:  server
Genisyspro
Discontinued Till Further Notice. | Feature-rich server software for Minecraft PE and Windows 10 Edition - v1.1.x
Stars: ✭ 157 (-3.68%)
Mutual labels:  server
Pervane
Plain text file based note taking and knowledge base building tool, markdown editor, simple browser IDE.
Stars: ✭ 159 (-2.45%)
Mutual labels:  server
Android Http Server
A complete zero-dependency implementation of a web server and a servlet container in Java with a sample Android application.
Stars: ✭ 158 (-3.07%)
Mutual labels:  server
Unity Fastpacedmultiplayer
Features a Networking Framework to be used on top of Unity Networking, in order to implement an Authoritative Server with Lag Compensation, Client-Side Prediction/Server Reconciliation and Entity Interpolation
Stars: ✭ 162 (-0.61%)
Mutual labels:  server

node-git-server

🎡 A configurable git server written in Node.js

there be 🐲 here! The API's and functionality are still be cemented, anything before a 1.0.0 release will be subject to change.

Npm Version Build Status Coverage Status Dependency Status devDependency Status npm npm

Install

npm install node-git-server

Usage

Simple

const path = require('path');
const Server = require('node-git-server');

const repos = new Server(path.resolve(__dirname, 'tmp'), {
    autoCreate: true
});
const port = process.env.PORT || 7005;

repos.on('push', (push) => {
    console.log(`push ${push.repo}/${push.commit} (${push.branch})`);
    push.accept();
});

repos.on('fetch', (fetch) => {
    console.log(`fetch ${fetch.commit}`);
    fetch.accept();
});

repos.listen(port, () => {
    console.log(`node-git-server running at http://localhost:${port}`)
});

then start up the node-git-server server...

$ node example/index.js

meanwhile...

$ git push http://localhost:7005/beep master
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)
To http://localhost:7005/beep
 * [new branch]      master -> master

Sending logs

const path = require('path');
const Server = require('node-git-server');

const repos = new Server(path.resolve(__dirname, 'tmp'), {
    autoCreate: true
});
const port = process.env.PORT || 7005;

repos.on('push', (push) => {
    console.log(`push ${push.repo}/${push.commit} (${push.branch})`);

    repos.list((err, results) => {
        push.log(' ');
        push.log('Hey!');
        push.log('Checkout these other repos:');
        for(const repo of results) {
          push.log(`- ${repo}`);
        }
        push.log(' ');
    });

    push.accept();
});

repos.listen(port, () => {
    console.log(`node-git-server running at http://localhost:${port}`)
});

then start up the node-git-server server...

$ node example/index.js

meanwhile...

$ git push http://localhost:7005/beep master
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)
remote:  
remote: Hey!
remote: Checkout these other repos:
remote: - test.git
remote:  
To http://localhost:7005/test
   77bb26e..22918d5  master -> master

Authentication

const path = require('path');
const Server = require('node-git-server');

const repos = new Server(path.resolve(__dirname, 'tmp'), {
    autoCreate: true,
    authenticate: ({type, repo, user}, next) => {
      if(type == 'push') {
        user((username, password) => {
          console.log(username, password);
          next();
        });
      } else {
        next();
      }
    }
});
const port = process.env.PORT || 7005;

repos.on('push', (push) => {
    console.log(`push ${push.repo}/${push.commit} (${push.branch})`);
    push.accept();
});

repos.on('fetch', (fetch) => {
    console.log(`fetch ${fetch.commit}`);
    fetch.accept();
});

repos.listen(port, () => {
    console.log(`node-git-server running at http://localhost:${port}`)
});

then start up the node-git-server server...

$ node example/index.js

meanwhile...

$ git push http://localhost:7005/beep master
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)
To http://localhost:7005/beep
 * [new branch]      master -> master

Example

Running the following command will start up a simple http server:

node example/index.js

If you want to try using https run the following

node example/index.js --https

When running https with self-signed certs there are two ways to override the git-clients behavior using git config http.sslVerify false or git config --global http.sslCAInfo /path/to/cert.pem

For more information please visit the docs

Philosophy

This library is aimed to have a zero dependency footprint. If you are reading this and you see dependencies, help to remove them 🐒.

Thanks

This is a hard fork from pushover.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].