5564 Commits

Author SHA1 Message Date
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
Luis A. Arizmendi
10617b900e
Translated using Weblate (Spanish)
Currently translated at 100.0% (1281 of 1281 strings)
2020-06-14 18:41:42 +02:00
aiman an
db8257d0dd
Translated using Weblate (Arabic (Saudi Arabia))
Currently translated at 1.5% (20 of 1281 strings)
2020-06-10 17:41:41 +02:00
WaldiS
52be9e60dc
Translated using Weblate (Polish)
Currently translated at 28.8% (369 of 1281 strings)
2020-06-10 17:41:41 +02:00
aiman an
fcc9c5adfa
Added translation using Weblate (Arabic (Saudi Arabia)) 2020-06-09 13:59:04 +02:00
Ralf Barkow
c2edcfde42
Translated using Weblate (German)
Currently translated at 98.6% (1264 of 1281 strings)
2020-06-06 02:41:42 +02:00
Sunil Mohan Adapa
2e5a1857f7
container: Add script to manage systemd-nspawn containers for dev.
Inspired by: https://salsa.debian.org/vexch/plinth/snippets/391

This script creates a simple container using systemd-nspawn for developing
FreedomBox. It has many advantages over running a VM using Vagrant. RAM is
allocated to processes in the container as needed without any fixed limit. Also
RAM does not have to be statically allocated so it is typically much lighter
than running an VM. There is no hardware emulation when running a container with
same architecture, so processes run as fast as they would on the host machine.

Environment: The script will run only run on hosts having systemd-nspawn and
network-manager installed, typical GNU/Linux distributions. It has been
primarily developed and tested on Debian Buster but should work on most modern
GNU/Linux distributions.

Disk image: systemd-nspawn accepts not only a directory for starting a container
but also a disk image. This disk image is loop-back mounted and container is
started from that mounted directory. The partition to use is determined by
looking at the boot flag in the partition table. This happens to work well with
all existing FreedomBox images. In future, we may be able to run different
architectures in this manner.

After downloading, the disk image is expanded along with the partition and file
system inside so that development can be done without running into disk space
issues. Expanding the disk does not immediately consume disk space because it
will be a sparse file. As data is written to the disk, it will occupy more and
more space but the upper limit is the size to which disk has been expanded.

Downloading images: Images are downloaded from FreedomBox download server using
fixed URLs for each distribution. Signature is verified for the download images.
The fingerprint of the allowed signing key is hard-coded in this script.
Downloaded images are kept even after destroying the extracted raw image along
with container. This allows for quickly resetting the container without
downloading again.

Booting: systemd-nspawn is run in 'boot' mode. This means that init process
(happens to be systemd) is started inside the container. It then spawns all the
other necessary daemons including openssh-server, firewalld and network-manager.
A login terminal can be opened using 'machinectl login' because container is
running systemd. SSH into the container is possible because network is up,
configured by network-manager, and openssh server is running.

Shared folder: Using systemd-nspawn, the project directory is mounted as
/freedombox inside the container. The project directory is determined as
directory in which this script resides. The project folder from the container
point of view will be read-only. Container should be able to write various files
such as build files, FreedomBox sqlite3 database and session files into the
/freedombox folder. To enable writing, an additional read-write folder is
overlayed onto /freedombox folder in the container. This directory can't be
created under the project folder and is created instead in
$XDG_DATA_HOME/freedombox-container/overlay/$DISTRIBUTION. If XDG_DATA_HOME is
not set, it is assumed to be $HOME/.local/shared/. Whenever data is written into
/freedombox directory inside the container, this directory on the host receives
the changes. See documentation for Overlay filesystem for further details. When
container is destroyed, this overlay folder is destroyed to ensure clean state
after bringing up the container again.

Users: PrivateUsers configuration flag for systemd-nspawn is currently off. This
means that each user's UID on the host is also the same UID in the container as
along as there is an entry in the container's password database. In future, we
may explore using private users inside the container.

'fbx' is the development user and its UID is changed during setup phase to 10000
hoping it would not match anything on the host system. 'fbx' user has full sudo
access inside the container without needing a password. Password for this user
is not set by default, but can be set if needed. If there is no access to the
container in any way, one can run 'sudo machinectl shell' and then run 'passwd
fbx' to set the password for the 'fbx' user.

