Skip to content

Commit

Permalink
update site
Browse files Browse the repository at this point in the history
  • Loading branch information
j-keck committed Feb 23, 2020
1 parent db08ea4 commit be66f80
Show file tree
Hide file tree
Showing 10 changed files with 199 additions and 142 deletions.
62 changes: 37 additions & 25 deletions README.org
Original file line number Diff line number Diff line change
@@ -1,47 +1,59 @@
* ~zfs-snap-diff~

This branch contains the next ~zfs-snap-diff~ version: ~1.0.0~.
It's a complete rewrite:
helps you with your zfs snapshots.

- backend is implemented in [[https://golang.org][Go]] (as before)
- frontend in [[http://purescript.org][PureScript]] (with [[https://pursuit.purescript.org/packages/purescript-react-basic][react-basic]])
** Documentation

For more information see: [[https://j-keck.github.io/zfs-snap-diff/]]
See the [[https://j-keck.github.io/zfs-snap-diff/][website]] for more details.

** Prebuild
** Get it

You can download a prebuild version from: [[https://j-keck.github.io/zfs-snap-diff/docs/install]]
*** Prebuild

** Build from source
You can download a prebuild version from: [[https://j-keck.github.io/zfs-snap-diff/docs/install]]

You need only ~go~ to build this project.
I compile the frontend code to javascript and decode it in ~pkg/webapp/bindata.go~.
*** Build from source

*** Build with ~go~
The backend from ~zfs-snap-diff~ is implemented in [[https://golang.org][Go]], the frontend in [[http://purescript.org][PureScript]].

- clone this repo: ~git clone -b dev https://github.com/j-keck/zfs-snap-diff~
- change to the checkout directory: ~cd zfs-snap-diff~
- build it: ~go build -ldflags="-X main.version=$(git describe)" ./cmd/zfs-snap-diff~
**** Build with ~go~

The optional ~-ldflags="-X main.version=$(git describe)"~ flag updates the ~version~ string in the binary.
I use [[https://github.com/go-bindata/go-bindata][go-bindata]] to decode the frontend code and all dependencies to a
go source file so you need only the go compiler to compile it yourself.

*** Build with ~nix~
The minimum supported go version is =go1.12=.

The ~nix~ build also compiles the frontend to javascript and decode it in ~pkg/webapp/bindata.go~.
- clone this repo: ~git clone https://github.com/j-keck/zfs-snap-diff~
- ~cd zfs-snap-diff~
- build it: ~go build -ldflags="-X main.version=$(git describe)" ./cmd/zfs-snap-diff~

- clone this repo: ~git clone -b dev https://github.com/j-keck/zfs-snap-diff~
- change to the checkout directory: ~cd zfs-snap-diff~
- build it: ~nix-build -A zfs-snap-diff~
The optional ~-ldflags="-X main.version=$(git describe)"~ flag updates the ~version~ string in the binary.

To crosscompile the binary for

- FreeBSD: ~nix-build -A zfs-snap-diff --argstr goos freebsd~
- MacOS: ~nix-build -A zfs-snap-diff --argstr goos darwin~
- Solaris: ~nix-build -A zfs-snap-diff --argstr goos solaris~
**** Build with ~nix~

I use [[https://nixos.org/nix/][nix]] to build my projects. The ~nix~ build also compiles the frontend
to javascript and decode it in ~pkg/webapp/bindata.go~.

- clone this repo: ~git clone https://github.com/j-keck/zfs-snap-diff~
- ~cd zfs-snap-diff~
- build it: ~nix-build -A zfs-snap-diff~

The build artifacts ~zfs-snap-diff~ and ~zsd~ are in ~./result/bin/~.

To crosscompile the binary for

- FreeBSD: ~nix-build -A zfs-snap-diff --argstr goos freebsd~
- MacOS: ~nix-build -A zfs-snap-diff --argstr goos darwin~
- Solaris: ~nix-build -A zfs-snap-diff --argstr goos solaris~


** Run it

~./zfs-snap-diff <POOL>~
#+BEGIN_SRC sh
./zfs-snap-diff [OPTIONS] <ZFS_DATASET_NAME>
#+END_SRC

This starts a embedded webserver and serves the included web-app at http://127.0.0.1:12345.

[[./doc/site/static/images/browse-filesystem.png][file:./doc/site/static/images/browse-filesystem.png]]
2 changes: 1 addition & 1 deletion cmd/zfs-snap-diff/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type CliConfig struct {
func main() {
zfsSnapDiffBin := os.Args[0]
flag.Usage = func() {
fmt.Fprintf(os.Stderr, "zfs-snap-diff - web application to find older versions of a given file in your zfs snapshots.\n")
fmt.Fprintf(os.Stderr, "zfs-snap-diff - web application to find older file versions zfs snapshot and zfs snapshot management tool.\n")
fmt.Fprintf(os.Stderr, "\nUSAGE:\n %s [OPTIONS] <ZFS_DATASET_NAME>\n\n", zfsSnapDiffBin)
fmt.Fprint(os.Stderr, "OPTIONS:\n")
flag.PrintDefaults()
Expand Down
22 changes: 16 additions & 6 deletions doc/site/content/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,32 @@ creator = "Emacs 26.3 (Org mode 9.1.9 + ox-hugo)"
weight = 10
+++

{{< hint danger >}}
This describes the currently ****unreleased beta version****.
{{< /hint >}}
`zfs-snap-diff` helps you with your zfs snapshots.


## Find file versions {#find-file-versions}

`zfs-snap-diff` searches different file versions in your zfs snapshots for you.

If you have hundreds or thousands of zfs snapshots, `zfs-snap-diff` searched
the snapshots and shows you only the snapshots where a given file was modified.

To speedup this process, it performs the search incremental when you request an older file version.

You can inspect a diff from the actual file version to the older file version in the
snapshot, revert a single change or restore a whole file.

`zfs-snap-diff` has a web frontend, so it can run on your local work machine or on your

## Management {#management}

You can create and destroy zfs snapshots, use the integrated directory browser to
navigate in your snapshots (directory history) and download a directory as a zip-archive.


## Simply use {#simply-use}

[`zfs-snap-diff`](/docs/zfs-snap-diff) has a web frontend, so it can run on your local work machine or on your
remote file / backup server (no Xserver necesarry). To keep it portable it's made
as a single static compiled executable.

For a quick file version lookup / restore in the terminal, it contains the independent [`zsd`](/docs/zsd) cli tool.

{{< figure src="/images/zfs-snap-diff.gif" alt="Example session from zfs-snap-diff" link="/images/zfs-snap-diff.gif" >}}
7 changes: 5 additions & 2 deletions doc/site/content/docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@ creator = "Emacs 26.3 (Org mode 9.1.9 + ox-hugo)"
weight = 50
+++

## 1.0.0-beta (unreleased) {#1-dot-0-dot-0-beta--unreleased}
## 1.0.0 {#1-dot-0-dot-0}

{{< hint info >}}
This version is a complete rewrite.

The backend is implemented in [Go](https://golang.org) (as before) and the frontend in [PureScript](http://purescript.org).
{{< /hint >}}

If you have any questions, trouble or other input, feel free to open an
issue, contact me per mail (see my github profile), or [keybase.io](https://keybase.io/jkeck).

- create and destroy snapshots from the webapp

- download a complete directory as a zip-archive
Expand All @@ -29,7 +32,7 @@ The backend is implemented in [Go](https://golang.org) (as before) and the front

- works now also with 'legacy' mountpoints

[all commits from 0.0.10...dev](https://github.com/j-keck/zfs-snap-diff/compare/0.0.10...dev)
[all commits from 0.0.10...1.0.0](https://github.com/j-keck/zfs-snap-diff/compare/0.0.10...1.0.0)


## 0.0.10 {#0-dot-0-dot-10}
Expand Down
44 changes: 23 additions & 21 deletions doc/site/content/docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ if it does not find a configuration, it will create the following default config

```text
use-cache-dir-for-backups = true
days-to-scan = 7
days-to-scan = 2
max-archive-unpacked-size-mb = 200
snapshot-name-template = "zfs-snap-diff-%FT%H:%M"
compare-method = "auto"
Expand All @@ -48,10 +48,7 @@ diff-context-size = 5
```


## Keys {#keys}


### `use-cache-dir-for-backups` {#use-cache-dir-for-backups}
## `use-cache-dir-for-backups` {#use-cache-dir-for-backups}

If it's set to `true`, the file backups will be stored in the users cache-directory.

Expand All @@ -64,18 +61,23 @@ If it's set to `true`, the file backups will be stored in the users cache-direct
If it's `false`, it will create the backup file under the actual directory in the `./zfs-snap-diff/` folder.


### `days-to-scan` {#days-to-scan}
## `days-to-scan` {#days-to-scan}

To speedup the scan for other file versions, `zfs-snap-diff` performs the scan incremental
when you request an older file version. This parameter determines how many days are scanned
if you request a older versions.

Configures the day range for each scan. If you have a many daily snapshots set this to `1`.

## `max-archive-unpacked-size-mb` {#max-archive-unpacked-size-mb}

### `max-archive-unpacked-size-mb` {#max-archive-unpacked-size-mb}
The maximal (unpacked) archive size is restricted by default.
Set this to `-1` to allow disable this restriction.

Maximal unpacked archive size in megabytes.
Set this to `-1` to disable the size-check.

## `snapshot-name-template` {#snapshot-name-template}

### `snapshot-name-template` {#snapshot-name-template}
Snapshot name template. Used to create snapshots in the web-app.
The template supports the following format sequences:

```text
Format sequences are alike the `date` command
Expand All @@ -92,48 +94,48 @@ Format sequences are alike the `date` command
```


### `compare-method` {#compare-method}
## `compare-method` {#compare-method}

Method how to determine two file versions are the same version.
Used compare method to find different file versions.
This is used when scanning the zfs snapshots to determine
a file was changed in a snapshot.
if a file was modified in a snapshot.


#### auto {#auto}
### auto {#auto}

Uses `md5` for text files and `size+mtime` for others


#### size {#size}
### size {#size}

If two files versions have the same filesize,
it's interpreted as the same version.


#### mtime {#mtime}
### mtime {#mtime}

If two files versions have the same mtime,
it's interpreted as the same version.


#### size+mtime {#size-plus-mtime}
### size+mtime {#size-plus-mtime}

If two files versions have the same size AND mtime,
it's interpreted as the same version.


#### content {#content}
### content {#content}

If two files versions have the same content,
it's interpreted as the same version.


#### md5 {#md5}
### md5 {#md5}

If two files versions have the same md5 sum,
it's interpreted as the same version.


### `diff-context-size` {#diff-context-size}
## `diff-context-size` {#diff-context-size}

Diff context size in the webui.
38 changes: 24 additions & 14 deletions doc/site/content/docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,45 @@ creator = "Emacs 26.3 (Org mode 9.1.9 + ox-hugo)"
weight = 20
+++

{{< hint danger >}}
This describes the currently ****unreleased beta version****.
{{< /hint >}}
## Binary packages {#binary-packages}

{{< hint warning >}}
This is the first release after a complete rewrite. You find older versions on the [GitHub release page](https://github.com/j-keck/zfs-snap-diff/releases).

## Binary packages {#binary-packages}
If you have any questions, trouble or other input, feel free to open an
issue, contact me per mail (see my github profile), or [keybase.io](https://keybase.io/jkeck).
{{< /hint >}}

You can download the latest binary package from here or
from the [githup release page](https://github.com/j-keck/zfs-snap-diff/releases).
{{< hint info >}}
The tar archive contains currently only the executables. In the following releases
i will provide distribution specific packages.
{{< /hint >}}

You can download the latest binary package from here or from the [GitHub release page](https://github.com/j-keck/zfs-snap-diff/releases).

{{<tabs "install">}}{{< tab "Linux" >}}
{{<tabs "install">}}
{{< tab "Linux" >}}
Download the beta version for ****Linux amd64**** here:

[zfs-snap-diff-linux-v1.0.0-beta-16-g1bae2c4.tgz](/zfs-snap-diff-linux-v1.0.0-beta-16-g1bae2c4.tgz)
[zfs-snap-diff-linux-v1.0.0.tgz](https://github.com/j-keck/zfs-snap-diff/releases/download/v1.0.0/zfs-snap-diff-linux-v1.0.0.tgz)
{{< /tab >}}

{{< tab "FreeBSD" >}}
Download the beta version for ****FreeBSD amd64**** here:

[zfs-snap-diff-freebsd-v1.0.0-beta-16-g1bae2c4.tgz](/zfs-snap-diff-freebsd-v1.0.0-beta-16-g1bae2c4.tgz)
[zfs-snap-diff-freebsd-v1.0.0.tgz](https://github.com/j-keck/zfs-snap-diff/releases/download/v1.0.0/zfs-snap-diff-freebsd-v1.0.0.tgz)
{{< /tab >}}

{{< tab "macOS" >}}
Download the beta version for ****macOS amd64**** here:

[zfs-snap-diff-darwin-v1.0.0-beta-16-g1bae2c4.tgz](/zfs-snap-diff-darwin-v1.0.0-beta-16-g1bae2c4.tgz)
[zfs-snap-diff-darwin-v1.0.0.tgz](https://github.com/j-keck/zfs-snap-diff/releases/download/v1.0.0/zfs-snap-diff-darwin-v1.0.0.tgz)
{{< /tab >}}

{{< tab "Solaris" >}}
Download the beta version for ****Solaris amd64**** here:

[zfs-snap-diff-solaris-v1.0.0-beta-16-g1bae2c4.tgz](/zfs-snap-diff-solaris-v1.0.0-beta-16-g1bae2c4.tgz)
[zfs-snap-diff-solaris-v1.0.0.tgz](https://github.com/j-keck/zfs-snap-diff/releases/download/v1.0.0/zfs-snap-diff-solaris-v1.0.0.tgz)
{{< /tab >}}

{{< /tabs >}}
Expand All @@ -53,15 +60,18 @@ platform, feel free to contact me!

## Build from source {#build-from-source}

You need only [go](https://go-lang.org) to build this project.
The backend from `zfs-snap-diff` is implemented in [Go](https://golang.org), the frontend in [PureScript](http://purescript.org).


### `go` {#go}

I use [go-bindata](https://github.com/go-bindata/go-bindata) to decode the frontend code and all dependencies to a
go source file so you need only the go compiler to compile it yourself.

The minimum supported go version is `go1.12`.

- clone this repo: `git clone -b dev https://github.com/j-keck/zfs-snap-diff`
- change to the checkout directory: `cd zfs-snap-diff`
- clone this repo: `git clone https://github.com/j-keck/zfs-snap-diff`
- `cd zfs-snap-diff`
- build it: `go build -ldflags="-X main.version=$(git describe)" ./cmd/zfs-snap-diff`

The optional `-ldflags="-X main.version=$(git describe)"` flag updates the `version` string in the binary.
Expand Down
12 changes: 4 additions & 8 deletions doc/site/content/docs/zfs-snap-diff.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@ creator = "Emacs 26.3 (Org mode 9.1.9 + ox-hugo)"
weight = 30
+++

{{< hint danger >}}
This describes the currently ****unreleased beta version****.
{{< /hint >}}

`zfs-snap-diff` - web application to find older versions of a given file in your zfs snapshots.
`zfs-snap-diff` - web application to find older file versions in zfs snapshots and zfs snapshot management tool.

With `zfs-snap-diff` you can

Expand Down Expand Up @@ -38,7 +34,7 @@ With `zfs-snap-diff` you can

```text
main⟩ zfs-snap-diff -h
zfs-snap-diff - web application to find older versions of a given file in your zfs snapshots.
zfs-snap-diff - web application to find older file versions in zfs snapshots and zfs snapshot management tool.
USAGE:
./zfs-snap-diff [OPTIONS] <ZFS_DATASET_NAME>
Expand All @@ -53,7 +49,7 @@ OPTIONS:
-d int
days to scan (default 7)
-diff-context-size int
show N lines before and after each diff (default 5)
show N lines before and after each diff (default 2)
-key string
TLS private key file
-l string
Expand Down Expand Up @@ -92,7 +88,7 @@ Project home page: https://j-keck.github.io/zfs-snap-diff
./zfs-snap-diff [OPTIONS] <ZFS_DATASET_NAME>
```

This starts a embedded webserver and serves the included web-app.
This starts a embedded webserver and serves the included web-app at <http://127.0.0.1:12345>.

- open your webbrowser at

Expand Down
Loading

0 comments on commit be66f80

Please sign in to comment.