diff --git a/README.md b/README.md index b474500..1f59745 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ A simple admin web UI for [Garage](https://garagehq.deuxfleurs.fr/), a self-host ## Installation -The Garage Web UI is available as a Docker image. You can install it using the command line or with Docker Compose. +The Garage Web UI is available as a single executable binary and docker image. You can install it using the command line or with Docker Compose. ### Docker CLI @@ -42,6 +42,50 @@ services: - 3909:3909 ``` +### Without Docker + +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.1/garage-webui-v1.0.1-linux-amd64 +$ chmod +x garage-webui +$ sudo cp garage-webui /usr/local/bin +``` + +Run the program with specified `garage.toml` config path. + +```sh +$ CONFIG_PATH=./garage.toml garage-webui +``` + +If you want to run the program at startup, you may want to create a systemd service. + +```sh +$ sudo nano /etc/systemd/system/garage-webui.service +``` + +``` +[Unit] +Description=Garage Web UI +After=network.target + +[Service] +Environment="PORT=3919" +Environment="CONFIG_PATH=/etc/garage.toml" +ExecStart=/usr/local/bin/garage-webui +Restart=always + +[Install] +WantedBy=default.target +``` + +Then reload and start the garage-webui service. + +```sh +$ sudo systemctl daemon-reload +$ sudo systemctl enable --now garage-webui +``` + ### Configuration To simplify installation, the Garage Web UI uses values from the Garage configuration, such as `rpc_public_addr`, `admin.admin_token`, `s3_web.root_domain`, etc. diff --git a/misc/build-binaries.sh b/misc/build-binaries.sh new file mode 100755 index 0000000..8c5e774 --- /dev/null +++ b/misc/build-binaries.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +set -e + +BINARY=garage-webui +VERSION=$(cat package.json | grep \"version\" | cut -d'"' -f 4) +PLATFORMS="linux" +ARCHITECTURES="386 amd64 arm arm64" + +echo "Building version $VERSION" + +cd backend && rm -rf dist && mkdir -p dist && cp -r ../dist ./ui/dist + +for PLATFORM in $PLATFORMS; do + for ARCH in $ARCHITECTURES; do + echo "Building $PLATFORM-$ARCH" + + GOOS=$PLATFORM GOARCH=$ARCH go build -o "dist/$BINARY-v$VERSION-$PLATFORM-$ARCH" -tags="prod" main.go + done +done diff --git a/misc/build.sh b/misc/build-docker.sh similarity index 100% rename from misc/build.sh rename to misc/build-docker.sh