3830 Commits

Author SHA1 Message Date
Sunil Mohan Adapa
20f2ff9370
snapshot: Fix issues with restore and delete
- Avoid no-response error when deleting a snapshot. This is caused when disk is
full and delete operation tries to store data in session which is stored on
disk. The session update fails and there are no values to delete. This case in
not handled and return a None in view causing a 500 error. Use GET params
instead.

- Delete all functionality that is meant to speed up deleting snapshots has
regressed and is currently never used. Further, there are more types of
snapshots that can't be deleted that needs to be handled in delete all
functionality. Drop it for now.

- When snapper list is run the snapshot number can contain '-', '+' or '*'
suffixed to it. Currently only '*' is handled. This leads to failure in listing
the snapshots after a restore snapshot'. Fix this is properly parsing. Also it
is no longer needed to query 'btrfs' command to know the snapshot that will
used at next boot. '+' or '*' means that.

- Don't list snapshot number '0'. It is never listed to the user and it can
never be deleted. It represents the current system.

- Properly implement checking for default and active snapshots. Don't let delete
operation on either of them.

- Fix regression with disabling the delete button when there are no snapshots
that can be deleted.

Tests performed:

- Before any snapshot is restored, the labels 'will be used at next boot' and
'in use' are not shown. Snapshot with number 0 is not shown.

- Immediately after restoring a snapshot, the 'will be used at next boot' label
will shown up on snapshot that is going to boot next.

- After rebooting after restore, the snapshot that has been restored will show
'will be used at next boot' and 'in use' labels. Restoring another snapshot will
move the 'will be used at next boot' label to the new restore snapshot but keep
the 'in use' label on the current snapshot until next reboot. Snapshot with
number 0 is not shown.

- Delete check boxes are not shown against the 'in use' and 'will be used at
next boot' snapshots. Entering their values manually in the URL in the delete
screen will lead them to be ignored.

- Select multiple snapshots and click delete. The details appear properly in the
confirmation window. Deleting will delete the snapshots.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-05-11 21:44:39 -04:00
Michael Breidenbach
b008697a0e
Translated using Weblate (Swedish)
Currently translated at 100.0% (1264 of 1264 strings)
2020-05-11 12:41:31 +02:00
Michael Breidenbach
17e3150a28
Translated using Weblate (German)
Currently translated at 100.0% (1264 of 1264 strings)
2020-05-11 12:41:30 +02:00
James Valleroy
d437f61423
snapshot: Set as essential module
Storage Snapshots will be installed by default. It will only be usable
if filesystem is btrfs. For other filesystems, a message is displayed
that it is not available.

Closes #1284.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-05-06 12:00:34 -07:00
Petter Reinholdtsen
ab16dec26b Translated using Weblate (Norwegian Bokmål)
Currently translated at 86.7% (1091 of 1257 strings)
2020-05-06 08:11:56 +02:00
James Valleroy
dac7bc4f8c
Release v20.8 to unstable
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2020-05-04 20:55:02 -04:00
James Valleroy
47b03168ef
locale: Update translation strings
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2020-05-04 20:01:29 -04:00
Sunil Mohan Adapa
b1fd0c93dc
datetime: Disable diagnostics when no tests are available
Closes: #1846

Tests:

- When systemd-timesyncd is running, 'Run Diagnostics' button is shown and two
diagnostics results are shown. The two results appears on the diagnostics app
results too.

- When systemd-timesyncd is not running, 'Run Diagnostics' button is not shown.
Datetime app is not included the diagnostics app page results.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-05-04 19:48:43 -04:00
Sunil Mohan Adapa
ce23f07e92
datetime: Don't expect synced time in diagnostics inside VMs
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-05-04 18:46:29 -04:00
Sunil Mohan Adapa
57daf338c8
datetime: Refactor handling systemd-timesyncd not running in VMs
- Merged the two DateTimeApp classes. In future, we will remove all
module.init() methods in favor of automatically performing the operations from
module_loader.

- Also fix an error running './run --list-dependencies' when running without
systemd support inside a test case container:

   ERROR plinth.module_loader Exception while running init for <module 'plinth.modules.datetime' from '/builds/sunilmohan/plinth/plinth/modules/datetime/__init__.py'>: Command '['systemctl', 'show', '--property=ConditionResult', '--value', 'systemd-timesyncd']' returned non-zero exit status 1.
