storage

module
v0.0.0-...-fa1d128 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2025 License: MIT

README

Storage

A self-hosted file storage server.

Project Goal

The primary goal of this project is to provide an easy-to-use solution for managing personal storage. It allows users to upload, download and secure their files through web interface.

Features

  • Providing basic file and folder operations including create, rename and delete
  • Make your storage become a free cloud
  • Protect your files with user authentication
  • Easy to setup and configure

Installation

Note: Storage uses SQLite3 for database

Docker

Clone the reposity to your storage, change JWT_SECRET and path in file compose.yaml:

backend:
  #...
  environment:
    JWT_SECRET: "change to your secret"
  volumes:
    - /path/to/your/db:/data/data.db # Database
    - /path/to/your/storage:/storage # Directory you want to mount for storage
  #...

Then run:

docker compose up -d
Build from source

Prerequisites:

  • Go (version 1.25.1)
  • SQLite database
  • Nodejs and pnpm

Clone the repository and install dependencies:

git clone https://github.com/SteGG200/storage.git
cd storage
go mod download

Set environment variables for both frontend and backend. List of env is all inside file .env.example and frontend/.env.example Build the project:

./scripts/production_build.sh

Run frontend:

cd frontend/
NODE_ENV=production pnpm start

Frontend will start on port 8080.

Run backend:

./build/storage -database /path/to/your/db -storage /path/to/your/storage

Backend will start on port 3000 by default.

Directories

Path Synopsis
cmd
migrate command
storage command
Package db manages the database of the app
Package db manages the database of the app
Package logger provides logging functionality for the application.
Package logger provides logging functionality for the application.
Package migration provides embedded schema sql files for database migration
Package migration provides embedded schema sql files for database migration
Package server provides functionality for managing server operations.
Package server provides functionality for managing server operations.
config
Package config provides methods for configuring backend
Package config provides methods for configuring backend
exception
Package exception provides some additional errors for specific exceptions
Package exception provides some additional errors for specific exceptions
middleware
Package middleware provides some basic middlewares setup for server-side
Package middleware provides some basic middlewares setup for server-side
mux
Package mux implements HTTP request multiplexer based on standard type http.ServeMux with some additional fields
Package mux implements HTTP request multiplexer based on standard type http.ServeMux with some additional fields
utils
Package utils provides fast and useful utilities for working with specific cases
Package utils provides fast and useful utilities for working with specific cases

Jump to

Keyboard shortcuts

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