weblens

module
v0.0.0-...-dd4be11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 4, 2026 License: MIT

README

Weblens

Self-hosted file manager and photo server

Weblens logo

CI


Weblens is a self-hosted file management server. It runs as a Docker container, stores files on your own hardware, and gives you a web UI to upload, organize, browse, and share them.

Features

  • File management - upload, organize, rename, delete, and move files through a web interface.
    • Files are not encrypted, the file structure is exactly what you see in the UI.
  • File history - view full history of any file, and restore deleted or overwritten files without a separate backup tool.
  • Sharing - share files and folders with other users or via anonymous guest links, with granular permissions.
  • Media browser - view photos and videos in-browser, including RAW formats and video playback.
    • View EXIF metadata such as GPS coordinates, capture date, resolution, and more.
  • Search - fast full-text search across filenames and metadata.
    • Local ML-based image recognition. Search for objects, concepts, or text and find it instantly.
  • Backup server - run a second Weblens instance as an offsite mirror of your primary server.
  • REST API - documented at /docs/index.html on any running instance.

Installation

Weblens is distributed as a Docker image. The easiest way to get started is with Docker Compose.

Refer to the example compose and .env files in the docker directory to get set up.

Edit .env to set the three paths:

DATA_HOST_PATH=/path/to/your/data       # Where user files are stored (plain, not encrypted)
CACHE_HOST_PATH=/path/to/your/cache     # Where thumbnails and temp files go
DATABASE_HOST_PATH=/path/to/your/db     # Where MongoDB stores its data

The DATA_HOST_PATH is your long-term file storage - point it at wherever you have space. CACHE_HOST_PATH benefits from fast storage (SSD) since it holds thumbnails and processed media.

Setup

On first launch, Weblens will prompt you to configure the server. You can set it up as a core server or a backup server.

Core server

A core server is the primary instance you use day-to-day. Configure it with an owner account, a server name, and optionally a public address if it's behind a reverse proxy.

Backup server

A backup server mirrors one or more core servers. It only needs outbound access to the core - it does not need to be publicly accessible.

To set one up, you need an API key (in settings -> account) on your core server's owners account. Now, on the backup server, give the backup server a name, the core servers public address, and that key.

In the event of a disaster on your core server, the backup server can restore all data to a new core instance. If you only need protection against accidental deletion, the built-in file history on the core server is sufficient - a separate backup instance is optional.

Configuration

There are two ways to configure Weblens:

  1. Through environment variables, which are set in the .env file
  2. Through the admin interface at /settings/dev

These two methods of are not mutually exclusive - you can use both at the same time, and have some, but not complete, feature overlap. Configuration you set in the admin interface will be stored in the DB, and will override environment variables.

Screenshots

Files Timeline Presentation Restore

Roadmap

  • Better file and media tagging with improved, unified search
  • WebDAV support
  • Direct backup to cloud storage providers
  • Restore individual files from a backup server

Contributing

Bug reports, feature requests, and pull requests are welcome. See CONTRIBUTING.md for development setup instructions.

Directories

