chore: update readme and add RESTICUI_PORT env var

This commit is contained in:
garethgeorge
2023-11-16 22:07:58 -08:00
parent 53c7f1248f
commit 667d766cd7
2 changed files with 38 additions and 5 deletions
+31 -3
View File
@@ -25,6 +25,28 @@ Feature Support
* [ ] Restore files from a snapshot (use restic UI to identify a snapshot to restore, use restic cli to restore it today)
* [ ] Prune snapshots after backup operations (recommend periodically running `restic prune` on the CLI until this feature is supported)
# Getting Started
## Running
Installation options
* Download a release from the [releases page](https://github.com/garethgeorge/resticui/releases), extract and run the binary (you may need to mark it executable e.g. `chmod +x resticui`).
* Build from source ([see below](#building)).
ResticUI is accessible from a web browser. By default it binds to `0.0.0.0:9898` and can be accessed at `http://localhost:9898`.
# Configuration
**Environment Variables**
* RESTICUI_PORT - the port to bind to. Defaults to 9898.
**Configuration File**
ResticUI uses a JSON config. The default config location is `$HOME/.config/resticui/config.json` or if `$XDG_CONFIG_HOME` is set, `$XDG_CONFIG_HOME/resticui/config.json`.
## Screenshots
Configuring a backup plan:
@@ -36,10 +58,16 @@ Running backup operation:
Browsing snapshots:
![Browse Backup](./screenshots/screenshot-browse.png)
# Dependencies
# Developer Setup
## Dev
## Dev Depedencies
**Basic Dependencies**
* Node.JS for UI development
* Go 1.21 or greater for server development
**To Edit Protobuffers**
```sh
apt install -y protobuf-compiler
go install \
@@ -53,6 +81,6 @@ go install github.com/bufbuild/buf/cmd/buf@v1.27.2
## Building
```sh
(cd webui && npm run build)
(cd webui && npm i && npm run build)
(cd cmd/resticui && go build .)
```
+7 -2
View File
@@ -3,6 +3,7 @@ package main
import (
"context"
"errors"
"fmt"
"io/fs"
"net/http"
"os"
@@ -24,11 +25,15 @@ import (
)
func main() {
port := os.Getenv("RESTICUI_PORT")
if port == "" {
port = "9898"
}
ctx := context.Background()
ctx, cancel := context.WithCancel(ctx)
go onterm(cancel)
if _, err := config.Default.Get(); err != nil {
zap.S().Fatalf("Error loading config: %v", err)
}
@@ -81,7 +86,7 @@ func main() {
// Serve the HTTP gateway
server := &http.Server{
Addr: ":9090",
Addr: fmt.Sprintf(":%s", port),
Handler: mux,
}