Skip to content

Commit

Permalink
Adjusted image to work with the new CrashPlan products.
Browse files Browse the repository at this point in the history
Basically, all products now use the same client (the same one as the
enterprise version) and require a server address.  The only exception
is the Small Business version, which uses a predefined, server address.
  • Loading branch information
jlesage committed Nov 29, 2023
1 parent 22512f8 commit 19b190d
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 37 deletions.
21 changes: 12 additions & 9 deletions DOCKERHUB.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Docker container for CrashPlan PRO
# Docker container for CrashPlan
[![Release](https://img.shields.io/github/release/jlesage/docker-crashplan-pro.svg?logo=github&style=for-the-badge)](https://github.com/jlesage/docker-crashplan-pro/releases/latest)
[![Docker Image Size](https://img.shields.io/docker/image-size/jlesage/crashplan-pro/latest?logo=docker&style=for-the-badge)](https://hub.docker.com/r/jlesage/crashplan-pro/tags)
[![Docker Pulls](https://img.shields.io/docker/pulls/jlesage/crashplan-pro?label=Pulls&logo=docker&style=for-the-badge)](https://hub.docker.com/r/jlesage/crashplan-pro)
Expand All @@ -7,19 +7,22 @@
[![Source](https://img.shields.io/badge/Source-GitHub-blue?logo=github&style=for-the-badge)](https://github.com/jlesage/docker-crashplan-pro)
[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg?style=for-the-badge)](https://paypal.me/JocelynLeSage)

This is a Docker container for [CrashPlan PRO](https://www.crashplan.com).
This is a Docker container for [CrashPlan](https://www.crashplan.com).

The GUI of the application is accessed through a modern web browser (no
installation or configuration needed on the client side) or via any VNC client.

This Docker container can be used with all CrashPlan products: Essential,
Professional, Enterprise, MSPs and Small Business (no longer sold).

---

[![CrashPlan PRO logo](https://images.weserv.nl/?url=raw.githubusercontent.com/jlesage/docker-templates/master/jlesage/images/crashplan-pro-icon.png&w=110)](https://www.crashplan.com)[![CrashPlan PRO](https://images.placeholders.dev/?width=416&height=110&fontFamily=monospace&fontWeight=400&fontSize=52&text=CrashPlan%20PRO&bgColor=rgba(0,0,0,0.0)&textColor=rgba(121,121,121,1))](https://www.crashplan.com)
[![CrashPlan logo](https://images.weserv.nl/?url=raw.githubusercontent.com/jlesage/docker-templates/master/jlesage/images/crashplan-pro-icon.png&w=110)](https://www.crashplan.com)[![CrashPlan](https://images.placeholders.dev/?width=288&height=110&fontFamily=monospace&fontWeight=400&fontSize=52&text=CrashPlan&bgColor=rgba(0,0,0,0.0)&textColor=rgba(121,121,121,1))](https://www.crashplan.com)

CrashPlan offers the most comprehensive online backup solution to tens of
thousands of businesses around the world. The highly secure, automatic and
continuous service provides customers the peace of mind that their digital life
is protected and easily accessible.
CrashPlan provides peace of mind through secure, scalable, and
straightforward endpoint data backup. We help organizations recover from
any worst-case scenario, whether it is a disaster, simple human error, a
stolen laptop, ransomware or an as-of-yet undiscovered calamity.

---

Expand All @@ -29,7 +32,7 @@ is protected and easily accessible.
The Docker command provided in this quick start is given as an example
and parameters should be adjusted to your need.

Launch the CrashPlan PRO docker container with the following command:
Launch the CrashPlan docker container with the following command:
```shell
docker run -d \
--name=crashplan-pro \
Expand All @@ -44,7 +47,7 @@ Where:
- `/docker/appdata/crashplan-pro`: This is where the application stores its configuration, states, log and any files needing persistency.
- `/home/user`: This location contains files from your host that need to be accessible to the application.

Browse to `http://your-host-ip:5800` to access the CrashPlan PRO GUI.
Browse to `http://your-host-ip:5800` to access the CrashPlan GUI.
Files from the host appear under the `/storage` folder in the container.

## Documentation
Expand Down
13 changes: 7 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ARG CRASHPLAN_VERSION=11.2.0
ARG CRASHPLAN_BUILD=520

# Define software download URLs.
ARG CRASHPLAN_URL=https://download.crashplan.com/installs/agent/cloud/${CRASHPLAN_VERSION}/${CRASHPLAN_BUILD}/install/CrashPlanSmb_${CRASHPLAN_VERSION}_${CRASHPLAN_BUILD}_Linux.tgz
ARG CRASHPLAN_URL=https://download.crashplan.com/installs/agent/cloud/${CRASHPLAN_VERSION}/${CRASHPLAN_BUILD}/install/CrashPlan_${CRASHPLAN_VERSION}_${CRASHPLAN_BUILD}_Linux.tgz

# Build CrashPlan.
FROM ubuntu:22.04 AS crashplan
Expand All @@ -39,9 +39,9 @@ RUN \
# Keep a copy of the default config.
mv ${TARGETDIR}/conf /defaults/conf && \
# Make sure the UI connects by default to the engine using the loopback IP address (127.0.0.1).
sed-patch '/<orgType>BUSINESS<\/orgType>/a \\t<serviceUIConfig>\n\t\t<serviceHost>127.0.0.1<\/serviceHost>\n\t<\/serviceUIConfig>' /defaults/conf/default.service.xml && \
sed-patch '/<\/serviceBackupConfig>/a \\t<serviceUIConfig>\n\t\t<serviceHost>127.0.0.1<\/serviceHost>\n\t<\/serviceUIConfig>' /defaults/conf/default.service.xml && \
# Add the javaMemoryHeapMax setting to the default service file.
sed-patch '/<serviceUIConfig>/i\\t<javaMemoryHeapMax nil="true"/>' /defaults/conf/default.service.xml && \
#sed-patch '/<serviceUIConfig>/i\\t<javaMemoryHeapMax nil="true"/>' /defaults/conf/default.service.xml && \
# Prevent automatic updates.
rm -r /usr/local/crashplan/upgrade && \
touch /usr/local/crashplan/upgrade && chmod 400 /usr/local/crashplan/upgrade && \
Expand Down Expand Up @@ -83,22 +83,23 @@ COPY rootfs/ /

# Set internal environment variables.
RUN \
set-cont-env APP_NAME "CrashPlan for Small Business" && \
set-cont-env APP_NAME "CrashPlan" && \
set-cont-env APP_VERSION "$CRASHPLAN_VERSION" && \
set-cont-env DOCKER_IMAGE_VERSION "$DOCKER_IMAGE_VERSION" && \
true

# Set public environment variables.
ENV \
CRASHPLAN_SRV_MAX_MEM=1024M
CRASHPLAN_SRV_MAX_MEM=1024M \
CRASHPLAN_SERVER_ADDRESS=

# Define mountable directories.
VOLUME ["/storage"]

# Metadata.
LABEL \
org.label-schema.name="crashplan-pro" \
org.label-schema.description="Docker container for CrashPlan PRO" \
org.label-schema.description="Docker container for CrashPlan" \
org.label-schema.version="${DOCKER_IMAGE_VERSION:-unknown}" \
org.label-schema.vcs-url="https://github.com/jlesage/docker-crashplan-pro" \
org.label-schema.schema-version="1.0"
24 changes: 14 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
# Docker container for CrashPlan PRO
# Docker container for CrashPlan
[![Release](https://img.shields.io/github/release/jlesage/docker-crashplan-pro.svg?logo=github&style=for-the-badge)](https://github.com/jlesage/docker-crashplan-pro/releases/latest)
[![Docker Image Size](https://img.shields.io/docker/image-size/jlesage/crashplan-pro/latest?logo=docker&style=for-the-badge)](https://hub.docker.com/r/jlesage/crashplan-pro/tags)
[![Docker Pulls](https://img.shields.io/docker/pulls/jlesage/crashplan-pro?label=Pulls&logo=docker&style=for-the-badge)](https://hub.docker.com/r/jlesage/crashplan-pro)
[![Docker Stars](https://img.shields.io/docker/stars/jlesage/crashplan-pro?label=Stars&logo=docker&style=for-the-badge)](https://hub.docker.com/r/jlesage/crashplan-pro)
[![Build Status](https://img.shields.io/github/actions/workflow/status/jlesage/docker-crashplan-pro/build-image.yml?logo=github&branch=master&style=for-the-badge)](https://github.com/jlesage/docker-crashplan-pro/actions/workflows/build-image.yml)
[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg?style=for-the-badge)](https://paypal.me/JocelynLeSage)

This project implements a Docker container for [CrashPlan PRO](https://www.crashplan.com).
This project implements a Docker container for [CrashPlan](https://www.crashplan.com).

The GUI of the application is accessed through a modern web browser (no
installation or configuration needed on the client side) or via any VNC client.

This Docker container can be used with all CrashPlan products: Essential,
Professional, Enterprise, MSPs and Small Business (no longer sold).

---

[![CrashPlan PRO logo](https://images.weserv.nl/?url=raw.githubusercontent.com/jlesage/docker-templates/master/jlesage/images/crashplan-pro-icon.png&w=110)](https://www.crashplan.com)[![CrashPlan PRO](https://images.placeholders.dev/?width=416&height=110&fontFamily=monospace&fontWeight=400&fontSize=52&text=CrashPlan%20PRO&bgColor=rgba(0,0,0,0.0)&textColor=rgba(121,121,121,1))](https://www.crashplan.com)
[![CrashPlan logo](https://images.weserv.nl/?url=raw.githubusercontent.com/jlesage/docker-templates/master/jlesage/images/crashplan-pro-icon.png&w=110)](https://www.crashplan.com)[![CrashPlan](https://images.placeholders.dev/?width=288&height=110&fontFamily=monospace&fontWeight=400&fontSize=52&text=CrashPlan&bgColor=rgba(0,0,0,0.0)&textColor=rgba(121,121,121,1))](https://www.crashplan.com)

CrashPlan offers the most comprehensive online backup solution to tens of
thousands of businesses around the world. The highly secure, automatic and
continuous service provides customers the peace of mind that their digital life
is protected and easily accessible.
CrashPlan provides peace of mind through secure, scalable, and
straightforward endpoint data backup. We help organizations recover from
any worst-case scenario, whether it is a disaster, simple human error, a
stolen laptop, ransomware or an as-of-yet undiscovered calamity.

---

Expand Down Expand Up @@ -64,7 +67,7 @@ is protected and easily accessible.
The Docker command provided in this quick start is given as an example
and parameters should be adjusted to your need.

Launch the CrashPlan PRO docker container with the following command:
Launch the CrashPlan docker container with the following command:
```shell
docker run -d \
--name=crashplan-pro \
Expand All @@ -79,7 +82,7 @@ Where:
- `/docker/appdata/crashplan-pro`: This is where the application stores its configuration, states, log and any files needing persistency.
- `/home/user`: This location contains files from your host that need to be accessible to the application.

Browse to `http://your-host-ip:5800` to access the CrashPlan PRO GUI.
Browse to `http://your-host-ip:5800` to access the CrashPlan GUI.
Files from the host appear under the `/storage` folder in the container.

## Usage
Expand Down Expand Up @@ -130,6 +133,7 @@ of this parameter has the format `<VARIABLE_NAME>=<VALUE>`.
|`VNC_PASSWORD`| Password needed to connect to the application's GUI. See the [VNC Password](#vnc-password) section for more details. | (no value) |
|`ENABLE_CJK_FONT`| When set to `1`, open-source computer font `WenQuanYi Zen Hei` is installed. This font contains a large range of Chinese/Japanese/Korean characters. | `0` |
|`CRASHPLAN_SRV_MAX_MEM`| Maximum amount of memory the CrashPlan Engine is allowed to use. One of the following memory unit (case insensitive) should be added as a suffix to the size: `G`, `M` or `K`. By default, when this variable is not set, a maximum of 1024MB (`1024M`) of memory is allowed. **NOTE**: Setting this variable as the same effect as running the `java mx VALUE, restart` command from the CrashPlan command line. | `1024M` |
|`CRASHPLAN_SERVER_ADDRESS`| The CrashPlan server address to use. This is provided by CrashPlan when subscribing to a plan. **NOTE**: CrashPlan for Small Business version requires this variable to be set to `SMB`. This edition comes with a specific, pre-defined server address. | (no value) |
#### Deployment Considerations
Expand Down Expand Up @@ -306,7 +310,7 @@ container image.
4. Select the image, click *Download* and then choose the `latest` tag.
5. Wait for the download to complete. A notification will appear once done.
6. Click on *Container* in the left pane.
7. Select your CrashPlan PRO container.
7. Select your CrashPlan container.
8. Stop it by clicking *Action*->*Stop*.
9. Clear the container by clicking *Action*->*Reset* (or *Action*->*Clear* if
you don't have the latest *Docker* application). This removes the
Expand Down
33 changes: 28 additions & 5 deletions appdefs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,28 @@
app:
id: 10
name: crashplan-pro
friendly_name: CrashPlan PRO
friendly_name: CrashPlan
gui_type: x11
base_os: alpine
project:
description: |-
CrashPlan offers the most comprehensive online backup solution to tens of
thousands of businesses around the world. The highly secure, automatic and
continuous service provides customers the peace of mind that their digital life
is protected and easily accessible.
CrashPlan provides peace of mind through secure, scalable, and
straightforward endpoint data backup. We help organizations recover from
any worst-case scenario, whether it is a disaster, simple human error, a
stolen laptop, ransomware or an as-of-yet undiscovered calamity.
url: https://www.crashplan.com
unraid:
name: CrashPlanPRO
extra_description: >-
**Warning**: Make sure to read the *Taking Over Existing Backup* section of the
documentation if you are installing this container to replace another CrashPlan
installation (from Windows, Linux, Mac or even another Docker container).
support_url: https://forums.unraid.net/topic/59647-support-crashplan-pro/
category: "Backup:"
documentation:
overview: |-
This Docker container can be used with all CrashPlan products: Essential,
Professional, Enterprise, MSPs and Small Business (no longer sold).
sections:
- title: Taking Over Existing Backup
level: 2
Expand Down Expand Up @@ -620,6 +624,25 @@ container:
display: advanced
required: false
mask: false
- name: CRASHPLAN_SERVER_ADDRESS
description: >-
The CrashPlan server address to use. This is provided by CrashPlan when
subscribing to a plan.
**NOTE**: CrashPlan for Small Business version requires this variable
to be set to `SMB`. This edition comes with a specific, pre-defined
server address.
type: public
unraid_template:
title: CrashPlan Server Address
description: >-
The CrashPlan server address to use. This is provided by CrashPlan
when subscribing to a plan.
**NOTE**: CrashPlan for Small Business version requires this variable
to be set to "SMB". This edition comes with a specific, pre-defined
server address.
display: always
required: false
mask: false
# Volumes
volumes: []

Expand Down
36 changes: 29 additions & 7 deletions rootfs/etc/cont-init.d/55-crashplan-pro.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@
set -e # Exit immediately if a command exits with a non-zero status.
set -u # Treat unset variables as an error.

get_cp_max_mem() {
if [ -f "$1" ]; then
cat "$1" | sed -n 's/.*<javaMemoryHeapMax>\(.*\)<\/javaMemoryHeapMax>.*/\1/p'
fi
}

# Generate machine id.
# NOTE: CrashPlan requires the machine-id to be the same to avoid re-login.
# Thus, it needs to be saved into the config directory.
Expand All @@ -28,7 +22,7 @@ mkdir -p /config/var
mkdir -p /config/repository/metadata
mkdir -p /config/.crashplan

# Workaround for a crash that occurs with the enfine with version 11.0.1.33.
# Workaround for a crash that occurs with the engine with version 11.0.1.33.
# See https://github.com/jlesage/docker-crashplan-pro/issues/416
mkdir -p /dev/input/by-path

Expand All @@ -54,6 +48,25 @@ elif [ "$(cat /config/cp_version)" != "$(cat /defaults/cp_version)" ]; then
UPGRADE=1
fi

# Determine if the "SMB" version (for Small Business) of the CrashPlan app is needed.
IS_SMB=0
if [ -f /config/conf/default.service.xml ]; then
if grep -q '<orgType>BUSINESS</orgType>' /config/conf/default.service.xml
then
# The existing installation is the SMB version.
IS_SMB=1
fi
elif [ "${CRASHPLAN_SERVER_ADDRESS:-}" = "SMB" ]; then
# New installation for the SMB version.
IS_SMB=1
fi

if [ "$IS_SMB" -eq 1 ]; then
echo "running the CrashPlan for Small Business version"
elif [ -n "${CRASHPLAN_SERVER_ADDRESS:-}" ]; then
echo "using CrashPlan server $CRASHPLAN_SERVER_ADDRESS"
fi

# Install defaults.
if [ "$FIRST_INSTALL" -eq 1 ] || [ "$UPGRADE" -eq 1 ]; then
# Copy default config files.
Expand All @@ -64,6 +77,15 @@ if [ "$FIRST_INSTALL" -eq 1 ] || [ "$UPGRADE" -eq 1 ]; then

# Clear the cache.
rm -rf /config/cache/*

# Adjust the default.service.xml file.
if [ "$IS_SMB" -eq 1 ]; then
# The SMB version has a hard-coded server address.
sed-patch 's|<orgType>ENTERPRISE</orgType>|<orgType>BUSINESS</orgType>|' /config/conf/default.service.xml
sed-patch 's|<authority .*|<authority address="central.crashplanpro.com:4287" hideAddress="true" lockAddress="true" />|' /config/conf/default.service.xml
elif [ -n "${CRASHPLAN_SERVER_ADDRESS:-}" ]; then
sed-patch 's|<authority .*|<authority address="'$CRASHPLAN_SERVER_ADDRESS'" hideAddress="true" lockAddress="false" />|' /config/conf/default.service.xml
fi
fi

# run.conf was used before CrashPlan 7.0.0.
Expand Down

0 comments on commit 19b190d

Please sign in to comment.