diff --git a/ct/backrest.sh b/ct/backrest.sh new file mode 100644 index 00000000..c69d359b --- /dev/null +++ b/ct/backrest.sh @@ -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}" diff --git a/ct/headers/authentik b/ct/headers/authentik deleted file mode 100644 index f609964e..00000000 --- a/ct/headers/authentik +++ /dev/null @@ -1,6 +0,0 @@ - ___ __ __ __ _ __ - / | __ __/ /_/ /_ ___ ____ / /_(_) /__ - / /| |/ / / / __/ __ \/ _ \/ __ \/ __/ / //_/ - / ___ / /_/ / /_/ / / / __/ / / / /_/ / ,< -/_/ |_\__,_/\__/_/ /_/\___/_/ /_/\__/_/_/|_| - diff --git a/ct/headers/backrest b/ct/headers/backrest new file mode 100644 index 00000000..fd1f7f06 --- /dev/null +++ b/ct/headers/backrest @@ -0,0 +1,6 @@ + ____ __ __ + / __ )____ ______/ /__________ _____/ /_ + / __ / __ `/ ___/ //_/ ___/ _ \/ ___/ __/ + / /_/ / /_/ / /__/ ,< / / / __(__ ) /_ +/_____/\__,_/\___/_/|_/_/ \___/____/\__/ + diff --git a/ct/headers/bookstack b/ct/headers/bookstack deleted file mode 100644 index f6864666..00000000 --- a/ct/headers/bookstack +++ /dev/null @@ -1,6 +0,0 @@ - ____ __ __ __ - / __ )____ ____ / /_______/ /_____ ______/ /__ - / __ / __ \/ __ \/ //_/ ___/ __/ __ `/ ___/ //_/ - / /_/ / /_/ / /_/ / ,< (__ ) /_/ /_/ / /__/ ,< -/_____/\____/\____/_/|_/____/\__/\__,_/\___/_/|_| - diff --git a/ct/headers/gatus b/ct/headers/gatus deleted file mode 100644 index 42caf9c6..00000000 --- a/ct/headers/gatus +++ /dev/null @@ -1,6 +0,0 @@ - __ - ____ _____ _/ /___ _______ - / __ `/ __ `/ __/ / / / ___/ - / /_/ / /_/ / /_/ /_/ (__ ) - \__, /\__,_/\__/\__,_/____/ -/____/ diff --git a/ct/headers/homeassistant-core b/ct/headers/homeassistant-core deleted file mode 100644 index aaf56a68..00000000 --- a/ct/headers/homeassistant-core +++ /dev/null @@ -1,6 +0,0 @@ - __ __ ___ _ __ __ ______ - / / / /___ ____ ___ ___ / | __________(_)____/ /_____ _____ / /_ / ____/___ ________ - / /_/ / __ \/ __ `__ \/ _ \ / /| | / ___/ ___/ / ___/ __/ __ `/ __ \/ __/_____/ / / __ \/ ___/ _ \ - / __ / /_/ / / / / / / __/ / ___ |(__ |__ ) (__ ) /_/ /_/ / / / / /_/_____/ /___/ /_/ / / / __/ -/_/ /_/\____/_/ /_/ /_/\___/ /_/ |_/____/____/_/____/\__/\__,_/_/ /_/\__/ \____/\____/_/ \___/ - diff --git a/ct/headers/matterbridge b/ct/headers/matterbridge deleted file mode 100644 index 6aa7b56b..00000000 --- a/ct/headers/matterbridge +++ /dev/null @@ -1,6 +0,0 @@ - __ ___ __ __ __ _ __ - / |/ /___ _/ /_/ /____ _____/ /_ _____(_)___/ /___ ____ - / /|_/ / __ `/ __/ __/ _ \/ ___/ __ \/ ___/ / __ / __ `/ _ \ - / / / / /_/ / /_/ /_/ __/ / / /_/ / / / / /_/ / /_/ / __/ -/_/ /_/\__,_/\__/\__/\___/_/ /_.___/_/ /_/\__,_/\__, /\___/ - /____/ diff --git a/ct/headers/mattermost b/ct/headers/mattermost deleted file mode 100644 index 1fc67ba3..00000000 --- a/ct/headers/mattermost +++ /dev/null @@ -1,6 +0,0 @@ - __ ___ __ __ __ - / |/ /___ _/ /_/ /____ _________ ___ ____ _____/ /_ - / /|_/ / __ `/ __/ __/ _ \/ ___/ __ `__ \/ __ \/ ___/ __/ - / / / / /_/ / /_/ /_/ __/ / / / / / / / /_/ (__ ) /_ -/_/ /_/\__,_/\__/\__/\___/_/ /_/ /_/ /_/\____/____/\__/ - diff --git a/ct/headers/openproject b/ct/headers/openproject deleted file mode 100644 index 79fe7cf2..00000000 --- a/ct/headers/openproject +++ /dev/null @@ -1,6 +0,0 @@ - ____ ____ _ __ - / __ \____ ___ ____ / __ \_________ (_)__ _____/ /_ - / / / / __ \/ _ \/ __ \/ /_/ / ___/ __ \ / / _ \/ ___/ __/ -/ /_/ / /_/ / __/ / / / ____/ / / /_/ / / / __/ /__/ /_ -\____/ .___/\___/_/ /_/_/ /_/ \____/_/ /\___/\___/\__/ - /_/ /___/ diff --git a/ct/headers/paperless-ngx b/ct/headers/paperless-ngx deleted file mode 100644 index 177cf574..00000000 --- a/ct/headers/paperless-ngx +++ /dev/null @@ -1,6 +0,0 @@ - ____ __ - / __ \____ _____ ___ _____/ /__ __________ ____ ____ __ __ - / /_/ / __ `/ __ \/ _ \/ ___/ / _ \/ ___/ ___/_____/ __ \/ __ `/ |/_/ - / ____/ /_/ / /_/ / __/ / / / __(__ |__ )_____/ / / / /_/ /> < -/_/ \__,_/ .___/\___/_/ /_/\___/____/____/ /_/ /_/\__, /_/|_| - /_/ /____/ diff --git a/frontend/public/json/backrest.json b/frontend/public/json/backrest.json new file mode 100644 index 00000000..a3e643d2 --- /dev/null +++ b/frontend/public/json/backrest.json @@ -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." + } + ] +} \ No newline at end of file diff --git a/install/backrest-install.sh b/install/backrest-install.sh new file mode 100644 index 00000000..14d7f1aa --- /dev/null +++ b/install/backrest-install.sh @@ -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 </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"