712 Commits

Author SHA1 Message Date
Sunil Mohan Adapa
68bc333842
updates: Allow matrix-synapse 1.3 to be installed for buster users
- matrix-synapse 1.2 is already unavailable in buster-backports, testing and
  unstable. It is replaced by matrix-synapse 1.3. Allow matrix-synapse 1.3 to
  become available for Buster users.

- Allow upgrades to all future versions of matrix-synapse from buster-backports.
  Since buster-backports does not have security updates except that provided
  by the maintainer, it is best to let users be on the latest version provided
  by the maintainer in buster-backports.

- We don't pick and choose among the versions uploaded to backports. Once we
  allow a package to upgrade to backports version, we should continue to do that
  without any further restriction. Update descriptions accordingly.

- Simplify updating the apt preferences file by providing a simple configuration
  instead of creating the file on the fly.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-08-25 17:41:58 -04:00
Sunil Mohan Adapa
caa266e348
users: Don't fail badly when admin group does not exist
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-08-25 15:52:08 -04:00
Sunil Mohan Adapa
7499b687c8
users: yapf cosmetic changes
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-08-25 15:52:00 -04:00
Joseph Nuthalpati
9b46d1a661
matrix-synapse: Allow installation of version 1.2 from backports
Used version pinning instead of release pinning to avoid unexpected upgrades for
users running FreedomBox stable.

Explanation for backports:
This fixes incompatibility issues with newly created rooms on Matrix Synapse
versions 0.99.5 and above. Users on stable using 0.99.2 might not be able to
join those rooms, especially direct chats.

Fixes #1600

Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-08-20 20:14:36 -04:00
Sunil Mohan Adapa
0dba497383
ejabberd: Use domain added signal for listening to domain changes
In the action, the new domain is always extended to the list of domain names
accepted by ejabberd. To simplify domain handling simply use the domain_added
signal.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-08-11 18:40:06 -04:00
Sunil Mohan Adapa
0d0ee32a87
ejabberd: Ensure that hosts are not duplicated in configuration
This is non-essential as there seems to be no problem for ejabberd with
duplicated host names.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-08-11 18:40:04 -04:00
Sunil Mohan Adapa
76725a0068
cockpit: Don't error out when removing an unknown domain
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-08-11 18:40:02 -04:00
Sunil Mohan Adapa
8ece36893c
letsencrypt: Revoke certificate only if it exists
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-08-11 18:39:58 -04:00
Sunil Mohan Adapa
c3a3d80ea5
storage: yapf changes
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-08-07 05:40:07 -04:00
Sunil Mohan Adapa
8b96ea0698
storage: Fix incorrect i18n when throwing and error
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-08-07 05:40:00 -04:00
Joseph Nuthalapati
654d69a389
sharing: Simplify --is-public option
Use store_true with default=False to toggle public status based on whether
'--is-public' argument is passed or not.

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-07-22 17:56:50 -04:00
Joseph Nuthalapati
1eec1cf9ce
sharing: Allow directories to be publicly shared
Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-07-22 17:56:35 -04:00
Sunil Mohan Adapa
49b543599a
ejabberd: Add let's encrypt component for managing certificates
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2019-07-16 15:13:44 +05:30
Sunil Mohan Adapa
9fd1b95244
matrixsynapse: Add let's encrypt component for certficiates
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2019-07-16 15:13:35 +05:30
Sunil Mohan Adapa
254b8a98a9
letsencrypt: Handling certificate renewals when daemon is offline
During boot or in other situations when FreedomBox Service is offline, Let's
Encrypt certificate renewals might happen. When FreedomBox Service starts, check
on such certificates and run certificate setup mechanism in each app to use the
latest renewed certificate.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2019-07-16 15:13:21 +05:30
Sunil Mohan Adapa
da366636d8
letsencrypt: Implement action to compare copied certificates
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2019-07-16 15:12:16 +05:30
Sunil Mohan Adapa
ebbc9912d2
letsencyrpt: Implement action to copy certificates
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2019-07-16 15:12:05 +05:30
Sunil Mohan Adapa
c042ff5a2e
letsencrypt: Add lineage information in status
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2019-07-16 15:11:57 +05:30
Sunil Mohan Adapa
486f91d129
letsencrypt: Remove old style hooks from all configuration files
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2019-07-16 15:10:56 +05:30
Sunil Mohan Adapa
d8647aaf18
letsencrypt: Remove renewal hooks implementation
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2019-07-16 15:10:38 +05:30
Sunil Mohan Adapa
a134311663
letsencrypt: Force commands to be non-interactive
This fixes issues with revoking certificates.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2019-07-16 15:10:27 +05:30
Sunil Mohan Adapa
d8ddf6abff
service: Implement action for systemd try-restart
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2019-07-16 15:09:37 +05:30
Sunil Mohan Adapa
dd5d93637f
backups: Don't send passphrase on the command line
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2019-07-03 12:44:54 +05:30
Joseph Nuthalapati
3a6dcbe7a7
Verify SSH hostkey before mounting
Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2019-07-03 12:42:41 +05:30
Sunil Mohan Adapa
20aa2abe3b
radicale: Workaround issue with creating log directory
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-06-13 20:18:05 -04:00
Sunil Mohan Adapa
e4351b6b97
Introduce daemon component to handle systemd units
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-06-13 20:18:02 -04:00
Sunil Mohan Adapa
862d87920a
Introduce uwsgi component to manage uWSGI configuration
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-06-13 20:17:53 -04:00
Sunil Mohan Adapa
4100d36381
Introduce webserver component for managing Apache configuration
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-06-13 20:17:49 -04:00
Joseph Nuthalapati
23e4aac400
searx: Improve functional tests
- Make tests more semantically correct
- Add implementation for missing fixture - When I log out
- Check whether file exists when disabling public access

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-06-09 10:40:54 -04:00
Joseph Nuthalapati
7e1e5182cc
searx: Preserve public_access setting
- Preserve the setting during enable/disable as well as during backup/restore.
- Show setting as disabled when application is disabled but restore user's
  original preference value on enable.
