Skip to content

Commit

Permalink
Merge pull request #171 from SelfhostedPro/updating
Browse files Browse the repository at this point in the history
added network_mode to templates and db
  • Loading branch information
SelfhostedPro authored Oct 15, 2020
2 parents abca524 + 91176ef commit 5842033
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions backend/api/db/crud/templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ def add_template(db: Session, template: models.containers.Template):
categories=entry.get('categories', ''),
restart_policy=entry.get('restart_policy'),
ports=ports,
network_mode=entry.get('network_mode', ''),
volumes=entry.get('volumes', []),
env=entry.get('env', []),
devices=entry.get('devices', []),
Expand All @@ -99,6 +100,7 @@ def add_template(db: Session, template: models.containers.Template):
categories=entry.get('categories', ''),
restart_policy=entry.get('restart_policy'),
ports=ports,
network_mode=entry.get('network_mode', ''),
volumes=entry.get('volumes', []),
env=entry.get('env', []),
devices=entry.get('devices', []),
Expand Down Expand Up @@ -160,6 +162,7 @@ def refresh_template(db: Session, template_id: id):
categories=entry.get('categories', ''),
restart_policy=entry.get('restart_policy'),
ports=ports,
network_mode=entry.get('network_mode', ''),
volumes=entry.get('volumes', []),
env=entry.get('env', []),
devices=entry.get('devices', []),
Expand All @@ -186,6 +189,7 @@ def refresh_template(db: Session, template_id: id):
categories=entry.get('categories', ''),
restart_policy=entry.get('restart_policy'),
ports=ports,
network_mode=entry.get('network_mode', ''),
volumes=entry.get('volumes', []),
env=entry.get('env', []),
devices=entry.get('devices', []),
Expand Down
2 changes: 2 additions & 0 deletions backend/api/db/models/containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ class TemplateItem(Base):
nullable=True, unique=False, index=False)
ports = Column(JSON,
nullable=True, unique=False, index=False)
network_mode = Column(JSON,
nullable=True, unique=False, index=False)
volumes = Column(JSON,
nullable=True, unique=False, index=False)
env = Column(JSON,
Expand Down
1 change: 1 addition & 0 deletions backend/api/db/schemas/templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class TemplateItem(BaseModel):
labels: Optional[List] = []
sysctls: Optional[List] = []
cap_add: Optional[List] = []
network_mode: Optional[str]

class Config:
orm_mode = True
Expand Down
2 changes: 2 additions & 0 deletions backend/api/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ class Settings(BaseSettings):
{"variable": "!pictures", "replacement": "/yacht/Media/Photos"},
{"variable": "!localtime", "replacement": "/etc/localtime"},
{"variable": "!logs", "replacement": "/yacht/AppData/Logs"},
{"variable": "!PUID", "replacement": "1000"},
{"variable": "!GUID", "replacement": "100"},
]
SQLALCHEMY_DATABASE_URI = os.environ.get(
"DATABASE_URL", "sqlite:///config/data.sqlite"
Expand Down

0 comments on commit 5842033

Please sign in to comment.