onion: remove onion key column, prod forms

This commit is contained in:
Iain Learmonth 2022-11-09 15:16:39 +00:00
parent 890ce3077f
commit e1394f71d6
4 changed files with 68 additions and 20 deletions

View file

@ -87,7 +87,7 @@ class MirrorList(AbstractConfiguration):
if self.provider == "s3":
return f"s3://{self.container}/{self.filename}"
if self.provider == "http_post":
return self.container
return str(self.container)
return "Unknown provider"
@classmethod

View file

@ -19,7 +19,6 @@ class Onion(AbstractConfiguration):
group_id = db.Column(db.Integer(), db.ForeignKey("group.id"), nullable=False)
domain_name = db.Column(db.String(255), nullable=False)
onion_name = db.Column(db.String(56), nullable=False, unique=True)
onion_public_key = db.Column(db.LargeBinary, nullable=False)
onion_private_key = db.Column(db.LargeBinary, nullable=False)
@ -30,7 +29,7 @@ class Onion(AbstractConfiguration):
group = db.relationship("Group", back_populates="onions")
@property
def calculated_onion_name(self):
def onion_name(self) -> str:
p = self.onion_public_key[32:]
h = hashlib.sha3_256()