Compare commits

...

12 Commits

Author SHA1 Message Date
CanbiZ
706ff5b006
Merge pull request #316 from ksad/backrest-script
New Script: Backrest
2025-05-14 10:48:02 +02:00
Karim SAD
6ab9a16e95 Update install/backrest-install.sh 2025-05-13 09:43:12 -04:00
enirts31
80b76212d9
Update frontend/public/json/backrest.json
Co-authored-by: Slaviša Arežina <58952836+tremor021@users.noreply.github.com>
2025-05-13 09:37:12 -04:00
enirts31
145d116ef8
Update frontend/public/json/backrest.json
Co-authored-by: Slaviša Arežina <58952836+tremor021@users.noreply.github.com>
2025-05-13 09:36:19 -04:00
enirts31
a4c69b211c
Update ct/backrest.sh
Co-authored-by: Slaviša Arežina <58952836+tremor021@users.noreply.github.com>
2025-05-13 09:35:25 -04:00
enirts31
19b0c7d527
Update ct/backrest.sh
Co-authored-by: Slaviša Arežina <58952836+tremor021@users.noreply.github.com>
2025-05-13 09:35:11 -04:00
enirts31
75812b4409
Update ct/backrest.sh
Co-authored-by: Slaviša Arežina <58952836+tremor021@users.noreply.github.com>
2025-05-13 09:34:47 -04:00
enirts31
5fd366e9b1
Update ct/backrest.sh
Co-authored-by: Slaviša Arežina <58952836+tremor021@users.noreply.github.com>
2025-05-13 09:34:22 -04:00
enirts31
c7c9daca80
Update ct/backrest.sh
Co-authored-by: Slaviša Arežina <58952836+tremor021@users.noreply.github.com>
2025-05-13 09:33:59 -04:00
enirts31
60788fccbd
Update install/backrest-install.sh
Co-authored-by: Slaviša Arežina <58952836+tremor021@users.noreply.github.com>
2025-05-13 09:33:22 -04:00
enirts31
b541ecf318
Update ct/backrest.sh
Co-authored-by: Slaviša Arežina <58952836+tremor021@users.noreply.github.com>
2025-05-13 09:27:07 -04:00
Karim SAD
30229fe06c New Script: Backrest 2025-05-12 20:11:43 -04:00
3 changed files with 158 additions and 0 deletions

63
ct/backrest.sh Normal file
View File

@ -0,0 +1,63 @@
#!/usr/bin/env bash
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func)
# Copyright (c) 2021-2025 community-scripts ORG
# Author: ksad (enirys31)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://garethgeorge.github.io/backrest/
APP="Backrest"
var_tags="${var_tags:-backup}"
var_cpu="${var_cpu:-1}"
var_ram="${var_ram:-512}"
var_disk="${var_disk:-8}"
var_os="${var_os:-debian}"
var_version="${var_version:-12}"
var_unprivileged="${var_unprivileged:-1}"
header_info "$APP"
variables
color
catch_errors
function update_script() {
header_info
check_container_storage
check_container_resources
if [[ ! -d /opt/backrest ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
RELEASE=$(curl -fsSL https://api.github.com/repos/garethgeorge/backrest/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
msg_info "Stopping ${APP}"
systemctl stop backrest
msg_ok "Stopped ${APP}"
msg_info "Updating ${APP} to ${RELEASE}"
cd /opt/backrest/bin
curl -fsSL "https://github.com/garethgeorge/backrest/releases/download/v${RELEASE}/backrest_Linux_x86_64.tar.gz" -o "backrest_Linux_x86_64.tar.gz"
tar -xzf backrest_Linux_x86_64.tar.gz
rm -rf backrest_Linux_x86_64.tar.gz
rm -f install.sh uninstall.sh
chmod +x backrest
echo "${RELEASE}" >/opt/${APP}_version.txt
msg_ok "Updated ${APP} to ${RELEASE}"
msg_info "Starting ${APP}"
systemctl start backrest
msg_ok "Started ${APP}"
msg_ok "Updated Successfully"
else
msg_ok "No update required. ${APP} is already at ${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}:9898${CL}"

View File

@ -0,0 +1,40 @@
{
"name": "Backrest",
"slug": "backrest",
"categories": [
7
],
"date_created": "2025-05-11",
"type": "ct",
"updateable": true,
"privileged": false,
"interface_port": 9898,
"documentation": "https://garethgeorge.github.io/backrest/introduction/getting-started",
"website": "https://garethgeorge.github.io/backrest",
"logo": "https://raw.githubusercontent.com/selfhst/icons/refs/heads/main/svg/backrest-light.svg",
"config_path": "/opt/backrest/config/config.json",
"description": "Backrest is a web-accessible backup solution built on top of restic and providing a WebUI which wraps the restic CLI and makes it easy to create repos, browse snapshots, and restore files. Additionally, Backrest can run in the background and take an opinionated approach to scheduling snapshots and orchestrating repo health operations.",
"install_methods": [
{
"type": "default",
"script": "ct/backrest.sh",
"resources": {
"cpu": 1,
"ram": 512,
"hdd": 8,
"os": "debian",
"version": "12"
}
}
],
"default_credentials": {
"username": null,
"password": null
},
"notes": [
{
"type": "info",
"text": "`cat ~/.ssh/id_ed25519.pub` to view ssh public key. This key is used to authenticate with sftp targets. You can add this key on the sftp server."
}
]
}

View File

@ -0,0 +1,55 @@
#!/usr/bin/env bash
# Copyright (c) 2021-2025 community-scripts ORG
# Author: ksad (enirys31)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://garethgeorge.github.io/backrest/
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
msg_info "Installing Backrest"
RELEASE=$(curl -fsSL https://api.github.com/repos/garethgeorge/backrest/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
mkdir -p /opt/backrest/{bin,config,data}
cd /opt/backrest/bin
curl -fsSL "https://github.com/garethgeorge/backrest/releases/download/v${RELEASE}/backrest_Linux_x86_64.tar.gz" -o "backrest_Linux_x86_64.tar.gz"
tar -xzf backrest_Linux_x86_64.tar.gz
chmod +x backrest
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
msg_ok "Installed Backrest"
msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/backrest.service
[Unit]
Description=Backrest
After=network.target
[Service]
Type=simple
User=root
ExecStart=/opt/backrest/bin/backrest
Environment="BACKREST_PORT=9898"
Environment="BACKREST_CONFIG=/opt/backrest/config/config.json"
Environment="BACKREST_DATA=/opt/backrest/data"
Environment="XDG_CACHE_HOME=/opt/backrest/cache"
[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now backrest
msg_ok "Created Service"
motd_ssh
customize
msg_info "Cleaning up"
$STD apt-get -y autoremove
$STD apt-get -y autoclean
rm -rf backrest_Linux_x86_64.tar.gz
rm -f install.sh uninstall.sh
msg_ok "Cleaned"