From 22760ceb500fb2bd25a66124b881722dde465d2c Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Sat, 31 May 2014 20:21:28 +0530 Subject: [PATCH 01/23] Remove Photos stub --- modules/installed/apps/apps.py | 7 ----- modules/installed/apps/templates/photos.html | 29 -------------------- 2 files changed, 36 deletions(-) delete mode 100644 modules/installed/apps/templates/photos.html diff --git a/modules/installed/apps/apps.py b/modules/installed/apps/apps.py index 43f8fcafd..521aa29c2 100644 --- a/modules/installed/apps/apps.py +++ b/modules/installed/apps/apps.py @@ -12,15 +12,8 @@ class Apps(PagePlugin): self.register_page("apps") self.menu = cfg.main_menu.add_item("Apps", "icon-download-alt", "/apps", 80) self.menu.add_item("Chat", "icon-comment", "/../jwchat", 30) - self.menu.add_item("Photo Gallery", "icon-picture", "/apps/photos", 35) @cherrypy.expose def index(self): return util.render_template(template='apps', title=_('User Applications')) - - @cherrypy.expose - @require() - def photos(self): - return util.render_template(template='photos', - title=_('Photo Gallery')) diff --git a/modules/installed/apps/templates/photos.html b/modules/installed/apps/templates/photos.html deleted file mode 100644 index 5658a54ff..000000000 --- a/modules/installed/apps/templates/photos.html +++ /dev/null @@ -1,29 +0,0 @@ -{% extends 'login_nav.html' %} -{% comment %} -# -# This file is part of Plinth. -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -{% endcomment %} - -{% block main_block %} - -

Your photos might well be the most valuable digital property you -have, so why trust it to companies that have no investment in the -sentimental value of your family snaps? Keep those photos local, -backed up, easily accessed and free from the whims of some other -websites business model.

- -{% endblock %} From 59572610ee13f06d3f6662011573cbfe87ffc228 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Sat, 31 May 2014 22:30:00 +0530 Subject: [PATCH 02/23] Remove defunct link to forms API module --- modules/forms.py | 1 - 1 file changed, 1 deletion(-) delete mode 120000 modules/forms.py diff --git a/modules/forms.py b/modules/forms.py deleted file mode 120000 index 4b0a50792..000000000 --- a/modules/forms.py +++ /dev/null @@ -1 +0,0 @@ -installed/lib/forms.py \ No newline at end of file From 1625a99cc261b03cf0fc346788952a3b7fcbe14c Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Sat, 31 May 2014 22:36:01 +0530 Subject: [PATCH 03/23] Remove Sharing stubs --- modules/file_explorer.py | 1 - modules/installed/sharing/file_explorer.py | 19 -------- modules/installed/sharing/sharing.py | 44 ------------------- .../sharing/templates/file_explorer.html | 42 ------------------ .../installed/sharing/templates/sharing.html | 33 -------------- .../sharing/templates/sharing_printer.html | 37 ---------------- modules/sharing.py | 1 - 7 files changed, 177 deletions(-) delete mode 120000 modules/file_explorer.py delete mode 100644 modules/installed/sharing/file_explorer.py delete mode 100644 modules/installed/sharing/sharing.py delete mode 100644 modules/installed/sharing/templates/file_explorer.html delete mode 100644 modules/installed/sharing/templates/sharing.html delete mode 100644 modules/installed/sharing/templates/sharing_printer.html delete mode 120000 modules/sharing.py diff --git a/modules/file_explorer.py b/modules/file_explorer.py deleted file mode 120000 index f19191667..000000000 --- a/modules/file_explorer.py +++ /dev/null @@ -1 +0,0 @@ -installed/sharing/file_explorer.py \ No newline at end of file diff --git a/modules/installed/sharing/file_explorer.py b/modules/installed/sharing/file_explorer.py deleted file mode 100644 index c56cdb504..000000000 --- a/modules/installed/sharing/file_explorer.py +++ /dev/null @@ -1,19 +0,0 @@ -import cherrypy -from gettext import gettext as _ -from modules.auth import require -from plugin_mount import PagePlugin -import cfg -import util - - -class FileExplorer(PagePlugin): - def __init__(self, *args, **kwargs): - PagePlugin.__init__(self, *args, **kwargs) - self.register_page("sharing.explorer") - cfg.html_root.sharing.menu.add_item("File Explorer", "icon-folder-open", "/sharing/explorer", 30) - - @cherrypy.expose - @require() - def index(self): - return util.render_template(template='file_explorer', - title=_('File Explorer')) diff --git a/modules/installed/sharing/sharing.py b/modules/installed/sharing/sharing.py deleted file mode 100644 index 81e004c20..000000000 --- a/modules/installed/sharing/sharing.py +++ /dev/null @@ -1,44 +0,0 @@ -import cherrypy -from gettext import gettext as _ -from modules.auth import require -from plugin_mount import PagePlugin -import cfg -import util - - -class Sharing(PagePlugin): - order = 9 # order of running init in PagePlugins - - def __init__(self, *args, **kwargs): - PagePlugin.__init__(self, *args, **kwargs) - self.register_page("sharing") - self.menu = cfg.main_menu.add_item("Sharing", "icon-share-alt", "/sharing", 35) - self.menu.add_item("File Server", "icon-inbox", "/sharing/files", 10) - - @cherrypy.expose - def index(self): - """This isn't an internal redirect, because we need the url to - reflect that we've moved down into the submenu hierarchy. - Otherwise, it's hard to know which menu portion to make active - or expand or contract.""" - raise cherrypy.HTTPRedirect(cfg.server_dir + '/sharing/files') - - @cherrypy.expose - @require() - def files(self): - return util.render_template(template='sharing', - title=_('File Server')) - - -#TODO: move PrinterSharing to another file, as it should be an optional module (most people don't care about printer sharing) -class PrinterSharing(PagePlugin): - def __init__(self, *args, **kwargs): - PagePlugin.__init__(self, *args, **kwargs) - self.register_page("sharing.printer") - cfg.html_root.sharing.menu.add_item("Printer Sharing", "icon-print", "/sharing/printer", 35) - - @cherrypy.expose - @require() - def index(self): - return util.render_template(template='sharing_printer', - title=_('Printer Sharing')) diff --git a/modules/installed/sharing/templates/file_explorer.html b/modules/installed/sharing/templates/file_explorer.html deleted file mode 100644 index a7f98b232..000000000 --- a/modules/installed/sharing/templates/file_explorer.html +++ /dev/null @@ -1,42 +0,0 @@ -{% extends 'login_nav.html' %} -{% comment %} -# -# This file is part of Plinth. -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -{% endcomment %} - -{% block main_block %} - -

File explorer for users that also have shell accounts.

Until -that is written (and it will be a while), we should -install mollify -or ajaxplorer, -but of which seem to have some support for playing media files in the -browser (as opposed to forcing users to download and play them -locally). The downsides to third-party explorers are: they're don't -fit within our theme system, they require separate login, and they're -written in php, which will make integrating them hard.

- -

There are, of course, many other options for php-based file -explorers. These were the ones I saw that might do built-in media -players.

- -

For python-friendly options, check out FileManager. -It appears to be mostly javascript with some bindings to make it -python-friendly.

- -{% endblock %} diff --git a/modules/installed/sharing/templates/sharing.html b/modules/installed/sharing/templates/sharing.html deleted file mode 100644 index 020c3edfe..000000000 --- a/modules/installed/sharing/templates/sharing.html +++ /dev/null @@ -1,33 +0,0 @@ -{% extends "login_nav.html" %} -{% comment %} -# -# This file is part of Plinth. -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -{% endcomment %} - -{% block sidebar_right_block %} - - - -{% endblock %} diff --git a/modules/installed/sharing/templates/sharing_printer.html b/modules/installed/sharing/templates/sharing_printer.html deleted file mode 100644 index 05ef7fb3e..000000000 --- a/modules/installed/sharing/templates/sharing_printer.html +++ /dev/null @@ -1,37 +0,0 @@ -{% extends "login_nav.html" %} -{% comment %} -# -# This file is part of Plinth. -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -{% endcomment %} - -{% block main_block %} - -

TODO: Setup and install SAMBA

-

TODO: Setup and install CUPS

- -{% endblock %} - -{% block sidebar_right_block %} - - - -{% endblock %} diff --git a/modules/sharing.py b/modules/sharing.py deleted file mode 120000 index e2323fb26..000000000 --- a/modules/sharing.py +++ /dev/null @@ -1 +0,0 @@ -installed/sharing/sharing.py \ No newline at end of file From de250e5e63e4b0a36d06f8187644f91157265218 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Sat, 31 May 2014 23:18:23 +0530 Subject: [PATCH 04/23] Remove Privacy stubs --- modules/installed/privacy/privacy.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/modules/installed/privacy/privacy.py b/modules/installed/privacy/privacy.py index 8de533f88..238ffc483 100644 --- a/modules/installed/privacy/privacy.py +++ b/modules/installed/privacy/privacy.py @@ -12,17 +12,8 @@ class Privacy(PagePlugin): PagePlugin.__init__(self, *args, **kwargs) self.register_page("privacy") self.menu = cfg.main_menu.add_item("Privacy", "icon-eye-open", "/privacy", 12) - self.menu.add_item("General Config", "icon-asterisk", "/privacy/config", 10) - self.menu.add_item("Ad Blocking", "icon-ban-circle", "/privacy/adblock", 20) - self.menu.add_item("HTTPS Everywhere", "icon-lock", "/privacy/https_everywhere", 30) @cherrypy.expose def index(self): - #raise cherrypy.InternalRedirect('/privacy/config') - return self.config() - - @cherrypy.expose - @require() - def config(self): return util.render_template(template='privacy_config', title=_('Privacy Control Panel')) From 57487ab2d37628036c426ad8769cfc382d4949d6 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Sun, 1 Jun 2014 10:45:46 +0530 Subject: [PATCH 05/23] Remove Router stubs --- modules/installed/router/pagekite.py | 10 +- modules/installed/router/router.py | 123 +----------------- .../router/templates/router_setup.html | 117 ----------------- 3 files changed, 6 insertions(+), 244 deletions(-) delete mode 100644 modules/installed/router/templates/router_setup.html diff --git a/modules/installed/router/pagekite.py b/modules/installed/router/pagekite.py index 799a8860d..72d1da260 100644 --- a/modules/installed/router/pagekite.py +++ b/modules/installed/router/pagekite.py @@ -38,10 +38,10 @@ class PageKite(PagePlugin): def __init__(self, *args, **kwargs): PagePlugin.__init__(self, *args, **kwargs) - self.register_page("router.setup.pagekite") - cfg.html_root.router.setup.menu.add_item( + self.register_page("router.pagekite") + cfg.html_root.router.menu.add_item( _("Public Visibility (PageKite)"), "icon-flag", - "/router/setup/pagekite", 50) + "/router/pagekite", 50) @staticmethod @cherrypy.expose @@ -51,7 +51,7 @@ class PageKite(PagePlugin): del kwargs # Unused menu = {'title': _('PageKite'), - 'items': [{'url': '/router/setup/pagekite/configure', + 'items': [{'url': '/router/pagekite/configure', 'text': _('Configure PageKite')}]} sidebar_right = util.render_template(template='menu_block', menu=menu) @@ -112,7 +112,7 @@ class Configure(PagePlugin): # pylint: disable-msg=C0103 def __init__(self, *args, **kwargs): PagePlugin.__init__(self, *args, **kwargs) - self.register_page("router.setup.pagekite.configure") + self.register_page("router.pagekite.configure") @cherrypy.expose @require() diff --git a/modules/installed/router/router.py b/modules/installed/router/router.py index 2cc75d980..22ca40107 100644 --- a/modules/installed/router/router.py +++ b/modules/installed/router/router.py @@ -18,11 +18,6 @@ class Router(PagePlugin): self.menu = cfg.main_menu.add_item('Router', 'icon-retweet', '/router', 10) - self.menu.add_item('Wireless', 'icon-signal', '/router/wireless', 12) - self.menu.add_item('Firewall', 'icon-fire', '/router/firewall', 18) - self.menu.add_item('Hotspot and Mesh', 'icon-map-marker', - '/router/hotspot') - self.menu.add_item('Info', 'icon-list-alt', '/router/info', 100) @staticmethod @cherrypy.expose @@ -31,120 +26,4 @@ class Router(PagePlugin): reflect that we've moved down into the submenu hierarchy. Otherwise, it's hard to know which menu portion to make active or expand or contract.""" - raise cherrypy.HTTPRedirect(cfg.server_dir + '/router/setup') - - @staticmethod - @cherrypy.expose - @require() - def wireless(): - """Serve the wireless page""" - return util.render_template(title="Wireless", - main="

wireless setup: essid, etc.

