From 06d9199d89d3aaa54127f8b832be42fa6ea39d46 Mon Sep 17 00:00:00 2001 From: "CanbiZ (MickLesk)" <47820557+MickLesk@users.noreply.github.com> Date: Thu, 5 Feb 2026 11:55:32 +0100 Subject: [PATCH] feat(sqlserver): add SQL Server 2025 with Ubuntu 24.04 support & refactor 2022 (#11546) - Add new SQL Server 2025 scripts with Ubuntu 24.04 support - Refactor both versions to use setup_deb822_repo - Fix debuginfod profile causing update errors (#11522) - Use apt instead of apt-get in CT scripts - Consistent messaging and formatting --- ct/sqlserver2022.sh | 3 +- ct/sqlserver2025.sh | 45 +++++++++++++++++ frontend/public/json/sqlserver2025.json | 52 +++++++++++++++++++ install/sqlserver2022-install.sh | 37 +++++++++----- install/sqlserver2025-install.sh | 66 +++++++++++++++++++++++++ 5 files changed, 190 insertions(+), 13 deletions(-) create mode 100644 ct/sqlserver2025.sh create mode 100644 frontend/public/json/sqlserver2025.json create mode 100644 install/sqlserver2025-install.sh diff --git a/ct/sqlserver2022.sh b/ct/sqlserver2022.sh index 4e41379af..e66baa7e8 100644 --- a/ct/sqlserver2022.sh +++ b/ct/sqlserver2022.sh @@ -27,7 +27,8 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - msg_info "Updating ${APP} LXC" + msg_info "Updating SQL Server 2022" + rm -f /etc/profile.d/debuginfod.sh /etc/profile.d/debuginfod.csh $STD apt update $STD apt -y upgrade msg_ok "Updated successfully!" diff --git a/ct/sqlserver2025.sh b/ct/sqlserver2025.sh new file mode 100644 index 000000000..729c84013 --- /dev/null +++ b/ct/sqlserver2025.sh @@ -0,0 +1,45 @@ +#!/usr/bin/env bash +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/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://www.microsoft.com/en-us/sql-server/sql-server-2025 + +APP="SQL Server 2025" +var_tags="${var_tags:-sql;database}" +var_cpu="${var_cpu:-2}" +var_ram="${var_ram:-2048}" +var_disk="${var_disk:-10}" +var_os="${var_os:-ubuntu}" +var_version="${var_version:-24.04}" +var_unprivileged="${var_unprivileged:-0}" + +header_info "$APP" +variables +color +catch_errors + +function update_script() { + header_info + check_container_storage + check_container_resources + if [[ ! -d /opt/mssql ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + msg_info "Updating SQL Server 2025" + rm -f /etc/profile.d/debuginfod.sh /etc/profile.d/debuginfod.csh + $STD apt update + $STD apt -y upgrade + msg_ok "Updated successfully!" + 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 IP:${CL}" +echo -e "${TAB}${GATEWAY}${BGN}${IP}:1433${CL}" diff --git a/frontend/public/json/sqlserver2025.json b/frontend/public/json/sqlserver2025.json new file mode 100644 index 000000000..0af9ba70e --- /dev/null +++ b/frontend/public/json/sqlserver2025.json @@ -0,0 +1,52 @@ +{ + "name": "SQL Server 2025", + "slug": "sqlserver2025", + "categories": [ + 8 + ], + "date_created": "2026-02-04", + "type": "ct", + "updateable": true, + "privileged": true, + "interface_port": 1433, + "documentation": "https://learn.microsoft.com/en-us/sql/sql-server/?view=sql-server-ver17", + "website": "https://www.microsoft.com/en-us/sql-server/sql-server-2025", + "logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/microsoft-sql-server.webp", + "config_path": "", + "description": "Script to automatically set up a SQL Server 2025 installation with Ubuntu 24.04 support.", + "install_methods": [ + { + "type": "default", + "script": "ct/sqlserver2025.sh", + "resources": { + "cpu": 2, + "ram": 2048, + "hdd": 10, + "os": "Ubuntu", + "version": "24.04" + } + } + ], + "default_credentials": { + "username": null, + "password": null + }, + "notes": [ + { + "text": "If you choose not to run the installation setup, execute: `/opt/mssql/bin/mssql-conf setup` in LXC shell.", + "type": "info" + }, + { + "text": "You can setup the admin account 'SA' during installation", + "type": "info" + }, + { + "text": "Make sure you disable the SA account if you intend to use this in production!", + "type": "warning" + }, + { + "text": "Ubuntu 24.04 support requires SQL Server 2025 CU1 or later", + "type": "info" + } + ] +} diff --git a/install/sqlserver2022-install.sh b/install/sqlserver2022-install.sh index c074bddcb..9fc4f4161 100644 --- a/install/sqlserver2022-install.sh +++ b/install/sqlserver2022-install.sh @@ -14,24 +14,32 @@ network_check update_os msg_info "Installing Dependencies" -$STD apt install -y \ - coreutils +$STD apt install -y coreutils msg_ok "Installed Dependencies" -msg_info "Setup SQL Server 2022" -curl -fsSL https://packages.microsoft.com/keys/microsoft.asc | sudo tee /etc/apt/trusted.gpg.d/microsoft.asc >/dev/null -curl -fsSL https://packages.microsoft.com/config/ubuntu/22.04/mssql-server-2022.list | tee /etc/apt/sources.list.d/mssql-server-2022.list >/dev/null -$STD apt-get update -y -$STD apt-get install -y mssql-server -msg_ok "Setup Server 2022" +msg_info "Setting up SQL Server 2022 Repository" +setup_deb822_repo \ + "mssql-server-2022" \ + "https://packages.microsoft.com/keys/microsoft.asc" \ + "https://packages.microsoft.com/ubuntu/22.04/mssql-server-2022" \ + "./" \ + "" +msg_ok "Repository configured" + +msg_info "Installing SQL Server 2022" +$STD apt install -y mssql-server +msg_ok "Installed SQL Server 2022" msg_info "Installing SQL Server Tools" export DEBIAN_FRONTEND=noninteractive export ACCEPT_EULA=Y -curl -fsSL https://packages.microsoft.com/keys/microsoft.asc | tee /etc/apt/trusted.gpg.d/microsoft.asc >/dev/null -curl -fsSL https://packages.microsoft.com/config/ubuntu/22.04/prod.list | tee /etc/apt/sources.list.d/mssql-release.list >/dev/null -$STD apt-get update -$STD apt-get install -y -qq \ +setup_deb822_repo \ + "mssql-release" \ + "https://packages.microsoft.com/keys/microsoft.asc" \ + "https://packages.microsoft.com/ubuntu/22.04/prod" \ + "jammy" \ + "main" +$STD apt-get install -y \ mssql-tools18 \ unixodbc-dev echo 'export PATH="$PATH:/opt/mssql-tools18/bin"' >>~/.bash_profile @@ -49,6 +57,11 @@ msg_info "Start Service" systemctl enable -q --now mssql-server msg_ok "Service started" +msg_info "Cleaning up" +rm -f /etc/profile.d/debuginfod.sh +rm -f /etc/profile.d/debuginfod.csh +msg_ok "Cleaned up" + motd_ssh customize cleanup_lxc diff --git a/install/sqlserver2025-install.sh b/install/sqlserver2025-install.sh new file mode 100644 index 000000000..748cd5dcb --- /dev/null +++ b/install/sqlserver2025-install.sh @@ -0,0 +1,66 @@ +#!/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://www.microsoft.com/en-us/sql-server/sql-server-2025 + +source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +msg_info "Installing Dependencies" +$STD apt install -y coreutils +msg_ok "Installed Dependencies" + +msg_info "Setting up SQL Server 2025 Repository" +setup_deb822_repo \ + "mssql-server-2025" \ + "https://packages.microsoft.com/keys/microsoft.asc" \ + "https://packages.microsoft.com/ubuntu/24.04/mssql-server-2025" \ + "./" \ + "" +msg_ok "Repository configured" + +msg_info "Installing SQL Server 2025" +$STD apt install -y mssql-server +msg_ok "Installed SQL Server 2025" + +msg_info "Installing SQL Server Tools" +export DEBIAN_FRONTEND=noninteractive +export ACCEPT_EULA=Y +setup_deb822_repo \ + "mssql-release" \ + "https://packages.microsoft.com/keys/microsoft.asc" \ + "https://packages.microsoft.com/ubuntu/24.04/prod" \ + "noble" \ + "main" +$STD apt-get install -y \ + mssql-tools18 \ + unixodbc-dev +echo 'export PATH="$PATH:/opt/mssql-tools18/bin"' >>~/.bash_profile +source ~/.bash_profile +msg_ok "Installed SQL Server Tools" + +read -r -p "${TAB3}Do you want to run the SQL Server setup now? (Later is also possible) " prompt +if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then + /opt/mssql/bin/mssql-conf setup +else + msg_ok "Skipping SQL Server setup. You can run it later with '/opt/mssql/bin/mssql-conf setup'." +fi + +msg_info "Starting SQL Server Service" +systemctl enable -q --now mssql-server +msg_ok "Service started" + +msg_info "Cleaning up" +rm -f /etc/profile.d/debuginfod.sh /etc/profile.d/debuginfod.csh +msg_ok "Cleaned up" + +motd_ssh +customize +cleanup_lxc