5607 Commits

Author SHA1 Message Date
James Valleroy
0f54fab067
apt: Run dpkg --configure -a before other actions
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-06-25 11:54:55 -07:00
James Valleroy
5424e1e23f
apt: Run apt-get -f install before other commands
Run `apt-get --fix-broken install` before installing package or manual
update. This will attempt to correct broken dependencies.

Tests:
- Install a package without its dependencies using `dpkg -i`.
- Both app install and manual update successfully recover from this
  situation.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-06-25 11:54:45 -07:00
Veiko Aasa
bf53fd8b17
functional-tests: Fix page not fully loaded errors when taking backups
- Use a submit() function to wait for a update when visiting app pages.
This prevents failures on pages which have custom javascript,
including the backup app. Those errors are more common if the server
hardware is slower.

- Remove unnecessary wait_for_page_update() as submit() already waits
for a page update.

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-06-25 10:50:51 -07:00
Sunil Mohan Adapa
7f7f4cfb52
container: Remove sqlite3 file early enough
During --list-dependencies if an old sqlite3 file is present with gitweb
enabled, then a2enconf -c gitweb-freedombox-auth get executed. In this case,
setting up apache2 module fails because authpubtkt tokens are not yet generated
but they are being referred to in the configuration files.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-06-25 01:21:39 +03:00
Pavel Borecki
a988828f73
Translated using Weblate (Czech)
Currently translated at 79.0% (1012 of 1281 strings)
2020-06-24 13:41:46 +02:00
Michael Breidenbach
8892029268
Translated using Weblate (Swedish)
Currently translated at 100.0% (1281 of 1281 strings)
2020-06-24 13:41:46 +02:00
Sunil Mohan Adapa
cf9f086e6f
Translated using Weblate (Telugu)
Currently translated at 64.2% (823 of 1281 strings)
2020-06-24 13:41:46 +02:00
Fioddor Superconcentrado
7d0647319a
Translated using Weblate (Spanish)
Currently translated at 100.0% (1281 of 1281 strings)
2020-06-24 13:41:45 +02:00
Michael Breidenbach
b80bd00d5d
Translated using Weblate (German)
Currently translated at 100.0% (1281 of 1281 strings)
2020-06-24 13:41:44 +02:00
James Valleroy
2c1a868567
storage: Handle multi-line text in functional test
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2020-06-24 07:23:43 -04:00
Sunil Mohan Adapa
3fd0921e0f
backups: Remove an unnecessary print() statement
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-06-24 07:23:41 -04:00
Sunil Mohan Adapa
e59f9ac3fc
storage: Ignore eject failures if filesystems unmounted properly
Not all disks can be ejected. For example, SATA disks can't be ejected. However,
they can be removed as long as all filesystems are unmounted properly. Ignore
errors during ejecting of a disk.

Closes: #1597.

Tests performed:

- In VirtualBox, attach a SATA disk, format it with two partitions. See them
auto-mounted by FreedomBox. Eject one of the partitions, both partitions are
unmounted but operation does not fail despite SATA disks not being eject-able.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-06-24 07:23:39 -04:00
Sunil Mohan Adapa
d3b5143ed6
storage: Allow ejecting any device not in fstab or crypttab
Allow any disk including SATA disks to be ejected.

Helps: #1597.

Tests performed:

- Attach SATA disk to VirtualBox. Create two partitions and filesystem in it.
FreedomBox will auto-mount the filesystems. Eject button is shown on both the
partitions. Without the patch, this is not shown.

- Eject button is not shown against '/' as it is part of fstab.

- Add a device into /etc/fstab. Eject button will not be shown against the
device.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-06-24 07:23:37 -04:00
Sunil Mohan Adapa
426cef4c2c
storage: Don't auto-mount loopback devices except in develop mode
In the event containers are being used on the server with images, attempting to
auto-mounting loop devices could interfere with their operation. We currently
don't have a use case where a user would want to auto-mount loop devices.
Initially suggested in
https://salsa.debian.org/freedombox-team/freedombox/-/issues/1854

Tests performed:

- Add a loopback device as follows and observe that is automatically mounted.

  dd if=/dev/zero of=/tmp/test_disk bs=1M count=100
  mkfs.ext4 /tmp/test_disk
  losetup loop0 /tmp/test_disk
  umount /dev/loop0
  losetup -d /dev/loop0

