9 Commits

Author SHA1 Message Date
Sunil Mohan Adapa
5234bffb3b Don't restart webserver unnecessary
Some of the important modules such as php5, cgi and authnz_ldap are
enabled by default in freedombox-setup.  However, when installing
ikiwiki we still restart the apache2 web server.  This patch fixes that
by restart or reloading only when the corresponding module/config/site
is not already in the state required.
2015-12-03 17:55:22 -05:00
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
James Valleroy
e7b68f7e28 diagnostics: Remove extra 'error' displayed results.
Just show 'error' for missing command.
2015-08-29 09:37:35 -04:00
James Valleroy
9a25e6b21d tor: Add torsocks as required package, needed for diagnostics.
Display error for diagnostic if command is missing.
2015-08-29 07:48:06 -04:00
Sunil Mohan Adapa
49c4c1dce6 diagnostics: Action helpers for modules
- Helper for checking whether a port is being listened on.

- Helper for checking whether a URL is accessible.

- Helper for checking whether a URL is accessible with all possible IPs
  and machine names.

- Helper for checking whether it is possible to connect to a port.
2015-08-29 06:22:01 -04:00
Sunil Mohan Adapa
ac19238e91 Add utilites for Apache configuration management 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
517c364559 pagekite: Move to using python3-augeas
- Merge actions/pagekite_util.py into plinth/modules/pagekite/util.py.

- Rename plinth/modules/pagekite/util.py to utils.py.

- Add python-augeus as dependency.

- Move actions/util.py to plinth/action_utils.py and update services
  that use it.

- Rename _run() method to run() as it is being used publicly.

- Import the utils in a more conventional manner.

- Move all python2 bits to python3.
2015-07-19 15:37:43 -04:00