6218 Commits

Author SHA1 Message Date
Veiko Aasa
504d0cdf00
gitweb: Add functional tests for git-access group
Add functional tests:
- User of git-access group can access gitweb site.
- User not of git-access group can't access gitweb site.

Tested that all the gitweb app tests pass.

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
2021-01-10 20:16:50 +05:30
Stanisław Stefan Krukowski
23fee50bd4
Translated using Weblate (Polish)
Currently translated at 33.6% (477 of 1418 strings)
2021-01-10 12:32:10 +01:00
Veiko Aasa
9c7b4d7b84
tests: functional: Improve creating users in tests
- Do not require a user password when creating a user. Generate a password
  if not provided.
- Before creating a user, delete previous user with the same name.
- Delete user: Do not skip if the user doesn't exist. It avoids the
  situation that some @when tests may silently skip.
- Update openvpn and deluge functional tests assuming passwords were not
  under the tests.

Tests performed:
- users, openvpn and deluge app functional tests pass.

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2021-01-09 22:03:00 -05:00
Veiko Aasa
fd296ad063 dev-container: Add command to print container IP address
Add './container ip' command to print current IP address of the container.
Useful when running container related scripts on host machine.

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
2021-01-07 15:53:13 +01:00
Veiko Aasa
fc7696d181
dev-container: 'up' command: Show banner also when container is already running
Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: Fioddor Superconcentrado <fioddor@gmail.com>
2021-01-07 14:28:45 +01:00
James Valleroy
d69a36c25f
users: Avoid test error if ldapsearch is not available
ldapsearch is provided by ldap-utils, which is not a build dependency.

Test: Build package using `gbp buildpackage`.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2021-01-06 08:36:18 +02:00
Veiko Aasa
7cf166e558
gitweb: tests: functional: Fix test failures in localized environment
Closes #2005

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: Fioddor Superconcentrado <fioddor@gmail.com>
2021-01-05 22:38:55 +01:00
Veiko Aasa
2317239d8d
dev-container: Add subcommand to run tests
- Add new subcommand `run-tests` to the ./container script and the --pytest-args
  argument to pass additional arguments to the pytest command.
- Runs tests as root.
- Add new parameters to the SSH command:
  - -Y Enable X11 forwarding to be able to run a browser GUI on a container.
  - -C Use traffic compression so the X11 GUI is not laggy.
  - -t Force pseudo-terminal allocation to enable colors on terminal.
  - Use the LogLevel=error option to suppress some warning messages.
- Update module markers in the pytest.ini file.
- Increase the default container disk size to 12G.
- Update HACKING.md to run unit and functional tests.

PROVISION_SCRIPT:
- Explicitly install sshpass as requirement for tests, needed on Debian
  stable.
- Ensure that geckodriver.log and .pytest_cache/ exist and are others-writable.

Closes #1901

