48 Commits

Author SHA1 Message Date
Sunil Mohan Adapa
d1ead29251
setup: Don't perform is-package-manager-busy checks when not needed
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-01-14 17:40:31 -05:00
Sunil Mohan Adapa
65f1af7a7b
setup: Minor flake8 fixes
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-01-14 17:40:22 -05:00
Sunil Mohan Adapa
de82f5002d
setup: Handle showing setup page after app completes installation
- During the rendering of the view, the state of installation may keep changing.
  This may lead to inconsistencies in the page. Avoid that by collecting the
  state once and then reusing that throughout the rendering process.

- During the time that setup middleware's checked of setup state of an app and
  rendering of app's setup view, if the setup process could get completed. This
  will lead to setup page being shown even after the application is installed.
  Handle this case and show a proper page instead of 'Submit Query' button on
  the page. Fixes #1360. This can be easily replicated by introducing a 10
  second sleep after setup middle checks of the application is 'up-to-date'.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-01-14 17:40:02 -05:00
Joseph Nuthalapati
61b6395a1c
install: Use Post/Response/Get pattern for reloads
Redirect the POST request for install with the template. This ensures that any
reload performed on the page will be a GET request.

https://en.wikipedia.org/wiki/Post/Redirect/Get

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2018-08-21 17:51:59 +05:30
Joseph Nuthalapati
45138fcdf0
packages: Button to refresh package lists
- This is a fallback solution to manually refresh package lists on AWS images
  since they come with no apt package lists.
- This can also be occasionally useful for people running the testing
  distribution where packages might be frequently added and removed.

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-07-02 19:30:13 -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
90932e78af
locale: Implement utilities for setting/getting language
Separate language cookie are only used if sessions (session middleware) are not
available. Otherwise, even anonymous users have their language preference in
sessions instead of cookies. This is default Django behavior, conform to it.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-02-21 21:07:47 +01:00
Sunil Mohan Adapa
e644e5c86a
locale: Refactor language selection form
- Use properly base class overrides

- Implement feature to go back to the page user was on before language
  selection.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-02-21 21:07:39 +01:00
Sai Kiran Naragam
837e0b8384
locale: Adds preferred language for logged in user
- UserProfile model is created, it has one-to-one relationship with User.

- Language selection dropdown added to UserCreate and UserUpdate forms.

- Adds None to language selection dropdown to explicitly unselect.

- LANGUAGE_SESSION_KEY is set to User's preferred language on LogIn activity.

- LANGUAGE_SESSION_KEY is deleted on User's LogOut activity.

Signed-off-by: Sai Kiran Naragam <saikiran.rguiiit@gmail.com>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2018-02-21 21:06:14 +01:00
Sai Kiran Naragam
5cff5629d8
locale: Anonymous users can set preferred language
Logged-in user flow is pending.

Check [How django discovers language preference]:
https://docs.djangoproject.com/en/1.10/topics/i18n/translation/#how-django-discovers-language-preference

Signed-off-by: Sai Kiran Naragam <saikiran.rguiiit@gmail.com>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2018-02-21 21:06:07 +01:00
Sunil Mohan Adapa
8f4811b350
Rename Plinth to FreedomBox in more module doc strings
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-02-16 20:10:31 -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
1200020a0e
clients: Minor styling fixes
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2017-12-13 18:56:08 -05:00
Joseph Nuthalapati
efa575b204
Add clients to ServiceView
Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2017-12-04 12:15:12 -05:00
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
Sunil Mohan Adapa
1247f2ef93
setup: Prioritize FirstSetupMiddle over some others
- Minor PEP8 fixes.
- Add doc strings.
- Make a few methods private.
- Remove unused global declarations.
- Remove unused imports.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2017-10-11 18:13:14 +05:30
Joseph Nuthalpati
7ce56864e9
setup: Fix Plinth startup issues
- Selectively run setup for modules
- Middleware pending

Fixes #1024

