mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-11 08:16:03 +00:00
chore: v3 config migration script
This commit is contained in:
@@ -67,8 +67,6 @@ class Application:
|
||||
|
||||
sensitive_meta: config_mgr.ConfigManager = None
|
||||
|
||||
instance_secret_meta: config_mgr.ConfigManager = None # deprecated
|
||||
|
||||
pipeline_config_meta_trigger: config_mgr.ConfigManager = None
|
||||
pipeline_config_meta_safety: config_mgr.ConfigManager = None
|
||||
pipeline_config_meta_ai: config_mgr.ConfigManager = None
|
||||
|
||||
@@ -51,8 +51,8 @@ class BuildAppStage(stage.BootingStage):
|
||||
ap.log_cache = log_cache
|
||||
|
||||
persistence_mgr_inst = persistencemgr.PersistenceManager(ap)
|
||||
await persistence_mgr_inst.initialize()
|
||||
ap.persistence_mgr = persistence_mgr_inst
|
||||
await persistence_mgr_inst.initialize()
|
||||
|
||||
plugin_mgr_inst = plugin_mgr.PluginManager(ap)
|
||||
await plugin_mgr_inst.initialize()
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import secrets
|
||||
import os
|
||||
|
||||
from .. import stage, app
|
||||
@@ -50,12 +49,6 @@ class LoadConfigStage(stage.BootingStage):
|
||||
completion=False,
|
||||
)
|
||||
|
||||
if os.path.exists('data/metadata/instance-secret.json'):
|
||||
ap.instance_secret_meta = await config.load_json_config(
|
||||
'data/metadata/instance-secret.json',
|
||||
template_data={'jwt_secret': secrets.token_hex(16)},
|
||||
)
|
||||
await ap.instance_secret_meta.dump_config()
|
||||
# ======= deprecated =======
|
||||
|
||||
ap.instance_config = await config.load_yaml_config(
|
||||
|
||||
Reference in New Issue
Block a user