npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@riligar/elysia-backup

v1.9.0

Published

Elysia plugin for R2/S3 backup with a built-in UI dashboard

Downloads

1,254

Readme

@riligar/elysia-backup

Open Source npm version License: MIT

An open source project by RiLiGar

A powerful Elysia plugin for R2/S3 backup with a beautiful built-in UI dashboard. Designed for Bun runtime with native S3 client for optimal performance.

✨ Features

  • 📁 Smart Backup — Backup local directories to R2/S3 with file filtering
  • 🔄 Scheduled Backups — Cron-based automatic backups
  • 🖥️ Beautiful Dashboard — Modern UI with real-time status
  • 🔐 Secure Authentication — Session-based auth with 2FA/TOTP support
  • 🧭 Guided Onboarding — Multi-step setup wizard for first-time configuration
  • ⬇️ One-Click Restore — Easily restore files from backup
  • 🗑️ Backup Management — Delete old backups from the UI
  • ⚙️ Runtime Configuration — Update settings without restarting

📦 Installation

bun add @riligar/elysia-backup

Peer Dependencies

bun add elysia @elysiajs/html

🚀 Quick Start

import { Elysia } from 'elysia'
import { r2Backup } from '@riligar/elysia-backup'

const app = new Elysia()
    .use(
        r2Backup({
            sourceDir: './data',
            configPath: './backup-config.json',
        })
    )
    .listen(3000)

console.log('🦊 Server running at http://localhost:3000')
console.log('📦 Backup UI at http://localhost:3000/backup')

On first run, you'll be guided through an onboarding wizard to configure:

  • Storage credentials (R2/S3)
  • Backup schedule
  • Admin authentication

⚙️ Configuration

Plugin Options

| Option | Type | Required | Description | | ------------ | ------ | -------- | ------------------------------------------------------------- | | sourceDir | string | ✅ | Local directory to backup | | configPath | string | ❌ | Path to save runtime config (default: ./backup-config.json) |

Runtime Configuration (via UI or backup-config.json)

| Option | Type | Description | | ----------------- | -------- | ---------------------------------------------- | | bucket | string | R2/S3 bucket name | | accessKeyId | string | R2/S3 Access Key ID | | secretAccessKey | string | R2/S3 Secret Access Key | | endpoint | string | R2/S3 Endpoint URL | | prefix | string | Prefix for S3 keys (e.g., backups/) | | extensions | string[] | File extensions to include (empty = all files) | | cronSchedule | string | Cron expression for scheduled backups | | cronEnabled | boolean | Enable/disable scheduled backups | | auth.username | string | Admin username | | auth.password | string | Admin password | | auth.totpSecret | string | TOTP secret for 2FA (optional) |

🔌 API Endpoints

The plugin adds the following routes under /backup:

Pages

| Method | Path | Description | | ------ | -------------------- | ----------------------- | | GET | /backup | Dashboard UI | | GET | /backup/login | Login page | | GET | /backup/onboarding | First-time setup wizard |

Authentication

| Method | Path | Description | | ------ | --------------------- | ----------------- | | POST | /backup/auth/login | Authenticate user | | POST | /backup/auth/logout | End session |

Backup Operations

| Method | Path | Description | | ------ | --------------------- | --------------------------- | | POST | /backup/api/run | Trigger manual backup | | GET | /backup/api/files | List remote backup files | | POST | /backup/api/restore | Restore a specific file | | POST | /backup/api/delete | Delete a remote backup file | | POST | /backup/api/config | Update configuration |

Two-Factor Authentication (TOTP)

| Method | Path | Description | | ------ | --------------------------- | ----------------------------- | | GET | /backup/api/totp/status | Check 2FA status | | POST | /backup/api/totp/generate | Generate new TOTP secret & QR | | POST | /backup/api/totp/verify | Verify and enable 2FA | | POST | /backup/api/totp/disable | Disable 2FA |

🔐 Security Features

Session-Based Authentication

  • Secure session tokens with configurable expiration
  • HTTP-only cookies for session management
  • Automatic session cleanup

Two-Factor Authentication (TOTP)

  • Compatible with any authenticator app (Google Authenticator, Authy, etc.)
  • QR code for easy setup
  • Backup codes support

📂 Project Structure

src/
├── index.js              # Main plugin entry
├── assets/               # Static assets (favicon, logo)
├── views/
│   ├── LoginPage.js      # Login page
│   ├── DashboardPage.js  # Main dashboard
│   ├── OnboardingPage.js # Setup wizard
│   ├── components/       # UI components
│   │   ├── ActionArea.js
│   │   ├── FilesTab.js
│   │   ├── Footer.js
│   │   ├── Head.js
│   │   ├── Header.js
│   │   ├── LoginCard.js
│   │   ├── OnboardingCard.js
│   │   ├── SecuritySection.js
│   │   ├── SettingsTab.js
│   │   └── StatusCards.js
│   └── scripts/          # Client-side JavaScript
│       ├── backupApp.js
│       ├── loginApp.js
│       └── onboardingApp.js

🤝 Contributing

Contributions are welcome! See our GitHub repository for more information.

📄 License

MIT © RiLiGar