gitoria
All repositories: gitoria
1.2 KB
#!/bin/sh# The forced command of every key: `gitoria-shell <user id>`. What the client asked is in SSH_ORIGINAL_COMMAND and may only be# git-upload-pack (clone, fetch) or git-receive-pack (push) of ONE repository '<slug>.git'; the app decides who may push.user=$1cmd=${SSH_ORIGINAL_COMMAND:-}refuse() { echo "gitoria: $1" >&2; exit 1; }case "$cmd" in"git-upload-pack "*) service=git-upload-pack; write=0 ;;"git-receive-pack "*) service=git-receive-pack; write=1 ;;*) refuse "only git clone, fetch and push work over ssh (no shell)" ;;esacarg=${cmd#* }arg=${arg#\'}; arg=${arg%\'}; arg=${arg#/}slug=${arg%.git}[ "$arg" = "$slug.git" ] || refuse "no such repository"case "$slug" in""|*[!a-z0-9-]*|-*|*-) refuse "no such repository" ;;esac[ ${#slug} -ge 2 ] && [ ${#slug} -le 40 ] || refuse "no such repository"status=$(curl -sS --max-time 10 -G -o /tmp/gitoria-access.$$ -w '%{http_code}' -H "X-Gitoria-Secret: $(cat /run/gitoria-secret)" \--data-urlencode "user=$user" --data-urlencode "slug=$slug" --data-urlencode "write=$write" "$(cat /run/gitoria-url)/__git/access") || status=000msg=$(cat /tmp/gitoria-access.$$ 2>/dev/null); rm -f /tmp/gitoria-access.$$[ "$status" = 200 ] || refuse "${msg:-the server did not answer}"exec "$service" "/repos/$slug.git"
Branches
- mainmain branch
Latest commits
- 68dcb603deploy.sh: back up live storage/.sessions/.env before every deploy (newest 5 kept)mre
- e2deed6dgitoria#20: "Add code" only on the Code page of an empty repository, no collapsiblemre
- 8bb97ffddeploy.sh: never send .git or .gitignore to Byrodinmre
- fd981932State of 2026-09-27; bin/ no longer tracked (Hybriel commit is in README)mre
- 4a2d7125initial commitmre