903 Commits

Author SHA1 Message Date
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
5f548a9e36
packages: Make modules declare managed packages
This can then be used by a privileged action to verify that packages
requested for installation are in fact valid.  This slightly improves
security of those privileged actions.
2016-06-11 12:11:32 -04:00
Sunil Mohan Adapa
4f634b86e2
networks: Better explain auto/shared connections 2016-06-07 08:12:25 -04:00
Sunil Mohan Adapa
4865a64d2b
networks: Allow shared connections to have IPs
Setting IP address on a shared connection can be usefull.  This tells
Network Manager to pick the provided network range (inferred from
IP/netmask) instead of something in 10.42.x.x.  This can be used to give
predicatable IPs, static IPs and to make large static
reservations (instead of the default 8).
2016-06-07 08:12:18 -04:00
Sunil Mohan Adapa
ccf217f2f7
pagekite: Fix regression not showing description
After the recent cleanup, pagekite no longer shows description before
installation.  Only after installation does it show the insturctions
about why it is needed.  Also in the description {box_name} is not
substituted and there are incorrect escape sequences.

Revert this earlier change that causes these regressions.
2016-06-07 07:19:30 -04:00
Sunil Mohan Adapa
5a0e2c0b91
pagekite: Move app to system configuration
This app rightfully belongs in system configuration section instead of
the application section.  It is setup once and not used regularly.  It
is not service but enabler for other services.
2016-06-07 07:19:24 -04:00
Sunil Mohan Adapa
fbb2f4c3df
dynamicdns: Move app to system configuration
This app rightfully belongs in system configuration section instead of
the application section.  It is setup once and not used regularly.  It
is not service but enabler for other services.  Closes: #441.
2016-06-07 07:19:04 -04:00
Sunil Mohan Adapa
ad61028a3a
menu: Sort menu items for all locales
Currently menu items are shown in alphabetical order in applications and
no clear order in system configuration.  This is done using static
weights for menu items based on English names that does not work for
other locales.

Sorting can't be done at the time of adding menu items as users of
multiple locales may use the interface at the same time.

Implement a sorting mechanism based on existing order as well as labels
of menu item.  This allows the flexiblity of grouping menu items in
future as it may be need for system configuration.  In case of help menu

Remove sort order for all modules except for help menu as here we want
that specific order.
2016-06-06 17:44:59 -04:00
Allan Nordhøy
1264413a63 Translated using Weblate (Norwegian Bokmål)
Currently translated at 99.1% (581 of 586 strings)
2016-06-05 22:24:08 +02:00
Sunil Mohan Adapa
4fe0067f01
firewall: List a service only if relevant
If a service does not have corresponding firewall ports, don't list it
on firewall page.  Add a simple if condition in the template.
2016-06-05 15:44:55 -04:00
Sunil Mohan Adapa
6d08468933
firewall: List firewall services alphabetically
When firewall services are list, the order changes for every run of
plinth and is not predictable making it hard to lookup a service.  List
services alphabetically to fix the problem.
2016-06-05 15:44:53 -04:00
Sunil Mohan Adapa
4c30d5e8a5
firewall: Don't infer firewall service name
Now that all firewall ports are explicitly specified for all services,
it is safer to remove automatic infering of firewall service name from
systemd service name.  This Closes: #468 where firewall status is
being shown for 'software upgrades'.
2016-06-05 15:44:50 -04:00
Sunil Mohan Adapa
f245e7e763
firewall: Explicitly specify ports for services
It has become confusing to reuse the name of the service for name of the
systemd unit file and firewall port.  This has lead to the regression
that quassel, mumble and minetest can no longer open firewall ports.
Fix this by explicitly specifying ports all services.
2016-06-05 15:44:41 -04:00
Sunil Mohan Adapa
ff53e7d653
diagnostics: Don't run on modules not yet setup
Closes: #248.
2016-06-04 08:13:46 +05:30
Sunil Mohan Adapa
47596c47ff
xmpp: Fix display of domain name in template 2016-06-03 18:53:50 -04:00
Sunil Mohan Adapa
3d5661dc60
action_utils: PEP8 fixes and minor changes 2016-06-03 16:22:06 -04:00
Sunil Mohan Adapa
d3f386733f
diagnostics: Use curl instead of wget for URLs
wget does not seem to support interface scoping for IPv6 addresses.  For
example, http_proxy=http://[fe80::babe:ff:ffff:babe%eth0]:8118/ . Curl
supports this.

This fixes most of the failures for IPv6 related addresses.  Hide the
last failure as there does not seem to be a proper fix from OS level:
when using link local addresses, if a hostname is resolved to IPv6 link
local address, it is not scoped to that interface.  It can't properly be
used by any tool then.
2016-06-03 16:22:02 -04:00
Sunil Mohan Adapa
97b77e3719
diagnostics: Implement scoping for IPv6 addresses 2016-06-03 16:21:59 -04:00
Sunil Mohan Adapa
288a9e7bf9
privoxy: Fix issue with privoxy diagnotic tests
The URL is always https:// so we only need https proxy and nothing else.
2016-06-03 16:21:53 -04:00
Sunil Mohan Adapa
4986d26b5d
middleware: Add tests for setup middleware 2016-06-02 20:13:44 -04:00
Sunil Mohan Adapa
cde615aee6
middleware: Don't interfere in 404 URLs in setup
Don't raise a 404 exception when a page is not found.  Instead, simply
bypass the setup middleware so that other middleware have a chance to
process further.

