mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-11-12 18:25:28 +01:00
Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
baa5de49b7 | ||
|
|
0f00ec055f | ||
|
|
005f52a2ac |
No files matched your search
@@ -593,6 +593,10 @@ Exercise vigilance regarding copycat or coat-tailing sites that seek to exploit
|
||||
|
||||
- Whisparr-eros: set the first login and save it [@MickLesk](https://github.com/MickLesk) ([#18617](https://github.com/community-scripts/ProxmoxVE/pull/18617))
|
||||
|
||||
- #### 💥 Breaking Changes
|
||||
|
||||
- Updated ASP.NET Web App script to Debian and adds a .Net selection [@kris701](https://github.com/kris701) ([#18628](https://github.com/community-scripts/ProxmoxVE/pull/18628))
|
||||
|
||||
### 📚 Documentation
|
||||
|
||||
- pocketbase-bot: apply website metadata requests from Accept/Decline boxes [@MickLesk](https://github.com/MickLesk) ([#18631](https://github.com/community-scripts/ProxmoxVE/pull/18631))
|
||||
|
||||
@@ -4,17 +4,17 @@ source "$_cs_boot" 2>/dev/null || source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: Kristian Skov
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/linux-nginx?view=aspnetcore-9.0&tabs=linux-ubuntu
|
||||
# Source: https://learn.microsoft.com/en-us/dotnet/core/install/linux-debian
|
||||
|
||||
APP="Dotnet ASP Web API"
|
||||
var_tags="${var_tags:-web}"
|
||||
var_cpu="${var_cpu:-1}"
|
||||
var_ram="${var_ram:-1024}"
|
||||
var_disk="${var_disk:-8}"
|
||||
var_os="${var_os:-ubuntu}"
|
||||
var_version="${var_version:-24.04}"
|
||||
var_os="${var_os:-debian}"
|
||||
var_version="${var_version:-13}"
|
||||
var_arm64="${var_arm64:-yes}"
|
||||
var_unprivileged="${var_unprivileged:-0}"
|
||||
var_unprivileged="${var_unprivileged:-1}"
|
||||
|
||||
header_info "$APP"
|
||||
variables
|
||||
@@ -43,4 +43,4 @@ 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 "${GATEWAY}${BGN}${IP}:80${CL}"
|
||||
echo -e "${GATEWAY}${BGN}${IP}:80${CL}"
|
||||
@@ -3,7 +3,7 @@
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: Kristian Skov
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/linux-nginx?view=aspnetcore-9.0&tabs=linux-ubuntu
|
||||
# Source: https://learn.microsoft.com/en-us/dotnet/core/install/linux-debian
|
||||
|
||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||
color
|
||||
@@ -14,21 +14,36 @@ network_check
|
||||
update_os
|
||||
|
||||
msg_info "Installing Dependencies"
|
||||
apt_update_safe
|
||||
$STD apt install -y \
|
||||
ssh \
|
||||
software-properties-common
|
||||
|
||||
$STD add-apt-repository -y ppa:dotnet/backports
|
||||
$STD apt install -y \
|
||||
dotnet-sdk-9.0 \
|
||||
vsftpd \
|
||||
nginx
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
var_project_name="${var_project_name:-}"
|
||||
[[ -n "$var_project_name" ]] || read -r -p "${TAB3}Type the assembly name of the project: " var_project_name || true
|
||||
[[ -n "$var_project_name" ]] || { msg_error "No assembly name given; set var_project_name or answer the prompt"; exit 64; }
|
||||
setup_deb822_repo \
|
||||
"microsoft" \
|
||||
"https://packages.microsoft.com/keys/microsoft-2025.asc" \
|
||||
"https://packages.microsoft.com/debian/13/prod/" \
|
||||
"trixie" \
|
||||
"main"
|
||||
|
||||
if [[ -z "${var_dotnet_version:-}" && -t 0 ]]; then
|
||||
read -r -t 60 -p "${TAB3}.NET SDK version, 10 (LTS) or 11 [10]: " var_dotnet_version || echo
|
||||
fi
|
||||
var_dotnet_version="${var_dotnet_version:-10}"
|
||||
var_dotnet_version="${var_dotnet_version%%.*}"
|
||||
if ! apt-cache show "dotnet-sdk-${var_dotnet_version}.0" &>/dev/null; then
|
||||
msg_warn ".NET SDK ${var_dotnet_version} is not available for this system, using 10"
|
||||
var_dotnet_version="10"
|
||||
fi
|
||||
|
||||
if [[ -z "${var_project_name:-}" && -t 0 ]]; then
|
||||
read -r -t 60 -p "${TAB3}Assembly name of the project [testproject]: " var_project_name || echo
|
||||
fi
|
||||
var_project_name="${var_project_name:-testproject}"
|
||||
|
||||
msg_info "Installing .NET SDK ${var_dotnet_version}"
|
||||
$STD apt install -y "dotnet-sdk-${var_dotnet_version}.0"
|
||||
msg_ok "Installed .NET SDK ${var_dotnet_version}"
|
||||
|
||||
msg_info "Setting up FTP Server"
|
||||
useradd ftpuser
|
||||
@@ -55,7 +70,7 @@ msg_ok "FTP server setup completed"
|
||||
msg_info "Setting up Nginx Server"
|
||||
rm -f /var/www/html/index.nginx-debian.html
|
||||
|
||||
sed "s/\$var_project_name/$var_project_name/g" >myfile <<'EOF' >/etc/nginx/sites-available/default
|
||||
sed "s/\$var_project_name/$var_project_name/g" <<'EOF' >/etc/nginx/sites-available/default
|
||||
map $http_connection $connection_upgrade {
|
||||
"~*Upgrade" $http_connection;
|
||||
default keep-alive;
|
||||
@@ -82,12 +97,12 @@ msg_info "Creating Service"
|
||||
cat <<EOF >/etc/systemd/system/kestrel-aspnetapi.service
|
||||
[Unit]
|
||||
Description=.NET Web API App running on Linux
|
||||
ConditionPathExists=/var/www/html/$var_project_name.dll
|
||||
|
||||
[Service]
|
||||
WorkingDirectory=/var/www/html
|
||||
ExecStart=/usr/bin/dotnet /var/www/html/$var_project_name.dll
|
||||
Restart=always
|
||||
# Restart service after 10 seconds if the dotnet service crashes:
|
||||
RestartSec=10
|
||||
KillSignal=SIGINT
|
||||
SyslogIdentifier=dotnet-${var_project_name}
|
||||
@@ -98,7 +113,18 @@ Environment=DOTNET_NOLOGO=true
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now kestrel-aspnetapi
|
||||
cat <<EOF >/etc/systemd/system/kestrel-aspnetapi.path
|
||||
[Unit]
|
||||
Description=Start the .NET Web API App once it is deployed
|
||||
|
||||
[Path]
|
||||
PathExists=/var/www/html/$var_project_name.dll
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q kestrel-aspnetapi
|
||||
systemctl enable -q --now kestrel-aspnetapi.path
|
||||
msg_ok "Created Service"
|
||||
|
||||
motd_ssh
|
||||
|
||||
Reference in new issue
Block a user