weblens

module
v0.0.0-...-fd4993d Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 License: MIT

README

Weblens

Self-Hosted file manager and photo server

weblens logo

Weblens Fulltest


Overview

Weblens is a self-hosted file management and sharing system that aims to provide a simple and snappy experience.

Features lightning round

  • File management: including history, backup, and restore
  • File sharing with other users and anonymous guests
  • Fast and extensive global search and searching features
  • Clean, productive web interface
  • Media viewing and management, including video and raw photo support, metadata editing, and more
  • API (still likely to include breaking changes with future updates, documentation at /docs/index.html on any running weblens server)
  • Focus on performance and simplicity
  • And plenty of bugs! Oh and more features too
Roadmap
  • Search and organization
    • File and media tagging and improved search
    • Local machine learning support for image recognition
  • Backup
    • Core "emulation" for backup servers
    • Restore individual files from backup server
    • Direct backup to cloud storage providers
  • Improved metadata editing
  • WebDav support

Ready to get started?

Installation

Weblens is distributed as a Docker image. Here is a minimal docker setup to get started:

docker run --name weblens \
-p 8080:8080 \ 
-v {{ /files/on/host }}:/media/users \ 
-v {{ /cache/on/host }}:/media/cache \
-e MONGODB_URI="mongodb://weblens-mongo:27017/?replicaSet=rs0" \ # This is the default, and can be omitted, but you can change it to fit your setup, if needed.
--network weblens-net \
docker.io/ethrous/weblens:latest

Also, Weblens uses MongoDB. This can easily be setup using another container

docker run --name weblens-mongo \ # Name must match the MONGODB_URI above
-v {{ /db/on/host }}:/data/db \
--network weblens-net \
docker.io/ethrous/weblens-mongo:latest

Replace anything above with {{ DOUBLE_BRACES }} with values specific to your setup.

⚠️ Note Having the containers on the same Docker network is extremely helpful. Read how to set up a Docker network. If you wish not to do this, you will have to modify the MONGODB_URI to something routable, and export port 27017 on the mongo container.

If you prefer to use docker-compose or want view the other configuration options, check out the docker-compose.yml example.

Setup

Once you have the containers configured and running, you can begin setting up your Weblens server.

A Weblens server can be configured as a "core" server, or as a "backup" server. A core server is the main server that is used day to day, and an optional backup server is a one that mirrors the contents of 1 or more core servers. Ideally a backup server is physically distant from any core it backs up.

WeblensSetup.png

Weblens Core

If you are new to Weblens, you will want to set up a core server. If instead you want to create an offsite backup, see setup instructions for a Weblens Backup server.

Configuring a core server requires you to create an owner user, give the server a name, and optionally set the server address (e.g. if it is behind a reverse proxy)

CoreSetup.png

And thats it! You will be dropped into the files page, and you can begin uploading and organizing files, and inviting other users to share with.

Weblens Backup

Weblens backup servers are designed to be a simple set-and-forget solution to keep your data safe. Unlike core servers, which need to be accessible on the internet (or via VPN, etc.), a backup server can be setup behind a firewall or on a private network, and just needs to be able to reach the core server.

⚠️ Note that a Backup server requires an existing core server, and for you to be an admin of that server

To configure a backup server, give it a name, the public address of the core server, and an API key generated by the core server.

WeblensBackupConfiguration.png

After setting up your backup, under the "remotes" section of the adming settings on your core server, you can now view the status of your backup server.

In the event of a disaster that takes out your core server, you can perform a "restore" operation on your backup server, and all your data will be restored to a new core server of your choosing. If, instead, you just want protection from accidental deletion of files, a core server has this functionality built in, and would not need a backup server to acomplish this.


Want to contribute?

Visit the contributing instructions for how you can help improve Weblens!

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.
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.
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.
media/agno
Package agno provides CGO bindings for the AGNO image processing library.
Package agno provides CGO bindings for the AGNO image processing library.
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