mirror of https://github.com/micromata/borgbackup-butler.git

doc
Kai Reinhard
14.38.2021 d90060ae470941fdaff448963ba9efe1a3654c07
doc
3 files added
3 files modified
40666 ■■■■■ changed files
README.adoc 109 ●●●● patch | view | raw | blame | history
borgbutler-core/src/main/kotlin/org/micromata/borgbutler/config/ConfigurationHandler.kt 2 ●●● patch | view | raw | blame | history
borgbutler-docker/README.adoc 20 ●●●●● patch | view | raw | blame | history
borgbutler-docker/buildDocker.sh 2 ●●● patch | view | raw | blame | history
borgbutler-webapp/package-lock.json 40438 ●●●●● patch | view | raw | blame | history
doc/Development.adoc 95 ●●●●● patch | view | raw | blame | history
README.adoc
@@ -1,95 +1,48 @@
Micromata BorgBackup-Butler
===========================
= Micromata BorgBackup-Butler
Micromata GmbH, Kai Reinhard
:toc:
:toclevels: 4
Copyright (C) 2018
Copyright (C) 2018-2021
ifdef::env-github,env-browser[:outfilesuffix: .adoc]
== Configuration
== Why?
* Accessing your borg backups in an very convenient and fast way.
* Caches remote repo archive information for fast browsing.
* Differ functionality to see the differences of backups (files, directories etc.)
== Quick start
=== Docker
BorgButler working directory `$HOME/.borgbutler` is assumed, but you may define any other.
1. `docker run -v $HOME/.borgbutler:/Borgbutler -p 127.0.0.1:9042:9042 --name borgbuttler kreinhard/borgbutler` (exporting of `.ssh` is useful for ssh remotes, otherwise skip this setting.)
2. Stopping: simly click `CTRL-C`.
3. Restart: `docker start`
4. Stop: `docker stop`
Enjoy BorgButler by opening your browser: http://localhost:9042
You may refer the log file through the web browser or in `$HOME/.borgbutler/borgbutler.log`.
~/.borgbutler/borgbutler-config.json
[source,json]
----
{
  "repo-configs" : [ {
    "display_name" : "My-Laptop-Local-Backup",
    "repo"         : "/Volumes/backup/my-laptop-backup"
  },
  {
    "display_name"    : "My-Laptop-Remote-Backup",
    "repo"            : "ssh://backup.acme.com/./backups/my-laptop",
    "passwordCommand" : "security find-generic-password -a $USER -s borg-passphrase -w",
    "rsh"             : "ssh -i /Users/horst/.ssh/acme_rsa"
  } ]
}
----
* `repo-configs`: You may add a list of all your repos with the borg variables. The name is only used for displaying
purposes.
=== Starting from sources
1. `gradle clean distZip`
2. Unzip `borgbutler-server/build/distributions/borgbutler-server-<version>.zip`
3. Run `bin/borgbutler-server` or `bin/borgbutler-server.bat`.
=== Backups of configuration files
Enjoy BorgButler by opening your browser: http://localhost:9042
== Further informatino
=== Configuration
==== Backups of configuration files
You may configure and initialize your repositories by the BorgButler app. The config file is generated by BorgButler. Before
saving a new configuration BorgButler stores a copy of the current configuration in the backup dir: `~/.borgbutler/backup/`.
== Build and start from command line
=== Build distribution and start with Gradle
1. `cd borgbackup-butler/borgbutler-webapp`
2. `npm install`
3. `cd ..`
4. `gradle distZip`
5. `unzip borgbutler-server/build/distributions/borgbutler-server-0.1-SNAPSHOT.zip`
6. Start BorgButler: `borgbutler-server-0.1-SNAPSHOT/bin/borgbutler-server`
Now the default webbrowser is started on default port `9042`. Enjoy it!
== Build and start inside your IDE
=== Lombok required
[.text-center]
https://github.com/mplushnikov/lombok-intellij-plugin[Lombok Intellij plugin description^] +
[.text-left]
Or go to
[.text-center]
https://projectlombok.org/[Lombok home page^] +
[.text-left]
* Using IDE built-in plugin system on Windows: +
  File > Settings > Plugins > Browse repositories... > Search for "lombok" > Install Plugin
* Using IDE built-in plugin system on MacOs: +
  Preferences > Settings > Plugins > Browse repositories... > Search for "lombok" > Install Plugin
* Manually: +
  Download the latest release and install it manually using Preferences > Plugins > Install plugin from disk..
* In your project: Click Preferences -> Build, Execution, Deployment -> Compiler, Annotation Processors. Click Enable Annotation Processing
=== Start borgbutler-server
1. `cd borgbutler-webapp`
2. `npm install`
3. `gradle npmBuild` (builds the web archive)
4. Start `de.micromata.borgbutler.server.Main`
=== Start borgbutler-server for web development
For using hot code replacement of your web files, you should use `npm start` or `yarn start`:
1. `cd borgbutler-webapp`
2. `npm install`
3. `npm start` (opens the web browser on port 3000)
4. Start `de.micromata.borgbutler.server.Main` (ignore the opened browser window for port 9042)
=== Profiling heap, cpu and everything using JProfiler
JProfiler is an excellent tool for analysing your software. BorgButler was optimized regarding heap memory and CPU usage by
using https://www.ej-technologies.com/products/jprofiler/overview.html[JProfiler from EJ Technologies^]
== Ideas
=== 2 factor authentication
https://github.com/j256/two-factor-auth
== Install server
=== Debian
tbd.
borgbutler-core/src/main/kotlin/org/micromata/borgbutler/config/ConfigurationHandler.kt
@@ -65,7 +65,7 @@
                json = json.replace("repo-configs", "repoConfigs")
                json = json.replace("display_name", "displayName")
            }
            val formatter = SimpleDateFormat("yyyy-MM-dd_HH-mm-ss'-'")
            val formatter = SimpleDateFormat("yyyy-MM-dd_HH-mm-ss")
            val backupFilename = "${formatter.format(Date())}-old-${jsonConfigFile.name}"
            log.info("Migrating old json config file to yaml file. Renaming old json file '${jsonConfigFile.absolutePath}' to '$backupFilename'.")
            FileUtils.moveFile(jsonConfigFile, File(jsonConfigFile.parent, backupFilename))
