mirror of
https://github.com/khairul169/garage-webui.git
synced 2025-05-15 06:59:32 +07:00
Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
b2bc905e3c | |||
59e68455b6 | |||
f30d4289f1 |
10
README.md
10
README.md
@ -41,7 +41,7 @@ services:
|
||||
ports:
|
||||
- 3900:3900
|
||||
- 3901:3901
|
||||
- 3902:3903
|
||||
- 3902:3902
|
||||
- 3903:3903
|
||||
|
||||
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:
|
||||
|
||||
```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
|
||||
$ sudo cp garage-webui /usr/local/bin
|
||||
```
|
||||
@ -136,7 +136,11 @@ admin_token = "YOUR_ADMIN_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`.
|
||||
- `BASE_PATH`: Base path or prefix for Web UI.
|
||||
|
@ -146,11 +146,20 @@ func (b *Browse) GetOneObject(w http.ResponseWriter, r *http.Request) {
|
||||
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("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)
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "garage-webui",
|
||||
"private": true,
|
||||
"version": "1.0.8",
|
||||
"version": "1.0.9",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev:client": "vite",
|
||||
|
Loading…
x
Reference in New Issue
Block a user