Tests performed:
- Run unit tests on stable, testing and unstable containers, no failed tests.
- Run functional tests on stable and testing containers, no regressions.
[ fioddor: Some failing tests. All of them unrelated to the changes
           introduced. Impact restricted to development tools; the product
           hasn't been changed.]

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: Fioddor Superconcentrado <fioddor@gmail.com>
2021-01-05 17:34:23 +01:00
Veiko Aasa
53a0a54f18 functional-tests: Fix installation errors in install.sh script
- On Debian 10, pin pytest-bdd version to 3.2.1, this is the latest
  version that supports pytest 3.10.1.
- Install wheel and pytest-xdist packages from the Debian repos.
- Add git as a dependency for functional tests.
- Fix regexp when getting Gecko version from the Github api, for some
  reason after colon, sometimes there is a space and sometimes not.

Tests performed on Debian stable, testing and unstable:
- Installing dependencies with the install.sh script succeeds.
- No regressions when running tests.

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
2021-01-05 17:31:50 +01:00
Veiko Aasa
87b2799e3b users: Skip action script tests if LDAP is not set up
- Also, make sure an admin account exists before some tests.

Tests performed:
- The users module test_actions unit tests are skipped if LDAP is not set up.
- The users module unit tests pass if LDAP is set up.

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
2021-01-05 17:31:50 +01:00
Michael Breidenbach
9d6cbceb15
Translated using Weblate (Swedish)
Currently translated at 100.0% (1418 of 1418 strings)
2021-01-05 11:29:45 +01:00
Sunil Mohan Adapa
8bcd7f9611
radicale: Fix backup and restore of configuration
Perhaps the configuration was earlier stored under /var and symlinked from /etc/
but currently it is a separate directory and needs to be backed up.

Tests:
- Run functional tests for the radicale.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2021-01-04 13:47:41 +02:00
Sunil Mohan Adapa
b378305f58
doc: dev: Update the tutorial to reflect latest API/code
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2021-01-04 13:47:41 +02:00
Sunil Mohan Adapa
838a2ede8c
doc: dev: Update documentation on calling clients validation
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2021-01-04 13:47:40 +02:00
Sunil Mohan Adapa
6fc9e228a0
app: info: Move client validation to info component
- Each app does not have to call the validator by itself.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2021-01-04 13:47:39 +02:00
Sunil Mohan Adapa
5f3c691c38
doc: dev: Update documentation for using backup component
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2021-01-04 13:47:39 +02:00
Sunil Mohan Adapa
fb1898befc
backups: Use the backup component in all apps
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2021-01-04 13:47:38 +02:00
Sunil Mohan Adapa
f630fb6059
backups: Add new component for backup and restore
- Component performs the validation instead of each app calling the validator.

- Retain the schema for declaring backup information.

- Suitable for usage directly in the backup/restore operation packets instead of
using BackupApp class.

- Backup/restore hooks can be handled by overriding this component instead of
module level methods.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2021-01-04 13:47:37 +02:00
Sunil Mohan Adapa
ec75790c00
app: Add locked flag
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2021-01-04 13:47:37 +02:00
Sunil Mohan Adapa
734e4fea9a
app: component: Add app_id and app properties
- So that with a component at hand, it's app can be easily retrieved.

- Don't create circular dependencies.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2021-01-04 13:47:36 +02:00
Sunil Mohan Adapa
d45cc00981
openvpn: Don't show running status on download profile button
The running status prevents the user from downloading the profile a second time.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2021-01-02 13:53:20 +02:00
Sunil Mohan Adapa
cc8c0cb05d
backups: Don't open a new window for downloading backups
Opening a new window is simply unnecessary.

Tests:

- Clicking the link will result in immediate download in Chrome without
navigating away from the page.

- Clicking the link will result in download prompt in Firefox without navigating
away from the page.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2021-01-02 13:53:14 +02:00
Sunil Mohan Adapa
1cf0748a49
apache2: Allow downloads in openvpn and backups with latest browsers
Closes: #2002.

Entire FreedomBox UI is served within a sandbox that is originally meant for
cross-site iframes.

A newly introduced flag allow-downloads is required to trigger downloads. Two
instances where this is used in FreedomBox is openvpn profiled download and
backup download. Firefox 81 and Chrome 83 implement this flag.

Add 'allow-downloads' to sandbox directives to fix this.

References:

- https://github.com/whatwg/html/pull/4293
- https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe
- https://bugzilla.mozilla.org/show_bug.cgi?id=1558394
- https://www.chromestatus.com/feature/5706745674465280

Tests:

- Check that OpenVPN profile can be downloaded.
- Check that backups can be downloaded.
- Check on Firefox 78 and Chromium 83.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2021-01-02 13:52:59 +02:00
Johannes Keyser
d8cd3ee5fe
Translated using Weblate (German)
Currently translated at 100.0% (1418 of 1418 strings)
2021-01-01 15:29:17 +01:00
ullli
269936ff14
mumble: Updated mumla and removed plumble from clients list
- Added mumla play-store link
- Removed pumble entry and plumble var

Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-12-31 17:15:51 -08:00
Veiko Aasa
aa54421216
ejabberd: functional tests: Wait until the jsxc buddy list is loaded
Fixes #1894

Tests performed:
- All the ejabberd tests pass on both Debian testing and stable

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-12-31 17:01:52 -08:00
Veiko Aasa
1ea6b0b176
functional tests: Make tests compatible with pytest-bdd v4.0
- In pytest-bdd v4.0, given steps are no longer fixtures. Mark steps
  as fixtures when needed.
- Remove 'test_' prefix from step function names, so that pytest doesn't
  run those twice.

Test performed:
- Run all tests, no more pytest-bdd v4.0 related failures
- All the openvpn, snapshot and users module tests pass

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-12-31 15:41:40 -08:00
Doma Gergő
0a10d02605
Translated using Weblate (Hungarian)
Currently translated at 90.6% (1285 of 1418 strings)
2020-12-31 03:29:42 +01:00
Burak Yavuz
dd6938df9d
Translated using Weblate (Turkish)
Currently translated at 100.0% (1418 of 1418 strings)
2020-12-31 03:29:42 +01:00
ikmaak
fd49f27338
Translated using Weblate (Dutch)
Currently translated at 100.0% (1418 of 1418 strings)
2020-12-31 03:29:41 +01:00
ikmaak
95b1c61a96
Translated using Weblate (German)
Currently translated at 100.0% (1418 of 1418 strings)
2020-12-31 03:29:41 +01:00
Dietmar
32c53e347a
Translated using Weblate (German)
Currently translated at 100.0% (1418 of 1418 strings)
2020-12-31 03:29:40 +01:00
James Valleroy
da4ab1bc8b
Release v20.21 to unstable
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
v20.21
2020-12-28 21:09:18 -05:00
James Valleroy
92c9ba21ac
debian: Bump standards version to 4.5.1
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2020-12-28 21:08:14 -05:00
James Valleroy
f15a6f8d55
doc: Fetch latest manual
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2020-12-28 20:50:46 -05:00
James Valleroy
48c8a8fd29
locale: Update translation strings
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2020-12-28 20:12:06 -05:00
Doma Gergő
d94af183e7
Translated using Weblate (Hungarian)
Currently translated at 88.7% (1259 of 1418 strings)
2020-12-29 02:10:05 +01:00
n0nie4HP
c46696ad0a
Translated using Weblate (Polish)
Currently translated at 34.0% (483 of 1418 strings)
2020-12-29 02:10:03 +01:00
ikmaak
6f2e6f3373
Translated using Weblate (Polish)
Currently translated at 34.0% (483 of 1418 strings)
2020-12-29 02:10:03 +01:00
Nikita Epifanov
cb8a7df4a7
Translated using Weblate (Russian)
Currently translated at 95.4% (1354 of 1418 strings)
2020-12-29 02:10:02 +01:00
James Valleroy
30a0e69548
upgrades: Update searx search engines during dist upgrade
Flush stdout after printing debug info.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-12-28 10:48:45 -08:00
James Valleroy
092c7e70d1
upgrades: Allow grub-pc upgrade without reinstalling grub
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-12-28 10:48:38 -08:00
Veiko Aasa
6665052fe8
security: Fix access denied for user daemon from cron
When 'restrict console logins' is activated, debsecan hourly cron jobs fail
because the 'daemon' user is not allowed to run cron jobs. Add rule to the
login access control file to allow 'daemon' user to run cron jobs.

Fixes #1770

Tested that after I copied the file to /etc/security/access.d/10freedombox-security.conf,
there are no more debsecan cron job errors in the journalctl logs.

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: Fioddor Superconcentrado <fioddor@gmail.com>
2020-12-28 15:46:37 +01:00
spectral
79acc9b918
calibre: Fix manual page name
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-12-26 13:47:53 -05:00
Veiko Aasa
0255058656
users: Remove timeout when creating Samba user
Fixes #2000

Tests performed:
- All the users module tests pass
- Create a user, add the user to the freedombox-share group,
check that the user can connect to the Samba Group share.

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-12-26 12:59:08 -05:00
n0nie4HP
1101674cf3
Translated using Weblate (Polish)
Currently translated at 28.1% (399 of 1418 strings)
2020-12-26 16:29:15 +01:00
Veiko Aasa
5f3643cc24
apache: Create snake oil certificate if not exists
When FreedomBox package is installed on a fresh Debian machine where a
snakeoil certificate doesn't exist, generate a new one.

Fixes #1923
Fixes #1999

Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
[Veiko: Made added code comment more precise]
Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-12-26 10:18:14 +02:00
Michael Breidenbach
327e76220b
Translated using Weblate (Swedish)
Currently translated at 100.0% (1418 of 1418 strings)
2020-12-24 18:29:15 +01:00
Fioddor Superconcentrado
9dcf87f1a4
Translated using Weblate (Spanish)
Currently translated at 99.9% (1417 of 1418 strings)
2020-12-24 18:29:15 +01:00
Joseph Nuthalapati
8085879643
deluge: Functional tests for bit-torrent group
Add tests to check that usage of Deluge is only permitted to users in
the group 'bit-torrent'.

Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-12-23 16:47:03 +02:00