GitPHP / Docs / 📦 Installation
⚡️ REST API v1

The GitPHP guide 🚀

Comprehensive open-source documentation: Self-hosting, Personal Access Tokens, Git & SSH, pull requests, and REST API.

🚀 Remote Updaters & CI/CD Token Architecture (upd_*)

NEW

Authorizes automated CLI installers (such as antigravity-installer-linux), headless servers, and CI/CD pipelines to download repository releases and source code archives directly without interactive browser prompts.

Personal Account upd_* Token

Every member gets an isolated permanent token starting with upd_... that can be copied or regenerated at any time.

Full cURL & Wget Compatibility

Pass the token via the X-Update-Token header or the query parameter ?token=upd_*.

Short-Link Anti-Scraping Shield

Unauthorized raw download requests automatically redirect to the verified short-link download gateway.

Automation & Shell Examples:

# 1. Download release assets via X-Update-Token header (Recommended):
curl -sSL -H "X-Update-Token: upd_YOUR_PERSONAL_TOKEN" \
     "https://git.ysnapp.com/username/repository/releases/download/v1.0.0/app.tar.gz" -o app.tar.gz

# 2. Download repository source archives directly:
curl -sSL -H "X-Update-Token: upd_YOUR_PERSONAL_TOKEN" \
     "https://git.ysnapp.com/username/repository/archive/main.zip" -o source.zip

# 3. Using direct query token with Wget:
wget "https://git.ysnapp.com/d/SHORT_CODE/get?token=upd_YOUR_PERSONAL_TOKEN" -O package.zip
🚀 Get Your Token: Navigate to Settings → Remote Updates or open /settings/updates.

☁️ Unified Download Portal & Broken Link Reporting (/d/* Gateway)

NEW

An ultra-fast, security-audited portal for all shared platform assets, binaries, and repository archives with real-time integrity verification.

Automated SHA-256 Checksum

Automatic cryptographic hash computation with one-click copy to verify file integrity prior to installation.

Broken Link Reporting System

Visitors can immediately report corrupt, missing, or slow downloads with automatic logging to the admin dashboard.

Responsive Large-Screen Sidebar

Desktop-optimized sidebar presenting live cluster activity, verification badges, and file specifications.

📦 Installation & Self-Hosting Guide

Open Source

GitPHP is completely open-source and engineered to be lightweight, high-performance, and trivial to install on any shared Linux hosting or dedicated VPS without requiring Docker or bloated runtime services.

📋 System Requirements:

  • Operating System: Modern Linux (Ubuntu 20.04+, Debian 11+, AlmaLinux 9+, Rocky Linux, RHEL).
  • PHP Version: PHP 8.1 or newer (PHP 8.2 / 8.3 recommended) with extensions: pdo_mysql, mbstring, curl, intl, sodium, fileinfo.
  • Database: MariaDB 10.6+ or MySQL 8.0+.
  • Git Engine: Git 2.30+ installed server-wide and available in $PATH.
  • Package Manager: Composer 2.x.
  • Web Server: OpenLiteSpeed / LiteSpeed, Nginx, or Apache.

🚀 Quick Command-Line (CLI) Installation:

1. Clone Repository & Install Dependencies:

# Clone repository into web directory
git clone https://github.com/ysnapp/gitphp.git /var/www/gitphp
cd /var/www/gitphp

# Install production dependencies
composer install --no-dev --optimize-autoloader

2. Configure Environment & Database:

# Copy configuration template
cp config/config.example.php config/config.php

# Edit database credentials and application settings
nano config/config.php

3. Run the Automated Installer:

# Execute the interactive CLI installer
php bin/install.php

# Or run the browser installer wizard by navigating to:
# https://your-domain.com/install.php

4. Set Permissions & Run Diagnostic:

# Grant ownership to your web user (www-data / nobody / site user)
chown -R www-data:www-data /var/www/gitphp/
chmod -R 755 /var/www/gitphp/
chmod -R 775 /var/www/gitphp/data/ /var/www/gitphp/storage/

# Run the health & push verification script
php bin/fix-push.php
✅ After completing setup, remove public_html/install.php or the application will automatically block access for security.

⚙️ Web Server Configuration (OpenLiteSpeed / Nginx / Apache)

Point your Document Root to the public_html directory and ensure URL rewrites and Authorization headers are passed:

a) OpenLiteSpeed / CyberPanel:

In CyberPanel → Websites → Manage → vHost Conf, set the document root and rewrite rules:

# In vHost Configuration:
docRoot                   /home/git.ysnapp.com/public_html
vhssl {
  enableContextRewrite    1
}

# .htaccess rules in public_html/.htaccess:
RewriteEngine On
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule .* - [e=HTTP_AUTHORIZATION:%1]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [QSA,L]

b) Nginx Server Block:

server {
    listen 80;
    server_name git.example.com;
    root /var/www/gitphp/public_html;
    index index.php;

    client_max_body_size 500M;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location ~ \.php$ {
        include fastcgi_params;
        fastcgi_pass unix:/run/php/php8.2-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param HTTP_AUTHORIZATION $http_authorization;
    }

    location ~ /\.(?!well-known).* {
        deny all;
    }
}

c) Background Cron Job:

Add the recurring task in crontab to execute repository synchronizations, dispatch webhooks, and purge expired sessions:

# Edit crontab for web user
crontab -u www-data -e

# Add one-minute background trigger:
* * * * * php /var/www/gitphp/bin/cron.php >/dev/null 2>&1
📖 For in-depth technical deployment guides, check: docs/installation.md and docs/deploy.md.