all repos — weimar @ 87601e8f1973d0b01106ea99ce63228c88130e1a

Unnamed repository; edit this file 'description' to name the repository.

README.md (view raw)

  1# weimar
  2
  3A single-binary media repository for your home server. Share memes,
  4screenshots, and short videos with your group without uploading to someone
  5else's cloud. Self-host on any Linux machine: all you need is the binary and a
  6place to store files.
  7
  8weimar is inspired by [Chevereto](https://github.com/chevereto/chevereto) but
  9stripped down to the essentials: upload media, tag it, browse a gallery, and
 10share a direct link.
 11
 12## What it looks like
 13
 14The web interface is a modern single-page app with a full-screen image viewer,
 15keyboard navigation, and tag-based discovery. Upload from your phone's browser,
 16browse on your laptop, download originals from anywhere. The design is clean
 17and bold — Swiss typography with red accents.
 18
 19## What you get
 20
 21The core loop is dead simple. Register an account (or have an admin make one
 22for you), upload files through the web form with whatever tags make sense, and
 23they appear in the gallery. Click any thumbnail to open the full image in an
 24overlay viewer: arrow keys to browse, `Esc` to close, click outside to dismiss.
 25
 26Tags are how you find things later. Type a few words when uploading and the
 27autocomplete will suggest tags other people have used. Filter the gallery by
 28clicking tags or adding `?tag=funny` to the URL. Each image gets a permanent
 29page you can share, a download link, and an auto-generated thumbnail.
 30
 31## Where data lives on disk
 32
 33Everything lives in two directories you control: one for the SQLite database
 34(user accounts, sessions, metadata) and one for the image files. Files are
 35stored in a hash-partitioned folder structure (three levels of two-character
 36subdirectories) so no single folder ever gets crowded. The config file points
 37to these locations and you can put them anywhere.
 38
 39## How to install
 40
 41The simplest path is to download a pre-built binary from the releases page.
 42There are builds for Linux and macOS, both amd64 and arm64. Put the binary
 43somewhere in your PATH like `/usr/local/bin/weimar`, make it executable with
 44`chmod +x`, and you're done.
 45
 46If you want to build from source, you'll need Go and Bun. Run `make build` and
 47the binary lands in `bin/weimar`.
 48
 49## How to configure
 50
 51Create a file called `weimar.toml` in the same directory you run the server
 52from. This is the only required step. Everything has sensible defaults.
 53
 54```toml
 55[server]
 56host = "0.0.0.0"
 57port = 8080
 58
 59[database]
 60path = "./data/weimar.db"
 61
 62[storage]
 63path = "./data/images"
 64
 65[upload]
 66max_size_mb = 50
 67
 68[auth]
 69allow_registration = true
 70```
 71
 72If you don't want to bother with a config file at all, you can set every option
 73through environment variables prefixed with `WEIMAR_`. For example,
 74`WEIMAR_SERVER_PORT=9090 weimar serve` overrides the default port.
 75
 76## How to run
 77
 78The first time you start the server, create an admin account with
 79`--admin-email` and `--admin-password`:
 80
 81```bash
 82weimar serve --config weimar.toml --admin-email you@example.com --admin-password s3cur3
 83```
 84
 85This flags only work on the very first run when no users exist yet. After that,
 86admin accounts can be managed through the CLI or by other admins.
 87
 88Once the server is running, open `http://your-server-ip:8080` in a browser.
 89
 90### Running as a systemd service
 91
 92For a proper home-server setup you'll want weimar to start on boot and stay
 93running.
 94
 95```
 96[Unit]
 97Description=weimar media repository
 98After=network.target
 99
100[Service]
101Type=simple
102User=weimar
103Group=weimar
104WorkingDirectory=/home/weimar
105ExecStart=/usr/local/bin/weimar serve
106Restart=on-failure
107RestartSec=5
108
109[Install]
110WantedBy=multi-user.target
111```
112
113Create a dedicated `weimar` system user, place the config and data directories
114under its home folder, enable the service with `systemctl enable weimar`, and
115start it with `systemctl start weimar`.
116
117## Admin commands
118
119User management happens on the command line, not through the web interface.
120
121```bash
122weimar users list
123weimar users create newuser password123
124weimar users create adminuser str0ngp4ss --admin
125weimar users delete bob
126weimar users password-reset alice
127weimar image delete 42
128```
129
130Every command accepts `--config` or `WEIMAR_CONFIG` to point at your config
131file.
132
133## What about video?
134
135weimar handles short videos just fine. It stores them, streams them, and
136generates thumbnails. Thumbnails require `ffmpeg` on the server's PATH. If
137`ffmpeg` isn't available, videos still play in the browser; they just show a
138placeholder instead of a thumbnail in the gallery.
139
140## Things weimar doesn't do
141
142This is intentionally a simple tool. There's no full-text search beyond tags,
143no albums or collections, no user profiles, no comment threads, no federation
144with other servers, no Redis or caching layer, and no Docker image. The
145database is a single SQLite file with one writer at a time: fine for a small
146group, probably not ideal for hundreds of concurrent users.