32 Commits

Author SHA1 Message Date
Alice Kile
eb83e00011
fix formatting issues
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-12-07 13:08:35 -05:00
Sunil Mohan Adapa
ec68eb3d89
setup: Make additional info available for force upgrading
This includes list of packages for which conffile prompts will be shown. For
each package current version of the package, new version of the package and list
of configuration files that were modified.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-02-28 20:48:51 -05:00
Sunil Mohan Adapa
c8b2ba8c99
package: Helper method to filter packages that need conffile prompt
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-02-26 06:24:17 -05:00
Sunil Mohan Adapa
920d083301
setup: Add option to handle configuration prompts during install
This is optional and does not affect normal installations. However, when
performing configuration migration in FreedomBox (due to unattended-upgrades
refusing it), it is useful as a part of strategy to read configuration, force
install new configuration files and apply configuration again. This option can
be used on such cases.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-02-13 06:42:50 -05:00
Joseph Nuthalapati
3d38b8a686
backports: Add buster-backports to apt sources list
Fixes freedombox-team/freedom-maker#149

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-02-05 14:58:27 -08:00
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
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
Sunil Mohan Adapa
79276f14df
Don't use async for method parameters
async is a reserved keyword in Python 3.7. It can no longer be used as method
parameter. Change the name so that we are ready for Python 3.7.

See: https://www.python.org/dev/peps/pep-0492/#deprecation-plans

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-02-24 19:14:13 +01: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
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
Vikas Singh
5c83dea442
actions: Allow not printing error when an action fails
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2018-01-30 10:57: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
James Valleroy
a1a8e17497
Clean up remaining references to packagekit 2016-09-03 10:02:36 +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
55cabdaa2e
package: Better error handling 2016-02-13 13:52:37 +05:30
Sunil Mohan Adapa
1f5fa31e53
package: Remove old package installation methods 2016-02-13 13:52:33 +05:30
Sunil Mohan Adapa
716ba5f1a0
package: Expose starting install without thread 2016-02-13 13:49:45 +05:30
Sunil Mohan Adapa
20a97488d9
package: Proper string casting of PackageException 2016-02-13 13:49:37 +05:30
Ruben Lubbes
fad7448417 More punctuation and minor errors changed 2015-12-09 23:55:55 +05:30
Sunil Mohan Adapa
9be80b2483 packages: Fix issue with handling some errors
I got an error when one of the sources in my sources.list is untrusted.
The error code was available as 'gpg-error' and more description was
available.  Our untested code to handle that threw an exception in that
case.  This patch fixes it.  I have tested with the error I got as the
error was easily reproducible.
2015-12-03 17:55:22 -05:00
Sunil Mohan Adapa
cc858bbd6a Use pgi only when gi is not available
- Write a convenience utility to handle the import process.
2015-11-16 09:55:20 +05:30
Nik Nyby
608897b9ec Test on python 3.3 and 3.4 with travis
Python 3.2.x is deprecated, so I thought it would be
good to get tests running on some newer pythons. I've
switched from the python3-gi package to using 'pgi' from
pypi, because the apt-installed python3-gi was having trouble
importing.

pgi required python 3.3+ (see: https://pypi.python.org/pypi/pgi),
so I've removed python 3.2 from the test matrix. Let me know if
we're using python 3.2 anywhere, but as far as I know plinth is
run on python 3.4.3 with debian sid on the freedombox image.
2015-11-16 08:44:01 +05:30
Sunil Mohan Adapa
3df1a88824 Switch to Django i18n for code strings
Django i18n layer is on top of gettext and provide may crucial features
such as per-request locales, lazy translations etc.
2015-11-13 22:08:43 +05:30
Sunil Mohan Adapa
2ef22ec1b4 Require library version for GObject introspection
Specify the version of a library before importing it using GObject
introspection.  Mainly to avoid warnings with recent version of
pygobject.  Closes #247.
2015-10-17 21:13:35 -04:00
Sunil Mohan Adapa
b4c487f520 package: Fix showing error during pre/post install
When an ActionError is raised during pre_install or on_install action,
the error is not being shown.  Instead an error is being raised.  This
fixes that.
2015-08-18 21:23:02 +05:30
James Valleroy
ca61649105 xmpp: Preseed debconf values before ejabberd and jwchat packages are installed. 2015-05-24 17:25:54 +05:30
Sunil Mohan Adapa
a2039c342d packages: handle speed updates during installation 2015-04-04 12:25:12 -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
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