Skip to content

Commit

Permalink
chore: rebrand as backrest
Browse files Browse the repository at this point in the history
  • Loading branch information
garethgeorge committed Dec 22, 2023
1 parent c03ddef commit 94f73d4
Show file tree
Hide file tree
Showing 71 changed files with 777 additions and 776 deletions.
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
restora
restora-*
backrest
backrest-*
dist
restora.exe
backrest.exe
6 changes: 3 additions & 3 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ archives:

dockers:
- image_templates:
- garethgeorge/restora:latest
- garethgeorge/restora:{{ .Tag }}
- garethgeorge/backrest:latest
- garethgeorge/backrest:{{ .Tag }}

changelog:
sort: asc
Expand All @@ -56,4 +56,4 @@ changelog:
release:
github:
owner: garethgeorge
name: restora
name: backrest
168 changes: 84 additions & 84 deletions CHANGELOG.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ go install github.com/bufbuild/buf/cmd/buf@v1.27.2

```sh
(cd webui && npm i && npm run build)
(cd cmd/restora && go build .)
(cd cmd/backrest && go build .)
```
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM golang:alpine as gobuild
RUN mkdir /tmp-orig
COPY restora /restora
RUN /restora --install-deps=true
COPY backrest /backrest
RUN /backrest --install-deps=true

FROM scratch
COPY --from=gobuild /root/.local/share/restora/ /.local/share/restora/
COPY --from=gobuild /root/.local/share/backrest/ /.local/share/backrest/
COPY --from=gobuild /tmp-orig /tmp
COPY --from=gobuild /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/

ENTRYPOINT ["/restora"]
COPY restora /restora
ENTRYPOINT ["/backrest"]
COPY backrest /backrest
84 changes: 42 additions & 42 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Restora
# Backrest

