From a53daa3559b369beba64308e69615d77a11114d8 Mon Sep 17 00:00:00 2001 From: "push-app-to-main[bot]" <203845782+push-app-to-main[bot]@users.noreply.github.com> Date: Tue, 22 Jul 2025 15:56:22 +0200 Subject: [PATCH] Salt (#6116) * 'Add new script' * curl * hdd * logo --------- Co-authored-by: push-app-to-main[bot] <203845782+push-app-to-main[bot]@users.noreply.github.com> Co-authored-by: CanbiZ <47820557+MickLesk@users.noreply.github.com> --- ct/headers/salt | 6 ++++ ct/salt.sh | 50 ++++++++++++++++++++++++++++++++++ frontend/public/json/salt.json | 35 ++++++++++++++++++++++++ install/salt-install.sh | 44 ++++++++++++++++++++++++++++++ 4 files changed, 135 insertions(+) create mode 100644 ct/headers/salt create mode 100644 ct/salt.sh create mode 100644 frontend/public/json/salt.json create mode 100644 install/salt-install.sh diff --git a/ct/headers/salt b/ct/headers/salt new file mode 100644 index 000000000..3b11949de --- /dev/null +++ b/ct/headers/salt @@ -0,0 +1,6 @@ + _____ ____ + / ___/____ _/ / /_ + \__ \/ __ `/ / __/ + ___/ / /_/ / / /_ +/____/\__,_/_/\__/ + diff --git a/ct/salt.sh b/ct/salt.sh new file mode 100644 index 000000000..cfdbb5450 --- /dev/null +++ b/ct/salt.sh @@ -0,0 +1,50 @@ +#!/usr/bin/env bash +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +# Copyright (c) 2021-2025 community-scripts ORG +# Author: bvdberg01 +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/saltstack/salt + +APP="Salt" +var_tags="${var_tags:-automations}" +var_cpu="${var_cpu:-1}" +var_ram="${var_ram:-1024}" +var_disk="${var_disk:-3}" +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 /etc/salt ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + + RELEASE=$(curl -fsSL https://api.github.com/repos/saltstack/salt/releases/latest | jq -r .tag_name | sed 's/^v//') + if [[ ! -f /~.salt ]] || [[ "${RELEASE}" != "$(cat /~.salt)" ]]; then + msg_info "Updating $APP to ${RELEASE}" + sed -i "s/^\(Pin: version \).*/\1${RELEASE}/" /etc/apt/preferences.d/salt-pin-1001 + $STD apt-get update + $STD apt-get upgrade -y + echo "${RELEASE}" >/~.salt + msg_ok "Updated ${APP} to ${RELEASE}" + else + msg_ok "${APP} is already up to date (${RELEASE})" + fi +} + +start +build_container +description + +msg_ok "Completed Successfully!\n" +echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" diff --git a/frontend/public/json/salt.json b/frontend/public/json/salt.json new file mode 100644 index 000000000..68e6afeaa --- /dev/null +++ b/frontend/public/json/salt.json @@ -0,0 +1,35 @@ +{ + "name": "Salt", + "slug": "salt", + "categories": [ + 19 + ], + "date_created": "2025-07-21", + "type": "ct", + "updateable": true, + "privileged": false, + "config_path": "/opt/salt/.env", + "interface_port": 3000, + "documentation": "https://docs.saltproject.io/salt/install-guide/en/latest/", + "website": "https://saltproject.io/", + "logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/salt.webp", + "description": "SaltStack Salt is a software for automating the management and configuration of IT infrastructure and applications. It is an event-driven automation tool and framework used to deploy, configure, and manage complex IT systems. Its primary functions include configuration management, where it ensures consistent configurations and manages operating system deployment and software installation. It also automates and orchestrates routine IT processes and can create self-aware, self-healing systems.", + "install_methods": [ + { + "type": "default", + "script": "ct/salt.sh", + "resources": { + "cpu": 1, + "ram": 1024, + "hdd": 3, + "os": "Debian", + "version": "12" + } + } + ], + "default_credentials": { + "username": null, + "password": null + }, + "notes": [] +} diff --git a/install/salt-install.sh b/install/salt-install.sh new file mode 100644 index 000000000..4fe29a824 --- /dev/null +++ b/install/salt-install.sh @@ -0,0 +1,44 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2025 community-scripts ORG +# Author: bvdberg01 +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/saltstack/salt + +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 jq +msg_ok "Installed Dependencies" + +msg_info "Setup Salt Repo" +mkdir -p /etc/apt/keyrings +curl -fsSL https://packages.broadcom.com/artifactory/api/security/keypair/SaltProjectKey/public -o /etc/apt/keyrings/salt-archive-keyring.pgp +curl -fsSL https://github.com/saltstack/salt-install-guide/releases/latest/download/salt.sources -o /etc/apt/sources.list.d/salt.sources +$STD apt-get update +msg_ok "Setup Salt Repo" + +msg_info "Installing Salt" +RELEASE=$(curl -fsSL https://api.github.com/repos/saltstack/salt/releases/latest | jq -r .tag_name | sed 's/^v//') +cat </etc/apt/preferences.d/salt-pin-1001 +Package: salt-* +Pin: version ${RELEASE} +Pin-Priority: 1001 +EOF +$STD apt-get install -y salt-master +echo "${RELEASE}" >/~.salt +msg_ok "Installed Salt" + +motd_ssh +customize + +msg_info "Cleaning up" +$STD apt-get -y autoremove +$STD apt-get -y autoclean +msg_ok "Cleaned"