mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-08-19 12:36:06 +00:00
names: Declare domain types in various apps
- config handles static domain types. - pagekite handles pagekite domain types. - tor handles hidden service domain types. - dynamicdns handles dynamic domain types. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
5cbdd40f6b
commit
ab42b9b241
@ -27,6 +27,7 @@ from django.utils.translation import ugettext_lazy
|
||||
from plinth import actions
|
||||
from plinth import app as app_module
|
||||
from plinth import frontpage, menu
|
||||
from plinth.modules.names.components import DomainType
|
||||
from plinth.signals import domain_added
|
||||
|
||||
version = 2
|
||||
@ -61,6 +62,11 @@ class ConfigApp(app_module.App):
|
||||
parent_url_name='system')
|
||||
self.add(menu_item)
|
||||
|
||||
domain_type = DomainType('domain-type-static',
|
||||
ugettext_lazy('Domain Name'), 'config:index',
|
||||
can_have_certificate=True)
|
||||
self.add(domain_type)
|
||||
|
||||
|
||||
def get_domainname():
|
||||
"""Return the domainname"""
|
||||
|
||||
@ -23,6 +23,7 @@ from django.utils.translation import ugettext_lazy as _
|
||||
from plinth import actions
|
||||
from plinth import app as app_module
|
||||
from plinth import cfg, menu
|
||||
from plinth.modules.names.components import DomainType
|
||||
from plinth.signals import domain_added
|
||||
from plinth.utils import format_lazy
|
||||
|
||||
@ -73,6 +74,11 @@ class DynamicDNSApp(app_module.App):
|
||||
'dynamicdns:index', parent_url_name='system')
|
||||
self.add(menu_item)
|
||||
|
||||
domain_type = DomainType('domain-type-dynamic',
|
||||
_('Dynamic Domain Name'), 'dynamicdns:index',
|
||||
can_have_certificate=True)
|
||||
self.add(domain_type)
|
||||
|
||||
|
||||
def init():
|
||||
"""Initialize the module."""
|
||||
|
||||
@ -22,6 +22,7 @@ from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from plinth import app as app_module
|
||||
from plinth import cfg, menu
|
||||
from plinth.modules.names.components import DomainType
|
||||
from plinth.utils import format_lazy
|
||||
|
||||
from . import utils
|
||||
@ -92,6 +93,10 @@ class PagekiteApp(app_module.App):
|
||||
parent_url_name='system')
|
||||
self.add(menu_item)
|
||||
|
||||
domain_type = DomainType('domain-type-pagekite', _('PageKite Domain'),
|
||||
'pagekite:index', can_have_certificate=True)
|
||||
self.add(domain_type)
|
||||
|
||||
# XXX: Add pagekite daemon component and simplify action script
|
||||
|
||||
|
||||
|
||||
@ -28,6 +28,7 @@ from plinth import menu
|
||||
from plinth.daemon import Daemon
|
||||
from plinth.modules.firewall.components import Firewall
|
||||
from plinth.modules.names import SERVICES
|
||||
from plinth.modules.names.components import DomainType
|
||||
from plinth.signals import domain_added, domain_removed
|
||||
|
||||
from . import utils
|
||||
@ -77,6 +78,10 @@ class TorApp(app_module.App):
|
||||
'tor:index', parent_url_name='apps')
|
||||
self.add(menu_item)
|
||||
|
||||
domain_type = DomainType('domain-type-tor', _('Tor Hidden Service'),
|
||||
'tor:index', can_have_certificate=False)
|
||||
self.add(domain_type)
|
||||
|
||||
firewall = Firewall('firewall-tor-socks', _('Tor Socks Proxy'),
|
||||
ports=['tor-socks'], is_external=False)
|
||||
self.add(firewall)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user