- Add a loopback device as follows and observe that both partitions are mounted.

  dd if=/dev/zero of=/tmp/test_disk bs=1M count=100
  parted /tmp/test_disk
  mklabel gpt
  mkpart Part1 ext4 0% 50%
  mkpart Part2 ext4 50% 100%
  kpartx -avs /tmp/test_disk
  mkfs.ext4 /dev/mapper/loop0p1
  mkfs.ext4 /dev/mapper/loop0p2
  umount /dev/mapper/loop0p1
  umount /dev/mapper/loop0p2
  kpartx -dvs /tmp/test_disk

- When --develop is removed or when code is modified to negate the not
  condition, the partitions are not auto-mounted in the above cases.

Reported-by: James Valleroy <jvalleroy@mailbox.org>
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-06-24 07:23:35 -04:00
Sunil Mohan Adapa
8c05fb0722
storage: Remove rule to not automount system disks with no paritions
This rule imported originally from udiskie's defaults seems somewhat arbitrary.
We attach a SATA drive with partitions, it mounts them. However, if the entire
drive is a file system, it does not auto-mount.

Tests performed:

- In VirtualBox, attach a SATA drive. Create two partitions and filesystems in
them. Both filesystems are auto-mounted.

- In VirtualBox, attach a SATA drive. Format the entire drive as a filesystem.
The filesystem is auto-mounted.

- Same behavior is observed with loop devices.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-06-24 07:23:33 -04:00
Sunil Mohan Adapa
d4ce843e22
storage: Don't show empty progress bar for disks not mounted
In future, we may consider showing disks that are not mounted and allow mounting
them manually or unlocking encrypted volumes manually. Prepare for that
scenario.

Tests performed:

- Edit get_disks() code to show not mounted disks. The progress bar or free
space information should not be shown.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-06-24 07:23:31 -04:00
Sunil Mohan Adapa
10b46f1968
storage: Use UDisks information as primary source
Rename get_disks() to get_mounts() and use it in for backups and samba shares.

Create a new get_disks() similar to get_mounts() but use df information only for
showing free space. This inverts the importance of 'df' and UDisks. Use UDisks
as primary source of information for showing list of disks and then use df to
fill in the free space information.

- Retrieve all the mount points of a device and return them as part of
get_disks() in an extra 'mount_points' property.

- For storage listing, this fixes showing up of /.snapshots as separate disk and
showing of vboxsf, network mounts etc. Only shows mounts that are related to
block devices.

- Update various uses of get_disks() within storage module to use
'mounts_points' instead of 'mount_point' to be accurate in cases where there are
multiple mounts for a given device. Use get_mounts() where appropriate instead.

- Display all the mount points against a devices in multiple lines.

- Also show devices that are not currently mounted.

Tests performed:

- Filling up a disk shows a disk space warning properly. Warning contains the
  free disk space correctly.

- Calling get_root_device(get_disks()) return the correct root device.

- In Deluge, the download directory contains a list of all samba current shares.
  If a disk with samba share is unmouted, it does not show up in the list.

- In the Samba app page, all disks are shown properly. Root disk is shown as
  'disk'. All other mount points such as .snapshots and /vagrant also show up.

- In the Samba app page, unavailable shares list shows up when a disk with a
  share is unmounted.

- Upload a backup, warning on the form shows available disk space properly.

- When adding a backup location. The list includes all mount points. Duplicated
  mount points are not shown. Root disk is not shown in the list. When all the
  disks are used up for backup location, a warning that no additional disks are
  available is shown.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-06-24 07:23:29 -04:00
Sunil Mohan Adapa
955dfea866
storage: Fix regression with showing error messages
In ed09028fcd2c850c3b87b65de66187b214190150, when eject was made to run as
superuser inside storage action, parsing of the error messages was not handled
properly. Fix it to show simple error messages about why the eject was not
successful.

Tests performed:

- In a terminal, switch to the directory where a disk is mounted to keep the
mount point busy. Attempt to eject the disk. A large stack trace is shown
without the patch and a clean error message is shown with it.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-06-24 07:23:27 -04:00
Sunil Mohan Adapa
225d86e344
storage: Use DBus directly for listing disks
Bring us closer to avoiding the use of two different methods to access UDisks
DBus API: UDisks2 client library and direct DBus access with GDBus.

Perform formatting of the bytes outside of udisks2 module to avoid depending on
Django.

Tests performed:

- Visit the storage page. Disks are listed properly.

- Sizes are formatted to be human readable.

- Filesystem type is show properly: ext4, btrfs

- Labels for disks are shown as set by tune2fs etc.

- Device paths are shown properly.

