Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

AOSSIE-Org/ThruBox-Server

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AOSSIE

 

Static Badge

Telegram Badge    X (formerly Twitter) Badge    Discord Badge    LinkedIn Badge    Youtube Badge

OpenSSF Scorecard    Best Practices    Protected by Gitleaks


ThruBox Server

A simple, self-hostable relay server that acts as a dumb encrypted mailbox. Any application can use it to pass encrypted data between users. The server never sees plaintext — all encryption/decryption happens client-side.


🚀 Features

  • Encrypted Message Relay: Store and retrieve opaque encrypted payloads via simple REST endpoints
  • Self-Hostable: Single binary, embedded SQLite, zero external dependencies
  • Configurable TTL: Auto-purge messages after N days, or set to 0 for permanent storage
  • Rate Limiting: Built-in IP-based rate limiting to prevent abuse
  • API Key Auth: Optional API key authentication for private relays
  • Docker Ready: Dockerfile and Docker Compose included

💻 Tech Stack

Backend

  • Go 1.22+
  • SQLite (embedded, WAL mode) via mattn/go-sqlite3
  • net/http (standard library)

Infrastructure

  • Docker + Docker Compose
  • GitHub Actions CI/CD

🏗️ Architecture Diagram

graph TD
    Client["Client / SDK"] -->|HTTP| MW1["API Key Middleware"]
    MW1 --> MW2["Rate Limiter"]
    MW2 --> Mux["net/http ServeMux"]
    Mux -->|"POST /api/messages"| H1["Create Message"]
    Mux -->|"GET /api/messages/:address"| H2["Get by Address"]
    Mux -->|"DELETE /api/messages/:id"| H3["Delete Message"]
    Mux -->|"GET /health"| H4["Health Check"]
    H1 & H2 & H3 --> Store["Store Interface"]
    Store --> SQLite["SQLiteStore (WAL mode)"]
    BG["Hourly Purge Goroutine"] --> Store
Loading

🔄 API Endpoints

Method Endpoint Description
POST /api/messages Store a new encrypted message
GET /api/messages/:address Fetch all messages for a wallet address
DELETE /api/messages/:id Delete a specific message
GET /health Server health check

Send a Message

curl -X POST http://localhost:3000/api/messages \
  -H "Content-Type: application/json" \
  -d '{"to": "0xRecipient", "from": "0xSender", "payload": "encrypted_base64_data"}'

Fetch Messages

curl http://localhost:3000/api/messages/0xRecipient

Delete a Message

curl -X DELETE http://localhost:3000/api/messages/<message-id>

🔗 Repository Links

  1. ThruBox Server — This repository (relay server)
  2. ThruBox Client — TypeScript SDK

🍀 Getting Started

Prerequisites

  • Go 1.22+ with CGo enabled (required for SQLite)
  • GCC (for compiling go-sqlite3)
  • Docker (optional, for containerized deployment)

Installation

1. Clone the Repository

git clone https://github.com/AOSSIE-Org/ThruBox-Server.git
cd ThruBox-Server

2. Install Dependencies

go mod download

3. Build and Run

go build -o relay-server ./cmd/relay
./relay-server

The server starts on http://localhost:3000 with a SQLite database that auto-creates at ./data/relay.db.

4. Docker (Alternative)

docker compose up -d

Configuration

Edit config.yaml or use environment variables:

Setting YAML Key Env Variable Default
Server port server.port RELAY_SERVER_PORT 3000
Server host server.host RELAY_SERVER_HOST 0.0.0.0
Storage path storage.path RELAY_STORAGE_PATH ./data/relay.db
Message TTL messages.ttl_days RELAY_MESSAGES_TTL_DAYS 7 (0 = forever)
Max payload messages.max_payload_size RELAY_MESSAGES_MAX_PAYLOAD_SIZE 524288 (500KB)
Rate limit security.rate_limit RELAY_SECURITY_RATE_LIMIT 30 req/min/IP
API key security.api_key RELAY_SECURITY_API_KEY `` (disabled)

🙌 Contributing

⭐ Don't forget to star this repository if you find it useful! ⭐

Thank you for considering contributing to this project! Contributions are highly appreciated and welcomed. To ensure smooth collaboration, please refer to our Contribution Guidelines.


✨ Maintainers


📍 License

This project is licensed under the GNU General Public License v3.0. See the LICENSE file for details.


💪 Thanks To All Contributors

Thanks a lot for spending your time helping ThruBox grow. Keep rocking 🥂

Contributors

© 2025 AOSSIE

About

A Minimal Relay Server

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.