5924 Commits

Author SHA1 Message Date
James Valleroy
bacfc4bcee
upgrades: Set a flag so interrupted dist-upgrade can be continued
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-10-05 15:12:34 -07:00
James Valleroy
0308d783e3
upgrades: Detect and upgrade to next stable release
Process can be tested by upgrading to testing:
$ sudo ./actions/upgrades --develop --test-upgrade

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
[sunil: cosmetic: isort fixes]
[sunil: Restore BACKPORTS_REQUESTED_KEY that was accidentally removed]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-10-05 15:11:19 -07:00
James Valleroy
036f917efb
upgrades: Extend function to check for normal dist availability
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-10-05 15:09:47 -07:00
Veiko Aasa
819520466a
container: Assign virtual network interface to trusted firewall zone
If firewalld is running, the virtual network interface created by
systemd-nspawn gets assigned to the home zone by default. Because
of this, DHCP server is not availabe for the container and most
of the incoming ports are closed.

This commit assigns the network interface created by systemd-nspawn to
the trusted network zone if firewalld is running, so that all network
connections are accepted.

Signed-off-by: Veiko Aasa veiko17@disroot.org
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-10-05 11:44:38 -07:00
Fioddor Superconcentrado
6bb5d34132
HACKING.md: Re-organised contents according to onboarding journey
See MR#1919.note_194567.

Since the documents and some chapters are long a table of contents has been
added at the beginning along with navigation links pointing back to it at the
end of main sections and long chapters.

Signed-off-by: Fioddor Superconcentrado <fioddor@gmail.com>
[sunil: Drop periods at the end of TOC entries]
[sunil: Re-title some sections]
[sunil: Add links to Django i18n documentation and IRC chatroom]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-10-05 01:22:39 -07:00
Sunil Mohan Adapa
fe183dbc72
debian/control: Add sshpass as build dependency
- Required only by tests when run as superuser. However, it's addition makes it
  very uniform to ensure that all dependencies are pre-installed in a container
  when running tests.

- We may find ways to run root user tests in future.

- The package seems very stable.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-10-05 00:05:57 -07:00
Sunil Mohan Adapa
9ef9a0fb1c
*: Minor flake8 fixes
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-10-05 00:05:54 -07:00
Sunil Mohan Adapa
e5cd5bd796
users: cosmetic: Yapf refactoring
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-10-05 00:05:51 -07:00
Sunil Mohan Adapa
30c326523e
users: Deal with admin user already existing during first boot
- Trying to create another admin user using the first boot wizard will certainly
fail.

- Show the list of admin users in the system so that they an be deleted and
creation of admin by first boot wizard can continue.

- If existing account can already work (such as when Plinth and LDAP entries
exist) allow skipping the step.

- Since the scenario is mostly like encountered only during advanced usage and
not for most regular users, the technical nature of solutions is okay.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-10-05 00:05:47 -07:00
Veiko Aasa
dfaf009d3c
users: Require admin credentials when creating or editing a user
This change prevents the plinth user to become a superuser without
knowing an admin password.

