15 Commits

Author SHA1 Message Date
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
Johannes Keyser
634afef1c9
actions: Make subparsers mandatory, fixes calls without arguments
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2017-04-10 11:54:23 +05:30
Sunil Mohan Adapa
7cf47bbcb2 deluge: Remove get-enabled from actions
- Use webserver action utilites.

- Move status getting to module __init__.py so that it can be turned
  into an API in future for further simplificaiton.

- Apply this to other modules too in future commits.
2015-07-19 19:54:13 -04:00
Sunil Mohan Adapa
07e2c0ce14 Don't use actions to check if service is running
- To check whether a service is running does not require root
  privileges.  This can directly be done from a module without any
  action.

- Since actions are allowed to be run using sudo, introducing
  unnecessary sub-commands increases attack surface.

- Simple functions calls are unnecessarily being converted to command
  line invocations and involve parsing response.

- There is a lot of repeated code because of this that can be
  eliminated.

- To generalize this, we need to make all non-root system operations
  directly from module instead of delegating to action commands.
2015-07-19 19:54:13 -04:00
Sunil Mohan Adapa
3b6af2f29c Use only action utilities for service management
- When disabling a service, ignore if unable to stop the service.
2015-07-19 19:54:13 -04:00
Sunil Mohan Adapa
0335ee9c32 deluge: Further improvements to actions
- Perform disable even when the service is not running.

- Improve checking if deluge is enabled.
2015-06-28 11:17:17 +05:30
Sunil Mohan Adapa
21e12b3c1f deluge: Perform setup operations during enable
We should use on_install setups as sparingly as possible.  We don't get
callbacks in cases where package is already installed.  Until we
implement our versioned setup mechanism, doing some idempotent setup()
during enable() is much safer.
2015-06-26 18:52:26 +05:30
James Valleroy
2871519322 deluge: enable/disable refactoring 2015-06-26 17:34:38 +05:30
James Valleroy
5712c3d9ea deluge: Also disable the service when stopping. 2015-06-26 17:34:38 +05:30
James Valleroy
fd73bcd734 deluge: Run setup and enable after install. 2015-06-26 17:34:38 +05:30
James Valleroy
9c717246ee deluge: Install apache conf file during Plinth install. 2015-06-26 17:34:37 +05:30
Sunil Mohan Adapa
939f330816 deluge: Auto start deluge-web using systemd 2015-05-10 14:57:20 +05:30
Sunil Mohan Adapa
a6fa7abbad deluge: Minor fixes and styling
- Updated comments

- Start the daemon before enabling Apache configuration.

- Warn the user about editing the Apache configuration for Deluge.

- Other minor updates.
2015-05-10 13:44:33 +05:30
Sunil Mohan Adapa
6a57dc78f3 deluge: Make starting/stopping daemon safer
- Match the daemon using uid, name and a pidfile for a safer match.

- Make start process idempotent.
2015-05-10 13:40:15 +05:30
Sunil Mohan Adapa
51e6aa3df6 deluge: Rename from bittorrent to deluge
- There could be multiple applications for the same functions.  Although
  in the interface we should we show generic names like 'BitTorrent', we
  could use specific names in the backend.

- There is already a bittorrent client: Transmission.
2015-05-10 10:08:06 +05:30