How privatebin/privatebin works
PrivateBin is a zero-knowledge pastebin: the browser encrypts paste content before sending it, and the server stores and serves the encrypted payload. The principal path runs from browser interaction through the PHP request controller, paste model, and configured storage backend; reads return data for browser-side decryption. Discussions, expiration and burn-after-reading, traffic controls, translations, rendering, and URL-shortener integrations are additional capabilities. Relationships reflect the excerpts, SOURCE INDEX references, or README; unsampled implementation details are not inferred.
Main entry points: Controller.php Request controller · AbstractData.php Data interface · Configuration.php Configuration · Paste.php Paste model
Components 24
Browser experience
- Browser client
js/privatebin.js - Bootstrap template
tpl/bootstrap5.php
Request and presentation
- HTTP entry
index.php - Request controller
lib/Controller.php - Request parsing
lib/Request.php - Page rendering
lib/View.php - Template selection
lib/TemplateSwitcher.php
Paste domain
- Paste model
lib/Model/Paste.php - Discussion model
lib/Model/Comment.php - Model factory
lib/Model.php
Persistence
- Data interface
lib/Data/AbstractData.php - Filesystem backend
lib/Data/Filesystem.php - Database backend
lib/Data/Database.php - Cloud storage
lib/Data/GoogleCloudStorage.php - S3 storage
lib/Data/S3Storage.php
Shared services
- Configuration
lib/Configuration.php - Traffic limiter
lib/Persistence/TrafficLimiter.php - Server salt
lib/Persistence/ServerSalt.php - Translations
lib/I18n.php - JSON encoding
lib/Json.php - Shortener proxies
lib/Proxy/AbstractProxy.php - Input filtering
lib/Filter.php - Paste format
lib/FormatV2.php
Other components
- Paste user
Connections 27
- Paste user → Browser client: uses
README.md - Browser client → HTTP entry: sends encrypted data
README.md - HTTP entry → Request controller: starts
index.php - Request controller → Request parsing: reads
lib/Controller.php - Request controller → Model factory: dispatches
lib/Controller.php - Request controller → Traffic limiter: checks limits
lib/Controller.php - Request controller → Shortener proxies: routes shortener
lib/Controller.php - Request controller → Input filtering: uses
lib/Controller.php - Request controller → Paste format: uses
lib/Controller.php - Request controller → Page rendering: renders
lib/Controller.php - Request controller → Template selection: selects template
lib/Controller.php - Request controller → Translations: translates output
lib/Controller.php - Request controller → JSON encoding: encodes response
lib/Controller.php - Model factory → Paste model: creates
lib/Model.php - Paste model → Discussion model: loads discussions
lib/Model/Paste.php - Paste model → Data interface: reads and writes
- Data interface → Filesystem backend: implemented by
lib/Data/Filesystem.php - Data interface → Database backend: implemented by
lib/Data/Database.php - Data interface → Cloud storage: implemented by
lib/Data/GoogleCloudStorage.php - Data interface → S3 storage: implemented by
lib/Data/S3Storage.php - Configuration → Filesystem backend: configures backend
lib/Configuration.php - Configuration → Database backend: configures backend
lib/Configuration.php - Configuration → Cloud storage: configures backend
lib/Configuration.php - Configuration → S3 storage: configures backend
lib/Configuration.php - Traffic limiter → Server salt: derives visitor key
lib/Persistence/TrafficLimiter.php - Server salt → Data interface: persists salt
lib/Persistence/ServerSalt.php - Bootstrap template → Browser client: hosts interface