- Rust 63.8%
- JavaScript 28.8%
- HTML 7.4%
| .idea | Add image tags to Json output of API | |
| package | Add config option for number of database connections | |
| src | Convert OsStr of filename to a displayable string first to avoid failing on non UTF-8 filenames | |
| static | Add keybindings for fullscreen view | |
| .gitignore | Add Cargo.lock | |
| Cargo.lock | Convert OsStr of filename to a displayable string first to avoid failing on non UTF-8 filenames | |
| Cargo.toml | Convert OsStr of filename to a displayable string first to avoid failing on non UTF-8 filenames | |
| README.md | Add config option for number of database connections | |
Simple Rocket Gallery
A simple dynamic web application that generates a gallery view out of a folder.
Images in sub folders are assigned a tag with the name of the parenting folder.
For example an image with the relative path of maid/twitter/123456789.jpg will get the tags maid and twitter.
Usage
Images can be shown full screen by clicking on them.
Esc closes the full screen view.
LeftArray and RightArrow allow to navigate through pictures in fullscreen view.
Components
Two components make up this application.
- Server side API implemented with rocket
- Client side frontend using JavaScript
Setup
Configuration
Configuration is done via the Rocket.toml file located in the current execution directory.
Location can be specified by setting ROCKET_CONFIG environment variable.
Example config
[default]
image_path = "../../Pictures/"
assets_path = "./static/"
extensions = ["png", "jpg", "jpeg", "webp"]
db_url = "image_cache.sqlite"
url_prefix = "http://localhost:8076"
port = 8076
adress = "127.0.0.1"
connections = 128
Rocket Gallery specific configuration options:
image_pathis the folder with your imagesassets_path: path whereindex.htmlandgallery.jsare locatedextensions: the file extensions to interpret as images (any file-type supported by the image crate is supported)db_url: location of the sqlite databaseurl_prefix: this should be the URL where your application is exposed to the user. Useful, if you're running it behind a reverse proxy like nginx.connections: number of database connections to open
Package Manager
An Arch Linux PKGBUILD is available here: MaidLucy/rocket-gallery-PKGBUILD
Packages for Arch Linux are available on the releases page.
From Source
- Clone the repository
- Compile
cargo run --release
Credits
- Bootstrap for CSS needs.