From 2c5cf1db1221049d52fd64a58579b6802b5fdf18 Mon Sep 17 00:00:00 2001 From: Felix Krull Date: Sat, 10 Feb 2018 20:17:58 +0000 Subject: [PATCH 01/18] Add build script and supporting files for Docker images. --- Installer/Docker/build-images.sh | 71 +++++++++++++++++++++++ Installer/Docker/context/Dockerfile | 33 +++++++++++ Installer/Docker/context/duplicati | 2 + Installer/Docker/context/duplicati-server | 2 + 4 files changed, 108 insertions(+) create mode 100755 Installer/Docker/build-images.sh create mode 100644 Installer/Docker/context/Dockerfile create mode 100755 Installer/Docker/context/duplicati create mode 100755 Installer/Docker/context/duplicati-server diff --git a/Installer/Docker/build-images.sh b/Installer/Docker/build-images.sh new file mode 100755 index 000000000..42289d4c8 --- /dev/null +++ b/Installer/Docker/build-images.sh @@ -0,0 +1,71 @@ +#!/bin/bash + +if [ ! -f "$1" ]; then + echo "Please provide the filename of an existing zip build as the first argument" + exit +fi + +ARCHITECTURES="amd64 arm32v7" +DEFAULT_ARCHITECTURE=amd64 +DEFAULT_CHANNEL=beta +REPOSITORY=duplicati/duplicati + +ARCHIVE_NAME=`basename -s .zip $1` +VERSION=`echo "${ARCHIVE_NAME}" | cut -d "-" -f 2-` +CHANNEL=`echo "${ARCHIVE_NAME}" | cut -d "_" -f 2` +DIRNAME=duplicati + +if [ -d "${DIRNAME}" ]; then + rm -rf "${DIRNAME}" +fi + +unzip -d "${DIRNAME}" "$1" + +for n in "../oem" "../../oem" "../../../oem" +do + if [ -d $n ]; then + echo "Installing OEM files" + cp -R $n "${DIRNAME}/webroot/" + fi +done + +for n in "oem-app-name.txt" "oem-update-url.txt" "oem-update-key.txt" "oem-update-readme.txt" "oem-update-installid.txt" +do + for p in "../$n" "../../$n" "../../../$n" + do + if [ -f $p ]; then + echo "Installing OEM override file" + cp $p "${DIRNAME}" + fi + done +done + +for arch in ${ARCHITECTURES}; do + tags="linux-${arch}-${VERSION} linux-${arch}-${CHANNEL}" + if [ ${CHANNEL} = ${DEFAULT_CHANNEL} ]; then + tags="linux-${arch} ${tags}" + fi + if [ ${arch} = ${DEFAULT_ARCHITECTURE} ]; then + tags="${VERSION} ${CHANNEL} ${tags}" + fi + if [ ${CHANNEL} = ${DEFAULT_CHANNEL} -a ${arch} = ${DEFAULT_ARCHITECTURE} ]; then + tags="latest ${tags}" + fi + + args="" + for tag in ${tags}; do + args="-t ${REPOSITORY}:${tag} ${args}" + done + + docker build \ + ${args} \ + --build-arg ARCH=${arch}/ \ + --build-arg VERSION=${VERSION} \ + --build-arg CHANNEL=${CHANNEL} \ + --file context/Dockerfile \ + . + + for tag in ${tags}; do + docker push ${REPOSITORY}:${tag} + done +done diff --git a/Installer/Docker/context/Dockerfile b/Installer/Docker/context/Dockerfile new file mode 100644 index 000000000..76337f54e --- /dev/null +++ b/Installer/Docker/context/Dockerfile @@ -0,0 +1,33 @@ +ARG ARCH= +FROM ${ARCH}mono:5-slim + +RUN apt-get update && \ + apt-get install -y \ + libmono-sqlite4.0-cil \ + libmono-system-drawing4.0-cil \ + referenceassemblies-pcl && \ + rm -rf /var/lib/apt/lists + +ENV TINI_VERSION v0.16.1 +RUN apt-get update && \ + apt-get install -y curl && \ + curl -L -o /usr/sbin/tini https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-$(dpkg --print-architecture) && \ + chmod 0755 /usr/sbin/tini && \ + apt-get autoremove --purge -y curl && \ + rm -rf /var/lib/apt/lists +ENTRYPOINT ["/usr/sbin/tini", "--"] + +ENV XDG_CONFIG_HOME=/data +VOLUME /data + +COPY context/duplicati context/duplicati-server /usr/bin/ +RUN chmod 0755 /usr/bin/duplicati /usr/bin/duplicati-server + +ARG CHANNEL= +ARG VERSION= +ENV DUPLICATI_CHANNEL=${CHANNEL} +ENV DUPLICATI_VERSION=${VERSION} +COPY duplicati /opt/duplicati + +EXPOSE 8200 +CMD ["/usr/bin/duplicati-server", "--webservice-port=8200", "--webservice-interface=any"] diff --git a/Installer/Docker/context/duplicati b/Installer/Docker/context/duplicati new file mode 100755 index 000000000..8508b447b --- /dev/null +++ b/Installer/Docker/context/duplicati @@ -0,0 +1,2 @@ +#!/bin/sh +exec mono /opt/duplicati/Duplicati.CommandLine.exe $@ diff --git a/Installer/Docker/context/duplicati-server b/Installer/Docker/context/duplicati-server new file mode 100755 index 000000000..0fd72bae5 --- /dev/null +++ b/Installer/Docker/context/duplicati-server @@ -0,0 +1,2 @@ +#!/bin/sh +exec mono /opt/duplicati/Duplicati.Server.exe $@ From 3a83b39e95f2dacfdead792ef8cd5c60ff2ef914 Mon Sep 17 00:00:00 2001 From: Felix Krull Date: Sat, 10 Feb 2018 20:18:49 +0000 Subject: [PATCH 02/18] Build Docker images with the other installers. --- build-installers.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/build-installers.sh b/build-installers.sh index 8e07abb3f..92f0d177f 100755 --- a/build-installers.sh +++ b/build-installers.sh @@ -136,6 +136,17 @@ mv "Installer/fedora/${RPMNAME}" "${UPDATE_TARGET}" echo "Done building rpm package" +echo "" +echo "" +echo "Building Docker images ..." + +cd Installer/Docker +bash build-images.sh ../../$1 +cd ../.. + +echo "Done building Docker images" + + echo "" echo "" echo "Building Windows instance in virtual machine" From 8f99b0d93036758b3c98fedd46b2d42ee2f7730a Mon Sep 17 00:00:00 2001 From: Felix Krull Date: Sun, 11 Feb 2018 14:12:23 +0100 Subject: [PATCH 03/18] Match Docker image launcher scripts to other packages. --- Installer/Docker/context/Dockerfile | 4 ++-- Installer/Docker/context/duplicati | 2 -- Installer/Docker/context/duplicati-cli | 4 ++++ Installer/Docker/context/duplicati-server | 6 ++++-- 4 files changed, 10 insertions(+), 6 deletions(-) delete mode 100755 Installer/Docker/context/duplicati create mode 100755 Installer/Docker/context/duplicati-cli diff --git a/Installer/Docker/context/Dockerfile b/Installer/Docker/context/Dockerfile index 76337f54e..4ab2cc3fb 100644 --- a/Installer/Docker/context/Dockerfile +++ b/Installer/Docker/context/Dockerfile @@ -20,8 +20,8 @@ ENTRYPOINT ["/usr/sbin/tini", "--"] ENV XDG_CONFIG_HOME=/data VOLUME /data -COPY context/duplicati context/duplicati-server /usr/bin/ -RUN chmod 0755 /usr/bin/duplicati /usr/bin/duplicati-server +COPY context/duplicati-cli context/duplicati-server /usr/bin/ +RUN chmod 0755 /usr/bin/duplicati-cli /usr/bin/duplicati-server ARG CHANNEL= ARG VERSION= diff --git a/Installer/Docker/context/duplicati b/Installer/Docker/context/duplicati deleted file mode 100755 index 8508b447b..000000000 --- a/Installer/Docker/context/duplicati +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -exec mono /opt/duplicati/Duplicati.CommandLine.exe $@ diff --git a/Installer/Docker/context/duplicati-cli b/Installer/Docker/context/duplicati-cli new file mode 100755 index 000000000..5bec19f01 --- /dev/null +++ b/Installer/Docker/context/duplicati-cli @@ -0,0 +1,4 @@ +#!/bin/bash +EXE_FILE=/opt/duplicati/Duplicati.CommandLine.exe +APP_NAME=Duplicati.CommandLine +exec -a "$APP_NAME" mono "$EXE_FILE" "$@" diff --git a/Installer/Docker/context/duplicati-server b/Installer/Docker/context/duplicati-server index 0fd72bae5..c603da265 100755 --- a/Installer/Docker/context/duplicati-server +++ b/Installer/Docker/context/duplicati-server @@ -1,2 +1,4 @@ -#!/bin/sh -exec mono /opt/duplicati/Duplicati.Server.exe $@ +#!/bin/bash +EXE_FILE=/opt/duplicati/Duplicati.Server.exe +APP_NAME=DuplicatiServer +exec -a "$APP_NAME" mono "$EXE_FILE" "$@" From 5f4a1fa3385e749517192a058b8aef7eef4bdc3f Mon Sep 17 00:00:00 2001 From: Felix Krull Date: Sun, 11 Feb 2018 14:35:24 +0100 Subject: [PATCH 04/18] Reindent using spaces. --- Installer/Docker/build-images.sh | 54 ++++++++++++++++---------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/Installer/Docker/build-images.sh b/Installer/Docker/build-images.sh index 42289d4c8..1ce763018 100755 --- a/Installer/Docker/build-images.sh +++ b/Installer/Docker/build-images.sh @@ -1,8 +1,8 @@ #!/bin/bash if [ ! -f "$1" ]; then - echo "Please provide the filename of an existing zip build as the first argument" - exit + echo "Please provide the filename of an existing zip build as the first argument" + exit fi ARCHITECTURES="amd64 arm32v7" @@ -16,7 +16,7 @@ CHANNEL=`echo "${ARCHIVE_NAME}" | cut -d "_" -f 2` DIRNAME=duplicati if [ -d "${DIRNAME}" ]; then - rm -rf "${DIRNAME}" + rm -rf "${DIRNAME}" fi unzip -d "${DIRNAME}" "$1" @@ -41,31 +41,31 @@ do done for arch in ${ARCHITECTURES}; do - tags="linux-${arch}-${VERSION} linux-${arch}-${CHANNEL}" - if [ ${CHANNEL} = ${DEFAULT_CHANNEL} ]; then - tags="linux-${arch} ${tags}" - fi - if [ ${arch} = ${DEFAULT_ARCHITECTURE} ]; then - tags="${VERSION} ${CHANNEL} ${tags}" - fi - if [ ${CHANNEL} = ${DEFAULT_CHANNEL} -a ${arch} = ${DEFAULT_ARCHITECTURE} ]; then - tags="latest ${tags}" - fi + tags="linux-${arch}-${VERSION} linux-${arch}-${CHANNEL}" + if [ ${CHANNEL} = ${DEFAULT_CHANNEL} ]; then + tags="linux-${arch} ${tags}" + fi + if [ ${arch} = ${DEFAULT_ARCHITECTURE} ]; then + tags="${VERSION} ${CHANNEL} ${tags}" + fi + if [ ${CHANNEL} = ${DEFAULT_CHANNEL} -a ${arch} = ${DEFAULT_ARCHITECTURE} ]; then + tags="latest ${tags}" + fi - args="" - for tag in ${tags}; do - args="-t ${REPOSITORY}:${tag} ${args}" - done + args="" + for tag in ${tags}; do + args="-t ${REPOSITORY}:${tag} ${args}" + done - docker build \ - ${args} \ - --build-arg ARCH=${arch}/ \ - --build-arg VERSION=${VERSION} \ - --build-arg CHANNEL=${CHANNEL} \ - --file context/Dockerfile \ - . + docker build \ + ${args} \ + --build-arg ARCH=${arch}/ \ + --build-arg VERSION=${VERSION} \ + --build-arg CHANNEL=${CHANNEL} \ + --file context/Dockerfile \ + . - for tag in ${tags}; do - docker push ${REPOSITORY}:${tag} - done + for tag in ${tags}; do + docker push ${REPOSITORY}:${tag} + done done From 049ca85c8f8c7a133e0a95f77a5bd793081fd330 Mon Sep 17 00:00:00 2001 From: Felix Krull Date: Mon, 12 Feb 2018 22:03:38 +0100 Subject: [PATCH 05/18] Don't accidentally purge ca-certificates-mono. --- Installer/Docker/context/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Installer/Docker/context/Dockerfile b/Installer/Docker/context/Dockerfile index 4ab2cc3fb..a4db82111 100644 --- a/Installer/Docker/context/Dockerfile +++ b/Installer/Docker/context/Dockerfile @@ -2,7 +2,7 @@ ARG ARCH= FROM ${ARCH}mono:5-slim RUN apt-get update && \ - apt-get install -y \ + apt-get install -y --no-install-recommends \ libmono-sqlite4.0-cil \ libmono-system-drawing4.0-cil \ referenceassemblies-pcl && \ @@ -10,7 +10,7 @@ RUN apt-get update && \ ENV TINI_VERSION v0.16.1 RUN apt-get update && \ - apt-get install -y curl && \ + apt-get install -y --no-install-recommends curl && \ curl -L -o /usr/sbin/tini https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-$(dpkg --print-architecture) && \ chmod 0755 /usr/sbin/tini && \ apt-get autoremove --purge -y curl && \ From 4ec8f4b32b5efd4fb51946e64810cdf919df33d0 Mon Sep 17 00:00:00 2001 From: Felix Krull Date: Mon, 12 Feb 2018 22:25:14 +0100 Subject: [PATCH 06/18] Simplify tini installation. --- Installer/Docker/context/Dockerfile | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Installer/Docker/context/Dockerfile b/Installer/Docker/context/Dockerfile index a4db82111..442df4b65 100644 --- a/Installer/Docker/context/Dockerfile +++ b/Installer/Docker/context/Dockerfile @@ -3,18 +3,15 @@ FROM ${ARCH}mono:5-slim RUN apt-get update && \ apt-get install -y --no-install-recommends \ + curl \ libmono-sqlite4.0-cil \ libmono-system-drawing4.0-cil \ referenceassemblies-pcl && \ rm -rf /var/lib/apt/lists ENV TINI_VERSION v0.16.1 -RUN apt-get update && \ - apt-get install -y --no-install-recommends curl && \ - curl -L -o /usr/sbin/tini https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-$(dpkg --print-architecture) && \ - chmod 0755 /usr/sbin/tini && \ - apt-get autoremove --purge -y curl && \ - rm -rf /var/lib/apt/lists +RUN curl -L -o /usr/sbin/tini https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-$(dpkg --print-architecture) && \ + chmod 0755 /usr/sbin/tini ENTRYPOINT ["/usr/sbin/tini", "--"] ENV XDG_CONFIG_HOME=/data From 116c86110092b7745112091b14b6d6eab84af8c6 Mon Sep 17 00:00:00 2001 From: Felix Krull Date: Mon, 12 Feb 2018 22:52:22 +0100 Subject: [PATCH 07/18] Suffix arch-default images with "-latest" for consistency. --- Installer/Docker/build-images.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Installer/Docker/build-images.sh b/Installer/Docker/build-images.sh index 1ce763018..f1bc71e46 100755 --- a/Installer/Docker/build-images.sh +++ b/Installer/Docker/build-images.sh @@ -43,7 +43,7 @@ done for arch in ${ARCHITECTURES}; do tags="linux-${arch}-${VERSION} linux-${arch}-${CHANNEL}" if [ ${CHANNEL} = ${DEFAULT_CHANNEL} ]; then - tags="linux-${arch} ${tags}" + tags="linux-${arch}-latest ${tags}" fi if [ ${arch} = ${DEFAULT_ARCHITECTURE} ]; then tags="${VERSION} ${CHANNEL} ${tags}" From 30492b101fa874c6dae1819e1ce6102b327a9fdc Mon Sep 17 00:00:00 2001 From: Felix Krull Date: Mon, 12 Feb 2018 22:52:41 +0100 Subject: [PATCH 08/18] Re-sync certificates during build. --- Installer/Docker/context/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Installer/Docker/context/Dockerfile b/Installer/Docker/context/Dockerfile index 442df4b65..8d36797e2 100644 --- a/Installer/Docker/context/Dockerfile +++ b/Installer/Docker/context/Dockerfile @@ -7,7 +7,8 @@ RUN apt-get update && \ libmono-sqlite4.0-cil \ libmono-system-drawing4.0-cil \ referenceassemblies-pcl && \ - rm -rf /var/lib/apt/lists + rm -rf /var/lib/apt/lists && \ + cert-sync /etc/ssl/certs/ca-certificates.crt ENV TINI_VERSION v0.16.1 RUN curl -L -o /usr/sbin/tini https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-$(dpkg --print-architecture) && \ From 1d697cdf4f4437a9b781929352bac34460421ca9 Mon Sep 17 00:00:00 2001 From: Felix Krull Date: Mon, 12 Feb 2018 23:19:59 +0100 Subject: [PATCH 09/18] Add Docker readme. --- Installer/Docker/README.md | 64 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 Installer/Docker/README.md diff --git a/Installer/Docker/README.md b/Installer/Docker/README.md new file mode 100644 index 000000000..3047e2f69 --- /dev/null +++ b/Installer/Docker/README.md @@ -0,0 +1,64 @@ +# [Duplicati](https://www.duplicati.com) +Duplicati is a free, open source, backup client that securely stores encrypted, incremental, compressed backups on cloud storage services and remote file servers. It works with: + +*Amazon S3, OneDrive, Google Drive, Rackspace Cloud Files, HubiC, Backblaze (B2), Amazon Cloud Drive (AmzCD), Swift / OpenStack, WebDAV, SSH (SFTP), FTP, and more!* + +Duplicati is licensed under LGPL and available for Windows, OSX and Linux (.NET 4.5+ or Mono required). + +## Available tags + +* `beta` - the most recent beta release +* `experimental` - the most recent experimental release +* `canary` - the most recent canary release +* `latest` - an alias for `beta` +* specific versions like `2.0.2.1_beta_2017-08-01` + +Images for the following OS/architecture combinations are available: + +* `linux-amd64` +* `linux-arm32v7` - 32-bit ARMv7 devices like the Raspberry Pi 2 + +The default architecture is `linux-amd64`. To pull an image for another architecture, prepend the architecture string to the image tag, e.g. `linux-arm32v7-beta`. + +## How to use this image + +```console +$ docker run -p 8200:8200 -v /some/path:/some/path duplicati/duplicati +``` + +Then, open [http://localhost:8200](http://localhost:8200) on the host to access the Duplicati web interface and configure backups. Any host directory that you want to back up needs to be mounted into the container using the `-v` option. + +### Preserving configuration + +All configuration is stored in `/data` inside the container, so you can mount a volume at that path to preserve the configuration: + +```console +$ docker run --name=duplicati -v duplicati-data:/data duplicati/duplicati +``` + +This allows you to delete and recreate the container without losing your configuration: + +```console +$ docker rm duplicati +$ docker run --name=duplicati -v duplicati-data:/data duplicati/duplicati +``` + +### Using Duplicati CLI + +Run the `duplicati-cli` command to use the Duplicati command-line interface: + +```console +$ docker run --rm duplicati/duplicati duplicati-cli help +See duplicati.commandline.exe help for more information. + General: example, changelog +... +$ docker run --rm -v /home:/backup/home duplicati/duplicati duplicati-cli backup ssh://user@host /backup/home +``` + +### Specifying server arguments + +To launch the Duplicati server with additional arguments, run the `duplicati-server` command: + +```console +$ docker run duplicati/duplicati duplicati-server --log-level=debug +``` From 0ccda78c8b270d36e64e15eaf433016bb2cf1f94 Mon Sep 17 00:00:00 2001 From: Pectojin Date: Tue, 13 Feb 2018 18:42:51 +0100 Subject: [PATCH 10/18] Fixed an issue with long log entries in the live log displayed poorly. Also tweaked the spacing between log entries slight --- Duplicati/Server/webroot/ngax/less/style.less | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Duplicati/Server/webroot/ngax/less/style.less b/Duplicati/Server/webroot/ngax/less/style.less index 8fff83afb..81f4bc59f 100755 --- a/Duplicati/Server/webroot/ngax/less/style.less +++ b/Duplicati/Server/webroot/ngax/less/style.less @@ -210,10 +210,6 @@ ul.tabs { } .entries.livedata { - li { - height: 1.2em; - } - li.expanded { height: auto; overflow: auto; @@ -1492,7 +1488,7 @@ body { ul.entries { li { - padding-top: 30px; + padding-top: 10px; } } } From 6557a743749e39e50a34d4dd667d1bed1a81df97 Mon Sep 17 00:00:00 2001 From: Pectojin Date: Tue, 13 Feb 2018 18:57:46 +0100 Subject: [PATCH 11/18] Fixed weird overflow issue when expanding live log entries and made non-expandable entries not appear clickable --- Duplicati/Server/webroot/ngax/less/style.less | 3 +-- Duplicati/Server/webroot/ngax/templates/log.html | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Duplicati/Server/webroot/ngax/less/style.less b/Duplicati/Server/webroot/ngax/less/style.less index 81f4bc59f..0e0188c8b 100755 --- a/Duplicati/Server/webroot/ngax/less/style.less +++ b/Duplicati/Server/webroot/ngax/less/style.less @@ -204,7 +204,7 @@ ul.tabs { } .entries { - div.entryline { + div.entryline.clickable { cursor: pointer; } } @@ -212,7 +212,6 @@ ul.tabs { .entries.livedata { li.expanded { height: auto; - overflow: auto; } } diff --git a/Duplicati/Server/webroot/ngax/templates/log.html b/Duplicati/Server/webroot/ngax/templates/log.html index 6b3d13bd1..6b2baa31a 100644 --- a/Duplicati/Server/webroot/ngax/templates/log.html +++ b/Duplicati/Server/webroot/ngax/templates/log.html @@ -34,7 +34,7 @@
  • -
    {{item.When | parsetimestamp}}: {{item.Message}}
    +
    {{item.When | parsetimestamp}}: {{item.Message}}
    {{item.Exception}}
