feat(support): isolated stateless customer chat with JWT gatekeeper
This commit is contained in:
1 parent
8bf1843b9b
commit
8242a1271f
21 files changed
+413
No files matched your search
@@ -0,0 +1,19 @@
|
||||
"""Create ephemeral support-only home; never load Telegram memory/plugins/hooks."""
|
||||
import os
|
||||
import sys
|
||||
sys.path[:0] = ['/opt/hermes', '/opt/hermes/.venv/lib/python3.14/site-packages', '/opt/support-chat']
|
||||
from pathlib import Path
|
||||
import site
|
||||
site.addsitedir('/opt/hermes/.venv/lib/python3.14/site-packages')
|
||||
import hermes_yaml as yaml
|
||||
source = yaml.safe_load(Path('/opt/data/config.yaml').read_text())
|
||||
home = Path('/run/canina-support')
|
||||
home.mkdir(mode=0o700, exist_ok=True)
|
||||
safe = {'model': source.get('model', {}), 'web': source.get('web', {}), 'memory': {'memory_enabled': False, 'user_profile_enabled': False}, 'telemetry': {'shared_metrics': {'enabled': False, 'send': False}}, 'agent': {'max_iterations': 2}, 'compression': {'enabled': False}}
|
||||
p = home/'config.yaml'
|
||||
p.write_text(yaml.safe_dump(safe)); p.chmod(0o600)
|
||||
os.environ['HERMES_HOME']=str(home)
|
||||
# No Telegram token, gateway API key, DB or inherited internal credentials.
|
||||
for name in list(os.environ):
|
||||
if any(term in name for term in ['TELEGRAM','DATABASE','ADMIN','JWT','API_SERVER_KEY']): os.environ.pop(name,None)
|
||||
os.execv('/opt/hermes/.venv/bin/python',['python','/opt/support-chat/server.py'])
|
||||
Reference in new issue
Block a user