15 lines
564 B
Python
15 lines
564 B
Python
"""YakPanel - Firewall model"""
|
|
from sqlalchemy import String, Integer
|
|
from sqlalchemy.orm import Mapped, mapped_column
|
|
from app.core.database import Base
|
|
|
|
|
|
class FirewallRule(Base):
|
|
__tablename__ = "firewall"
|
|
|
|
id: Mapped[int] = mapped_column(Integer, primary_key=True, autoincrement=True)
|
|
port: Mapped[str] = mapped_column(String(32), nullable=False)
|
|
protocol: Mapped[str] = mapped_column(String(16), default="tcp")
|
|
action: Mapped[str] = mapped_column(String(16), default="accept")
|
|
ps: Mapped[str] = mapped_column(String(255), default="")
|