- Add functional test for this.

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-06-09 10:40:49 -04:00
Joseph Nuthalapati
2d85b61199
searx: Add option to allow public access to the application
[jvalleroy] Resolved merge conflict to use shortcut component.

Fixes #1590

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-06-09 10:37:16 -04:00
Sunil Mohan Adapa
75c57d3e00
Turn frontpage shortcut into an app component
- Turn frontpage shortcut into an App component. Add tests and full
  documentation.

- Overridden implementations for tahoe, diaspora, mediawiki shortcuts to handle
  special cases. Special handling for ikiwiki.

- Extend App API for removing and retrieving a component.

- Add clients information into shortcuts to avoid hacks when presenting
  shortcuts to Mobile devices via API.

- Fixed unnecessary stripping and adding of '/' when setting home page redirect
  URLs. This fixes problem with setting Cockpit as home page.

- Replaced the use of term 'app' in favor of 'shortcut' as the term when setting
  frontpage shortcuts as home page.

- JSXC shortcut does not require login.

- Don't show shadowsocks for anonymous users.

- Simplify showing selected shortcut details.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-06-07 11:48:08 -07:00
Sunil Mohan Adapa
97ed7fe144
i2p: Minor flake8 and yapf fixes
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-04-29 16:51:54 -07:00
LoveIsGrief
f7d9c9eff5
i2p: Include default favorites after installation
The default favorites might change and we might have to update the list but for
now they were extracted from a clean router.config saved by the i2p daemon.

1528 - augeas for router.config

Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-04-29 16:51:19 -07:00
LoveIsGrief
1c9ad9f953
i2p: Use augeas for editing the router.config
It's cleaner and less hacky, however we still overwrite the default favs because
they aren't written to the file by i2p until a change is made manually in the
frontend.

