Complete local development environment for the community archival system, including PostgreSQL, 3-node IPFS Cluster, archival API, and web UI.
⚠️ IMPORTANT: This is a prototype for development and testing. It uses mock CIDs and does not include production features like encryption, OpenTimestamps, or Ed25519 signatures. See Limitations for details.
New here? Start with START-HERE.md for a 3-command setup.
┌─────────────────────────────────────────────────────┐
│ Web UI + API (Single Container) │
│ http://localhost:8000 │
│ - Vue.js UI with drag & drop upload │
│ - Browse archived files and commits │
│ - FastAPI backend serving both UI and API │
│ - Accept uploads and run archival workflow │
└─────────────┬───────────────────────────────────────┘
│
┌─────────────▼───────────────────────────────────────┐
│ PostgreSQL (scottfiles database) │
│ localhost:5432 │
│ - paths table (filelister schema) │
│ - commits table (ntx schema) │
└─────────────────────────────────────────────────────┘
│
┌─────────────▼───────────────────────────────────────┐
│ CCS Cluster (3 nodes) │
│ - node1: localhost:9094 (test-org1 primary) │
│ - node2: localhost:9095 (shared backup) │
│ - node3: localhost:9098 (test-org2 primary) │
│ Replication: min=2, max=3 │
└─────────────────────────────────────────────────────┘
- PostgreSQL: Full filelister + ntx schema
- 3-node IPFS Cluster: Private network with automatic replication
- Archival API: REST API for upload, catalog, archive
- Web UI: Dropbox-like interface for file management
- File Upload: Drag & drop or browse
- Cataloging: Scan filesystem and add to database
- Simplified Archival: Mock commit creation (for demonstration)
- ntx archival: Mock implementation (no encryption, signatures, or OpenTimestamps)
- filelister: Simplified scan (no parallel processing or advanced filtering)
- CCS integration: Mock CIDs (not actual IPFS upload)
- Encryption: XChaCha20-Poly1305
- Merkle trees: Cryptographic binding of content + metadata
- Ed25519 signatures: Organizational attribution
- OpenTimestamps: Bitcoin-anchored existence proofs
- S3 backup: Redundant storage
- Real IPFS upload: Actual content-addressed storage
- Docker and Docker Compose
- Node.js 20+ (for web UI development)
- OpenSSL (for secret generation)
cd deployment/local
./setup.shThis will:
- Generate IPFS cluster secrets
- Generate swarm key for private IPFS network
- Install web UI dependencies
- Create
.envfile
# From community-cloud-storage directory
docker compose up -dWait ~30 seconds for all services to start.
Open your browser to: http://localhost:8000
- Upload Files: Drag & drop files into the web UI
- Run Catalog: Click "Run Catalog" to scan uploaded files into database
- Check Status: See pending files count update
- Run Archive: Click "Run Archive" to create a commit and mock archive
- View Files: Browse cataloged files, see CIDs and commit IDs
Base URL: http://localhost:8000
GET /- API health checkGET /status- System status (pending files, commits)GET /files?limit=100&offset=0&archived_only=false- List filesGET /commits?limit=50- List commits
POST /upload- Upload file (multipart/form-data)POST /catalog- Run filelister scanPOST /archive?size_limit_gb=0.1&dry_run=false- Run archival
Example:
# Upload a file
curl -X POST http://localhost:8000/upload \
-F "file=@test.pdf"
# Run catalog
curl -X POST http://localhost:8000/catalog
# Check status
curl http://localhost:8000/status | jq
# Run archive (dry run)
curl -X POST http://localhost:8000/archive?dry_run=true | jq
# Run archive (real)
curl -X POST http://localhost:8000/archive | jqConnect to PostgreSQL:
# Using psql
docker exec -it archival-postgres psql -U archival -d scottfiles
# Example queries
SELECT COUNT(*) FROM paths WHERE commit_id IS NULL; -- Pending files
SELECT * FROM commits ORDER BY sequence DESC LIMIT 5; -- Recent commits
SELECT encode(path, 'escape') as path, size, commit_id FROM paths LIMIT 10;Check cluster status:
# Node 1 peer ID
curl http://localhost:9094/id | jq
# List all cluster peers
curl http://localhost:9094/peers | jq
# Check pins
curl http://localhost:9094/pins | jqlocal-dev/
├── README.md # This file
├── setup.sh # Setup script
├── init-db/
│ └── 01-create-schema.sql # PostgreSQL schema
├── ccs-config/
│ ├── cluster-secret.txt # Generated by setup.sh
│ └── swarm.key # Generated by setup.sh
├── archival-api/
│ ├── Dockerfile
│ ├── requirements.txt
│ └── app.py # FastAPI application
└── web-ui/
├── Dockerfile
├── nginx.conf
├── package.json
├── vite.config.js
├── index.html
└── src/
├── main.js
└── App.vue # Vue.js app
cd ../../api
# Install dependencies
pip install -r requirements.txt
# Set environment variables
export DATABASE_URL="postgresql://archival:dev-password-change-in-production@localhost:5432/scottfiles"
export UPLOAD_DIR="/tmp/uploads"
export STAGING_DIR="/tmp/staging"
# Run API
python -m uvicorn app:app --reload --port 8000cd ../../ui
# Install dependencies
npm install
# Run dev server (UI only, API must be running separately)
npm run devAccess at: http://localhost:5173 (API at http://localhost:8000)
# Stop all services
docker compose down
# Stop and remove volumes (⚠️ deletes all data)
docker compose down -vCheck logs:
docker compose logs -fEnsure PostgreSQL is healthy:
docker compose ps postgresCheck cluster logs:
docker logs node1-cluster
docker logs node2-cluster
docker logs node3-clusterCheck CORS settings in archival-api/app.py and ensure API is running:
curl http://localhost:8000To integrate with real production tools:
Replace simplified catalog with actual filelister:
# In archival-api/app.py
import subprocess
subprocess.run([
"filelister", "scan",
"--config", "/etc/filelister/config.toml"
])Replace mock archive with actual ntx:
# In archival-api/app.py
import subprocess
subprocess.run([
"ntx", "scan",
"--config", "/etc/ntx/ntx.toml"
])Use actual CCS library for IPFS upload:
from community_cloud_storage.operations import add as ccs_add
result = ccs_add(commit_dir, profile="hrdag", config=ccs_config)Integrate XChaCha20-Poly1305 encryption from ntx.
Integrate Bitcoin anchoring from ntx.
Sign commits with organizational keys from ntx.
| Component | Prototype | Production |
|---|---|---|
| Database | PostgreSQL (Docker) | PostgreSQL (scott) |
| Filelister | Simplified scan | Full parallel scan with exclusions |
| ntx | Mock commits | Full: encryption, Merkle trees, OTS, signatures |
| CCS | Mock CIDs | Real IPFS cluster with replication |
| Backup | None | S3 via rclone |
| Network | Docker bridge | Tailscale VPN |
| Keys | None | LUKS-encrypted USB drive |
| Monitoring | None | Prometheus, hrdag-monitor |
- community-cloud-storage - CCS library and CLI
- filelister - Filesystem cataloging
- ntx - Archival with cryptographic proofs
- server-documentation - Infrastructure docs
GPL-2 or newer (same as parent project)