- Mount point is shown properly.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-06-24 07:23:24 -04:00
James Valleroy
34a28e35c9
upgrades: Append unattended-upgrades-dpkg.log for more detail
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-06-23 20:14:30 -07:00
Veiko Aasa
0c59dbb0e4
functional-tests: Skip tests if app is not available in distribution
Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-06-22 15:21:26 -07:00
Veiko Aasa
f97902615b
functional-tests: Handle connection error when web server restarts
Catch exeptions if web server restarts on form submit.

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-06-22 15:20:21 -07:00
James Valleroy
aac511d534
debian: Add nscd >= 2 as dependency
This is a slightly hacky way to ensure that nscd package is installed
rather than unscd (which provides nscd as a virtual package).

This will work as long as unscd does not jump to a version 2. It is
currently 0.53-1 and has little recent activity, so this condition
seems likely to hold in the near future.

Tests:

- In vagrant box, installed unscd. Installed modified freedombox deb.
  Saw that unscd was removed and nscd was installed.

- In DigitalOcean droplet, reproduced issue from #1877. Installed
  modified freedombox deb. Saw that unscd was removed (no other
  packages were removed) and nscd was installed. FreedomBox interface
  was available again.

- Built a freedom-maker image with modified freedombox deb. Checked
  build log that nscd was installed and unscd was not installed.

Closes: #1877.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-06-22 15:13:59 -07:00
Sunil Mohan Adapa
f07a81ef39
apache: Add ssl-cert package as dependency
The make-ssl-cert command is used during initial setup so it is a hard
dependency. Earlier it was being included as a Recommends: via apache2 package.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-06-22 17:17:58 -04:00
Sunil Mohan Adapa
28e19abf46
d/control: Add python3-systemd as a dependency
Module systemd.journal is used for writing proper structured messages to
systemd-journald. This was earlier only a recommends.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-06-22 17:17:55 -04:00
James Valleroy
fea7956527
upgrades: Skip enable-auto in develop mode
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-06-21 11:49:20 -07:00
James Valleroy
cf7ff2d1b6
upgrades: Combine into single page with manual update
Manual update is placed in a new section under Configuration.

Tests:
- Ran manual update with packages to be upgraded.
  - Busy indicator is shown as expected.
  - Log display button appears when logs are available.
  - Logs can be expanded and collapsed.

Closes: #1771.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
[sunil: Change the update now button into default priority button]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-06-20 13:49:30 -07:00
Sunil Mohan Adapa
28b5ad9191
tests: functional: Allow parallel installation of apps
- By waiting for one app to finish installing before trying to install.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-06-20 10:43:05 -04:00
Sunil Mohan Adapa
176dc69fc5
tests: functional: Remove implicit and explicit wait times
- Splinter/selenium have implicit and explicit waiting time. Implicit wait time
will make every negative lookup wait for about 3 seconds before it actually
fails. Because we ensure missing elements in quite a few places, this introduces
many 3 seconds wait periods during testing. Remove it instead rely on explicit
waiting whenever needed.

- Explicit wait time is only used during explicitly requests waiting conditions.
In a loop the API waits for a maximum of timeout period until a given condition
is satisfied. Each time the condition is checked, it goes into sleep for
explicit wait period amount of time. This is typically a second or so. Since we
are impatient, make it 0.1 instead.

- Also make sure that whenever a page is visit()ed, we automatically wait until
the page is fully loaded by overriding the splinter wait condition. Otherwise,
we will need to introduce waiting code in a lot of places.

- Using document.readyState == complete is a better check to ensure that a page
is fully loaded. If we proceed with the page 'loading' or 'interactive' state,
we will have to change a lot of code to make it wait.

- Handle Apache restarts when waiting for page load. The error page apparently
is never reaches document.readyState == 'complete'. So, if an error page is
encountered, always reload.

- While waiting for installation, ensure that we atomically check that page has
loaded fully and the installation progress is not being shown. Otherwise, there
would be race condition due to installation page refreshing itself.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-06-20 10:43:01 -04:00
Sunil Mohan Adapa
29f971a272
syncthing: tests: functional: Fix to wait properly
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-06-20 10:42:58 -04:00
Sunil Mohan Adapa
ad5fae2180
ejabberd: tests: functional: Fixes for no implicit waiting
- When 'relogin' hit is seen after page load, reload the page instead of trying
to login as it does not always succeed.

- Wait after the page load until the connection with jabber server has been
checked.

- Wait until the roster appears after login.

- Wait until contact appears after contact is added.

- Wait for popups and dialogs when deleting the contact.