") - - @staticmethod - @cherrypy.expose - @require() - def firewall(): - """Serve the firewall page""" - return util.render_template(title="Firewall", - main="

Iptables twiddling.

") - - @staticmethod - @cherrypy.expose - @require() - def hotspot(): - """Serve the hotspot page""" - return util.render_template(title="Hotspot and Mesh", - main="

connection sharing setup.

") - - -class WANForm(forms.Form): # pylint: disable-msg=W0232 - """WAN setup form""" - connection_type = forms.ChoiceField( - label=_('Connection Type'), - choices=[('dhcp', _('DHCP')), ('static_ip', _('Static IP'))]) - - wan_ip = forms.IPAddressField(label=_('WAN IP Address'), required=False) - - subnet_mask = forms.IPAddressField(label=_('Subnet Mask'), required=False) - - dns_1 = forms.IPAddressField(label=_('Static DNS 1'), required=False) - - dns_2 = forms.IPAddressField(label=_('Static DNS 2'), required=False) - - dns_3 = forms.IPAddressField(label=_('Static DNS 3'), required=False) - - -class Setup(PagePlugin): - """Router setup page""" - def __init__(self, *args, **kwargs): - PagePlugin.__init__(self, args, kwargs) - - self.register_page('router.setup') - - self.menu = cfg.html_root.router.menu.add_item( - 'General Setup', 'icon-cog', '/router/setup', 10) - self.menu.add_item('Dynamic DNS', 'icon-flag', '/router/setup/ddns', - 20) - self.menu.add_item('MAC Address Clone', 'icon-barcode', - '/router/setup/mac_address', 30) - - @cherrypy.expose - @require() - def index(self, **kwargs): - """Return the setup page""" - status = self.get_status() - - form = None - messages = [] - - if kwargs: - form = WANForm(kwargs, prefix='router') - # pylint: disable-msg=E1101 - if form.is_valid(): - self._apply_changes(status, form.cleaned_data, messages) - status = self.get_status() - form = WANForm(initial=status, prefix='router') - else: - form = WANForm(initial=status, prefix='router') - - return util.render_template(template='router_setup', - title=_('General Router Setup'), - form=form, messages=messages) - - @staticmethod - @cherrypy.expose - @require() - def ddns(): - """Return the DDNS page""" - return util.render_template(title="Dynamic DNS", - main="

Masquerade setup

") - - @staticmethod - @cherrypy.expose - @require() - def mac_address(): - """Return the MAC address page""" - return util.render_template( - title="MAC Address Cloning", - main="

Your router can pretend to have a different MAC address \ -on any interface.

") - - @staticmethod - def get_status(): - """Return the current status""" - store = util.filedict_con(cfg.store_file, 'router') - return {'connection_type': store.get('connection_type', 'dhcp')} - - @staticmethod - def _apply_changes(old_status, new_status, messages): - """Apply the changes""" - print 'Apply changes - %s, %s', old_status, new_status - if old_status['connection_type'] == new_status['connection_type']: - return - - store = util.filedict_con(cfg.store_file, 'router') - store['connection_type'] = new_status['connection_type'] - - messages.append(('success', _('Connection type set'))) - messages.append(('info', _('IP address settings unimplemented'))) + raise cherrypy.HTTPRedirect(cfg.server_dir + '/router/pagekite') diff --git a/modules/installed/router/templates/router_setup.html b/modules/installed/router/templates/router_setup.html deleted file mode 100644 index c484c5585..000000000 --- a/modules/installed/router/templates/router_setup.html +++ /dev/null @@ -1,117 +0,0 @@ -{% extends "login_nav.html" %} -{% comment %} -# -# This file is part of Plinth. -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -{% endcomment %} - -{% block main_block %} - -{% if cfg.users.expert %} - -

WAN Connection

- - {% include 'messages.html' %} - -
- {% csrf_token %} - - {% include 'bootstrapform/field.html' with field=form.connection_type %} - -
- {% include 'bootstrapform/field.html' with field=form.wan_ip %} - {% include 'bootstrapform/field.html' with field=form.subnet_mask %} - {% include 'bootstrapform/field.html' with field=form.dns_1 %} - {% include 'bootstrapform/field.html' with field=form.dns_2 %} - {% include 'bootstrapform/field.html' with field=form.dns_3 %} -
- - - -
- -{% else %} - -

In basic mode, you don't need to do any router setup before you - can go online. Just plug your {{ cfg.product_name }} in to your - cable or DSL modem and the router will try to get you on the - internet using DHCP.

- -

If that fails, you might need to resort to the expert options. - Enable expert mode in the "{{ cfg.product_name }} / System / - Configure" menu.

- -{% endif %} - -{% endblock %} - -{% block sidebar_right_block %} - - - -{% endblock %} - -{% block js_block %} - {{ js|safe }} - - - -{% endblock %} From cb26256bb3b80e1291b85131fc9eeea27f3f5ec6 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Sun, 1 Jun 2014 10:56:16 +0530 Subject: [PATCH 06/23] Remove OpenID stub --- modules/installed/services/services.py | 8 +---- .../installed/services/templates/openid.html | 29 ------------------- 2 files changed, 1 insertion(+), 36 deletions(-) delete mode 100644 modules/installed/services/templates/openid.html diff --git a/modules/installed/services/services.py b/modules/installed/services/services.py index 0bf5fb698..71485f8d3 100644 --- a/modules/installed/services/services.py +++ b/modules/installed/services/services.py @@ -11,13 +11,7 @@ class Services(PagePlugin): PagePlugin.__init__(self, *args, **kwargs) self.register_page("services") self.menu = cfg.main_menu.add_item("Services", "icon-list", "/services", 90) - self.menu.add_item("Open ID", "icon-user", "/services/openid", 35) @cherrypy.expose def index(self): - return self.openid() - - @cherrypy.expose - @require() - def openid(self): - return util.render_template(template='openid', title="Open ID") + raise cherrypy.HTTPRedirect(cfg.server_dir + '/services/xmpp') diff --git a/modules/installed/services/templates/openid.html b/modules/installed/services/templates/openid.html deleted file mode 100644 index 69d6ab8a6..000000000 --- a/modules/installed/services/templates/openid.html +++ /dev/null @@ -1,29 +0,0 @@ -{% extends "login_nav.html" %} -{% comment %} -# -# This file is part of Plinth. -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -{% endcomment %} - -{% block main_block %} - -

One Login for Every Site

- -

Your {{ cfg.box_name }} is also an OpenID machine. It can generate -credentials that allow you to log in to many websites without the need -to remember or enter a separate username and password at each one.

- -{% endblock %} From faf9cb937e283dea662dc06b840b667f16d19b14 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Sun, 1 Jun 2014 11:08:31 +0530 Subject: [PATCH 07/23] Remove WAN stub --- modules/installed/system/templates/wan.html | 52 ------------- modules/installed/system/wan.py | 85 --------------------- modules/wan.py | 1 - 3 files changed, 138 deletions(-) delete mode 100644 modules/installed/system/templates/wan.html delete mode 100644 modules/installed/system/wan.py delete mode 120000 modules/wan.py diff --git a/modules/installed/system/templates/wan.html b/modules/installed/system/templates/wan.html deleted file mode 100644 index ea83226d0..000000000 --- a/modules/installed/system/templates/wan.html +++ /dev/null @@ -1,52 +0,0 @@ -{% extends "login_nav.html" %} -{% comment %} -# -# This file is part of Plinth. -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -{% endcomment %} - -{% load bootstrap %} - -{% block main_block %} - -{% if cfg.users.expert %} - - {% include 'messages.html' %} - -

For security reasons, neither WAN Administration nor WAN SSH is - available to the `admin` user account.

- -

TODO: in expert mode, tell user they can ssh in to enable admin - from WAN, do their business, then disable it. It would be good to - enable the option and autodisable it when the ssh connection - dies.

- -
- {% csrf_token %} - - {{ form|bootstrap }} - - - -
- -{% else %} - -

This page is available only in expert mode.

- -{% endif %} - -{% endblock %} diff --git a/modules/installed/system/wan.py b/modules/installed/system/wan.py deleted file mode 100644 index 962fe806f..000000000 --- a/modules/installed/system/wan.py +++ /dev/null @@ -1,85 +0,0 @@ -import cherrypy -from django import forms -from gettext import gettext as _ -from modules.auth import require -from plugin_mount import PagePlugin -import cfg -import util - - -class WanForm(forms.Form): # pylint: disable-msg=W0232 - """Form to configure wan settings""" - - wan_admin = forms.BooleanField( - label=_('Allow access to Plinth from WAN'), - required=False, - help_text=_('If you check this box, this front end will be reachable \ -from the WAN. If your {{ box_name }} connects you to the internet, that \ -means you\'ll be able to log in to the front end from the internet. This \ -might be convenient, but it is also dangerous, since it can \ -enable attackers to gain access to your {{ box_name }} from the outside \ -world. All they\'ll need is your username and passphrase, which they might \ -guess or they might simply try every posible combination of letters and \ -numbers until they get in. If you enable the WAN administration option, you \ -must use long and complex passphrases.').format( - box_name=cfg.box_name)) - - lan_ssh = forms.BooleanField( - label=_('Allow SSH access from LAN'), - required=False) - - wan_ssh = forms.BooleanField( - label=_('Allow SSH access from WAN'), - required=False) - - # XXX: Only present due to issue with submitting empty form - dummy = forms.CharField(label='Dummy', initial='dummy', - widget=forms.HiddenInput()) - - -class Wan(PagePlugin): - order = 60 - - def __init__(self, *args, **kwargs): - PagePlugin.__init__(self, *args, **kwargs) - self.register_page('sys.config.wan') - - cfg.html_root.sys.config.menu.add_item(_('WAN'), 'icon-cog', - '/sys/config/wan', 20) - - @cherrypy.expose - @require() - def index(self, **kwargs): - """Serve the configuration form""" - status = self.get_status() - - form = None - messages = [] - - if kwargs and cfg.users.expert(): - form = WanForm(kwargs, prefix='wan') - # pylint: disable-msg=E1101 - if form.is_valid(): - self._apply_changes(form.cleaned_data, messages) - status = self.get_status() - form = WanForm(initial=status, prefix='wan') - else: - form = WanForm(initial=status, prefix='wan') - - title = _('Accessing the {box_name}').format(box_name=cfg.box_name) - return util.render_template(template='wan', title=title, form=form, - messages=messages) - - @staticmethod - def get_status(): - """Return the current status""" - return util.filedict_con(cfg.store_file, 'sys') - - @staticmethod - def _apply_changes(new_status, messages): - """Apply the changes after form submission""" - store = util.filedict_con(cfg.store_file, 'sys') - for field in ['wan_admin', 'wan_ssh', 'lan_ssh']: - store[field] = new_status[field] - - messages.append(('success', _('Setting updated'))) diff --git a/modules/wan.py b/modules/wan.py deleted file mode 120000 index 5a68efd0d..000000000 --- a/modules/wan.py +++ /dev/null @@ -1 +0,0 @@ -installed/system/wan.py \ No newline at end of file From 7c878ba1b491fc53cb570885cd0b1badae23a9fe Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Sun, 1 Jun 2014 12:00:59 +0530 Subject: [PATCH 08/23] Move Tor to separate module and present under Apps - Remove Privacy section --- modules/installed/privacy/privacy.py | 19 -------- .../privacy/templates/privacy_config.html | 46 ------------------- .../{privacy => tor}/templates/tor.html | 0 modules/installed/{privacy => tor}/tor.py | 7 +-- modules/privacy.py | 1 - modules/tor.py | 2 +- 6 files changed, 5 insertions(+), 70 deletions(-) delete mode 100644 modules/installed/privacy/privacy.py delete mode 100644 modules/installed/privacy/templates/privacy_config.html rename modules/installed/{privacy => tor}/templates/tor.html (100%) rename modules/installed/{privacy => tor}/tor.py (87%) delete mode 120000 modules/privacy.py diff --git a/modules/installed/privacy/privacy.py b/modules/installed/privacy/privacy.py deleted file mode 100644 index 238ffc483..000000000 --- a/modules/installed/privacy/privacy.py +++ /dev/null @@ -1,19 +0,0 @@ -import cherrypy -from gettext import gettext as _ -from plugin_mount import PagePlugin -from modules.auth import require -import cfg -import util - - -class Privacy(PagePlugin): - order = 20 # order of running init in PagePlugins - def __init__(self, *args, **kwargs): - PagePlugin.__init__(self, *args, **kwargs) - self.register_page("privacy") - self.menu = cfg.main_menu.add_item("Privacy", "icon-eye-open", "/privacy", 12) - - @cherrypy.expose - def index(self): - return util.render_template(template='privacy_config', - title=_('Privacy Control Panel')) diff --git a/modules/installed/privacy/templates/privacy_config.html b/modules/installed/privacy/templates/privacy_config.html deleted file mode 100644 index cc3becb15..000000000 --- a/modules/installed/privacy/templates/privacy_config.html +++ /dev/null @@ -1,46 +0,0 @@ -{% extends "login_nav.html" %} -{% comment %} -# -# This file is part of Plinth. -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -{% endcomment %} - -{% block main_block %} - -

Privacy controls are not yet implemented. This page is a -placeholder and a promise: privacy is important enough that it is a -founding consideration, not an afterthought.

- -{% endblock %} - -{% block sidebar_right_block %} - - - -{% endblock %} diff --git a/modules/installed/privacy/templates/tor.html b/modules/installed/tor/templates/tor.html similarity index 100% rename from modules/installed/privacy/templates/tor.html rename to modules/installed/tor/templates/tor.html diff --git a/modules/installed/privacy/tor.py b/modules/installed/tor/tor.py similarity index 87% rename from modules/installed/privacy/tor.py rename to modules/installed/tor/tor.py index 404553629..b09daf417 100644 --- a/modules/installed/privacy/tor.py +++ b/modules/installed/tor/tor.py @@ -29,11 +29,12 @@ import util class tor(PagePlugin): - order = 30 # order of running init in PagePlugins + order = 60 # order of running init in PagePlugins def __init__(self, *args, **kwargs): PagePlugin.__init__(self, *args, **kwargs) - self.register_page("privacy.tor") - cfg.html_root.privacy.menu.add_item("Tor", "icon-eye-close", "/privacy/tor", 30) + self.register_page("apps.tor") + cfg.html_root.apps.menu.add_item("Tor", "icon-eye-close", "/apps/tor", + 30) @cherrypy.expose @require() diff --git a/modules/privacy.py b/modules/privacy.py deleted file mode 120000 index 07f303ee7..000000000 --- a/modules/privacy.py +++ /dev/null @@ -1 +0,0 @@ -installed/privacy/privacy.py \ No newline at end of file diff --git a/modules/tor.py b/modules/tor.py index 28c310568..4c888a3a1 120000 --- a/modules/tor.py +++ b/modules/tor.py @@ -1 +1 @@ -installed/privacy/tor.py \ No newline at end of file +installed/tor/tor.py \ No newline at end of file From 11a3cecf0aef564a08cad9623bcf5a14301be4ef Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Sun, 1 Jun 2014 12:46:51 +0530 Subject: [PATCH 09/23] Move XMPP to separate module and present under Apps - Remove Services section --- modules/installed/services/services.py | 17 ----------------- .../templates/xmpp_configure.html | 0 .../templates/xmpp_register.html | 0 modules/installed/{services => xmpp}/xmpp.py | 18 +++++++++++------- modules/services.py | 1 - modules/xmpp.py | 2 +- 6 files changed, 12 insertions(+), 26 deletions(-) delete mode 100644 modules/installed/services/services.py rename modules/installed/{services => xmpp}/templates/xmpp_configure.html (100%) rename modules/installed/{services => xmpp}/templates/xmpp_register.html (100%) rename modules/installed/{services => xmpp}/xmpp.py (93%) delete mode 120000 modules/services.py diff --git a/modules/installed/services/services.py b/modules/installed/services/services.py deleted file mode 100644 index 71485f8d3..000000000 --- a/modules/installed/services/services.py +++ /dev/null @@ -1,17 +0,0 @@ -import cherrypy -from modules.auth import require -from plugin_mount import PagePlugin -import cfg -import util - - -class Services(PagePlugin): - order = 9 # order of running init in PagePlugins - def __init__(self, *args, **kwargs): - PagePlugin.__init__(self, *args, **kwargs) - self.register_page("services") - self.menu = cfg.main_menu.add_item("Services", "icon-list", "/services", 90) - - @cherrypy.expose - def index(self): - raise cherrypy.HTTPRedirect(cfg.server_dir + '/services/xmpp') diff --git a/modules/installed/services/templates/xmpp_configure.html b/modules/installed/xmpp/templates/xmpp_configure.html similarity index 100% rename from modules/installed/services/templates/xmpp_configure.html rename to modules/installed/xmpp/templates/xmpp_configure.html diff --git a/modules/installed/services/templates/xmpp_register.html b/modules/installed/xmpp/templates/xmpp_register.html similarity index 100% rename from modules/installed/services/templates/xmpp_register.html rename to modules/installed/xmpp/templates/xmpp_register.html diff --git a/modules/installed/services/xmpp.py b/modules/installed/xmpp/xmpp.py similarity index 93% rename from modules/installed/services/xmpp.py rename to modules/installed/xmpp/xmpp.py index 767411432..6a65b764c 100644 --- a/modules/installed/services/xmpp.py +++ b/modules/installed/xmpp/xmpp.py @@ -10,19 +10,21 @@ import util SIDE_MENU = {'title': _('XMPP'), - 'items': [{'url': '/services/xmpp/configure', + 'items': [{'url': '/apps/xmpp/configure', 'text': 'Configure XMPP Server'}, - {'url': '/services/xmpp/register', + {'url': '/apps/xmpp/register', 'text': 'Register XMPP Account'}]} class XMPP(PagePlugin): """XMPP Page""" + order = 60 + def __init__(self, *args, **kwargs): PagePlugin.__init__(self, *args, **kwargs) - self.register_page('services.xmpp') - cfg.html_root.services.menu.add_item('XMPP', 'icon-comment', - '/services/xmpp', 40) + self.register_page('apps.xmpp') + cfg.html_root.apps.menu.add_item('XMPP', 'icon-comment', + '/apps/xmpp', 40) self.client_service = service.Service( 'xmpp-client', _('Chat Server - client connections'), @@ -62,10 +64,11 @@ allowed to register an account through an XMPP client')) class Configure(PagePlugin): """Configuration page""" + order = 65 def __init__(self, *args, **kwargs): PagePlugin.__init__(self, *args, **kwargs) - self.register_page("services.xmpp.configure") + self.register_page("apps.xmpp.configure") @cherrypy.expose @require() @@ -143,10 +146,11 @@ class RegisterForm(forms.Form): # pylint: disable-msg=W0232 class Register(PagePlugin): """User registration page""" + order = 65 def __init__(self, *args, **kwargs): PagePlugin.__init__(self, *args, **kwargs) - self.register_page('services.xmpp.register') + self.register_page('apps.xmpp.register') @cherrypy.expose @require() diff --git a/modules/services.py b/modules/services.py deleted file mode 120000 index 806ae4f9f..000000000 --- a/modules/services.py +++ /dev/null @@ -1 +0,0 @@ -installed/services/services.py \ No newline at end of file diff --git a/modules/xmpp.py b/modules/xmpp.py index f31c66cd0..4e0dfe42c 120000 --- a/modules/xmpp.py +++ b/modules/xmpp.py @@ -1 +1 @@ -installed/services/xmpp.py \ No newline at end of file +installed/xmpp/xmpp.py \ No newline at end of file From 2aec96d96c40578df18058615ebd1bbb8c0ac7b2 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Sun, 1 Jun 2014 12:58:51 +0530 Subject: [PATCH 10/23] Move first_boot to separate module --- modules/first_boot.py | 2 +- modules/installed/{ => first_boot}/first_boot.py | 0 .../installed/{ => first_boot}/templates/firstboot_sidebar.html | 0 .../installed/{ => first_boot}/templates/firstboot_state0.html | 0 .../installed/{ => first_boot}/templates/firstboot_state1.html | 0 5 files changed, 1 insertion(+), 1 deletion(-) rename modules/installed/{ => first_boot}/first_boot.py (100%) rename modules/installed/{ => first_boot}/templates/firstboot_sidebar.html (100%) rename modules/installed/{ => first_boot}/templates/firstboot_state0.html (100%) rename modules/installed/{ => first_boot}/templates/firstboot_state1.html (100%) diff --git a/modules/first_boot.py b/modules/first_boot.py index ae5c55471..2003115bb 120000 --- a/modules/first_boot.py +++ b/modules/first_boot.py @@ -1 +1 @@ -installed/first_boot.py \ No newline at end of file +installed/first_boot/first_boot.py \ No newline at end of file diff --git a/modules/installed/first_boot.py b/modules/installed/first_boot/first_boot.py similarity index 100% rename from modules/installed/first_boot.py rename to modules/installed/first_boot/first_boot.py diff --git a/modules/installed/templates/firstboot_sidebar.html b/modules/installed/first_boot/templates/firstboot_sidebar.html similarity index 100% rename from modules/installed/templates/firstboot_sidebar.html rename to modules/installed/first_boot/templates/firstboot_sidebar.html diff --git a/modules/installed/templates/firstboot_state0.html b/modules/installed/first_boot/templates/firstboot_state0.html similarity index 100% rename from modules/installed/templates/firstboot_state0.html rename to modules/installed/first_boot/templates/firstboot_state0.html diff --git a/modules/installed/templates/firstboot_state1.html b/modules/installed/first_boot/templates/firstboot_state1.html similarity index 100% rename from modules/installed/templates/firstboot_state1.html rename to modules/installed/first_boot/templates/firstboot_state1.html From 1b4364b045a8b49081efb7a59b6c8688767347c8 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Sun, 1 Jun 2014 13:07:07 +0530 Subject: [PATCH 11/23] Move firewall to separate module --- modules/firewall.py | 2 +- modules/installed/{system => firewall}/firewall.py | 0 modules/installed/{system => firewall}/templates/firewall.html | 0 3 files changed, 1 insertion(+), 1 deletion(-) rename modules/installed/{system => firewall}/firewall.py (100%) rename modules/installed/{system => firewall}/templates/firewall.html (100%) diff --git a/modules/firewall.py b/modules/firewall.py index 1d198303f..5bb891767 120000 --- a/modules/firewall.py +++ b/modules/firewall.py @@ -1 +1 @@ -installed/system/firewall.py \ No newline at end of file +installed/firewall/firewall.py \ No newline at end of file diff --git a/modules/installed/system/firewall.py b/modules/installed/firewall/firewall.py similarity index 100% rename from modules/installed/system/firewall.py rename to modules/installed/firewall/firewall.py diff --git a/modules/installed/system/templates/firewall.html b/modules/installed/firewall/templates/firewall.html similarity index 100% rename from modules/installed/system/templates/firewall.html rename to modules/installed/firewall/templates/firewall.html From 034745e91ff9f05a72ece426c812c2676b7cbf56 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Sun, 1 Jun 2014 13:11:11 +0530 Subject: [PATCH 12/23] Move ownCloud to separate module --- modules/installed/{apps => owncloud}/owncloud.py | 0 modules/installed/{apps => owncloud}/templates/owncloud.html | 0 modules/owncloud.py | 2 +- 3 files changed, 1 insertion(+), 1 deletion(-) rename modules/installed/{apps => owncloud}/owncloud.py (100%) rename modules/installed/{apps => owncloud}/templates/owncloud.html (100%) diff --git a/modules/installed/apps/owncloud.py b/modules/installed/owncloud/owncloud.py similarity index 100% rename from modules/installed/apps/owncloud.py rename to modules/installed/owncloud/owncloud.py diff --git a/modules/installed/apps/templates/owncloud.html b/modules/installed/owncloud/templates/owncloud.html similarity index 100% rename from modules/installed/apps/templates/owncloud.html rename to modules/installed/owncloud/templates/owncloud.html diff --git a/modules/owncloud.py b/modules/owncloud.py index 4ae17c8be..0fbf23189 120000 --- a/modules/owncloud.py +++ b/modules/owncloud.py @@ -1 +1 @@ -installed/apps/owncloud.py \ No newline at end of file +installed/owncloud/owncloud.py \ No newline at end of file From f0e710a3d86f70887cfd567dec5312bd50a11807 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Sun, 1 Jun 2014 13:24:28 +0530 Subject: [PATCH 13/23] Move PageKite to separate module and present in Apps - Remove Router section --- modules/info.py | 1 - .../{router => pagekite}/pagekite.py | 10 +++---- .../templates/pagekite_configure.html | 0 .../templates/pagekite_introduction.html | 2 +- modules/installed/router/info.py | 21 -------------- modules/installed/router/router.py | 29 ------------------- modules/pagekite.py | 2 +- modules/router.py | 1 - 8 files changed, 7 insertions(+), 59 deletions(-) delete mode 120000 modules/info.py rename modules/installed/{router => pagekite}/pagekite.py (96%) rename modules/installed/{router => pagekite}/templates/pagekite_configure.html (100%) rename modules/installed/{router => pagekite}/templates/pagekite_introduction.html (96%) delete mode 100644 modules/installed/router/info.py delete mode 100644 modules/installed/router/router.py delete mode 120000 modules/router.py diff --git a/modules/info.py b/modules/info.py deleted file mode 120000 index 0cc405209..000000000 --- a/modules/info.py +++ /dev/null @@ -1 +0,0 @@ -installed/router/info.py \ No newline at end of file diff --git a/modules/installed/router/pagekite.py b/modules/installed/pagekite/pagekite.py similarity index 96% rename from modules/installed/router/pagekite.py rename to modules/installed/pagekite/pagekite.py index 72d1da260..5bb4726da 100644 --- a/modules/installed/router/pagekite.py +++ b/modules/installed/pagekite/pagekite.py @@ -38,10 +38,10 @@ class PageKite(PagePlugin): def __init__(self, *args, **kwargs): PagePlugin.__init__(self, *args, **kwargs) - self.register_page("router.pagekite") - cfg.html_root.router.menu.add_item( + self.register_page("apps.pagekite") + cfg.html_root.apps.menu.add_item( _("Public Visibility (PageKite)"), "icon-flag", - "/router/pagekite", 50) + "/apps/pagekite", 50) @staticmethod @cherrypy.expose @@ -51,7 +51,7 @@ class PageKite(PagePlugin): del kwargs # Unused menu = {'title': _('PageKite'), - 'items': [{'url': '/router/pagekite/configure', + 'items': [{'url': '/apps/pagekite/configure', 'text': _('Configure PageKite')}]} sidebar_right = util.render_template(template='menu_block', menu=menu) @@ -112,7 +112,7 @@ class Configure(PagePlugin): # pylint: disable-msg=C0103 def __init__(self, *args, **kwargs): PagePlugin.__init__(self, *args, **kwargs) - self.register_page("router.pagekite.configure") + self.register_page("apps.pagekite.configure") @cherrypy.expose @require() diff --git a/modules/installed/router/templates/pagekite_configure.html b/modules/installed/pagekite/templates/pagekite_configure.html similarity index 100% rename from modules/installed/router/templates/pagekite_configure.html rename to modules/installed/pagekite/templates/pagekite_configure.html diff --git a/modules/installed/router/templates/pagekite_introduction.html b/modules/installed/pagekite/templates/pagekite_introduction.html similarity index 96% rename from modules/installed/router/templates/pagekite_introduction.html rename to modules/installed/pagekite/templates/pagekite_introduction.html index f6619c9a1..f22e1ec35 100644 --- a/modules/installed/router/templates/pagekite_introduction.html +++ b/modules/installed/pagekite/templates/pagekite_introduction.html @@ -49,7 +49,7 @@ there. In future, it might be possible to use your buddy's

Configure + href="{{ basehref }}/apps/pagekite/configure">Configure PageKite

diff --git a/modules/installed/router/info.py b/modules/installed/router/info.py deleted file mode 100644 index cc9c5539a..000000000 --- a/modules/installed/router/info.py +++ /dev/null @@ -1,21 +0,0 @@ -import cherrypy -from plugin_mount import PagePlugin -from modules.auth import require -import util - - -class Info(PagePlugin): - title = 'Info' - order = 10 - url = 'info' - - def __init__(self, *args, **kwargs): - self.register_page("router.info") - - @cherrypy.expose - @require() - def index(self): - return util.render_template(title="Router Information", main=""" -

