Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Script: Duplicati #2052

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions ct/duplicati.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
#!/usr/bin/env bash
source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
# Copyright (c) 2021-2025 community-scripts ORG
# Author: tremor021
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://github.com/duplicati/duplicati/

APP="Duplicati"
TAGS="backup"
var_cpu="1"
var_ram="1024"
var_disk="10"
var_os="debian"
var_version="12"
var_unprivileged="1"

header_info "$APP"
base_settings

variables
color
catch_errors

function update_script() {
header_info
check_container_storage
check_container_resources

tremor021 marked this conversation as resolved.
Show resolved Hide resolved
if [[ ! -f /usr/bin/duplicati-server ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi

tremor021 marked this conversation as resolved.
Show resolved Hide resolved
RELEASE=$(curl -s https://api.github.com/repos/duplicati/duplicati/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4)}')
if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then
msg_info "Updating $APP"

tremor021 marked this conversation as resolved.
Show resolved Hide resolved
msg_info "Stopping $APP"
systemctl stop duplicati
msg_ok "Stopped $APP"

tremor021 marked this conversation as resolved.
Show resolved Hide resolved

msg_info "Updating $APP to v${RELEASE}"
wget -q "https://github.com/duplicati/duplicati/releases/download/v${RELEASE}/duplicati-${RELEASE}-linux-x64-gui.deb"
$STD dpkg -i duplicati-${RELEASE}-linux-x64-gui.deb
msg_ok "Updated $APP to v${RELEASE}"

msg_info "Starting $APP"
systemctl start duplicati
msg_ok "Started $APP"

msg_info "Cleaning Up"
rm -rf ~/duplicati-${RELEASE}-linux-x64-gui.deb
msg_ok "Cleanup Completed"

echo "${RELEASE}" >/opt/${APP}_version.txt
tremor021 marked this conversation as resolved.
Show resolved Hide resolved
msg_ok "Update Successful"
else
msg_ok "No update required. ${APP} is already at v${RELEASE}"
fi
exit
}

start
build_container
description

msg_ok "Completed Successfully!\n"
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8200${CL}"
66 changes: 66 additions & 0 deletions install/duplicati-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#!/usr/bin/env bash

# Copyright (c) 2021-2025 community-scripts ORG
# Author: tremor021
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://github.com/duplicati/duplicati

source /dev/stdin <<< "$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os

msg_info "Installing Dependencies"
$STD apt-get install -y \
curl \
sudo \
mc \
libice6 \
libsm6 \
libfontconfig1
msg_ok "Installed Dependencies"

msg_info "Setting up Duplicati"
RELEASE=$(curl -s https://api.github.com/repos/duplicati/duplicati/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4)}')
wget -q "https://github.com/duplicati/duplicati/releases/download/v${RELEASE}/duplicati-${RELEASE}-linux-x64-gui.deb"
$STD dpkg -i duplicati-${RELEASE}-linux-x64-gui.deb
echo "${RELEASE}" >/opt/Duplicati_version.txt
msg_ok "Finished setting up Duplicati"

DECRYPTKEY=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
ADMINPASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
{
echo "Admin password = ${ADMINPASS}"
echo "Database encryption key = ${DECRYPTKEY}"
} >> ~/duplicati.creds

msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/duplicati.service
[Unit]
Description=Duplicati Service
After=network.target

[Service]
ExecStart=/usr/bin/duplicati-server --webservice-interface=any --webservice-password=$ADMINPASS --settings-encryption-key=$DECRYPTKEY
Restart=always

[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now duplicati
msg_ok "Created Service"

motd_ssh
customize

msg_info "Cleaning up"
rm -f duplicati-${RELEASE}-linux-x64-gui.deb
$STD apt-get -y autoremove
$STD apt-get -y autoclean
msg_ok "Cleaned"

motd_ssh
customize
39 changes: 39 additions & 0 deletions json/duplicati.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"name": "Duplicati",
"slug": "duplicati",
"categories": [
7
],
"date_created": "2025-02-05",
tremor021 marked this conversation as resolved.
Show resolved Hide resolved
"type": "ct",
"updateable": true,
"privileged": false,
"interface_port": 8200,
"documentation": "https://docs.duplicati.com/",
"website": "https://duplicati.com/",
"logo": "https://framerusercontent.com/images/LezF3gmqYkyAgrNprSShLYIsw.png",
"description": "Duplicati is a free, open-source backup solution that offers zero-trust, fully encrypted backups for your data.",
"install_methods": [
{
"type": "default",
"script": "ct/duplicati.sh",
"resources": {
"cpu": 1,
"ram": 1048,
"hdd": 10,
"os": "debian",
"version": "12"
}
}
],
"default_credentials": {
"username": null,
"password": null
},
"notes": [
{
"text": "Admin password and database encryption key: `cat ~/duplicati.creds`",
"type": "info"
}
]
}