[![Build and Test](https://github.com/garethgeorge/restora/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/garethgeorge/restora/actions/workflows/build-and-test.yml)
[![Build and Test](https://github.com/garethgeorge/backrest/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/garethgeorge/backrest/actions/workflows/build-and-test.yml)

Restora is a free and open-source web UI wrapper for [restic](https://restic.net/).
Backrest is a free and open-source web UI wrapper for [restic](https://restic.net/).

**Project goals:**

Expand All @@ -11,7 +11,7 @@ Restora is a free and open-source web UI wrapper for [restic](https://restic.net
* Safe: all backups leverage simple [restic](https://restic.net/) features and have test coverage.
* Easy to pull back the curtain: all common operations should be possible from the UI, but it should be easy to drop down to the command line and use restic directly if needed.
* Lightweight: your backup orchestration should blend into the background. The web UI binary is fully self contained as a single executable and the binary is ~25 MB with very light memory overhead at runtime.
* Runs everywhere: Restora should be able to run on any platform that restic supports and that you need backed up. Restora is originally conceived of as a self-hosted backup tool for NAS devices but runs just as well on an interactive Desktop or Laptop.
* Runs everywhere: Backrest should be able to run on any platform that restic supports and that you need backed up. Backrest is originally conceived of as a self-hosted backup tool for NAS devices but runs just as well on an interactive Desktop or Laptop.

**Platform Support**

Expand All @@ -32,42 +32,42 @@ Restora is a free and open-source web UI wrapper for [restic](https://restic.net

| | |
| -------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| <img src="https://f000.backblazeb2.com/file/gshare/screenshots/restora-backup-view.png" width="400px"/> | <img src="https://f000.backblazeb2.com/file/gshare/screenshots/restora-add-repo.png" width="400px" /> |
| <img src="https://f000.backblazeb2.com/file/gshare/screenshots/restora-realtime-progress.png" width="400px" /> | <img src="https://f000.backblazeb2.com/file/gshare/screenshots/restora-add-plan.png" width="400px" /> |
| <img src="https://f000.backblazeb2.com/file/gshare/screenshots/backrest-backup-view.png" width="400px"/> | <img src="https://f000.backblazeb2.com/file/gshare/screenshots/backrest-add-repo.png" width="400px" /> |
| <img src="https://f000.backblazeb2.com/file/gshare/screenshots/backrest-realtime-progress.png" width="400px" /> | <img src="https://f000.backblazeb2.com/file/gshare/screenshots/backrest-add-plan.png" width="400px" /> |

# Getting Started

Restora is packaged as a single executable. It can be run directly on Linux, MacOS, and Windows with no dependencies. [restic](https://github.com/restic/restic) will be downloaded and installed automatically on first run.
Backrest is packaged as a single executable. It can be run directly on Linux, MacOS, and Windows with no dependencies. [restic](https://github.com/restic/restic) will be downloaded and installed automatically on first run.

Download options

* Download and run a release from the [releases page](https://github.com/garethgeorge/restora/releases).
* Download and run a release from the [releases page](https://github.com/garethgeorge/backrest/releases).
* Build from source ([see below](#building)).
* Run with docker: `garethgeorge/restora:latest` ([see on dockerhub](https://hub.docker.com/repository/docker/garethgeorge/restora/))
* Run with docker: `garethgeorge/backrest:latest` ([see on dockerhub](https://hub.docker.com/repository/docker/garethgeorge/backrest/))

Restora is accessible from a web browser. By default it binds to `0.0.0.0:9898` and can be accessed at `http://localhost:9898`.
Backrest is accessible from a web browser. By default it binds to `0.0.0.0:9898` and can be accessed at `http://localhost:9898`.

## Running with Docker Compose

Docker image: https://hub.docker.com/garethgeorge/restora
Docker image: https://hub.docker.com/garethgeorge/backrest

<details>
Example compose file:

```yaml
version: "3.2"
services:
restora:
image: garethgeorge/restora
container_name: restora
backrest:
image: garethgeorge/backrest
container_name: backrest
volumes:
- ./restora/data:/data
- ./restora/config:/config
- ./restora/cache:/cache
- ./backrest/data:/data
- ./backrest/config:/config
- ./backrest/cache:/cache
- /MY-BACKUP-DATA:/userdata # mount your directories to backup somewhere in the filesystem
environment:
- RESTORA_DATA=/data # path for restora data. restic binary and the database are placed here.
- RESTORA_CONFIG=/config/config.json # path for the restora config file.
- BACKREST_DATA=/data # path for backrest data. restic binary and the database are placed here.
- BACKREST_CONFIG=/config/config.json # path for the backrest config file.
- XDG_CACHE_HOME=/cache # path for the restic cache which greatly improves performance.
restart: unless-stopped
```
Expand All @@ -77,33 +77,33 @@ services:
<details>
Download a release from the [releases page](https://github.com/garethgeorge/restora/releases)
Download a release from the [releases page](https://github.com/garethgeorge/backrest/releases)
#### Run on startup with cron (Basic)
Move the restora binary to `/usr/local/bin`:
Move the backrest binary to `/usr/local/bin`:

```sh
sudo mv restora /usr/local/bin/restora
sudo mv backrest /usr/local/bin/backrest
```

Add the following line to your crontab (e.g. `crontab -e`):

```sh
@reboot /usr/local/bin/restora
@reboot /usr/local/bin/backrest
```

#### Run on startup with systemd (Recommended)



Download a Linux release from the [releases page](https://github.com/garethgeorge/restora/releases). Move the restora binary to `/usr/local/bin`:
Download a Linux release from the [releases page](https://github.com/garethgeorge/backrest/releases). Move the backrest binary to `/usr/local/bin`:

```sh
sudo mv restora /usr/local/bin/restora
sudo mv backrest /usr/local/bin/backrest
```

Create a systemd service file at `/etc/systemd/system/restora.service` with the following contents:
Create a systemd service file at `/etc/systemd/system/backrest.service` with the following contents:

```ini
[Unit]
Expand All @@ -114,7 +114,7 @@ After=network.target
Type=simple
User=<your linux user>
Group=<your linux group>
ExecStart=/usr/local/bin/restora
ExecStart=/usr/local/bin/backrest
[Install]
WantedBy=multi-user.target
Expand All @@ -123,8 +123,8 @@ WantedBy=multi-user.target
Then run the following commands to enable and start the service:

```sh
sudo systemctl enable restora
sudo systemctl start restora
sudo systemctl enable backrest
sudo systemctl start backrest
```

Note: you can set the linux user and group to your primary user (e.g. `whoami` when logged in).
Expand All @@ -135,45 +135,45 @@ Note: you can set the linux user and group to your primary user (e.g. `whoami` w

<details>

Download a Darwin release from the [releases page](https://github.com/garethgeorge/restora/releases) and install it to `/usr/local/bin`.
Download a Darwin release from the [releases page](https://github.com/garethgeorge/backrest/releases) and install it to `/usr/local/bin`.

At the moment there is no automated way to run Restora on startup on MacOS. You can run it manually or create a launch agent to run it on startup. See [lingon](https://www.peterborgapps.com/lingon/) for a GUI tool to create a launch agent that runs Restora at startup.
At the moment there is no automated way to run Backrest on startup on MacOS. You can run it manually or create a launch agent to run it on startup. See [lingon](https://www.peterborgapps.com/lingon/) for a GUI tool to create a launch agent that runs Backrest at startup.

</details>

## Running on Windows

<details>

Download a Windows release from the [releases page](https://github.com/garethgeorge/restora/releases) and install it to `C:\Program Files\Restora\restora.exe` (create the path if it does not exist).
Download a Windows release from the [releases page](https://github.com/garethgeorge/backrest/releases) and install it to `C:\Program Files\Backrest\backrest.exe` (create the path if it does not exist).

To run the binary on login, create a shortcut to the binary and place it in the `shell:startup` folder. See [this windows support article](https://support.microsoft.com/en-us/windows/add-an-app-to-run-automatically-at-startup-in-windows-10-150da165-dcd9-7230-517b-cf3c295d89dd) for more details.

warning: Restora is not tested on Windows to the same bar as Linux and MacOS. Please report any issues you encounter. Some folders may not be accessible to Restora or to restic on Windows due to permissions issues.
warning: Backrest is not tested on Windows to the same bar as Linux and MacOS. Please report any issues you encounter. Some folders may not be accessible to Backrest or to restic on Windows due to permissions issues.

</details>

# Configuration

## Environment Variables

* `RESTORA_PORT` - the port to bind to. Defaults to 9898.
* `RESTORA_CONFIG` - the path to the config file. Defaults to `$HOME/.config/restora/config.json` or if `$XDG_CONFIG_HOME` is set, `$XDG_CONFIG_HOME/restora/config.json`.
* `RESTORA_DATA` - the path to the data directory. Defaults to `$HOME/.local/share/restora` or if `$XDG_DATA_HOME` is set, `$XDG_DATA_HOME/restora`.
* `RESTORA_RESTIC_COMMAND` - the path to the restic binary. Defaults managed version of restic which will be downloaded and installed in the data directory.
* `BACKREST_PORT` - the port to bind to. Defaults to 9898.
* `BACKREST_CONFIG` - the path to the config file. Defaults to `$HOME/.config/backrest/config.json` or if `$XDG_CONFIG_HOME` is set, `$XDG_CONFIG_HOME/backrest/config.json`.
* `BACKREST_DATA` - the path to the data directory. Defaults to `$HOME/.local/share/backrest` or if `$XDG_DATA_HOME` is set, `$XDG_DATA_HOME/backrest`.
* `BACKREST_RESTIC_COMMAND` - the path to the restic binary. Defaults managed version of restic which will be downloaded and installed in the data directory.
* `XDG_CACHE_HOME` -- the path to the cache directory. This is propagated to restic.

# Usage

## Adding a Repository

A restora repository maps to the concept of a restic repository (and is indeed a restic repo under-the-hood). A repository is a location where restora will store your backups.
A backrest repository maps to the concept of a restic repository (and is indeed a restic repo under-the-hood). A repository is a location where backrest will store your backups.

To add a repository, click the "Add Repository" button on the side nav. You will be prompted to enter a name for the repository and a path to the repository. The path can be a local path or a remote path (e.g. an S3 bucket). See the [restic docs](https://restic.readthedocs.io/en/stable/030_preparing_a_new_repo.html) for more details on the types of repositories that restic supports. Restora allows you to configure environment variables which should be used to pass additional credentials for remote repositories. For example, if you are using an S3 bucket, you can configure the `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` environment variables to pass your AWS credentials to restic.
To add a repository, click the "Add Repository" button on the side nav. You will be prompted to enter a name for the repository and a path to the repository. The path can be a local path or a remote path (e.g. an S3 bucket). See the [restic docs](https://restic.readthedocs.io/en/stable/030_preparing_a_new_repo.html) for more details on the types of repositories that restic supports. Backrest allows you to configure environment variables which should be used to pass additional credentials for remote repositories. For example, if you are using an S3 bucket, you can configure the `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` environment variables to pass your AWS credentials to restic.

## Adding a Plan

A plan is a new concept introduced by restora. A plan is a set of rules for backing up data. A plan can be configured to backup one or more directories to a single repository. Each plan has it's own schedule and retention policy controlling when backups are run and how long backups are kept.
A plan is a new concept introduced by backrest. A plan is a set of rules for backing up data. A plan can be configured to backup one or more directories to a single repository. Each plan has it's own schedule and retention policy controlling when backups are run and how long backups are kept.

To add a plan, click the "Add Plan" button on the side nav. You will be prompted to enter a name for the plan and select a repository to backup to. You will then be prompted to select one or more directories to backup. A default retention policy is given but you can also pick between time based retention or keeping a configurable number of snapshots.

Expand All @@ -183,7 +183,7 @@ Backups are run automatically based on the scheduled specified in your plan. You

## Best Practices

* Configure a reasonable retention policy for each plan. Restora performs well up to a history of ~1000s of snapshots but too many may eventually slow performance.
* Backup your configuration (e.g. `$RESTORA_CONFIG` or `$HOME/.config/restora/config.json` by default on Linux/MacOS)
* Configure a reasonable retention policy for each plan. Backrest performs well up to a history of ~1000s of snapshots but too many may eventually slow performance.
* Backup your configuration (e.g. `$BACKREST_CONFIG` or `$HOME/.config/backrest/config.json` by default on Linux/MacOS)
* Your configuration contains the encryption keys for your repositories. If you loose this file you will not be able to restore your backups.
* You may alternatively backup your encryption keys individually in which case you will be able to use restic directly to restore your backups.
12 changes: 6 additions & 6 deletions restora.go → backrest.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ import (
"syscall"

rice "github.com/GeertJohan/go.rice"
"github.com/garethgeorge/restora/internal/api"
"github.com/garethgeorge/restora/internal/config"
"github.com/garethgeorge/restora/internal/oplog"
"github.com/garethgeorge/restora/internal/orchestrator"
"github.com/garethgeorge/restora/internal/resticinstaller"
"github.com/garethgeorge/backrest/internal/api"
"github.com/garethgeorge/backrest/internal/config"
"github.com/garethgeorge/backrest/internal/oplog"
"github.com/garethgeorge/backrest/internal/orchestrator"
"github.com/garethgeorge/backrest/internal/resticinstaller"
"github.com/mattn/go-colorable"
"go.etcd.io/bbolt"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
)

var (
installOnly = flag.Bool("install-deps", false, "Install restora and exit")
installOnly = flag.Bool("install-deps", false, "Install backrest and exit")
)

func main() {
Expand Down
8 changes: 4 additions & 4 deletions gen/go/types/value.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions gen/go/v1/config.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 94f73d4

Please sign in to comment.