Skip to content

Commit 2e51c28

Browse files
New Script: Duplicati (#2052)
* add duplicati script * Update ct/duplicati.sh Co-authored-by: Michel Roegl-Brunner <[email protected]> * Update ct/duplicati.sh Co-authored-by: Michel Roegl-Brunner <[email protected]> * made admin password random also * fixes --------- Co-authored-by: Michel Roegl-Brunner <[email protected]>
1 parent 0382894 commit 2e51c28

File tree

3 files changed

+170
-0
lines changed

3 files changed

+170
-0
lines changed

ct/duplicati.sh

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
#!/usr/bin/env bash
2+
source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: tremor021
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://github.com/duplicati/duplicati/
7+
8+
APP="Duplicati"
9+
TAGS="backup"
10+
var_cpu="1"
11+
var_ram="1024"
12+
var_disk="10"
13+
var_os="debian"
14+
var_version="12"
15+
var_unprivileged="1"
16+
17+
header_info "$APP"
18+
base_settings
19+
20+
variables
21+
color
22+
catch_errors
23+
24+
function update_script() {
25+
header_info
26+
check_container_storage
27+
check_container_resources
28+
if [[ ! -f /usr/bin/duplicati-server ]]; then
29+
msg_error "No ${APP} Installation Found!"
30+
exit
31+
fi
32+
RELEASE=$(curl -s https://api.github.com/repos/duplicati/duplicati/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4)}')
33+
if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then
34+
msg_info "Stopping $APP"
35+
systemctl stop duplicati
36+
msg_ok "Stopped $APP"
37+
msg_info "Updating $APP to v${RELEASE}"
38+
wget -q "https://github.com/duplicati/duplicati/releases/download/v${RELEASE}/duplicati-${RELEASE}-linux-x64-gui.deb"
39+
$STD dpkg -i duplicati-${RELEASE}-linux-x64-gui.deb
40+
echo "${RELEASE}" >/opt/${APP}_version.txt
41+
msg_ok "Updated $APP to v${RELEASE}"
42+
43+
msg_info "Starting $APP"
44+
systemctl start duplicati
45+
msg_ok "Started $APP"
46+
47+
msg_info "Cleaning Up"
48+
rm -rf ~/duplicati-${RELEASE}-linux-x64-gui.deb
49+
msg_ok "Cleanup Completed"
50+
51+
msg_ok "Update Successful"
52+
else
53+
msg_ok "No update required. ${APP} is already at v${RELEASE}"
54+
fi
55+
exit
56+
}
57+
58+
start
59+
build_container
60+
description
61+
62+
msg_ok "Completed Successfully!\n"
63+
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
64+
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
65+
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8200${CL}"

install/duplicati-install.sh

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: tremor021
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://github.com/duplicati/duplicati
7+
8+
source /dev/stdin <<< "$FUNCTIONS_FILE_PATH"
9+
color
10+
verb_ip6
11+
catch_errors
12+
setting_up_container
13+
network_check
14+
update_os
15+
16+
msg_info "Installing Dependencies"
17+
$STD apt-get install -y \
18+
curl \
19+
sudo \
20+
mc \
21+
libice6 \
22+
libsm6 \
23+
libfontconfig1
24+
msg_ok "Installed Dependencies"
25+
26+
msg_info "Setting up Duplicati"
27+
RELEASE=$(curl -s https://api.github.com/repos/duplicati/duplicati/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4)}')
28+
wget -q "https://github.com/duplicati/duplicati/releases/download/v${RELEASE}/duplicati-${RELEASE}-linux-x64-gui.deb"
29+
$STD dpkg -i duplicati-${RELEASE}-linux-x64-gui.deb
30+
echo "${RELEASE}" >/opt/Duplicati_version.txt
31+
msg_ok "Finished setting up Duplicati"
32+
33+
DECRYPTKEY=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
34+
ADMINPASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
35+
{
36+
echo "Admin password = ${ADMINPASS}"
37+
echo "Database encryption key = ${DECRYPTKEY}"
38+
} >> ~/duplicati.creds
39+
40+
msg_info "Creating Service"
41+
cat <<EOF >/etc/systemd/system/duplicati.service
42+
[Unit]
43+
Description=Duplicati Service
44+
After=network.target
45+
46+
[Service]
47+
ExecStart=/usr/bin/duplicati-server --webservice-interface=any --webservice-password=$ADMINPASS --settings-encryption-key=$DECRYPTKEY
48+
Restart=always
49+
50+
[Install]
51+
WantedBy=multi-user.target
52+
EOF
53+
systemctl enable -q --now duplicati
54+
msg_ok "Created Service"
55+
56+
motd_ssh
57+
customize
58+
59+
msg_info "Cleaning up"
60+
rm -f duplicati-${RELEASE}-linux-x64-gui.deb
61+
$STD apt-get -y autoremove
62+
$STD apt-get -y autoclean
63+
msg_ok "Cleaned"
64+
65+
motd_ssh
66+
customize

json/duplicati.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"name": "Duplicati",
3+
"slug": "duplicati",
4+
"categories": [
5+
7
6+
],
7+
"date_created": "2025-02-06",
8+
"type": "ct",
9+
"updateable": true,
10+
"privileged": false,
11+
"interface_port": 8200,
12+
"documentation": "https://docs.duplicati.com/",
13+
"website": "https://duplicati.com/",
14+
"logo": "https://framerusercontent.com/images/LezF3gmqYkyAgrNprSShLYIsw.png",
15+
"description": "Duplicati is a free, open-source backup solution that offers zero-trust, fully encrypted backups for your data.",
16+
"install_methods": [
17+
{
18+
"type": "default",
19+
"script": "ct/duplicati.sh",
20+
"resources": {
21+
"cpu": 1,
22+
"ram": 1048,
23+
"hdd": 10,
24+
"os": "debian",
25+
"version": "12"
26+
}
27+
}
28+
],
29+
"default_credentials": {
30+
"username": null,
31+
"password": null
32+
},
33+
"notes": [
34+
{
35+
"text": "Admin password and database encryption key: `cat ~/duplicati.creds`",
36+
"type": "info"
37+
}
38+
]
39+
}

0 commit comments

Comments
 (0)