Signed-off-by: Joseph Nuthalpati <njoseph@thoughtworks.com>
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2017-10-11 18:12:45 +05:30
abilashr
81fde34254
Rename Disks and Snapshots in Configuration tab
- Rename Disks to Storage
- Rename Snapshot to Storage Snapshots

Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2017-09-27 09:39:34 +05:30
Johannes Keyser
3c4c770404
disks: add low disk space warning to system and disks page
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2017-08-31 15:48:23 +05:30
Johannes Keyser
82475522f9
disks: Add low disk space warning (Closes: #985)
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2017-08-31 15:47:15 +05:30
morrme
ad3420823d
owncloud: Remove module (Closes: #818)
It is believed that ownCloud is unlikely to return to Debian in near future.
Removing module to ease maintenance.

Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2017-04-25 18:06:56 +05:30
Johannes Keyser
76a63d102b
setup: Disable install/upgrade when dpkg/apt is running
Show a warning message that a package manager is running. This prevents users
from getting an installation error just because another installation/upgrade is
running.

Closes: #625.
2017-04-19 16:50:00 +05:30
Sunil Mohan Adapa
4feb0c7a01
Complete tests and remove duplicate context information 2017-03-29 20:10:39 +05:30
Rahul De
ad0b235dd7
users: Restrict groups and active user control to admins
- Only admins can now edit the groups of any user

- Only admins can mark any user as active or not

- Refactored all occurrences of admin checks to its own utility function
2017-02-15 21:07:54 +05:30
Sunil Mohan Adapa
dd5ab7612e
Minor refactoring and lint fixes
- Rename AdminMiddleware to AdminRequiredMiddleware to be consistent
  with stronghold/Django terminology

- Simplify .gitignore pattern

- Format single line docstrings as per PEP8.

- Add missing docstrings.

- Restrict lines to 79 characters.
2017-02-15 21:07:27 +05:30
lispyclouds
0f3189c6bd
frontpage: Show config options only to admins 2017-02-15 21:06:20 +05:30
mridulnagpal
8d5fc5f1c4
icons updated 2016-12-18 12:32:41 -05:00
mridulnagpal
06fb7fab3b
License updated ikiwiki icon added title indented 2016-12-18 12:32:26 -05:00
mridulnagpal
8f147e4c7f
frontpage: Show Configure button in service details
Only show when user is logged in.
2016-11-21 12:22:01 -05:00
Sunil Mohan Adapa
7d2f9549a0
frontpage: Fix regression in showing description
- After the shortcuts were turned into a list instead of dictionary, the
  descriptions stopped showing in the front page due to an 'in' check
  that worked for dict.  Fix this by changing the shortcuts into a
  dictionary.

- Also make the key of the shortcut dict an 'id' instead of 'app' that
  could create confusion how an app maps to a shortcut.

- Minor indentation fixes.
2016-09-02 20:06:41 +05:30
James Valleroy
49eadd971a
Add information about enabled services to front page 2016-09-02 20:03:39 +05:30
James Valleroy
3eb7dd914a
Add basic front page with shortcuts to web apps 2016-09-02 20:03:24 +05:30
Sunil Mohan Adapa
18996b5c56
Import urlresolvers from django.urls
In Django 1.10, django.core.urlresolvers is available from
django.urls. Use it.
2016-08-11 18:03:00 -04:00
fonfon
895f329654
Services: minor cleanup
- remove Service.description (not used anymore)
- remove datetime template (use default service.html instead)
2016-05-11 18:19:42 -04:00
fonfon
b54846b0ce
Services: Template restructuring
- renamed app.html to simple_service.html
- allow hiding the 'status' block instead of using separate
  apache_service.html template
2016-05-11 18:19:35 -04:00
fonfon
f419c28596
Services: Explicitly use ServiceForm and ServiceView
- adapted all modules to not use views.ConfigurationView anymore
- removed templates that are not needed anymore
- no more implicit 'enabled' and 'get_status' functions in __init__.py files
- (more coherent/explicit use of Django functionality)
2016-05-11 18:19:31 -04:00
Sunil Mohan Adapa
2078e209d1
views: Minor adjustment to module load order 2016-02-28 19:54:24 +05:30
Sunil Mohan Adapa
fa8c2cf6ff
views: Add a common view for enabling applications
- A lot of boiler plate code can be removed from Plinth if enabling and
  disabling an application can be done using a common base form.

- This also allows to define a reusable method in an application for
  enabling and disabling.

- This brings more structure to a application module and paves way for
  having a different views such as dashboard.
2016-02-28 19:37:23 +05:30
Sunil Mohan Adapa
1f5fa31e53
package: Remove old package installation methods 2016-02-13 13:52:33 +05:30
Sunil Mohan Adapa
7a4a8fbc99
views: New view to show setup need and progress 2016-02-13 13:50:12 +05:30
James Valleroy
eca896a2e8 Fix missing import and pass before_install correctly. 2015-05-24 17:25:54 +05:30
Sunil Mohan Adapa
07ee03941f Redirect to apps page always from index page
- Plinth will become the home page for FreedomBox.  So it has to serve
  the purpose the directing users to available services.  This will
  happen most often and should also work when users are not logged in.

- Soon we will have a resigned 'front page'/'apps' section which is
  expected to be shown to user who are not logged in too.

- Apps menus has been removed.  Index page is now the only way to reach
  Apps section.
2015-05-01 21:14:04 -04:00
Sunil Mohan Adapa
3a22e1717e packages: refresh package list before install and handle errors
- Refresh package list before trying to install packages.  Also lookup
  the ID of the package, including the version, using the newly fetched
  package list.

- Call on_install() callback requested by modules only if the package
  installation was successful.  Handle any exception raised in the
  callback itself.

- Handle exceptions raised during packagekit operations.  Also check the
  returned results for error code.

- Capture error/success status during a transaction.  Don't destroy the
  transaction object until the error/success status has been collected.
  When a view is refreshed after completion of a transaction collect the
  result of the transaction and show it to the user.

- Handle cases where package searches in the package list fails.  Simply
  show the package name without its description.
2015-04-04 12:25:12 -04:00
Sunil Mohan Adapa
be838a30c1 package: Add ability to receive notification on install
- Fix issue with Mumble firewall enabling after a fresh install.
2015-03-28 16:02:39 -04:00
fonfon
e905d1a8f2 packagekit: use TemplateView instead of FormView
For the installation procedure a TemplateView is sufficient, and the user
won't be able to edit any form-data on the client-side.
2015-01-05 00:27:45 +05:30
Sunil Mohan Adapa
a4be460538 Introduce framework for checking/installing packages
- Uses PackageKit dameon, Glib library wrapping packagekit DBUS API and
  Python bindings for the Glib library.

- Implement a decorator to wrap views requiring packages.

- Framework allows for parallel operations.  However, doing parallel
  operations hangs because of what appears to be PackageKit backend
  limitations.
2015-01-05 00:13:19 +05:30
Sunil Mohan Adapa
65fa648d9f Reorganize python sources into 'plinth' package 2014-08-29 12:57:27 +05:30