1782 Commits

Author SHA1 Message Date
James Valleroy
28bc880dc5
wireguard: Write pre-shared key to tempfile
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-01-18 13:53:07 -05:00
James Valleroy
aa66a9135c
wireguard: Add views for editing and deleting clients and servers
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-01-18 13:53:03 -05:00
James Valleroy
6b39aa8075
wireguard: Encode public keys for use in URLs
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-01-18 13:52:58 -05:00
James Valleroy
aed82eca1b
wireguard: Show this box's public key
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-01-18 13:52:54 -05:00
James Valleroy
966b179756
wireguard: Add server information view
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-01-18 13:52:50 -05:00
James Valleroy
36fdedb9a7
wireguard: List peers in client section
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-01-18 13:52:48 -05:00
James Valleroy
901f89f393
wireguard: Form to add server
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-01-18 13:52:46 -05:00
James Valleroy
5d287ce579
wireguard: Add client info view
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-01-18 13:52:44 -05:00
James Valleroy
415e1eb4ba
wireguard: Allow deleting a client
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-01-18 13:52:42 -05:00
James Valleroy
e00c28f36e
wireguard: Show list of added clients
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-01-18 13:52:40 -05:00
James Valleroy
aa02f4d710
wireguard: Implement adding client
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-01-18 13:52:38 -05:00
James Valleroy
6aa83e7118
wireguard: Add skeleton for new app
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
[sunil: Use the form from base template to show enable/disable properly]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-01-18 13:52:35 -05:00
Veiko Aasa
3a202af843
samba: Add unit and functional tests
- Add functional tests
- Add unit tests for samba views
- New dependency for running functional tests: smbclient
- Make port configurable for the smbclient

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
2020-01-17 02:47:06 +05:30
Allan Nordhøy
aa69585cb6
samba: Fix spelling
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-01-16 18:23:05 +02:00
James Valleroy
693b109806
security: Add explanation of sandboxing
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-01-13 12:11:05 -08:00
James Valleroy
f6c7f77c0f
matrixsynapse: Allow upgrade to 1.8.*
- Use new configuration from package.
- Re-run the post-install to set our custom config.
- Re-apply setting for public registration if enabled.

Tested by manually downgrading matrix-synapse to 1.6.1-1 and then
running apt update.

Fixes #1754.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-01-13 11:55:04 -08:00
Veiko Aasa
ff27f1d21b
deluge: Manage starting/stoping deluged
- run deluged daemon with default configuration location
- deluge-web: autoconnect to the deluged daemon
- functional tests: assert deluge-web is connected to the deluged daemon

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-01-12 15:55:49 -05:00
James Valleroy
0460ecf89f
openvpn: Add diagnostic for ipv6 port
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2020-01-04 15:18:06 -05:00
Sunil Mohan Adapa
0a48175249
storage: Ignore errors resizing partition during initial setup
On Raspberry Pi 3B+ image, it was observed that resizing partition fails during
initial setup. Due to this, Apache, SSH and Plinth become unavailable. Since
resizing the partition is not a critical operation to perform to bring up
FreedomBox, it is safe it ignore the error. In these cases, the user will have
to the storage app and retry manually after bring prompted by low disk space
message.

Tests:

- Introduce deliberate error in expand partition operation. Modify code to
  always detect that partition can be expanded. Remove storage module from
  plinth_module table in plinth.sqlite3. Run plinth. Notice that storage setup
  is run but expanding partition fails. Even after expanding partition fails,
  storage module is fully setup. Plinth proceeds with starting web server and
  storage module is found in the plinth_module table of plinth.sqlite3.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-01-04 09:08:43 -05:00
Joseph Nuthalapati
cfe014a3f4
mediawiki: Allow admin to set default skin
Fixes #1731

Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
[sunil: Refactor getting skins and form field for simplicity]
[sunil: Remove incorrect change to showing success form message]
[sunil: Minor simplification to editing the configuration]
[sunil: Read configuration value enclosed in single as well as double quote]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-01-03 16:31:28 -08:00
Joseph Nuthalapati
890d45bd64
mediawiki: Use a mobile-friendly skin by default
- Timeless is a mobile-friendly skin.
- This is a cheaper solution for FreedomBox as compared hosting a
  separate mobile website like the WikiMedia sites do

Fixes #1732

Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
[sunil: Remove unneeded upgrade to app version number]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-01-03 16:31:25 -08:00
Sunil Mohan Adapa
9e166f799c
gitweb: Fix flake8 error that is causing pipeline failures
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-01-02 17:49:02 -08:00
Nektarios Katakis
018767aaae
openvpn: Enable support for communication among all clients
Closes: #1694

Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-01-02 16:54:29 -08:00
Veiko Aasa
171f2976cf
gitweb: Add tests for views
- Delete unused key from repo info dict
- Rename actions test file

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
[sunil: Make URLs setup cleanup properly, minor cosmetics and warning fixes]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-01-02 16:31:37 -08:00
Veiko Aasa
e6b0d732d5 users: Fix test fixture that disables console login restrictions
Fixes pytest StopIteration errors when console login restrictions are disabled
before running tests.

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
2020-01-02 19:04:38 +02:00
Sunil Mohan Adapa
8a4fd1def4
mediawiki: Fix problem with session cache failing logins
Set the session cache to use database. This will also have the added benefit of
sessions persisting across reboots (and PHP session cleanups). See bug report on
why this is needed. https://salsa.debian.org/freedombox-team/plinth/issues/1736

