Finished BUD 1

This commit is contained in:
Your Name
2025-08-18 21:51:54 -04:00
parent e641c813eb
commit 95ccb3a9c4
24 changed files with 1728 additions and 31 deletions

View File

@@ -14,39 +14,42 @@ This document outlines the implementation plan for ginxsom, a FastCGI-based Blos
## Phase 1: Basic File Serving & Retrieval (BUD-01)
### 1.1 Infrastructure Setup
- [ ] Create basic directory structure
- [ ] Create `blobs/` directory for file storage
- [ ] Create `db/` directory for SQLite database
- [ ] Create `logs/` directory for application logs
- [ ] Set up proper permissions (nginx readable, app writable)
- [x] Create basic directory structure
- [x] Create `blobs/` directory for file storage
- [x] Create `db/` directory for SQLite database
- [x] Create `logs/` directory for application logs
- [x] Set up proper permissions (nginx readable, app writable)
### 1.2 Database Schema
- [ ] Design SQLite schema for blob metadata
- [ ] `blobs` table: sha256, size, type, uploaded_at, uploader_pubkey
- [ ] `server_config` table: key-value pairs for server settings
- [ ] Create database initialization script
- [ ] Add proper indexes on sha256 hash
- [x] Design SQLite schema for blob metadata
- [x] `blobs` table: sha256, size, type, uploaded_at, uploader_pubkey, filename
- [x] `server_config` table: key-value pairs for server settings
- [x] Create database initialization script
- [x] Add proper indexes on sha256 hash
### 1.3 nginx Configuration
- [ ] Configure nginx for static file serving
- [ ] Set up location block for `GET /<sha256>` pattern
- [ ] Configure proper MIME type detection
- [ ] Add proper headers (Cache-Control, ETag, etc.)
- [ ] Handle 404s gracefully when blob doesn't exist
- [ ] Configure FastCGI pass-through for non-GET requests
- [x] Configure nginx for static file serving
- [x] Set up location block for `GET /<sha256>` pattern with extension support
- [x] Configure try_files directive for multiple extension fallbacks
- [x] Configure proper MIME type detection
- [x] Add proper headers (Cache-Control, ETag, etc.)
- [x] Handle 404s gracefully when blob doesn't exist
- [x] Configure FastCGI pass-through for HEAD and non-GET requests
### 1.4 Basic HEAD Endpoint
- [ ] Implement FastCGI handler for `HEAD /<sha256>`
- [ ] Query database for blob metadata
- [ ] Return proper headers (Content-Type, Content-Length, etc.)
- [ ] Return 404 if blob doesn't exist
- [ ] Add server timing headers for debugging
- [x] Implement FastCGI handler for `HEAD /<sha256>`
- [x] Query database for blob metadata (single source of truth)
- [x] Extract SHA-256 from URL (strip extensions)
- [x] Return proper headers (Content-Type, Content-Length, etc.)
- [x] Return 404 if blob doesn't exist in database
- [x] Add server timing headers for debugging
### 1.5 Testing & Validation
- [ ] Create test blobs with known SHA-256 hashes
- [ ] Verify nginx serves files correctly
- [ ] Verify HEAD requests return proper metadata
- [ ] Test with missing files (404 responses)
- [x] Create test blobs with known SHA-256 hashes
- [x] Verify nginx serves files correctly with extension support
- [x] Verify HEAD requests return proper metadata
- [x] Test with missing files (404 responses)
- [x] Test HEAD requests with and without extensions
- [ ] Performance test with large files
---
@@ -177,10 +180,10 @@ This document outlines the implementation plan for ginxsom, a FastCGI-based Blos
## Development Milestones
### Milestone 1: Basic Functionality (Phase 1 Complete)
- nginx serves files by hash
- HEAD requests return metadata
- Database stores blob information
### Milestone 1: Basic Functionality (Phase 1 Complete)
- [x] nginx serves files by hash with extension support
- [x] HEAD requests return metadata from database
- [x] Database stores blob information with proper schema
### Milestone 2: Full Upload Support (Phase 2 Complete)
- Authenticated uploads working
@@ -262,4 +265,3 @@ This document outlines the implementation plan for ginxsom, a FastCGI-based Blos
- [ ] Backup procedures
- [ ] Security hardening guide
- [ ] Documentation and examples