Eventually we will display a bunch of info, graphs and logs about -the routing functions here.

-""") diff --git a/modules/installed/router/router.py b/modules/installed/router/router.py deleted file mode 100644 index 22ca40107..000000000 --- a/modules/installed/router/router.py +++ /dev/null @@ -1,29 +0,0 @@ -import cherrypy -from django import forms -from gettext import gettext as _ -from plugin_mount import PagePlugin -from modules.auth import require -import cfg -import util - - -class Router(PagePlugin): - """Router page""" - order = 9 # order of running init in PagePlugins - - def __init__(self, *args, **kwargs): - PagePlugin.__init__(self, args, kwargs) - - self.register_page('router') - - self.menu = cfg.main_menu.add_item('Router', 'icon-retweet', '/router', - 10) - - @staticmethod - @cherrypy.expose - def index(): - """This isn't an internal redirect, because we need the url to - reflect that we've moved down into the submenu hierarchy. - Otherwise, it's hard to know which menu portion to make active - or expand or contract.""" - raise cherrypy.HTTPRedirect(cfg.server_dir + '/router/pagekite') diff --git a/modules/pagekite.py b/modules/pagekite.py index 2981955ca..d30c4701f 120000 --- a/modules/pagekite.py +++ b/modules/pagekite.py @@ -1 +1 @@ -installed/router/pagekite.py \ No newline at end of file +installed/pagekite/pagekite.py \ No newline at end of file diff --git a/modules/router.py b/modules/router.py deleted file mode 120000 index 7239c9f3b..000000000 --- a/modules/router.py +++ /dev/null @@ -1 +0,0 @@ -installed/router/router.py \ No newline at end of file From 889bd16f1e459734b237f95805f5fde0d7dc79b1 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Sun, 1 Jun 2014 14:18:34 +0530 Subject: [PATCH 14/23] Move diagnostics to separate module --- modules/diagnostics.py | 2 +- modules/installed/{system => diagnostics}/diagnostics.py | 0 .../{system => diagnostics}/templates/diagnostics.html | 0 .../{system => diagnostics}/templates/diagnostics_test.html | 0 4 files changed, 1 insertion(+), 1 deletion(-) rename modules/installed/{system => diagnostics}/diagnostics.py (100%) rename modules/installed/{system => diagnostics}/templates/diagnostics.html (100%) rename modules/installed/{system => diagnostics}/templates/diagnostics_test.html (100%) diff --git a/modules/diagnostics.py b/modules/diagnostics.py index 31b7abf86..2400f0df8 120000 --- a/modules/diagnostics.py +++ b/modules/diagnostics.py @@ -1 +1 @@ -installed/system/diagnostics.py \ No newline at end of file +installed/diagnostics/diagnostics.py \ No newline at end of file diff --git a/modules/installed/system/diagnostics.py b/modules/installed/diagnostics/diagnostics.py similarity index 100% rename from modules/installed/system/diagnostics.py rename to modules/installed/diagnostics/diagnostics.py diff --git a/modules/installed/system/templates/diagnostics.html b/modules/installed/diagnostics/templates/diagnostics.html similarity index 100% rename from modules/installed/system/templates/diagnostics.html rename to modules/installed/diagnostics/templates/diagnostics.html diff --git a/modules/installed/system/templates/diagnostics_test.html b/modules/installed/diagnostics/templates/diagnostics_test.html similarity index 100% rename from modules/installed/system/templates/diagnostics_test.html rename to modules/installed/diagnostics/templates/diagnostics_test.html From eb403b129b44dbd4f910ea747c47e28642d0d571 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Sun, 1 Jun 2014 14:21:14 +0530 Subject: [PATCH 15/23] Move Packages to separate module --- modules/installed/{system => packages}/packages.py | 0 modules/installed/{system => packages}/templates/packages.html | 0 modules/packages.py | 2 +- 3 files changed, 1 insertion(+), 1 deletion(-) rename modules/installed/{system => packages}/packages.py (100%) rename modules/installed/{system => packages}/templates/packages.html (100%) diff --git a/modules/installed/system/packages.py b/modules/installed/packages/packages.py similarity index 100% rename from modules/installed/system/packages.py rename to modules/installed/packages/packages.py diff --git a/modules/installed/system/templates/packages.html b/modules/installed/packages/templates/packages.html similarity index 100% rename from modules/installed/system/templates/packages.html rename to modules/installed/packages/templates/packages.html diff --git a/modules/packages.py b/modules/packages.py index fa4dedfc6..8c473f1ac 120000 --- a/modules/packages.py +++ b/modules/packages.py @@ -1 +1 @@ -installed/system/packages.py \ No newline at end of file +installed/packages/packages.py \ No newline at end of file From 1aaa930a1f6a39175b6fb8418603f78e9f857c50 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Sun, 1 Jun 2014 14:28:49 +0530 Subject: [PATCH 16/23] Move expert_mode to separate module - Move one level up in menu --- modules/expert_mode.py | 2 +- modules/installed/{system => expert_mode}/expert_mode.py | 6 +++--- .../{system => expert_mode}/templates/expert_mode.html | 0 3 files changed, 4 insertions(+), 4 deletions(-) rename modules/installed/{system => expert_mode}/expert_mode.py (92%) rename modules/installed/{system => expert_mode}/templates/expert_mode.html (100%) diff --git a/modules/expert_mode.py b/modules/expert_mode.py index aaa140ed1..2dbc00d05 120000 --- a/modules/expert_mode.py +++ b/modules/expert_mode.py @@ -1 +1 @@ -installed/system/expert_mode.py \ No newline at end of file +installed/expert_mode/expert_mode.py \ No newline at end of file diff --git a/modules/installed/system/expert_mode.py b/modules/installed/expert_mode/expert_mode.py similarity index 92% rename from modules/installed/system/expert_mode.py rename to modules/installed/expert_mode/expert_mode.py index 041ce0793..19ee30f0d 100644 --- a/modules/installed/system/expert_mode.py +++ b/modules/installed/expert_mode/expert_mode.py @@ -24,10 +24,10 @@ class Experts(PagePlugin): def __init__(self, *args, **kwargs): PagePlugin.__init__(self, *args, **kwargs) - self.register_page('sys.config.expert') + self.register_page('sys.expert') - cfg.html_root.sys.config.menu.add_item(_('Expert mode'), 'icon-cog', - '/sys/config/expert', 10) + cfg.html_root.sys.menu.add_item(_('Expert Mode'), 'icon-cog', + '/sys/expert', 10) @cherrypy.expose @require() diff --git a/modules/installed/system/templates/expert_mode.html b/modules/installed/expert_mode/templates/expert_mode.html similarity index 100% rename from modules/installed/system/templates/expert_mode.html rename to modules/installed/expert_mode/templates/expert_mode.html From ef01d89b0b2b9cb5d6c2c32249f6a22ea817c4f3 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Sun, 1 Jun 2014 14:38:10 +0530 Subject: [PATCH 17/23] Move users to separate module --- modules/installed/{system => users}/templates/users_add.html | 0 modules/installed/{system => users}/templates/users_edit.html | 0 modules/installed/{system => users}/users.py | 0 modules/users.py | 2 +- 4 files changed, 1 insertion(+), 1 deletion(-) rename modules/installed/{system => users}/templates/users_add.html (100%) rename modules/installed/{system => users}/templates/users_edit.html (100%) rename modules/installed/{system => users}/users.py (100%) diff --git a/modules/installed/system/templates/users_add.html b/modules/installed/users/templates/users_add.html similarity index 100% rename from modules/installed/system/templates/users_add.html rename to modules/installed/users/templates/users_add.html diff --git a/modules/installed/system/templates/users_edit.html b/modules/installed/users/templates/users_edit.html similarity index 100% rename from modules/installed/system/templates/users_edit.html rename to modules/installed/users/templates/users_edit.html diff --git a/modules/installed/system/users.py b/modules/installed/users/users.py similarity index 100% rename from modules/installed/system/users.py rename to modules/installed/users/users.py diff --git a/modules/users.py b/modules/users.py index 4b7ce2010..f807cf4fc 120000 --- a/modules/users.py +++ b/modules/users.py @@ -1 +1 @@ -installed/system/users.py \ No newline at end of file +installed/users/users.py \ No newline at end of file From 64fa4189a9c785ab1a9c269a6b2b00b4031b85ff Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Sun, 1 Jun 2014 14:46:36 +0530 Subject: [PATCH 18/23] Redirect to /apps instead of /router after login and firstboot --- modules/installed/first_boot/templates/firstboot_state1.html | 2 +- plinth.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/installed/first_boot/templates/firstboot_state1.html b/modules/installed/first_boot/templates/firstboot_state1.html index 5ea907ff9..7a40fcf1e 100644 --- a/modules/installed/first_boot/templates/firstboot_state1.html +++ b/modules/installed/first_boot/templates/firstboot_state1.html @@ -23,7 +23,7 @@ {% block main_block %}