We are unfortunately modifying the MediaWiki settings that file that we are
shipping when preferences are modified in the FreedomBox UI. This means that if
a newer version of this settings file is shipped, then FreedomBox package will
show configuration file prompts. To solve this, introduce a new static settings
file that will have lower priority than the file modified by FreedomBox UI.

Closes: #1736.

Tests:

- Test that running FreedomBox daemon with changes runs the MediaWiki app's
  setup and introduces the new line into LocalSettings.php

- That LocalSettings.php will be populated with lines to include
  FreedomBoxStaticSettings.php and FreedomBoxSettings.php in that order when
  'actions/mediawiki setup' is run. This should work when no lines are present,
  one of the lines is already present and both the lines are already present.

- Test that running './setup.py install' installs FreedomBoxStaticSettings.php.

- Test that MediaWiki runs without FreedomBoxStaticSettings.php

- Test that private wiki and public registrations settings work with the new
  changes.

- Run functional tests for MediaWiki app with the changes.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-12-30 20:38:30 -05:00
James Valleroy
89aefc00cf
security: List whether each app is sandboxed
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
[sunil: i18n for yes, no, N/A strings, avoid changing an i18ned string]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-12-30 12:29:23 -08:00
Sunil Mohan Adapa
1be1af9b18
minidlna: Fix showing clients information
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-12-30 11:38:05 -05:00
Sunil Mohan Adapa
f65b4ec407
views: Don't require sending diagnostics module name separately
- Reuse the app_id already available to the view.

- Implement automatically detecting if an app has implemented diagnostics.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-12-30 11:38:02 -05:00
Sunil Mohan Adapa
636aa05b66
app: Implement API to check if app/component has diagnostics
- Use the API to skip diagnosing apps that don't implement diagnostics.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-12-30 11:38:00 -05:00
Sunil Mohan Adapa
e0dba2cc17
apache: Move diagnostics for checking URLs into apache module
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-12-30 11:37:57 -05:00
Sunil Mohan Adapa
c617cecc02
daemon: Move diagnosing using netcat to daemon module
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-12-30 11:37:54 -05:00
Sunil Mohan Adapa
97d8166f31
daemon: Move diagnosing port listening into daemon module
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-12-30 11:37:52 -05:00
Sunil Mohan Adapa
a1fd8f45be
cosmetic: Yapf and isort fixes
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-12-30 11:37:49 -05:00
Sunil Mohan Adapa
2ebb565c92
diagnostics: Use new component based API for all diagnostic tests
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-12-30 11:37:46 -05:00
Sunil Mohan Adapa
1f14c42af5
firewall: Implement new diagnostic tests to check port status
- Test that a port meant to available to internal network is available.

- Test that a port meant to available to external network is available.

- Test that a port meant to unavailable to external network is unavailable.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-12-30 11:37:43 -05:00
Sunil Mohan Adapa
0d5493dae7
apache: Implement diagnostic test for web server component
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-12-30 11:37:35 -05:00
Sunil Mohan Adapa
176e7ecae3
help: Refactor to move app into __init__.py for consistency
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-12-30 11:37:19 -05:00
James Valleroy
ddd1abdb8a
upgrades: Add systemd sandboxing features to repository setup service
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-12-29 17:49:13 -08:00
James Valleroy
c91939710b
storage: Add systemd sandboxing features to udiskie service
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-12-29 17:49:10 -08:00
James Valleroy
1498a9ae83
infinoted: Use systemd sandboxing features
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-12-29 17:49:07 -08:00
James Valleroy
b4e00d2574
deluge: Use systemd sandboxing features
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
[sunil: Remove directive for unused logs directory]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-12-29 17:48:31 -08:00
James Valleroy
bc748ed5bb
mldonkey: Add ProtectKernelLogs
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-12-29 17:47:49 -08:00
James Valleroy
c9d9d4736b
firewall: Support upgrading firewalld to 0.8
Closes #1737.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-12-29 14:46:36 -08:00
Veiko Aasa
aa2aa56c46
users: Add tests for the Samba user database
Fix: after renaming a user delete old username from the Samba password database

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-12-29 16:59:04 -05:00
Veiko Aasa
962e5b488f
storage: Tests for the directory validation action
Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-12-26 16:37:01 -05:00
James Valleroy
2351744024
samba: Fix spelling in description
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2019-12-20 21:29:12 -05:00
Veiko Aasa
83cb305026
samba: private shares
- new share types - group and home shares
- users: when creating, deleting or changing user password, update also Samba
  tdbsam backend database
- users: new managed packages - samba-common-bin, tdb-tools
- module page: show current samba users who are in freedombox-share group
- module page: show users who should re-enter their password in the password change page
- fix: use os.path.ismount() from Python standard library to validate a mount point
- fix: samba share permissions, fixes #1729
- fix: delete a share - do not raise an exception if the share doesn't exist
- storage: show samba share type in the directory selection form

Closes #1727

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-12-20 21:01:12 -05:00
James Valleroy
83ca977dd4
users: Use service action to restart share group service
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2019-12-15 19:08:18 -05:00
Veiko Aasa
6bf6740b23
transmission: New directory selection form
- use new directory selection form (#1703)
- add transmission-daemon to the freedombox-share group
- pass only needed data to the template
- do not change or validate download directory if transmission
  module is going to be disabled
- yapf3 validation changes

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-12-15 19:08:14 -05:00