Pyramid web app for inspecting arborist Merkle trees over sharded SQLite: document roots, inclusion proofs, an interactive 3D Merkle lattice (six.js / WebGL with graceful fallback), audit-chain linkage, and a live SSE event stream. Generated artifacts (env/, vendored static/six/ bundles, demo databases) are gitignored and rebuilt via the Makefile (venv, six, init-db, serve).
37 lines
1,010 B
Python
37 lines
1,010 B
Python
"""Create the dashboard metadata SQLite + run migrations.
|
|
|
|
Usage:
|
|
|
|
arborist_viz_init_db development.ini
|
|
|
|
Matches the remarkbox ``remarkbox_init_db`` entry-point pattern.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import os
|
|
import sys
|
|
|
|
from pyramid.paster import bootstrap, setup_logging
|
|
from sqlalchemy import engine_from_config
|
|
|
|
from ..models import Base
|
|
|
|
|
|
def main(argv=sys.argv):
|
|
if len(argv) < 2:
|
|
print("usage: arborist_viz_init_db <config_uri>", file=sys.stderr)
|
|
sys.exit(1)
|
|
config_uri = argv[1]
|
|
setup_logging(config_uri)
|
|
with bootstrap(config_uri) as env:
|
|
settings = env["registry"].settings
|
|
os.makedirs(os.path.join(os.path.dirname(os.path.abspath(config_uri)), "data"), exist_ok=True)
|
|
engine = engine_from_config(settings, "sqlalchemy.")
|
|
Base.metadata.create_all(engine)
|
|
print("[arborist_viz] dashboard metadata schema created at {0}".format(
|
|
settings.get("sqlalchemy.url")))
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|