Remove hardcoded PG password fallbacks — require PG_DSN env var in all scripts
This commit is contained in:
+1
-1
@@ -56,7 +56,7 @@ DEFAULT_SETTINGS = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
print("Loading Aaron AI...")
|
print("Loading Aaron AI...")
|
||||||
PG_DSN = os.getenv("PG_DSN", "dbname=aaronai user=aaronai password=aaronai_db_password host=localhost")
|
PG_DSN = os.getenv("PG_DSN")
|
||||||
|
|
||||||
def get_pg():
|
def get_pg():
|
||||||
return psycopg2.connect(PG_DSN)
|
return psycopg2.connect(PG_DSN)
|
||||||
|
|||||||
+1
-1
@@ -23,7 +23,7 @@ import psycopg2
|
|||||||
|
|
||||||
load_dotenv(Path.home() / "aaronai" / ".env")
|
load_dotenv(Path.home() / "aaronai" / ".env")
|
||||||
|
|
||||||
PG_DSN = os.getenv("PG_DSN", "dbname=aaronai user=aaronai password=aaronai_db_password host=localhost")
|
PG_DSN = os.getenv("PG_DSN")
|
||||||
|
|
||||||
def get_pg():
|
def get_pg():
|
||||||
return psycopg2.connect(PG_DSN)
|
return psycopg2.connect(PG_DSN)
|
||||||
|
|||||||
+1
-1
@@ -16,7 +16,7 @@ load_dotenv(Path.home() / "aaronai" / ".env")
|
|||||||
print("Loading embedding model...")
|
print("Loading embedding model...")
|
||||||
embedder = SentenceTransformer("all-MiniLM-L6-v2")
|
embedder = SentenceTransformer("all-MiniLM-L6-v2")
|
||||||
|
|
||||||
PG_DSN = os.getenv("PG_DSN", "dbname=aaronai user=aaronai password=aaronai_db_password host=localhost")
|
PG_DSN = os.getenv("PG_DSN")
|
||||||
|
|
||||||
def get_pg():
|
def get_pg():
|
||||||
return psycopg2.connect(PG_DSN)
|
return psycopg2.connect(PG_DSN)
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ from sentence_transformers import SentenceTransformer
|
|||||||
load_dotenv(Path.home() / "aaronai" / ".env")
|
load_dotenv(Path.home() / "aaronai" / ".env")
|
||||||
|
|
||||||
CONVERSATIONS_DB = str(Path.home() / "aaronai" / "conversations.db")
|
CONVERSATIONS_DB = str(Path.home() / "aaronai" / "conversations.db")
|
||||||
PG_DSN = os.getenv("PG_DSN", "dbname=aaronai user=aaronai password=aaronai_db_password host=localhost")
|
PG_DSN = os.getenv("PG_DSN")
|
||||||
MIN_EXCHANGES = 3
|
MIN_EXCHANGES = 3
|
||||||
|
|
||||||
print("Loading embedding model...")
|
print("Loading embedding model...")
|
||||||
|
|||||||
@@ -10,7 +10,10 @@ from pathlib import Path
|
|||||||
from sentence_transformers import SentenceTransformer
|
from sentence_transformers import SentenceTransformer
|
||||||
|
|
||||||
CHROMA_SQLITE = str(Path.home() / "aaronai" / "db" / "chroma.sqlite3")
|
CHROMA_SQLITE = str(Path.home() / "aaronai" / "db" / "chroma.sqlite3")
|
||||||
PG_DSN = "dbname=aaronai user=aaronai password=aaronai_db_password host=localhost"
|
import os
|
||||||
|
PG_DSN = os.getenv("PG_DSN")
|
||||||
|
if not PG_DSN:
|
||||||
|
raise RuntimeError("PG_DSN environment variable not set")
|
||||||
|
|
||||||
print("Loading embedding model...")
|
print("Loading embedding model...")
|
||||||
embedder = SentenceTransformer("all-MiniLM-L6-v2")
|
embedder = SentenceTransformer("all-MiniLM-L6-v2")
|
||||||
|
|||||||
Reference in New Issue
Block a user