Merge branch 'main' into feature/umbraco

Add PR changes
This commit is contained in:
montagneid
2026-05-08 15:28:43 +02:00
2 changed files with 29 additions and 54 deletions

View File

@@ -28,9 +28,19 @@ function update_script() {
exit exit
fi fi
msg_info "Updating ${APP} LXC" msg_info "Updating ${APP} LXC"
$STD apt-get update $STD apt update
$STD apt-get -y upgrade $STD apt -y upgrade
msg_ok "Updated successfully!" msg_ok "Updated ${APP} LXC"
msg_info "Updating .NET SDK"
$STD apt install -y dotnet-sdk-10.0
msg_ok "Updated .NET SDK"
msg_info "Updating Umbraco Templates"
$STD dotnet new update
msg_ok "Updated Umbraco Templates"
msg_ok "Update completed successfully!"
exit exit
} }

View File

@@ -2,7 +2,7 @@
# Copyright (c) 2021-2026 community-scripts ORG # Copyright (c) 2021-2026 community-scripts ORG
# Author: Joost van den Berg # Author: Joost van den Berg
# License: MIT | https://github.com/montagneid/ProxmoxVE/raw/main/LICENSE # License: MIT | https://github.com/montagneid/ProxmoxVED/raw/main/LICENSE
# Source: https://github.com/umbraco/Umbraco-CMS # Source: https://github.com/umbraco/Umbraco-CMS
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
@@ -18,38 +18,20 @@ var_project_name="cms"
msg_info "Installing Dependencies" msg_info "Installing Dependencies"
$STD apt-get update $STD apt-get update
$STD apt-get install -y \ $STD apt-get install -y \
curl \
wget \
ca-certificates \ ca-certificates \
uuid-runtime uuid-runtime \
msg_info "Installing .NET SDK 10.0 using Microsoft install script"
wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh
chmod +x dotnet-install.sh
$STD ./dotnet-install.sh --channel 10.0 --install-dir /usr/share/dotnet
rm dotnet-install.sh
ln -sf /usr/share/dotnet/dotnet /usr/bin/dotnet
export DOTNET_ROOT=/usr/share/dotnet
export PATH=$PATH:$DOTNET_ROOT
msg_ok "Installed .NET SDK 10.0"
msg_info "Installing Nginx and FTP Server"
$STD apt-get install -y \
nginx \ nginx \
vsftpd vsftpd
msg_ok "Installed Nginx and FTP Server" msg_ok "Installed Dependencies"
read -r -p "${TAB3}Enable PostgreSQL database (allow remote connections)? (Default: SQLite) <y/N> " prompt msg_info "Installing .NET SDK 10.0"
if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then wget https://packages.microsoft.com/config/debian/13/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
msg_info "Setting up PostgreSQL (Patience)" sudo dpkg -i packages-microsoft-prod.deb
PG_VERSION="17" setup_postgresql rm packages-microsoft-prod.deb
PG_DB_NAME="${var_project_name}_db" PG_DB_USER="${var_project_name}_user" PG_DB_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
setup_postgresql_db sudo apt-get update && \
sed -i "s/#listen_addresses = 'localhost'/listen_addresses = '*'/" /etc/postgresql/17/main/postgresql.conf sudo apt-get install -y dotnet-sdk-10.0
echo "host all all 0.0.0.0/0 scram-sha-256" >> /etc/postgresql/17/main/pg_hba.conf msg_ok "Installed .NET SDK 10.0"
systemctl restart postgresql
msg_ok "PostgreSQL setup completed"
fi
msg_info "Installing dotnet Umbraco templates and create project (Patience)" msg_info "Installing dotnet Umbraco templates and create project (Patience)"
cd /var/www/html cd /var/www/html
@@ -60,29 +42,12 @@ msg_ok "Umbraco templates installed and project created"
msg_info "Configuring database connection and unattended setup" msg_info "Configuring database connection and unattended setup"
cd /var/www/html/$var_project_name cd /var/www/html/$var_project_name
UMBRACO_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13) UMBRACO_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
apt-get install -y jq &>/dev/null
if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then
$STD dotnet add package Npgsql.EntityFrameworkCore.PostgreSQL
$STD dotnet add package Our.Umbraco.PostgreSql
jq --arg dbname "$PG_DB_NAME" \
--arg dbuser "$PG_DB_USER" \
--arg dbpass "$PG_DB_PASS" '. + {
"ConnectionStrings": {
"umbracoDbDSN": ("Host=localhost;Port=5432;SSL Mode=Allow;Database=" + $dbname + ";Username=" + $dbuser + ";Password=" + $dbpass),
"umbracoDbDSN_ProviderName": "Npgsql2"
}
}' /var/www/html/$var_project_name/appsettings.json > /tmp/appsettings.tmp && mv /tmp/appsettings.tmp /var/www/html/$var_project_name/appsettings.json
else
jq '. + {
"ConnectionStrings": {
"umbracoDbDSN": "Data Source=|DataDirectory|/Umbraco.sqlite.db;Cache=Shared;Foreign Keys=True;Pooling=True",
"umbracoDbDSN_ProviderName": "Microsoft.Data.Sqlite"
}
}' /var/www/html/$var_project_name/appsettings.json > /tmp/appsettings.tmp && mv /tmp/appsettings.tmp /var/www/html/$var_project_name/appsettings.json
fi
jq --arg umbracopass "$UMBRACO_PASS" '. + { jq --arg umbracopass "$UMBRACO_PASS" '. + {
"ConnectionStrings": {
"umbracoDbDSN": "Data Source=|DataDirectory|/Umbraco.sqlite.db;Cache=Shared;Foreign Keys=True;Pooling=True",
"umbracoDbDSN_ProviderName": "Microsoft.Data.Sqlite"
},
"Umbraco": { "Umbraco": {
"CMS": { "CMS": {
"_Comment": "Remove the Unattended section after first run", "_Comment": "Remove the Unattended section after first run",
@@ -218,7 +183,7 @@ cat >"$PUBLISH_PROFILE_DIR/FTPProfile.pubxml" <<EOF
<ExcludeApp_Data>false</ExcludeApp_Data> <ExcludeApp_Data>false</ExcludeApp_Data>
<ProjectGuid>${PROJECT_GUID}</ProjectGuid> <ProjectGuid>${PROJECT_GUID}</ProjectGuid>
<publishUrl>${CONTAINER_IP}</publishUrl> <publishUrl>${CONTAINER_IP}</publishUrl>
<DeleteExistingFiles>true</DeleteExistingFiles> <DeleteExistingFiles>false</DeleteExistingFiles>
<FtpPassiveMode>true</FtpPassiveMode> <FtpPassiveMode>true</FtpPassiveMode>
<FtpSitePath>${var_project_name}-publish</FtpSitePath> <FtpSitePath>${var_project_name}-publish</FtpSitePath>
<UserName>ftpuser</UserName> <UserName>ftpuser</UserName>