1859 Commits

Author SHA1 Message Date
Sunil Mohan Adapa
3e8ce0c6bd
networks: Minor changes to router/internet configuration forms
- Cosmetic styling fixes. Having doc string as suggested by Python doc string
guidelines.

- 'connected to the Internet' seems much more popular phrase than 'connected on
the Internet' judging by web search results.

- Stylize as 'Internet' for consistency although 'internet' is correct too.

- Add space at the end of main radio button option text as translators seems to
understand it incorrectly. See current Spanish translation.

- Recommend 'DMZ' for router configuration.

- Remove incorrect title casing port forwarding text.

- Internationalize some strings.

- Update the default value for router configuration to 'not_configured'.

- Update the default value for Internet connection type to None so that nothing
is selected by default. We could consider introducing a fourth option
'not_configured'.

- Update the ID of first boot wizard step for Internet connectivity.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-02-24 12:36:44 -05:00
Sunil Mohan Adapa
1ba55e793f
networks: Fix i18n for wizard forms
- Using Markup on format_lazy objects seems to convert negate their lazy
behavior.

- Extend the format_lazy() utility method to handle markup.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-02-24 12:36:41 -05:00
Nektarios Katakis
9fda18b859
networks: Show internet connectivity string in main page
Closes: #1558

Signed-off-by: Nektarios Katakis <iam@nektarioskatakis.xyz>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-02-24 12:36:38 -05:00
Nektarios Katakis
5e6d6d1cd1
networks: Refactor connections list template
Signed-off-by: Nektarios Katakis <iam@nektarioskatakis.xyz>
[sunil: Use SPDX license identifier]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-02-24 12:36:34 -05:00
Nektarios Katakis
a8cd9c0b4a
networks: Save to kvstore internet connectivity type
Signed-off-by: Nektarios Katakis <iam@nektarioskatakis.xyz>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-02-24 12:36:31 -05:00
Nektarios Katakis
a95e59460e
networks: Add first boot step for internet connection type
Signed-off-by: Nektarios Katakis <iam@nektarioskatakis.xyz>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-02-24 12:36:28 -05:00
Nektarios Katakis
eb016bc686
networks: All first step wizard form for internet connection type
Signed-off-by: Nektarios Katakis <iam@nektarioskatakis.xyz>
[sunil: Use SPDX license identifier]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-02-24 12:36:24 -05:00
Nektarios Katakis
4ad2d7b2cf
networks: Link internet connection help page with networks page.
Signed-off-by: Nektarios Katakis <iam@nektarioskatakis.xyz>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-02-24 12:36:21 -05:00
Nektarios Katakis
bcd4c52851
networks: Add network view and url for internet connection help page
Signed-off-by: Nektarios Katakis <iam@nektarioskatakis.xyz>
[sunil: Use SPDX license identifier]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-02-24 12:36:18 -05:00
Nektarios Katakis
8134371bbb
networks: Add form for internet connection type
Signed-off-by: Nektarios Katakis <iam@nektarioskatakis.xyz>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-02-24 12:36:15 -05:00
Sunil Mohan Adapa
90d3736431
app: cosmetic: Rename header.html to app-header.html
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-02-23 08:31:29 -05:00
Joseph Nuthalapati
5944e13cf0
searx: Update search engines for 0.16.0
- Handle gzipped example settings files

- Fix yaml.load deprecation warnings

Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-02-21 21:47:54 -05:00
Joseph Nuthalapati
bb668e0f52
samba: Add link to manual page
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
2020-02-21 21:57:46 +05:30
Sunil Mohan Adapa
3e8c052258
deluge: More reliable initial configuration setup
Closes: #1779.

Wait until configuration files are created the deluge services.

- Deluged service on Debian Stable creates the core configuration file after
first exit. The version on Debian Testing creates the configuration file during
first run.

- deluge-web seems to create web.conf on first run.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-02-21 12:42:18 +02:00
Sunil Mohan Adapa
10d66d76ce
deluge: Don't use code execution for editing configuration
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-02-21 12:41:24 +02:00
Sunil Mohan Adapa
5c17c8c31e
firewalld: Ignore errors with DBus API when firewalld is not running
Closes: #1782.

This restores the API to the earlier behavior of ignoring errors when firewalld
is not running. This may not be the best approach however.

- Ignore errors on all operations when firewalld is not running. This include
enable/disable service, list interfaces of a zone, get service ports and get
enabled service.

- Log errors when firewalld is not running.