'plinth' user's UID in the container is also changed and set to the UID of
whichever user owns the project directory. This allows the files to written by
'plinth' container user in the project directory because UID of the owner of the
directory is same as the 'plinth' user's UID in container.

Network: A private network is created inside the container using systemd-nspawn
feature. Network interfaces from the host are not available inside the
container. A new network interface called 'host0' is configured inside the
container which is automatically configured by network-manager. On the host a
new network interface is created. This script creates configuration for a
'shared' network using network-manager. When bringing up the container, this
network connection is also brought up. A DHCP server and a DNS server are
started network-manager on the host side so that DHCP and DNS client functions
work inside the container. Traffic from the container is also masqueraded so
that Internet connectivity inside the container works if the host has one.

If necessary, the network interface on host side can be differently configured.
For example, it can be bridged with another interface to expose the container on
a network that the host machine participates in.

The network IP address inside the container can be queried using machinectl.
This script queries that IP address and presents the address in its console
messages. All ports in the container can be reached from the host using this IP
address as long as the firewall inside the container allows it. There is no need
to perform port forwarding or mapping.

SSH: It is assumed that openssh-server is installed inside the container. SSH
server keys in the container are created if missing. Client side keys are
created in .container/ssh directory and the public key is installed in the
authorized keys file of the 'fbx' user. The 'ssh' sub-command to this script is
simply a convenience mechanism for quick launch of ssh with the right IP
address, user name and identity file.

Role of machinectl: Most of the work is done by systemd-nspawn. machinectl is
useful for running systemd-nspawn in the background and querying its current
state. It also helps with providing the IP address of the container. machinectl
is made to recognize the container by creating a link in /var/lib/machines/ to
the image file. systemd-nspawn options are added by creating a temporary file in
/run/systemd/nspawn. All machinectl commands should work.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-06-04 18:20:03 +03:00
Sunil Mohan Adapa
f2d43737fa
web_framework: Reduce verbosity of DB migration process
During provisioning of container/VM, we need to run --list-dependencies. When
run without --develop, they are unable to create database. When run with
--develop, the output from the database migration process is messing up the
output meant for stdin as it is outputting to stdout instead stderr. Reduce
verbosity even in debug mode to fix this.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-06-04 18:19:36 +03:00
James Valleroy
848845c432
upgrades: Don't enable backports on Debian derivatives
- Avoid introducing dependency on dpkg-vendor.

Tested:

- Install a base-files package from Ubuntu. Change
  /etc/dpkg/origins/default to point to it. Running the
  setup-repositories action does not create the backports list in apt
  sources.

Closes: #1654.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-06-03 21:39:06 -07:00
Sunil Mohan Adapa
ac103d7132
*: Remove use of Turbolinks library
See #1841 for discussion on why Turbolinks needs to be removed.

Closes: #1841.
Closes: #1804.

Tests performed:

- There are no more references to 'turbolinks' in source code other than .po(t)
  files and the manual.

- When loading a page, turbolinks.js is no longer loaded.

- The following links don't have data-turbolinks attribute and work well when
  clicked.a
  - Gitweb repository links
  - Download manual links (en, es)
  - Ikiwiki wiki links
  - Sharing app web share links
  - TT-RSS mobile app link
  - 'Launch web client' button
  - 'Launch' button in web section of clients table
  - Active and regular front page shortcut

- Roundcube does not have a link to /roundcube in description.

- turblinks not present in /static/jslicense.html . LibreJs accepts all scripts.

