Compare commits

...

3 Commits
1.0.8 ... main

Author SHA1 Message Date
b2bc905e3c chore: mark version 1.0.9 2025-04-15 14:04:50 +07:00
59e68455b6 fix: panic when download file 2025-04-15 03:20:04 +07:00
f30d4289f1 docs: update readme 2025-03-19 06:06:34 +07:00
3 changed files with 20 additions and 7 deletions

View File

@ -41,7 +41,7 @@ services:
ports: ports:
- 3900:3900 - 3900:3900
- 3901:3901 - 3901:3901
- 3902:3903 - 3902:3902
- 3903:3903 - 3903:3903
webui: webui:
@ -62,7 +62,7 @@ services:
Get the latest binary from the [release page](https://github.com/khairul169/garage-webui/releases/latest) according to your OS architecture. For example: Get the latest binary from the [release page](https://github.com/khairul169/garage-webui/releases/latest) according to your OS architecture. For example:
```sh ```sh
$ wget -O garage-webui https://github.com/khairul169/garage-webui/releases/download/1.0.8/garage-webui-v1.0.8-linux-amd64 $ wget -O garage-webui https://github.com/khairul169/garage-webui/releases/download/1.0.9/garage-webui-v1.0.9-linux-amd64
$ chmod +x garage-webui $ chmod +x garage-webui
$ sudo cp garage-webui /usr/local/bin $ sudo cp garage-webui /usr/local/bin
``` ```
@ -136,7 +136,11 @@ admin_token = "YOUR_ADMIN_TOKEN_HERE"
metrics_token = "YOUR_METRICS_TOKEN_HERE" metrics_token = "YOUR_METRICS_TOKEN_HERE"
``` ```
However, if it fails to load, you can set these environment variables instead: However, if it fails to load, you can set `API_BASE_URL` & `API_ADMIN_KEY` environment variables instead.
### Environment Variables
Configurable envs:
- `CONFIG_PATH`: Path to the Garage `config.toml` file. Defaults to `/etc/garage.toml`. - `CONFIG_PATH`: Path to the Garage `config.toml` file. Defaults to `/etc/garage.toml`.
- `BASE_PATH`: Base path or prefix for Web UI. - `BASE_PATH`: Base path or prefix for Web UI.

View File

@ -146,11 +146,20 @@ func (b *Browse) GetOneObject(w http.ResponseWriter, r *http.Request) {
return return
} }
w.Header().Set("Content-Type", *object.ContentType)
w.Header().Set("Content-Length", strconv.FormatInt(*object.ContentLength, 10))
w.Header().Set("Cache-Control", "max-age=86400") w.Header().Set("Cache-Control", "max-age=86400")
w.Header().Set("Last-Modified", object.LastModified.Format(time.RFC1123)) w.Header().Set("Last-Modified", object.LastModified.Format(time.RFC1123))
w.Header().Set("Etag", *object.ETag)
if object.ContentType != nil {
w.Header().Set("Content-Type", *object.ContentType)
} else {
w.Header().Set("Content-Type", "application/octet-stream")
}
if object.ContentLength != nil {
w.Header().Set("Content-Length", strconv.FormatInt(*object.ContentLength, 10))
}
if object.ETag != nil {
w.Header().Set("Etag", *object.ETag)
}
_, err = io.Copy(w, object.Body) _, err = io.Copy(w, object.Body)

View File

@ -1,7 +1,7 @@
{ {
"name": "garage-webui", "name": "garage-webui",
"private": true, "private": true,
"version": "1.0.8", "version": "1.0.9",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev:client": "vite", "dev:client": "vite",