20 Commits

Author SHA1 Message Date
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
Joseph Nuthalapati
647139f17e
Don't disable installation when apt lists are empty
We are wrongly showing a warning message and disabling the install button on the
setup page on newly spun up AWS cloud images. This is a false positive since the
applications might be available in Debian but the apt caches are not updated.
Taking care of this issue as well.

The function returns None and not False to distinguish this as a case different
from returning a result about whether the package is unavailable or not.

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-09-29 22:02:34 -04:00
James Valleroy
c511dab7ff
package: Add option to skip recommends
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2018-07-02 19:00:24 -04:00
Joseph Nuthalapati
70b568d579
setup: Remove unavailable as a state in setup_helper
- Unavailable being a state can cause issues in several places in the where
  there are currently only checks for 'needs-setup'
- Since it's only used in the UI, a method to check whether a module is
  unavailable should be sufficient.

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-05-19 08:06:44 -04:00
Johannes Keyser
3a9c4128ff
setup: disable install button for currently unavailable apps
- Fixes #1229.

Signed-off-by: Johannes Keyser <johanneskeyser@posteo.de>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-04-20 20:12:46 -04:00
Sunil Mohan Adapa
90f2117554
Rename Plinth to FreedomBox in comments
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-02-16 20:10:45 -05: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
Joseph Nuthalapati
63e67b5688
YAPF formatting and optimization of imports
Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2018-01-30 10:49:20 +05:30
Joseph Nuthalapati
4826f70343
firstboot: Fix caching issue in collecting first_boot steps
- Created a django singal to indicate that a setup happened

- Clearing the cached list of firstboot_steps each time the above signal is sent

Closes #1193.

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2018-01-30 10:48:48 +05:30
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
Sunil Mohan Adapa
375f594808
Add argument to list packages needed by apps 2016-09-17 13:48:46 -04:00
Sunil Mohan Adapa
b097731e40
setup: Fix arguments to setup without install
- When arguments are passed to --setup-no-install, use them correctly.

- Explicitly initialize member in constructor

- Minor indentation
2016-09-03 11:28:58 +05:30
James Valleroy
548e0ebd60
Add --setup-no-install command
Acts the same as --setup, but does not install any packages. Will
raise an error if any required package is not already installed.
2016-09-03 10:02:54 +05:30
Hemanth Kumar Veeranki
60e808e9bb
Added option for plinth --setup
Now plinth --setup could take a list of modules to setup
2016-07-31 14:15:57 +05:30
Sunil Mohan Adapa
7a9a4cd861
packages: Switch to installing with apt-get
- Use action helper so that Plinth can run unprivilaged and action
  script can run as root.

- Use Status-Fd feature of apt-get to report progress.  Don't report
  much detail.

- Capture all stderr of the apt-get process and present it only in case
  of failure.

- Remove package installation using PackageKit.  Remove dependency on
  PackageKit.

- Merge --setup package installation with regular package installation.

This should fix the following problems:

- PackageKit throws errors when APT encounters an error and later
  corrects them and proceeds well.  This is reported upstream but not
  fixed.

- PackageKit does not install recommends by default and there is no easy
  way to tell it to do so.

- In some rare cases, PackageKit could get stuck for interactive input
  even though interactive flag is set to false.

- PackageKit does not work without network manager connections. (Could
  have been mitigated by altering packagekit configuration).

- PackageKit glib library leaks file descriptors after each operation.
  This leads to running out of fds during long running refresh
  operations such as OpenVPN setup.  (This should have subsided by not
  checking package install with the new setup mechanism.)]

Known issues:

- In development mode, inside action scripts the python modules are
  always loaded from system path and not development directory.

- With PackageKit it is possible to run multiple operations
  simultaneously.  Others would wait while the first is being
  installed.  With new implementation, the others error out unable to
  obtain lock.
2016-06-11 12:11:40 -04:00
Sunil Mohan Adapa
567fd590ab
setup: Run first time setup with apt
Due to problems with running PackageKit inside foriegn binary Qemu, this
is a fallback solution to use apt-get directly instead.
2016-05-08 10:46:57 +05:30
Sunil Mohan Adapa
1f5fa31e53
package: Remove old package installation methods 2016-02-13 13:52:33 +05:30
Sunil Mohan Adapa
be6ccabec2
setup: New module to handle application setup
- There shall be a setup helper object in every module.  The setup
  process will simply call methods in helper.

- Helper is responsible for loading/storing/checking module setup
  versions.

- Methods help in showing progress of setup process automatically.
2016-02-13 13:49:59 +05:30