Path Synopsis
api module
cmd
weblens command
Package main is the entry point for the Weblens application server.
Package main is the entry point for the Weblens application server.
Package docs Code generated by swaggo/swag.
Package docs Code generated by swaggo/swag.
models
auth
Package auth provides authentication token management for the Weblens system.
Package auth provides authentication token management for the Weblens system.
client
Package client manages websocket client connections and their lifecycle.
Package client manages websocket client connections and their lifecycle.
cover
Package cover manages folder cover photos and their associations.
Package cover manages folder cover photos and their associations.
db
Package db provides MongoDB database operations with context integration and caching support.
Package db provides MongoDB database operations with context integration and caching support.
featureflags
Package featureflags provides feature flag management for Weblens.
Package featureflags provides feature flag management for Weblens.
file
Package file provides file management functionality for the Weblens system.
Package file provides file management functionality for the Weblens system.
filetree
Package filetree provides file tree management functionality for organizing and navigating file hierarchies.
Package filetree provides file tree management functionality for organizing and navigating file hierarchies.
history
Package history provides functionality for tracking and managing file action history.
Package history provides functionality for tracking and managing file action history.
job
Package job defines task identifiers for various background jobs in the Weblens system.
Package job defines task identifiers for various background jobs in the Weblens system.
media
Package media provides media processing and caching functionality.
Package media provides media processing and caching functionality.
share
Package share provides file sharing functionality and permissions management for the Weblens system.
Package share provides file sharing functionality and permissions management for the Weblens system.
tag
Package tag provides file tagging functionality for organizing files across folders.
Package tag provides file tagging functionality for organizing files across folders.
takeout
Package takeout contains types for a zip file of multiple files
Package takeout contains types for a zip file of multiple files
task
Package task provides task and worker pool management for the Weblens application.
Package task provides task and worker pool management for the Weblens application.
tower
Package tower manages tower instances and their connections in the Weblens distributed system.
Package tower manages tower instances and their connections in the Weblens distributed system.
usermodel
Package usermodel provides user account models and operations for the Weblens system.
Package usermodel provides user account models and operations for the Weblens system.
modules
cache
Package cache provides caching utilities using Sturdyc for the Weblens system.
Package cache provides caching utilities using Sturdyc for the Weblens system.
config
Package config provides configuration management for Weblens server settings.
Package config provides configuration management for Weblens server settings.
cryptography
Package cryptography provides cryptographic utilities for generating random values and hashing.
Package cryptography provides cryptographic utilities for generating random values and hashing.
file
Package file provides interfaces and types for file operations in the Weblens system.
Package file provides interfaces and types for file operations in the Weblens system.
netwrk
Package netwrk provides HTTP networking utilities for making requests and handling errors.
Package netwrk provides HTTP networking utilities for making requests and handling errors.
option
Package option provides a generic Option type for representing optional values.
Package option provides a generic Option type for representing optional values.
set
Package set provides a generic set data structure for storing unique values.
Package set provides a generic set data structure for storing unique values.
startup
Package startup provides a mechanism for registering and running initialization functions during application startup.
Package startup provides a mechanism for registering and running initialization functions during application startup.
tests
Package tests provides utility functions for test setup and error recovery in test cases.
Package tests provides utility functions for test setup and error recovery in test cases.
websocket
Package websocket provides WebSocket communication functionality for real-time client-server messaging.
Package websocket provides WebSocket communication functionality for real-time client-server messaging.
wlatomic
Package wlatomic provides a generic atomic value wrapper that allows for thread-safe access to a value of any type.
Package wlatomic provides a generic atomic value wrapper that allows for thread-safe access to a value of any type.
wlcontext
Package wlcontext provides custom error types for context-related operations.
Package wlcontext provides custom error types for context-related operations.
wlerrors
Package wlerrors provides error handling with stack traces.
Package wlerrors provides error handling with stack traces.
wlfs
Package wlfs provides filesystem abstraction and path manipulation utilities.
Package wlfs provides filesystem abstraction and path manipulation utilities.
wlog
Package wlog provides colorized logging utilities for HTTP requests and responses.
Package wlog provides colorized logging utilities for HTTP requests and responses.
wlslices
Package wlslices provides utility functions for working with slices in Go.
Package wlslices provides utility functions for working with slices in Go.
wlstructs
Package wlstructs provides data transfer objects and API request/response structures.
Package wlstructs provides data transfer objects and API request/response structures.
Package routers provides HTTP routing and server startup functionality for the Weblens application.
Package routers provides HTTP routing and server startup functionality for the Weblens application.
api/v1
Package v1 provides the version 1 API routes and handlers for the Weblens application.
Package v1 provides the version 1 API routes and handlers for the Weblens application.
api/v1/backup
Package backup provides REST API handlers for backup operations.
Package backup provides REST API handlers for backup operations.
api/v1/file
Package file provides HTTP handlers for file and folder operations in the Weblens API.
Package file provides HTTP handlers for file and folder operations in the Weblens API.
api/v1/history
Package history provides functionalities for managing and retrieving file history.
Package history provides functionalities for managing and retrieving file history.
api/v1/media
Package media provides handlers for media-related API endpoints.
Package media provides handlers for media-related API endpoints.
api/v1/restuser
Package restuser provides REST API handlers for user operations.
Package restuser provides REST API handlers for user operations.
api/v1/tower
Package tower contains admin REST API handlers for tower management.
Package tower contains admin REST API handlers for tower management.
api/v1/websocket
Package websocket provides WebSocket connection handlers and utilities.
Package websocket provides WebSocket connection handlers and utilities.
router
Package router provides HTTP routing and handler functionality for the Weblens application.
Package router provides HTTP routing and handler functionality for the Weblens application.
test
Package test provides testing utilities for Weblens.
Package test provides testing utilities for Weblens.
web
Package web provides HTTP handlers for serving the Weblens web UI and static content.
Package web provides HTTP handlers for serving the Weblens web UI and static content.
Package services provides WebDAV filesystem implementation for Weblens.
Package services provides WebDAV filesystem implementation for Weblens.
auth
Package auth provides authentication and authorization services for file and share access.
Package auth provides authentication and authorization services for file and share access.
ctxservice
Package ctxservice provides application context and dependency injection for Weblens services.
Package ctxservice provides application context and dependency injection for Weblens services.
file
Package file provides services for managing files, folders, and file operations in the Weblens system.
Package file provides services for managing files, folders, and file operations in the Weblens system.
jobs
Package jobs implements background job tasks.
Package jobs implements background job tasks.
journal
Package journal provides functionalities to manage and retrieve file action histories and lifetimes.
Package journal provides functionalities to manage and retrieve file action histories and lifetimes.
media
Package media provides functionalities related to media processing and management.
Package media provides functionalities related to media processing and management.
notify
Package notify provides websocket notification services for broadcasting events to connected clients.
Package notify provides websocket notification services for broadcasting events to connected clients.
proxy
Package proxy provides functionality to communicate with remote tower instances.
Package proxy provides functionality to communicate with remote tower instances.
reshape
Package reshape provides functions for converting between domain models and API transfer objects.
Package reshape provides functions for converting between domain models and API transfer objects.
tower
Package tower provides services for connecting and communicating with tower instances.
Package tower provides services for connecting and communicating with tower instances.
userservice
Package userservice manages higher level user operations
Package userservice manages higher level user operations

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL