mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-09-19 04:59:01 +00:00
minidlna: Add protection to local service using firewall
Tests: - When app is freshly installed, nft rules are inserted. - Trying to connect to local daemon from fbx user fails. - Functional tests pass. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
f518c75922
commit
489c536805
@ -9,7 +9,8 @@ from plinth import frontpage, menu
|
|||||||
from plinth.daemon import Daemon
|
from plinth.daemon import Daemon
|
||||||
from plinth.modules.apache.components import Webserver
|
from plinth.modules.apache.components import Webserver
|
||||||
from plinth.modules.backups.components import BackupRestore
|
from plinth.modules.backups.components import BackupRestore
|
||||||
from plinth.modules.firewall.components import Firewall
|
from plinth.modules.firewall.components import (Firewall,
|
||||||
|
FirewallLocalProtection)
|
||||||
from plinth.modules.users.components import UsersAndGroups
|
from plinth.modules.users.components import UsersAndGroups
|
||||||
from plinth.package import Packages, install
|
from plinth.package import Packages, install
|
||||||
from plinth.utils import Version
|
from plinth.utils import Version
|
||||||
@ -33,7 +34,7 @@ class MiniDLNAApp(app_module.App):
|
|||||||
|
|
||||||
app_id = 'minidlna'
|
app_id = 'minidlna'
|
||||||
|
|
||||||
_version = 2
|
_version = 3
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
"""Initialize the app components."""
|
"""Initialize the app components."""
|
||||||
@ -74,6 +75,10 @@ class MiniDLNAApp(app_module.App):
|
|||||||
is_external=False)
|
is_external=False)
|
||||||
self.add(firewall)
|
self.add(firewall)
|
||||||
|
|
||||||
|
firewall_local_protection = FirewallLocalProtection(
|
||||||
|
'firewall-local-protection-minidlna', ['8200'])
|
||||||
|
self.add(firewall_local_protection)
|
||||||
|
|
||||||
webserver = Webserver('webserver-minidlna', 'minidlna-freedombox',
|
webserver = Webserver('webserver-minidlna', 'minidlna-freedombox',
|
||||||
urls=['https://{host}/_minidlna/'])
|
urls=['https://{host}/_minidlna/'])
|
||||||
self.add(webserver)
|
self.add(webserver)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user