🗄️ PutPlace

File Metadata Storage Service

✓ Running

Welcome

PutPlace is a FastAPI-based service for storing and retrieving file metadata with MongoDB backend. Track file locations, SHA256 hashes, and metadata across your infrastructure.

API Endpoints

  • GET /health - Health check with database status
  • POST /put_file - Store file metadata
  • GET /get_file/{sha256} - Retrieve file by SHA256 hash
  • POST /upload_file/{sha256} - Upload file content
  • POST /api_keys - Create new API key
  • GET /api_keys - List all API keys
  • DELETE /api_keys/{key_id} - Delete API key
  • PUT /api_keys/{key_id}/revoke - Revoke API key

Example Usage

Store File Metadata

curl -X POST http://localhost:8000/put_file \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your-api-key" \
  -d '{
    "filepath": "/var/log/app.log",
    "hostname": "server01",
    "ip_address": "192.168.1.100",
    "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
  }'

Retrieve File Metadata

curl -H "X-API-Key: your-api-key" \
  http://localhost:8000/get_file/e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855

Using the Client Tool

# Scan a directory and send metadata to server
ppclient /var/log --api-key your-api-key

# With exclude patterns
ppclient /home/user --exclude .git --exclude "*.log"

# Dry run mode
ppclient /var/log --dry-run

Getting Started

1. Create Your First API Key

Use the bootstrap script to create your first API key:

python -m putplace.scripts.create_api_key

2. Install the Client

pip install -e .
source .venv/bin/activate
ppclient --help

3. Start Scanning

Use the ppclient command to scan directories and send metadata to the server.