Skip to content

rafal06/grasswave

Repository files navigation

Grasswave CDN

A stupidly simple and easy to self-host, personal server for file hosting on the web. Written in Rust.

Thanks, @Maciejowski, for the stylesheet!

Screenshots

screenshot of the main page

Show more

Mobile layout

mobile layout

Search

search

Tag search

tag search

Installation

Docker (recommended)

  1. Install Docker
  2. Create a new directory and, inside it, a file called docker-compose.yml
  3. Copy the following contents into that file:
version: '3.3'

services:
  grasswave:
    image: rafal06/grasswave:latest
    container_name: grasswave
    restart: unless-stopped
    ports:
      - '7000:7000'
    volumes:
      - ./data:/data
  1. Start the container with the command docker compose up -d
  2. Copy the files for serving to the ./data/files directory (see the section How to use)
  3. If the container is not starting, check the logs with docker compose logs

Compile from source

  1. Install the Rust toolchain
  2. Clone this repository
  3. Create the files folder and put your files inside (see How to use)
  4. Run cargo run --release
  5. This will compile and run the project

How to use

For every file you want to publish, create a seperate directory in the files folder, and place the files inside of them. In every directory, create a file named info.toml.

files
├── lorem
│   ├── lorem.tar.xz
│   └── info.toml
├── ipsum
│   ├── info.toml
│   └── ipsum.tar.xz
└── dolor
    ├── info.toml
    └── dolor.tar.xz

In the toml files, set the name and description to display, and the name of the file to publish, in the following format:

name = "Lorem"
description = "Lorem ipsum dolor sit amet"
tags = ["lorem", "ipsum", "dolor"]
path = "lorem.tar.xz"

Run the executable, and that's it! You can visit it in the browser at the link displayed in the terminal.

You can configure it in a config file created automatically on the first run.

Default config
displayed_name = "Grasswave CDN"
files_path = "files"
accent_colors = ["#1D9F00", "#4DE928"]
http_port = 7000