Reported-by: Veiko Aasa <veiko17@disroot.org>
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Tested-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-06-03 10:29:19 +03:00
Michael Breidenbach
eb88c60389
Translated using Weblate (Swedish)
Currently translated at 100.0% (1281 of 1281 strings)
2020-06-03 04:52:53 +02:00
Michael Breidenbach
a7ec3f9b2e
Translated using Weblate (German)
Currently translated at 98.5% (1262 of 1281 strings)
2020-06-03 04:52:52 +02:00
Petter Reinholdtsen
4a1fcf148a Translated using Weblate (Norwegian Bokmål)
Currently translated at 85.5% (1086 of 1270 strings)
2020-06-02 02:57:19 +02:00
Thomas Vincent
e411be2f5d Translated using Weblate (French)
Currently translated at 100.0% (1270 of 1270 strings)
2020-06-02 02:57:18 +02:00
James Valleroy
bce4c1c974
Release v20.10 to unstable
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
v20.10
2020-06-01 20:07:15 -04:00
James Valleroy
b5ad52ac50
doc: Fetch latest manual
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2020-06-01 19:48:58 -04:00
James Valleroy
074042c84f
locale: Update translation strings
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2020-06-01 17:45:09 -04:00
Sunil Mohan Adapa
48f66a0d7a
pagekite: Fix expired certificates causing connection failures
This is to make Pagekite use certficates shipped by Debian. Otherwise by
default, it uses internally shipped certificates that may be outdated. See:
https://pagekite.wordpress.com/2020/05/30/tls-certificate-validation-issues/

Tests performed:

- Without the patch, configure pagekite with a proper account. Notice that
pagekite fails to connect to the server due to SSL failures.

- Stop FreedomBox, apply the patch, run ./setup.py and run FreedomBox. File
/etc/pagekite.d/90_freedombox_certs.rc is present. Pagekite is restarted by
restarts. It start connecting to the server successfully.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
[jvalleroy: Fix typo in comment]
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-06-01 17:36:56 -04:00
Sunil Mohan Adapa
0273d534cc
minidlna: Fix i18n for name of the app
- Also properly stylize the app name as done on project website.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-05-30 11:36:11 -04:00
Sunil Mohan Adapa
b5bbb16b03
minidlna: Add link to manual page
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-05-30 11:36:08 -04:00
Sunil Mohan Adapa
d379c981bb
firewall: Don't show tun interface in internal zone warning
- We are mention in the internal zone warning that services are available when
connected over VPN.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-05-29 21:27:03 -04:00
Sunil Mohan Adapa
e7be53723f
firewall: Mention that internal services are available over VPN
When showing the internal zone warning.

Closes: #1312.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-05-29 21:27:00 -04:00
James Valleroy
746f7b07fc
templates: Fix setup state check
Closes: #1728.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2020-05-29 13:03:06 -07:00
James Valleroy
1aaf5efb52
users: Avoid error when user's groups cannot be parsed
Add log warnings to help debug if there is a related issue.

May help #1834.

Tested:
- Run action command with valid and invalid username. Warning is printed for
  invalid username.
- Modify the output to remove '='. Warning is printed instead of exception.
- Ensure that warnings messages are output to stderr and not stdout.
- On frontpage.py change the call to get user groups and ensure that that output
  warning messages are not parsed groups.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
[sunil: Drop module logger as root logger is at use]
[sunil: Use %s formatting for logging API]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-05-29 13:01:16 -07:00
Allan Nordhøy
b524cbe399
Translated using Weblate (Greek)
Currently translated at 87.6% (1113 of 1270 strings)
2020-05-29 20:41:38 +02:00
Allan Nordhøy
3ebdb00010
Translated using Weblate (Hungarian)
Currently translated at 80.0% (1016 of 1270 strings)
2020-05-29 20:41:38 +02:00
Allan Nordhøy
a91611694c
Translated using Weblate (Czech)
Currently translated at 79.9% (1015 of 1270 strings)
2020-05-29 20:41:37 +02:00
Allan Nordhøy
64498b7b17
Translated using Weblate (Norwegian Bokmål)
Currently translated at 85.5% (1086 of 1270 strings)
2020-05-29 20:41:37 +02:00
James Valleroy
ee10835359
radicale: Fix link in description to clients
Closes: #1863.

Tested:
- Click on link and it loads valid page.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-05-29 10:54:12 -07:00
James Valleroy
dc5f4a69b7
firewall: Minor spelling fix
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-05-27 14:29:42 -04:00
Sunil Mohan Adapa
b6478b6888
cockpit: Promote for advanced storage/firewalld/networking ops
- Talk about cockpit in networking, firewall and storage apps for advanced
operations. Make it a separate section instead of just description update to
provider higher emphasis.

- Update cockpit description too.

