Add open-webui dropshell template for AI chat interface
All checks were successful
Test and Publish Templates / test-and-publish (push) Successful in 15s
All checks were successful
Test and Publish Templates / test-and-publish (push) Successful in 15s
This commit is contained in:
12
open-webui/backup.sh
Executable file
12
open-webui/backup.sh
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
source "${AGENT_PATH}/common.sh"
|
||||
_check_required_env_vars "CONTAINER_NAME" "DATA_VOLUME" "BACKUP_FILE" "TEMP_DIR"
|
||||
|
||||
mkdir -p "${TEMP_DIR}/backup"
|
||||
|
||||
docker run --rm -v "${DATA_VOLUME}":/source -v "${TEMP_DIR}/backup":/backup \
|
||||
debian tar -czf /backup/data.tgz -C /source .
|
||||
|
||||
tar -czf "${BACKUP_FILE}" -C "${TEMP_DIR}/backup" .
|
||||
|
||||
echo "Backup completed successfully"
|
||||
12
open-webui/config/service.env
Normal file
12
open-webui/config/service.env
Normal file
@@ -0,0 +1,12 @@
|
||||
CONTAINER_NAME=open-webui
|
||||
SSH_USER="root"
|
||||
IMAGE_TAG="main"
|
||||
|
||||
# Port to expose on the host
|
||||
HOST_PORT=3000
|
||||
|
||||
# Ollama connection URL (e.g. http://ollama-host:11434)
|
||||
OLLAMA_BASE_URL="http://localhost:11434"
|
||||
|
||||
# Set to False to disable authentication (single-user mode)
|
||||
# WEBUI_AUTH=False
|
||||
11
open-webui/destroy.sh
Executable file
11
open-webui/destroy.sh
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
source "${AGENT_PATH}/common.sh"
|
||||
_check_required_env_vars "CONTAINER_NAME" "DATA_VOLUME"
|
||||
|
||||
echo "WARNING: This will PERMANENTLY DELETE all data for ${CONTAINER_NAME}"
|
||||
|
||||
bash ./stop.sh
|
||||
_remove_container "$CONTAINER_NAME"
|
||||
_remove_volume "$DATA_VOLUME"
|
||||
|
||||
echo "Service and all data destroyed"
|
||||
7
open-webui/install-pre.sh
Executable file
7
open-webui/install-pre.sh
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
source "${AGENT_PATH}/common.sh"
|
||||
_check_required_env_vars "IMAGE_REGISTRY" "IMAGE_REPO" "IMAGE_TAG"
|
||||
|
||||
docker pull -q "$IMAGE_REGISTRY/$IMAGE_REPO:$IMAGE_TAG" || echo "Warning: pre-pull failed, install.sh will retry"
|
||||
|
||||
echo "Pre-install complete"
|
||||
14
open-webui/install.sh
Executable file
14
open-webui/install.sh
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
source "${AGENT_PATH}/common.sh"
|
||||
|
||||
_check_required_env_vars "CONTAINER_NAME" "IMAGE_REGISTRY" "IMAGE_REPO" "IMAGE_TAG" "DATA_VOLUME"
|
||||
_check_docker_installed || _die "Docker test failed"
|
||||
|
||||
docker pull "$IMAGE_REGISTRY/$IMAGE_REPO:$IMAGE_TAG" || _die "Failed to pull image"
|
||||
docker volume create "$DATA_VOLUME" 2>/dev/null || true
|
||||
|
||||
bash ./stop.sh || _die "Failed to stop container"
|
||||
_remove_container "$CONTAINER_NAME" || _die "Failed to remove container"
|
||||
bash ./start.sh || _die "Failed to start container"
|
||||
|
||||
echo "Installation of ${CONTAINER_NAME} complete"
|
||||
5
open-webui/logs.sh
Executable file
5
open-webui/logs.sh
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
source "${AGENT_PATH}/common.sh"
|
||||
_check_required_env_vars "CONTAINER_NAME"
|
||||
|
||||
docker logs "$CONTAINER_NAME" "$@"
|
||||
13
open-webui/restore.sh
Executable file
13
open-webui/restore.sh
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
source "${AGENT_PATH}/common.sh"
|
||||
_check_required_env_vars "CONTAINER_NAME" "DATA_VOLUME" "BACKUP_FILE" "TEMP_DIR"
|
||||
|
||||
mkdir -p "${TEMP_DIR}/restore"
|
||||
tar -xzf "${BACKUP_FILE}" -C "${TEMP_DIR}/restore"
|
||||
|
||||
docker volume rm "${DATA_VOLUME}" 2>/dev/null || true
|
||||
docker volume create "${DATA_VOLUME}"
|
||||
docker run --rm -v "${DATA_VOLUME}":/target -v "${TEMP_DIR}/restore":/backup \
|
||||
debian tar -xzf /backup/data.tgz -C /target
|
||||
|
||||
echo "Restore completed successfully"
|
||||
12
open-webui/start.sh
Executable file
12
open-webui/start.sh
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
source "${AGENT_PATH}/common.sh"
|
||||
_check_required_env_vars "CONTAINER_NAME" "IMAGE_REGISTRY" "IMAGE_REPO" "IMAGE_TAG" "DATA_VOLUME" "HOST_PORT" "OLLAMA_BASE_URL"
|
||||
|
||||
docker run -d \
|
||||
--name "$CONTAINER_NAME" \
|
||||
--restart unless-stopped \
|
||||
-p "${HOST_PORT}:8080" \
|
||||
-e "OLLAMA_BASE_URL=${OLLAMA_BASE_URL}" \
|
||||
${WEBUI_AUTH:+-e "WEBUI_AUTH=${WEBUI_AUTH}"} \
|
||||
-v "${DATA_VOLUME}:/app/backend/data" \
|
||||
"$IMAGE_REGISTRY/$IMAGE_REPO:$IMAGE_TAG"
|
||||
25
open-webui/status.sh
Executable file
25
open-webui/status.sh
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
source "${AGENT_PATH}/common.sh"
|
||||
_check_required_env_vars "CONTAINER_NAME"
|
||||
|
||||
if ! docker ps -a --format "{{.Names}}" | grep -q "^${CONTAINER_NAME}$"; then
|
||||
echo "Unknown"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
STATE=$(docker inspect -f '{{.State.Status}}' "$CONTAINER_NAME" 2>/dev/null)
|
||||
case "$STATE" in
|
||||
running)
|
||||
if docker inspect -f '{{.State.Health.Status}}' "$CONTAINER_NAME" 2>/dev/null | grep -q "unhealthy"; then
|
||||
echo "Error"
|
||||
else
|
||||
echo "Running"
|
||||
fi
|
||||
;;
|
||||
exited|stopped)
|
||||
echo "Stopped"
|
||||
;;
|
||||
*)
|
||||
echo "Unknown"
|
||||
;;
|
||||
esac
|
||||
5
open-webui/stop.sh
Executable file
5
open-webui/stop.sh
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
source "${AGENT_PATH}/common.sh"
|
||||
_check_required_env_vars "CONTAINER_NAME"
|
||||
|
||||
docker stop "$CONTAINER_NAME" 2>/dev/null || true
|
||||
12
open-webui/template_info.env
Normal file
12
open-webui/template_info.env
Normal file
@@ -0,0 +1,12 @@
|
||||
# Requirements
|
||||
REQUIRES_HOST_ROOT=false
|
||||
REQUIRES_DOCKER=true
|
||||
REQUIRES_DOCKER_ROOT=false
|
||||
|
||||
# Docker image settings
|
||||
IMAGE_REGISTRY="ghcr.io"
|
||||
IMAGE_REPO="open-webui/open-webui"
|
||||
IMAGE_TAG="main"
|
||||
|
||||
# Volume definitions
|
||||
DATA_VOLUME="${CONTAINER_NAME}_data"
|
||||
10
open-webui/uninstall.sh
Executable file
10
open-webui/uninstall.sh
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
source "${AGENT_PATH}/common.sh"
|
||||
_check_required_env_vars "CONTAINER_NAME"
|
||||
|
||||
bash ./stop.sh || _die "Failed to stop container"
|
||||
_remove_container "$CONTAINER_NAME" || _die "Failed to remove container"
|
||||
|
||||
# DO NOT remove volumes here! Data is preserved for reinstallation.
|
||||
echo "Uninstallation of ${CONTAINER_NAME} complete"
|
||||
echo "Note: Data volumes have been preserved. To remove all data, use destroy.sh"
|
||||
Reference in New Issue
Block a user