From 1530f242b638c5dde6f844cedb43c2e157ce89d2 Mon Sep 17 00:00:00 2001 From: Jali Date: Mon, 6 Apr 2026 23:20:46 +0200 Subject: [PATCH] Finish installer --- README.md | 1 + installer.conf | 2 +- installer.sh | 25 +++++++++++++++---------- 3 files changed, 17 insertions(+), 11 deletions(-) mode change 100644 => 100755 installer.sh diff --git a/README.md b/README.md index 0dde2b8..46679c3 100644 --- a/README.md +++ b/README.md @@ -28,3 +28,4 @@ Then start the service: sudo systemctl enable open-webui.service sudo systemctl start open-webui.service ``` + diff --git a/installer.conf b/installer.conf index 7b05a52..505b84c 100644 --- a/installer.conf +++ b/installer.conf @@ -14,4 +14,4 @@ GROUP="open-webui" TARGET_DIR="/opt/open-webui" # The python version to use -PYTHON=python3.13 +PYTHON=python3.12 diff --git a/installer.sh b/installer.sh old mode 100644 new mode 100755 index 43c9659..ae47660 --- a/installer.sh +++ b/installer.sh @@ -4,6 +4,8 @@ # Load the configuration source ./installer.conf +CURRENT_DIR=$(pwd) + # Create the users echo "Create users and groups" getent group $GROUP > /dev/null 2&>1 || groupadd $GROUP @@ -16,7 +18,7 @@ fi echo "Writing configuration files..." mkdir -p /etc/open-webui cp open-webui.conf /etc/open-webui -sed -i 's/#TARGET_DIR#/${TARGET_DIR}/g' /etc/open-webui/open-webui.conf +sed -i "s|#TARGET_DIR#|${TARGET_DIR}|g" /etc/open-webui/open-webui.conf # Now create the target directory echo "Creating target directory..." @@ -24,23 +26,26 @@ mkdir -p $TARGET_DIR # And populate it echo "Installing open-webui" -chown $USER:$GROUP $TARGET_DIR cd $TARGET_DIR -sudo $PYTHON -m venv .venv -sudo -u $USER pip install --upgrade pip -sudo -u $USER pip open-webui +$PYTHON -m venv .venv +source .venv/bin/activate +pip install --upgrade pip +pip install open-webui +deactivate +chown -R $USER:$GROUP $TARGET_DIR +cd $CURRENT_DIR echo "Finished installing open-webui." # Now install the script file echo "Installing the script" mkdir -p /usr/local/bin -cp ./run-open-webui /usr/local/bin -chmod +x /usr/local/bin/run-open-webui +cp ./run-open-webui $TARGET_DIR +chmod +x $TARGET_DIR/run-open-webui # Install the systemd file echo "Installing the service file" cp ./open-webui.service /etc/systemd/system -sed -i '/#TARGET_DIR#/${TARGET_DIR}/g' /etc/systemd/system/open-webui.service -sed -i '/#USER#/${USER}/g' /etc/systemd/system/open-webui.service -sed -i '/#GROUP#/${GROUP}/g' /etc/systemd/system/open-webui.service +sed -i "s|#TARGET_DIR#|${TARGET_DIR}|g" /etc/systemd/system/open-webui.service +sed -i "s|#USER#|${USER}|g" /etc/systemd/system/open-webui.service +sed -i "s|#GROUP#|${GROUP}|g" /etc/systemd/system/open-webui.service systemctl daemon-reload