Closes: #1809.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-05-27 14:29:39 -04:00
James Valleroy
b9459655fb
debian: Mark doc packages as Multi-Arch: foreign
Issue was reported by multiarch hinter on
https://tracker.debian.org/pkg/plinth.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-05-26 19:01:25 -07:00
James Valleroy
f46b7ae2a6
utils: Handle removal of axes.get_version()
This was removed from django-axes 5.0.13 with introduction of
setuptools-scm.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-05-26 17:47:30 -07:00
Sunil Mohan Adapa
bb3b32fd69
samba: Add clients information
Closes: #1814.

Tests performed:

- Connect with all the mentioned clients to a Samba folder on a FreedomBox.

- Visit all the links in the clients information table.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-05-26 10:56:36 +03:00
Sunil Mohan Adapa
8ab665a7a2
mldonkey: Add app to freedombox-share group
- To be able to write to folders shared with other apps.

- Increment app version so that already installed apps also get upgraded and
mldonkey becomes part of freedombox-share group.

- Ensure that app does not get enabled after upgrade.

- Relax path restrictions for write access so that mldonkey can write to
external disks and root disk shared folders.

Closes: #1813.

Tests performed:

- Install app freshly mldonkey user is part of freedombox-share group.

- Install app without changes. Switch to a branch with changes. Run ./setup.py
install. The app is upgraded after run. mldonkey user is now part of
freedombox-share group. To check run sudo actions/users get-group-users
freedombox-share.

- Modify options -> Shares and Add Share with a group shared folder with
strategy incoming_files. Remove old share with strategy incoming_files.
Downloading a new file means it will be stored in the shared folder.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-05-26 09:37:05 +03:00
fred1m
169ead7bca
ikiwiki: Enable 'attachment' plugin by default
Closes #1848.

Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-05-25 14:37:25 -04:00
Sunil Mohan Adapa
8cb5716f76
tor: Fix problems with running a relay
This is a fix for regression introduced by
ebe6a0ed026e27dc650b4c2fed8426357f959ddc. I have incorrectly assumed that
providing only IPv6 ORPort is sufficient to listen on IPv4 and IPv6. As a
result, Tor does not run when relay is enabled. Fix this by adding ORPorts for
both IPv6 and IPv4.

Tests performed:

- Tor shows as running after enabling relay functionality.

- Adding single or multiple ORPort values in the configuration file leads to
actions/tor get-status reporting that relay is enabled.

- Functional tests for Tor run properly.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-05-24 08:59:55 -04:00
Joseph Nuthalapati
a4dab3cc36
tests: functional: Add pytest-xdist to install.sh
pytest-xdist is a dependency for parallel execution of functional tests.
2020-05-22 23:16:33 +05:30
Sunil Mohan Adapa
63ab11143a
test: functional: Fix for Apache restart after domain change
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
2020-05-22 22:58:38 +05:30
Sunil Mohan Adapa
863789e47e
snapshot: Fix functional test to account for non-removable snapshots
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
2020-05-22 22:57:15 +05:30
Sunil Mohan Adapa
aa414eb68b
ttrss: Fix functional tests
Looks like the old 'Actions...' menu has been changed into a burger menu. Keep
compatibility with earlier version too.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
2020-05-22 22:56:39 +05:30
Sunil Mohan Adapa
84a7d7c928
coturn: Fix functional test for backup/restore
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
2020-05-22 22:56:25 +05:30
Sunil Mohan Adapa
80dff7bf9c
tests: functional: Re-organize step definitions and helper methods
- Move non-reusable app specific step definitions and helper methods into
<app>/tests/test_functional.py.

- Merge reusable helper methods into plinth.tests.functional

- Merge reusable step definitions into plinth.tests.functional.step_definitions

- avahi, datetime, ikiwiki: Reuse common methods to avoid repetition. Avoid
mapping from app nicknames to actual app names.

- deluge, transmission: Make a copy of sample.torrent for each app to avoid
clogging common place.

- Implement functional.visit() to simplify a lot of browser.visit() calls.

- Ensure that name of the mark on functional tests for an app is same as name of
the app. This will help with predicting the mark when running tests for a
particular app.

Tests performed:

- Run all functional tests.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
2020-05-22 22:52:40 +05:30
Sunil Mohan Adapa
8fac6a71fe
tests: functional: cosmetic: flake8 fixes
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
2020-05-22 21:27:29 +05:30