borgbutler-docker/README.adoc
New file
@@ -0,0 +1,20 @@
= Micromata https://xxx[BorgBackup]-Butler
Micromata GmbH, Kai Reinhard
:toc:
:toclevels: 4
Copyright (C) 2018-2021
ifdef::env-github,env-browser[:outfilesuffix: .adoc]
== Building docker container
1. `gradle clean distZipe` in top directory (compiles and builds the project)
2. `cd borgbutler-docker`
3. `./buildDocker.sh` (builds the docker container)
== Deploying
1. `docker tag bc0459ed7d01 kreinhard/borgbutler:0.3  kreinhard/borgbutler:latest`
2. `docker push kreinhard/borgbutler:0.3`
3. `docker push kreinhard/borgbutler:latest`
borgbutler-docker/buildDocker.sh
@@ -12,4 +12,4 @@
(cd app; docker build -t kreinhard/borgbutler .)
echo "Push: docker push kreinhard/boprgbutler:tagname"
echo "Run with 'docker run -p 127.0.0.1:9042:9042 -v $HOME/.borgbutler:/Borgbutler kreinhard/borgbutler'"
echo "Run with 'docker run -v $HOME/.borgbutler:/Borgbutler -p 127.0.0.1:9042:9042 --name borgbuttler kreinhard/borgbutler'"
borgbutler-webapp/package-lock.json
New file
Diff too large
doc/Development.adoc
New file
@@ -0,0 +1,95 @@
Micromata BorgBackup-Butler
===========================
Micromata GmbH, Kai Reinhard
:toc:
:toclevels: 4
Copyright (C) 2018-2021
ifdef::env-github,env-browser[:outfilesuffix: .adoc]
== Configuration
~/.borgbutler/borgbutler-config.json
[source,json]
----
{
  "repo-configs" : [ {
    "display_name" : "My-Laptop-Local-Backup",
    "repo"         : "/Volumes/backup/my-laptop-backup"
  },
  {
    "display_name"    : "My-Laptop-Remote-Backup",
    "repo"            : "ssh://backup.acme.com/./backups/my-laptop",
    "passwordCommand" : "security find-generic-password -a $USER -s borg-passphrase -w",
    "rsh"             : "ssh -i /Users/horst/.ssh/acme_rsa"
  } ]
}
----
* `repo-configs`: You may add a list of all your repos with the borg variables. The name is only used for displaying
purposes.
=== Backups of configuration files
You may configure and initialize your repositories by the BorgButler app. The config file is generated by BorgButler. Before
saving a new configuration BorgButler stores a copy of the current configuration in the backup dir: `~/.borgbutler/backup/`.
== Build and start from command line
=== Build distribution and start with Gradle
1. `cd borgbackup-butler/borgbutler-webapp`
2. `npm install`
3. `cd ..`
4. `gradle distZip`
5. `unzip borgbutler-server/build/distributions/borgbutler-server-0.1-SNAPSHOT.zip`
6. Start BorgButler: `borgbutler-server-0.1-SNAPSHOT/bin/borgbutler-server`
Now the default webbrowser is started on default port `9042`. Enjoy it!
== Build and start inside your IDE
=== Lombok required
[.text-center]
https://github.com/mplushnikov/lombok-intellij-plugin[Lombok Intellij plugin description^] +
[.text-left]
Or go to
[.text-center]
https://projectlombok.org/[Lombok home page^] +
[.text-left]
* Using IDE built-in plugin system on Windows: +
  File > Settings > Plugins > Browse repositories... > Search for "lombok" > Install Plugin
* Using IDE built-in plugin system on MacOs: +
  Preferences > Settings > Plugins > Browse repositories... > Search for "lombok" > Install Plugin
* Manually: +
  Download the latest release and install it manually using Preferences > Plugins > Install plugin from disk..
* In your project: Click Preferences -> Build, Execution, Deployment -> Compiler, Annotation Processors. Click Enable Annotation Processing
=== Start borgbutler-server
1. `cd borgbutler-webapp`
2. `npm install`
3. `gradle npmBuild` (builds the web archive)
4. Start `de.micromata.borgbutler.server.Main`
=== Start borgbutler-server for web development
For using hot code replacement of your web files, you should use `npm start` or `yarn start`:
1. `cd borgbutler-webapp`
2. `npm install`
3. `npm start` (opens the web browser on port 3000)
4. Start `de.micromata.borgbutler.server.Main` (ignore the opened browser window for port 9042)
=== Profiling heap, cpu and everything using JProfiler
JProfiler is an excellent tool for analysing your software. BorgButler was optimized regarding heap memory and CPU usage by
using https://www.ej-technologies.com/products/jprofiler/overview.html[JProfiler from EJ Technologies^]
== Ideas
=== 2 factor authentication
https://github.com/j256/two-factor-auth
== Install server
=== Debian
tbd.