mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-11-08 20:32:49 +00:00
Compare commits
1 Commits
github-act
...
openwebui
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b0e56d319c |
@@ -22,10 +22,6 @@ Exercise vigilance regarding copycat or coat-tailing sites that seek to exploit
|
||||
- MongoDB: Remove unused message [@tremor021](https://github.com/tremor021) ([#8969](https://github.com/community-scripts/ProxmoxVE/pull/8969))
|
||||
- Set TZ=Etc/UTC in Ghostfolio installation script [@LuloDev](https://github.com/LuloDev) ([#8961](https://github.com/community-scripts/ProxmoxVE/pull/8961))
|
||||
|
||||
- #### 🔧 Refactor
|
||||
|
||||
- Refactor setup_deb822_repo for optional architectures [@MickLesk](https://github.com/MickLesk) ([#8983](https://github.com/community-scripts/ProxmoxVE/pull/8983))
|
||||
|
||||
## 2025-11-07
|
||||
|
||||
### 🆕 New Scripts
|
||||
|
||||
@@ -17,7 +17,11 @@ msg_info "Installing Dependencies"
|
||||
$STD apt install -y ffmpeg
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
USE_UVX="YES" PYTHON_VERSION="3.12" setup_uv
|
||||
PYTHON_VERSION="3.12" setup_uv
|
||||
|
||||
msg_info "Installing Open WebUI"
|
||||
$STD uv tool install --python 3.12 open-webui[all]
|
||||
msg_ok "Installed Open WebUI"
|
||||
|
||||
read -r -p "${TAB3}Would you like to add Ollama? <y/N> " prompt
|
||||
if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then
|
||||
@@ -56,7 +60,7 @@ After=network.target
|
||||
Type=simple
|
||||
EnvironmentFile=-/root/.env
|
||||
Environment=DATA_DIR=/root/.open-webui
|
||||
ExecStart=/usr/local/bin/uvx --python 3.12 open-webui@latest serve
|
||||
ExecStart=/root/.local/bin/open-webui serve
|
||||
WorkingDirectory=/root
|
||||
Restart=on-failure
|
||||
RestartSec=5
|
||||
|
||||
@@ -1198,8 +1198,8 @@ ensure_apt_working() {
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Standardized deb822 repository setup (with optional Architectures)
|
||||
# Always runs apt update after repo creation to ensure package availability
|
||||
# Standardized deb822 repository setup
|
||||
# Validates all parameters and fails safely if any are empty
|
||||
# ------------------------------------------------------------------------------
|
||||
setup_deb822_repo() {
|
||||
local name="$1"
|
||||
@@ -1207,40 +1207,56 @@ setup_deb822_repo() {
|
||||
local repo_url="$3"
|
||||
local suite="$4"
|
||||
local component="${5:-main}"
|
||||
local architectures="$6" # optional
|
||||
local architectures="${6:-$(dpkg --print-architecture)}"
|
||||
|
||||
# Validate required parameters
|
||||
if [[ -z "$name" || -z "$gpg_url" || -z "$repo_url" || -z "$suite" ]]; then
|
||||
msg_error "setup_deb822_repo: missing required parameters (name=$name repo=$repo_url suite=$suite)"
|
||||
msg_error "setup_deb822_repo: missing required parameters (name=$name, gpg=$gpg_url, repo=$repo_url, suite=$suite)"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Cleanup
|
||||
# Cleanup old configs for this app
|
||||
cleanup_old_repo_files "$name"
|
||||
|
||||
# Cleanup any orphaned .sources files from other apps
|
||||
cleanup_orphaned_sources
|
||||
|
||||
# Ensure keyring directory exists
|
||||
mkdir -p /etc/apt/keyrings || {
|
||||
msg_error "Failed to create /etc/apt/keyrings"
|
||||
msg_error "Failed to create /etc/apt/keyrings directory"
|
||||
return 1
|
||||
}
|
||||
|
||||
# Import GPG
|
||||
curl -fsSL "$gpg_url" | gpg --dearmor --yes -o "/etc/apt/keyrings/${name}.gpg" || {
|
||||
msg_error "Failed to import GPG key for ${name}"
|
||||
# Download GPG key (with --yes to avoid interactive prompts)
|
||||
curl -fsSL "$gpg_url" | gpg --dearmor --yes -o "/etc/apt/keyrings/${name}.gpg" 2>/dev/null || {
|
||||
msg_error "Failed to download or import GPG key for ${name} from $gpg_url"
|
||||
return 1
|
||||
}
|
||||
|
||||
# Write deb822
|
||||
{
|
||||
echo "Types: deb"
|
||||
echo "URIs: $repo_url"
|
||||
echo "Suites: $suite"
|
||||
echo "Components: $component"
|
||||
[[ -n "$architectures" ]] && echo "Architectures: $architectures"
|
||||
echo "Signed-By: /etc/apt/keyrings/${name}.gpg"
|
||||
} >/etc/apt/sources.list.d/${name}.sources
|
||||
# Create deb822 sources file
|
||||
cat <<EOF >/etc/apt/sources.list.d/${name}.sources
|
||||
Types: deb
|
||||
URIs: $repo_url
|
||||
Suites: $suite
|
||||
Components: $component
|
||||
Architectures: $architectures
|
||||
Signed-By: /etc/apt/keyrings/${name}.gpg
|
||||
EOF
|
||||
|
||||
$STD apt update
|
||||
# Use cached apt update
|
||||
local apt_cache_file="/var/cache/apt-update-timestamp"
|
||||
local current_time=$(date +%s)
|
||||
local last_update=0
|
||||
|
||||
if [[ -f "$apt_cache_file" ]]; then
|
||||
last_update=$(cat "$apt_cache_file" 2>/dev/null || echo 0)
|
||||
fi
|
||||
|
||||
# For repo changes, always update but respect short-term cache (30s)
|
||||
if ((current_time - last_update > 30)); then
|
||||
$STD apt update
|
||||
echo "$current_time" >"$apt_cache_file"
|
||||
fi
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user