Traceback (most recent call last):
  File "/builds/sunilmohan/plinth/plinth/module_loader.py", line 123, in _initialize_module
    init()
  File "/builds/sunilmohan/plinth/plinth/modules/datetime/__init__.py", line 77, in init
    if _is_time_managed():
  File "/builds/sunilmohan/plinth/plinth/modules/datetime/__init__.py", line 112, in _is_time_managed
    output = subprocess.check_output([
  File "/usr/lib/python3.8/subprocess.py", line 411, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/lib/python3.8/subprocess.py", line 512, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['systemctl', 'show', '--property=ConditionResult', '--value', 'systemd-timesyncd']' returned non-zero exit status 1.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
CC: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-05-04 18:46:22 -04:00
James Valleroy
b1780f5e09
snapshot: Fix title
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-05-04 15:20:20 -07:00
James Valleroy
9ed61200f2
snapshot: Fix message when not available
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-05-04 15:20:03 -07:00
Sunil Mohan Adapa
b4e6c03bd7
coturn: New app to manage Coturn TURN/STUN server
- Shows URLs and shared secret that communication servers like matrix-synapse
should be configured to. Later we will implement auto-configuring those servers.

- Allow selecting domain for the sake of TLS/DTLS certificate installation.

- Simplify systemd service file options. Drop log file and pid file support as
they are not needed with systemd. Add security options.

- Set custom configuration file by overriding systemd service file options so
that we don't have a problem with conffile prompts.

- Implement functional tests (and automatic diagnostics).

- Custom icon selected from the Noun project as Coturn project does not have
one.

- Backup/restore configuration file and certificates.

- Document some questions regarding configuration options.

Tests performed:

- App is not listed in the app page if 'advanced' flag is disabled.

- App name, icon and short description shows up correctly in apps page.

- App name, icon, short description, description, manual link, enable/disable
button and diagnostics link show up currently in app page.

- Verify that configuration used by coturn server is the FreedomBox
configuration by checking the cert path in the log output.

- PID file is not created in /var/run/turnserver/. It goes into /dev/null
according to the log output.

- No log file is created other than what is collected by systemd from command
line.

- systemctl show coturn.service shows all the intended restrictions such as
NoNewPrivileges, Protect* options.

- Run functional tests.

- Ensure that backup of configuration file works by taking backup, changing the
secret and restoring. During backup and restore coturn should be stopped and
started as per logs.

- Build Debian package. No warnings about the copyright file.

- Enabling the app enables the service and runs it.

- Disabling the app disables the service and stop it.

- All diagnostics tests pass.

- Diagnostic tests show firewall port coturn-freedombox for internal and
external networks, service coturn, and each listening port for udp4, udp6, tcp4
and tcp6.

- Information in the firewall page shows up properly. Enabling the app opens
firewall ports, and disabling it closes them.

- When the app is installed, if a cert domain is available, it will be used.
When multiple domains are available, one of them is picked.

- Status shows 4 URLs with the currently selected domain and secret key.

- Changing domain to another domain succeeds and reflects in the status
information.

- When no domain is configured. Installing the app succeeds. No domain is shown
in the list of domains.

- When domain is changed, the certificates files in /etc/coturn/certs are
overwritten.

- Certificates have the ownership turnserver:turnserver. Public key is cert.pem
has 644 permissions. Private is pkey.pem has 600 permissions. /etc/coturn/certs
is owned by root:root.

- Let's encrypt certificates are setup immediately after install.

- Port forwarding information shows all ports except for relay ports.

- Trying to create a user with username 'turnserver' throws an error. This
happens even when coturn is not installed yet.

- After installing coturn, the configuration file /etc/coturn/freedombox.conf is
created with ownership root:turnserver and permissions 640. The directory
/etc/coturn is created with ownership root:root and permissions 755.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
[jvalleroy: Fix copied form_valid comment]
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-05-02 18:51:23 -04:00
fred1m
efe84419b1
mumble: Add Mumla to the list of clients
* `py.test-3 plinth/modules/mumble/manifest.py` said only two warnings
(could not create cache path {path})

* `sudo -u plinth /vagrant/run --develop` and https://localhost:4430/ had
show me what I expected

Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-05-02 12:50:24 -07:00
Michael Breidenbach
c01a04a31d Translated using Weblate (Swedish)
Currently translated at 100.0% (1257 of 1257 strings)
2020-05-02 10:11:56 +02:00
Nathan
ef60238be9 Translated using Weblate (French)
Currently translated at 100.0% (1257 of 1257 strings)
2020-05-02 10:11:56 +02:00
Luis A. Arizmendi
1e29f7da0e Translated using Weblate (Spanish)
Currently translated at 100.0% (1257 of 1257 strings)
2020-05-02 10:11:56 +02:00
Anonymous
a0dea36da6 Translated using Weblate (Spanish)
Currently translated at 100.0% (1257 of 1257 strings)
2020-05-02 10:11:56 +02:00
Sunil Mohan Adapa
16202e6f3a
*: Update links to repository and project page
- The repository has been renamed from 'plinth' to 'freedombox'.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
2020-05-01 17:14:23 +05:30
nautilusx
0f850f6821
Translated using Weblate (German)
Currently translated at 100.0% (1257 of 1257 strings)
2020-04-27 18:11:16 +02:00
Artem
579600b0a7
Translated using Weblate (Russian)
Currently translated at 75.4% (949 of 1257 strings)
2020-04-25 16:11:15 +02:00
Joseph Nuthalapati
d5a3c7f4cd
Translated using Weblate (Telugu)
Currently translated at 65.3% (821 of 1257 strings)
2020-04-25 16:11:15 +02:00
Veiko Aasa
7d77a26761
datetime: Handle timesyncd service runs conditionally
systemd-timesyncd service does not run if we have another NTP daemon installed
or FreedomBox runs inside a container where the host manages the time. In this
case, make the application as unmanaged - app can't be disabled, no app
diagnostics is shown and enable/disable functional tests are skipped.

Closes #1616

Tests performed:
- Run FreedomBox inside a KVM virtualization module, check that
  systemd-timesyncd is running, datetime app can be disabled and all
  diagnostics and date_and_time functional tests pass.
- Run FreedomBox inside a systemd-nspawn container, check that
  systemd-timesyncd is not running, datetime app can't be disabled,
  the diagnostics button is not shown and two date_and_time functional tests
  are skipped.

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-04-25 09:56:00 -04:00
Sunil Mohan Adapa
a327bf650b
storage: Fix tests by wrestling with auto-mounting of disks
- Also properly cleanup mounted file systems.

- When a file system is created, it is automatically mounted by udiskie (or
FreedomBox itself). This leads loop back setups not getting cleaned and btrfs
check failing to check a mounted disk. Force check in case of btrfs and umount
ignoring errors before cleanup.

Closes: #1839.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-04-25 08:04:30 -04:00
Sunil Mohan Adapa
2526c98de6
static: Use SVG logo during first wizard welcome step
- This removes the need to ship a 67K file and scales better.

- Rename the file to have lowercase chars only for consistency.

Tests performed:

- Goto home page, see the logo at the bottom properly displayed.

- Goto the first wizard welcome page, notice that the logo is displayed. Also
the dimensions of the image are same as without the change.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-04-24 16:09:51 -04:00
Sunil Mohan Adapa
05670257fd
web_server: Suppress warnings that static directories don't exist
When JSXC is not installed, currently we get warnings that jsxc directories are
not found when we start the web server.

Suppress warning that some of the static directories don't exist. Since there is
no way to add/remove those tree mounts at will, we need to add them all before
hand even if they don't exist now. If the directories becomes available later,
CherryPy serves them just fine.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-04-24 10:52:47 +03:00
Veiko Aasa
2d963ec461
users: Try-restart service after service is added to the sharing group
Try-restart the service (instead of restart) after adding service to the
freedombox-share group to avoid starting the service if app is disabled.

Tests performed:
- Remove syncthing user from the freedombox-share group, disable
  syncthing app, increase app version. After the app is upgraded,
  verify that syncthing user is in the freedombox-share group and
  syncthing@syncthing.service remains disabled.
- Remove syncthing user from the freedombox-share group, enable
  syncthing app, increase app version. After the app is upgraded,
  verify that syncthing user is in the freedombox-share group and
  logs show that syncthing@syncthing.service was restarted.

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-04-23 11:21:01 -07:00
Nektarios Katakis
4187a19c34
syncthing: add to freedombox-share group
Closes: #1808

Test performed:
- Install samba in development VM and create open share (owned from root:freedombox-share).
- install syncthing and create syncronization folder in the above openshare.
- Sync files from desktop peer to development VM one on the above folder.

Signed-off-by: Nektarios Katakis <iam@nektarioskatakis.xyz>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-04-23 13:58:07 +01:00
Joseph Nuthalapati
1b3359faf7
Translated using Weblate (Telugu)
Currently translated at 65.2% (820 of 1257 strings)
2020-04-23 09:11:17 +02:00
Luis A. Arizmendi
faf9257bdd
Translated using Weblate (Spanish)
Currently translated at 100.0% (1257 of 1257 strings)
2020-04-23 09:11:17 +02:00
James Valleroy
167895b537
Release v20.7 to unstable
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2020-04-20 18:39:06 -04:00
James Valleroy
5efe523bec
locale: Update translation strings
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2020-04-20 17:54:31 -04:00
James Valleroy
0d059b7553
matrixsynapse: Handle upgrade to 1.12.*
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-04-19 16:46:48 -07:00
James Valleroy
6d1c637c1d
upgrades: Allow installation of python3-twisted from backports
- matrix-synapse >= 1.12 requires python3-twisted >= 18.9.0-8~.

- python3-twisted requires matching version of python3-twisted-bin.

- Increment upgrades module version.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-04-19 11:23:59 -07:00
Veiko Aasa
d26e87661b
gitweb: Improve error handling when creating repository
If an error occurs during creation of a git repository, delete possibly
corrupted git repository directory and show more specific error message.

Closes #1829

Tests performed:
- Gitweb unit and functional tests pass
- Create a small disk for git repositories:
  > dd if=/dev/zero of=disk.img iflag=fullblock bs=128k count=100 && sync
  > mkfs.ext4 disk.img
  > mount -o loop disk.img /var/lib/git/
- Clone a large repository https://salsa.debian.org/freedombox-team/plinth
  Disk got full during cloning remote repository. Repository listing do not
  show this repository anymore. (No errors is shown to the user.)
- Fill disk space:
  > head -c 1G </dev/urandom > /var/lib/git/myfile
- Disk is full. Cloning an existing remote repository fails with an error
  message (No space left on device)
- Disk is full. Creating a new repository fails with an error message
  (No space left on device)

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-04-18 15:23:11 -04:00
Joseph Nuthalapati
202980b6d5
Translated using Weblate (Telugu)
Currently translated at 64.9% (816 of 1257 strings)
2020-04-15 15:11:14 +02:00
Localisation Lab
4a435f0ca0
Translated using Weblate (French)
Currently translated at 100.0% (1257 of 1257 strings)
2020-04-15 15:11:14 +02:00
vihor
14b4c6b795
Translated using Weblate (Serbian)
Currently translated at 11.2% (141 of 1257 strings)
2020-04-13 07:34:40 +02:00
Coucouf
d3c8aac7c3
Translated using Weblate (French)
Currently translated at 100.0% (1257 of 1257 strings)
2020-04-13 07:34:40 +02:00
James Valleroy
ba0bb524ee
Release v20.6.1 to unstable
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2020-04-11 09:57:07 -04:00
vihor
0e0ce2d6cb
Translated using Weblate (Serbian)
Currently translated at 10.5% (132 of 1257 strings)
2020-04-11 15:36:20 +02:00
wind
4786272efe
Translated using Weblate (Russian)
Currently translated at 75.3% (947 of 1257 strings)
2020-04-11 15:36:19 +02:00
Jeannette L
67ed607c86
Translated using Weblate (Italian)
Currently translated at 50.1% (630 of 1257 strings)
2020-04-11 15:36:17 +02:00
Jeannette L
f96e87a5d5
Translated using Weblate (French)
Currently translated at 100.0% (1257 of 1257 strings)
2020-04-11 15:36:17 +02:00
Jeannette L
11b43fd8ee
Translated using Weblate (German)
Currently translated at 99.9% (1256 of 1257 strings)
2020-04-11 15:36:16 +02:00
Coucouf
eb2e10833a
Translated using Weblate (French)
Currently translated at 100.0% (1257 of 1257 strings)
2020-04-11 08:28:02 +02:00
nautilusx
d3c462ca40
Translated using Weblate (German)
Currently translated at 99.9% (1256 of 1257 strings)
2020-04-09 05:20:56 +02:00
Manuela Silva
ba32cd1208
Translated using Weblate (Portuguese)
Currently translated at 13.6% (172 of 1257 strings)
2020-04-08 15:55:30 +02:00
Coucouf
a723352d19
Translated using Weblate (French)
Currently translated at 100.0% (1257 of 1257 strings)
2020-04-08 15:55:28 +02:00
Allan Nordhøy
9f0d5dc0fa
Translated using Weblate (German)
Currently translated at 99.7% (1254 of 1257 strings)
2020-04-08 15:55:26 +02:00