Coder Social home page Coder Social logo

tsuru / gandalf Goto Github PK

View Code? Open in Web Editor NEW
267.0 63.0 55.0 3.34 MB

Gandalf is an HTTP API for managing Git repositories.

Home Page: https://gandalf.readthedocs.org/

License: BSD 3-Clause "New" or "Revised" License

Makefile 0.24% Go 97.20% Shell 2.43% Dockerfile 0.13%
go git

gandalf's Introduction

gandalf's People

Contributors

andrestc avatar andrewsmedina avatar bardusco avatar cezarsa avatar cristianossd avatar dnsaoki2 avatar flavianmissi avatar flavioribeiro avatar fsouza avatar ggarnier avatar guestisp avatar guilhermebr avatar guilhermef avatar heynemann avatar hfeeki avatar jaywgraves avatar joaopaulovieira avatar marcelometal avatar minhajuddin avatar morpheu avatar msabramo avatar nettoclaudio avatar rfloriano avatar ricardodani avatar rochacon avatar scorphus avatar tarsisazevedo avatar xsavitar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gandalf's Issues

command to check whether a user has permission to read/write a repository

If the user has permission to read/write the repository, the code should execute the user's original command, this can be done using the SSH_ORIGINAL_COMMAND environment variable.

If not, the command should return an permission error.

It is important to notice that this command will be called only when the user tries to establish a ssh connection using the git user.

key: move pkg files into user pkg

There's no need to a separate pkg exist.

Also, it is better if there is no exported actions in the pkg key, since the actions on it are applied only into authorized_keys file and do not reflect in gandalf's database.

repository: replace isPublic field by file in git bare

Now that we're using git daemon to serve public operations, we need git daemon to know whether a repository is public or not, for that, when Gandalf receives the isPublic field, instead of saving the information in the database, it should create the related file in order to make it public for git daemon

handler: list keys

The user should have a way to know how many keys he/she has, and what are their names.

bin: remove ' of repository path

Gandalf currently executes the original command around quotes, e.g:

git-receive-pack '/var/repositories/myproj.git'

This gives an error when executed via golang, it is needed to remove the single quotes.

git-daemon export-all flag

It should be possible to start git-daemon (via gandalf) exporting all repositories by default.

Gandalf shold have a configuration flag, e.g.:

git-daemon:
    export-all: true

should support custom hooks for bare repositories

We could support it using a template for bare repositories that already come with the hooks on it.

Or it could be a config flag pointing to a file, like

gandalf.conf

post-receive: path/to/executable

I'd rather the conf option.

scaling problem

Gandalf does not support scaling over more than one machine because of the authorized_keys file.

In order to have more than one server, Gandalf must share (?) the authorized_keys files over each server.

Maybe doozer is a great tool for that.

bin: repass messages to end user

For example, when a user pushes into an absent repository, the message returned by the server is:

fatal: The remote end hung up unexpectedly

This happens for all commands that executes with error in the server side.

bin: log actions

It is impossible to debug this module right now, logs would help a lot

bin: append repository-path before execute SSH_ORIGINAL_COMMAND

For example, a

$> git push

with the remote set as [email protected]:myproject.git will execute the following command at githost.com:

$> git-receive-pack 'myproject.git'

but our repository path is not the git user's home, so we should run git-receive-pack passing the absolute path to the repository, e.g.:

$> git-receive-pack '/var/repositories/myproject.git'

Wrapper to database session

We must have a wrapper to manage database sections, we can copy tsuru's interface:

db.Session.Repository().Action()

log actions

In the present moment, we do not log any kind of actions.

It would be nice if we started logging. It would be awesome if we also have log levels (error, warning, info and debug)

user: AddKey method

It should be possible to append keys to existent users, e.g:

u.AddKey("ssh-rsa somekey...")

This method should add the key into the user document at mongodb and write it at authorized_keys file.

start git daemon on initialization

It might be done on web server start up inside the main function, or by the install script, that already starts gandalf-webserver.

I'd rather the startup on main approach, mainly because we need to pass a --base-path config that resides on gandalf.conf file. Other good point for that approach is that if the user does not uses the install script to install/start gandalf he/she will not be forced to start git-daemon manually.

wrap ssh key with custom confs

We should ensure that the user cannot write into repositories which he/she has no permission to do so.
We should also ensure that the user cannot freely login into the server using the git user, and not execute any command different from the binary that we're gonna create.

Something like:

no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty,command=
"/path/to/cmd or binary name (in PATH)" ssh-rsa AAAAB3NzaC1kc3MAAACBAOjv4TL4EbQ(...)

This issue depends on issue #12.

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.