{
    "name": "Schaefer File Drop",
    "version": "1.0.0",
    "description": "1-Click File Sharing — passwortgeschützter Upload, öffentliche curl-kompatible Download-Links.",
    "base_url": "https://drop.schaefer.zone",
    "endpoints": {
        "GET  /": "Hauptseite — PWA-UI für Upload",
        "GET  /d/<id>": "Datei herunterladen (öffentlich, kein Passwort). curl -OJ <url>",
        "GET  /s/<slug>": "Datei über Custom Slug herunterladen",
        "GET  /d/<id>/preview": "Inline-Vorschau (Content-Disposition: inline)",
        "GET  /d/<id>?password=<pw>": "Download mit optionalem Datei-Passwort",
        "GET  /raw/<id>": "Immer roher Dateiinhalt (no HTML wrapping, für LLMs die Text direkt lesen wollen)",
        "GET  /d/<id>?raw=1": "Dasselbe wie /raw/<id> — roher Inhalt erzwingen",
        "GET  /d/<id>?inline=1": "Inline erzwingen (auch für Browser)",
        "GET  /d?id=<id>": "Legacy: Download via Query-String (weiterhin unterstützt)",
        "GET  /d?s=<slug>": "Legacy: Download via Slug Query-String",
        "POST /api/upload.php?action=init": "Chunked-Upload initialisieren (Auth: Bearer <password>)",
        "POST /api/upload.php?action=chunk&id=<id>&offset=<bytes>": "Chunk hochladen (raw body)",
        "POST /api/upload.php?action=complete&id=<id>&sha256=<hex>": "Upload abschließen",
        "POST /api/upload.php?action=status&id=<id>": "Upload-Status abfragen",
        "POST /api/upload.php?action=abort&id=<id>": "Upload abbrechen",
        "POST /api/upload.php": "Single-Shot Upload (multipart/form-data, Auth: Bearer <password>)",
        "GET  /api/status.php": "Alle Uploads auflisten (Auth: Bearer)",
        "GET  /api/status.php?id=<id>": "Einzelnen Upload-Status (Auth: Bearer)",
        "GET  /api/status.php?stats=1": "Server-Statistiken (Auth: Bearer)",
        "GET  /api/delete.php?id=<id>": "Upload löschen (Auth: Bearer, ?confirm=1)",
        "GET  /api/gc.php?key=<key>": "Garbage Collection (Cron)",
        "GET  /api/help.php": "Diese Hilfe"
    },
    "authentication": {
        "upload": "Authorization: Bearer <upload-password> (Header) oder ?password=<pw> (Query, weniger sicher)",
        "download": "Standardmäßig keine Auth. Optional pro-Datei Passwort via Bearer <password> oder ?password=",
        "api_tokens": "Langlebige Tokens konfigurierbar in config.php (API_TOKENS)"
    },
    "curl_examples": {
        "upload_single": "curl -X POST https://drop.schaefer.zone/api/upload.php \\\n  -H \"Authorization: Bearer YOUR_PASSWORD\" \\\n  -F \"file=@bericht.pdf\" \\\n  -F \"ttl=7\"",
        "upload_chunked_init": "curl -X POST 'https://drop.schaefer.zone/api/upload.php?action=init' \\\n  -H 'Authorization: Bearer YOUR_PASSWORD' \\\n  -H 'Content-Type: application/json' \\\n  -d '{\"filename\":\"big.zip\",\"size\":12345678,\"mime\":\"application/zip\",\"ttl_days\":7}'",
        "download": "curl -OJ https://drop.schaefer.zone/d/abc123",
        "download_with_slug": "curl -OJ https://drop.schaefer.zone/s/quartalsbericht",
        "download_with_password": "curl -OJ -H 'Authorization: Bearer FILE_PASSWORD' https://drop.schaefer.zone/d/abc123",
        "list": "curl -H 'Authorization: Bearer YOUR_PASSWORD' https://drop.schaefer.zone/api/status.php",
        "delete": "curl -H 'Authorization: Bearer YOUR_PASSWORD' 'https://drop.schaefer.zone/api/delete.php?id=abc123&confirm=1'",
        "gc_cron": "*/15 * * * * curl -sS 'https://drop.schaefer.zone/api/gc.php?key=YOUR_GC_KEY' > /dev/null"
    },
    "features": {
        "chunked_upload_with_resume": true,
        "sha256_integrity_check": true,
        "self_destruct_after_n_downloads": true,
        "custom_slug_urls": true,
        "optional_per_file_download_password": true,
        "download_statistics": true,
        "preview_mode_for_text_image_pdf": true,
        "llm_friendly_inline_serving": "LLM/Bot User-Agents (curl, wget, python-requests, OpenAI, Anthropic, etc.) receive content inline automatically — no Content-Disposition: attachment. Text files are wrapped in minimal HTML <pre> structure for LLMs with HTML-based Open Tools (Jina-like readers). Manual override via ?inline=1 (force inline) or ?raw=1 (force raw, no HTML wrapping).",
        "raw_endpoint": "/raw/<id> always serves the raw file content with its native Content-Type, never HTML-wrapped. Use this for clients that want plain text without any HTML structure.",
        "share_target_pwa": true,
        "qr_code_per_link": true,
        "email_notification_on_first_download": true,
        "webhook_on_upload_and_download": true,
        "clamav_scan_optional": true,
        "api_tokens_for_ci_cd": true,
        "automatic_zip_for_multi_upload": true,
        "multi_upload_zip": true
    },
    "limits": {
        "default_ttl_days": 7,
        "ttl_options": [
            1,
            3,
            7,
            14,
            30,
            0
        ],
        "chunk_size": 5242880,
        "max_total_size": "unlimited",
        "rate_limit_per_minute": 30
    },
    "repo": "https://gitlab.com/schaefer-services/file-drop"
}