Welcome screen not completely implemented yet. Press continue to see the rest of the + href="{{basehref }}/apps">continue to see the rest of the web interface.

    diff --git a/plinth.py b/plinth.py index b5b5af526..7a7eb94f6 100755 --- a/plinth.py +++ b/plinth.py @@ -70,7 +70,7 @@ class Root(plugin_mount.PagePlugin): cfg.log("First Boot state = %d" % db['state']) raise cherrypy.InternalRedirect('firstboot/state%d' % db['state']) if cherrypy.session.get(cfg.session_key, None): - raise cherrypy.InternalRedirect('router') + raise cherrypy.InternalRedirect('apps') else: raise cherrypy.InternalRedirect('help/about') From 58109eff5f9069925f846b109cb38426a6ace82d Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Sun, 1 Jun 2014 23:11:54 +0530 Subject: [PATCH 19/23] Don't allow firstboot after completion of firstboot Without this it would be possible to run firstboot at any time and create fresh plinth accounts --- modules/installed/first_boot/first_boot.py | 31 +++++++++++++++------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/modules/installed/first_boot/first_boot.py b/modules/installed/first_boot/first_boot.py index 8fdde7b31..7bd616ca3 100644 --- a/modules/installed/first_boot/first_boot.py +++ b/modules/installed/first_boot/first_boot.py @@ -100,8 +100,12 @@ class FirstBoot(PagePlugin): message is an optional string that we can display to the user. It's a good place to put error messages. """ + try: + if FirstBoot._read_state() >= 5: + raise cherrypy.HTTPRedirect(cfg.server_dir, 302) + except KeyError: + pass - # FIXME: reject connection attempt if db["state"] >= 5. ## Until LDAP is in place, we'll put the box key in the cfg.store_file status = self.get_state0() @@ -117,11 +121,8 @@ class FirstBoot(PagePlugin): if success: # Everything is good, permanently mark and move to page 2 - with sqlite_db(cfg.store_file, table="firstboot", - autocommit=True) as database: - database['state'] = 1 - - raise cherrypy.InternalRedirect('state1') + FirstBoot._write_state(1) + raise cherrypy.HTTPRedirect('state1', 302) else: form = State0Form(initial=status, prefix='firstboot') @@ -176,9 +177,21 @@ class FirstBoot(PagePlugin): """ # TODO complete first_boot handling # Make sure the user is not stuck on a dead end for now. - with sqlite_db(cfg.store_file, table='firstboot', autocommit=True) as \ - database: - database['state'] = 5 + FirstBoot._write_state(5) return util.render_template(template='firstboot_state1', title=_('Installing the Certificate')) + + @staticmethod + def _read_state(): + """Read the current state from database""" + with sqlite_db(cfg.store_file, table='firstboot', + autocommit=True) as database: + return database['state'] + + @staticmethod + def _write_state(state): + """Write state to database""" + with sqlite_db(cfg.store_file, table='firstboot', + autocommit=True) as database: + database['state'] = state From 8d5e976b841f4629eeaa05c0bc815ca1b4b4179f Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Tue, 3 Jun 2014 19:51:21 +0530 Subject: [PATCH 20/23] Move system/config to separate module --- modules/config.py | 2 +- modules/installed/{system => config}/config.py | 0 modules/installed/{system => config}/templates/config.html | 0 3 files changed, 1 insertion(+), 1 deletion(-) rename modules/installed/{system => config}/config.py (100%) rename modules/installed/{system => config}/templates/config.html (100%) diff --git a/modules/config.py b/modules/config.py index 2e37164c3..a7104c23d 120000 --- a/modules/config.py +++ b/modules/config.py @@ -1 +1 @@ -installed/system/config.py \ No newline at end of file +installed/config/config.py \ No newline at end of file diff --git a/modules/installed/system/config.py b/modules/installed/config/config.py similarity index 100% rename from modules/installed/system/config.py rename to modules/installed/config/config.py diff --git a/modules/installed/system/templates/config.html b/modules/installed/config/templates/config.html similarity index 100% rename from modules/installed/system/templates/config.html rename to modules/installed/config/templates/config.html From 912c5022cadf170003d966a75aaf472a9b088a36 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Fri, 6 Jun 2014 12:01:08 +0530 Subject: [PATCH 21/23] Module is a directory instead of file - Move enabled module symlinks to 'modules/enabled' directory. - Make all modules properly importable - Import modules instead of their symlinks --- modules/apps.py | 1 - modules/auth.py | 1 - modules/auth_page.py | 1 - modules/config.py | 1 - modules/diagnostics.py | 1 - modules/enabled/apps | 1 + modules/enabled/config | 1 + modules/enabled/diagnostics | 1 + modules/enabled/expert_mode | 1 + modules/enabled/firewall | 1 + modules/enabled/first_boot | 1 + modules/enabled/help | 1 + modules/enabled/lib | 1 + modules/enabled/owncloud | 1 + modules/enabled/packages | 1 + modules/enabled/pagekite | 1 + modules/enabled/system | 1 + modules/enabled/tor | 1 + modules/enabled/users | 1 + modules/enabled/xmpp | 1 + modules/expert_mode.py | 1 - modules/firewall.py | 1 - modules/first_boot.py | 1 - modules/help.py | 1 - modules/installed/__init__.py | 0 modules/installed/apps/__init__.py | 25 +++++++++++++ modules/installed/apps/apps.py | 1 - modules/installed/config/__init__.py | 25 +++++++++++++ modules/installed/config/config.py | 2 +- modules/installed/diagnostics/__init__.py | 25 +++++++++++++ modules/installed/diagnostics/diagnostics.py | 2 +- modules/installed/expert_mode/__init__.py | 25 +++++++++++++ modules/installed/expert_mode/expert_mode.py | 2 +- modules/installed/firewall/__init__.py | 25 +++++++++++++ modules/installed/firewall/firewall.py | 2 +- modules/installed/first_boot/__init__.py | 25 +++++++++++++ modules/installed/first_boot/first_boot.py | 4 +- modules/installed/help/__init__.py | 25 +++++++++++++ modules/installed/lib/__init__.py | 29 +++++++++++++++ modules/installed/owncloud/__init__.py | 25 +++++++++++++ modules/installed/owncloud/owncloud.py | 2 +- modules/installed/packages/__init__.py | 25 +++++++++++++ modules/installed/packages/packages.py | 2 +- modules/installed/pagekite/__init__.py | 25 +++++++++++++ modules/installed/pagekite/pagekite.py | 2 +- modules/installed/santiago/__init__.py | 25 +++++++++++++ modules/installed/system/__init__.py | 25 +++++++++++++ modules/installed/tor/__init__.py | 25 +++++++++++++ modules/installed/tor/tor.py | 2 +- modules/installed/users/__init__.py | 25 +++++++++++++ modules/installed/users/users.py | 7 ++-- modules/installed/xmpp/__init__.py | 25 +++++++++++++ modules/installed/xmpp/xmpp.py | 2 +- modules/owncloud.py | 1 - modules/packages.py | 1 - modules/pagekite.py | 1 - modules/system.py | 1 - modules/tor.py | 1 - modules/user_store.py | 1 - modules/users.py | 1 - modules/xmpp.py | 1 - plinth.py | 39 ++++++++++---------- plugin_mount.py | 3 -- 63 files changed, 452 insertions(+), 56 deletions(-) delete mode 120000 modules/apps.py delete mode 120000 modules/auth.py delete mode 120000 modules/auth_page.py delete mode 120000 modules/config.py delete mode 120000 modules/diagnostics.py create mode 120000 modules/enabled/apps create mode 120000 modules/enabled/config create mode 120000 modules/enabled/diagnostics create mode 120000 modules/enabled/expert_mode create mode 120000 modules/enabled/firewall create mode 120000 modules/enabled/first_boot create mode 120000 modules/enabled/help create mode 120000 modules/enabled/lib create mode 120000 modules/enabled/owncloud create mode 120000 modules/enabled/packages create mode 120000 modules/enabled/pagekite create mode 120000 modules/enabled/system create mode 120000 modules/enabled/tor create mode 120000 modules/enabled/users create mode 120000 modules/enabled/xmpp delete mode 120000 modules/expert_mode.py delete mode 120000 modules/firewall.py delete mode 120000 modules/first_boot.py delete mode 120000 modules/help.py create mode 100644 modules/installed/__init__.py create mode 100644 modules/installed/apps/__init__.py create mode 100644 modules/installed/config/__init__.py create mode 100644 modules/installed/diagnostics/__init__.py create mode 100644 modules/installed/expert_mode/__init__.py create mode 100644 modules/installed/firewall/__init__.py create mode 100644 modules/installed/first_boot/__init__.py create mode 100644 modules/installed/help/__init__.py create mode 100644 modules/installed/lib/__init__.py create mode 100644 modules/installed/owncloud/__init__.py create mode 100644 modules/installed/packages/__init__.py create mode 100644 modules/installed/pagekite/__init__.py create mode 100644 modules/installed/santiago/__init__.py create mode 100644 modules/installed/system/__init__.py create mode 100644 modules/installed/tor/__init__.py create mode 100644 modules/installed/users/__init__.py create mode 100644 modules/installed/xmpp/__init__.py delete mode 120000 modules/owncloud.py delete mode 120000 modules/packages.py delete mode 120000 modules/pagekite.py delete mode 120000 modules/system.py delete mode 120000 modules/tor.py delete mode 120000 modules/user_store.py delete mode 120000 modules/users.py delete mode 120000 modules/xmpp.py diff --git a/modules/apps.py b/modules/apps.py deleted file mode 120000 index d69ec8059..000000000 --- a/modules/apps.py +++ /dev/null @@ -1 +0,0 @@ -installed/apps/apps.py \ No newline at end of file diff --git a/modules/auth.py b/modules/auth.py deleted file mode 120000 index 7a4c6eccd..000000000 --- a/modules/auth.py +++ /dev/null @@ -1 +0,0 @@ -installed/lib/auth.py \ No newline at end of file diff --git a/modules/auth_page.py b/modules/auth_page.py deleted file mode 120000 index 7ce3ca22a..000000000 --- a/modules/auth_page.py +++ /dev/null @@ -1 +0,0 @@ -installed/lib/auth_page.py \ No newline at end of file diff --git a/modules/config.py b/modules/config.py deleted file mode 120000 index a7104c23d..000000000 --- a/modules/config.py +++ /dev/null @@ -1 +0,0 @@ -installed/config/config.py \ No newline at end of file diff --git a/modules/diagnostics.py b/modules/diagnostics.py deleted file mode 120000 index 2400f0df8..000000000 --- a/modules/diagnostics.py +++ /dev/null @@ -1 +0,0 @@ -installed/diagnostics/diagnostics.py \ No newline at end of file diff --git a/modules/enabled/apps b/modules/enabled/apps new file mode 120000 index 000000000..1e5ce6875 --- /dev/null +++ b/modules/enabled/apps @@ -0,0 +1 @@ +../installed/apps/ \ No newline at end of file diff --git a/modules/enabled/config b/modules/enabled/config new file mode 120000 index 000000000..95f5d5d11 --- /dev/null +++ b/modules/enabled/config @@ -0,0 +1 @@ +../installed/config/ \ No newline at end of file diff --git a/modules/enabled/diagnostics b/modules/enabled/diagnostics new file mode 120000 index 000000000..7575508ad --- /dev/null +++ b/modules/enabled/diagnostics @@ -0,0 +1 @@ +../installed/diagnostics/ \ No newline at end of file diff --git a/modules/enabled/expert_mode b/modules/enabled/expert_mode new file mode 120000 index 000000000..899eb7ef1 --- /dev/null +++ b/modules/enabled/expert_mode @@ -0,0 +1 @@ +../installed/expert_mode/ \ No newline at end of file diff --git a/modules/enabled/firewall b/modules/enabled/firewall new file mode 120000 index 000000000..fa24d8415 --- /dev/null +++ b/modules/enabled/firewall @@ -0,0 +1 @@ +../installed/firewall/ \ No newline at end of file diff --git a/modules/enabled/first_boot b/modules/enabled/first_boot new file mode 120000 index 000000000..ffd4685cc --- /dev/null +++ b/modules/enabled/first_boot @@ -0,0 +1 @@ +../installed/first_boot/ \ No newline at end of file diff --git a/modules/enabled/help b/modules/enabled/help new file mode 120000 index 000000000..7f4f221a6 --- /dev/null +++ b/modules/enabled/help @@ -0,0 +1 @@ +../installed/help/ \ No newline at end of file diff --git a/modules/enabled/lib b/modules/enabled/lib new file mode 120000 index 000000000..7cd28ddb5 --- /dev/null +++ b/modules/enabled/lib @@ -0,0 +1 @@ +../installed/lib/ \ No newline at end of file diff --git a/modules/enabled/owncloud b/modules/enabled/owncloud new file mode 120000 index 000000000..63da55329 --- /dev/null +++ b/modules/enabled/owncloud @@ -0,0 +1 @@ +../installed/owncloud/ \ No newline at end of file diff --git a/modules/enabled/packages b/modules/enabled/packages new file mode 120000 index 000000000..b6441c789 --- /dev/null +++ b/modules/enabled/packages @@ -0,0 +1 @@ +../installed/packages/ \ No newline at end of file diff --git a/modules/enabled/pagekite b/modules/enabled/pagekite new file mode 120000 index 000000000..e19e08de2 --- /dev/null +++ b/modules/enabled/pagekite @@ -0,0 +1 @@ +../installed/pagekite/ \ No newline at end of file diff --git a/modules/enabled/system b/modules/enabled/system new file mode 120000 index 000000000..e47f3142b --- /dev/null +++ b/modules/enabled/system @@ -0,0 +1 @@ +../installed/system/ \ No newline at end of file diff --git a/modules/enabled/tor b/modules/enabled/tor new file mode 120000 index 000000000..62dc28af9 --- /dev/null +++ b/modules/enabled/tor @@ -0,0 +1 @@ +../installed/tor/ \ No newline at end of file diff --git a/modules/enabled/users b/modules/enabled/users new file mode 120000 index 000000000..8f8a47d96 --- /dev/null +++ b/modules/enabled/users @@ -0,0 +1 @@ +../installed/users/ \ No newline at end of file diff --git a/modules/enabled/xmpp b/modules/enabled/xmpp new file mode 120000 index 000000000..726e67c0e --- /dev/null +++ b/modules/enabled/xmpp @@ -0,0 +1 @@ +../installed/xmpp/ \ No newline at end of file diff --git a/modules/expert_mode.py b/modules/expert_mode.py deleted file mode 120000 index 2dbc00d05..000000000 --- a/modules/expert_mode.py +++ /dev/null @@ -1 +0,0 @@ -installed/expert_mode/expert_mode.py \ No newline at end of file diff --git a/modules/firewall.py b/modules/firewall.py deleted file mode 120000 index 5bb891767..000000000 --- a/modules/firewall.py +++ /dev/null @@ -1 +0,0 @@ -installed/firewall/firewall.py \ No newline at end of file diff --git a/modules/first_boot.py b/modules/first_boot.py deleted file mode 120000 index 2003115bb..000000000 --- a/modules/first_boot.py +++ /dev/null @@ -1 +0,0 @@ -installed/first_boot/first_boot.py \ No newline at end of file diff --git a/modules/help.py b/modules/help.py deleted file mode 120000 index 3fc0799d2..000000000 --- a/modules/help.py +++ /dev/null @@ -1 +0,0 @@ -installed/help/help.py \ No newline at end of file diff --git a/modules/installed/__init__.py b/modules/installed/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/modules/installed/apps/__init__.py b/modules/installed/apps/__init__.py new file mode 100644 index 000000000..bf5f66418 --- /dev/null +++ b/modules/installed/apps/__init__.py @@ -0,0 +1,25 @@ +# +# This file is part of Plinth. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +""" +Plinth module for apps section page +""" + +from . import apps + + +__all__ = ['apps'] diff --git a/modules/installed/apps/apps.py b/modules/installed/apps/apps.py index 521aa29c2..05bb7fad3 100644 --- a/modules/installed/apps/apps.py +++ b/modules/installed/apps/apps.py @@ -1,6 +1,5 @@ import cherrypy from gettext import gettext as _ -from modules.auth import require from plugin_mount import PagePlugin import cfg import util diff --git a/modules/installed/config/__init__.py b/modules/installed/config/__init__.py new file mode 100644 index 000000000..aface4101 --- /dev/null +++ b/modules/installed/config/__init__.py @@ -0,0 +1,25 @@ +# +# This file is part of Plinth. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +""" +Plinth module for basic system configuration +""" + +from . import config + + +__all__ = ['config'] diff --git a/modules/installed/config/config.py b/modules/installed/config/config.py index 808681f2e..bda9dd2de 100644 --- a/modules/installed/config/config.py +++ b/modules/installed/config/config.py @@ -28,7 +28,7 @@ import socket import actions import cfg -from modules.auth import require +from ..lib.auth import require from plugin_mount import PagePlugin import util diff --git a/modules/installed/diagnostics/__init__.py b/modules/installed/diagnostics/__init__.py new file mode 100644 index 000000000..8c01bd990 --- /dev/null +++ b/modules/installed/diagnostics/__init__.py @@ -0,0 +1,25 @@ +# +# This file is part of Plinth. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +""" +Plinth module to system diagnostics +""" + +from . import diagnostics + + +__all__ = ['diagnostics'] diff --git a/modules/installed/diagnostics/diagnostics.py b/modules/installed/diagnostics/diagnostics.py index db05738a2..e82de7d11 100644 --- a/modules/installed/diagnostics/diagnostics.py +++ b/modules/installed/diagnostics/diagnostics.py @@ -21,7 +21,7 @@ Plinth module for running diagnostics import cherrypy from gettext import gettext as _ -from auth import require +from ..lib.auth import require from plugin_mount import PagePlugin import actions import cfg diff --git a/modules/installed/expert_mode/__init__.py b/modules/installed/expert_mode/__init__.py new file mode 100644 index 000000000..c638fd55e --- /dev/null +++ b/modules/installed/expert_mode/__init__.py @@ -0,0 +1,25 @@ +# +# This file is part of Plinth. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +""" +Plinth module for expert mode configuration +""" + +from . import expert_mode + + +__all__ = ['expert_mode'] diff --git a/modules/installed/expert_mode/expert_mode.py b/modules/installed/expert_mode/expert_mode.py index 19ee30f0d..50c2811e6 100644 --- a/modules/installed/expert_mode/expert_mode.py +++ b/modules/installed/expert_mode/expert_mode.py @@ -1,7 +1,7 @@ import cherrypy from django import forms from gettext import gettext as _ -from modules.auth import require +from ..lib.auth import require from plugin_mount import PagePlugin import cfg import util diff --git a/modules/installed/firewall/__init__.py b/modules/installed/firewall/__init__.py new file mode 100644 index 000000000..33eb5d302 --- /dev/null +++ b/modules/installed/firewall/__init__.py @@ -0,0 +1,25 @@ +# +# This file is part of Plinth. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +""" +Plinth module to configure a firewall +""" + +from . import firewall + + +__all__ = ['firewall'] diff --git a/modules/installed/firewall/firewall.py b/modules/installed/firewall/firewall.py index e736627f1..ebdbf67a7 100644 --- a/modules/installed/firewall/firewall.py +++ b/modules/installed/firewall/firewall.py @@ -24,7 +24,7 @@ from gettext import gettext as _ import actions import cfg -from modules.auth import require +from ..lib.auth import require from plugin_mount import PagePlugin import service as service_module import util diff --git a/modules/installed/first_boot/__init__.py b/modules/installed/first_boot/__init__.py new file mode 100644 index 000000000..20e972dae --- /dev/null +++ b/modules/installed/first_boot/__init__.py @@ -0,0 +1,25 @@ +# +# This file is part of Plinth. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +""" +Plinth module for first boot wizard +""" + +from . import first_boot + + +__all__ = ['first_boot'] diff --git a/modules/installed/first_boot/first_boot.py b/modules/installed/first_boot/first_boot.py index 7bd616ca3..7bcf98e27 100644 --- a/modules/installed/first_boot/first_boot.py +++ b/modules/installed/first_boot/first_boot.py @@ -23,10 +23,10 @@ from django import forms from django.core import validators from gettext import gettext as _ from plugin_mount import PagePlugin -from modules.auth import add_user +from ..lib.auth import add_user +from ..config import config from withsqlite.withsqlite import sqlite_db import cfg -import config import util diff --git a/modules/installed/help/__init__.py b/modules/installed/help/__init__.py new file mode 100644 index 000000000..9ef609e2d --- /dev/null +++ b/modules/installed/help/__init__.py @@ -0,0 +1,25 @@ +# +# This file is part of Plinth. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +""" +Plinth module for help pages +""" + +from . import help # pylint: disable-msg=W0622 + + +__all__ = ['help'] diff --git a/modules/installed/lib/__init__.py b/modules/installed/lib/__init__.py new file mode 100644 index 000000000..ab399cd3f --- /dev/null +++ b/modules/installed/lib/__init__.py @@ -0,0 +1,29 @@ +# +# This file is part of Plinth. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +""" +Plinth library modules +""" + +from . import auth +from . import auth_page +from . import user_store + + +__all__ = ['auth', + 'auth_page', + 'user_store'] diff --git a/modules/installed/owncloud/__init__.py b/modules/installed/owncloud/__init__.py new file mode 100644 index 000000000..544b2ebc7 --- /dev/null +++ b/modules/installed/owncloud/__init__.py @@ -0,0 +1,25 @@ +# +# This file is part of Plinth. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +""" +Plinth module to configure ownCloud +""" + +from . import owncloud + + +__all__ = ['owncloud'] diff --git a/modules/installed/owncloud/owncloud.py b/modules/installed/owncloud/owncloud.py index 7ed4dfcdb..535ba019b 100644 --- a/modules/installed/owncloud/owncloud.py +++ b/modules/installed/owncloud/owncloud.py @@ -1,7 +1,7 @@ import cherrypy from django import forms from gettext import gettext as _ -from modules.auth import require +from ..lib.auth import require from plugin_mount import PagePlugin import actions import cfg diff --git a/modules/installed/packages/__init__.py b/modules/installed/packages/__init__.py new file mode 100644 index 000000000..f84ac44c1 --- /dev/null +++ b/modules/installed/packages/__init__.py @@ -0,0 +1,25 @@ +# +# This file is part of Plinth. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +""" +Plinth module to manage packages +""" + +from . import packages + + +__all__ = ['packages'] diff --git a/modules/installed/packages/packages.py b/modules/installed/packages/packages.py index 63df8cab0..89fe69676 100644 --- a/modules/installed/packages/packages.py +++ b/modules/installed/packages/packages.py @@ -1,7 +1,7 @@ import cherrypy from django import forms from gettext import gettext as _ -from auth import require +from ..lib.auth import require from plugin_mount import PagePlugin import actions import cfg diff --git a/modules/installed/pagekite/__init__.py b/modules/installed/pagekite/__init__.py new file mode 100644 index 000000000..fa247ab25 --- /dev/null +++ b/modules/installed/pagekite/__init__.py @@ -0,0 +1,25 @@ +# +# This file is part of Plinth. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +""" +Plinth module to configure PageKite +""" + +from . import pagekite + + +__all__ = ['pagekite'] diff --git a/modules/installed/pagekite/pagekite.py b/modules/installed/pagekite/pagekite.py index 5bb4726da..cc7791a2d 100644 --- a/modules/installed/pagekite/pagekite.py +++ b/modules/installed/pagekite/pagekite.py @@ -26,7 +26,7 @@ from gettext import gettext as _ import actions import cfg -from modules.auth import require +from ..lib.auth import require from plugin_mount import PagePlugin import util diff --git a/modules/installed/santiago/__init__.py b/modules/installed/santiago/__init__.py new file mode 100644 index 000000000..abe7409d6 --- /dev/null +++ b/modules/installed/santiago/__init__.py @@ -0,0 +1,25 @@ +# +# This file is part of Plinth. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +""" +Plinth module to configure santiago port +""" + +from . import santiago + + +__all__ = ['santiago'] diff --git a/modules/installed/system/__init__.py b/modules/installed/system/__init__.py new file mode 100644 index 000000000..bd46fa10c --- /dev/null +++ b/modules/installed/system/__init__.py @@ -0,0 +1,25 @@ +# +# This file is part of Plinth. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +""" +Plinth module for system section page +""" + +from . import system + + +__all__ = ['system'] diff --git a/modules/installed/tor/__init__.py b/modules/installed/tor/__init__.py new file mode 100644 index 000000000..4b42293f9 --- /dev/null +++ b/modules/installed/tor/__init__.py @@ -0,0 +1,25 @@ +# +# This file is part of Plinth. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +""" +Plinth module to configure Tor +""" + +from . import tor + + +__all__ = ['tor'] diff --git a/modules/installed/tor/tor.py b/modules/installed/tor/tor.py index b09daf417..9e64240f8 100644 --- a/modules/installed/tor/tor.py +++ b/modules/installed/tor/tor.py @@ -22,7 +22,7 @@ Plinth module for configuring Tor import cherrypy from gettext import gettext as _ from plugin_mount import PagePlugin -from modules.auth import require +from ..lib.auth import require import actions import cfg import util diff --git a/modules/installed/users/__init__.py b/modules/installed/users/__init__.py new file mode 100644 index 000000000..7cb056bb5 --- /dev/null +++ b/modules/installed/users/__init__.py @@ -0,0 +1,25 @@ +# +# This file is part of Plinth. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +""" +Plinth module to manage users +""" + +from . import users + + +__all__ = ['users'] diff --git a/modules/installed/users/users.py b/modules/installed/users/users.py index 1b7550405..5722271b7 100644 --- a/modules/installed/users/users.py +++ b/modules/installed/users/users.py @@ -2,8 +2,7 @@ import cherrypy from django import forms from django.core import validators from gettext import gettext as _ -import auth -from auth import require +from ..lib.auth import require, add_user from plugin_mount import PagePlugin import cfg from model import User @@ -86,8 +85,8 @@ class UserAdd(PagePlugin): username=data['username']))) return - auth.add_user(data['username'], data['password'], data['full_name'], - data['email'], False) + add_user(data['username'], data['password'], data['full_name'], + data['email'], False) messages.append( ('success', _('User "{username}" added').format( username=data['username']))) diff --git a/modules/installed/xmpp/__init__.py b/modules/installed/xmpp/__init__.py new file mode 100644 index 000000000..a55e739c3 --- /dev/null +++ b/modules/installed/xmpp/__init__.py @@ -0,0 +1,25 @@ +# +# This file is part of Plinth. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +""" +Plinth module to configure XMPP server +""" + +from . import xmpp + + +__all__ = ['xmpp'] diff --git a/modules/installed/xmpp/xmpp.py b/modules/installed/xmpp/xmpp.py index 6a65b764c..ab80118c2 100644 --- a/modules/installed/xmpp/xmpp.py +++ b/modules/installed/xmpp/xmpp.py @@ -1,7 +1,7 @@ import cherrypy from django import forms from gettext import gettext as _ -from modules.auth import require +from ..lib.auth import require from plugin_mount import PagePlugin import cfg import actions diff --git a/modules/owncloud.py b/modules/owncloud.py deleted file mode 120000 index 0fbf23189..000000000 --- a/modules/owncloud.py +++ /dev/null @@ -1 +0,0 @@ -installed/owncloud/owncloud.py \ No newline at end of file diff --git a/modules/packages.py b/modules/packages.py deleted file mode 120000 index 8c473f1ac..000000000 --- a/modules/packages.py +++ /dev/null @@ -1 +0,0 @@ -installed/packages/packages.py \ No newline at end of file diff --git a/modules/pagekite.py b/modules/pagekite.py deleted file mode 120000 index d30c4701f..000000000 --- a/modules/pagekite.py +++ /dev/null @@ -1 +0,0 @@ -installed/pagekite/pagekite.py \ No newline at end of file diff --git a/modules/system.py b/modules/system.py deleted file mode 120000 index 6eddf3e2d..000000000 --- a/modules/system.py +++ /dev/null @@ -1 +0,0 @@ -installed/system/system.py \ No newline at end of file diff --git a/modules/tor.py b/modules/tor.py deleted file mode 120000 index 4c888a3a1..000000000 --- a/modules/tor.py +++ /dev/null @@ -1 +0,0 @@ -installed/tor/tor.py \ No newline at end of file diff --git a/modules/user_store.py b/modules/user_store.py deleted file mode 120000 index 09e8f90fe..000000000 --- a/modules/user_store.py +++ /dev/null @@ -1 +0,0 @@ -installed/lib/user_store.py \ No newline at end of file diff --git a/modules/users.py b/modules/users.py deleted file mode 120000 index f807cf4fc..000000000 --- a/modules/users.py +++ /dev/null @@ -1 +0,0 @@ -installed/users/users.py \ No newline at end of file diff --git a/modules/xmpp.py b/modules/xmpp.py deleted file mode 120000 index 4e0dfe42c..000000000 --- a/modules/xmpp.py +++ /dev/null @@ -1 +0,0 @@ -installed/xmpp/xmpp.py \ No newline at end of file diff --git a/plinth.py b/plinth.py index 7a7eb94f6..ee3dd1571 100755 --- a/plinth.py +++ b/plinth.py @@ -4,8 +4,10 @@ import os, stat, sys, argparse from gettext import gettext as _ import cfg import django.conf +import importlib if not os.path.join(cfg.file_root, "vendor") in sys.path: sys.path.append(os.path.join(cfg.file_root, "vendor")) +import re import cherrypy from cherrypy import _cpserver @@ -74,20 +76,21 @@ class Root(plugin_mount.PagePlugin): else: raise cherrypy.InternalRedirect('help/about') + def load_modules(): - """Import all the symlinked .py files in the modules directory and - all the .py files in directories linked in the modules directory - (but don't dive deeper than that). Also, ignore the installed - directory.""" - for name in os.listdir("modules"): - if name.endswith(".py") and not name.startswith('.'): - cfg.log.info("importing modules/%s" % name) - try: - __import__("modules.%s" % (name[:-3])) - except ImportError, e: - cfg.log.error(_("Couldn't import modules/%s: %s") % (name, e)) - else: - cfg.log("skipping %s" % name) + """ + Read names of enabled modules in modules/enabled directory and + import them from modules/installed directory. + """ + for name in os.listdir('modules/enabled'): + cfg.log.info('Importing modules/installed/%s' % name) + try: + importlib.import_module( + 'modules.installed.{module}'.format(module=name)) + except ImportError as exception: + cfg.log.error( + 'Could not import modules/installed/{module}: {exception}' + .format(module=name, exception=exception)) def get_template_directories(): @@ -96,13 +99,9 @@ def get_template_directories(): core_directory = os.path.join(directory, 'templates') directories = set((core_directory,)) - for name in os.listdir('modules'): - if not name.endswith(".py") or name.startswith('.'): - continue - - real_name = os.path.realpath(os.path.join('modules', name)) - directory = os.path.dirname(real_name) - directories.add(os.path.join(directory, 'templates')) + for name in os.listdir('modules/enabled'): + directories.add(os.path.join('modules', 'installed', name, + 'templates')) cfg.log.info('Template directories - %s' % directories) diff --git a/plugin_mount.py b/plugin_mount.py index e3ef5db41..38ac1e313 100644 --- a/plugin_mount.py +++ b/plugin_mount.py @@ -1,7 +1,4 @@ -import cherrypy -from modules.auth import require import cfg -import util class PluginMount(type): From 37206f1e83a61fc950ee97f0e84d1a1dc09ec0a6 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Fri, 6 Jun 2014 12:14:17 +0530 Subject: [PATCH 22/23] Move all modules from 'modules/installed' to 'modules' directory --- modules/{installed => }/apps/__init__.py | 0 modules/{installed => }/apps/apps.py | 0 modules/{installed => }/apps/templates/apps.html | 0 modules/{installed => }/config/__init__.py | 0 modules/{installed => }/config/config.py | 0 modules/{installed => }/config/templates/config.html | 0 modules/{installed => }/diagnostics/__init__.py | 0 modules/{installed => }/diagnostics/diagnostics.py | 0 .../diagnostics/templates/diagnostics.html | 0 .../diagnostics/templates/diagnostics_test.html | 0 modules/enabled/apps | 2 +- modules/enabled/config | 2 +- modules/enabled/diagnostics | 2 +- modules/enabled/expert_mode | 2 +- modules/enabled/firewall | 2 +- modules/enabled/first_boot | 2 +- modules/enabled/help | 2 +- modules/enabled/lib | 2 +- modules/enabled/owncloud | 2 +- modules/enabled/packages | 2 +- modules/enabled/pagekite | 2 +- modules/enabled/system | 2 +- modules/enabled/tor | 2 +- modules/enabled/users | 2 +- modules/enabled/xmpp | 2 +- modules/{installed => }/expert_mode/__init__.py | 0 modules/{installed => }/expert_mode/expert_mode.py | 0 .../expert_mode/templates/expert_mode.html | 0 modules/{installed => }/firewall/__init__.py | 0 modules/{installed => }/firewall/firewall.py | 0 .../{installed => }/firewall/templates/firewall.html | 0 modules/{installed => }/first_boot/__init__.py | 0 modules/{installed => }/first_boot/first_boot.py | 0 .../first_boot/templates/firstboot_sidebar.html | 0 .../first_boot/templates/firstboot_state0.html | 0 .../first_boot/templates/firstboot_state1.html | 0 modules/{installed => }/help/__init__.py | 0 modules/{installed => }/help/help.py | 0 modules/{installed => }/help/templates/about.html | 0 modules/{installed => }/help/templates/help.html | 0 modules/installed/__init__.py | 0 modules/{installed => }/lib/__init__.py | 0 modules/{installed => }/lib/auth.py | 0 modules/{installed => }/lib/auth_page.py | 0 modules/{installed => }/lib/user_store.py | 0 modules/{installed => }/owncloud/__init__.py | 0 modules/{installed => }/owncloud/owncloud.py | 0 .../{installed => }/owncloud/templates/owncloud.html | 0 modules/{installed => }/packages/__init__.py | 0 modules/{installed => }/packages/packages.py | 0 .../{installed => }/packages/templates/packages.html | 0 modules/{installed => }/pagekite/__init__.py | 0 modules/{installed => }/pagekite/pagekite.py | 0 .../pagekite/templates/pagekite_configure.html | 0 .../pagekite/templates/pagekite_introduction.html | 0 modules/{installed => }/santiago/__init__.py | 0 modules/{installed => }/santiago/santiago.py | 0 modules/{installed => }/system/__init__.py | 0 modules/{installed => }/system/system.py | 0 modules/{installed => }/system/templates/system.html | 0 modules/{installed => }/tor/__init__.py | 0 modules/{installed => }/tor/templates/tor.html | 0 modules/{installed => }/tor/tor.py | 0 modules/{installed => }/users/__init__.py | 0 .../{installed => }/users/templates/users_add.html | 0 .../{installed => }/users/templates/users_edit.html | 0 modules/{installed => }/users/users.py | 0 modules/{installed => }/xmpp/__init__.py | 0 .../xmpp/templates/xmpp_configure.html | 0 .../xmpp/templates/xmpp_register.html | 0 modules/{installed => }/xmpp/xmpp.py | 0 plinth.py | 12 +++++------- 72 files changed, 20 insertions(+), 22 deletions(-) rename modules/{installed => }/apps/__init__.py (100%) rename modules/{installed => }/apps/apps.py (100%) rename modules/{installed => }/apps/templates/apps.html (100%) rename modules/{installed => }/config/__init__.py (100%) rename modules/{installed => }/config/config.py (100%) rename modules/{installed => }/config/templates/config.html (100%) rename modules/{installed => }/diagnostics/__init__.py (100%) rename modules/{installed => }/diagnostics/diagnostics.py (100%) rename modules/{installed => }/diagnostics/templates/diagnostics.html (100%) rename modules/{installed => }/diagnostics/templates/diagnostics_test.html (100%) rename modules/{installed => }/expert_mode/__init__.py (100%) rename modules/{installed => }/expert_mode/expert_mode.py (100%) rename modules/{installed => }/expert_mode/templates/expert_mode.html (100%) rename modules/{installed => }/firewall/__init__.py (100%) rename modules/{installed => }/firewall/firewall.py (100%) rename modules/{installed => }/firewall/templates/firewall.html (100%) rename modules/{installed => }/first_boot/__init__.py (100%) rename modules/{installed => }/first_boot/first_boot.py (100%) rename modules/{installed => }/first_boot/templates/firstboot_sidebar.html (100%) rename modules/{installed => }/first_boot/templates/firstboot_state0.html (100%) rename modules/{installed => }/first_boot/templates/firstboot_state1.html (100%) rename modules/{installed => }/help/__init__.py (100%) rename modules/{installed => }/help/help.py (100%) rename modules/{installed => }/help/templates/about.html (100%) rename modules/{installed => }/help/templates/help.html (100%) delete mode 100644 modules/installed/__init__.py rename modules/{installed => }/lib/__init__.py (100%) rename modules/{installed => }/lib/auth.py (100%) rename modules/{installed => }/lib/auth_page.py (100%) rename modules/{installed => }/lib/user_store.py (100%) rename modules/{installed => }/owncloud/__init__.py (100%) rename modules/{installed => }/owncloud/owncloud.py (100%) rename modules/{installed => }/owncloud/templates/owncloud.html (100%) rename modules/{installed => }/packages/__init__.py (100%) rename modules/{installed => }/packages/packages.py (100%) rename modules/{installed => }/packages/templates/packages.html (100%) rename modules/{installed => }/pagekite/__init__.py (100%) rename modules/{installed => }/pagekite/pagekite.py (100%) rename modules/{installed => }/pagekite/templates/pagekite_configure.html (100%) rename modules/{installed => }/pagekite/templates/pagekite_introduction.html (100%) rename modules/{installed => }/santiago/__init__.py (100%) rename modules/{installed => }/santiago/santiago.py (100%) rename modules/{installed => }/system/__init__.py (100%) rename modules/{installed => }/system/system.py (100%) rename modules/{installed => }/system/templates/system.html (100%) rename modules/{installed => }/tor/__init__.py (100%) rename modules/{installed => }/tor/templates/tor.html (100%) rename modules/{installed => }/tor/tor.py (100%) rename modules/{installed => }/users/__init__.py (100%) rename modules/{installed => }/users/templates/users_add.html (100%) rename modules/{installed => }/users/templates/users_edit.html (100%) rename modules/{installed => }/users/users.py (100%) rename modules/{installed => }/xmpp/__init__.py (100%) rename modules/{installed => }/xmpp/templates/xmpp_configure.html (100%) rename modules/{installed => }/xmpp/templates/xmpp_register.html (100%) rename modules/{installed => }/xmpp/xmpp.py (100%) diff --git a/modules/installed/apps/__init__.py b/modules/apps/__init__.py similarity index 100% rename from modules/installed/apps/__init__.py rename to modules/apps/__init__.py diff --git a/modules/installed/apps/apps.py b/modules/apps/apps.py similarity index 100% rename from modules/installed/apps/apps.py rename to modules/apps/apps.py diff --git a/modules/installed/apps/templates/apps.html b/modules/apps/templates/apps.html similarity index 100% rename from modules/installed/apps/templates/apps.html rename to modules/apps/templates/apps.html diff --git a/modules/installed/config/__init__.py b/modules/config/__init__.py similarity index 100% rename from modules/installed/config/__init__.py rename to modules/config/__init__.py diff --git a/modules/installed/config/config.py b/modules/config/config.py similarity index 100% rename from modules/installed/config/config.py rename to modules/config/config.py diff --git a/modules/installed/config/templates/config.html b/modules/config/templates/config.html similarity index 100% rename from modules/installed/config/templates/config.html rename to modules/config/templates/config.html diff --git a/modules/installed/diagnostics/__init__.py b/modules/diagnostics/__init__.py similarity index 100% rename from modules/installed/diagnostics/__init__.py rename to modules/diagnostics/__init__.py diff --git a/modules/installed/diagnostics/diagnostics.py b/modules/diagnostics/diagnostics.py similarity index 100% rename from modules/installed/diagnostics/diagnostics.py rename to modules/diagnostics/diagnostics.py diff --git a/modules/installed/diagnostics/templates/diagnostics.html b/modules/diagnostics/templates/diagnostics.html similarity index 100% rename from modules/installed/diagnostics/templates/diagnostics.html rename to modules/diagnostics/templates/diagnostics.html diff --git a/modules/installed/diagnostics/templates/diagnostics_test.html b/modules/diagnostics/templates/diagnostics_test.html similarity index 100% rename from modules/installed/diagnostics/templates/diagnostics_test.html rename to modules/diagnostics/templates/diagnostics_test.html diff --git a/modules/enabled/apps b/modules/enabled/apps index 1e5ce6875..ee655a64d 120000 --- a/modules/enabled/apps +++ b/modules/enabled/apps @@ -1 +1 @@ -../installed/apps/ \ No newline at end of file +../apps/ \ No newline at end of file diff --git a/modules/enabled/config b/modules/enabled/config index 95f5d5d11..408852685 120000 --- a/modules/enabled/config +++ b/modules/enabled/config @@ -1 +1 @@ -../installed/config/ \ No newline at end of file +../config/ \ No newline at end of file diff --git a/modules/enabled/diagnostics b/modules/enabled/diagnostics index 7575508ad..44f76bee7 120000 --- a/modules/enabled/diagnostics +++ b/modules/enabled/diagnostics @@ -1 +1 @@ -../installed/diagnostics/ \ No newline at end of file +../diagnostics/ \ No newline at end of file diff --git a/modules/enabled/expert_mode b/modules/enabled/expert_mode index 899eb7ef1..0006eedc0 120000 --- a/modules/enabled/expert_mode +++ b/modules/enabled/expert_mode @@ -1 +1 @@ -../installed/expert_mode/ \ No newline at end of file +../expert_mode/ \ No newline at end of file diff --git a/modules/enabled/firewall b/modules/enabled/firewall index fa24d8415..ecb364d05 120000 --- a/modules/enabled/firewall +++ b/modules/enabled/firewall @@ -1 +1 @@ -../installed/firewall/ \ No newline at end of file +../firewall/ \ No newline at end of file diff --git a/modules/enabled/first_boot b/modules/enabled/first_boot index ffd4685cc..b977d6c94 120000 --- a/modules/enabled/first_boot +++ b/modules/enabled/first_boot @@ -1 +1 @@ -../installed/first_boot/ \ No newline at end of file +../first_boot/ \ No newline at end of file diff --git a/modules/enabled/help b/modules/enabled/help index 7f4f221a6..76c213eda 120000 --- a/modules/enabled/help +++ b/modules/enabled/help @@ -1 +1 @@ -../installed/help/ \ No newline at end of file +../help/ \ No newline at end of file diff --git a/modules/enabled/lib b/modules/enabled/lib index 7cd28ddb5..5bf80bf13 120000 --- a/modules/enabled/lib +++ b/modules/enabled/lib @@ -1 +1 @@ -../installed/lib/ \ No newline at end of file +../lib/ \ No newline at end of file diff --git a/modules/enabled/owncloud b/modules/enabled/owncloud index 63da55329..b9d942937 120000 --- a/modules/enabled/owncloud +++ b/modules/enabled/owncloud @@ -1 +1 @@ -../installed/owncloud/ \ No newline at end of file +../owncloud/ \ No newline at end of file diff --git a/modules/enabled/packages b/modules/enabled/packages index b6441c789..f314f73fa 120000 --- a/modules/enabled/packages +++ b/modules/enabled/packages @@ -1 +1 @@ -../installed/packages/ \ No newline at end of file +../packages/ \ No newline at end of file diff --git a/modules/enabled/pagekite b/modules/enabled/pagekite index e19e08de2..1c4c9c144 120000 --- a/modules/enabled/pagekite +++ b/modules/enabled/pagekite @@ -1 +1 @@ -../installed/pagekite/ \ No newline at end of file +../pagekite/ \ No newline at end of file diff --git a/modules/enabled/system b/modules/enabled/system index e47f3142b..16f8cc2b2 120000 --- a/modules/enabled/system +++ b/modules/enabled/system @@ -1 +1 @@ -../installed/system/ \ No newline at end of file +../system/ \ No newline at end of file diff --git a/modules/enabled/tor b/modules/enabled/tor index 62dc28af9..f7495e4ab 120000 --- a/modules/enabled/tor +++ b/modules/enabled/tor @@ -1 +1 @@ -../installed/tor/ \ No newline at end of file +../tor/ \ No newline at end of file diff --git a/modules/enabled/users b/modules/enabled/users index 8f8a47d96..db9284fbb 120000 --- a/modules/enabled/users +++ b/modules/enabled/users @@ -1 +1 @@ -../installed/users/ \ No newline at end of file +../users/ \ No newline at end of file diff --git a/modules/enabled/xmpp b/modules/enabled/xmpp index 726e67c0e..686474fe7 120000 --- a/modules/enabled/xmpp +++ b/modules/enabled/xmpp @@ -1 +1 @@ -../installed/xmpp/ \ No newline at end of file +../xmpp/ \ No newline at end of file diff --git a/modules/installed/expert_mode/__init__.py b/modules/expert_mode/__init__.py similarity index 100% rename from modules/installed/expert_mode/__init__.py rename to modules/expert_mode/__init__.py diff --git a/modules/installed/expert_mode/expert_mode.py b/modules/expert_mode/expert_mode.py similarity index 100% rename from modules/installed/expert_mode/expert_mode.py rename to modules/expert_mode/expert_mode.py diff --git a/modules/installed/expert_mode/templates/expert_mode.html b/modules/expert_mode/templates/expert_mode.html similarity index 100% rename from modules/installed/expert_mode/templates/expert_mode.html rename to modules/expert_mode/templates/expert_mode.html diff --git a/modules/installed/firewall/__init__.py b/modules/firewall/__init__.py similarity index 100% rename from modules/installed/firewall/__init__.py rename to modules/firewall/__init__.py diff --git a/modules/installed/firewall/firewall.py b/modules/firewall/firewall.py similarity index 100% rename from modules/installed/firewall/firewall.py rename to modules/firewall/firewall.py diff --git a/modules/installed/firewall/templates/firewall.html b/modules/firewall/templates/firewall.html similarity index 100% rename from modules/installed/firewall/templates/firewall.html rename to modules/firewall/templates/firewall.html diff --git a/modules/installed/first_boot/__init__.py b/modules/first_boot/__init__.py similarity index 100% rename from modules/installed/first_boot/__init__.py rename to modules/first_boot/__init__.py diff --git a/modules/installed/first_boot/first_boot.py b/modules/first_boot/first_boot.py similarity index 100% rename from modules/installed/first_boot/first_boot.py rename to modules/first_boot/first_boot.py diff --git a/modules/installed/first_boot/templates/firstboot_sidebar.html b/modules/first_boot/templates/firstboot_sidebar.html similarity index 100% rename from modules/installed/first_boot/templates/firstboot_sidebar.html rename to modules/first_boot/templates/firstboot_sidebar.html diff --git a/modules/installed/first_boot/templates/firstboot_state0.html b/modules/first_boot/templates/firstboot_state0.html similarity index 100% rename from modules/installed/first_boot/templates/firstboot_state0.html rename to modules/first_boot/templates/firstboot_state0.html diff --git a/modules/installed/first_boot/templates/firstboot_state1.html b/modules/first_boot/templates/firstboot_state1.html similarity index 100% rename from modules/installed/first_boot/templates/firstboot_state1.html rename to modules/first_boot/templates/firstboot_state1.html diff --git a/modules/installed/help/__init__.py b/modules/help/__init__.py similarity index 100% rename from modules/installed/help/__init__.py rename to modules/help/__init__.py diff --git a/modules/installed/help/help.py b/modules/help/help.py similarity index 100% rename from modules/installed/help/help.py rename to modules/help/help.py diff --git a/modules/installed/help/templates/about.html b/modules/help/templates/about.html similarity index 100% rename from modules/installed/help/templates/about.html rename to modules/help/templates/about.html diff --git a/modules/installed/help/templates/help.html b/modules/help/templates/help.html similarity index 100% rename from modules/installed/help/templates/help.html rename to modules/help/templates/help.html diff --git a/modules/installed/__init__.py b/modules/installed/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/modules/installed/lib/__init__.py b/modules/lib/__init__.py similarity index 100% rename from modules/installed/lib/__init__.py rename to modules/lib/__init__.py diff --git a/modules/installed/lib/auth.py b/modules/lib/auth.py similarity index 100% rename from modules/installed/lib/auth.py rename to modules/lib/auth.py diff --git a/modules/installed/lib/auth_page.py b/modules/lib/auth_page.py similarity index 100% rename from modules/installed/lib/auth_page.py rename to modules/lib/auth_page.py diff --git a/modules/installed/lib/user_store.py b/modules/lib/user_store.py similarity index 100% rename from modules/installed/lib/user_store.py rename to modules/lib/user_store.py diff --git a/modules/installed/owncloud/__init__.py b/modules/owncloud/__init__.py similarity index 100% rename from modules/installed/owncloud/__init__.py rename to modules/owncloud/__init__.py diff --git a/modules/installed/owncloud/owncloud.py b/modules/owncloud/owncloud.py similarity index 100% rename from modules/installed/owncloud/owncloud.py rename to modules/owncloud/owncloud.py diff --git a/modules/installed/owncloud/templates/owncloud.html b/modules/owncloud/templates/owncloud.html similarity index 100% rename from modules/installed/owncloud/templates/owncloud.html rename to modules/owncloud/templates/owncloud.html diff --git a/modules/installed/packages/__init__.py b/modules/packages/__init__.py similarity index 100% rename from modules/installed/packages/__init__.py rename to modules/packages/__init__.py diff --git a/modules/installed/packages/packages.py b/modules/packages/packages.py similarity index 100% rename from modules/installed/packages/packages.py rename to modules/packages/packages.py diff --git a/modules/installed/packages/templates/packages.html b/modules/packages/templates/packages.html similarity index 100% rename from modules/installed/packages/templates/packages.html rename to modules/packages/templates/packages.html diff --git a/modules/installed/pagekite/__init__.py b/modules/pagekite/__init__.py similarity index 100% rename from modules/installed/pagekite/__init__.py rename to modules/pagekite/__init__.py diff --git a/modules/installed/pagekite/pagekite.py b/modules/pagekite/pagekite.py similarity index 100% rename from modules/installed/pagekite/pagekite.py rename to modules/pagekite/pagekite.py diff --git a/modules/installed/pagekite/templates/pagekite_configure.html b/modules/pagekite/templates/pagekite_configure.html similarity index 100% rename from modules/installed/pagekite/templates/pagekite_configure.html rename to modules/pagekite/templates/pagekite_configure.html diff --git a/modules/installed/pagekite/templates/pagekite_introduction.html b/modules/pagekite/templates/pagekite_introduction.html similarity index 100% rename from modules/installed/pagekite/templates/pagekite_introduction.html rename to modules/pagekite/templates/pagekite_introduction.html diff --git a/modules/installed/santiago/__init__.py b/modules/santiago/__init__.py similarity index 100% rename from modules/installed/santiago/__init__.py rename to modules/santiago/__init__.py diff --git a/modules/installed/santiago/santiago.py b/modules/santiago/santiago.py similarity index 100% rename from modules/installed/santiago/santiago.py rename to modules/santiago/santiago.py diff --git a/modules/installed/system/__init__.py b/modules/system/__init__.py similarity index 100% rename from modules/installed/system/__init__.py rename to modules/system/__init__.py diff --git a/modules/installed/system/system.py b/modules/system/system.py similarity index 100% rename from modules/installed/system/system.py rename to modules/system/system.py diff --git a/modules/installed/system/templates/system.html b/modules/system/templates/system.html similarity index 100% rename from modules/installed/system/templates/system.html rename to modules/system/templates/system.html diff --git a/modules/installed/tor/__init__.py b/modules/tor/__init__.py similarity index 100% rename from modules/installed/tor/__init__.py rename to modules/tor/__init__.py diff --git a/modules/installed/tor/templates/tor.html b/modules/tor/templates/tor.html similarity index 100% rename from modules/installed/tor/templates/tor.html rename to modules/tor/templates/tor.html diff --git a/modules/installed/tor/tor.py b/modules/tor/tor.py similarity index 100% rename from modules/installed/tor/tor.py rename to modules/tor/tor.py diff --git a/modules/installed/users/__init__.py b/modules/users/__init__.py similarity index 100% rename from modules/installed/users/__init__.py rename to modules/users/__init__.py diff --git a/modules/installed/users/templates/users_add.html b/modules/users/templates/users_add.html similarity index 100% rename from modules/installed/users/templates/users_add.html rename to modules/users/templates/users_add.html diff --git a/modules/installed/users/templates/users_edit.html b/modules/users/templates/users_edit.html similarity index 100% rename from modules/installed/users/templates/users_edit.html rename to modules/users/templates/users_edit.html diff --git a/modules/installed/users/users.py b/modules/users/users.py similarity index 100% rename from modules/installed/users/users.py rename to modules/users/users.py diff --git a/modules/installed/xmpp/__init__.py b/modules/xmpp/__init__.py similarity index 100% rename from modules/installed/xmpp/__init__.py rename to modules/xmpp/__init__.py diff --git a/modules/installed/xmpp/templates/xmpp_configure.html b/modules/xmpp/templates/xmpp_configure.html similarity index 100% rename from modules/installed/xmpp/templates/xmpp_configure.html rename to modules/xmpp/templates/xmpp_configure.html diff --git a/modules/installed/xmpp/templates/xmpp_register.html b/modules/xmpp/templates/xmpp_register.html similarity index 100% rename from modules/installed/xmpp/templates/xmpp_register.html rename to modules/xmpp/templates/xmpp_register.html diff --git a/modules/installed/xmpp/xmpp.py b/modules/xmpp/xmpp.py similarity index 100% rename from modules/installed/xmpp/xmpp.py rename to modules/xmpp/xmpp.py diff --git a/plinth.py b/plinth.py index ee3dd1571..e3d8666a9 100755 --- a/plinth.py +++ b/plinth.py @@ -80,16 +80,15 @@ class Root(plugin_mount.PagePlugin): def load_modules(): """ Read names of enabled modules in modules/enabled directory and - import them from modules/installed directory. + import them from modules directory. """ for name in os.listdir('modules/enabled'): - cfg.log.info('Importing modules/installed/%s' % name) + cfg.log.info('Importing modules/%s' % name) try: - importlib.import_module( - 'modules.installed.{module}'.format(module=name)) + importlib.import_module('modules.{module}'.format(module=name)) except ImportError as exception: cfg.log.error( - 'Could not import modules/installed/{module}: {exception}' + 'Could not import modules/{module}: {exception}' .format(module=name, exception=exception)) @@ -100,8 +99,7 @@ def get_template_directories(): directories = set((core_directory,)) for name in os.listdir('modules/enabled'): - directories.add(os.path.join('modules', 'installed', name, - 'templates')) + directories.add(os.path.join('modules', name, 'templates')) cfg.log.info('Template directories - %s' % directories) From 998b515fedda987e2063c72f2762a3c8704ec354 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Fri, 6 Jun 2014 12:50:05 +0530 Subject: [PATCH 23/23] Update LICENSE files for module reorganization --- LICENSES | 39 ++++++++++++++++----------------------- 1 file changed, 16 insertions(+), 23 deletions(-) diff --git a/LICENSES b/LICENSES index 27ecd15dd..7581e1686 100644 --- a/LICENSES +++ b/LICENSES @@ -45,29 +45,22 @@ specified and linked otherwise. - doc/scripts.mdwn :: - - doc/security.mdwn :: - - doc/themes.mdwn :: - -- modules/installed/first_boot.py :: - -- modules/installed/apps/apps.py :: - -- modules/installed/apps/owncloud.py :: - -- modules/installed/help/help.py :: - -- modules/installed/lib/auth_page.py :: - -- modules/installed/lib/auth.py :: Derived from [[http://tools.cherrypy.org/wiki/AuthenticationAndAccessRestrictions][Arnar Birisson's CherryPy wiki code]]. -- modules/installed/lib/forms.py :: [[file:modules/installed/lib/forms.py::Copyright%202011-2013%20James%20Vasile][Copyright James Vasile]] -- modules/installed/lib/user_store.py :: - -- modules/installed/privacy/privacy.py :: - -- modules/installed/router/info.py :: - -- modules/installed/router/router.py :: - -- modules/installed/santiago/santiago.py :: - -- modules/installed/services/services.py :: - -- modules/installed/services/xmpp.py :: - -- modules/installed/sharing/file_explorer.py :: - -- modules/installed/sharing/sharing.py :: - -- modules/installed/system/config.py :: - -- modules/installed/system/diagnostics.py :: - -- modules/installed/system/expert_mode.py :: - -- modules/installed/system/system.py :: - -- modules/installed/system/time_zones :: - -- modules/installed/system/users.py :: - -- modules/installed/system/wan.py :: - +- modules/apps/apps.py :: - +- modules/config/config.py :: - +- modules/diagnostics/diagnostics.py :: - +- modules/expert_mode/expert_mode.py :: - +- modules/first_boot/first_boot.py :: - +- modules/help/help.py :: - +- modules/lib/auth_page.py :: - +- modules/lib/auth.py :: Derived from [[http://tools.cherrypy.org/wiki/AuthenticationAndAccessRestrictions][Arnar Birisson's CherryPy wiki code]]. +- modules/lib/user_store.py :: - +- modules/owncloud/owncloud.py :: - +- modules/packages/packages.py :: - +- modules/santiago/santiago.py :: - +- modules/system/system.py :: - +- modules/tor/tor.py :: - +- modules/users/users.py :: - +- modules/xmpp/xmpp.py :: - - setup/86_plinth :: - - share/apache2/plinth.conf :: - - share/apache2/plinth-ssl.conf :: -