The GitPHP guide 🚀
Comprehensive open-source documentation: Self-hosting, Personal Access Tokens, Git & SSH, pull requests, and REST API.
16 Platform Administration
The Admin Dashboard for platform owners provides:
- Platform metrics and 14-day activity traffic charts.
- Collaborator role assignment (
read/write) per repository. - Remote repository mirroring and sync from GitHub, GitLab, and Codeberg.
- Security audit logging and SSH key oversight.
- Maintenance helper script:
php bin/fix-push.php.
🛡️ Security Architecture & Permissions Model
Defense in DepthGitPHP enforces strict multi-layered security controls to isolate repositories, protect user credentials, and eliminate threats across web and Git transport layers.
1. Role-Based Access Control (RBAC) Matrix:
| Role / Level | Browse Code | Clone Repo | Push Commits | Manage Issues & PRs | Merge Pull Requests | Settings & Webhooks |
|---|---|---|---|---|---|---|
| Public Visitor | ✅ (Public only) | ✅ (Public only) | ❌ | ❌ | ❌ | ❌ |
Collaborator (read) |
✅ | ✅ | ❌ | ✅ (Comment) | ❌ | ❌ |
Collaborator (write) |
✅ | ✅ | ✅ (Unprotected) | ✅ (Full) | ✅ (If approved) | ❌ |
Repository Owner (admin) |
✅ | ✅ | ✅ (Full) | ✅ (Full) | ✅ (Full) | ✅ (Full + Delete) |
2. Core Security Pillars:
🔑 Argon2id Password Hashing
Industry standard password hashing resistant to GPU/ASIC-based brute-force attacks.
📲 Two-Factor Authentication (2FA)
Full RFC 6238 TOTP support (Google / MS Authenticator) with hashed emergency recovery keys.
⚡️ SHA-256 Token Hashing
Personal tokens (gtp_…) are strictly hashed in database with instant one-click revocation.
🔒 SSH User Hardening
Restricted git-shell-wrapper.php prevents interactive shell logins and confines users to Git commands only.
🛡️ Server-Side Branch Protection
Pre-receive hooks enforce deletion blocking, force-push prevention, and mandatory approved code reviews.
📜 Security Audit Logging
Comprehensive event logging for authentication, token generation, role assignments, and deletions.
docs/security.md.