- ALREADY_ENABLE and NOT_ENABLED errors already ignored during enable/disable
service operations respectively.

Tests successfully executed:

- Turn off firewalld and perform following operations. They should all log an
error that firewalld is not running.

  - Visit app page of an app that works only on internal networks such as
  Privoxy. It should show that there are no internal networks.

  - Run diagnostics of an app. It should show ports for a service as empty list.

  - Enable/disable an app, it should enable/disable without failure.

  - Visit firewall app page. It should show that firewalld is not running.

- Perform all the about operations without error message showing up and with
expected results.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-02-20 12:37:10 +02:00
Sunil Mohan Adapa
fffbbe5ac7
help: Fix attribute on download manual button
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-02-19 14:40:52 +02:00
Sunil Mohan Adapa
a2f897e33d
*.js: Use SPDX license identifier
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-02-19 14:40:43 +02:00
Sunil Mohan Adapa
365c29ba1a
*: Update remaining misc files to use SPDX license identifier
None of the files are installed into /etc/. They will unconditionally override
older versions of themselves. They are not likely to cause any configuration
file prompts.

Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-02-19 14:40:32 +02:00
Sunil Mohan Adapa
9ba3b93dac
*.css: Use SPDX license identifier
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-02-19 14:40:03 +02:00
Sunil Mohan Adapa
e89e2b4a2a
*.html: Use SPDX license identifier
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-02-19 14:39:19 +02:00
Sunil Mohan Adapa
9368504da5
*.py: Use SPDX license identifier
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-02-19 14:38:55 +02:00
Sunil Mohan Adapa
92f6f8723c firewall: Use firewalld DBus API for most operations
- Significantly reduce the time taken to perform the operations in the following
  cases:

  - Enable/disable an app

  - list services in firewall page

  - Load app page when interfaces belonging to internal zone need to shown

  - First run setup of FreedomBox

- Install a polkit local authority configuration file to allow FreedomBox
service to perform: information queries and configuration changes.

- Drop unused actions.

- Alter the template for showing firewall port information since port/protocol
pairs are no longer pre-formatted.

- Handle errors when trying to get ports details of an unknown service.

Tests performed:

- Enable/disable an app. Ensure with firewall-cmd that ports are added/removed
properly.

- Temporarily modify code to call add_service() and remove_service() twice in a
row. Perform enable/disable operations and ensure that there are not error
thrown to test that add/remove services operations are idempotent.

- Visit the firewalld page and see the current state is reflected properly.

- Visit an app that shows the list of interfaces in firewall zone. Internal
interfaces should be listed properly.

- Reset the installed version of firewall app and disable all firewall services.
Start FreedomBox and ensure that when setup is re-run, default ports (http,
https, dns and dhcp) are opened properly. Run again but with ports already
enabled to check that the setup operation is idempotent.

- Visit diagnostics of an app that uses firewall components and see that ports
are listed properly in the port diagnostic test result.

- Remove some needed services such as those in /etc/firewalld/services and try
to visit the firewalld page. The page should show blank details against the
affected services.

Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-02-18 17:09:50 +02:00
Veiko Aasa
e073f0169c
config: Depends also on apache module
Closes #1778

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-02-17 18:37:57 -08:00
Sunil Mohan Adapa
b576a77c3d
app: Refactor all apps to use the Info component
- Remove the need to pass all the individual information elements to the AppView
  separately. This eliminates many issues with elements that were mistakenly not
  sent to AppView. Also reduces a lot of code duplication.

- Create App classes for power and sso for consistency.

Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-02-16 18:22:01 -05:00
Sunil Mohan Adapa
591ed5c4ae
jsxc: Bypass issue with stronghold to get the app working again
stronghold seems to have an issue with Django 2.1 decorators. A fix has not
been released yet.

Closes: #1697.

Tests:

- Functional tests for JSXC.

- Vist JSXC, login using FreedomBox account. Chat rooster becomes available.

- Log out, ensure that JSXC page is available.

