mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-12-02 09:50:11 +00:00
root pass fix
This commit is contained in:
parent
9109fcbf60
commit
deae13d383
5 changed files with 12 additions and 10 deletions
|
|
@ -10,6 +10,8 @@ dockerman = None
|
|||
|
||||
def initialize():
|
||||
global args
|
||||
if args:
|
||||
return
|
||||
parser.add_argument("--port", type=int, default=None, help="Web UI port")
|
||||
parser.add_argument("--host", type=str, default=None, help="Web UI host")
|
||||
parser.add_argument(
|
||||
|
|
|
|||
|
|
@ -1,18 +1,16 @@
|
|||
import asyncio
|
||||
import json
|
||||
import os
|
||||
import re
|
||||
import subprocess
|
||||
from typing import Any, Literal, Optional, TypedDict
|
||||
from typing import Any, Literal, TypedDict
|
||||
|
||||
import models
|
||||
from python.helpers import rfc_exchange, runtime, whisper
|
||||
from python.helpers import runtime, whisper
|
||||
from . import files, dotenv
|
||||
from models import get_model, ModelProvider, ModelType
|
||||
from langchain_core.language_models.chat_models import BaseChatModel
|
||||
from langchain_core.embeddings import Embeddings
|
||||
|
||||
|
||||
class Settings(TypedDict):
|
||||
chat_model_provider: str
|
||||
chat_model_name: str
|
||||
|
|
@ -693,7 +691,7 @@ def _write_sensitive_settings(settings: Settings):
|
|||
if settings["root_password"]:
|
||||
dotenv.save_dotenv_value(dotenv.KEY_ROOT_PASSWORD, settings["root_password"])
|
||||
if settings["root_password"]:
|
||||
dotenv.save_dotenv_value(dotenv.KEY_ROOT_PASSWORD, settings["root_password"])
|
||||
set_root_password(settings["root_password"])
|
||||
|
||||
|
||||
def _get_default_settings() -> Settings:
|
||||
|
|
@ -777,6 +775,8 @@ def set_root_password(password: str):
|
|||
if not runtime.is_dockerized():
|
||||
raise Exception("root password can only be set in dockerized environments")
|
||||
subprocess.run(f"echo 'root:{password}' | chpasswd", shell=True, check=True)
|
||||
dotenv.save_dotenv_value(dotenv.KEY_ROOT_PASSWORD, password)
|
||||
|
||||
|
||||
|
||||
def get_runtime_config(set: Settings):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue