41 Commits

Author SHA1 Message Date
Joseph Nuthalapati
e04ae48637
users: Add component for managing users and groups
- Handle groups needed by an app.
- Handle reserved usernames for an app.
- Updated documentation
- Updated unit tests

Tests performed:
  - Reserved usernames: ez-ipupd, ejabberd, Debian-minetest, mldonkey,
    monkeysphere, mumble-server, privoxy, quasselcore, radicale, debian-tor,
    debian-transmission
  - Reserved usernames checks should work in the following forms:
    - Create user
    - Update user
    - First boot user creation
  - Full list of available groups should appear in following cases:
    - Create user form
    - Update user form
  - Full list of groups should get created in Django DB during:
    - Update user form display
    - First boot form save
  - When updating the last admin user, the 'admin' group choice is checked
    and disabled.
  - Following groups show up (sorted by group name):
    - bit-torrent: Download files using BitTorrent applications
    - git-access: Read-write access to Git repositories
    - i2p: Manage I2P application
    - wiki: View and edit wiki applications
    - minidlna: Media streaming server
    - ed2k: Download files using eDonkey applications
    - freedombox-share: Access to the private shares
    - web-search: Search the web
    - syncthing: Administer Syncthing application
    - feed-reader: Read and subscribe to news feeds
    - admin: Access to all services and system settings
  - Directory validation form checks for write permissions for following apps:
    - deluge with debian-deluged user
    - transmission with debian-transmission user
  - Sharing app should show all the groups in add/edit share forms
  - The following apps should get added to share group during setup:
    debian-transmission
    debian-deluged
  - Unit tests pass
  - Functional tests for users and groups pass
  - Test that an app (example syncthing) provides the necessary
    permissions to users in that group (but not in admin group).

Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
[sunil: Fix i18n of group descriptions]
[sunil: Update developer documentation]
[sunil: Separate out cosmetic changes]
[sunil: Fix component ID for mumble]
[sunil: sharing: Remove unneeded dependency on users app]
[sunil: Implement better API for getting groups in component]
[sunil: Fix incorrect regression change ttrss app]
[sunil: Make iterating over gourps more readable]
[sunil: Improve tests, drop single use fixtures]
[sunil: Simplify test_view.py fixture]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Tested-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-04-04 09:31:35 -04:00
Sunil Mohan Adapa
9368504da5
*.py: Use SPDX license identifier
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-02-19 14:38:55 +02:00
Sunil Mohan Adapa
b576a77c3d
app: Refactor all apps to use the Info component
- Remove the need to pass all the individual information elements to the AppView
  separately. This eliminates many issues with elements that were mistakenly not
  sent to AppView. Also reduces a lot of code duplication.

- Create App classes for power and sso for consistency.

Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-02-16 18:22:01 -05:00
Sunil Mohan Adapa
2ebb565c92
diagnostics: Use new component based API for all diagnostic tests
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-12-30 11:37:46 -05:00
Alice Kile
fa74a26042
use single variable for referencing icon filename
- add and use "icon_filename" property to almost all of the modules
  being displayed in the apps page
- sharing and tor modules do not seem to be using setup.html template
  file and so the variable is not added to their __init__.py files,
  therefore the icon will not be displayed on these app pages.

Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-12-07 13:08:33 -05:00
Alice Kile
4969efd3b9
apps: Remove link to webapps in app descriptions
[sunil: Fix trailing white space in description]
[sunil: Fix removal of wrong message from ttrss app]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-11-26 15:39:28 -08:00
Veiko Aasa
955da6bee8
turbolinks: Disable turbolinks on links that don't point to /plinth/...
Fixes #1678

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
2019-11-14 08:14:49 +05:30
Sunil Mohan Adapa
8a1a3a66f7
cosmetic: yapf formatting
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-10-20 11:54:15 -04:00
Nikolas Nyby
5439084c84
Add flake8 to gitlib-ci - closes #58
And fix the rest of the flake8 errors.

Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-07-25 11:07:06 -07:00
Nikolas Nyby
f81b1751ce
Fix typos in module init docs
Intialize -> Initialize

Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-07-24 14:55:22 -07:00
Sunil Mohan Adapa
c6bbc847b4
syncthing: Open firewall ports for listening and discovery
- Closes #1592.

- Use firewall service definition 'syncthing' already available.

- Open externally also, helps in syncing with peers on the Internet. Open
  discovery port also externally and syncthing deal with the traffic.

- Based on https://docs.syncthing.net/users/firewall.html

Test:

- Install version 2, syncthing firewall service is enabled in internal and
  external zones.

- Disable app, syncthing firewall service is removed. Enable app, syncthing
  firewall service is added.

- Install version 1, upgrade to version 2, syncthing firewall service is added.

- Install version 1, disable syncthing, upgrade to version 2, syncthing firewall
  service is not added. Enable syncthing, firewall service is added.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-06-24 18:11:35 -04:00
Sunil Mohan Adapa
e4351b6b97
Introduce daemon component to handle systemd units
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-06-13 20:18:02 -04:00
Sunil Mohan Adapa
46f162d093
app: Add unique ID to each app class
Also maintain a global list of apps

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-06-13 20:17:59 -04:00
Sunil Mohan Adapa
4100d36381
Introduce webserver component for managing Apache configuration
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-06-13 20:17:49 -04:00
Sunil Mohan Adapa
ca2c7dbeb0
Introduce firewall component for opening/closing ports
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-06-13 20:17:45 -04:00
Sunil Mohan Adapa
75c57d3e00
Turn frontpage shortcut into an app component
- Turn frontpage shortcut into an App component. Add tests and full
  documentation.

- Overridden implementations for tahoe, diaspora, mediawiki shortcuts to handle
  special cases. Special handling for ikiwiki.

- Extend App API for removing and retrieving a component.

- Add clients information into shortcuts to avoid hacks when presenting
  shortcuts to Mobile devices via API.

- Fixed unnecessary stripping and adding of '/' when setting home page redirect
  URLs. This fixes problem with setting Cockpit as home page.

- Replaced the use of term 'app' in favor of 'shortcut' as the term when setting
  frontpage shortcuts as home page.

- JSXC shortcut does not require login.

- Don't show shadowsocks for anonymous users.

- Simplify showing selected shortcut details.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-06-07 11:48:08 -07:00
Sunil Mohan Adapa
b96d901071
Introduce component architecture and menu component
- Introduce base class for all apps that will contain components. With
  unittests.

- Introduce base classes for components. With unittests.

- Turn Menu class into an app component.

  - Further cleanup Menu class.

  - Update tests.

  - Maintain a global list of menu items and look them up easily. Generalize
    such that subsubmenus can later be merged into Menu class.

  - Cleanup scope of main menu initialization.

  - Use None instead of empty strings for various values. Ensure that
    printing short_description does not show 'None' in output.

  - Use enable/disable instead of promote/demote.

- Use menu component in all apps.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-06-07 11:48:04 -07:00
James Valleroy
893bd2b4d6
apps: Separate enabled and disabled apps
- Add 'secondary' flag to menu items.

- Mark apps as 'secondary' when disabled.

- Extend TemplateView for apps index.

- Add card-container for disabled apps.

Closes #1309

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-05-07 16:57:55 -07:00
Sunil Mohan Adapa
529c281734
syncthing: Add backup/restore support
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-01-26 21:30:29 -05:00
Hemanth Kumar Veeranki
881302ac02
Use logos instead of icons in the apps page
- Adjust the template so that it uses glyphicons for sys page and logos for the app page
- Add logos for missing apps (tor and sharing) and their licences

Signed-off-by: Hemanth Kumar Veeranki <hems.india1997@gmail.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-06-30 09:40:09 -04:00
Hemanth Kumar Veeranki
b605c9da8a
Add a way to refine shortcuts
- Add a field `allowed_groups` to shortcuts, which will contain groups which can
  access a particular app
- When a user is logged in, only return those shortcuts to the front page if the
  user is allowed to access them. This check is done based on the allowed_groups
  field of the shortcut
- Add allowed_groups for shortcuts of all apps with group-restricted access

Signed-off-by: Hemanth Kumar Veeranki <hemanthveeranki@gmail.com>
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2018-06-21 18:53:45 +05:30
Joseph Nuthalapati
4064d6e231
manual: Link to manual from each service
Closes #930

- Make targets to download wiki pages of each service

- Add post-processor script for DocBook file processing

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-03-22 19:49:14 -04:00
Sunil Mohan Adapa
8f0e2d6381
Rename Plinth to FreedomBox in module doc strings
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-02-16 20:10:25 -05:00
Sunil Mohan Adapa
dea4af17fb
Rename Plinth to FreedomBox in license headers
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-02-16 20:10:09 -05:00
Sunil Mohan Adapa
8dcf570c76
syncthing: yapf indentation
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2018-01-15 17:51:43 +05:30
Aakanksha Saini
5ec7f49c8b
syncthing: Restrict administration to users in group syncthing
- Add syncthing group
- Add validation in syncthing-plinth configuration

* Tested on UI

Signed-off-by: Aakanksha Saini <aakanksa@thoughtworks.com>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2018-01-15 17:51:30 +05:30
Joseph Nuthalapati
d3cddfa68c
Add icons for desktop applications and Apple App store.
- Add yapf style file for consistency of formatting
- Some minor changes and renaming
- Add template tag filters for checking conditions
- Move icons from img directory to icons directory

Currently the client listing is in both the SetupView and ServceView for ease of
development. Have to remove from ServiceView.

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2017-12-04 12:15:03 -05:00
Joseph Nuthalapati
d403782b77
Add client information for Matrix Synapse and Syncthing
- Add logos for desktop operating systems

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2017-12-04 12:14:42 -05:00
Prachi
823e06271f
Add client information for modules
Added information for the following:
-diaspora
-ejabbered
-infinoted
-ikiwiki
-jsxc
-matrixsynapse
-minetest
-mumble
-quassel
-radicale
-repro
-restore
-roundcube
-shaarli
-synchting
-tor
-shaarli
-transmission
-ttrss

Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2017-12-04 12:14:34 -05:00
Prachi Srivastava
83430f4031
Add mobile, web and desktop client for modules
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2017-10-24 17:13:13 +05:30
Prachi
c8eb714562
Separate out the short description and app name
Signed-off-by: Prachi <prachi@swecha.net>
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2017-08-21 11:17:08 +05:30
Sunil Mohan Adapa
ee7cc98fee
apps, system: Remove modules and merge into main
- Remove apps and system modules and merge their views into main views.

- Move main_menu from cfg into menu.py.

- Remove dependencies of other modules on apps and system modules.

- Update tests.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2017-05-05 22:31:45 -04:00
Johannes Keyser
fab423e652
syncthing: Fixed typos and clarity in description 2017-04-17 11:48:19 +05:30
Sahithi Yarlagadda
24851ca7ff
syncthing: Added line break to title 2017-04-12 14:06:35 +05:30
Sunil Mohan Adapa
4a3cf220c8
syncthing: Fixes issues with enabling and setup
- On enable, don't just run syncthing, actually enable it.

- Make setup step idempotent. Run setup during enable as it is
  idempotent.

- Perform user/group creation properly during setup.

- Provide better description.

- Modify the application label and icon for accuracy of the service
  provided.

- Fix problem with showing service in firewall.
2017-03-23 15:09:46 +05:30
Sunil Mohan Adapa
277cd45342
syncthing: Minor styling fixes 2017-03-23 15:09:26 +05:30
Joseph Nuthalpati
551bd7b92c
syncthing: Fix showing running status in configuration page 2017-03-23 15:07:38 +05:30
Joseph Nuthalpati
a5147cfe16
syncthing: Run service as system user 'syncthing'
- Enabled Apache LDAP authentication for Syncthing.
2017-03-23 15:07:25 +05:30
Joseph Nuthalpati
53645deebf
syncthing: Made it a systemd service 2017-03-23 15:06:52 +05:30
Joseph Nuthalpati
cef7e6ff60
syncthing: Added glyph icon and corrected description and URLs 2017-03-23 15:05:11 +05:30
Joseph Nuthalpati
2e28408f4b
syncthing: initial attempt at integrating Syncthing 2017-03-23 15:01:13 +05:30