How forceu/gokapi works
Gokapi is a self-hosted file-sharing service. Its principal workflow accepts uploads through the web/API surface, stores file content and metadata, and serves expiring shares for download; administrators configure the service and manage users and shares. The repository also documents file requests, deduplication, encryption, REST automation, S3-compatible storage, OIDC, and UI customization. The sampled excerpts do not show the full server routing or upload implementation, so uncertain internal call links are omitted; documented capabilities are represented without claiming their detailed wiring.
Main entry points: Webserver.go HTTP server · Database.go Database access · FileUpload.go Upload handling · Api.go REST API
Components 22
Service entry
- Gokapi startup
cmd/gokapi/Main.go
Web and access
- HTTP server
internal/webserver/Webserver.go - REST API
internal/webserver/api/Api.go - Authentication
internal/webserver/authentication/Authentication.go - Session management
internal/webserver/authentication/sessionmanager/SessionManager.go - Web interface
internal/webserver/web/static/js/admin_ui_allPages.js
File sharing
- Upload handling
internal/webserver/fileupload/FileUpload.go - File requests
internal/storage/filerequest/Filerequest.go - Encryption
internal/encryption/Encryption.go - End-to-end encryption
internal/encryption/end2end/End2End.go - File serving
internal/storage/FileServing.go
Persistence
- Storage selection
internal/storage/filesystem/FileSystem.go - Local storage
internal/storage/filesystem/localstorage/Localstorage.go - S3 storage
internal/storage/filesystem/s3filesystem/S3filesystem.go - Database access
internal/configuration/database/Database.go - SQLite or Redis
internal/configuration/database/dbabstraction/DbAbstraction.go
Configuration
- Runtime configuration
internal/configuration/Configuration.go - Setup wizard
internal/configuration/setup/Setup.go
Other components
- Browser user
- API or CLI client
- OIDC provider
- S3-compatible store
Connections 28
- Browser user → HTTP server: uses HTTP
- API or CLI client → REST API: calls REST
- Browser user → Web interface: uses interface
- Web interface → HTTP server: requests pages
- Gokapi startup → Runtime configuration: loads settings
- Gokapi startup → Database access: connects database
- Gokapi startup → HTTP server: starts server
- HTTP server → REST API: serves API
- HTTP server → Authentication: authenticates requests
- Authentication → Session management: validates sessions
- Session management → Database access: reads and writes sessions
- REST API → Upload handling: dispatches uploads
- REST API → File serving: dispatches downloads
- Upload handling → Encryption: encrypts content
- Upload handling → Storage selection: stores content
- Upload handling → Database access: stores metadata
- File requests → Database access: stores request state
- File serving → Storage selection: reads content
- File serving → Database access: reads share metadata
- Storage selection → Local storage: selects local driver
- Storage selection → S3 storage: selects cloud driver
- S3 storage → S3-compatible store: stores objects
- Database access → SQLite or Redis: uses database abstraction
- SQLite or Redis → Local storage
- Browser user → Setup wizard: configures service
- HTTP server → File requests: supports file requests
- Browser user → End-to-end encryption: encrypts or decrypts
- OIDC provider → Authentication: provides identity