Compare commits

...
Author SHA1 Message Date
push-app-to-main[bot] 80b395b84e Add kopia (ct) 2026-12-01 18:58:02 +00:00
2 changed files with 117 additions and 0 deletions

No files matched your search

+60
View File
@@ -0,0 +1,60 @@
#!/usr/bin/env bash
_cs_boot="${COMMUNITY_SCRIPTS_CORE_DIR:-$(dirname "${BASH_SOURCE[0]}")/../../core}/core/build.func"
source "$_cs_boot" 2>/dev/null || source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_URL:-https://raw.githubusercontent.com/community-scripts/core/main}/core/build.func")
# Copyright (c) 2021-2026 community-scripts ORG
# Author: MickLesk (CanbiZ)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://github.com/kopia/kopia
APP="Kopia"
var_tags="${var_tags:-backup}"
var_cpu="${var_cpu:-2}"
var_ram="${var_ram:-1024}"
var_disk="${var_disk:-10}"
var_os="${var_os:-debian}"
var_version="${var_version:-13}"
var_arm64="${var_arm64:-yes}"
var_unprivileged="${var_unprivileged:-1}"
export var_kopia_password="${var_kopia_password:-}"
export var_kopia_repo_password="${var_kopia_repo_password:-}"
header_info "$APP"
variables
color
catch_errors
function update_script() {
header_info
check_container_storage
check_container_resources
if [[ ! -f /opt/kopia_data/.env ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
if check_for_gh_release "kopia" "kopia/kopia"; then
msg_info "Stopping Kopia"
systemctl stop kopia
msg_ok "Stopped Kopia"
fetch_and_deploy_gh_release "kopia" "kopia/kopia" "binary" "latest" "" "kopia_*_linux_$(arch_resolve "amd64" "arm64").deb"
msg_info "Starting Kopia"
systemctl start kopia
msg_ok "Started Kopia"
msg_ok "Updated successfully!"
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 "${GATEWAY}${BGN}https://${IP}:51515${CL}"
echo -e "${INFO}${YW}Credentials are stored in /opt/kopia_data/.env${CL}"
+57
View File
@@ -0,0 +1,57 @@
#!/usr/bin/env bash
# Copyright (c) 2021-2026 community-scripts ORG
# Author: MickLesk (CanbiZ)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://github.com/kopia/kopia
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
fetch_and_deploy_gh_release "kopia" "kopia/kopia" "binary" "latest" "" "kopia_*_linux_$(arch_resolve "amd64" "arm64").deb"
create_self_signed_cert "kopia"
msg_info "Creating Kopia Repository"
mkdir -p /opt/kopia_data/{config,repository,cache,logs}
cat <<EOT >/opt/kopia_data/.env
KOPIA_CONFIG_PATH=/opt/kopia_data/config/repository.config
KOPIA_CACHE_DIRECTORY=/opt/kopia_data/cache
KOPIA_LOG_DIR=/opt/kopia_data/logs
KOPIA_PASSWORD=${var_kopia_repo_password:-$(random_password)}
KOPIA_SERVER_USERNAME=admin
KOPIA_SERVER_PASSWORD=${var_kopia_password:-$(random_password)}
KOPIA_SERVER_CONTROL_PASSWORD=$(random_password)
EOT
chmod 600 /opt/kopia_data/.env
set -a
source /opt/kopia_data/.env
set +a
$STD kopia repository create filesystem --path /opt/kopia_data/repository
msg_ok "Created Kopia Repository"
msg_info "Creating Service"
cat <<EOT >/etc/systemd/system/kopia.service
[Unit]
Description=Kopia Server
After=network-online.target
Wants=network-online.target
[Service]
EnvironmentFile=/opt/kopia_data/.env
ExecStart=/usr/bin/kopia server start --address=0.0.0.0:51515 --tls-cert-file=/etc/ssl/kopia/kopia.crt --tls-key-file=/etc/ssl/kopia/kopia.key
Restart=on-failure
[Install]
WantedBy=multi-user.target
EOT
systemctl enable -q --now kopia
msg_ok "Created Service"
motd_ssh
customize
cleanup_lxc