aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/src/meshbay_hub/db/models.py
diff options
context:
space:
mode:
authorChristophe Besson <cbesson@gmail.com>2026-08-28 03:43:29 +0200
committerChristophe Besson <cbesson@gmail.com>2026-08-28 03:43:29 +0200
commit2f573b4143212b21d92ff20179356acb8f8fe635 (patch)
treece0c4ff78044a56c0882d7ba94fbea436f0e83c3 /packages/meshbay-hub/src/meshbay_hub/db/models.py
parente1f1b65cfac031096e4bae24ccf102ca0dbb86d9 (diff)
parentb5b4f188a39fc96c4d32e67151e067b1add6dcfc (diff)
downloadmeshbay-2f573b4143212b21d92ff20179356acb8f8fe635.tar.gz
Merge branch 'feat/hub-disable-public-groups'
Diffstat (limited to 'packages/meshbay-hub/src/meshbay_hub/db/models.py')
-rw-r--r--packages/meshbay-hub/src/meshbay_hub/db/models.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/packages/meshbay-hub/src/meshbay_hub/db/models.py b/packages/meshbay-hub/src/meshbay_hub/db/models.py
index 3966bdc..0c337c1 100644
--- a/packages/meshbay-hub/src/meshbay_hub/db/models.py
+++ b/packages/meshbay-hub/src/meshbay_hub/db/models.py
@@ -299,6 +299,26 @@ class UserPreference(Base):
value: Mapped[str] = mapped_column(Text, nullable=False)
+class HubSetting(Base):
+ """
+ Instance-wide settings an admin changes at runtime from the panel.
+
+ Deliberately a key/value table rather than fields in `hub.toml`: the config
+ file is read once at boot and editing it means an SSH session and a restart,
+ which is not what "toggle this from the admin page" means. Anything here is a
+ policy the running hub can change on itself.
+
+ Absent key ⇒ the built-in default (see `meshbay_hub.hub_settings`). An older
+ hub with no row behaves exactly as it did before the setting existed.
+ """
+ __tablename__ = "hub_settings"
+
+ key: Mapped[str] = mapped_column(String(64), primary_key=True)
+ value: Mapped[str] = mapped_column(Text, nullable=False)
+ updated_at: Mapped[datetime] = mapped_column(
+ DateTime(timezone=True), default=_now, onupdate=_now)
+
+
class IPLog(Base):
"""
Connection log for legal compliance.