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

Kai Reinhard
02.39.2025 0544adbad3b488b1f6fc91fd4e66590a41ed1e3e
Updates in progress...
6 files modified
6574 ■■■■ changed files
README.adoc 8 ●●●● patch | view | raw | blame | history
borgbutler-core/src/main/java/de/micromata/borgbutler/BorgCommands.java 4 ●●●● patch | view | raw | blame | history
borgbutler-webapp/build.gradle.kts 121 ●●●●● patch | view | raw | blame | history
borgbutler-webapp/package-lock.json 6437 ●●●● patch | view | raw | blame | history
borgbutler-webapp/package.json 1 ●●●● patch | view | raw | blame | history
build.gradle.kts 3 ●●●● patch | view | raw | blame | history
README.adoc
@@ -3,7 +3,7 @@
:toc:
:toclevels: 4
Copyright (C) 2018-2022
Copyright (C) 2018-2025 Micromata GmbH, Kai Reinhard
ifdef::env-github,env-browser[:outfilesuffix: .adoc]
@@ -72,7 +72,7 @@
For new versions of BorgButler or for changing the running options of your BorgButler container, simply delete the BorgButler docker container by `docker rm borgbutler` and call `docker run` again.
=== Starting from Java zip
You'll need OpenJDK 9+.
You'll need OpenJDK 17.
1. Download BorgButler from https://sourceforge.net/projects/borgbutler/files/latest/download
2. Unzip `borgbutler-server/build/distributions/borgbutler-server-<version>.zip`
@@ -129,7 +129,7 @@
saving a new configuration BorgButler stores a copy of the current configuration in the backup dir: `${BorgButlerHome}/backup/`.
== More immpressions
== More impressions
See some more screens to get an first overview of the functionality of BorgButler.
@@ -144,7 +144,7 @@
image::doc/images/screen-logviewer.png[Log viewer of BorgButler,800]
== Trouble shooting
== Troubleshooting
=== Docker
==== Increase memory (OutOfMemory)
Edit `${BorgButlerHome}/environment.sh` and restart your docker container (since version 0.6).
borgbutler-core/src/main/java/de/micromata/borgbutler/BorgCommands.java
@@ -11,7 +11,6 @@
import de.micromata.borgbutler.utils.ReplaceUtils;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.Validate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -20,6 +19,7 @@
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
/**
 * Creates and executes  borg commands by calling system's borg application (Borg must be installed).
@@ -290,7 +290,7 @@
    }
    private static BorgJob<Void> execute(BorgCommand command) {
        Validate.notNull(command);
        Objects.requireNonNull(command);
        return BorgQueueExecutor.getInstance().execute(command);
    }
}
borgbutler-webapp/build.gradle.kts
@@ -4,97 +4,64 @@
}
node {
    // Configure the Node.js and npm versions
    version.set("23.1.0")
    // Version of npm to use
    // If specified, installs it in the npmWorkDir
    npmVersion.set("10.9.0")
    // npmVersion.set("") // If empty, the plugin will use the npm command bundled with Node.js
    download.set(true) // Downloads Node.js and npm instead of using a globally installed version
    // Set the directories for Node.js and npm installations using the modern Gradle API
    // Use a persistent directory outside the `build` folder
    workDir.set(layout.projectDirectory.dir("node/nodejs")) // Directory for Node.js installation
    npmWorkDir.set(layout.projectDirectory.dir("node/npm")) // Directory for npm installation
    // Explicitly set the Node.js binary path
    nodeProjectDir.set(file(layout.projectDirectory.dir(".").asFile.absolutePath))
    version.set("16.15.0")
    npmVersion.set("8.5.4")
    download.set(true)
    workDir.set(layout.projectDirectory.dir("node/nodejs"))
    npmWorkDir.set(layout.projectDirectory.dir("node/npm"))
    nodeProjectDir.set(layout.projectDirectory.dir("."))
}
tasks.named<Delete>("clean") {
    delete(
        file("node"),  // Delete download directory of node and npm.
        file("node"),
        file("node_modules"),
        layout.buildDirectory
    )
}
tasks {
    // Configure the existing npmInstall task instead of registering a new one
    named<com.github.gradle.node.npm.task.NpmTask>("npmInstall") {
        group = "build"
        description = "Installs npm dependencies"
        args.set(listOf("install"))
        // Skip task if node_modules exists
        val nodeModulesDir = layout.projectDirectory.dir("node_modules")
        onlyIf {
            !nodeModulesDir.asFile.exists()
tasks.register<com.github.gradle.node.npm.task.NpmTask>("npmBuild") {
    group = "build"
    description = "Builds the React project"
    args.set(listOf("run", "build"))
    dependsOn("npmInstall")
    // Definiere explizit `build/webapp` als Output
    outputs.dir(layout.buildDirectory.dir("webapp"))
    doLast {
        val webappDir = layout.buildDirectory.dir("webapp").get().asFile
        if (!webappDir.exists()) {
            webappDir.mkdirs() // Erstelle das Verzeichnis, falls es nicht existiert
        }
        outputs.dir(project.layout.projectDirectory.dir("node_modules"))
    }
}
tasks.register<Jar>("webAppJar") {
    group = "build"
    description = "Package React build output as a JAR"
    archiveBaseName.set("borgbutler-webapp")
    archiveVersion.set(project.version.toString())
    destinationDirectory.set(layout.buildDirectory.dir("libs"))
    dependsOn("npmBuild")
    // Korrekte Referenz auf `webapp`-Verzeichnis
    inputs.dir(layout.buildDirectory.dir("webapp"))
    outputs.file(archiveFile)
    from(layout.buildDirectory.dir("webapp")) {
        into("static")
        exclude("resources", "libs", "tmp")
    }
    register<com.github.gradle.node.npm.task.NpmTask>("npmBuild") {
        group = "build"
        description = "Builds the React project"
        args.set(listOf("run", "build"))
        dependsOn("npmInstall")
        inputs.files(fileTree("src")) // All source files as input
        outputs.dir("build") // React output directory as output
    from(layout.projectDirectory.file("src/index.html")) {
        into("static")
    }
}
    register<Copy>("copyReactBuild") {
        duplicatesStrategy = DuplicatesStrategy.EXCLUDE
        group = "build"
        description = "Copies built React files to the target directory"
        dependsOn("npmBuild") // Depends on the React build process
        from(file("build")) {
            // Exclude the target directory to prevent recursion
            exclude("resources/main/static/**")
        }
        from(file("src")) {
            include("index.html")
        }
        into(layout.buildDirectory.dir("resources/main/static")) // Target directory in the Gradle project
        // Skip task if target directory is up-to-date
        inputs.dir("build") // React build directory as input
        outputs.dir(layout.buildDirectory.dir("resources/main/static")) // Static resources directory as output
    }
    register<Jar>("webAppJar") {
        group = "build"
        description = "Package React build output as a JAR"
        archiveBaseName.set("borgbutler-webapp")
        archiveVersion.set(project.version.toString())
        destinationDirectory.set(layout.buildDirectory.dir("libs"))
        // Include files from react-build directory
        from(layout.buildDirectory.get()) {
            into("static") // Place files under /static in the JAR
            exclude("resources")
            exclude("libs")
            exclude("tmp")
        }
        // Include additional files (e.g., src/index.html)
        from(layout.projectDirectory.file("src/index.html")) {
            into("static") // Copy index.html to /static
        }
        dependsOn("copyReactBuild") // Ensure React build and copy are done first
    }
    // Include the React build in the Gradle build process
    named("build") {
        dependsOn("copyReactBuild") // Makes React build a part of the Gradle build
    }
tasks.named("build") {
    dependsOn("webAppJar")
}
description = "borgbutler-webapp"
borgbutler-webapp/package-lock.json
Diff too large
borgbutler-webapp/package.json
@@ -10,6 +10,7 @@
    "classnames": "^2.2.6",
    "history": "^4.7.2",
    "i": "^0.3.6",
    "install": "^0.13.0",
    "js-file-download": "^0.4.4",
    "npm": "^6.4.1",
    "prop-types": "^15.5.7",
build.gradle.kts
@@ -8,7 +8,7 @@
allprojects {
    group = "de.micromata.borgbutler"
    version = "0.9"
    version = "0.8"
}
subprojects {
@@ -23,7 +23,6 @@
    repositories {
        mavenCentral()
        maven("https://maven.ej-technologies.com/repository")
    }
    dependencies {