🐕🖼️✨🔒 DoggyGallery FAQ
DoggyGallery is a secure, self-hosted media gallery server for serving images and videos over HTTPS. It's designed with security as the top priority, enforcing modern encryption standards and authentication.
-
crates.io:
crates.io/crates/doggygallery
(install with
cargo install doggygallery) - GitHub: github.com/meltingscales/DoggyGallery
- Documentation: docs.rs/doggygallery
DoggyGallery uses HTTP Basic Authentication over TLS 1.3. While HTTP Basic Auth sends credentials with each request, it is completely safe when used with TLS 1.3 because:
- All traffic is encrypted end-to-end - Your credentials are encrypted before leaving your device
- TLS 1.3 only - We enforce the latest TLS version with no fallback to older, vulnerable protocols
- Constant-time comparison - Credentials are validated using timing-attack resistant algorithms
- Credentials zeroized - Passwords are securely erased from memory after use
TLS 1.3 provides forward secrecy, authenticated encryption, and eliminates all known vulnerabilities from older TLS versions. When credentials are sent over TLS 1.3, they're protected by AES-256-GCM or ChaCha20-Poly1305 encryption, making interception impossible without compromising the TLS connection itself.
DoggyGallery implements multiple layers of security protection:
Transport Security:
- TLS 1.3 enforcement - Only the latest TLS protocol is accepted (no TLS 1.2 or older)
- HSTS headers - Forces browsers to always use HTTPS
- Modern cipher suites - Uses only secure, forward-secret ciphers
Authentication Security:
- Rate limiting - Limits failed login attempts (10 attempts per 60 seconds per IP)
- Constant-time comparison - Prevents timing attacks during credential validation
-
Memory protection - Passwords are zeroized
from memory using the
zeroizecrate - Failed attempt logging - All authentication failures are logged with client IPs
Content Security:
- Path traversal protection - Prevents access to files outside the media directory
- SVG XSS protection - SVG files are sandboxed with restrictive CSP headers
- Security headers - X-Frame-Options, X-Content-Type-Options, CSP, and more
- Media-only serving - Only image and video files can be accessed
DoggyGallery implements smart rate limiting that only restricts failed authentication attempts:
- Failed logins are tracked per IP address
- After 10 failed attempts within 60 seconds, the IP is temporarily blocked
- Successful authentication immediately clears the rate limit for that IP
- Once authenticated, users can make unlimited requests - no browsing restrictions
- Old entries are cleaned up automatically every 5 minutes
DoggyGallery supports two certificate modes:
1. Self-signed certificates (development):
-
Use
--self-signed-certs-on-the-flyto generate certificates automatically -
Certificates are generated fresh on each startup using
rcgen - Great for local development and testing
- Browsers will show security warnings (expected behavior)
2. Custom certificates (production):
-
Use
--certand--keyto provide your own certificate files - Supports certificates from Let's Encrypt, commercial CAs, or your own CA
- Required for production deployments
- No browser warnings when using trusted certificates
DoggyGallery supports images, videos, and audio files in a beautiful, responsive grid:
Images:
- Loading...
Videos:
- Loading...
Audio:
- Loading...
Files are displayed with thumbnails, and clicking opens them in a lightbox with navigation controls. All other file types are ignored for security.
DoggyGallery includes mobile-friendly navigation controls:
- Keyboard shortcuts: Use arrow keys to navigate left/right, Escape to close
- Touch gestures: Swipe left/right on mobile devices to navigate between images
- Navigation buttons: On-screen Prev/Next buttons for easy navigation
- Random button: Jump to a random image in the current gallery
- Arrow buttons: Large arrow overlays on the sides of the lightbox
DoggyGallery respects your privacy:
- No analytics - No tracking cookies, no third-party scripts
- Minimal logging - Only authentication attempts and errors are logged
- Self-hosted - Your media never leaves your server
- No external dependencies - All assets are served locally
- IP privacy - IP addresses are only used for rate limiting and not permanently stored
DoggyGallery enforces HTTP/2 only - there is no fallback to HTTP/1.1. This provides significant performance and security benefits:
HTTP/2 Benefits:
- Multiplexing: Multiple requests over a single TCP connection
- Header compression: Reduces overhead significantly
- Server push: Proactive resource delivery
- Binary protocol: More efficient parsing
- Stream prioritization: Better resource loading order
Why not HTTP/3?
HTTP/3 uses QUIC (UDP-based) instead of TCP, which requires a completely different server architecture. While HTTP/3 offers benefits like:
- Faster connection establishment
- Better handling of packet loss
- Connection migration
...implementing it would require migrating from axum-server
to quinn or h3, which is beyond the current scope.
HTTP/2 over TLS 1.3 already provides excellent performance and security.
All connections must support HTTP/2. Clients that don't support HTTP/2 (very rare in 2025) will not be able to connect.
DoggyGallery is built with Rust and designed for easy deployment:
Quick Start:
# Build the project
cargo build --release
# Run with self-signed certs (development)
./target/release/doggygallery \
--self-signed-certs-on-the-fly \
--media-dir /path/to/media \
--username admin \
--password "your-secure-password" \
--host 0.0.0.0 \
--port 7833
# Run with custom certificates (production)
./target/release/doggygallery \
--cert /path/to/cert.pem \
--key /path/to/key.pem \
--media-dir /path/to/media \
--username admin \
--password "your-secure-password"
All options can also be set via environment variables. See the README for full deployment instructions.
To maximize security when running DoggyGallery:
- Use strong passwords - Long, random passwords for authentication
- Use proper certificates - Get free certificates from Let's Encrypt for production
- Keep it updated - Regularly update to get the latest security patches
- Restrict network access - Use firewall rules to limit who can reach the server
- Monitor logs - Watch for suspicious authentication patterns
- Run with minimal privileges - Don't run as root; use a dedicated service account
-
Keep dependencies updated - Run
cargo auditregularly
If you discover a security vulnerability in DoggyGallery:
- DO NOT open a public GitHub issue
- Report privately through GitHub's security advisory system
- Or contact the maintainers directly via email
Responsible disclosure helps keep all users secure.