- Wait for contact to appear when checking for contact. Don't reload on every
check.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-06-20 10:42:56 -04:00
Sunil Mohan Adapa
e36818e591
snapshot: tests: functional: Delete all snapshots properly
Don't depend on number of snapshots being 0 to conclude that all snapshots have
been deleted instead use the disabled state of the 'Delete Selected' button.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-06-20 10:42:54 -04:00
Sunil Mohan Adapa
1db2f4982a
mldonkey: tests: functional: Wait for frame to load properly
Before counting the number of downloads.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-06-20 10:42:51 -04:00
Sunil Mohan Adapa
61d36e43fe
users: tests: functional: Leave no-language as final setting
- Whenever functional tests for user app are run, the tester user is left with
the last language that is tested. This is a minor inconvenience. Fix this by
adding no-language option to test at the end.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-06-20 10:42:44 -04:00
Sunil Mohan Adapa
399a132bac
tor: tests: functional: Fix to wait properly on progress page
- Fix the condition for checking if we are on progress page by ensuring that the
page is loaded fully before checking if it is that progress loader. Avoid a race
condition writing a single atomic JS script to check both conditions.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-06-20 10:42:42 -04:00
Sunil Mohan Adapa
ae73b296de
ttrss: tests: functional: Fix to wait properly
- When subscribe button is clicked in subscribe dialog, the dialog does not
close immediately. Wait until it closes or error appears.

- When a feed is added, the feed list refreshes and during that time, it is not
possible to click on the feed expand button. Wait until it can be clicked.
Extend the eventually() method to wait on exceptions and not just false values.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-06-20 10:42:39 -04:00
Sunil Mohan Adapa
f768840165
transmission: tests: functional: Fix to wait properly
When the page is initially loaded, torrents don't appear. It is later loaded
using an AJAX call. Wait until we find the torrents we need.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-06-20 10:42:37 -04:00
wind
bc6b24247d
Translated using Weblate (Russian)
Currently translated at 74.7% (957 of 1281 strings)
2020-06-20 07:41:44 +02:00
Joseph Nuthalapati
2bcff5809d
Translated using Weblate (Telugu)
Currently translated at 64.0% (821 of 1281 strings)
2020-06-20 07:41:43 +02:00
Thomas Vincent
aaabb0d030
Translated using Weblate (French)
Currently translated at 98.6% (1264 of 1281 strings)
2020-06-20 07:41:43 +02:00
ferhad.necef
2f89bfa95b
Translated using Weblate (Russian)
Currently translated at 74.7% (957 of 1281 strings)
2020-06-18 22:03:49 +02:00
Sunil Mohan Adapa
f4d8a68f1d
Translated using Weblate (Telugu)
Currently translated at 64.0% (820 of 1281 strings)
2020-06-18 22:03:48 +02:00
Oğuz Ersen
dd6ff3fa3d
Translated using Weblate (Turkish)
Currently translated at 60.1% (771 of 1281 strings)
2020-06-17 04:41:42 +02:00
James Valleroy
9485d29cfa
Release v20.11 to unstable
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
v20.11
2020-06-15 20:06:39 -04:00
James Valleroy
03115e4e72
debian: Update renamed lintian tag
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2020-06-15 20:05:57 -04:00
James Valleroy
8f8b673dc4
doc: Fetch latest manual
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2020-06-15 19:55:07 -04:00
James Valleroy
6ec687ac9f
locale: Update translation strings
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2020-06-15 19:24:26 -04:00
Sunil Mohan Adapa
c6e4a4cecc
matrixsynapse: Handle upgrade to versions 1.15.x
- Comparison of dependencies of Debian packages for versions 1.13.0 and 1.15.0
show that there no new dependencies and no increase in version requirements for
dependencies. Hence changes to backports pin priorities is not needed.

Tests executed:

- Install older version of matrix-synapse. Run unattended upgrades. It will
refuse to upgrade matrix-synapse.

- Run freedombox, and run apt update, the upgrade for matrix-synapse is
performed by freedombox. The setting for MAM is kept during the upgrade.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Tested-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-06-15 19:05:30 -04:00
Sunil Mohan Adapa
966ceb5871
container: Fix upgrading of freedombox
On a development container, we are currently changing the plinth user to be a
non-system user to allow folder sharing with the host. This leads to `addgroup
--system` and `adduser --system` failing when a non-system user/group already
exists.

This patch added checks to ensure that plinth user and group don't exist before
trying to add them. Several packages in Debian seem to be doing similar checks
before running adduser and addgroup. So, this patch is not bad to have even when
container hack is not present.

Closes: #1875.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-06-15 18:30:04 -04:00
James Valleroy
2d1ced84cd
upgrades: Use a custom service for manual update
- Do not enable/start service during package install/upgrade
- Configure needrestart to skip restarting service

Closes: #1638.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
[sunil: Provide proper regex string in needrestart configuration with qr()]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-06-15 13:33:31 -07:00