Users module and action script:
- User credentials are now required for the subcommands: create-user,
  set-user-password, add-user-to-group (if the group is admin),
  remove-user-from-group (if the group is admin), set-user-status,
  remove-user (if the removed user is the last admin user.
  Note: the web UI doesn't allow to delete last admin user).
- subcommand remove-users requires authentication if the user is last
  admin user. Password must be provided through standard input.
- subcommand remove-group: do not allow to remove group 'admin'
- User credentials must be provided using the argument
  --auth-user and a passsword must be provided through standard input.
- If there are no users in the admin group, no admin password is
  required and if the --auth-user argument is required, it can be an
  empty string.

Users web UI:
- An admin needs to enter current password to create and edit a user
  and to change user's password.
- Show more detailed error text on exceptions when submitting forms.
- Show page title on the edit and create user pages.

Users unit and functional tests:
- Added a configuration parameters to the pytest configuration file
  to set current admin user/password.
- Added a configuration parameter 'ssh_port' to the functional tests.
  You can overwrite this with the FREEDOMBOX_SSH_PORT environment
  variable. Modified HACKING.md accordingly.
- Added an unit test:
     - test changing the password as a non-admin user.
     - test invalid admin password input.
     - test that removing the admin group fails.
- Capture stdout and stderr in the unit tests when calling an action
  script to be able to see more info on exceptions.
- Added functional tests for setting ssh keys and changing passwords
  for admin and non-admin users.
- Added a functional test for setting a user as active/inactive.

Changes during review [sunil]:
- Move uncommon functional step definitions to users module from global. This is
  keep the common functional step definitions to minimal level and promote when
  needed.
- Minor styling changes, flake8 fixes.
- Don't require pampy module when running non-admin tests. This allows tests to
  be run from outside the container on the host machine without python3-pam
  installed.
- Call the confirm password field 'Authorization Password'. This avoid confusion
  with a very common field 'Confirm Password' which essentially means retype
  your password to ensure you didn't get it wrong. Add label explaining why the
  field exists.
- Don't hard-code /tmp path in test_actions.py. Use tmp_path_factory fixture
  provided by pytest.
- Remove unused _get_password_hash() from actions/users.
- Undo splitting ldapgid output before parsing. It does not seem correct and
  could introduce problems when field values contain spaces.

Tests performed:
- No failed unit tests (run with and without sudo).
- All 'users' functional tests pass.
- Creating an admin user during the first boot wizard succeeds.
- Creating a user using the web UI with an empty or wrong admin
  password fails and with the correct admin password succeeds.
- Editing a user using the web UI with an empty or wrong admin
  password fails and with the correct admin password succeeds.
- Changing user's password using the web UI with an empty or wrong
  admin password fails and with the correct admin password succeeds.
- Above mentioned user action script commands can't be run without
  correct credentials.
- Adding the daemon user to the freedombox-share group succeeds when
  installing certain apps (deluge, mldonkey, syncthing, transmission).

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
[sunil: Move uncommon functional step definitions to users module from global]
[sunil: Minor styling changes, flake8 fixes]
[sunil: Don't require pampy module when running non-admin tests]
[sunil: Call the confirm password field 'Authorization Password']
[sunil: Don't hard-code /tmp path in test_actions.py]
[sunil: Remove unused _get_password_hash() from actions/users]
[sunil: Undo splitting ldapgid output before parsing]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-10-05 00:05:44 -07:00
Veiko Aasa
6b61ca2f18
ssh: action script: Require user credentials when editing ssh keys
This change prevents the plinth user to set the ssh-keys without
knowing the user password.

- Debian: added new dependency python3-pampy to authenticate users.
- Added additional required parameter --auth-user to the
  'actions/ssh set-keys' command. A password should be
  provided through STDIN.

Tests performed:
- running 'actions/ssh set-keys' with empty or wrong admin credentials
  fails.
- running 'actions/ssh set-keys' with correct admin credentials
  succeeds.
- running 'actions/ssh set-keys' with correct non-admin credentials
  succeeds if the --username is the same user.
- running 'actions/ssh set-keys' with correct non-admin credentials
  fails if the --username is a different user.

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-10-05 00:05:41 -07:00
Sunil Mohan Adapa
98f9d59ef1
quassel: Don't handle certificates if not installed
Tests:

- Without these changes, with Quassel not-installed, change the domain name.
Notice that certificate events for Quassel fails due to missing domain
information.

- With these changes, with Quassel not-installed, change the domain name. Notice
that certificate events for Quassel don't result in any actions.

- With these changes, when Quassel is installed, certificate is properly setup
for a domain.

- With these changes, with Quassel installed, change the domain name. Notice
that certificate events for Quassel succeed.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-10-03 10:10:26 -04:00
Sunil Mohan Adapa
00683762c8
coturn: Don't handle certificates if not installed
Tests:

- Without these changes, with Coturn not-installed, change the domain name.
Notice that certificate events for Coturn fails due to missing domain
information.

- With these changes, with Coturn not-installed, change the domain name. Notice
that certificate events for Coturn don't result in any actions.

- With these changes, when Coturn is installed, certificate is properly setup
for a domain.

- With these changes, with Coturn installed, change the domain name. Notice that
certificate events for Coturn succeed.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-10-03 10:10:23 -04:00
Petter Reinholdtsen
3aca199aab
Translated using Weblate (Norwegian Bokmål)
Currently translated at 82.8% (1094 of 1321 strings)
2020-10-03 02:41:03 +02:00
Burak Yavuz
c76241510b
Translated using Weblate (Turkish)
Currently translated at 100.0% (1321 of 1321 strings)
2020-10-01 23:41:05 +02:00
Coucouf
d60c00235c
Translated using Weblate (French)
Currently translated at 100.0% (1321 of 1321 strings)
2020-10-01 23:41:04 +02:00
Fioddor Superconcentrado
94c3ddefd1
Translated using Weblate (Spanish)
Currently translated at 100.0% (1321 of 1321 strings)
2020-10-01 23:41:04 +02:00
Joseph Nuthalapati
2416d87398
container: Handle edge cases with container update
Fix update command failing when image files do not exist.

Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-09-30 15:49:37 +03:00
Sunil Mohan Adapa
3f4bd9416d
doc: dev: Link to list of potential apps from tutorial
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-09-29 21:18:11 -04:00
Sunil Mohan Adapa
956530ab8a
mumble: Store and use a single domain for TLS certificate setup
Certificate can be setup for a single domain at a time in Mumble. So, allow the
user to choose the domain purely for this propose even though Mumble can work
with multiple domains. Tell Let's Encrypt to work with this domain.

Tests:

- Without Mumble installed, change the domain name. Notice the mumble related
certificate events are ignored.

- Install Mumble, a TLS domain is automatically selected. Certificate is setup
for that domain.

- Ensure at least two domains are setup in the system. See the list in the
Mumble app page. Choose a non-default domain. Domain should change and cert
should be setup for that domain.

- Go to config app and change the domain. Mumble domain should get set to a
different domain and cert should get updated.

- Install mumble without these changes. Apply the changes and start FreedomBox.
Mumble app should get upgraded and certificate should get setup for a domain.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-09-29 20:46:48 -04:00
Phil Morrell
215371a877
mumble: configure letsencrypt component
Fixes: #701

Signed-off-by: Phil Morrell <debian@emorrp1.name>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-09-29 20:46:42 -04:00
Sunil Mohan Adapa
c2a9592de1
quassel: Fix minor typo
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-09-29 20:46:36 -04:00
ssantos
9ea5792306
Translated using Weblate (Portuguese)
Currently translated at 12.3% (163 of 1321 strings)
2020-09-29 11:39:56 +02:00
Coucouf
69d66927ac
Translated using Weblate (French)
Currently translated at 100.0% (1321 of 1321 strings)
2020-09-29 11:39:56 +02:00
Sunil Mohan Adapa
5f4e2673f3
quassel: Don't handle certificates if not installed
Tests:

- Without these changes, with Quassel not-installed, change the domain name.
Notice that certificate events for Quassel fails due to missing domain
information.

- With these changes, with Quassel not-installed, change the domain name. Notice
that certificate events for Quassel don't result in any actions.

- With these changes, with Quassel installed, change the domain name. Notice
that certificate events for Quassel succeed.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-09-28 19:23:26 -04:00
Sunil Mohan Adapa
53b6203473
coturn: Don't handle certificates if not installed
Tests:

- Without these changes, with Coturn not-installed, change the domain name.
Notice that certificate events for Coturn fails due to missing domain
information.

- With these changes, with Coturn not-installed, change the domain name. Notice
that certificate events for Coturn don't result in any actions.

- With these changes, with Coturn installed, change the domain name. Notice that
certificate events for Coturn succeed.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-09-28 19:23:23 -04:00
Sunil Mohan Adapa
514a04d643
doc: Before fetching, drop all old to cleanup deleted pages/images
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-09-28 16:42:32 -04:00
Michael Breidenbach
e421e0fde9
Translated using Weblate (Swedish)
Currently translated at 100.0% (1321 of 1321 strings)
2020-09-28 14:41:22 +02:00
Joseph Nuthalapati
5a04f6d309
calibre: Minor changes to app description
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
2020-09-27 22:16:37 +05:30
Joseph Nuthalapati
6bfffeee13
calibre: Add new e-book library app
[joseph: initial code for the app]
Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
[sunil: use the modified framework API]
[sunil: simplify setup logic, move to service file]
[sunil: strict security for service file, dynamic users]
[sunil: interface for managing libraries]
[sunil: implement backup/restore]
[sunil: add functional, action, and view tests]
[sunil: use svg icon]
[sunil: update description]
[sunil: fix apache configuration]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
2020-09-27 22:16:07 +05:30
Sunil Mohan Adapa
68475668ea
tests: functional: Simplify calling the login helper
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
2020-09-27 22:15:27 +05:30
Sunil Mohan Adapa
7b7d42fe33
tor: Don't check if enabled when not installed
Tests:

- Install Tor and enable onion service. Restart FreedomBox. During
initialization the onion service domain is added. Check in Name Services.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-09-27 09:54:20 -04:00
Sunil Mohan Adapa
9b9238188a
pagekite: Don't update names module if not installed
- Due to a minor regression with init() method refactoring:

  - Pagekite tries to check if it is enabled even when it is not installed. This
  is an unnecessary check.

  - Pagekite tries to remove domains from name services even when it is not
  installed. This could have unnecessary consequences.

Fix this by checking if Pagekite is installed and perform name services updating
only if service is enabled.

Tests:

- Enable pagekite and configure it. When FreedomBox is restarted, Pagekite kite
is announced as domain and shown in Name Services.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-09-27 09:54:18 -04:00
Sunil Mohan Adapa
ec5f994068
pagekite: Don't announce unconfigured kite as a valid domain
Closes: #1891.

As soon as the app is installed, the default configuration has NAME.pagekite.me.
This is incorrectly announced as a valid domain to the system. Avoid this
behavior by never announcing this default configured kite name.

Tests:

- Install Pagekite. Observe that the default kite name is not announced as a
domain (confirmed in Name Services). With the patch, it will.

- Change the domain to anything other than default. It is announced. LE tries to
obtain cert. Name Services list the domain.

- Change the domain back to default kite name. It is not announced. Old domain
is removed.

- Start FreedomBox with Pagekite configured with default domain. It is not
announced.

- Start FreedomBox with Pagekite configured with non-default domain. It is
announced.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-09-27 09:54:14 -04:00
Sunil Mohan Adapa
e9559b2d0d
dynamicdns: Drop unnecessary code to set app as enabled
This is already handled by module loader.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-09-27 09:54:11 -04:00
Sunil Mohan Adapa
75a46962f0
module_loader, web_framework: Update console log messages
- Drop message for initialization of each app. This was removed earlier but was
reintroduced during init() refactoring. There is not much use for these messages
and the noise they generate hide some important messages relating to domains
added.

- Print lists in a better way for humans.

- Add a log message after all the initialization is completed.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-09-27 09:54:09 -04:00
Fioddor Superconcentrado
b527b003a3
CONTRIBUTING: Require flake8 compliance
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-09-25 16:26:35 -07:00
Fioddor Superconcentrado
d588e7fa25
HACKING: Add extra development requirements
[sunil: Reword the extra requirements to explain when they are needed]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-09-25 16:26:01 -07:00
Joseph Nuthalapati
f69d8289f6
bepasty: Change default permissions to 'read'
Allow read access by URL by default.

Tests:

- Installing bepasty fresh show the default permissions as read.

- Upgrading bepasty from older version when default permissions are none sets
the default permissions to read.

- Upgrading bepasty from older version when default permissions are not none
retrains the permissions.

Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
[sunil: Don't relocate setup() method]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Tested-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-09-25 14:54:35 -07:00
Coucouf
889810bb96
Translated using Weblate (French)
Currently translated at 100.0% (1321 of 1321 strings)
2020-09-25 00:41:00 +02:00
James Valleroy
afc6b178a4
Release v20.14.1 to unstable
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
v20.14.1
2020-09-23 07:38:44 -04:00
James Valleroy
33dccebae7
doc: Fetch latest manual
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2020-09-23 07:35:21 -04:00
Coucouf
f68b9e23bb
Translated using Weblate (French)
Currently translated at 94.6% (1250 of 1321 strings)
2020-09-23 13:08:36 +02:00
Dietmar
995347db54
Translated using Weblate (German)
Currently translated at 98.4% (1300 of 1321 strings)
2020-09-23 13:08:35 +02:00
Sunil Mohan Adapa
00b551972b
module_loader: Load/process all essential modules before others
Since modules need not have dependency on any essential module even though they
are dependent on them, it must be assumed that any module may depend on any
essential module. So, load or process (like running setup) essential modules
before non-essential modules.

Closes: #1967.

Tests:

- When service is started, console messages show that in the module load order,
all the essential modules are prioritized.

- Without these changes, this is not the case.

- When version of essential app and non-essential app are incremented, essential
app is setup before the non-essential app.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-09-23 06:44:13 -04:00
Petter Reinholdtsen
694866e4b2
Translated using Weblate (Norwegian Bokmål)
Currently translated at 82.2% (1086 of 1321 strings)
2020-09-22 11:39:56 +02:00
Petter Reinholdtsen
e9f944523f
Translated using Weblate (Norwegian Bokmål)
Currently translated at 81.9% (1083 of 1321 strings)
2020-09-21 08:58:17 +02:00
Sunil Mohan Adapa
9f8f187d42
cockpit: Don't show home page icon to non-admin users
Tests:

- Logout and see that the home page icon is not visible.

- Login as non-admin user and see that the home page icon is not visible.

- Login as admin user and see that the home page icon is visible.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
2020-09-19 15:21:03 +05:30
JC Staudt
a9ee8fb432
minidlna: Fix typo DNLA -> DLNA
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-09-18 14:00:59 -07:00
Nikita Epifanov
11c05bad0d
Translated using Weblate (Russian)
Currently translated at 100.0% (1321 of 1321 strings)
2020-09-17 11:36:16 +02:00