def __init__(self): """Create components for the app.""" super().__init__() self._private_mode = True info = app_module.Info(app_id=self.app_id, version=self._version, name=_('MediaWiki'), icon_filename='mediawiki', short_description=_('Wiki'), description=_description, manual_page='MediaWiki', clients=manifest.clients) self.add(info) menu_item = menu.Menu('menu-mediawiki', info.name, info.short_description, info.icon_filename, 'mediawiki:index', parent_url_name='apps') self.add(menu_item) shortcut = Shortcut('shortcut-mediawiki', info.name, short_description=info.short_description, icon=info.icon_filename, url='/mediawiki', clients=info.clients, login_required=True) self.add(shortcut) packages = Packages('packages-mediawiki', ['mediawiki', 'imagemagick', 'php-sqlite3']) self.add(packages) firewall = Firewall('firewall-mediawiki', info.name, ports=['http', 'https'], is_external=True) self.add(firewall) webserver = Webserver('webserver-mediawiki', 'mediawiki', urls=['https://{host}/mediawiki']) self.add(webserver) webserver = Webserver('webserver-mediawiki-freedombox', 'mediawiki-freedombox') self.add(webserver) daemon = Daemon('daemon-mediawiki', 'mediawiki-jobrunner') self.add(daemon) backup_restore = BackupRestore('backup-restore-mediawiki', **manifest.backup) self.add(backup_restore)
def __init__(self): """Create components for the app.""" super().__init__() self._private_mode = True info = app_module.Info(app_id=self.app_id, version=version, name=_('MediaWiki'), icon_filename='mediawiki', short_description=_('Wiki'), description=_description, manual_page='MediaWiki', clients=clients) self.add(info) menu_item = menu.Menu('menu-mediawiki', info.name, info.short_description, info.icon_filename, 'mediawiki:index', parent_url_name='apps') self.add(menu_item) shortcut = Shortcut('shortcut-mediawiki', info.name, short_description=info.short_description, icon=info.icon_filename, url='/mediawiki', clients=info.clients, login_required=True) self.add(shortcut) firewall = Firewall('firewall-mediawiki', info.name, ports=['http', 'https'], is_external=True) self.add(firewall) webserver = Webserver('webserver-mediawiki', 'mediawiki', urls=['https://{host}/mediawiki']) self.add(webserver) webserver = Webserver('webserver-mediawiki-freedombox', 'mediawiki-freedombox') self.add(webserver) daemon = Daemon('daemon-mediawiki', managed_services[0]) self.add(daemon)
def __init__(self): """Create components for the app.""" super().__init__() info = app_module.Info(app_id=self.app_id, version=version, name=_('Tahoe-LAFS'), icon_filename='tahoe-lafs', short_description=_('Distributed File Storage'), description=_description) self.add(info) menu_item = menu.Menu('menu-tahoe', info.name, info.short_description, info.icon_filename, 'tahoe:index', parent_url_name='apps', advanced=True) self.add(menu_item) shortcut = frontpage.Shortcut( 'shortcut-tahoe', info.name, short_description=info.short_description, icon=info.icon_filename, description=info.description, url=None, configure_url=reverse_lazy('tahoe:index'), login_required=True) self.add(shortcut) firewall = Firewall('firewall-tahoe', info.name, ports=['tahoe-plinth'], is_external=True) self.add(firewall) webserver = Webserver('webserver-tahoe', 'tahoe-plinth') self.add(webserver) daemon = Daemon('daemon-tahoe', managed_services[0]) self.add(daemon)
def __init__(self): """Create components for the app.""" super().__init__() info = app_module.Info(app_id=self.app_id, version=version, name=_('Shaarli'), icon_filename='shaarli', short_description=_('Bookmarks'), description=_description, manual_page='Shaarli', clients=clients) self.add(info) menu_item = menu.Menu('menu-shaarli', info.name, info.short_description, info.icon_filename, 'shaarli:index', parent_url_name='apps') self.add(menu_item) shortcut = frontpage.Shortcut('shortcut-shaarli', info.name, short_description=info.short_description, icon=info.icon_filename, url='/shaarli', clients=info.clients, login_required=True) self.add(shortcut) firewall = Firewall('firewall-shaarli', info.name, ports=['http', 'https'], is_external=True) self.add(firewall) webserver = Webserver('webserver-shaarli', 'shaarli') self.add(webserver)
def __init__(self): """Create components for the app.""" super().__init__() info = app_module.Info(app_id=self.app_id, version=version, name=_('diaspora*'), icon_filename='diaspora', short_description=_('Federated Social Network'), description=_description, clients=clients) self.add(info) menu_item = menu.Menu('menu-diaspora', info.name, info.short_description, info.icon_filename, 'diaspora:index', parent_url_name='apps') self.add(menu_item) shortcut = Shortcut('shortcut-diaspora', info.name, short_description=info.short_description, icon=info.icon_filename, url=None, clients=info.clients, login_required=True) self.add(shortcut) firewall = Firewall('firewall-diaspora', info.name, ports=['http', 'https'], is_external=True) self.add(firewall) webserver = Webserver('webserver-diaspora', 'diaspora-plinth') self.add(webserver) daemon = Daemon('daemon-diaspora', managed_services[0]) self.add(daemon)
def __init__(self): """Create components for the app.""" super().__init__() groups = {'ed2k': _('Download files using eDonkey applications')} info = app_module.Info( app_id=self.app_id, version=version, name=_('MLDonkey'), icon_filename='mldonkey', short_description=_('Peer-to-peer File Sharing'), description=_description, manual_page='MLDonkey', clients=manifest.clients) self.add(info) menu_item = menu.Menu('menu-mldonkey', info.name, info.short_description, info.icon_filename, 'mldonkey:index', parent_url_name='apps') self.add(menu_item) shortcuts = frontpage.Shortcut( 'shortcut-mldonkey', info.name, short_description=info.short_description, icon=info.icon_filename, url='/mldonkey/', login_required=True, clients=info.clients, allowed_groups=list(groups)) self.add(shortcuts) firewall = Firewall('firewall-mldonkey', info.name, ports=['http', 'https'], is_external=True) self.add(firewall) webserver = Webserver('webserver-mldonkey', 'mldonkey-freedombox', urls=['https://{host}/mldonkey/']) self.add(webserver) daemon = Daemon('daemon-mldonkey', managed_services[0], listen_ports=[(4080, 'tcp4')]) self.add(daemon) users_and_groups = UsersAndGroups('users-and-groups-mldonkey', reserved_usernames=[_SYSTEM_USER], groups=groups) self.add(users_and_groups) backup_restore = BackupRestore('backup-restore-mldonkey', **manifest.backup) self.add(backup_restore)
def __init__(self): """The app's constructor""" super().__init__() self._add_ui_components() self._add_daemons() self._add_firewall_ports() # /rspamd location webserver = Webserver( 'webserver-email', # unique id 'email-server-freedombox', # config file name urls=['https://{host}/rspamd']) self.add(webserver) # Let's Encrypt event hook default_domain = get_domainname() domains = [default_domain] if default_domain else [] letsencrypt = LetsEncrypt('letsencrypt-email-server', domains=domains, daemons=['postfix', 'dovecot'], should_copy_certificates=False, managing_app='email_server') self.add(letsencrypt) if not domains: logger.warning('Could not fetch the FreedomBox domain name!')
def __init__(self): """Create components for the app.""" super().__init__() info = app_module.Info(app_id=self.app_id, version=version, name=_('Transmission'), icon_filename='transmission', short_description=_('BitTorrent Web Client'), description=_description, manual_page='Transmission', clients=clients) self.add(info) menu_item = menu.Menu('menu-transmission', info.name, info.short_description, info.icon_filename, 'transmission:index', parent_url_name='apps') self.add(menu_item) shortcut = frontpage.Shortcut( 'shortcut-transmission', info.name, short_description=info.short_description, icon=info.icon_filename, url='/transmission', clients=info.clients, login_required=True, allowed_groups=[group[0]]) self.add(shortcut) firewall = Firewall('firewall-transmission', info.name, ports=['http', 'https'], is_external=True) self.add(firewall) webserver = Webserver('webserver-transmission', 'transmission-plinth', urls=['https://{host}/transmission']) self.add(webserver) daemon = Daemon('daemon-transmission', managed_services[0], listen_ports=[(9091, 'tcp4')]) self.add(daemon)
def __init__(self): """Create components for the app.""" super().__init__() info = app_module.Info( app_id=self.app_id, version=version, name=_('MLDonkey'), icon_filename='mldonkey', short_description=_('Peer-to-peer File Sharing'), description=_description, manual_page='MLDonkey', clients=clients) self.add(info) menu_item = menu.Menu('menu-mldonkey', info.name, info.short_description, info.icon_filename, 'mldonkey:index', parent_url_name='apps') self.add(menu_item) shortcuts = frontpage.Shortcut( 'shortcut-mldonkey', info.name, short_description=info.short_description, icon=info.icon_filename, url='/mldonkey/', login_required=True, clients=info.clients, allowed_groups=[group[0]]) self.add(shortcuts) firewall = Firewall('firewall-mldonkey', info.name, ports=['http', 'https'], is_external=True) self.add(firewall) webserver = Webserver('webserver-mldonkey', 'mldonkey-freedombox', urls=['https://{host}/mldonkey/']) self.add(webserver) daemon = Daemon('daemon-mldonkey', managed_services[0], listen_ports=[(4080, 'tcp4')]) self.add(daemon)
def __init__(self): """Create components for the app.""" super().__init__() info = app_module.Info(app_id=self.app_id, version=version, name=_('Roundcube'), icon_filename='roundcube', short_description=_('Email Client'), description=_description, manual_page='Roundcube', clients=manifest.clients) self.add(info) menu_item = menu.Menu('menu-roundcube', info.name, info.short_description, info.icon_filename, 'roundcube:index', parent_url_name='apps') self.add(menu_item) shortcut = frontpage.Shortcut('shortcut-roundcube', info.name, short_description=info.short_description, icon=info.icon_filename, url='/roundcube/', clients=info.clients, login_required=True) self.add(shortcut) firewall = Firewall('firewall-roundcube', info.name, ports=['http', 'https'], is_external=True) self.add(firewall) webserver = Webserver('webserver-roundcube', 'roundcube', urls=['https://{host}/roundcube']) self.add(webserver) backup_restore = BackupRestore('backup-restore-roundcube', **manifest.backup) self.add(backup_restore)
def __init__(self): """Create components for the app.""" super().__init__() groups = {'i2p': _('Manage I2P application')} info = app_module.Info(app_id=self.app_id, version=version, name=_('I2P'), icon_filename='i2p', short_description=_('Anonymity Network'), description=_description, manual_page='I2P', clients=clients) self.add(info) menu_item = menu.Menu('menu-i2p', info.name, info.short_description, info.icon_filename, 'i2p:index', parent_url_name='apps') self.add(menu_item) shortcut = frontpage.Shortcut('shortcut-i2p', info.name, short_description=info.short_description, icon=info.icon_filename, url='/i2p/', clients=info.clients, login_required=True, allowed_groups=list(groups)) self.add(shortcut) firewall = Firewall('firewall-i2p-web', info.name, ports=['http', 'https'], is_external=True) self.add(firewall) firewall = Firewall('firewall-i2p-proxies', _('I2P Proxy'), ports=tunnels_to_manage.values(), is_external=False) self.add(firewall) webserver = Webserver('webserver-i2p', 'i2p-freedombox', urls=['https://{host}/i2p/']) self.add(webserver) daemon = Daemon('daemon-i2p', managed_services[0], listen_ports=[(7657, 'tcp6')]) self.add(daemon) users_and_groups = UsersAndGroups('users-and-groups-i2p', groups=groups) self.add(users_and_groups)
def __init__(self): """Create components for the app.""" super().__init__() groups = {'calibre': _('Use calibre e-book libraries')} info = app_module.Info(app_id=self.app_id, version=version, name=_('calibre'), icon_filename='calibre', short_description=_('E-book Library'), description=_description, manual_page='Calibre', clients=manifest.clients, donation_url='https://calibre-ebook.com/donate') self.add(info) menu_item = menu.Menu('menu-calibre', info.name, info.short_description, info.icon_filename, 'calibre:index', parent_url_name='apps') self.add(menu_item) shortcut = frontpage.Shortcut('shortcut-calibre', info.name, short_description=info.short_description, icon=info.icon_filename, url='/calibre', clients=info.clients, login_required=True, allowed_groups=list(groups)) self.add(shortcut) firewall = Firewall('firewall-calibre', info.name, ports=['http', 'https'], is_external=True) self.add(firewall) webserver = Webserver('webserver-calibre', 'calibre-freedombox', urls=['https://{host}/calibre']) self.add(webserver) daemon = Daemon('daemon-calibre', managed_services[0], listen_ports=[(8844, 'tcp4')]) self.add(daemon) users_and_groups = UsersAndGroups('users-and-groups-calibre', reserved_usernames=['calibre'], groups=groups) self.add(users_and_groups) backup_restore = BackupRestore('backup-restore-calibre', **manifest.backup) self.add(backup_restore)
def __init__(self): """Create components for the app.""" super().__init__() info = app_module.Info(app_id=self.app_id, version=version, name=_('Matrix Synapse'), icon_filename='matrixsynapse', short_description=_('Chat Server'), description=_description, manual_page='MatrixSynapse', clients=clients) self.add(info) menu_item = menu.Menu('menu-matrixsynapse', info.name, info.short_description, 'matrixsynapse', 'matrixsynapse:index', parent_url_name='apps') self.add(menu_item) shortcut = frontpage.Shortcut( 'shortcut-matrixsynapse', info.name, short_description=info.short_description, icon=info.icon_filename, description=info.description, configure_url=reverse_lazy('matrixsynapse:index'), clients=info.clients, login_required=True) self.add(shortcut) firewall = Firewall('firewall-matrixsynapse', info.name, ports=['matrix-synapse-plinth'], is_external=True) self.add(firewall) webserver = Webserver('webserver-matrixsynapse', 'matrix-synapse-plinth', urls=['https://{host}/_matrix/client/versions']) self.add(webserver) letsencrypt = LetsEncrypt( 'letsencrypt-matrixsynapse', domains=get_domains, daemons=[managed_services[0]], should_copy_certificates=True, private_key_path='/etc/matrix-synapse/homeserver.tls.key', certificate_path='/etc/matrix-synapse/homeserver.tls.crt', user_owner='matrix-synapse', group_owner='nogroup', managing_app='matrixsynapse') self.add(letsencrypt) daemon = Daemon('daemon-matrixsynapse', managed_services[0], listen_ports=[(8008, 'tcp4'), (8448, 'tcp4')]) self.add(daemon)
def test_webserver_init(): """Test that webserver component can be initialized.""" with pytest.raises(ValueError): Webserver(None, None) webserver = Webserver('test-webserver', 'test-config', kind='module', urls=['url1', 'url2']) assert webserver.component_id == 'test-webserver' assert webserver.web_name == 'test-config' assert webserver.kind == 'module' assert webserver.urls == ['url1', 'url2'] webserver = Webserver('test-webserver', None) assert webserver.kind == 'config' assert webserver.urls == []
def test_webserver_enable(superuser_run): """Test that enabling webserver configuration works.""" webserver = Webserver('test-webserver', 'test-config', kind='module') webserver.enable() superuser_run.assert_has_calls([ call('apache', ['enable', '--name', 'test-config', '--kind', 'module']) ])
def __init__(self): """Create components for the app.""" super().__init__() groups = {'git-access': _('Read-write access to Git repositories')} self.repos = [] info = app_module.Info(app_id=self.app_id, version=version, name=_('Gitweb'), icon_filename='gitweb', short_description=_('Simple Git Hosting'), description=_description, manual_page='GitWeb', clients=clients) self.add(info) menu_item = menu.Menu('menu-gitweb', info.name, info.short_description, info.icon_filename, 'gitweb:index', parent_url_name='apps') self.add(menu_item) shortcut = frontpage.Shortcut('shortcut-gitweb', info.name, short_description=info.short_description, icon=info.icon_filename, url='/gitweb/', clients=info.clients, login_required=True, allowed_groups=list(groups)) self.add(shortcut) firewall = Firewall('firewall-gitweb', info.name, ports=['http', 'https'], is_external=True) self.add(firewall) webserver = Webserver('webserver-gitweb', 'gitweb-freedombox', urls=['https://{host}/gitweb/']) self.add(webserver) self.auth_webserver = GitwebWebserverAuth('webserver-gitweb-auth', 'gitweb-freedombox-auth') self.add(self.auth_webserver) users_and_groups = UsersAndGroups('users-and-groups-gitweb', groups=groups) self.add(users_and_groups) setup_helper = globals()['setup_helper'] if setup_helper.get_state() != 'needs-setup': self.update_service_access()
def __init__(self): """Create components for the app.""" super().__init__() groups = { 'bit-torrent': _('Download files using BitTorrent applications') } info = app_module.Info( app_id=self.app_id, version=self._version, name=_('Transmission'), icon_filename='transmission', short_description=_('BitTorrent Web Client'), description=_description, manual_page='Transmission', clients=manifest.clients, donation_url='https://transmissionbt.com/donate/') self.add(info) menu_item = menu.Menu('menu-transmission', info.name, info.short_description, info.icon_filename, 'transmission:index', parent_url_name='apps') self.add(menu_item) shortcut = frontpage.Shortcut( 'shortcut-transmission', info.name, short_description=info.short_description, icon=info.icon_filename, url='/transmission', clients=info.clients, login_required=True, allowed_groups=list(groups)) self.add(shortcut) packages = Packages('packages-transmission', ['transmission-daemon']) self.add(packages) firewall = Firewall('firewall-transmission', info.name, ports=['http', 'https', 'transmission-client'], is_external=True) self.add(firewall) webserver = Webserver('webserver-transmission', 'transmission-plinth', urls=['https://{host}/transmission']) self.add(webserver) daemon = Daemon( 'daemon-transmission', self.DAEMON, listen_ports=[ (9091, 'tcp4'), (51413, 'tcp4'), (51413, 'tcp6'), (51413, 'udp4'), ]) self.add(daemon) users_and_groups = UsersAndGroups('users-and-groups-transmission', reserved_usernames=[SYSTEM_USER], groups=groups) self.add(users_and_groups) backup_restore = BackupRestore('backup-restore-transmission', **manifest.backup) self.add(backup_restore)
def __init__(self): """Create components for the app.""" super().__init__() self.groups = {'syncthing': _('Administer Syncthing application')} info = app_module.Info(app_id=self.app_id, version=version, name=_('Syncthing'), icon_filename='syncthing', short_description=_('File Synchronization'), description=_description, manual_page='Syncthing', clients=clients) self.add(info) menu_item = menu.Menu('menu-syncthing', info.name, info.short_description, info.icon_filename, 'syncthing:index', parent_url_name='apps') self.add(menu_item) shortcut = frontpage.Shortcut('shortcut-syncthing', info.name, short_description=info.short_description, icon=info.icon_filename, url='/syncthing/', clients=info.clients, login_required=True, allowed_groups=list(self.groups)) self.add(shortcut) firewall = Firewall('firewall-syncthing-web', info.name, ports=['http', 'https'], is_external=True) self.add(firewall) firewall = Firewall('firewall-syncthing-ports', info.name, ports=['syncthing'], is_external=True) self.add(firewall) webserver = Webserver('webserver-syncthing', 'syncthing-plinth', urls=['https://{host}/syncthing/']) self.add(webserver) daemon = Daemon('daemon-syncthing', managed_services[0]) self.add(daemon) users_and_groups = UsersAndGroups('users-and-groups-syncthing', [SYSTEM_USER], self.groups) self.add(users_and_groups)
def __init__(self): """Create components for the app.""" super().__init__() info = app_module.Info( app_id=self.app_id, version=self._version, name=_('WordPress'), icon_filename='wordpress', short_description=_('Website and Blog'), description=_description, manual_page='WordPress', clients=manifest.clients, donation_url='https://wordpressfoundation.org/donate/') self.add(info) menu_item = menu.Menu('menu-wordpress', info.name, info.short_description, info.icon_filename, 'wordpress:index', parent_url_name='apps') self.add(menu_item) shortcut = frontpage.Shortcut('shortcut-wordpress', info.name, short_description=info.short_description, icon=info.icon_filename, url='/wordpress/', clients=info.clients) self.add(shortcut) # Add php to avoid wordpress package bringing in lib-apache2-mod-php. # WordPress only supports MySQL/MariaDB as database server. packages = Packages( 'packages-wordpress', [ 'wordpress', # Avoid WordPress package bringing in libapache2-mod-php 'php', # Optional, for performance 'php-imagick', # Optional, to upload plugins/themes using SSH connection 'php-ssh2', # Optional, for performance 'php-zip', # WordPress only supports MySQL/MariaDB as DB 'default-mysql-server', ]) self.add(packages) firewall = Firewall('firewall-wordpress', info.name, ports=['http', 'https'], is_external=True) self.add(firewall) webserver = Webserver('webserver-wordpress', 'wordpress-freedombox', urls=['https://{host}/wordpress/']) self.add(webserver) daemon = Daemon('daemon-wordpress', 'wordpress-freedombox.timer') self.add(daemon) backup_restore = WordPressBackupRestore('backup-restore-wordpress', **manifest.backup) self.add(backup_restore)
def __init__(self): """Create components for the app.""" super().__init__() groups = {'web-search': _('Search the web')} info = app_module.Info(app_id=self.app_id, version=version, name=_('Searx'), icon_filename='searx', short_description=_('Web Search'), description=_description, manual_page='Searx', clients=clients) self.add(info) menu_item = menu.Menu('menu-searx', info.name, info.short_description, info.icon_filename, 'searx:index', parent_url_name='apps') self.add(menu_item) shortcut = frontpage.Shortcut( 'shortcut-searx', info.name, short_description=info.short_description, icon=info.icon_filename, url='/searx/', clients=info.clients, login_required=(not is_public_access_enabled()), allowed_groups=list(groups)) self.add(shortcut) firewall = Firewall('firewall-searx', info.name, ports=['http', 'https'], is_external=True) self.add(firewall) webserver = Webserver('webserver-searx', 'searx-freedombox', urls=['https://{host}/searx/']) self.add(webserver) webserver = SearxWebserverAuth('webserver-searx-auth', 'searx-freedombox-auth') self.add(webserver) uwsgi = Uwsgi('uwsgi-searx', 'searx') self.add(uwsgi) users_and_groups = UsersAndGroups('users-and-groups-searx', groups=groups) self.add(users_and_groups)
def __init__(self): """Create components for the app.""" super().__init__() groups = {'feed-reader': _('Read and subscribe to news feeds')} info = app_module.Info(app_id=self.app_id, version=version, name=_('Tiny Tiny RSS'), icon_filename='ttrss', short_description=_('News Feed Reader'), description=_description, manual_page='TinyTinyRSS', clients=manifest.clients) self.add(info) menu_item = menu.Menu('menu-ttrss', info.name, info.short_description, info.icon_filename, 'ttrss:index', parent_url_name='apps') self.add(menu_item) shortcut = frontpage.Shortcut('shortcut-ttrss', info.name, short_description=info.short_description, icon=info.icon_filename, url='/tt-rss', clients=info.clients, login_required=True, allowed_groups=list(groups)) self.add(shortcut) firewall = Firewall('firewall-ttrss', info.name, ports=['http', 'https'], is_external=True) self.add(firewall) webserver = Webserver('webserver-ttrss', 'tt-rss-plinth', urls=['https://{host}/tt-rss']) self.add(webserver) daemon = Daemon('daemon-ttrss', managed_services[0]) self.add(daemon) users_and_groups = UsersAndGroups('users-and-groups-ttrss', groups=groups) self.add(users_and_groups) backup_restore = TTRSSBackupRestore('backup-restore-ttrss', **manifest.backup) self.add(backup_restore)
def __init__(self): """Create components for the app.""" super().__init__() info = app_module.Info(app_id=self.app_id, version=self._version, name=_('Radicale'), icon_filename='radicale', short_description=_('Calendar and Addressbook'), description=_description, manual_page='Radicale', clients=manifest.clients) self.add(info) menu_item = menu.Menu('menu-radicale', info.name, info.short_description, info.icon_filename, 'radicale:index', parent_url_name='apps') self.add(menu_item) shortcut = frontpage.Shortcut('shortcut-radicale', info.name, short_description=info.short_description, icon=info.icon_filename, url='/radicale/', clients=info.clients, login_required=True) self.add(shortcut) packages = Packages('packages-radicale', ['radicale']) self.add(packages) firewall = Firewall('firewall-radicale', info.name, ports=['http', 'https'], is_external=True) self.add(firewall) webserver = Webserver('webserver-radicale', 'radicale2-freedombox', urls=['https://{host}/radicale']) self.add(webserver) uwsgi = Uwsgi('uwsgi-radicale', 'radicale') self.add(uwsgi) users_and_groups = UsersAndGroups('users-and-groups-radicale', reserved_usernames=['radicale']) self.add(users_and_groups) backup_restore = BackupRestore('backup-restore-radicale', **manifest.backup) self.add(backup_restore)
def __init__(self): """Initialize the app components""" super().__init__() groups = {'minidlna': _('Media streaming server')} info = app_module.Info(app_id=self.app_id, version=version, name=_('MiniDLNA'), icon_filename='minidlna', short_description=_('Simple Media Server'), description=_description, manual_page='MiniDLNA', clients=manifest.clients) self.add(info) menu_item = menu.Menu( 'menu-minidlna', name=info.name, short_description=info.short_description, url_name='minidlna:index', parent_url_name='apps', icon=info.icon_filename, ) firewall = Firewall('firewall-minidlna', info.name, ports=['minidlna'], is_external=False) webserver = Webserver('webserver-minidlna', 'minidlna-freedombox', urls=['http://localhost:8200/']) shortcut = frontpage.Shortcut('shortcut-minidlna', info.name, short_description=info.short_description, description=info.description, icon=info.icon_filename, url='/_minidlna/', login_required=True, allowed_groups=list(groups)) daemon = Daemon('daemon-minidlna', managed_services[0]) backup_restore = BackupRestore('backup-restore-minidlna', **manifest.backup) self.add(backup_restore) self.add(menu_item) self.add(webserver) self.add(firewall) self.add(shortcut) self.add(daemon) users_and_groups = UsersAndGroups('users-and-groups-minidlna', groups=groups) self.add(users_and_groups)
def test_webserver_is_enabled(webserver_is_enabled): """Test that checking webserver configuration enabled works.""" webserver = Webserver('test-webserver', 'test-config', kind='module') webserver_is_enabled.return_value = True assert webserver.is_enabled() webserver_is_enabled.assert_has_calls([call('test-config', kind='module')]) webserver_is_enabled.reset_mock() webserver_is_enabled.return_value = False assert not webserver.is_enabled() webserver_is_enabled.assert_has_calls([call('test-config', kind='module')])
def __init__(self): """Create components for the app.""" super().__init__() info = app_module.Info(app_id=self.app_id, version=version, is_essential=is_essential, name=_('Cockpit'), icon='fa-wrench', icon_filename='cockpit', short_description=_('Server Administration'), description=_description, manual_page='Cockpit', clients=manifest.clients) self.add(info) menu_item = menu.Menu('menu-cockpit', info.name, info.short_description, info.icon, 'cockpit:index', parent_url_name='system') self.add(menu_item) shortcut = frontpage.Shortcut('shortcut-cockpit', info.name, short_description=info.short_description, icon=info.icon_filename, url='/_cockpit/', clients=info.clients, login_required=True, allowed_groups=['admin']) self.add(shortcut) firewall = Firewall('firewall-cockpit', info.name, ports=['http', 'https'], is_external=True) self.add(firewall) webserver = Webserver('webserver-cockpit', 'cockpit-freedombox', urls=['https://{host}/_cockpit/']) self.add(webserver) daemon = Daemon('daemon-cockpit', managed_services[0]) self.add(daemon) backup_restore = BackupRestore('backup-restore-cockpit', **manifest.backup) self.add(backup_restore) domain_added.connect(on_domain_added) domain_removed.connect(on_domain_removed)
def __init__(self): """Create components for the app.""" super().__init__() info = app_module.Info(self.app_id, self._version, name=_('bepasty'), icon_filename='bepasty', short_description=_('File & Snippet Sharing'), description=_description, manual_page='bepasty', clients=manifest.clients) self.add(info) menu_item = menu.Menu('menu-bepasty', info.name, info.short_description, info.icon_filename, 'bepasty:index', parent_url_name='apps') self.add(menu_item) shortcut = frontpage.Shortcut('shortcut-bepasty', info.name, info.short_description, info.icon_filename, '/bepasty', clients=manifest.clients) self.add(shortcut) packages = Packages('packages-bepasty', ['bepasty']) self.add(packages) firewall = Firewall('firewall-bepasty', info.name, ports=['http', 'https'], is_external=True) self.add(firewall) uwsgi = Uwsgi('uwsgi-bepasty', 'bepasty-freedombox') self.add(uwsgi) webserver = Webserver('webserver-bepasty', 'bepasty-freedombox', urls=['https://{host}/bepasty/']) self.add(webserver) backup_restore = BackupRestore('backup-restore-bepasty', **manifest.backup) self.add(backup_restore)
def __init__(self): """Create components for the app.""" super().__init__() info = app_module.Info(app_id=self.app_id, version=self._version, name=_('Zoph'), icon_filename='zoph', short_description=_('Photo Organizer'), description=_description, manual_page='Zoph', clients=manifest.clients) self.add(info) menu_item = menu.Menu('menu-zoph', info.name, info.short_description, info.icon_filename, 'zoph:index', parent_url_name='apps') self.add(menu_item) shortcut = frontpage.Shortcut('shortcut-zoph', info.name, short_description=info.short_description, icon=info.icon_filename, url='/zoph/', clients=info.clients, login_required=True) self.add(shortcut) packages = Packages('packages-zoph', ['zoph']) self.add(packages) firewall = Firewall('firewall-zoph', info.name, ports=['http', 'https'], is_external=True) self.add(firewall) webserver = Webserver('webserver-zoph', 'zoph', urls=['https://{host}/zoph/']) self.add(webserver) backup_restore = ZophBackupRestore('backup-restore-zoph', **manifest.backup) self.add(backup_restore)
def __init__(self): """Create components for the app.""" super().__init__() self.repos = [] info = app_module.Info(app_id=self.app_id, version=version, name=_('Gitweb'), icon_filename='gitweb', short_description=_('Simple Git Hosting'), description=_description, manual_page='GitWeb', clients=clients) self.add(info) menu_item = menu.Menu('menu-gitweb', info.name, info.short_description, info.icon_filename, 'gitweb:index', parent_url_name='apps') self.add(menu_item) shortcut = frontpage.Shortcut('shortcut-gitweb', info.name, short_description=info.short_description, icon=info.icon_filename, url='/gitweb/', clients=info.clients, login_required=True, allowed_groups=[group[0]]) self.add(shortcut) firewall = Firewall('firewall-gitweb', info.name, ports=['http', 'https'], is_external=True) self.add(firewall) webserver = Webserver('webserver-gitweb', 'gitweb-freedombox', urls=['https://{host}/gitweb/']) self.add(webserver) self.auth_webserver = GitwebWebserverAuth('webserver-gitweb-auth', 'gitweb-freedombox-auth') self.add(self.auth_webserver)
def __init__(self): """Initialize the app components""" super().__init__() info = app_module.Info(app_id=self.app_id, version=version, name='minidlna', icon_filename='minidlna', short_description=_('Simple Media Server'), description=_description, clients=clients) self.add(info) menu_item = menu.Menu( 'menu-minidlna', name=info.name, short_description=info.short_description, url_name='minidlna:index', parent_url_name='apps', icon=info.icon_filename, ) firewall = Firewall('firewall-minidlna', info.name, ports=['minidlna'], is_external=False) webserver = Webserver('webserver-minidlna', 'minidlna-freedombox', urls=['http://localhost:8200/']) shortcut = frontpage.Shortcut( 'shortcut-minidlna', info.name, short_description=info.short_description, description=info.description, icon=info.icon_filename, url='/_minidlna/', login_required=True, allowed_groups=[group[0]], ) daemon = Daemon('daemon-minidlna', managed_services[0]) self.add(menu_item) self.add(webserver) self.add(firewall) self.add(shortcut) self.add(daemon)
def __init__(self): """Create components for the app.""" super().__init__() info = app_module.Info(app_id=self.app_id, version=version, name=_('ikiwiki'), icon_filename='ikiwiki', short_description=_('Wiki and Blog'), description=_description, manual_page='Ikiwiki', clients=manifest.clients, donation_url='https://ikiwiki.info/tipjar/') self.add(info) menu_item = menu.Menu('menu-ikiwiki', info.name, info.short_description, info.icon_filename, 'ikiwiki:index', parent_url_name='apps') self.add(menu_item) self.refresh_sites() firewall = Firewall('firewall-ikiwiki', info.name, ports=['http', 'https'], is_external=True) self.add(firewall) webserver = Webserver('webserver-ikiwiki', 'ikiwiki-plinth', urls=['https://{host}/ikiwiki']) self.add(webserver) groups = {'wiki': _('View and edit wiki applications')} users_and_groups = UsersAndGroups('users-and-groups-ikiwiki', groups=groups) self.add(users_and_groups) backup_restore = BackupRestore('backup-restore-ikiwiki', **manifest.backup) self.add(backup_restore)