Thanks to visit codestin.com
Credit goes to github.com

Skip to content

TnZzZHlp/Ryuri

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

223 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ryuri

[简体中文]

Logo

Ryuri is a self-hosted comic and manga reader server designed for simplicity and compatibility. It allows you to manage your digital collection, read directly in the browser and sync.

Preview

alt text alt text alt text

Features

  • Self-Hosted Library: Organize your comics, manga, and ebooks (supports zip, rar, cbz, cbr, epub).
  • Web Reader: A modern, responsive web interface for reading on any device.
  • Komga Compatibility: Implements the Komga API, allowing you to use clients like Mihon.
  • Progress Tracking: Automatically tracks your reading progress across devices.
  • Content Scanning: Efficiently scans your folders to update your library.

Tech Stack

Backend

  • Language: Rust
  • Framework: Axum
  • Database: SQLite (via SQLx)
  • Key Crates: tokio, tower-http, zip, rar, epub

Frontend

Getting Started

Prerequisites

  • Rust (latest stable)
  • Node.js (v18+ recommended)
  • pnpm (optional, but recommended for frontend)

Development Setup

  1. Clone the repository:

    git clone https://github.com/yourusername/Ryuri.git
    cd Ryuri
  2. Setup Backend:

    cd backend
    # Create a .env file if necessary (check .env.example if available)
    cargo run

    The backend server usually runs on http://localhost:3000 (check main.rs or logs to confirm).

  3. Setup Frontend:

    cd frontend
    pnpm install
    pnpm dev

    The frontend development server will start, usually proxied to the backend.

    The server will start, usually on http://localhost:3000.

Running Binaries from Releases

If you prefer not to build from source, you can download pre-compiled binaries from the GitHub Releases page.

  1. Download the Binary: Go to the GitHub Releases page and download the appropriate binary for your operating system and architecture (e.g., ryuri-linux-amd64 or ryuri-windows-amd64.exe).

  2. Set Environment Variables and Run: Navigate to the directory where you downloaded the binary. Set the necessary environment variables and run the executable. A webpage will be available immediately upon startup, defaulting to listening on port 3000.

    Linux/macOS:

    chmod +x ryuri-linux-amd64
    ./ryuri-linux-amd64

    Windows (PowerShell):

    .\ryuri-windows-amd64.exe

    Important Environment Variables:

    • DATABASE_URL: Specifies the database connection string, e.g., sqlite:ryuri.db?mode=rwc.
    • JWT_SECRET: Crucial for security. Replace with a strong, random string.
    • HOST: (Optional) The host address to bind to (default: 0.0.0.0).
    • PORT: (Optional) The port to listen on (default: 3000).
    • JWT_EXPIRATION_HOURS: (Optional) How long JWT tokens are valid (default: 24).

    The server will start, usually on http://localhost:3000.

Building and Running from Source

To run Ryuri directly from the compiled binary, follow these steps:

  1. Prerequisites: Ensure you have Rust (latest stable) and Node.js (v18+ recommended) with pnpm installed.

  2. Clone the repository:

    git clone https://github.com/yourusername/Ryuri.git
    cd Ryuri
  3. Build Backend (Release Mode): First, build the frontend so its assets can be embedded in the backend binary.

    cd frontend
    pnpm install
    pnpm build
    cd ..

    Then, navigate to the backend directory and build the application in release mode.

    cd backend
    cargo build --release
    cd ..

    The compiled binary will be located at backend/target/release/backend.

  4. Run the Binary: You need to set environment variables for the database and JWT secret before running the application.

    Linux/macOS:

    export DATABASE_URL="sqlite:ryuri.db?mode=rwc"
    export JWT_SECRET="your_secure_random_string_here"
    ./backend/target/release/backend

    Windows (PowerShell):

    $env:DATABASE_URL="sqlite:ryuri.db?mode=rwc"
    $env:JWT_SECRET="your_secure_random_string_here"
    .\backend\target\release\backend.exe

    Important Environment Variables:

    • DATABASE_URL: Specifies the database connection string. For SQLite, sqlite:ryuri.db?mode=rwc will create a ryuri.db file in the current directory.
    • JWT_SECRET: Crucial for security. Replace "your_secure_random_string_here" with a long, random, and unique string. Without a persistent secret, user sessions will be invalidated on every restart.
    • HOST: (Optional) The host address to bind to (default: 0.0.0.0).
    • PORT: (Optional) The port to listen on (default: 3000).
    • JWT_EXPIRATION_HOURS: (Optional) How long JWT tokens are valid (default: 24).

    The server will start, usually on http://localhost:3000.

Deployment (Docker)

You can easily deploy Ryuri using the official Docker image.

  1. Pull the image:

    docker pull ghcr.io/tnzzzhlp/wyuri:latest

    (Note: Replace tnzzzhlp/wyuri with your specific image path if different)

  2. Run the container:

    docker run -d \
      -p 3000:3000 \
      --name ryuri \
      -v ./ryuri-data:/app/data \
      -v /path/to/your/comics:/comics \
      -e DATABASE_URL="sqlite:/app/data/ryuri.db?mode=rwc" \
      -e JWT_SECRET="change-this-to-a-secure-secret" \
      ghcr.io/tnzzzhlp/wyuri:latest

    Environment Variables:

    • DATABASE_URL: Connection string for the database. Ensure it points to a location inside the volume (e.g., /app/data).
    • JWT_SECRET: (Optional) A secure random string for signing authentication tokens (default: random string generated on each startup).
    • JWT_EXPIRATION_HOURS: (Optional) Token expiration time in hours (default: 24).

    Volumes:

    • /app/data: Persistent storage for the database.
    • /comics: (Example) Mount your local comic directories here to add them to your Ryuri library.

API Documentation

Ryuri provides a REST API for all frontend operations. Additionally, it exposes a Komga-compatible API layer under /komga.

  • Standard API: Used by the web frontend for library management, reading, and settings.
  • Limited Komga API support: Support the API required for the Komga plugin in the Mihon APP.

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors 2

  •  
  •