We still need to recreate the list of default and add them manually.

Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-04-29 16:50:40 -07:00
Sunil Mohan Adapa
a73f002ed6
i2p: flake8 and yapf fixes
- Run isort and yapf.

- Better docstrings.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-04-29 15:02:20 -07:00
LoveIsGrief
5c26c28f96
i2p: Open HTTP(S) and IRC ports on all interfaces on install
I2P has to be restarted in order for the changes to take effect.

Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-04-29 15:01:50 -07:00
James Valleroy
e5081018a3
firewall: Get service ports details
Add interface to get port types and numbers for a service.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-04-28 20:59:15 -07:00
Joseph Nuthalapati
a2d07fef0b
storage: Use udisks to list disks and df for disk space utilization
- Fetch disk information for all disks using udisks
- Call df as superuser so that all disks are listed (udisks doesn't need sudo)
- Improved implementation to check if device is removable

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-04-14 11:27:43 -04:00
Sunil Mohan Adapa
6e5a45a9b3
i2p: Review and cleanup action script
- Remove unneeded actions: start, stop, restart, is-running and is-enabled.

- Remove short form parameter passing for add-favorite action. Mostly for
  consistency and avoid confusion. Actions are not expected to be used by
  regular users.

- Rename Apache configuration from: i2p-plinth.conf to i2p-freedombox.conf

- Fix issue with adding favorites when none already present. This eliminates
  failure during first time installation for I2P.

- Fix issue with incorrect new lines while editing favorites.

- Minor fixes in Apache configuration.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-04-01 17:33:55 -07:00
Sunil Mohan Adapa
ba4d73ae60
i2p: Minor styling changes
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-04-01 17:33:45 -07:00
Sunil Mohan Adapa
70a9f4a6ae
apache: Add proxy_html module needed by i2p app
Enable by default so that app installation (algo during backup restore) does not
cause apache to restart and show error pages.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-04-01 17:33:38 -07:00
LoveIsGrief
0b2922749b
i2p: setup: Enrich I2P favorites
3 search engines and a torrent tracker added to the favorites

freedombox-team/plinth#1428 Request: I2P support

Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-04-01 17:33:12 -07:00
LoveIsGrief
25d3f76434
i2p: Add new application
- installs i2p from apt
 - accessible under /i2p/
 - needed to modify diagnostics url to include numbers

TODO:

 - fix CSS at /i2p/ : firefox NS_ERROR_INVALID_CONTENT_ENCODING ???
 - all green diagnostics
 - functional tests
 - autoconfiguration in setup form
 - configuration of SOCKS5 proxy for network interfaces

Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-04-01 17:32:37 -07:00
Sunil Mohan Adapa
bd20b6570b
ttrss: Implement upgrade from 17.4 to 18.12
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-03-01 23:50:45 -05:00
Sunil Mohan Adapa
0dea9e80f3
ttrss: Make setup process reusable
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-03-01 23:50:42 -05:00
James Valleroy
7ee48da299
security: Migrate access config to new file
Fixes #1504

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-03-01 20:09:40 -08:00
Sunil Mohan Adapa
f524219387
openvpn: Work around firewalld bug 919517
Instead of using a wildcard tun+ interface, use a fixed number of tun
interfaces and hope OpenVPN will use one of them.

Fixes: #1438.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-03-01 22:01:09 -05:00
Sunil Mohan Adapa
117c3d7507
openvpn: Fix issues with upgrade easy-rsa 2 to 3 migration
- Set permissions properly as if they are created newly.

- Ensure that configuration file is rewritten so that new certificate paths are
  used.

- Run easyrsa init-pki to ensure that configuration file is present.

- Create necessary empty directories as per new structure.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-03-01 18:13:37 -05:00
Joseph Nuthalapati
544c317cd2
openvpn: Migration from easy-rsa 2 to 3 for existing installations
- Change file and directory structure from easy-rsa 2's flat format to easy-rsa
  3's format.

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-03-01 18:13:27 -05:00