- Log in, ensure that JSXC page is available.

Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-02-15 15:35:54 -05:00
James Valleroy
c78d96984b
bind: Bump version and handle upgrade
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2020-02-15 10:07:48 -05:00
Nektarios Katakis
d0fcc179a7
bind: views show served domains in main view
Signed-off-by: Nektarios Katakis <iam@nektarioskatakis.xyz>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-02-15 10:07:43 -05:00
Nektarios Katakis
5826d35ce5
bind: test for parsing zones file with specific format
Signed-off-by: Nektarios Katakis <iam@nektarioskatakis.xyz>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-02-15 10:07:41 -05:00
Nektarios Katakis
19f9436457
bind: parse zones files
Signed-off-by: Nektarios Katakis <iam@nektarioskatakis.xyz>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-02-15 10:07:38 -05:00
Allan Nordhøy
4ac8e2c15f
openvpn: Fix spelling for Tunnelblick
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-02-14 16:38:42 -08:00
Joseph Nuthalapati
deb4adc4ab
l10n: Fix gettext not detecting no-python-format
Looks like the annotation provided by Django has to be literally on the
line above the line where the percent symbol is found.

https://docs.djangoproject.com/en/3.0/topics/i18n/translation/#troubleshooting-gettext-incorrectly-detects-python-format-in-strings-with-percent-signs
2020-02-15 00:57:52 +05:30
Sunil Mohan Adapa
9ef28c87c6
storage: In develop mode check for low disk space more frequently
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-02-10 18:13:42 -05:00
Sunil Mohan Adapa
db48e869a6
upgrades: Show notification when FreedomBox is updated
- Don't not show notification on first install/run.

- Shows notification when upgrading or downgrading.

- This also serves as an example of how to show more specific notifications when
  upgraded to a newer version. Closes: 1637.

Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-02-10 18:13:33 -05:00
Sunil Mohan Adapa
5714fc6f51
storage: Show low disk space warning using notifications API
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-02-10 18:13:31 -05:00
James Valleroy
abdcbd3f65
security: Drop PrivateUsers=yes from all service files
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-02-09 18:48:22 -08:00
James Valleroy
e5c80e8af3
matrixsynapse: Enable systemd sandboxing
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-02-09 18:48:07 -08:00
James Valleroy
4fc3d14ac3
bind: Add CapabilityBoundingSet and ReadWritePaths to service file
Change ProtectSystem to strict.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-02-09 18:47:38 -08:00
James Valleroy
20a1c70fc2
security: Add Sandbox Coverage to report page
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
[sunil: Change label from 'Not Running' to 'Not running' for consistency]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-02-09 15:03:22 -08:00
James Valleroy
8cec7893e7
users: Make help text translatable
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2020-02-09 11:18:12 -05:00
Veiko Aasa
274e8a74fd
users: Add unit tests for views
Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-02-09 11:17:50 -05:00
Veiko Aasa
72f653f5e8
sso, users: Turn off autocapitalization on the username field
Set autocapitalization='none' and autocomplete='username' on the username field.
Latest Django version uses those attributes by default on the username field.

Closes #1207

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-02-09 11:17:47 -05:00
Veiko Aasa
bcadf26ffc
users: More precise username validation
- Username should match [a-zA-Z0-9_.@-], can't start with '-'
- Use Python pwd module to retrieve all users instead of getent command.
- Checking, that a username already exists or is reservered, is case insensitive

Created usernames are now compatible with openldap and nslcd. Didn't change
urlpatterns in case of an invalid username is already created by the admin.

Closes #1773

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-02-09 11:17:44 -05:00
Joseph Nuthalapati
494fcd155b
l10n: Add missing trimmed to blocktrans blocks
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
2020-02-09 10:54:44 +05:30
Joseph Nuthalapati
447e5c3e38
l10n: Add blocktrans trimmed tag on a block
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
2020-02-09 10:31:47 +05:30
Veiko Aasa
0f16a0fbee
storage: Show disks if FreedomBox is running in an unprivileged container
- Get disks info from df command and add info from udisks, if available.
  Before, it was other way round.
- Add a functional test that asserts root disk is available
- Remove unused key file_system_type from disks info

Closes #1765

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-02-02 09:40:12 -05:00
Sunil Mohan Adapa
dfd4d40ed1
firewall: Show Run Diagnostics button in app
- Use AppView for firewall view so that diagnostics button shows up
  automatically. Consistency with the rest of the apps. Allow new features to
  AppView become useful.

- A status section is automatically added but can be removed when all the other
  apps loose their status section.

- Does not change anything else.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-01-31 12:33:55 +02:00
Veiko Aasa
8ef2c77891
diagnostics: Show firewall service status
Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-01-30 14:10:31 -08:00
Veiko Aasa
932d2e17f9
networks: Support virtual Ethernet (veth) devices
Closes #1767

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
[sunil: Add comment and a cosmetic change]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-01-28 13:13:54 -08:00
James Valleroy
a9ab05bde3
bind: Enable systemd sandbox options for bind9 service
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-01-27 14:56:51 -08:00