From 9def2e11235e3c629ddcce449b0ef491de657c3a Mon Sep 17 00:00:00 2001 From: Felix Krull Date: Tue, 13 Feb 2018 19:21:03 +0100 Subject: [PATCH 12/18] Fix some code quality issues. --- Installer/Docker/build-images.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Installer/Docker/build-images.sh b/Installer/Docker/build-images.sh index f1bc71e46..33500ee77 100755 --- a/Installer/Docker/build-images.sh +++ b/Installer/Docker/build-images.sh @@ -10,9 +10,9 @@ DEFAULT_ARCHITECTURE=amd64 DEFAULT_CHANNEL=beta REPOSITORY=duplicati/duplicati -ARCHIVE_NAME=`basename -s .zip $1` -VERSION=`echo "${ARCHIVE_NAME}" | cut -d "-" -f 2-` -CHANNEL=`echo "${ARCHIVE_NAME}" | cut -d "_" -f 2` +ARCHIVE_NAME=$(basename -s .zip $1) +VERSION=$(echo "${ARCHIVE_NAME}" | cut -d "-" -f 2-) +CHANNEL=$(echo "${ARCHIVE_NAME}" | cut -d "_" -f 2) DIRNAME=duplicati if [ -d "${DIRNAME}" ]; then From 7975a9ad8c3bf364dd491acbae4ab9a1cca393b4 Mon Sep 17 00:00:00 2001 From: Rune Henriksen Date: Sun, 18 Feb 2018 03:29:27 +0100 Subject: [PATCH 13/18] delete on unknown backup id should return 404 --- Duplicati/Server/WebServer/RESTMethods/Backup.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Duplicati/Server/WebServer/RESTMethods/Backup.cs b/Duplicati/Server/WebServer/RESTMethods/Backup.cs index 485cba0f8..64d76c08a 100644 --- a/Duplicati/Server/WebServer/RESTMethods/Backup.cs +++ b/Duplicati/Server/WebServer/RESTMethods/Backup.cs @@ -574,7 +574,7 @@ namespace Duplicati.Server.WebServer.RESTMethods var backup = Program.DataConnection.GetBackup(key); if (backup == null) { - info.ReportClientError("Invalid or missing backup id"); + info.ReportClientError("Invalid or missing backup id", System.Net.HttpStatusCode.NotFound); return; } From e1fc8f25aa101573ce10f58e7739bf186b978b9b Mon Sep 17 00:00:00 2001 From: Rune Henriksen Date: Mon, 19 Feb 2018 22:13:25 +0100 Subject: [PATCH 14/18] added clarification to error to help users resolve the problem --- Duplicati/Server/WebServer/AuthenticationHandler.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Duplicati/Server/WebServer/AuthenticationHandler.cs b/Duplicati/Server/WebServer/AuthenticationHandler.cs index 0744807b8..ccc232444 100644 --- a/Duplicati/Server/WebServer/AuthenticationHandler.cs +++ b/Duplicati/Server/WebServer/AuthenticationHandler.cs @@ -286,7 +286,7 @@ namespace Duplicati.Server.WebServer else { response.Status = System.Net.HttpStatusCode.BadRequest; - response.Reason = "Missing XSRF Token"; + response.Reason = "Missing XSRF Token. Please reload the page"; return true; } From 34f318b94abbd933873403f98ec9ba4bcf70f373 Mon Sep 17 00:00:00 2001 From: Drew Gates Date: Tue, 20 Feb 2018 11:12:43 -0500 Subject: [PATCH 15/18] Changed download URL Changed download URL from go-mono.com to mono-project.com. --- Installer/OSX/run-with-mono.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Installer/OSX/run-with-mono.sh b/Installer/OSX/run-with-mono.sh index 60af3dd1f..ae4890d0b 100644 --- a/Installer/OSX/run-with-mono.sh +++ b/Installer/OSX/run-with-mono.sh @@ -26,7 +26,7 @@ REQUIRED_MINOR=0 VERSION_TITLE="Cannot launch $APP_NAME" VERSION_MSG="$APP_NAME requires the Mono Framework version $REQUIRED_MAJOR.$REQUIRED_MINOR or later." -DOWNLOAD_URL="http://www.go-mono.com/mono-downloads/download.html" +DOWNLOAD_URL="http://www.mono-project.com/download/stable/#download-mac" # Try to find system default Mono if an override was not supplied if [ "z${MONO_BIN}" == "z" ]; then From 843b3e4eb2fe42b10e460805db0e93d4dae92bad Mon Sep 17 00:00:00 2001 From: Rune Henriksen Date: Tue, 20 Feb 2018 21:55:06 +0100 Subject: [PATCH 16/18] Made the LogData poll API respect pagesize. Defaults to 100 if no pagesize is provided --- Duplicati/Server/LogWriteHandler.cs | 12 ++++++++++-- Duplicati/Server/WebServer/RESTMethods/LogData.cs | 8 +++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/Duplicati/Server/LogWriteHandler.cs b/Duplicati/Server/LogWriteHandler.cs index 0d7d264ba..e37857dfd 100644 --- a/Duplicati/Server/LogWriteHandler.cs +++ b/Duplicati/Server/LogWriteHandler.cs @@ -235,7 +235,7 @@ namespace Duplicati.Server } } - public LogEntry[] AfterID(long id, LogMessageType level) + public LogEntry[] AfterID(long id, LogMessageType level, int pagesize) { RenewTimeout(level); UpdateLogLevel(); @@ -245,7 +245,15 @@ namespace Duplicati.Server if (m_buffer == null) return new LogEntry[0]; - return m_buffer.FlatArray((x) => x.ID > id && x.Type >= level ); + var buffer = m_buffer.FlatArray((x) => x.ID > id && x.Type >= level ); + // Return the newest entries + if (buffer.Length > pagesize) { + var index = buffer.Length - pagesize; + return buffer.Skip(index).Take(pagesize).ToArray(); + } + else { + return buffer; + } } } diff --git a/Duplicati/Server/WebServer/RESTMethods/LogData.cs b/Duplicati/Server/WebServer/RESTMethods/LogData.cs index 552cc2a7c..f87bbe2cb 100644 --- a/Duplicati/Server/WebServer/RESTMethods/LogData.cs +++ b/Duplicati/Server/WebServer/RESTMethods/LogData.cs @@ -29,13 +29,19 @@ namespace Duplicati.Server.WebServer.RESTMethods var level_str = input["level"].Value ?? ""; var id_str = input["id"].Value ?? ""; + int pagesize; + if (!int.TryParse(info.Request.QueryString["pagesize"].Value, out pagesize)) + pagesize = 100; + + pagesize = Math.Max(1, Math.Min(500, pagesize)); + Library.Logging.LogMessageType level; long id; long.TryParse(id_str, out id); Enum.TryParse(level_str, true, out level); - info.OutputOK(Program.LogHandler.AfterID(id, level)); + info.OutputOK(Program.LogHandler.AfterID(id, level, pagesize)); } else { From 910abc4fee37f839379f2630b2158c1119ffbd42 Mon Sep 17 00:00:00 2001 From: Rune Henriksen Date: Wed, 21 Feb 2018 01:26:07 +0100 Subject: [PATCH 17/18] limited number of logs displayed on live log page --- .../Server/webroot/ngax/scripts/controllers/LogController.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Duplicati/Server/webroot/ngax/scripts/controllers/LogController.js b/Duplicati/Server/webroot/ngax/scripts/controllers/LogController.js index 168e7c5b4..74eec186a 100644 --- a/Duplicati/Server/webroot/ngax/scripts/controllers/LogController.js +++ b/Duplicati/Server/webroot/ngax/scripts/controllers/LogController.js @@ -32,7 +32,8 @@ backupApp.controller('LogController', function($scope, $routeParams, $timeout, S resp.data.reverse(); $scope.LiveData.unshift.apply($scope.LiveData, resp.data); - $scope.LiveData.Length = Math.min(1000, $scope.LiveData.length); + $scope.LiveData.Length = Math.min(300, $scope.LiveData.length); + $scope.LiveData = $scope.LiveData.slice(0,$scope.LiveData.Length) $scope.LiveRefreshing = false; if ($scope.LiveRefreshPending) From 880732d8b009bf1007bf64a3c79d3d7a66fa6668 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Rad=C3=BCnz?= Date: Wed, 21 Feb 2018 21:09:56 +0100 Subject: [PATCH 18/18] Fixes issue #3055 --- .../controllers/EditBackupController.js | 33 +++++++++++-------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/Duplicati/Server/webroot/ngax/scripts/controllers/EditBackupController.js b/Duplicati/Server/webroot/ngax/scripts/controllers/EditBackupController.js index 07737e88f..a526cc70e 100644 --- a/Duplicati/Server/webroot/ngax/scripts/controllers/EditBackupController.js +++ b/Duplicati/Server/webroot/ngax/scripts/controllers/EditBackupController.js @@ -315,21 +315,26 @@ backupApp.controller('EditBackupController', function ($rootScope, $scope, $rout return; } - if ($scope.KeepType == 'time' || $scope.KeepType == '') - { - delete opts['keep-versions']; - delete opts['retention-policy']; + // Retention options are mutual exclusive -> allow only one to be selected at a time + function resetAllRetentionOptionsExcept(optionToKeep = '') { + ['keep-versions', 'keep-time', 'retention-policy'].forEach(function(entry) { + if (entry != optionToKeep) { + delete opts[entry]; + } + }); } - if ($scope.KeepType == 'versions' || $scope.KeepType == '') - { - delete opts['keep-time']; - delete opts['retention-policy']; - } - if ($scope.KeepType == 'smart' || $scope.KeepType == '') - { - delete opts['keep-versions']; - delete opts['keep-time']; - delete opts['retention-policy']; + + if ($scope.KeepType == 'time') { + resetAllRetentionOptionsExcept('keep-time'); + + } else if ($scope.KeepType == 'versions') { + resetAllRetentionOptionsExcept('keep-versions'); + + } else if ($scope.KeepType == 'smart' || $scope.KeepType == 'custom') { + resetAllRetentionOptionsExcept('retention-policy'); + + } else { + resetAllRetentionOptionsExcept(); // keep none } if ($scope.KeepType == 'time' && (opts['keep-time'] || '').trim().length == 0)