Skip to content

Commit

Permalink
Update README.md + support listing repositories in subdirectories
Browse files Browse the repository at this point in the history
  • Loading branch information
mcarbonne committed Jan 23, 2024
1 parent 9c7c409 commit 5c950ec
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build-push-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
push:
branches:
- 'main'
tags:
- 'v*'

env:
REGISTRY: ghcr.io
Expand Down
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,39 @@ shared:12347

For every account, create a folder `username:uid` in /srv/accounts.
Put every public keys allowed to access this account in the created directory.


# Usage
To manage your repositories, simply login to the desired account:
```
$ ssh ACCOUNT@HOSTNAME -p PORT
Availables commands :
create REPO_NAME : create a git repo
show REPO_NAME : get clone url
list : list availables repos
git> list
git> create tests/repo-a
Creating repo tests/repo-a
[ ... ]
Initialized empty Git repository in /srv/git/ACCOUNT/tests/repo-a/
You can now clone it :
git clone ssh://ACCOUNT@HOSTNAME:PORT/srv/git/ACCOUNT/tests/repo-a
git> create tests/repo-b
Creating repo tests/repo-b
[ ... ]
Initialized empty Git repository in /srv/git/ACCOUNT/tests/repo-b/
You can now clone it :
git clone ssh://ACCOUNT@HOSTNAME:PORT/srv/git/ACCOUNT/tests/repo-b
git> create repo-c
Creating repo repo-c
[ ... ]
Initialized empty Git repository in /srv/git/ACCOUNT/repo-c/
You can now clone it :
git clone ssh://ACCOUNT@HOSTNAME:PORT/srv/git/ACCOUNT/repo-c
git> list
repo-c
tests/repo-a
tests/repo-b
git>
10 changes: 8 additions & 2 deletions conf/git-shell-commands/list
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
#!/bin/sh
#!/bin/bash

#shellcheck disable=SC1091
. /srv/env

ls --color=auto "$REPO_ROOT/$USER"

for repo in $(find "$REPO_ROOT/$USER" -name "config" | sort)
do
folder=$(dirname "$repo")
repo_name=${folder#"$REPO_ROOT/$USER/"}
echo "$repo_name"
done

0 comments on commit 5c950ec

Please sign in to comment.