Slight modification so that resolve method can be mocked during
unittests.
2016-06-02 20:13:40 -04:00
Sunil Mohan Adapa
f34cb78867
middleware: Fix anonymous access to setup view
Django runs process_request() on all the middleware classes in order.
Then it runs process_view() on all of them again.  During the runs, if
any of the views return a HttpResponse.  Further processing is ignored.

Setup middleware was handling process_request() and returning
HttpResponse if the application as not setup.  However, stronghold
middleware handles process_view().  Since process_request happens first
and response is being returned there, stronghold middleware is never
called.

Make setup middleware use process_view() instead.
2016-06-02 20:13:35 -04:00
Sunil Mohan Adapa
9078ec5a2b
Don't write to PID file
When running under systemd, PID is known and maintained by systemd.
Process don't have write PIDs to a PID file.
2016-05-29 21:07:07 +05:30
Sunil Mohan Adapa
1f53321b51
Don't use init.d file, don't daemonize
We pretty much only run in systemd environment and I don't see that
changing any time soon.  By relying on it, we can reduce some burden.
Remove init script.

Daemonizing is not needed for systemd.  Remove code related
daemonization.
2016-05-29 20:32:12 +05:30
James Valleroy
f6884a18fa
Set privoxy listen-address by debconf preseed before install. 2016-05-25 19:23:54 -04:00
Sunil Mohan Adapa
8d9480901b
action_utils: Limited fallback to sysvinit
In case of start/stop/restart/reload and to check whether service is
running, fallback to sysvinit scripts when systemd is not running.  This
happens inside a chroot environment when setup of essential components
is happening.
2016-05-21 16:06:29 -04:00
James Valleroy
f01575e2ea
Move ldap setup from freedombox-setup to plinth. 2016-05-21 16:06:18 -04:00
Sunil Mohan Adapa
60e52d2729
Deal with ownCloud removal from Debian
It has been decided that FreedomBox will no longer support ownCloud due
it's removal from Debian.  To deal with this:

- Don't show ownCloud in Plinth any more for new users.

- For users who have already installed ownCloud, show a warning message
  that they need to migrate away from ownCloud or need to manage it
  manually.
2016-05-17 18:48:08 -04:00
James Valleroy
4e531d8686
Release 0.9.2 2016-05-14 11:43:06 -04:00
Алексей Докучаев
d2bb575842 Translated using Weblate (Russian)
Currently translated at 99.8% (585 of 586 strings)
2016-05-14 15:49:12 +02:00
fonfon
bc2cba0cbf
tor: remove circular import 2016-05-11 18:19:49 -04:00
fonfon
f867ecfb16
Removed (accidentially) duplicate dyndns description 2016-05-11 18:19:46 -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
398e6d7b14
Services: fix unittests 2016-05-11 18:19:39 -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
fonfon
a9528c56d9
Service object to handle services on a system-level
The Service object now offers handling services on a system level,
and gathering information whether it's enabled or running.
New methods: enable, disable, is_enabled, is_running;

For this it needs the correct (system-level) service name.
All of the methods can be overridden/customized.

This changes all modules to the new Service object and deletes
action scripts that are not required anymore.
2016-05-11 18:19:27 -04:00
fonfon
9fe49f881f
Services-Action to handle and list services managed by plinth
- API: start, stop, enable, disable, reload, is-running, is-enabled, list
- only allows access to a service if the service name is listed in a
  'managed_services' variable of any plinth module.
2016-05-11 18:19:14 -04:00
Sunil Mohan Adapa
16d6ff3941
roundcube: Minor fix in setup process notification 2016-05-08 10:47:08 +05:30
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
Mikkel Kirkgaard Nielsen
8340a813e5 Translated using Weblate (Danish)
Currently translated at 99.6% (584 of 586 strings)
2016-05-07 17:49:23 +02:00
Sunil Mohan Adapa
1489b81fee
diagnostics: Fix a warning about a global use 2016-05-07 11:48:18 -04:00
Sunil Mohan Adapa
2f3eba4e10 Translated using Weblate (Polish)
Currently translated at 23.3% (137 of 586 strings)
2016-05-07 16:01:06 +02:00
the29a
f42b455279 Translated using Weblate (Russian)
Currently translated at 100.0% (586 of 586 strings)
2016-05-06 12:45:20 +02:00
the29a
d3a7761a70 Translated using Weblate (Russian)
Currently translated at 100.0% (586 of 586 strings)
2016-05-01 12:45:37 +02:00
the29a
88e35bf476 Translated using Weblate (Russian)
Currently translated at 100.0% (586 of 586 strings)
2016-04-29 11:13:21 +02:00
Daniel Kukula
a007a159a9 Translated using Weblate (Polish)
Currently translated at 23.3% (137 of 586 strings)
2016-04-27 06:44:59 +02:00
Sunil Mohan Adapa
1cdb3e5be1
New locale for Polish (pl) 2016-04-22 06:00:10 +05:30
Ingrid Yrvin
6965b14c4c Translated using Weblate (Norwegian Bokmål)
Currently translated at 98.6% (578 of 586 strings)
2016-04-12 15:44:53 +02:00
Ole-Erik
bf42949dbc Translated using Weblate (Norwegian Bokmål)
Currently translated at 98.4% (577 of 586 strings)
2016-04-09 16:22:32 +02:00