Code Monkey home page Code Monkey logo

dev.sh's Introduction

dev.sh

Host a development server

Install

# Create a user as root or with sudo
useradd --create-home --skel /dev/null --home-dir /home/git --shell /bin/dash git
# Clone dev.sh to newly created user home directory
su git
git clone git://github.com/lauriro/dev.sh.git $HOME
# Setup .ssh dir and permissions
./dev.sh
# Add first git user
./dev.sh user john add
./dev.sh user john addkey

Now you can continue with ssh and newly created user

In most cases this should be sufficient.

Advanced Configuration

Defaults

ROOT=$HOME/repo
USER_RE='[a-z][-a-z0-9]\{1,16\}[a-z0-9]$'
REPO_RE='[-a-z0-9_.]\{0,30\}.git$'
LINE='command="env USER=%s %s",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty %s\n'
LOGS=$HOME/logs/dev.sh.log

It is possible to override logger by adding to conf file

log() {
	logger -t dev.sh -p ${2-"info"} "${SSH_CLIENT%% *} $USER: $1 -- $CMD"
}
# Watch files for changes and rerun tests
while :;do inotifywait -q -e modify dev.sh test/*.sh;./test/test.sh; done

Usage

$ ssh git@localhost help

git> repo
git> repo test.git init
git> repo test.git config access.read all
git> repo test.git config access.write admin,richard
git> repo test.git config access.write.devel all
git> repo test.git config access.tag richard
git> repo test.git config branch.master.denyDeletes true
git> repo test.git config branch.master.mergeoptions "--ff-only"
git> repo test.git config branch.devel.mergeoptions "--no-ff"
git> repo test.git config tags.denyOverwrite true
git> repo test.git describe "My cool repo"
git> repo test.git mv new-repo.git
git> repo test.git fork new-repo.git
git> repo test.git sta

git> user john
git> user john add
git> user john addkey <ssh-public-key>
git> user john rmkey john fingerprint
git> user john group admin
git> user john name "John Smith"
git> user john delete

Licence

Copyright (c) 2011-2022 Lauri Rooden [email protected]
The MIT License

For a simple local test, you can use git-remote-ext: git clone ext::'git --namespace=foo %s /tmp/prefixed.git'

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.