Complete implementation of photo and video sharing with anonymous guest access.
Features:
- Media upload with security validation (MIME type checking via magic bytes)
- File size limits (100MB max per file)
- Filesystem storage in ./media/event_{id}/ directories
- Media gallery with responsive grid layout (150px min columns)
- Share link generation with 32-byte random tokens (256-bit entropy)
- Anonymous upload and viewing via share links (no login required)
- Delete functionality (uploader or event creator only)
Handlers (server/handlers.go, ~800 new lines):
- handleMediaUpload: Multi-part upload for authenticated and anonymous users
- handleMediaGallery: Gallery view with upload form and share management
- handleMediaServe: Secure file serving with access control
- handleMediaDelete: Delete media (restricted to uploader/creator)
- handleShareLinkCreate: Generate cryptographically secure share tokens
- handleShareLinkDelete: Revoke share links
- handleSharePage: Public anonymous gallery with routing
- handleShareUpload: Anonymous file upload via share token
- handleShareMediaServe: Serve media to anonymous users
Templates:
- media_gallery.html: Authenticated gallery with grid, upload, share management
- share_page.html: Anonymous public gallery with upload capability
- Updated event_detail.html: Added "View Media Gallery" button
Routing:
- /events/{id}/media - Gallery (authenticated)
- /events/{id}/media/upload - Upload (authenticated)
- /events/{id}/media/{mediaId} - Serve file (authenticated)
- /events/{id}/media/{mediaId}/delete - Delete (authenticated)
- /events/{id}/share - Create share link (creator only)
- /events/{id}/share/{shareId}/delete - Delete share link (creator only)
- /share/{token} - Public gallery (anonymous)
- /share/{token}/upload - Anonymous upload
- /share/{token}/media/{mediaId} - Serve via share token
Security:
- MIME validation using http.DetectContentType (first 512 bytes)
- Unique filenames: {timestamp}_{random_hex}.{ext}
- Access control verification before file serving
- Anonymous uploads tracked separately for privacy
- Supported types: JPEG, PNG, GIF, WebP, MP4, MOV, AVI
Documentation:
- Updated DESIGN.md Phase 4 status: ✅ Complete
- Overall completion: 60% → 75%
- Updated implementation status table
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
||
|---|---|---|
| cmd/walle | ||
| config | ||
| model | ||
| server | ||
| store | ||
| .air.toml | ||
| .gitignore | ||
| .golangci.yml | ||
| DESIGN.md | ||
| docker-compose.yml | ||
| Dockerfile | ||
| go.mod | ||
| go.sum | ||
| Makefile | ||
| PROGRESS.md | ||
| README.md | ||
| UI_REDESIGN_PLAN.md | ||
| UI_REDESIGN_SUMMARY.md | ||
Walle
Walle is a web application designed to simplify event organization and management among groups of people. It is a simple, lightweight, and self-hostable application with minimal dependencies.
Core Features
Walle provides three core features:
- Shopping List Management: A collaborative list where members can add items and assign responsibility.
- Expense Settlement: Automatic calculation of who owes whom with minimum transactions.
- Media Sharing: Upload and share photos/videos from the event with members and guests.
Project Goals
- Simple, lightweight application with minimal dependencies.
- Self-hostable with SQLite as the primary database.
- A web interface as the main UI, with a CLI available for administration.
- Privacy-focused with secure sharing mechanisms.
- Fast, responsive UI using HTMX patterns.
Development
Requirements
Setup and Running
-
Clone the repository:
git clone <repository-url> cd walle -
Install dependencies:
go mod download -
Initialize the database: This command sets up the initial database schema.
make db-init -
Run the development server: The server will run on
http://localhost:8080by default and usesairfor live reloading.make dev -
Use the CLI: The CLI can be used for administrative tasks. For example, to create a user:
go run ./cmd/walle/main.go user create --email test@example.com --name "Test User"Available CLI commands:
walle serve- Start the web serverwalle user create --email <email> --name <name>- Create a new userwalle user list- List all userswalle event list- List all eventswalle event create --name <name> --creator <user-id>- Create an event
Build and Installation
Walle is designed to be deployed as a single, self-contained binary. All necessary assets like templates and migrations are embedded into the application.
Building from Source
-
Build the binary:
# Build both server and CLI make build # Or build individually make build-server # Creates bin/server make build-cli # Creates bin/walleThe binaries will be created in the
bin/directory. -
Development build:
# Run with auto-reload (requires air) make dev # Or install air and run manually go install github.com/air-verse/air@latest air
Docker Deployment
Walle includes Docker support for easy containerized deployment.
-
Build Docker image:
make docker-build # or docker build -t walle:latest . -
Run with Docker:
make docker-run # or docker run -p 8080:8080 \ -v $(pwd)/data:/app/data \ -v $(pwd)/media:/app/media \ walle:latest -
Run with Docker Compose:
docker-compose up -d
Production Deployment
-
Using the binary:
- Copy the
bin/serverbinary to your server - Create a systemd service or init script to run it
- Ensure the user has write permissions for data and media directories
- Copy the
-
Using Docker in production:
- Use the provided
docker-compose.yml - Mount persistent volumes for
/app/dataand/app/media - Configure reverse proxy (nginx/Caddy) for SSL and load balancing
- Use the provided
-
Environment Configuration: Set these environment variables for production:
# Server configuration WALLE_HOST=0.0.0.0 WALLE_PORT=8080 # Security WALLE_JWT_SECRET=your-super-secret-jwt-key-here WALLE_SESSION_TIMEOUT=86400 # Optional: External database (defaults to SQLite) WALLE_DATABASE_URL=postgres://user:pass@localhost/walle # Optional: File storage WALLE_MEDIA_PATH=/var/lib/walle/media WALLE_MAX_UPLOAD_SIZE=104857600 # 100MB in bytes -
Reverse Proxy Configuration (nginx example):
server { listen 80; server_name your-domain.com; location / { proxy_pass http://localhost:8080; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } # Cache static assets location /static/ { proxy_pass http://localhost:8080; expires 1y; add_header Cache-Control "public, immutable"; } }
API
Walle provides a REST API for programmatic access. The API is primarily used by the HTMX frontend but can be used for integrations.
Health Check
GET /health
Returns: {"status":"ok","service":"walle"}
Authentication
All protected endpoints require a JWT token in the auth_token cookie or Authorization: Bearer <token> header.
Troubleshooting
Common Issues
-
Database errors:
- Ensure the application has write permissions to the current directory
- Check if
walle.dbis corrupted:rm walle.dband restart
-
Media upload fails:
- Verify write permissions on the
media/directory - Check upload size limits in your reverse proxy
- Verify write permissions on the
-
JWT authentication issues:
- Ensure
WALLE_JWT_SECRETis set and consistent across restarts - Clear cookies if experiencing persistent auth issues
- Ensure
-
Docker issues:
- Check volume mounts:
docker-compose logs walle - Ensure ports aren't conflicting
- Check volume mounts:
Logs
The application logs to stdout/stderr. In production, capture these logs with your process manager.
Contributing
- Fork the repository
- Create a feature branch:
git checkout -b feature/my-feature - Make your changes with tests
- Run checks:
make check - Commit your changes:
git commit -am 'Add my feature' - Push to the branch:
git push origin feature/my-feature - Submit a pull request
Development Setup
# Clone and setup
git clone <your-fork-url>
cd walle
make deps
make install-tools
make dev
Code Quality
- Run tests:
make test - Format code:
make fmt - Lint:
make lint - Full check:
make check
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
For questions, issues, or contributions:
- GitHub Issues: https://github.com/your-org/walle/issues
- Documentation: https://walle-docs.example.com