Skip to content

ShoshinNikita/rview

Repository files navigation

Rview - web-based UI for Rclone


More screenshots here


Features

  • 🖼️ Automatic thumbnail generation: You don't have to download hundreds of MiBs to preview your photos. Image thumbnails are generated with the help of libvips, an extremely fast image processing library.
  • 🔍 Search: You can search for files by name. Search tips can be found here.
  • 📱 Responsive: UI is designed to be responsive, which means you can browse you files on both desktop and mobile.
  • 🪶 Lightweight & minimalistic: All pages are rendered on the server side using Go templates. JavaScript is used only to make the UI interactive.

Limitations

  • Rview is read-only and there are no plans to change that. You should use Rclone directly to upload, edit, or delete files.
  • Rview does not provide any authentication mechanism. It is therefore highly recommended to use a proxy such as Nginx or Caddy. Placing Rview behind a proxy also allows gzip compression, which sometimes can significantly improve response time.

Demo

Check out the live demo here, credentials for Basic Auth: rview:rview.

Run

  1. You have to install docker and docker compose.

  2. Let's consider you use Rclone S3 backend, and your ~/.config/rclone/rclone.conf looks like this:

    [my-s3]
    type = s3
    provider = Other
    access_key_id = <key id>
    secret_access_key = <access key>
    endpoint = <endpoint>
  3. Create docker-compose.yml with the following content:

    version: "2"
    services:
      rview:
        image: ghcr.io/shoshinnikita/rview:main
        container_name: rview
        volumes:
          - ./var:/srv/var                                          # mount app data directory
          - ~/.config/rclone/rclone.conf:/config/rclone/rclone.conf # mount Rclone config file
        ports:
          - "127.0.0.1:8080:8080"
        command: "--rclone-target=my-s3:" # pass Rclone target from the config file
  4. Run this command:

    docker compose up
  5. Go to http://localhost:8080.

Advanced

You can run Rview with an existing Rclone instance and without access to the internet. Read more here.

Configuration

--rclone-target                   Rclone target, required

--rclone-url                      Url of an existing rclone instance, optional. If url is
                                  not specified, a local rclone instance will be launched
                                  with the default config file. Url should include credentials
                                  for Basic Auth, e.g., http://user:pass@rclone:80

--dir                             Directory for app data: thumbnails and etc. (default: ./var)

--port                            Server port (default: 8080)

--image-preview-mode              Available image preview modes:
                                    - thumbnails (default): generate thumbnails
                                    - original: show original images
                                    - none: don't show preview for images

--thumbnails-max-age-days         Max age of thumbnails, days (default: 365)

--thumbnails-max-total-size-mb    Max total size of thumbnails, MiB (default: 500)

--thumbnails-workers-count        Number of workers for thumbnail generation (default: # of threads)

--read-static-files-from-disk     Read static files directly from disk

--debug-log-level                 Display debug log messages

--version                         Print version and exit

Development

First, you have to install the following dependencies:

  1. Rclone - instructions can be found here.

  2. libvips - you can install it with this command:

    sudo apt-get install libvips-tools

After completion of these steps you should be able to run Rview:

# Build and run
make build && make run
# Or just
make

# Build, run tests and lint code
make check

By default make run uses environment variables from .env file. You can redefine these variables via .env.local file.

API

API-endpoints exposed by Rview:

  • GET /api/dir/<path>?mod_time=<unix_time> - get directory info
  • GET /api/file/<path>?mod_time=<unix_time> - get original file
  • GET /api/thumbnail/<path>?mod_time=<unix_time> - get image thumbnail
  • GET /api/search?search=<search>&dir-limit=3&file-limit=7 - search files by name
  • POST /api/search/refresh-indexes - refresh search indexes

Response models can be found in web/models.go.

Metrics

Rview exposes Prometheus metrics on /debug/metrics. The list of all metrics can be found here

Thanks

Special thanks to these open-source projects:

  • Rclone - rsync for cloud storage.
  • Material Icon Theme - Material Design icons for VS Code.
  • Feather - Simply beautiful open source icons.
  • libvips - A fast image processing library with low memory needs.