mirror of
https://github.com/ParisNeo/lollms.git
synced 2024-12-18 20:27:58 +00:00
added security to server installation
This commit is contained in:
parent
4bc60c51a1
commit
2fb9f39082
@ -30,6 +30,12 @@ lollmsElfServer:LOLLMSWebUI = LOLLMSWebUI.get_instance()
|
||||
@router.get("/install_motion_ctrl")
|
||||
def install_motion_ctrl():
|
||||
try:
|
||||
if lollmsElfServer.config.headless_server_mode:
|
||||
return {"status":False,"error":"Service installation is blocked when in headless mode for obvious security reasons!"}
|
||||
|
||||
if lollmsElfServer.config.host!="localhost" and lollmsElfServer.config.host!="127.0.0.1":
|
||||
return {"status":False,"error":"Service installation is blocked when the server is exposed outside for very obvious reasons!"}
|
||||
|
||||
lollmsElfServer.ShowBlockingMessage("Installing Motion Ctrl api server\nPlease stand by")
|
||||
from lollms.services.motion_ctrl.lollms_motion_ctrl import install_motion_ctrl
|
||||
install_motion_ctrl(lollmsElfServer)
|
||||
|
@ -30,6 +30,12 @@ lollmsElfServer:LOLLMSWebUI = LOLLMSWebUI.get_instance()
|
||||
@router.get("/install_ollama")
|
||||
def install_ollama():
|
||||
try:
|
||||
if lollmsElfServer.config.headless_server_mode:
|
||||
return {"status":False,"error":"Service installation is blocked when in headless mode for obvious security reasons!"}
|
||||
|
||||
if lollmsElfServer.config.host!="localhost" and lollmsElfServer.config.host!="127.0.0.1":
|
||||
return {"status":False,"error":"Service installation is blocked when the server is exposed outside for very obvious reasons!"}
|
||||
|
||||
lollmsElfServer.ShowBlockingMessage("Installing ollama server\nPlease stand by")
|
||||
from lollms.services.ollama.lollms_ollama import install_ollama
|
||||
if install_ollama(lollmsElfServer):
|
||||
|
@ -30,6 +30,12 @@ lollmsElfServer:LOLLMSWebUI = LOLLMSWebUI.get_instance()
|
||||
@router.get("/install_sd")
|
||||
def install_sd():
|
||||
try:
|
||||
if lollmsElfServer.config.headless_server_mode:
|
||||
return {"status":False,"error":"Service installation is blocked when in headless mode for obvious security reasons!"}
|
||||
|
||||
if lollmsElfServer.config.host!="localhost" and lollmsElfServer.config.host!="127.0.0.1":
|
||||
return {"status":False,"error":"Service installation is blocked when the server is exposed outside for very obvious reasons!"}
|
||||
|
||||
lollmsElfServer.ShowBlockingMessage("Installing SD api server\nPlease stand by")
|
||||
from lollms.services.sd.lollms_sd import install_sd
|
||||
install_sd(lollmsElfServer)
|
||||
|
@ -29,6 +29,12 @@ lollmsElfServer:LOLLMSWebUI = LOLLMSWebUI.get_instance()
|
||||
@router.get("/install_vllm")
|
||||
def install_vllm():
|
||||
try:
|
||||
if lollmsElfServer.config.headless_server_mode:
|
||||
return {"status":False,"error":"Service installation is blocked when in headless mode for obvious security reasons!"}
|
||||
|
||||
if lollmsElfServer.config.host!="localhost" and lollmsElfServer.config.host!="127.0.0.1":
|
||||
return {"status":False,"error":"Service installation is blocked when the server is exposed outside for very obvious reasons!"}
|
||||
|
||||
lollmsElfServer.ShowBlockingMessage("Installing vllm server\nPlease stand by")
|
||||
from lollms.services.vllm.lollms_vllm import install_vllm
|
||||
if install_vllm(lollmsElfServer):
|
||||
|
@ -132,10 +132,10 @@ async def text2Audio(request: LollmsText2AudioRequest):
|
||||
def install_xtts():
|
||||
try:
|
||||
if lollmsElfServer.config.headless_server_mode:
|
||||
return {"status":False,"error":"Code execution is blocked when in headless mode for obvious security reasons!"}
|
||||
return {"status":False,"error":"Service installation is blocked when in headless mode for obvious security reasons!"}
|
||||
|
||||
if lollmsElfServer.config.host!="localhost" and lollmsElfServer.config.host!="127.0.0.1":
|
||||
return {"status":False,"error":"Code execution is blocked when the server is exposed outside for very obvious reasons!"}
|
||||
return {"status":False,"error":"Service installation is blocked when the server is exposed outside for very obvious reasons!"}
|
||||
|
||||
from lollms.services.xtts.lollms_xtts import install_xtts
|
||||
lollmsElfServer.ShowBlockingMessage("Installing xTTS api server\nPlease stand by")
|
||||
|
@ -6,7 +6,7 @@ if [ -e "$HOME/miniconda3/bin/conda" ]; then
|
||||
else
|
||||
echo "Conda is not installed. Please install it first."
|
||||
echo Installing conda
|
||||
curl -LOk https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
|
||||
curl -LO https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
|
||||
./Miniconda3-latest-Linux-x86_64.sh -b
|
||||
$HOME/miniconda3/bin/conda init --all
|
||||
rm ./Miniconda3-latest-Linux-x86_64.sh
|
||||
|
@ -6,7 +6,7 @@ if [ -e "$HOME/miniconda3/bin/conda" ]; then
|
||||
else
|
||||
echo "Conda is not installed. Please install it first."
|
||||
echo Installing conda
|
||||
curl -LOk https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
|
||||
curl -LO https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
|
||||
./Miniconda3-latest-Linux-x86_64.sh -b
|
||||
rm ./Miniconda3-latest-Linux-x86_64.sh
|
||||
echo Done
|
||||
|
@ -77,7 +77,7 @@ REPO_URL="https://github.com/ParisNeo/lollms.git"
|
||||
if [ ! -f "$MINICONDA_DIR/Scripts/conda" ]; then
|
||||
# Download miniconda
|
||||
echo "Downloading Miniconda installer from $MINICONDA_DOWNLOAD_URL"
|
||||
curl -LOk "$MINICONDA_DOWNLOAD_URL"
|
||||
curl -LO "$MINICONDA_DOWNLOAD_URL"
|
||||
|
||||
# Install miniconda
|
||||
echo
|
||||
|
@ -73,7 +73,7 @@ REPO_URL="https://github.com/ParisNeo/lollms.git"
|
||||
if [ ! -f "$MINICONDA_DIR/Scripts/conda" ]; then
|
||||
# Download Miniconda
|
||||
echo "Downloading Miniconda installer from $MINICONDA_DOWNLOAD_URL"
|
||||
curl -LOk "$MINICONDA_DOWNLOAD_URL"
|
||||
curl -LO "$MINICONDA_DOWNLOAD_URL"
|
||||
|
||||
# Install Miniconda
|
||||
echo
|
||||
|
@ -73,7 +73,7 @@ set REPO_URL=https://github.com/ParisNeo/lollms.git
|
||||
if not exist "%MINICONDA_DIR%\Scripts\conda.exe" (
|
||||
@rem download miniconda
|
||||
echo Downloading Miniconda installer from %MINICONDA_DOWNLOAD_URL%
|
||||
call curl -LOk "%MINICONDA_DOWNLOAD_URL%"
|
||||
call curl -LO "%MINICONDA_DOWNLOAD_URL%"
|
||||
|
||||
@rem install miniconda
|
||||
echo. && echo Installing Miniconda To "%MINICONDA_DIR%" && echo Please Wait... && echo.
|
||||
|
Loading…
Reference in New Issue
Block a user