Remove the following warnings when running functional tests.
plinth/modules/calibre/tests/test_functional.py:13: PytestUnknownMarkWarning: Unknown pytest.mark.sso - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html
pytestmark = [pytest.mark.apps, pytest.mark.sso, pytest.mark.calibre]
plinth/modules/kiwix/tests/test_functional.py:15: PytestUnknownMarkWarning: Unknown pytest.mark.sso - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html
pytestmark = [pytest.mark.apps, pytest.mark.sso, pytest.mark.kiwix]
plinth/modules/searx/tests/test_functional.py:9: PytestUnknownMarkWarning: Unknown pytest.mark.sso - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html
pytestmark = [pytest.mark.apps, pytest.mark.searx, pytest.mark.sso]
plinth/modules/syncthing/tests/test_functional.py:11: PytestUnknownMarkWarning: Unknown pytest.mark.sso - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html
pytestmark = [pytest.mark.apps, pytest.mark.syncthing, pytest.mark.sso]
plinth/modules/transmission/tests/test_functional.py:13: PytestUnknownMarkWarning: Unknown pytest.mark.sso - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html
pytestmark = [pytest.mark.apps, pytest.mark.transmission, pytest.mark.sso]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Fixes: #2568.
When Let's Encrypts events are fired for all applications, they happen on apps
that install as well. They have not been a problem so far because seem to
succeed always. However, ejabberd recently changed to having '*' for list of
domains accepted and also has non-root account for certificate ownership. This
combination causes a certificate operation to fail as the package 'ejabberd' is
not installed and 'ejabberd' user is not available. Fix this by making limiting
certificate operations to apps that have been installed.
Tests:
- Add a new domain name to a production FreedomBox using the Dynamic DNS
'tester' account. 'ejabberd' app should not be installed. LE events fire and a
log message showing failure is noticed. All the events after the failure for
other apps also succeed. The failure is a minor and contained to ejabberd.
- Apply the patch and revoke the certificate. LE event is fired on all other
installed apps but not on ejabberd. No error is logged.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Django's request.get_host() use X_FORWARDED_HOST when appropriate and falls
back to HTTP_HOST. In case of FreedomBox due to 'ProxyPreserveHost On' in Apache
configuration, both the values are the same. So, it makes no difference.
- Also document the need for 'ProxyPreserveHost On' in another validation.
Tests:
- Log the value of request_host, request.META['HTTP_HOST'], and
request.META['X_FORWARDED_HOST'] in DiscoverIDPView:get(). All the values are
same when accessing with IP address value not starting with 127.0.0.1.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
When a client has a package but no desktop package, an empty client entry
appears in the Desktop section.
Tests:
- For MiniDLNA, in the Desktop section, there is not empty entry for totem
anymore.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Update download link to .exe provided by WireGuard.
A utility that downloads, verifies and executes provided MSIs.
source: https://www.wireguard.com/install/
Signed-off-by: Frederico Gomes <fredericojfgomes@gmail.com>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Link to the F-Droid WireGuard package returns 404 Not Found.
WireGuard seems to no longer be packaged by F-Droid.
Signed-off-by: Frederico Gomes <fredericojfgomes@gmail.com>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
- Since FreedomBox does not depend on the package anymore, unattended-upgrades
will remove the package. This causes Apache2 to fail to start. Disable the
module from Apache2 configuration.
Tests:
- Remove the libapache2-mod-auth-pubtkt package. Re-run apache app setup by
incrementing it version number. Apache will fail to start. Apply the patch and
increment the version number. auth_pubtkt module will be disabled and Apache is
automatically running again.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
When testing OpenID Connect, I found that it wasn't working in a VM
with NAT port forwarding. However, vagrant can use bridged networking
instead. When the vagrant box is brought up, the user will be prompted
for which network interface to bridge.
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Tests:
- Clear out the directory /var/cache/apache2/mod_auth_openidc/metadata/. Then
run diagnostics on Calibre app without the patch. Several URLs fail because 404
has been returned on <domain>/calibre URL. With the patch the diagnostics
succeed.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- 'make install' removes enabled sso module
- Already logged in users stay logged in after update
- Apps need to re-authenticate of update (but this is transparent)
- Login and logout work as expected
- Failed login attempts lead to CAPTCHA form
- CAPTCHA form can't be skipped
- Answering CAPTCHA form will lead back to login page
- Users functional tests work
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Migrate old configuration file to new format.
Tests:
- Admin user is able to access a share.
- User belonging to a group allowed to access the share is able to access the
application.
- Regular user is not able to access the application.
- Anonymous user is not able to access the application.
- Setup is run after applying patches.
- Old shares are migrated from old style auth from authpubtkt to oidc. Name,
path, is_public, groups are presevered
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- The built documentation has been updated as expected.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- Functional tests work.
- Admin user is able to access the application
- User belonging to special group is able to access the application
- Regular user is not able to access the application
- Anonymous user is not able to access the application
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- Functional tests work.
- Admin user is able to access the application
- User belonging to special group is able to access the application
- Regular user is not able to access the application
- Anonymous user is not able to access the application
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- Functional tests work.
- Admin user is able to access the application
- User belonging to special group is able to access the application
- Regular user is not able to access the application
- Anonymous user is not able to access the application
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Regression: Users who to don't have git-access permission can't access the
public repositories.
Tests:
- Functional tests work.
- Admin user is able to view and access the repos when there are some public
repos and when there no public repos.
- User belonging to git-access are regular usrs are unable to access private
repos. But they are also not able to access the public repos. They have to
logout to be able to do that.
- Anonymous user is not able to access the application if all repos are private.
If there is at least one public repo, the repo listing can be accessed and
public repos can be seen and accessed.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- Functional tests work.
- Admin user is able to access the application
- User belonging to special group is able to access the application
- Regular user is not able to access the application
- Anonymous user is not able to access the application
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- Functional tests work.
- Admin user is able to access the application
- User belonging to special group is able to access the application
- Regular user is not able to access the application
- Anonymous user is not able to access the application
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- Functional tests work.
- Admin user is able to access the application
- Regular user is not able to access the application
- Anonymous user is not able to access the application
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- Functional tests work.
- Admin user is able to access the application
- User belonging to special group is able to access the application
- Regular user is not able to access the application
- Anonymous user is not able to access the application
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- Application is not installable in stable and testing. It is not functional in
unstable.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- Functional tests work.
- Admin user is able to access the application
- User belonging to special group is able to access the application
- Regular user is not able to access the application
- Anonymous user is not able to access the application
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- Functional tests work.
- Admin user is able to access the application
- User belonging to special group is able to access the application
- Regular user is not able to access the application
- Anonymous user is not able to access the application
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Use the excellent Apache module auth_openidc.
- Implement macros that can be easily used to configure OpenID Connect.
Tests:
- Accessing /freedombox/apache/discover-idp/ shows
- 'method' other than 'get' throw a 'bad request' error
- oidc_callback should match host. Otherwise 'bad request' error is raised.
- Mismatched host header is not allowed
- Invalid domain setup is not allowed
- target_link_uri is returned as is
- method is returned as is and only 'get' is allowed.
- x_csrf is returned as is
- oidc_scopes is returned as 'email freedombox_groups'
- HTTP request is answered and not redirected to https
- When logging in with OIDC, authorization is skipped. When authorization is
shown, it is shown as 'Web app protected by FreedomBox'.
- libapache2-mod-auth-openidc is added a dependency for freedombox package. It
is installable in stable, testing, and unstable distributions.
- On applying patches, Apache setup configuration is run and OpenIDC component
is created.
- When patches are applied and setup install is run, auth_openidc module,
10-freedombox, freedombox-openidc config is enabled in Apache.
- When setup is rerun, passphrase is not changed
- metadata directory and parent are created when apache setup is run. Mode is
0o700 and ownership is www-data.
- freedombox-openidc is created when apache setup is run and has 0o700
permissions.
- Metadata directory will contain the client id and client passphrase when
discovery happens for a particular domain.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Add a component to easily manage registration of client applications.
Tests:
- Package build is successful has dependency on python3-django-auto-toolkit
- python3-django-oauth-toolkit can be installed on stable, testing and unstable
containers
- /.well-known/openid-configuration and /.well-known/jwks.json are servered
properly.
- /o/ URLs don't require login to access
- When logging in list of claims includes 'sub', email, freedombox_groups.
- Logging in using IP address works. Also works with a port.
- Logging in using 127.0.0.1 address works. Also works with a port.
- Logging in using localhost works. Also works with a port.
- Logging in with IPv6 address works. Also works with a port.
- Logging in with IPv6 [::1] address works. Also works with a port.
- Logging in with IPv6 link-local address with zone ID is not possible (as
browsers don't support them).
- When authorization page is enabled, scopes show description as expected.
- When domain name is added/removed, all OIDC components are updated with
expected domains
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- This allows us to perform some checks before redirecting for OpenID Connect.
Tests:
- Functional tests of many apps pass with the patch.
- OIDC related changes introduced later work due to this change.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- Functional tests of many apps pass with the patch.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- Functional tests of many apps pass with this change.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
In some cases, we are visiting / and expecting to reach the home page of
FreedomBox UI. When due to failed tests in config app, the home page is set to
something other than FreedomBox UI, these tests fail. Fix this by visiting
/freedombox explicitly instead.
Tests:
- When hope page is set to Syncthing, kiwix functional tests pass.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Since we are going to be an OpenID Provider, we need to fix the URLs that
other apps will be configured with for authentication. So change now from
/plinth to /freedombox. If done later, it will be harder since all the
configuration files for all dependent apps will need to be updated.
Tests:
- App availability checking works. Request goes to /freedombox URL
- Favicon is served properly and through /favicon.ico URL
- Redirection happens from / to /freedombox directly
- UI is available on /freedombox and on /plinth
- Manual page show /freedombox as the URL in two places
- Static files are successfully served from /freedombox URLs. URLs inside page
start with /freedombox
- backup, bepasty, calibre, config, dynamicdns, ejabberd, featherwiki, gitweb,
ikiwiki, kiwix, miniflux, names, openvpn, shadowsocks, shadowsocksserver,
sharing, shapshot, tiddlywiki, users, wireguard, jsxc, matrixsynapse, first
wizard, storage, samba, tags functional tests work. Backup/restore test for
matrixsynapse fails due to an unrelated bug (server not restarted after
restore).
- Setting the home page works:
- Having /plinth in the home page configuration works. Shows selection
correctly.
- Setting to app works. Shows selection correctly.
- Setting to user home page (sets /freedombox). Shows selection correctly.
- Setting to apache default works. Shows selection correctly.
- Changing back to FreedomBox service works. Shows selection correctly.
- Unit tests work
- Configuration page shows /freedombox in description but not /plinth
- Diagnostics show /freedombox in tests
- Roundcube URL link in email app has /freedombox
- email loads the page /.well-known/autoconfig/mail/config-v1.1.xml correctly
- email app shows /freedombox/apps/roundcube for /roundcube if roundcube is not
installed.
- networks: router configuration page shows URL starting with /freedombox.
- snapshot: Shows URL starting with /freedombox on the app page
- js licenses page uses /freedombox prefix for JSXC.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- This is quite useful for debugging even on production machines.
- CherryPy can't be used for logging as grafting a WSGI application bypasses the
usual mechanisms of logging.
- Keep requests for static files turned off in CherryPy as these are not very
useful.
Tests:
- Making a request print an INFO message on the log with method and path after
the /freedombox part. Logs can be seen in systemd journal.
- Requests for static files are not logged.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Without the --git-export-dir option, gbp builds from the current directory
which contains .container and many other large files. All of these files will
get included into the tarball by default when 'gbp buildpackage' is executed in
an unclean folder.
- With the --git-export-dir option set, 'git export' is first executed to a
temporary directory and this git operation respects patterns in .gitignore. Thus
only expected files end up in the freedombox package source tarball.
Tests:
- When the source directory contains files in ./container, running 'gbp
buildpackage' results in freedombox*.tar.xz containing the disk images of the
containers. With this change, the tarball is clean and none of the files in
.gitignore endup in the tarball.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- Diagnostics page for Calibre app does not show a test for link-local IPv6
address anymore.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
See:
https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license
This eliminates the following warning messages when building the package:
********************************************************************************
Please use a simple string containing a SPDX expression for `project.license`.
You can also use `project.license-files`. (Both options available on
setuptools>=77.0.0).
By 2026-Feb-18, you need to update your project and remove deprecated calls
or your builds will no longer be supported.
See
https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license
for details.
********************************************************************************
Tests:
- Debian package can be built successfully. Two fewer warning during python
package build step were noticed.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Actions have been completed removed due to implementation of privileged
daemon.
Tests:
- None
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- Unit tests pass.
- When file /usr/share/freedombox/freedombox.conf is created, we can see log
message 'Configuration loaded from file - /usr/share/freedombox/freedombox.conf'
- When running in develop mode, we can see log message 'Configuration loaded
from file - /freedombox/plinth/develop.conf'
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Use the recommended configuration from Matrix Synapse documentation.
- Preserve Host: header.
- Set the X-Forwarded-Proto header.
- Don't decode encoded slashes in the URLs during proxying.
- Also proxy Synapse client API.
Tests:
- Web app at app.element.io is able to connect to a local server using browser.
Two client can chat with each other.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- They are not useful.
Tests:
- All the modified SVG files load and show as expected.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Fixes: #2562
Newer miniflux package does not create a separate file called
/etc/miniflux/database. Instead it write the database URL directly into
/etc/miniflux/miniflux.conf. It is easier to create the database settings from
dbconfig-common that to read them from miniflux.conf.
Signed-off-by: Frederico Gomes <fredericojfgomes@gmail.com>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This reverts commit 9af9a504e09b8021041a7d8fe4540574f42edc1c.
This workaround is no longer needed as the file is no longer used.
Reverted as per:
https://salsa.debian.org/freedombox-team/freedombox/-/merge_requests/2752#note_728315
**plinth/modules/miniflux/__init__.py**
- Keep version bump
**plinth/modules/miniflux/privileged.py**
- Keep docstring fix
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
- Currently, the value is hard-coded as /24. Instead take this as input and use
that value.
Tests:
- Entering invalid IPv4 address results in 'Enter a valid IPv4 address' error
message during form submission.
- Entering invalid prefix such as /33 results in 'Enter a valid network prefix
or net mask.' error during form submission.
- Both /32 and /255.255.255.255 formats are accepted.
- The description text for the form field 'IP address' is as expected.
- Changing the value of default route and IP address + netmask reflects in the
status page. Correct values is shown in the edit server and server status page.
- Not providing a netmask results in /32 being assigned.
- Unit and functional tests for wireguard pass. There are some intermittent
failures with functional tests that are unrelated to the patch.
- Setting the /32 prefix results in correct routing table as shown by 'ip route
show table all'. No default routes are network routes are present. 'traceroute
1.1.1.1' shows route taken via regular network.
- Setting the /24 prefix results in correct routing table. No default routes are
present. However, for the /24 network a route is present with device wg1.
'traceroute 1.1.1.1' shows route taken via regular network.
- Enabling the default route results in correct routing table. Default route is
shown for device wg1 with high priority. 'traceroute 1.1.1.1' shows route taken
via WireGuard network.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- Create a server connection with default route setting 'on'. See that the
server status page reflects the value correctly. Repeat for 'off'.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- The default route is not decided by the subnet on the IP address assigned. It
is to be decided using the list of allowed peers in the wireguard settings.
Tests:
- Set the default route setting to 'on' while creating the connection. In the
edit server page, the value is shown correctly. Repeat with 'off' value.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Show them in multiple lines using <pre> like before.
Tests:
- Multiple endpoints are shown in the one line each using <pre> tag.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Fixes: #2563.
Also see
https://salsa.debian.org/freedombox-team/freedombox/-/merge_requests/2740
Test:
- Functional tests for gitweb pass.
- Without the patch, install gitweb and enable it. Restart FreedomBox service.
The error message in #2563 is reproduced. With the patch, the error disappears.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Fixes: #2566.
Thanks to joeDoe for helping with identifying the bug and confirming a fix.
- Currently, when multiple domains are configured, only one certificate is
setup. One domains properly and other domains will end up using the certificate
for the configured domain. This leads to domain validation errors on the
client-side.
- Copy certificates for all domains to /etc/ejabberd/letsencrypt directory
whether they are configured for ejabberd or not.
- Use the new certfiles: directive to provide multiple certificates. Don't use
and remove the old s2s_certfile: directive. Migrate old configuration.
Tests:
- Functional tests for ejabberd work.
- Installing ejabberd freshly works. s2s_certfile: is not present in the
configuration file. certfiles: is present with wildcard for LE certs.
- Install ejabberd without the patch. s2s_certfile: is present and certfiles:
does not contain the wildcard for LE certificates. Apply the patch. Setup is
re-run for ejabberd app and succeeds. s2s_certfile: is removed from
configuration file. certfiles: contains wildcard for LE certificates.
/etc/ejabberd/letsencrypt/ contains certificates for all the configured domains
on the system.
- Adding domain works. Certificate for newly configured domain is copied into
the ejabberd LE cert directory. ejabberd daemon is reloaded. hosts: list is updated.
- Removing domain works. Certificate for the old domain is retained in the
ejabberd LE directory. ejabberd daemon is not reloaded.
- Setting the list of domains works. Old certificates are retained in the
ejabberd LE directory. ejabberd daemon is reloaded. hosts: list is updated.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- Run 'make build install'. The new binary is available as
/usr/bin/freedombox-change-password. Running 'freedombox-change-password
tester2' works as expected.
- Providing wrong username show proper error message.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
The HTML attributes of the translation must be the same as English string. Newly
inserted characters lead to 404 page not found errors.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Fixes: #2560.
The HTML attributes of the translation must be the same as English string. Newly
inserted characters lead to 404 page not found errors.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
- Currently, when adding a server, we have an option for 'default route' but
unchecking it does not work. This is due to allowed_peers always containing
::0/0 and 0.0.0.0/0. Fix this by setting the allowed_peers to a value containing
only the IP of the WireGuard network.
Tests:
- When default routing it checked, routing table shows default route for
wireguard device. Traceroute confirms routing through WireGuard network.
- When default routing it unchecked, routing table does not show default route
for wireguard device. Traceroute confirms routing through regular network.
Signed-off-by: Frederico Gomes <fredericojfgomes@gmail.com>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
- When an error page is shown during installation/uninstallation, no automatic
refresh of the page happens. Fix this by reloading the page when error is shown.
- When error page is shown, the document.readyState is "interactive" (meaning
that page load is completed but other resources such as images are being
loaded). So, checking for error page is never happening.
- Also when reloading an error page, WebDriverException may happen so use the
wait_for_page_update() utility to perform the page reloads.
Tests:
- Run functional tests for bepasty. When installing the app, stop apache web
server. Let an error page be shown. Then start the server again. Without the
patch, the error page is never reloaded. With the patch, the error page is
reloaded and tests succeed.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Currently when HTMX tries to fetch a page and fails, it silently fails and
does not perform any further operations. So, the installation page is stuck.
This is also leading to functional test case failures.
- Handle errors in page response and errors while making requests and reload the
entire page. This will result in browser showing appropriate error page. User
will understand that the operation has failed.
- Also add HTMX event listeners on the body as shown in HTMX documentation.
Tests:
- Press install. After installation process has started, stop Apache web server.
Without the patch, HTMX fails silently and the installation progress is shown
indefinitely.
- With the patch applied, the connection error page is properly shown.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- If functional tests run fast, daemon will be stopped and started many times.
This is hitting rate limit for some daemons.
Tests:
- Configuration file is created as expected. systemd read the value as shown by
'systemctl show'.
- Mumble functional tests pass without having to insert sleeps.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
- Change theme to 'Book' based on Sphinx pydata theme. It supports dark/light
modes. Looks more modern and better defaults/options.
- Add logo on the top left corner.
- Add menu to go to repository, view page source, edit page source, and report
issue on current page.
- Don't repeat 'FreedomBox Authors' in authors text and copyright text. Show
only once as suggested by the theme.
- Use theme option to show license link instead of overriding the template.
Tests:
- After building the theme, all options work as expected.
- Footer appears as expected.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
- When there is an error writing to certificate files, the umask is not reset
properly. Fix this my using umask context manager from action utils. This could
be core reason behind: #2564.
Tests:
- Changing the domain name creates the file /var/lib/quassel/quasselCert.pem
with the proper permissions of 0o600. If in Quassel app's Let's Encrypt component
the certificate file path is changed, then two files are created on domain name
change. Private key is created with 0o600 permissions and certificate file is
created with 0o644 permissions.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Closes: #2564
Tests:
- Changing the domain name in quassel app page set the expected file
permissions. Changing the value in the code results in file getting created with
changed permissions.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- When we set umask we typically want to change it back to original value after
the operation. Implement a context manager to help with this.
Tests:
- Unit tests pass.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Originally aimed to show server info (public key, endpoints) in a table.
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
[jvalleroy: Remove trailing spaces]
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- When /var/lib/plinth/.ssh is deleted and add remote repository form is
visited, the directory along with SSH key files are created. The .pub file has
the expected comment freedombox@configured_domain.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Tests:
- Provide incorrect passphrase when adding a remote repository. Should show a
message that passphrase is incorrect and redirect back to add remote repository
form.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
- As a safe guard although it should exist because of a prior verification of
SSH key.
- Minor refactor to make the method flatter.
Tests:
- Remove /var/lib/plinth/.ssh and visit add remote repository form. The public
key is displayed in the form. The files in /var/lib/plinth/.ssh are created with
expected permissions.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
- Integrate SSH error handling into borg error handling.
- Move logic to migrate SSH keys into lower levels (Repository class) so that it
can performed at more instances such as when initializing repository. It also
provides better abstraction keeping the view logic simpler.
- Drop ability to mount repository using password. This is important next step
for mounting using systemd unit files.
- Use exceptions to eliminate return value checking.
- Create a special exception for exceptions raised during SSH operations. Raise
this at lower levels and handle these using the common error handler.
Tests:
- Adding a remote repository with key and password authentication works with and
without encryption. Adding works with SSH host key pre-verified works too.
- Trying to add a remote repository with incorrect passpharse fails with the
simplified error message. Redirect happens to add remote repository page. Error
message with SSH host key pre-verified works too. Repository is removed.
- Trying to provide wrong SSH password fails with a simplified error message.
Redirect happens to add remote repository page. Repository is removed.
- Mounting a repository after unmounting it works.
- Mounting a repository with SSH password in its configuration works. Migration
is performed and SSH password is replaced with SSH key file path.
- A schedule for a repository with SSH password runs successfully. An archive is
created. Migration is performed and SSH password is replaced with SSH key file
path.
- SSH identity files are created with plinth:plinth ownership. Private key file
is created with 0o600 permissions and public key file is created with 0o644
permissions.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Tests:
- Adding a remote repository with key and password authentication works with and
without encryption.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
- This makes the functional test focus more on the repository that is added
rather than all remote repositories.
Tests:
- Functional tests for backups app works.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
- Use bootstrapform templates where possible to reduce code.
- Fix incorrect tag for radio button for password authentication.
- Drop borders and instead:
- Style each group as a section. This includes encryption section and
repository path section.
- Utilize the simplicity as passwords fields are not displayed.
- Retain <label> tag so that clicking on it works and it also easier for
accessibility tools.
Tests:
- The option for password authentication works are expected. The fields for
encryption passphrase, ssh password work as before.
- Clicking on form labels focuses the form element.
- Adding a repository with key and password authentication works with and
without encryption.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
- Unlike the case of network forms, for example, there is nothing the user could
infer from a disabled form element. If they see a disabled DNS field, they would
understand that it is an editable value but has been disabled due to other
option values. It is important to allow users to discover this. However, in case
of password fields, they are not needed to be shown to the user unless the
appropriate option is selected.
Tests:
- In the add remote repository form, selecting the authentication type radio
options shows and hides the password field. Selecting the value for encryption
type shows and hides the encryption password field.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Tests:
- In remote repository add form, selecting radio options for authentication
types does not throw an error. The password field is shown/hidden as expected.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Tests:
- Make a privileged method throw and exception after spewing output to stdout
and stderr. The exception caught on the service daemon contains the expected
stdout and stderr messages.
- Sending SIGTERM to privileged daemon shuts down the daemon.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Tests:
- On main branch, add a remote repository with SSH password. Unmount
the remote location.
- Switch to branch with this change. Mount the remote location. Logs
show that it is migrated from password to key authentication. Plinth
database no longer contains password for this remote.
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
- Use javascript to disable or enable password fields.
- If SSH key auth is selected, then try the connection.
- If SSH password auth is selected, then copy the key.
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
- After copying the SSH client public key to the remote host, replace
the SSH password credential with keyfile.
- Also use SSH key when checking that remote directory exists.
Tests:
- Add remote backup location "tester@localhost:~backups". Test various
operations like create backup, download backup, unmount and
mount. Confirm that SSH password is no longer present in plinth
sqlite database.
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- In development VM, add a remote backup location of "tester@localhost:~/backups".
Verify the SSH host key. plinth@freedombox key is listed in
/home/tester/.ssh/authorized_keys.
- Remove the remote backup location, and delete /home/tester/.ssh/authorized_keys.
Add the same remote backup location again. plinth@freedombox key is again
listed in /home/tester/.ssh/authorized_keys.
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- Click on Add Remote Backup Location. Logs show that SSH client key is
generated. The private key is readable only by plinth user.
- Go back, and click on Add Remote Backup Location again. Logs show that SSH
client key already exists.
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- When a notification dismiss button is clicked, first it fades and collapses
at the same time.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
Tests:
- Through code changes, ensure that dist upgrade notification, updated to new
release notification, privacy notification, and app installed notification show
up. Ensure that they have correct hx- attributes and URL property for dismiss
button. Clicking dismiss button works as expected.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
- Delete only the <li> of the notification using HTMX.
- Notifications list stays open. User can dismiss another notification.
- Decrement notification counter using JavaScript after removing
notification from the list.
- Added HTMX to every kind of notification.
- Tested dismissing notifications from the top, middle and bottom of the
list.
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
[sunil: Update comment format in .js file]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Tests:
- When app install button is clicked, the new page shows that app is being
installed. However, when app installation is complete, the notification still
shows that app is being installed. With the patch, the issues is resolved.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Display the WireGuard server endpoint (ip_address:listen_port)
alongside the public key on the main WireGuard page,
so users configuring clients can copy both values directly.
Signed-off-by: Frederico Gomes <fredericojfgomes@gmail.com>
[sunil: Keep the docstring]
[sunil: Adjust markup to eliminate <p> inside <p>]
[sunil: Produce a single <pre> tag instead of multiple for multiple domains]
[sunil: Minor refactoring for more concise code]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Tests:
- Install WireGuard and start the server. Uninstall the app and re-install.
Without the patch, the connection remain after uninstall. With the patch, the
connections are removed after uninstall and return to pristine state after
re-install.
- Functional tests succeed.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Display the next available IP address that will be
automatically assigned when adding a new client.
Helps admins know what client IP to provide when configuring client
connections back to this server.
Signed-off-by: Frederico Gomes <fredericojfgomes@gmail.com>
[sunil: Turn the IP address styling into a form element]
[sunil: Update the comment style for consistency]
[sunil: Update the label for clarity]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Container usage docs have been updated to be in line with
merged request !2731.
Signed-off-by: Frederico Gomes <fredericojfgomes@gmail.com>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Adds explicit UI flow to generate server keypair and interface.
- New EnableServerView
- Conditional 'Start Server' button on main page when no wg0
- Button switches to 'Add Client' after server setup
Solves circular dependency UX issue when connecting two FBs
EDIT: Following review feedback, I removed the intermediate
confirmation page.
The “Start WireGuard Server” button now sends a POST
directly from the main page.
Signed-off-by: Frederico Gomes <fredericojfgomes@gmail.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
[jvalleroy: Change from TemplateView to View]
[jvalleroy: Remove redundant import]
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
GitWeb requires authenticated access if there are no public
repositories left.
1. Create a public repository
2. Delete the repository (i.e. delete the last/only repository)
3. GitWeb app shows as disabled, but is still usable
4. If another repository is created, the app becomes enabled again
Not considering the component GitwebWebserverAuth when determining
whether the app is enabled or disabled.
This commit fixes the status shown in the configuration page, but keeps
the authentication requirement if there are no public repositories.
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
The notifications dropdown does not behave like the other 3 dropdowns in
the navigation bar, but a user would expect it to, since it is also
visually a dropdown like the others.
Added JavaScript for a click listener that would collapse the
notifications dropdown if the user clicks anywhere outside the dropdown
area.
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Add up/down commands as aliases for start/stop commands.
'stop' is not the opposite of 'up', so it can be confusing to new users
of the script.
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Fixes: #2554
- Update permissions on the backups-data directory so that files are only
accessible by root users.
- Ensure that the directory is created by the 'backups' app and not by each of
the apps that take the backup.
Tests:
- Run functional tests for miniflux, dynamicdns, wordpress, zoph, and nextlcoud.
There was an unrelated functional test case failure in nextcloud.
- On a fresh installation, apply patch. Service is restarted. The directory is
created with proper permissions and ownership.
- On a fresh installation, without the patch. Backup the dynamicdns app. The
directory is created with incorrect permissions. Apply the patch. Service is
restarted. Proper permissions are set on the directory.
- On a setup with incorrect permissions, re-run backups app's setup. The
permissions are updated correctly.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Fixes: #2555
- '-' in configuration keys changed to '_'. Write both old and new keys to the
configuration file so that same code works for both versions of transmission.
Extra keys are ignored and removed from the configuration by the transmission
daemon.
- When reading the configuration for download directory account for both old and
new keys.
- Update functional tests for change in ID for delete torrent button.
Tests:
- Run functional tests on trixie and forky VM.
- On trixie and forky VM, after the app is installed, the configuration values
are set as expected in the configuration file. Transmission does not show its
own authentication dialog. FreedomBox SSO works as expected.
- On trixie and forky, updating the download dir in FreedomBox app changes the
values in the web UI.
- On forky, install transmission using old code and sources.list updated to
trixie. Change the download directory. Stop service. Then update the
sources.list to forky, apply patches and start service. Run unattended-upgrades.
Notice that the earlier set download directory persists. Two configuration
values for rpc also are as expected.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Update link in copyright file to the logo.
- Update paths to configuration file. Drop hack to load old configuration path.
Migrate old configuration file to new path.
- Use newer package name instead of transitional package name.
- Use newer systemd unit name instead of aliased one.
- Update backup/restore paths.
- Drop code to handle configuration file update. This upgrade was done during
Bookworm cycle. It is not needed for upgrade from Bookworm to Trixie.
- Fix understanding of default values for keys not present in the configuration
file. These values are picked up from source code as the documentation does not
mention them.
Tests:
- Run unit and minetest functional tests.
- After the app is freshly installed. Max users is 15. PvP is enabled. Create
mode is disabled. Damaged is enabled.
- Changes in configuration are reflected.
- Play a game and make some changes. Update configuration. Backup. Uninstall and
restore. The player data is restored. Configuration is restored.
- Install without the changes. Make configuration changes. Apply changes and
remove obsolete files. Restart service. App is updated. Notice that
configuration file is migrated to new path. Configuration options are retained.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This is to follow up with the upstream change:
https://blog.luanti.org/2024/10/13/Introducing-Our-New-Name/.
Rename Minetest to Luanti in:
- App name
- App description
- Clients' name
- Docstrings
- Also update the donation and client download links to point to the new
domain.
- Make the app button point to /apps/luanti while continuing to serve
/apps/minetest in case somebody has it bookmarked.
Closes: #2521
Signed-off-by: Benedek Nagy <contact@nbenedek.me>
[sunil: Rename the old URL to index-old to avoid duplicates]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Tests:
- Install Transmission, apply the patch and confirm that the 409 conflict error,
that the redirects were originally meant for, is not reproducible anymore.
Fixes: #2502
Signed-off-by: Benedek Nagy <contact@nbenedek.me>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Tests:
- Bring up vagrant box version 25.16. Able to access the web interface
after setup is complete.
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Fixes: #2551.
Tests:
- In a VM visit the storage page. Without the patch, an exception is logged when
there is no space to expand the partition. With the patch, the exception is not
logged.
- Raise an exception in the storage.usage_info() method and notice that the
exception is logged when visiting the Storage app page.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- In the Calibre app page, the enable/disable toggle button has dark colors in
dark theme mode. The colors are proper when enabled, disabled, enabling,
disabling, hover.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- Select-all button in create backup page has mostly unchanged color in light
mode and more consistent color in dark mode.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- Main header's shadow is unchanged in light mode. In dark mode, it is still the
same and not really visible. This is better than casting a white shadow.
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- Insert event.preventDefault() in form submission code for submission buttons.
- For various button styles, submit the form. Running status indicator appears
on the form button. The styles for the indicator is appropriate in dark and
light themes.
- Calibre delete library confirmation page has btn-danger.
- Software Update, configuration update button has btn-primary.
- Software Update, 'update now' button has btn-default.
- Change a button from btn-primary to btn-link. Running status is not shown
for this type of button.
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- They were only present for compatibility with Bootstrap 5.2. The values were
picked directly from Bootstrap 5.3. So, there is no change in output.
Tests:
- Go to user creation form and make errors. A form element with error has red
outline like more. The help text and error message are also in red like before.
In dark mode, they are more appropriate with the rest of the page and with
higher contrast.
- On default styled button, background color on hover is also improved
similarly.
- The border for select-all button in the create new backup page is also
improved similarly.
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- In apps and system pages, the tags text in a card is unchanged in light theme.
In dark theme, it is more consistent with the rest of the page.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- In network connection editing page, find some form elements that are disabled
and their light mode color is mostly unchanged. In dark mode, it looks
consistent with the rest of the page.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Use color variables provided by Bootstrap. These automatically adjust to light
and dark themes.
Tests:
- In light mode, the style for 'Update now' button in Software Update app is
close to what it was before. In dark mode, the styling is consistent with the
rest of the page.
- Same is true for Calibre app 'Delete Library' button and extra options button
in an app.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Use the right CSS variable.
Tests:
- In a form, the help text for an input is unchanged in light mode. And in dark
mode, it is more appropriate.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- In the app header as well as tag search bar.
- De-emphasize the tag buttons in app header so that users won't see them as
sections of the page.
- Add a bullet Unicode character between the tags in app header to separate them
properly with new de-emphasized styling.
- Fix vertical alignment of text between tag buttons in app header and the close
button in tags in tag search bar.
Tests:
- In the app header, styling has been de-emphasized and tags now look more like
simple text. They are a separated with a bullet Unicode character. Vertical
alignment of bullets is accurate.
- In the tag search bar, tags continue to look like buttons but more like default
buttons. Vertical alignment of close button is accurate.
- In both areas tags look properly in dark and light color themes.
- In mobile view when there are a lot of tags, tags flow into second line.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- This simplifies the implementation and gets it ready for dark/light mode.
Tests:
- In the upgrades main view, set is_busy = True and disable setting
refresh_page_sec. Load the upgrades app and notice that the 'Updating...' button
is showing proper styling in light anddark modes.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Add a toggle menu for selecting the color scheme. JS code largely taken from
Bootstrap documentation and slightly customized.
- Use local storage to store the setting for dark/light/auto. Default to auto
which means browser level preference is picked up (which could be system level
preference).
Tests:
- Appearance of the toggle menu is consistent. Check box is shown on the
currently selected value.
- Deleting the local storage value reverts the preference to browser set value.
- Menu is collapsed at smaller screen sizes. Appearance and functionality as
expected.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- pytest runs the expected tests for Home Assistant.
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
- Without the CSP, during loading there are no errors in the console. However,
during chatting, some styling related error show up.
Tests:
- Ensure that there are no CSP related errors in the browser console.
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Fixes: #2547.
- Earlier, FreedomBox itself depended on Bootstrap 4 as needed by the room we
built for JSXC. Since FreedomBox moved to Bootstrap 5 this library is no longer
available for JSXC. libjs-jsxc itself depends on libjs-bootstrap which is of
version 3.
- Also fix the path for jquery-slimscroll. This is was likely updated for Trixie
cycle.
Tests:
- Connect to JSXC with two different browsers. Add contacts. Initiate chat and
send messages.
- Re-run app setup and it succeeds.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- The following messages was seen on the ddns.freedombox.org server:
"Unserviceable IP address from <ipv6_address>: user <username>.fbx.one - IP:
<ipv6_address>". This is due to code that checks for validity of incoming IP
address and fails. The current configuration only handles IPv4 address. Even if
this restriction is lifted, GnuDIP code does not contain code to add/remove AAAA
records.
- Fix this by forcing GnuDIP HTTP update requests to go on IPv4.
Tests:
- Copy the code for _request_get_ipv4() into a python3 console and run
_request_get_ipv4('https://ddns.freedombox.org/ip'). Do this on a dual stack
machine with both public IPv4 and IPv6 addresses. Only IPv4 address returned.
Changing the AF to AF_INET6 returns only the IPv6 address.
- Take a test DDNS account offline. Configure it in FreedomBox stable VM. The IP
address is properly updated.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- If an app declares dependency on package that is also a dependency for
freedombox, then during the app's uninstall, the dependency is attempt to be
removed and will fail (because freedombox package will be held state).
- Add freedombox (and thus its dependencies) to the list packages that should be
removed from list of packages to be removed during app uninstall.
- In test case, update list of packages attempted removal as the 'freedombox'
package is installed only in some environments.
Tests:
- Uninstall janus works. Log messages show that libjs-bootstrap5 and
node-popper2 are in the list of packages originally set to removed during app
uninstall but are later filtered out.
- Run pytest with 'freedombox' package installed and ensure all tests pass.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Bootswatch is a theme library for bootstrap. In Debian, only 3.x version of
the package is available. It is compatible with bootstrap 3.x but not bootstrap
5. Drop the theming altogether and use the basic bootstrap style (which is
already very close to the theme).
- Updated copyright year, mention the video room files in debian/copyright.
- Drop libjs-spin.js which is no longer used by the updated code.
- Change bootstrap version to 5.x from the earlier 4.x. Also add node-popper2
library (needed by bootstrap5 and video room code) as explicit dependency.
- Add missing style for btn-default class dropped in bootstrap 5.
- .simulcast-button CSS style is not longer needed as updated code used flex box
with .d-flex bootstrap class.
Tests:
- Compare the files in janus source code around Mar 2022 with the files in
FreedomBox source code before this patch. Compare latest janus source code with
the files after this patch. Both sets of changes are very similar.
- Connect to video room using two browser windows. Connection is successful and
2 video streams are shown in each of the browser windows.
- Styling looks close to the demo on janus website and is acceptable.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Needed for the new video room code to run without CSP errors in the browser
console. JS error happens immediately after loading the page before Janus
initialization. Styling related errors happen after joining the room despite
eliminating use of'style=' attributes from JS code.
Tests:
- The video room works for a conference without showing any
Content-Security-Policy header related errors in the Firefox developer console.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Janus is currently not installable in Trixie because Janus was temporarily
removed during the release process of Trixie.
- Installing it from unstable, despite the instability is better than keeping
the app unavailable. Users have reported using the app.
Tests:
- Restarting the service after applying the patch leads to setup for upgrades
app to run. Apt preferences for janus packages are set. App is shown as
available. It can be installed.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- This allows overriding these headers in individual pages easily instead of
relaxing global policy.
- Drop the obsolete CSP directive "block-all-mixed-content" and avoid a console
warning in Firefox.
Tests:
- Load a page and notice in the browser developer tools that the three headers
referrer-policy, content-security-policy, and x-content-type-options are set as
before.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- Running 'make build install' remove the module loading include file for ttrss.
- TT-RSS is no longer available in apps page.
- Installing Tor works. Onion header is set correctly. Re-running app setup
works.
- RSS Bridge's description is updated as expected. Links work.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
The following message is shown when Matrix Synapse server is started.
"""
This server is configured to use 'matrix.org' as its trusted key server via the
'trusted_key_servers' config option. 'matrix.org' is a good choice for a key
server since it is long-lived, stable and trusted. However, some admins may
wish to use another server for this purpose.
To suppress this warning and continue using 'matrix.org', admins should set
'suppress_key_server_warning' to 'true' in homeserver.yaml.
"""
Explicitly configure the server to use matrix.org as the trusted key server to
avoid the warning. The value can be set to empty list of servers, however, our
users are served best by this default.
Tests:
- On a testing container, when patch is applied after Matrix app installation,
the configuration file is updated.
- After the configuration is updated the warning is removed during Matrix
Synapse startup.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Create a separate section for federation as it is so important.
Tests:
- Federation description and TLS warning are shown in a separate section on the
app's post-setup page.
- Clicking on the testing tool link takes the user to the testing tool and the
current server's domain is automatically tested.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- This has already been update in the pre-setup page.
Tests:
- View the post-setup page and notice that the message was updated.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- Images are shown in the pages /plinth/help/manual/en/bepasty and
/plinth/help/manual/en/. Before the patch, images are not shown and 404 errors
are raised.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
- This shows status of each language rather than just a single number for all
the languages. This hopefully highlights languages needing more work.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- This means that systemd sandbox will be in effect even during development. We
won't miss out on bugs in sandbox configuration.
- We won't have disable systemd sandbox features just because we can test
properly on development setup. Such as JoinsNamespaceOf=.
- This also leads to significant reduction in hacky code for setting up for
development and functional tests.
- One disadvantage is that first setup is run before user gets a chance to
interact with the started container/VM. However, this is okay since first setup
can be re-run easily by removing the /var/lib/plinth/plinth.sqlite3 file and
also the need for doing this is rare.
Tests:
- Start a fresh container and run functional tests with './container run-tests'
on it. The tests run as expected (succeed or fail).
- While first setup is in progress, running the command 'make
wait-while-first-setup' waits while printing dots. After the first setup is
done, it exists.
- Running the command freedombox-logs shows FreedomBox logs for both the web and
privileged services.
- Changing a source code file in the /freedombox directory (or on the host)
leads to a restart of the Plinth web service.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- Similar to freedombox-privileged daemon. It makes it easy to turn on
development mode from a systemd service override (without having to override the
entire command line).
Tests:
- With the changes to systemd service file in this patch series, changing source
code file leads to plinth getting restarted.
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- This can have may uses such as:
- Waiting properly on the reboot page until the system has been restarted
while showing the status.
- Or, waiting for first setup to complete before running functional tests.
- Or, monitoring for the health status of FreedomBox in general.
- The page is public as all the information conveyed there is also already
public. Should we introduce any sensitive information there such as
'operations_in_progress', we can provide that information only to
administrators.
Tests:
- Visiting /plinth/status/ shows the status in JSON. Using curl to retrieve the
information is also possible.
- During the first setup 'is_first_setup_running' is 'true'. After it has
completed, it is 'false'.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- Earlier PrivateTmp=no is set freedombox-privileged.service in
4140d3b4444d2fd55ac682d066fd859cb2f034b5 and the fix was not properly tested.
Similar change was needed in plinth.service and it was not done.
- Complete the fix but this time enable private tmp and join namespaces for the
two daemons.
- This will cause issues with file uploading when plinth is run from command
line (for development purposes). This will be addressed separately.
Tests:
- Apply the change and reload systemd and restart service. Don't run plinth on
command line and run it as service.
- Uploading libraries to kiwix works
- Uploading backup tarballs works.
- Uploading TiddlyWiki and Feature Wiki wiki files works.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Fixes: #2536.
Multiple fixes:
- When miniflux and postgresql are install simultaneously, miniflux setup may be
installed before postgresql is started.
- When postgresql is already installed and disabled (due to a previous
uninstall), then postgresql may not be running during miniflux package
installation (and fail initial DB setup).
- When app is being installed while it is disabled, the database may not running
and may lead to failure in removing the app database.
Tests:
- Run functional tests on stable/testing twice in a row.
- Install the app without postgresql or miniflux installed.
- Disable the app and uninstall it. DB is purged.
- Uninstall and re-install (with postgresql is disabled during installed).
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- Uninstall miniflux and postgresql. Install freshly with all the patches in
this series. When installing miniflux freshly, postgresql is not disabled soon
after miniflux package is installed. Without this patch, postgresql is disabled
after packages are installed leading to a setup failure.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This prevents logging usernames and passwords to the journal logs and to the
Git repo configuration. Also, avoids usernames and passwords appear in the
process list when cloning a repository.
Tests performed:
- Create a new repository by cloning an existing repository URL with basic
auth credentials. Check that:
- Cloning succeeds.
- Journal logs don't contain URLs with credential info.
- The configuration of the cloned repository doesn't contain credential info.
- Try to clone a non-existing repository URL that contains credential
info. Cloning fails and there are no credential info in the journal logs.
- Cloning a public git repository without credential info succeeds.
- All the gitweb module tests pass.
Signed-off-by: Veiko Aasa <veiko17@disroot.org>
[sunil: Add/fix some more type hints]
[sunil: Add tests for URL parsing]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
- The privileged service will stop by itself if left idle for 5 minutes.
However, if someone is viewing a reloading page such as during manual software
update, the privileged service is never idle.
- When freedombox package is updated to a newer version, the old version of
privileged daemon could run for a long time but newer version of freedombox
service might be running by then. This would cause protocol mismatch
problems (unless backwards compatibility is provided which is unnecessarily
hard).
- Adding PartOf=.socket in .service file means that if .socket unit is stopped
or restarted, the .service unit will be stopped or restarted too. We still don't
want the dh_installsystemd script to be starting the .service unit, so this is
ideal.
Tests:
- During fresh install of freedombox package, freedombox-privilged.socket is
started but freedombox-privileged.service is not. It is started due to socket
activation (as seen in journal logs of privileged daemon).
- During removal of freedombox package, .service is stopped when .socket unit is
stopped.
- During reinstall of freedombox package, .service is restarted when .socket
unit is restarted.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- These situation occur when server encounters an error when trying to formulate
a response. All exceptions during execution of actions are caught and reported
properly. However, server may encounter errors during processing of exception
raised in an action. Or may die abruptly. This special error will make
identifying such situations easier.
Tests:
- Add a 'return' after _read_request() in
privileged_daemon.py:RequestHandler:handle(). This will trigger this error.
Starting FreedomBox service will show these errors as 'ConnectionError: Server
returned empty response'. Similarly running 'freedombox-cmd --no-args plinth
is_package_manager_busy' will show the same error.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- Now that we have a mechanism for properly collecting, transmitting, and display
the stdout and stderr. There is no reason not to collect all of the stdin and
stderr.
- Also, the stdin/stderr=subprocess.PIPE is redundant and prevents the output
from getting collected for debugging. So, remove it.
Tests:
- Ran functional tests on backups, calibre, ejabberd, email, gitweb, ikiwiki,
infinoted, kiwix, mediawiki, mumble, nextcloud,, openvpn, samba, wireguard,
zoph. 2-3 issues were found but did not seem like new errors.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- This is to capture stdout and stderr and transmit that from privileged daemon
back to the service to be displayed in HTML.
Tests:
- Unit tests and code checks pass.
- Some of the modified actions work as expected.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- This is to capture stdout and stderr and transmit that from privileged daemon
back to the service to be displayed in HTML.
Tests:
- Unit tests and code checks pass.
- Some of the modified actions work as expected.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- This is to capture stdout and stderr and transmit that from privileged daemon
back to the service to be displayed in HTML.
Tests:
- Unit tests and code checks pass.
- Some of the modified actions work as expected.
- systemd daemon-reload is performed during infinoted setup.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- This is to capture stdout and stderr and transmit that from privileged daemon
back to the service to be displayed in HTML.
Tests:
- Unit tests and code checks pass.
- Some of the modified actions work as expected.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- When an exception is raised in subprocess.run(), for that call the stdout and
stderr are not being collected. Any previous successful calls are being
collected.
- This also fixes issues with adding an existing backup repository back after
removal. Capturing stderr is essential for raising the proper exceptions and
working correctly.
Tests:
- Remove an existing backup repository and add it back again. It fails with the
patches and succeeds with the patches.
- Remove an existing encrypted backup repository and add it back again with the
wrong password. A proper error message is shown 'Incorrect encryption
passphrase'.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- A local storage object must exist globally shared by all threads. Then
object.__dict__ is the thread specific storage. Absent this, when multiple
actions run in parallel, one will erase the thread local object of another.
Tests:
- When an error is raised in a privileged method, then the HTML error shown
contains stdout and stderr of the involved processes.
- Running functional tests on a lot of apps does not show this error anymore.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- When an error occurs during setup thread execution and the error is not due a
failed privileged action, we are left with very little information about what
went run. On the other than when a privileged action fails, we will be logging
the exception twice. But this is okay.
Tests:
- Increment the setup version of one of installed apps and raise an exception in
setup() method. Notice that exception traceback in the logged message.
- Increment the setup version of one of installed apps and raise an exception in
setup's privileged action. Notice that exception traceback in the logged
message twice.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- This make it easy to find issues when looking at either main service logs or
privileged daemon logs.
Tests:
- Raise an exception in one of the privileged actions. Notice that the exception
is printed along with module name, action_name, stdout, stderr and traceback.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- When attempting to set an invalid shortcut ID or invalid user's directory as
home page, set FreedomBox UI as home page.
- Simplify the tests somewhat and avoid failure first time and skipping the test
next time.
Tests:
- Run unit tests as 'root' and 'fbx' users.
- Set home page to apache default, FreedomBox, user home page and a shortcut.
The set value is retained. The change works when visiting / with browser. The
value is as expected in Apache configuration.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
During functional tests, it was noticed that getattr() failed at the following
line. The original intent of the code is to ensure that there are no failures
when 'stdout'/'stderr' attribute are not present or when they return None.
stdout = (getattr(err, 'stdout') or b'').decode()
Tests:
- Make the UI raise incorrect password error. Notice that the error is shown
properly.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- This change means that when invalid module or action name is provided, the log
message is not printed. However, this is acceptable as those cases are rare in
production and are logged properly on the client side.
Tests:
- Run diagnostics for an app and notice that arguments are printed in privileged
daemon's journald logs.
- Remove a password from bepasty app and notice that the password argument is
not logged.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
Since debhelper 13.11.6, we don't need this hack as dh_installsystemd recognizes
the files in /usr/lib/systemd/ directory in addition to /lib/systemd/.
Tests:
- After build package with gbp. Notice that postinst script has code inserted by
dh_installsystemd for starting/restarting the service.
- Install the deb package starts service. Reinstalling the package restarts the
service.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- And gracefully terminate the process after finishing the current requests
underway.
Tests:
- Trigger a long operation such as an app installation. While the operation is
underway, run 'systemctl stop freedombox-privilved.service'. Journal will show
that the SIGTERM is handled and shutdown is more or less immediately complete.
However, the whole process will wait until the ongoing request is complete and
then exit.
- During the wait period, no new requests are accepted as experienced with
'freedombox-cmd plinth is_package_manager_busy --no-args' command.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- Older privileged daemon before 25.10 did not return the stdout/stderr
properties as part of an exception. During upgrade, there is a 5 minute time
window (longer if the privileged daemon is continuously used) when privileged
daemon is the old version and the service is the newer version. During this time
any exception in the privileged task will cause this problem.
- Our goal is not to always provide backward compatibility to old version of
privileged daemon as the web interface and privileged daemon are expected to be
upgraded at the same time. However, this one is easy and is complementary to a
separate fix that addresses the core problem.
Tests:
- Perform an operation that raises an Exception in a privileged method. The
error is properly shown as an HTML message but without stdout and stderr.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- When disconnected sshfs mounts are present, then df command prints the disk
usage for the remaining disks but prints a warning to the stderr and return a
non-zero return code. Accommodate this case and parse the information for all
the available disks.
Tests:
- Create a remote backup location and mount it. When the SSH process is killed,
it leaves a mount point that is not properly connected. View the storage page to
see that disk usage for other partitions is shown properly.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
Tests:
- When arguments are not provided to freedombox-cmd it shows errors on the
console.
- When a command is successfully executed, the output is printed on the console.
- The output of the privileged daemon goes to the journald.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
Tests:
- Running make install installs to /usr/lib/freedombox. Non-privileged users
don't find it in the path. root user does.
- New service file contains path to /usr/lib/freedombox/. Actions works as
expected.
- Build and install the debian package. Privileged daemon runs as expected and
first setup steps complete as expected. First wizard works as expected.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
Due the frequency and length of execution of diagnostics, the service does not
restart when files are modified. The operation also makes other testing tasks
wait until completed. It also makes functional tests slower. So, reduce the
frequency of execution. It can always be temporarily changed when debugging
diagnostics operations is necessary.
Tests:
- Change the development interval to 18 seconds and notice that new interval is
effective in development mode but not in production mode.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
Tests:
- In development mode, diagnostics task runs after about 180 seconds (with
jitter).
- In production mode, diagnostics task does not run after 180 seconds.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
Closes: #2517.
Tests:
- Without the patch, run without --develop option and visit a non-exiting page
like /plinth/foo/. It results in '500 internal server error' instead of 404
non-found error.
- With the patch, the '404' page is shown. Breadcrumbs show only a link to the
home page with home icon.
- Accessing a page like /plinth/apps/bepasty/add?foo redirects it to
/plinth/apps/bepasty/add/?foo.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- Add a custom shortcut and provide a custom icon for it in
/var/www/plinth/custom/static/icons/. Visit the page /plinth/api/1/shortcuts/.
The icon path for the custom shortcut is correct and accessible from browser.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Instead of detecting 'custom' in the name of the icons (which can happen if the
icon basename itself contains the word 'custom'), check if the icon is already
an absolute URL path.
Tests:
- Add a custom shortcut and provide a custom icon for it in
/var/www/plinth/custom/static/icons/. Visit the frontpage and ensure that the
icon is visible.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Closes: #2538
Tests:
- Without the patch, set the Zoph CLI User to "autodetect" and notice the
failure to load Zoph page.
- With the patch, set user to "autodetect" and access the app page. It is
updated to the first admin user in Zoph DB.
- Try with updating Zoph configuration.
- Try with re-running Zoph setup.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Fixes: #2251Fixes: #2426
- Temporarily add a bug fix for the one-line style apt sources format. Upstream
submission: https://github.com/hercules-team/augeas/pull/865 .
- Currently, only two options with keys arch= or trusted= are allowed. However,
as documented in apt manual page[1], there are many different options possible.
Apt itself parses these options in a much more generic way[2][3].
- Fixes allow parsing all the different options allowed by apt. A practical
example (accepted by apt) is also provided as a test case.
Tests:
- Add the following line to one of the apt sources file in
/etc/apt/sources.list.d: "deb
[signed-by=/usr/share/keyrings/debian-archive-trixie-stable.gpg]
https://deb.debian.org/debian trixie main". In augtool, print
/augeas/files/etc/apt/sources.list.d//error.
- With the patch, run 'make build install' and errors in augtool disappear.
- In tor proxy app, enabling/disabling apt through tor works. The files in
/etc/apt/ are updated as expected.
Link: https://manpages.debian.org/trixie/apt/sources.list.5.en.html
Link: 3c9399e643/apt-pkg/sourcelist.cc (L215)
Link: 3c9399e643/apt-pkg/contrib/strutl.cc (L245)
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- It is not possible to disable apt over tor for as many files as possible with
the current code because even an error in a single file will result in entire
process failing. Instead, implement a way to disable the exception.
Tests:
- Add an unparsable line into the one of the apt sources files. Disabling apt
over tor works and all file but the error file are modified.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- These is no need to set sudo related configuration for running actions.
- We need to enable and start freedombox-privileged daemon.
- Use 'make provision-dev' to simplify all setup.
- Update the check for 'setup finished' message.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Closes: #2414.
- Remove separate implementation for showing logs in help page.
- Add link to the page in diagnostics app so that FreedomBox logs can more
easily be discovered by users.
Tests:
- Raise an exception in the common error middleware to cause a 500 internal
server error. Run FreedomBox service with the --develop option and notice that
500 error page is served. There, the link to logs page works. It shows the logs
for Diagnostics app.
- Diagnostics page description is update. Link to logs page works.
- Diagnostics page shows logs for plinth.service and freedombox-develop.service.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
Tests:
- View logs menu entry is shown only for apps with daemons. It is now shown for
others such as Backups. It does not add menu for apps such as power.
- View logs entry for Date & Time shows show logs for multiple units. View logs
entry for Nextcloud shows many units.
- The textarea occupies full width. It is not editable. It is always scrolled to
the bottom. Control-A and Control-C selects all the text in it. It is re-sizable
vertically.
- The header shows unit name and unit description correctly.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
Tests:
- Upto 200 lines are shown in the logs. The description and unit name of the app
is correct.
- Apps without systemd units don't have 'View Logs' menu item.
- Nextcloud container logs are shown.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- According to a recent change in Salsa CI[1], this job does nothing.
- There is a syntax error that causes entire pipeline file from becoming valid.
Link: 2dd7850308
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- The current name does not the match the base class method it intends to
override.
Tests:
- Run functional tests for bepasty -v option and notice that only one backup and
restore test runs.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Tests:
- On stable, testing distributions applying the patches and restarting the
services causes two files to be created on the system.
/etc/apt/sources.list.d/freedombox-unstable.list and
/etc/apt/preferences.d/50freedombox-dist.pref. In unstable distributions the
files are not created.
- Installing Matrix Synapse on all three distributions works. Initial domain
configuration works. All diagnostic tests pass.
- On stable and testing distributions, running 'apt policy matrix-synapse' shows
that priority for package from unstable is 200 higher than installed package
priority of 100. Same for the package python3-pympler. Running 'apt policy
freedombox' shows that package from -backports has a priority of 500 that is
same as the priority of non-backports package.
Tests:
- During re-run of setup, unstable sources are setup.
- Matrix synapse app shows updated description.
- Upgrades app shows updated description about frequent feature updates.
- On oldstable, stable, and testing distributions unstable sources are setup.
But not on unstable.
- On stable, testing distributions applying the patches and restarting the
services causes two files to be created on the system.
/etc/apt/sources.list.d/freedombox-unstable.list and
/etc/apt/preferences.d/50freedombox-unstable.pref. In unstable distributions the
files are not created.
- Installing Matrix Synapse on all four distributions works. Initial domain
configuration works. All diagnostic tests pass.
- On oldstable, stable, and testing distributions, running 'apt policy
python3-pympler matrix-synapse python3-python-multipart' shows that priority for
package from unstable is 200 higher than installed package priority of 100.
Running 'apt policy freedombox' shows that package from -backports has a
priority of 500 that is same as the priority of non-backports package.
- When frequent feature updates is not enabled, the app can't be installed.
"This application is currently not available in your distribution." message is
shown. After enabling frequent feature updates, the apps can be installed.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Ensure that packages that are not installable to negative priority are not
shown as available.
Tests:
- Set priority of an available package to less than 0. This package will be
shown as not-available in the app install page.
- Normal apps are shown as available and can be installed as usual.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- When backports repository or unstable repository freshly added by the updates
app. We will like apps to become available due to newly available Debian
packages. For this to happen 'apt update' must be called before checking if an
app is available.
Tests:
- Freshly apply the patches for upgrades app. Setup is re-run and unstable
sources file is introduced. Immediately visit the Matrix app and notice that is
shown as available and can be installed immediately.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Move some utilities to utils.py from distupgrade.py and __init__.py.
- This fixes issues with apt preferences being set on unstable
distribution (despite code that tries to prevent it).
- There is no way to distinguish between 'testing' and 'unstable' distributions
in Debian using commands like lsb_release (powered by /etc/os-release). See:
https://lwn.net/Articles/984635/ . So, use the value set in
/etc/apt/sources.list.
Tests: (tested entire patchset)
- Deluge can be installed in trixie.
- Auto-distribution upgrade button is checked during setup on stable and
oldstable but not on testing and unstable.
- Auto-distribution upgrade button is enabled in the form on stable and
oldstable but not on testing and unstable.
- Backports wizard step is skipped on unstable (non-develop mode), but not on
oldstable, stable, testing, and unstable (develop mode).
- If backports are not activated during first wizard, then backports can be
activated on upgrades app page if distribution is oldstable, stable, testing, or
unstable (non-develop mode) but not unstable (develop mode).
- During re-run of setup, setting up backport sources is skipped if already
setup.
- Backports sources files are not added in testing (non-develop) and
unstable (non-develop) distributions. Backports sources are added to oldstable,
stable, testing (develop) and unstable (develop). Unstable sources sources are
not added to unstable but added to oldstable, stable, and testing.
- Backports sources file is added with correct code name bookworm/trixie for
oldstable, stable, and testing distributions.
- When backports sources is set to 'bookworm-backports' on Trixie distribution,
re-running setup updates them to 'trixie-backports'.
- Preferences files are added in oldstable, stable, and testing distributions
but not unstable.
- If unstable and another distro is present in apt sources, then it is treated
as unstable as shown in the distribution upgrade page.
- Current codename is shown properly from sources.list in oldstable, stable,
testing, and unstable in distribution upgrade page.
- NOT TESTED: If distribution upgrade is interrupted, then continue page is
shown.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Recently we have changed to using HTTP protocol for GnuDIP updates. These
involve using requests library. For exceptions raised by this library the
arguments may not all be JSON serializable. So, explicitly convert them into
strings.
Tests:
- Turn of network connection to the machine. Trigger a Dynamic DNS update by
re-submitting configuration form. This will results in an error message shown
in status table instead of an unhandled exception.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
- This prevents double logging for all log statements in privileged daemon.
- Also drop conditional checking for systemd.journal python module. We hard
depend on python3-systemd package which has it.
Tests:
- All logs messages from privileged daemon log only once to the journal.
- For main service, the log message happens on console only when running on the
command line. When the systemd service is started, it is only logged to the
journal.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
Tests:
- Mounting/unmounting of remote SSH repositories works.
- Creating repo, creating/deleting/list archives work.
- If a privileged method raises an exception after outputting to stdout (using
action_utils.run) then stdout is shown in the HTML UI message.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
Tests:
- If there is a syntax error in communication with privileged server. 'stdout'
and 'stderr' keys are present in 'exception' dictionary of the reply.
- If there is a error in the privileged method in communication with privileged
server. 'stdout' and 'stderr' keys are present in 'exception' dictionary of the
reply. The values are filled with output of the command that have been run.
- If a privileged method uses action_utils.run, then raising an exception in the
method shows proper stdout and stderr in the UI HTML message.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
Tests:
- /usr/share/plinth/actions/actions is not installed.
- Code check works on plinth directory and container script only
- Provisioning a container does not add sudo configuration for actions. 'fbx'
user can perform 'sudo' operations.
- Make install does not install actions based sudo configuration. Admin users
can perform sudo operations.
- Exporting backup archive works. Validating a transmission directory works.
Some of the privileged operations works.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
- Regression: downloading does not work with sudo based action anymore. However,
sudo based actions are to be removed in later patches.
Tests:
- Downloading tar backup archive works. Untar works. Downloading gives upto
10MiB/s speed.
- If API is not called with _raw_output=True, then special exception is raised.
- Downloading tar file from command line using nc also works.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
- Used after migration gitweb and storage calls to using
action_utils.run_as_user.
Tests:
- Gitweb operations and directory validations works when privileged daemon is
running or not running.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
- Instead implement running specific commands inside the privileged action as a
specific user.
Tests:
- In transmission, setting the download directory is valid if
- A parent level directory is writable by transmission daemon and child does
not exist.
- A leaf level directory is writable by transmission daemon when leaf exists.
- A leaf level exists and is not a directory.
- In MiniDLNA, setting the directory works only if it exists and is readable.
Work when write permission is not available.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
- Instead implement running specific commands inside the privileged action as a
specific user.
Tests:
- Gitweb functional tests and unit tests work.
- Running various operations such as clone, create, set branch, rename, etc. all
result in repositories (and all their contents) owned by www-data:www-data.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
Tests:
- Existing gitweb repos are listed properly. Newly created repos are reported
properly.
- Directories without .git extension or starting with . are not shown.
- Private repos are shown as private and public ones as public.
- Cloning progress is shown properly in the list of repos.
- Cloning starts with 0%.
- Cloning file is removed after completion of cloning process.
- Cloning is done into .temp directory.
- After cloning repo can be checked out as expected.
- Getting/setting of default branch/description/owner/private works.
- Getting the list of branches work when selecting the default branch.
- Creating new blank repo works.
- Deleting a repo works
- Uninstalling the app works. All repos are removed.
- Retrieving non-existent repo shows error as expected
- Backup/restore of repos works as expected.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
- To be used to run specific command as another user.
Tests:
- Unit tests.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
- When there is no URL name provided, the view fails to render when computing
breadcrumbs from middleware. Provide a name so that the URL does not lead to a
500 HTTP error.
Tests:
- Accessing the URL on development machine does not lead to an error page.
- On a production machine, when trying to use Thunderbird account setup wizard,
without the patch, Thunderbird says that it found configuration by enumerating
common names for the domain. A 500 error can be seen in the journal. After the
change in patch, Thunderbird says that it found the configuration from the
provider. A 200 success code can be seen from journal.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Files from web service are uploaded to /var/tmp/ directory. They need to
accessible to privileged daemon to that it can move them to a target location.
So, if /var/tmp is isolated for privileged daemon, it can't see those files as a
separate tmpfs filesystem is mounted on that folder.
- Ideally, we should have PrivateTmp=yes and
JoinsNameSpacesOf=freedombox-privileged.service set on plinth.service. However,
this requires further changes to the way developer execution is done command
line. This is done in future.
Tests:
- Uploading a backup works.
- Uploading a kiwix archive works.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
Removed android apps that have been discontinued and added SambaLite
app.
Tested that SambaLite works with Samba app.
Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
Fixes: #2534.
- Otherwise, if python standard library is updated, needs-restart will determine
that the freedombox-privileged.service needs to be restarted. The service may
have triggered the 'apt-get install' operation that triggered needs-restart in
the first place. That causes the install operation to fail.
Tests:
- Installing Calibre app which also brings in python standard library update
succeeds and freedombox-privileged.service is not restarted during 'apt-get
install' operation.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
Helps: #2534.
- When a module change is detected. Don't restart. Restart only when FreedomBox
source code is changed. This prevents unwanted restarts when Python standard
library is updated during an app's installation.
- This will make functional tests more robust as during functional tests,
freedombox service run in development mode.
- This may lead to annoyances during development when we have to restart the
service manually. This is unlikely but if it happens we can tweak the setting by
maintaining the allow list of modules instead of deny list of modules.
Tests:
- Calibre installation which brings in new version of python standard library
works without causing CherryPy to detect python module changes during 'apt-get
install'.
- Changing a source code file under the plinth/ directory leads to the service
getting automatically restarted.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
Defined two settings for ignoring laptop lid close action. They handle
the two cases - running on battery power and running on external power.
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
- As reported on IRC, links to source code files in Weblate are broken. This is
due to incorrect paths to files inside the POT file. Instead of plinth/views.py
it contains views.py. This might be a regression introduced when switching to
Makefile for all build tasks.
- To fix, we need to run 'django-admin makemessages' command at the topic level
directory in the source code repository. However, running at the top-level has
problems:
- Various unnecessary directories are considered. This was remedied using
--ignore aruments.
- The default locales directory was not being detected. This was remedied
using LOCALE_PATHS in Django settings.
- Django settings file was not being picked up. This was remedied using
--settings option.
- Django settings were being picked up from system's module path. This was
remedied using --pythonpath . option.
Tests:
- Running 'make update-translations' updates all the files. Newly generated POT
file contains plinth/ in the file paths. All locales were updated. There are no
other major changes POT or language files (other than what seemed to be pending
updates).
- Running freedombox-develop, locale can be changed to Spanish. The changed
locale is visible in UI. Changes to .po file are reflected in the UI after
running 'django-admin compilemessages'.
- After running freedombox using plinth.service systemd unit, locale can be
changed to Spanish. The changed locale is visible in UI. Changes to .po file are
reflected in the UI after running 'make build install'.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
Closes: #2533.
See https://salsa.debian.org/freedombox-team/freedombox/-/issues/2533 for
rationale.
Tests:
- Build Debian package with changes and incremented version number. Install it
in the development container and run unattended-upgrade -d. libpam-abl package
is removed by unattended-upgrades.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- Keep Bookworm as oldstable.
- Introduce delay before resize the filesystem as mount operation may start a
balancing operation that conflicts with resize.
- Change the VM configuration to enable UEFI for all but bookworm images.
- Add --nvram when destroying the VM so that VMs with UEFI booting and NVRAM
storage enabled can be deleted.
- Add UEFI parameters to grub-install after changing FSID. Mount the EFI
partition to allow grub-install to work.
Tests:
- On a clean setup (rm -rf .container), bring up all four containers using
machine-type=vm with on host machine arch amd64. Run first wizard successfully.
- On all but oldstable, run mokutil --sb-state and ensure that secure boot is
enabled.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Fixes: #2531.
- Currently, when a diagnostics test is skipped, the notification shows up with
'error' severity. Instead of this, treat 'skipped' and 'not done' tests as
passed for the purpose of the notification.
Tests:
- Change code in package.py to set the result of diagnostic test to be 'SKIPPED'
and 'NOT_DONE', in both cases, the notification is not shown after running full
diagnostic runs.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
Fixes: #2529.
Tests:
- Run functional tests on bepasty. Without the patch, many tests are skipped.
With the patch, all tests are executed. Introducing a sleep delay in
Package.is_available() method also works.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- Mostly for styling and just to fix the linter.
Tests:
- After package availability check in bepasty page, 'Install' button is enabled.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- Since we have important fixes deployed that we would like to get effected
immediately.
Tests:
- Not tested.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Dovecot is upgraded from 2.3 to 2.4, users are unable to see the old mails
from before the upgrade. New mails can be received but old mails can't be
accessed. Old mails are still present in
/var/mail/{usernmame}/mail/mailboxes/... New mails are being stored in
/var/mail/{username}/u.*. Other mailboxes such as 'Sent' are not affected.
Tests:
- Mails received in the inbox before the upgrade to dovecot 2.4 are now visible.
Without the patch, pre-upgrade mails are not visible and newly received mails
are stored in /var/mail/{username} instead of /var/mail/{username}/mailboxes/...
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Users were able to login using email address during dovecot 2.3 on Bookworm.
It was incorrectly assumed that there were not able to do that. Hence the
feature was not ported to 2.4. Early upgraders have reported this issue.
Tests:
- Login using full email address in the User Name field in Thunderbird. Without
the patch, the login fails and with the patch, it succeeds.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Configuration provided by David (https://discuss.freedombox.org/u/david/)
Tests:
- Install SOGo without patch and apply the patch. The app setup is run and new
version of configuration file is installed. After logging into SOGo:
- Mail settings shows an option to add IMAP account.
- Editing Full Name in the identity of the default account is now possible.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Fixes: #2528
Tests:
- In Responsive Design Mode in Firefox, expand the screen width to be beyond
1400px. The left side of popup for the user menu will be aligned with the left
side of the menu item itself. When the width of the page is less than 1400px,
the right side of the popup will be right aligned with the right side of the
menu item.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- Build a Debian package before and after the patch and notice that binary
packages have no differences when compared with diffoscope. Source packages show
only the change in the patch but no other change.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- Install matrix-synapse app by adding 'unstable' in apt sources.list. Then
remove 'unstable' from apt sources.list. Then matrix-synapse package will no
longer be found in the apt's cache.
- Try to uninstall the package. Without patch, the process errors out. With
patch, uninstall completes successfully.
- While matrix-synapse app is installed and apt cache does not contain
matrix-synapse package, install and uninstall bepasty app. Without patch,
uninstall fails. With patch, uninstall succeeds.
- Install and uninstall minetest app. 3d armor mod package is successfully
installed.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
- This change was part of the original pull request !2661 but was missed in its
continuation !2677.
Tests:
- Installing an app works.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
Without the change FileNotFound exception is raised.
Tests:
- Send request using 'nc' to privileged daemon that has invalid 'module'
parameter. SyntaxError exception is raised.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
- Fallback to sudo based privileged implementation. Privileged daemon tests are
still to be implemented.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
- Instead of running the command using sudo. If the server is not reachable, run
the privileged command using sudo.
Tests:
- Typical privileged calls are made to server as evidenced by the network emoji
icon in the log.
- Some actions such as creating gitweb repository or downloading a backup
archive happen via sudo instead of privileged daemon.
- When a call is made to privileged daemon the log message is show just like a
sudo call.
- If the daemon is not running and can't be started, the calls are made to sudo.
- If the daemon is rejects connections, then calls are automatically made to
sudo.
- When cloning a gitweb repository, the operation is immediately returned and
task runs in background. Other tasks as waited upon until they are finished.
Introducing a sleep in privileged method leads to increased page load time.
- When server sends non-JSON response, a decode error is printed and exception
is raised.
- When a typical privileged call is made, the return value as expected.
- When a typical privileged call raises exception, a nice HTML exception is
shown in the UI. stdout/stderr outputs are not shown. Error is also logged on
the console as expected but without stdout/stderr.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
Tests:
- When a call is made to privileged daemon the log shows network emoji instead
of #.
- Log for unimplemented calls such as downloading backup images still shows # as
they not sent to privileged daemon.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
Tests:
- When a new container image is provisioned, developer configuration is set on
privileged daemon as seen with 'systemctl show freedombox-privileged.service'.
freedombox-privileged.socket is enabled and running (socket is being listened
on).
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
Tests:
- Daemon starts up with uid/gid set to root.
- Daemon does not run by default if a request is not received. Socket file is
created with 666 permissions and root:root ownership. Socket file parent directory
is created with 755 permissions and root:root ownership.
- Daemon starts if a request is sent to the socket using nc.
- If there an exception in daemon starting, then restart is done every second to
5 seconds, forever.
- Build a Debian package.
- Install it on fresh trixie Debian VM. Ensure that setup works and privileged
daemon is auto-enabled.
- Start a fresh trixie Debian VM and install freedombox from Debian repos.
Upgrade to the built package. Privileged daemon works and is auto-enabled.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
- So that it can be invoked easily from the command line and systemd service.
Tests:
- make install creates /usr/bin/freedombox-privileged daemon which can be run as
root.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
- This daemon will be faster than running actions using 'sudo' because the
actions sometimes load all the modules before certain safety checks can be
performed. The daemon will load just once for many privileged calls.
Tests:
- After daemon is started, systemd shows the status as 'activated'.
- When daemon is started using socket activation and requests are sent, the
requests succeed.
- When daemon is started manually and requests are sent, the requests succeed.
The socket file is created with root:root ownership and 0666 permissions.
Parent directory is created if not exists. After the daemon exits, the socket
file is removed. When daemon is started manually, automatic idle timeout exit
does not happen.
- According to journalctl, server exists after 5 seconds. Proper log message is
seen.
- Without development mode, server exists after 5 minutes of idle. Proper log
message is seen.
- When a sleep is added in one of the actions and when the action is running,
server does not exit. Server exits after the request is completed.
- When an error is raised in verify request, the server exits with proper error
message. If the server exists with non-zero error code and is immediately
restarted by systemd.
- Sending a sample request using nc from root user and plinth user works.
- Sending a sample request using nc from fbx user is rejected.
- If a non-unicode text is sent as request, the response is a valid error
dictionary.
- If the request is larger than 1M, an 'request too large' error is thrown.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
Tests:
- When privileged daemon receives a non-JSON request, a proper error structure
is returned with SyntaxError.
- When privileged daemon receives a request without 'module', 'action', 'args'
or 'kwargs' parameters, a proper error structure is returned with TypeError.
- When privileged daemon receives a request for invalid 'module' or 'action', a
proper error structure is returned with SyntaxError.
- When an exception is thrown in a privileged method, the error is properly
returned in error structure and caller is shown all the proper details.
- Valid return values are sent when a privileged call is made.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
- Refactor validation of fields in the JSON object.
- Throw distinct errors for missing field and wrong type.
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
- Only effective once. Second call will skip loading apps.
- Helps with privileged daemon where actions might load apps repeatedly.
Tests:
- Diagnostics/enable/disable for apps bepasty, updates, config, security,
nextcloud, homeassistant run fine.
- Install/uninstall for bepasty works fine.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
- Only effective once. Second call will skip loading modules.
- Helps with privileged daemon where actions might load modules repeatedly.
Tests:
- Diagnostics/enable/disable for apps bepasty, updates, config, security,
nextcloud, homeassistant run fine.
- Install/uninstall for bepasty works fine.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
- The most pleasant font on any system is the default system font.
- It is the most optimized and styled font for the system considering screen
type and screen sizes.
- Used by all the system apps. Websites can become consistent with system apps
by using system fonts. GNOME, KDE, Ubuntu, Android, Chrome OS, iOS, and MacOS,
all have their own system fonts.
- Changed by the user using OS settings if they don't like it.
- Many popular sites have started using system fonts.
- No extra fonts have to be loaded making page loading jerk free and much
faster. On the first FreedomBox UI page load, the largest item is the font.
- We won't have carry the binary woff files in FreedomBox source tree anymore.
Also eliminates a bunch of lintian warnings.
- Lato font was used because it is prescribed by the FreedomBox identity manual.
Lato can still be used in other places such as marketing materials.
Tests:
- System font is used in the UI. When system font is changed in Gnome settings
and browser is restarted, the new font is shown in the UI.
- Check that the overall layout of the app grids is not effected by the font
size change.
- Check that all the tables in the UI are not affected by the font change.
- Backups repository listing shows each backup archive in one line.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
Fixes: #1358
- Refresh the apt cache if required packages for an app are not found and if the
cache is more than 1 hour old (or non-existent).
- If required packages are found, don't refresh the package cache even if the
cache is outdated. This is because the check operation could lead to many
minutes of waiting before app can be installed.
Tests:
- Remove /var/lib/apt/lists/* and /var/cache/apt/pkgcache.bin. Visit an app
setup page. apt cache is updated and it take a while to check that the app is
available. App is shown as available. If page is refreshed, this time, the cache
is not updated.
- Set the modification of /var/cache/apt/pkgcache.bin file to more than 2 hours
ago with 'touch -d "2 hours ago" /var/cache/apt/pkgcache.bin'. Then refreshing
the page will not refresh the cache.
- Repeat test with an app that is not available such as Janus. Again apt cache
is refreshed. App is shown as not available. On refresh, the cache is not
updated.
- Set the modification of /var/cache/apt/pkgcache.bin file to more than 2 hours
ago with 'touch -d "2 hours ago" /var/cache/apt/pkgcache.bin'. Then refreshing
the page will not refresh the cache.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
- Remove redundant if condition in setup.html template
- Use JavaScript fetch() API instead of XMLHTTPRequest class
- Update a comment in test_package.py
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
- Using AJAX request instead of loading the initial page slowly.
Tests:
- Unit tests passes.
- Deluge app is not available in bookworm and is available in Trixie.
- When app is available, no message is shown. Install button is enabled.
- When app is not available a proper warning alert message is shown. Install
button is disabled.
- During check for the availability, the progress message is shown. Install
button is disabled.
- When Javascript is disabled on the page, no availability check is performed.
Install button is enabled.
- When an exception is raised in the is-available view, error message is shown.
Install button is enabled.
- When is-available view return HTML response, error message is shown. Install
button is enabled.
- When is-available view invalid JSON response, error message is shown. Install
button is enabled.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
Tests:
- Add a comment and /etc/apt/sources.list file. Distribution upgrade page does
not load and fails with an error.
- With the patch, page loads properly. Distribution upgrade can be triggered.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
[jvalleroy: Fix test for release date]
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Thanks to git blame I found why python3-tomli had been added back then:
6199718a19383d8d070b7bdc9d26ead71a9d26dd
python3-tomli is slowly being sunset in favor of tomllib from the Standard
Library: https://wiki.debian.org/Python/Backports
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Add Full Text Search capability to Dovecot.
- Add 'dovecot-fts-xapian' to the list of packages for the email app.
- Add relevant configs for both dovecot 2.3 and 2.4
- Add a systemd timer to periodically clean search indexes
Configurations taken from plugin's upstream documentation:
https://github.com/grosjo/fts-xapian
Sunil:
- Tweak the dovecot 2.4 configuration. Remove explicit configuration same as or
close to default values.
- Drop the timer service for cleaning up the index. Dovecot documentation that
FTS plugins do it themselves.
- Drop the re-indexing command on setup. This could not be properly tested. On
first search, indexes will be created for mailboxes that don't have them.
Tests done:
- Perform a fresh install, on both Bookworm and Trixie, confirm the install is
successful, confirm the systemd service runs with exit 0.
- On Bookworm, apply the patches on an existing setup, confirm the patches apply
as expected.
- On a production like setup, set dovecot 2.4 to debug mode and check the
journal logs while receiving an email: The logs confirm that the fts module is
loaded and that it automatically creates a db for the indexes. I also opened the
newly created db file with less and confirmed that the human readable parts
contain my recent email.
- Using Sogo, perform a full search (including headers and body). Search works
and indexes are freshly created on all the folders.
Signed-off-by: Benedek Nagy <contact@nbenedek.me>
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
- This helps during distribution upgrade from dovecot 2.3 to 2.4. Dovecot will
stop running due to dovecot server 2.4 not understanding version 2.3
configuration files. When setup is re-run, starting the daemons again is the
right thing to do.
Tests:
- With email app installed, upgrade from bookworm to trixie. Dovecot is stopped
during distribution upgrade but after freedombox service runs, it recovers and
starts running again.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Sunil:
- When dovecot package is upgrade from 2.3 to 2.4 during distribution upgrade,
automatically re-run setup.
- Upgrade existing setups to new scheme by re-running setup with incremented app
version.
- Don't query dovecot version during app initialization. Instead overwrite the
DropinConfigs component to query dovecot version during setup and enable
operations.
- Use apt.Cache() to retrieve the installed version of dovecot package. Use
plinth.utils.Version to parse the version and perform a comparison.
- Split even configuration files that have not changed for simplicity.
- Add/update links in Dovecot configuration files.
Tests:
- Install email app on a testing container. Ensure that all files in
/etc/dovecot/conf.d/ are linked properly to 2.4 versions. TLS configuration is
accurate. Use Sogo to test login and sending mails.
- User with LDAP account and correct password is able to login.
- User without LDAP account or incorrect password is unable to login.
- Send mail with Sogo to another account on the server. Notice that mails are
stored in /var/mail/{user}/mail/ with mail:mail ownership in mbox format.
- Logging in with email such as user@example.com works. Capital letters are
allowed.
- "Archive", "Drafts", "Sent", "Junk", "Trash" folders are automatically
created and are marked with special flags. Creating additional folders such
as "Sent Items" also results in them having special flags.
- Thunderbird is able to connect via SSL with a self-signed certificate
exception.
- When an example spam message is sent, it is automatically moved to "Junk"
folder after getting marked by rspamd.
- When a message is moved to Junk folder, it is learned as spam by rspamd as
seen in its admin console.
- When a message is moved out of Junk folder (to other than "Trash" folder),
it is learned as not-spam by rspamd as seen in its admin console.
- Install email app on a stable container with patches. Ensure that all files in
/etc/dovecot/conf.d/ are linked properly to 2.3 versions. TLS configuration is
accurate. Use Sogo to test login and sending mails.
- Install email app on a stable container without patches. Apply patches. Ensure
that all files in /etc/dovecot/conf.d/ are linked properly to 2.3 versions. TLS
configuration is accurate for dovecot 2.3. Use Sogo to test login and sending
mails. Perform distribution upgrade to testing. Ensure that all files in
/etc/dovecot/conf.d/ are linked properly to 2.3 versions. TLS configuration is
accurate for dovecot 2.4. Use Sogo to test login and sending mails.
Signed-off-by: Benedek Nagy <contact@nbenedek.me>
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Closes#2256.
Based on a suggestion by Andrew Betts on the mailing list.
https://alioth-lists.debian.net/pipermail/freedombox-discuss/2022-August/009553.html
Sunil:
- Consolidate changes from various apps into a centralized place in
freedombox.conf applicable for all directory listings.
Tests:
- In Sharing, TiddlyWiki and FeatherWiki apps, directory listing when viewed
with Firefox Developer Tools Mobile view set to a Galaxy S20+ looks reasonable.
Without the patch the page is very zoomed out.
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
- Use btn-toolbar class instead of <p> tag for more consistent spacing between
buttons and the bottom of the notification.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
- Notifications are displayed in a user-friendly "time ago" format.
- Use last_update_time instead of created_time
Sunil:
- Some notifications don't have app name and app icon. Styling for those
notification was different due to the last update time. Revert back to
positioning for it. Use CSS float for it.
- Use localized, locale specific date/time format for the tooltip.
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
The field last_update_time is set to auto_now in the Django model, but it is not
being updated when using update_or_create() since Django 4.2. This is because it
sends update_fields= argument to save().
Say, a user installed an app a few hours ago and uninstalls it now, the
notification should be updated to show the uninstallation status but it shows
the timestamp of the installation instead.
Explicitly setting the updated timestamp is one way of fixing this issue.
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
[sunil: Use django_db mark in test case]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Uses Bootstrap accordion class to do collapsible sections without adding any
custom CSS or JavaScript.
Closes#2479
Sunil:
- Create one accordion instead of many. Automatically collapsing previously
expanded item works.
- Fix dangling </section> close tag.
- Embrace accordion styling instead of header-like styling for headers. The
tables with results are distinguished from the header due to header
highlighting and margins around tables.
- Fix issue with multiple 'passed' badges show for single app. 'regroup'
template tag expects the dict to be already sorted by the selected property.
- Internationalize badge text in headers.
- Right align badges. Move repair button into the accordion header for better
appearance.
- Wrap the header on small screen sizes.
- Add additional necessary HTML attributes.
- Change 'Loading...' to 'Running...' more accurately specify the status.
- Show Running and Exception statuses in header.
- Use 'text-bg-' classes instead of 'bg-' for allow automatic selection of text
color.
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Synchronize the Apache server configuration with TiddlyWiki.
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
[sunil: Drop no-cache and must-revalidate directives as they are redundant]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Apache sends an instruction to the browser to not cache the TiddlyWiki file at
all. This forces the browser to fetch the new version after each write avoiding
the case "file changed on server".
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
[sunil: Drop no-cache and must-revalidate directives as they are redundant]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Tests:
- Creating/renaming/uploading wikis with names index[.html] does not work. Doing
so with other names work.
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
[sunil: Use validators= property instead of clean_name()]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Tests:
- Creating/renaming/uploading wikis with names index[.html] does not work. Doing
so with other names work.
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
[sunil: Use validators= property instead of clean_name()]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
In trixie, cockpit-pcp is replaced by cockpit-bridge. However, our
packages module does not properly handle virtual packages.
- Specify cockpit-bridge and pcp as dependencies. In bookworm, they were
dependencies of cockpit-pcp.
- Allow cockpit-bridge as a substitute for cockpit-pcp.
Tests:
- In stable container, install Performance app. Install succeeds and app
is available.
- In testing container, install Performance app. Install succeeds and
app is available.
- Build stable-backports package with new version. Install in stable VM.
Install Performance app. Check that dist-upgrade succeeds. After
dist-upgrade, Performance app is still working. Uninstalling
Performance app works. Installing Performance app works. Diagnostics
are all passed.
Note: There is one minor issue with the Diagnostics. Package
cockpit-bridge line is shown twice (both are passed).
Fixes: #2475
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
- Use docker container via registry.freedombox.org to obtain the package.
Specify this in the description.
- Mark the app as experimental.
- Show information that a dedicated domain is required to host Home Assistant.
- Use special YAML loader/dumper to deal with custom YAML tags in configuration
file.
- Obtain logo file from a test file in code repository with Apache license as
the actual logo files are freely licensed.
- Write functional tests without accessing the website as a dedicated domain is
necessary.
Tests:
- Functional tests work.
- Add a domain 'mydomain.example' using the Names app. Assign this domain in
Home Assistant app configuration. In /etc/hosts on the host machine add a
mapping from mydomain.example to the IP address of the container/VM. Access the
web interface using https://mydomain.example. Home Assistant web interface is
available and functional.
- After install of the app the configuration.yaml file contains the proxy
related lines are expected.
- Diagnostics work (expect the URL access).
- Re-run setup works.
- 'Launch web client' and frontpage shortcut work as expected.
- Non-admin users can't connect on port 8123.
- Home Assistant is able to establish websocket connection in its web UI.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- For Bepasty app, the 'Launch web client' button is shown.
- For Matrix app, the 'Launch web client' button is not shown.
- For Home Assistant app, the 'Launch web client' button is shown.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Don't redirect to '/index.html' when Apache Default is set as the home page.
This allows having other files such as 'index.php' as index file in
/var/www/html/.
- If the home page is currently set to 'Apache Default' upgrade the
configuration.
Tests:
- With Home page set to 'Apache Default' apply the patches. Config setup is
re-run. The configuration file becomes empty but is still present. Correctly
value is shown in the UI. /var/www/html/index.html is still shown as the home
page.
- With Home page set to 'Bepasty' apply the patches. Config setup is re-reun.
The configuration file is not modified. Bepasty is still shown as the home page.
Correctly value is shown in the UI.
- With Home page not modified apply the patches. Config setup is re-reun. The
configuration file is created. FreedomBox is the home page. Correctly value is
shown in the UI.
- On fresh machine with patches applied, perform first run. The configuration
file is not created. FreedomBox is the home page. Correctly value is shown in
the UI.
- Changing home page to Bepasty or 'Apache Default' works. Changing back to
'FreedomBox Service (Plinth)' also works.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Instead of just the sites that have successfully obtain certificate. This
allows customization of configuration for those sites (especially useful when
testing where LE certs are not obtained).
Tests:
- When a domain is added to the system, an apache TLS configuration is created
for the domain even though the domain does not have a successfully obtained LE
cert.
- When a domain is removed, the TLS configuration for the domain is removed.
- Add a domain without the patches. Apply the patches and restart the service.
The domain added signals are fired during the startup. This results in site
specific TLS configuration files getting created and Apache reloads. When the
service is restarted, the files are not created and Apache is not reloaded.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- This allows TLS configuration to setup for domains that haven't yet
successfully obtained certificates yet.
Tests:
- Apply the patch on a production configuration and ensure that LE certificates
are properly used.
- With full pathset applied, on a test container, add a domain and ensure that
domain has its own site configuration and uses the snake-oil certificate.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- After a domain is added and a TLS configuration for the site is created,
creating each of the 4 files leads to customization for that domain. In case of
last two files, only the domain is effected.
- /etc/apache2/includes/all-domains-include-freedombox.conf
- /etc/apache2/includes/all-domains-include.conf
- /etc/apache2/includes/$domain-include-freedombox.conf
- /etc/apache2/includes/$domain-include.conf
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- To be used to show that no domain is initially selected in Home Assistant. And
also to release a domain from dedicated use.
Tests:
- Install Matrix Synapse app in unstable VM. After install the setup form does
not show None as an option. Selecting a domain works as expected.
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Drop the warning that app may not work properly if domain name is changed.
Currently only user of this form is matrixsynapse. There is already a warning
message that domian name change requires uninstall. This message is redundant
and incorrect.
Tests:
- Install Matrix Synapse on stable VM and ensure that the help text does not
show up.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- Functional tests for bepasty, nextcloud, torproxy app work.
- Adding/removing a domains works.
- After first setup, nscd service is masked.
- Re-run setup on miniflux app works.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- Visit the dynamicdns app. The new description about subdomains appears.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- Visit the add static domain page. Notice that additional form description is
visible.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- In version 23.6.2 (Debian Bookworm), the migration code is already present.
This means all users on bookworm would have migrated already. We don't have
support users upgrading directly from a version older than bookworm.
Tests:
- First setup works as expected when starting the service on a fresh container.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Closes: #2514
- On Trixie the configuration directory is /etc/luanti and not /etc/minetest.
So, it needs to be created.
Tests:
- On Trixie and Bookworm, updating configuration works. On Trixie, directory is
created if it does not exist.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Based on suggestion from Benedek[1].
Links
1) https://salsa.debian.org/freedombox-team/freedombox/-/issues/2514#note_608054
Tests:
- On Trixie, freshly install minetest server. The server is successfully running.
Command line for the process shows that gameid is minetest_game. Configuration
file is /etc/luanti/default.conf.
- Update configuration. The update is successful. The configuration
/etc/minetest/minetest.conf is created. The server command line shows using
/etc/minetest/minetest.conf as the configuration file.
- On Bookworm, freshly install minetest server. The server is running. Updating
configuration works. Command line shows that /etc/minetest/minetest.conf is
being used.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Closes: #2512.
- Newer versions of packages such as tzdata are uploaded to
bookworm-updates (first?). However, unattended-upgrades is not configured to get
package updates from bookworm-updates even though it is configured in
/etc/apt/sources.list. So, manually installation will work but not
unattended-upgrades. Fix this by explicitly allowing bookworm-updates in
FreedomBox configuration modifications for unattended-upgrades.
Tests:
- Start a bookworm VM. tzdata package is at version 2025a-0+deb12u1. Latest
version available in bookworm-updates is 2025b-0+deb12u1. Running
'unattended-upgrades -d' on command line does not upgrade the package with that
patches.
- Apply patches, run 'sudo make build install' and rerun unattended-upgrades.
tzdata package upgrades to latest version.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Fixes an issue where confirming user deletion is not submitting the user
edit form.
Also fixes an issue where the user edit submit button is disabled after user
deletion confirmation is cancelled.
Fixes#2513.
Tests performed:
- Deleting a user works.
- All the users module tests pass.
- After cancelling the user deletion confirmation dialog, the user edit
submit button is clickable.
- On the app pages, submit buttons are disabled when app enabling or disabling
is in progress.
Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Zoph package depends on libapache2-mod-php. This installed and enables mod-php.
Also the process model for apache is switched to prefork. In FreedomBox, we want
mod-event and php-fpm. So, immediately after installing the package, re-run
apache setup to ensure that PHP related changes are undone.
Tests:
- On Bookworm and Trixie, install zoph. Ensure that 'a2query -m php-8.{2,4}'
show that mod-php is disabled. Also 'a2query -m mpm_event' shows it is enabled
and prefork is disabled. Apache is restarted during installation.
- On Bookworm install without patch and notice that mod-php is installed. Apply
patches and notice that mod-php and mpm_prefork are disabled while mpm_event is
enabled.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Fixes: https://discuss.freedombox.org/t/solved-zoph-uninstall-failure/3431
There is a debconf question being asked about remove the uploaded files while
uninstalling the package. If it is not answered, removal fails. So, answer the
question during installation.
Re-run setup so that answer is set.
Tests:
- In Bookworm and Trixie, install the app, upload an image and uninstall it.
Uninstall is successful and directory /var/lib/zoph does not exist.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Closes: #2511.
- By adding bind9 to the list of packages to be held during distribution
upgrade.
Tests:
- Install bind app on Bookworm. Check that /etc/bind/named.conf.options has been
updated. Run distribution upgrade to Trixie. Notice that the configuration file
is unchanged. A new .dpkg-dist file is available with the new version of the
configuration. Journal messages show that bind was held during distupgrade and
force upgrade was later run on it.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests performed:
- Without starting `freedombox-develop` inside the container,
`./container run-tests ...` waits until plinth setup is finished and
then runs the functional tests.
Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Closes: #2509
If the user has changed a configuration file of a package outside of FreedomBox,
the distribution upgrade process could face a configuration file prompt and fail
midway. When using unattended-upgrades, these packages are not a problem as they
would left untouched at an old version and the rest of the system would be
upgraded. In case of distribution upgrade, these packages could cause the
distribution upgrade to fail and leave the system in an unusable state. Rather
than halt distribution upgrade midway due to a configuration file prompt, it is
better to overwrite with the new configuration. Backup copy of the old
configuration will be available to the user to later merge with the new
configuration.
For packages managed by FreedomBox, packages with configuration file prompt will
be held back during upgrade and later carefully upgraded with merge. These
package are not subject to --force-confnew option.
Tests:
- Install GNOME and edit the configuration file
/etc/fwupd/remotes.d/lvfs-testing.conf. Upgrade to Trixie. Distribution upgrade
was successful. Notice that the configuration file was force upgraded. Log shows
that new configuration file was installed as requested. Running 'apt -f install'
shows that there are not apt fixes pending.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Closes: #2507.
In Bookworm, /usr/lib/GNUStep/SOGo/WebServerResources is a symlink to
/usr/share/GNUStep/SOGo/WebServerResources. On Trixie, the directory
/usr/lib/GNUStep does not exist. In both cases,
/usr/share/GNUStep/SOGo/WebServerResources is where the actual resources are.
Update apache configuration to use /usr/share instead of /usr/lib/.
Tests:
- On Bookworm and Trixie, install sogo and ensure that the web UI is working.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Benedek Nagy <contact@nbenedek.me>
Closes: #2505
Tests:
- Install app on Bookworm. Web interface works. 'Special pages' page shows
'rename user' page. That page loads.
- Dist-upgrade to Trixie. Database upgrade is performed by FreedomBox service
soon after the distribution upgrade. App still works. 'Special pages' page shows
'rename user' page. That page loads.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Closes: #2498.
- Now, as soon as service starts, it will perform force upgrade operations and
post-installation app setup operations. So, it is no loner necessary to wait for
10 minutes and trigger the one of the operations with 'apt-get update'.
- In addition, the post-installation operations are triggered more explicitly
and sooner.
Tests:
- Install MediaWiki on Bookworm. Run distribution upgrade to Trixie and it
works. Log shows that post install operations were performed and mediawiki setup
was rerun.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- When service is started, check if there are any configuration file prompts
pending and perform package updates.
- When service is started, check if there are any package version updates that
require app re-run.
- These operations are done in the same thread that does app version upgrade.
All three operations don't race against each other for apt lock. On the
downside, some operations may get delayed if previous operation fails
temporarily.
Tests:
- After service starts, after 'Setup completed' message we can see messages
'Attempting to perform post-dpkg operations', 'Completed post-dpkg operations',
'Attempting to perform upgrade', and 'Completed upgrade'.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Operations triggered by FreedomBox service itself such 'apt-get update' and
'apt-get install' don't cause the package operations (post-install and
post-update) to get triggered. This is due to recent implementation of a check
with the FREEDOMBOX_INVOKED environment variable. So, it fairly safe to attempt
these operations immediately as they would have been invoked from outside.
- In one case, when unattended-upgrades is triggered it could lead to
post-install trigger getting triggered too quickly. But this only leads the
operation detecting that apt is busy and performing the long wait immediately
after.
- In case of distribution upgrade, this could mean simpler reasoning and less
wait time.
Tests:
- When a package is installed, post-dpkg operations are triggered and completed
immediately. However, another apt process immediately takes lock, this results
in a waiting period.
- When a 'apt update' is run, update operations are triggered and completed
immediately.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
samba-ad-dc package depends on winbind, which breaks FreedomBox LDAP PAM
configuration. In Debian Trixie, AD server package is required by samba
package, but is not required to run Samba file server. See also Debian
bug report 1099755.
Relates to #2498.
Tests performed:
- In Debian Bookworm, install samba, do dist-upgrade, check that
samba-ad-dc and winbind packages are not insalled and adding new user
works.
- In Debian Trixie, uninstalling and installing samba app works and
after this, adding new user works.
Signed-off-by: Veiko Aasa <veiko17@disroot.org>
- Instead of an arbitrary time decided by when FreedomBox service as started.
Tests:
- Add a log message before return statement. Set the system clock to 02:00 and
start service in debug mode. Wait for 3 minutes. The timer is triggered but
nothings happens.
- Set the system clock to 06:10 and start service in debug mode. Wait for 3
minutes and a distribution upgrade check is performed and a message is printed.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Show a notification 60 days, 30 days, 1 week, and 1 day before distribution
upgrade. If a notification is dismissed for any of these periods don't show
again until new period starts. Override any previous notification.
- Show a notification just before the distribution upgrade showing that the
process has started. Override any previous notification.
- Show a notification after the distribution upgrade is completed that it is
done. Override any previous notification. Keep this until it is 60 days before
next distribution upgrade. If user dismisses the notification, don't show it
again.
Tests:
- Start a bookworm VM.
- Disable the auto updates. Set the date to 2025-08-01. Start the service.
Notification is not shown when distribution check is done. Enable auto updates.
- Set the date to 2025-07-01. Start the service. No notification is shown after
distribution upgrade check is run.
- Set the date to 2025-08-01. Start the service. Notification is shown when
distribution check is done. Clicking on the 'Go to Distribution Update' takes to
distribution update page.
- Set the date to 2025-08-02. Start the service. Notification is not updated
when distribution check is done. Dismiss the notification.
- Set the date to 2025-08-03. Start the service. Notification is not shown when
distribution check is done.
- Set the date to 2025-08-22. Start the service. Notification is shown when
distribution check is done. Dismiss the notification.
- Set the date to 2025-08-23. Start the service. Notification is not shown when
distribution check is done.
- Set the date to 2025-09-15. Start the service. Notification is shown when
distribution check is done.
- Set the date to 2025-09-18 18:00. Start the service. Notification is shown
when distribution check is done.
- Set the date to 2025-09-19 18:00. Start the service. Notification is shown
that distribution update has started. Distribution upgrade has started. Dismiss
this notification. Upgrade does not succeed to due timestamp miss matches with
release file.
- Once the distribution upgrade has started. Start the service. Notification is
not shown when distribution check is done.
- Rollback to a snapshot before distribution upgrade. Start the distribution
upgrade manually and notice that notification is not shown when distribution
check is done.
- Once the distribution upgrade has completed, start the service. Notification
is shown the distribution upgrade has completed when distribution check is done.
Dismiss this notification.
- Restart the service. Notification is not shown when distribution check is
done.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- This is important because only if all the command succeed, the changes to
/etc/apt/sources.list file are committed.
Tests:
- Set the time to 2025-09-20. Distribution updates are triggered. 'apt update'
fails due an mismatch with release file's timestamp. Instead of proceeding, the
distribution upgrade is halted.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- This will help identify these snapshots more easily in case a revert it
needed.
Tests:
- Start a distribution upgrade. Notice that the snapshot taken has special
description that it was taken before a distribution upgrade.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Refer to the manual and mention that users can keep their distribution for 5
years before upgrade.
Tests:
- Proofread, links work.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Closes: #2090
- Create a new page for distribution upgrade.
- If distribution upgrade is running show its status here without any other UI.
- Show various conditions for not allowing distribution upgrades.
- Automatic updates disabled
- Distribution updates disabled
- Not enough free space.
- Unknown or mixed distribution in sources.list.
- If distribution upgrade was interrupted, show that information here and allow
triggering distribution upgrade again. This is detected by noticing that
codename in base-files is higher than one detected in sources.list.
- If the user is not testing/unstable, show a message and don't allow
triggering.
- If next stable has not been released, don't auto-upgrade but allow manual
upgrade. Show special warnings.
- If next stable has been released but only recently, don't auto-upgrade but
allow manual upgrade.
- If next stable has been released and it has been 30 days, allow auto-upgrade
and manual upgrade.
- Seek confirmation before triggering manual upgrade. Provide appropriate
advice.
- Rely on hard-coded list of releases and their release dates instead of
querying the server.
Tests:
- When automatic updates or distribution updates are disabled, an alert message
is shown distribution upgrade page. If both are disabled, both messages show up
in the alert. The start distribution upgrade button is disabled. Clicking on the
button does not work.
- Reducing the available free disk space will cause alert message to show up and
start upgrade button to be disabled.
- When the distribution in /etc/apt/sources.list is mixed or unknown, an alert
message is shown. the start distribution upgrade button is disabled.
- When the distribution in /etc/apt/sources.list is testing or unstable, an
alert message is shown "You are on a rolling release distribution...". the start
distribution upgrade button is disabled. The current distribution is
'None (testing)' or 'None (unstable)'. Next stable distribution is Unknown.
- If get_current_release is hard-coded to return (None, 'trixie'). Then a
message is show in the distribution update page 'A previous run of distribution
update may have been interrupted. Please re-run the distribution update.' A
'Continue Distribution Update' button is shown in warning color. The button
takes to confirm page where the confirm button is shown in blue and is enabled.
- On a bookworm VM, visiting the page shows the message "You are on the latest
stable distribution...". Upgrade button shows in red. Clicking it takes to
confirmation page. The page shows a warning alert and red confirmation button.
- Setting the clock to '2025-08-21' shows the message "A new stable distribution
is available. Your FreedomBox will be update automatically in 4 weeks...".
Upgrade button shows in blue. Clicking it takes to confirmation page. The page
does show warning. The button is in blue.
- Setting the clock to '2025-09-30' shows the message "A new status distribution
is available. Your FreedomBox will be updated automatically soon...". Upgrade
button shows in blue. Clicking it takes to confirmation page. The page does show
warning. The button is in blue.
- Clicking the confirmation button starts the distribution upgrade process. This
distribution upgrade page is shown. The page shows spinner with a message and no
other UI. Page is refreshed every 3 seconds. When the distribution upgrade
process is completed, the page shows the current status.
- Killing the apt-get process during distribution upgrade stop the page refresh.
The page shows that process was interrupted and also continuation. Clicking on
the confirmation button resumes the distribution upgrade process.
- After distribution upgrade, the page shows the current distribution and next
distribution properly. There is not release date for the next distribution. A
message shows: "Next stable distribution is not available yet."
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- From the default 90 seconds (system-wide). This is better when systems are
slow during bootup or have really slow disk IO.
Tests:
- When running 'systemctl start plinth' add a sleep of 120 seconds in main
before notification. The service stays in 'activating' state for 2 minutes but
then succeeds and becomes active.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Run as a Type=notify service with systemd service.
- Notify systemd just before blocking in the main thread.
- This allows systemd to catch any errors with startup of the service and log
appropriately. This also allows clients depending on making DBus calls etc. to
know that service is ready to serve requests.
- This will increase the boot time slightly as systemd will wait until
FreedomBox service to become active.
Tests:
- Raise an exception in main() during startup. Run 'systemctl start plinth'. No
error is thrown without this patch. With the patch, an error is shown.
- After 'systemctl start plinth', service shows in 'active' state.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- This allows for the service to become "ready" and serving web connection sooner.
- If some operations such as obtaining certificates and domain configurations
are happening, these can be shown as operations with UI notifications.
Tests:
- Running 'freedombox-develop --setup' works. 'App initialization completed'
message is printed before 'Running setup...' message. Process exits
successfully.
- Running 'freedombox-develop --setup-no-install' works. 'App initialization
completed' message is printed before 'Running setup...' message. Process exits
successfully.
- Running 'freedombox-develop' works. 'App initialization completed' message is
printed before 'Running regular setup' and 'Setup finished'. Cherrypy starts
listening before 'App initialization completed' message.
- Running a fresh VM setup works.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- 12 hours might genuinely not enough with SD cards, slow download speeds, and
large number of packages (due to apps such as GNOME).
Tests:
- None
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Closes: #2501
Tests:
- Install radicale app.
- Install a sample package using apt. Trigger will be run and but will
not result in radicale setup rerun.
- Make newer radicale available. This can be done by enabling testing
distribution but setting its priority low. radicale priority from testing will
be set to high. When unattened-upgrades is run, it will trigger the FreedomBox
mechanism and will result in database upgrade.
- After this install a sample package using apt. Trigger will be run but will
not result in radicale setup rerun.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Fixes: #2119
Tests:
- Install mediawiki app.
- Install a sample package using apt. Trigger will be run and but will
not result in Mediawiki setup rerun.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Closes: #1447
Find and rerun setup for apps after a dpkg operation is completed.
This is needed in a couple of situations:
1) Some Debian packages don't manage the database used by the package. When
these packages are updated, their database schema is left at an older version
and service might become unavailable. FreedomBox can perform the database schema
upgrade. However, FreedomBox needs to know when a package has been updated so
that database schema can be upgraded.
2) A package is installed but FreedomBox has not modified its configuration.
Newer version of package becomes available with a new configuration file. Since
the original configuration file has not changed at all, the new configuration
file overwrites the old one and unattended-upgrades deals with this case. Now,
say, the configuration file modifies some defaults that FreedomBox expects
things might break. In this case, FreedomBox can apply the require configuration
changes but it needs to notified as soon as the package has been updated.
When apt runs dpkg, after the operation is completed it triggers commands listed
under the configuration 'Dpkg::Post-Invoke'. This in turn calls this class via a
DBus notification. Here, we iterate through all the apps. If an app is currently
installed and interested in rerunning setup after dpkg operations, then its
setup is rerun. Interest is expressed using the 'rerun_setup_on_upgrade' flag on
the Package() component. If all packages of the app have not be upgraded since
the last check, we skip the operation.
Tests:
- When an app is installed from FreedomBox, the trigger is not run.
- When a package is installed from command line with apt, the trigger is run. It
does nothing.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- We have a hook that triggers when 'apt update' is successfully run. This hook
handles the force upgrading mechanism. It's intended purpose is to handle
packages with configuration file prompts that unattended-upgrades does not
touch. 'apt update' is run on behalf of unattended-upgrades every day on a
schedule. This is the primary time the hook is intended to run. However, the
hook also run every time FreedomBox runs 'apt update' before installing an app.
Also no operations are performed, there is a race to see of apt is available for
the operation.
- Avoid these unnecessary runs by setting an environmental variable and by
checking it before running the trigger.
- There is one place where we want to genuinely run the trigger. That is after a
distribution upgrade. Handle this case.
Tests:
- When apt update is run on the command line, the hook is triggered.
- When installing an app, however, the hook is not triggered.
- During a dist-upgrade, the hook is triggered at the end.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Although there are no issues with kiwix like for calibre, it is the right way to
do this.
Tests:
- Without patch, restore the app on testing from a backup on stable machine and
notice that the data folder is owned by nobody:nogroup but files inside are
owned by a kiwix-server-freedombox user and group. This is not ideal.
- With patch, restore again notice that the library is accessible and all the
files are owned by nobody:nogroup.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Fixes: #2500.
systemd 257 has introduced in which DynamicUser= services will use id-mapped
mounts[1] instead of performing chown on the entire data directory. On Debian
stable release, calibre service will contain data folders with a dynamic user
ownership while on testing release, calibre service will contain data folders
with nobody:nogroup ownership.
When a backup from stable release is restored on testing release, the two
directories are merged. The top level directory will be still owned by
nobody:nogroup while the files instead will be owned by dynamic user and group.
In this case, systemd will not recursively update the ownership. Calibre will
fail to access the library files.
The fix is to completely wipe the existing data folder before a restore. When
systemd notices that the directory ownership is not properly it will recursively
change the ownership before starting the service.
Links:
1) https://www.freedesktop.org/software/systemd/man/latest/systemd.exec.html#RuntimeDirectory=
Tests:
- Without patch, restore the app on testing from a backup on stable machine and
notice that the data folder is owned by nobody:nogroup but files inside are
owned by a calibre-server-freedombox user and group. This leads to failure when
accessing the library.
- With patch, restore again notice that the library is accessible and all the
files are owned by nobody:nogroup.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Many times, merging old and new data folders is not ideal and could lead to
unexpected outcomes. Perhaps removing all the backup folders and files before
restore is ideal. However, this patch tries to introduce that approach slowly on
an experimental basis.
Tests:
- Unit tests work.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Closes: #2503
- FreedomBox is a server that is typically always running. If applications such
as GNOME desktop environment are installed, they could, by default, cause system
to sleep or hibernate after a period of idleness (based on peripheral activity).
To ensure that services are always available over the network, prevent all such
applications from sending the system to sleep/hibernate.
- Other types of sleep such as hybrid sleep and suspend and hibernate are also
automatically disabled by systemd if either suspend or hibernate are disabled.
Tests:
- Without the changes, install GNOME. In gdm login screen or in desktop
environment, after 20 minutes (default) the system goes to sleep.
- Create the file in the patch with the appropriate directory in a production
FreedomBox machine. Run 'systemctl daemon-reload'. After this, running
'systemctl suspend' or 'systemctl hibernate' will return an error that the
operation is not supported. In GDM, the suspend button does not appear. In GNOME
desktop environment after login, the suspend button does not appear. Even after
the 15-20 minute period, the system does not go to sleep.
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
The path attribute has been deprecated and will be removed in pytest 9.0. The
new argument to use is collection_path which is pathlib.Path object it is
available in pytest 7.2 (bookworm) and above.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
The warning is:
RemovedInDjango50Warning: The default value of USE_TZ will change from False to
True in Django 5.0. Set USE_TZ to False in your project settings if you want to
keep the current default behavior.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Helps: #2501
Helps: Debian #1100995
- With radicale's Debian packaging for version 3.5 (trixie) the auth/type
configuration value is no longer set to remote_user by default[1]. FreedomBox's
setup depends on this. So, set this value explicitly including for bookworm.
Links:
1) https://tracker.debian.org/media/packages/r/radicale/changelog-3.5.0-1
Tests:
- Install on bookworm and testing VMs and run functional tests. Web UI works.
- On bookworm VM, install radicale and perform dist-upgrade. Upgrade succeeds.
Radicale is at version 3.5.0-1. The file /etc/radicale/config *does not*
contains auth/type as 'remote_user'. This is because unattended-upgrades has
unexpectedly upgraded radicale and overwrote the configuration file. This is
being investigated separately.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- We are using a private data structure that lead to failure. psutil 7.0 removed
two fields from the partition class. Just update the code to work with 7.0
instead of emulating psutil completely as that is a better test.
- The primary code is unaffected in is_partition_read_only() and
get_filesystem_type() due to not having any changes in the fields we use.
Tests:
- Run unit tests on testing and unstable VMs.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
There are configuration items that users of syncthing can accidentally
set, resulting in the UI becoming unavailable. Previously, if such a
thing happened, the FreedomBox admin would have to ssh into the server and
edit the xml manually or reinstall/restore the app. With this patch, it
is enough to re-run the setup to make the UI accesible again.
- Remove http basic authentication from the settings (gui/user and
gui/password. This is unnecessary as FreedomBox already provides
authentication.
- Make sure these options are properly set:
- 'Use HTTPS for GUI' is off
- 'GUI Listen Address' is 127.0.0.1:8384
- GUI is enabled
There is a forum discussion that inspired these changes:
https://discuss.freedombox.org/t/solved-cant-access-syncthing-administration-panel/2137
Tests done:
- Fresh install: after the setup, confirm the UI is working properly and
the xml is configured with the expected values.
- Make the changes to break the Syncthing UI, then re-run setup. Confirm
the UI is back online.
Signed-off-by: Benedek Nagy <contact@nbenedek.me>
[sunil: Initialize conf_changed variable to prevent failures accessing it]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Closes: #2499
[sunil]
- Add a comment about the dependency.
Signed-off-by: Benedek Nagy <contact@nbenedek.me>
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
[sunil]
- Move the script to plinth/tests/functional directory as it is the right place
for it.
- Add HACKING.md entry to talk about the script.
- Update the pyproject.toml to ensure that functional tests config.ini is
installed along with functional tests python code.
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
As reported in discussion forum[1], when clients connected via 'shared' network
connection try to resolve the a static domain name configured in FreedomBox,
they resolve to 127.0.1.1. Since this refers to client's own IP address, they
fail to connect.
In the previous version, this was not a problem because the entry was stored as
<hostname>.<domainname>. To resolve this, store domain names in kvstore instead
of /etc/hosts.
Links:
1)
https://discuss.freedombox.org/t/freedombox-resolves-its-own-external-name-as-127-0-1-1/3660
Tests:
- Adding/removing static domains from Names app works. The order of added
domains is preserved in the stored configuration. When adding a existing domain,
a proper error message is shown.
- Without the patch, configure multiple domains. They show up in /etc/hosts.
Apply the patches and restart the service. Names app setup will run. Entries
from /etc/hosts are removed and will be added to kvstore. The list of domains
shows properly in Names app. After restarting the services, domains are show
properly.
- Without the patch on a version of FreedomBox without support for multiple
static domains, configure a static domain. Switch to latest version FreedomBox
with the patches. Restart the service. Names app setup will run. Entry from
/etc/hosts will be removed and will be added to kvstore. The list of domains
shows properly in Names app. After restarting the services, domains are show
properly.
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Closes: #2490
Tests:
- Unit tests works.
- On a fresh stable container, enable auto updates. Run 'apt install
mumble-server' and kill the apt process when it is unpacking. After this any apt
install command will ask for running dpkg --configure -a. At this time, run the
Testing dist upgrade. Dist upgrade starts successfully and then shows the
message 'Fixing any broken apt/dpkg states...'. It also shows that packages that
were not setup have been setup. Dist upgrades proceeds after that.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Use qcow2 image format so that snapshots of VMs can be taken.
- Snapshots of running VMs can't yet taken yet. But once the VM is stopped,
snapshots are possible.
Tests:
- Bring up a stable VM freshly after destroying. Work with the VM, stop it and
take a snapshot using virt-manager.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Closes: #2490
- When app update and force upgrade are pending on an app, app.setup() is run
during initialization. During setup(), force upgrade is first run as expected.
However, force upgrade does not do it's job when an app needs version upgrade.
setup() then tries to run package install() for the app and fails because
configuration file prompt is pending.
Tests:
- On a fresh bookworm container, update all packages. Run freedombox and ensure
that first setup has been completed. Stop freedombox and increment the firewall
app version. Then change sources.list and change bookworm to testing. Run apt
update. Then start the fredombox service. Notice that firewall app setup is run.
During the setup, force upgrader is executed. It install the newer firewall
package with the newer configuration file and performs the configuration file
changes. After that setup process continues and completes successfully.
firewalld package has been upgraded from 1.3.x to 2.3.x. firewalld service is
running. In /etc/firewalld/firewalld.conf default zone is set to external and
backend is set to nftables.
- Rerun the above test without the patches and notice that force upgrader does
not recognize firewall as a package to upgrade and setup() fails when trying to
install() packages. This is run in a loop continuously.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Save changes to /etc/apt/sources.list as a different file.
- When launching the dist upgrade process via systemd-run, use bind mounting to
ensure that the newly created sources file is treated as the original
/etc/apt/sources.list.
- If the process completes successfully, rename the new file to the original
sources.list. If the process terminates abruptly or machine reboots,
sources.list will remain unchanged. This will also the dist upgrade process to
be restarted (and hopefully continued).
Tests:
- On a fresh stable container, running dist-upgrade succeeds.
- While dist-upgrade is running, /etc/apt/sources.list is unmodified. After the
operation is successfully completed, /etc/apt/sources.list has been updates
successfully. If the operation fails, /etc/apt/sources.list remains unmodified.
- During the run the following are run:
- apt update
- package holds
- debconf selections
- full-upgrade
- autoremove
- unattended-upgrades
- restarting freedombox service
- waiting 10 minutes
- apt update
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- When an action is invoked, it configured to handle console and journal
handlers. Console logger (StreamHandler) flushes after each event. Journal event
is sent immediately after the event. So, we are not losing the immediate flush
advantage by switching to logging framework.
- Since console logging is present (and the output is not captured away), using
journal handler also will double log each event. Remove the journal handler.
Console is where the output of various commands is logged. So, keep that.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- A service with the same name can't be started again.
- Transient service goes away as soon as the process ends. This is like
automatically removing the flag. This ensures that stale file does not cause an
issue.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Closes: #2493.
Tests:
- For each of the packages in the list, download the Bookworm version and Trixie
version of the packages. See if the files in /etc/ that were modified were also
files we also modify. If so, keep it in the list. Otherwise, remove it from the
list.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Helps: #2493.
- searx will not be part of Trixie.
- This special upgrade code is not required for Bookworm -> Trixie upgrade.
- This code is not be invoked for Bullseye -> Bookworm upgrade as this removal
will not reach Bullseye.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- On app and system pages, canceling the search using the close button at the
end of the search bar will remove the search tags but will stay on the same
page.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Tests:
- In apps and system page, removing the last tag from search bar keeps the same
page but without any filtering.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Tests:
- In apps page, notice that all the tags are displayed as expected.
- Inside an app from apps sections, clicking on an tag shows the apps with that
tag filtered.
- Clicking on the search bar shows the list of all tags.
- Clicking on tag from search list adds that tag to the search list.
- Labels are shown properly in the search bar.
- Clicking on label removes it from search.
- Search results are sorted based on the number of matches.
- Clicking on the close button the tags search input removes filtering.
- All the above tests work for systems page with systems app. Sections are shown
even when apps are filtered by tags. Sections without results are not shown.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- Adding a new domain works. Adding a new domain with old name results in error
message.
- Editing a old domain works. Updating the domain name works. Updating
configuration parameters without domain name change works.
- Adding a domain with capital letters results in domain with lower cased
letters.
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- Adding an new unique domain works.
- Adding an existing domain results in an error.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
unattended-upgrade will take a very long time to run, and won't be able
to upgrade most of the packages. There is not much benefit to running it
here.
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Tests:
- Start a dist-upgrade from stable to testing. Dist upgrade is completed
as expected. "The system will reboot" message appears only after
freedombox-dist-upgrade.service has completed.
Helps: #2090
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
- The get_domain_name() has some problem. It returns only static domain names
but not a dynamic domain name. It may not always return the same domain when
multiple static domains are configured. It may return return an empty string.
Tests:
- JSXC page shows the alphabetically first static domain. If no static domain is
configured, first dynamic domain is shown, next pagekite domain, next pagekite
domain, next tor onion domain, and finally .local domain.
- Downloading profile from OpenVPN will set the first domain in it.
- When ejabberd is installed, the first domain is configured by default.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Otherwise, on Debian stable, running make check-type results in following
error:
/usr/lib/python3/dist-packages/_pytest/python_api.py:24: error: Cannot find
implementation or library stub for module named "numpy" [import]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- First of the list is the most important one and may be used as "primary"
domain in apps.
- Change the return type of DomainName.list() from set to list so that order can
be preserved. Update all users of the API accordingly. Add type hints to all the
methods using this API to catch any errors.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- This can be used to ensure that apps that can deal with only a single domain
auto-configure the best domain by default.
Tests:
- Unit tests run.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Instead of just configure button, show edit/delete. And configure separately.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Change the mechanism for storing domain names in /etc/hosts. Don't write
hostname to /etc/hosts. Don't prepend hostname to domain name. This means that
when hostname changes, set_domain_name need not be called.
- This means that domain names such as example.fbx.one were not resolvable using
/etc/hosts but these will now resolve to 127.0.1.1. This is a minor concern to
becoming a breaking change.
- Don't use socket.getfqdn() for finding the domain name of the machine. Instead
read from /etc/hosts. There does not seem to a glibc/python API for querying
domain names from /etc/hosts with all variations it allows. Forward resolution
properly works no matter the library.
- Drop a pre-Python 3 conversion from unicode to ascii string for hostname. This
is no longer relevant.
- Domain name form is now domain add form. Passing domain name is mandatory.
Domain delete form and view have been introduced.
- Use augeas to edit hosts file. Add privileged methods to add/delete/get
domains. Add method to migration from old format to new. Support reading old
format too in get_domains.
Tests:
- Without hostname written in /etc/hosts, 'resolvectl query <hostname>' and
'ping <hostname>' work.
- With old /etc/hosts format apply patches and restart service. It will be
converted to new format.
- Adding a domain adds a new line to /etc/hosts file. The domain is shown in
domains list in Names app. Applications get reconfigured with the new domain
name.
- Deleting a domain adds a new line to /etc/hosts file. The domain is shown in
domains list in Names app. Applications get reconfigured with the new domain
name.
- Restarting app triggers domain added signal for all domains and all the
domains are shown in the Names app.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- In the main domains list, only show currently configured domains. Allow
operations such as edit/delete/configure on them. Actions are determined by the
domain type.
- Show domain types that can be added in a separate table. If an domain is
present and only of that type can exist, it will not be shown in this table.
Show add/configure action based on whether multiple domains can exist.
Tests:
- Configuring a singleton domain type puts it in the domains tables and removes
it from the add domains table. De-configuring it or disabling it does the
opposite.
- For domain types with multiple domains (static/dynamic), entries are shown in
domains if such domains exist. Entry in add domains tables always shows up.
- All action buttons for all five domain types work.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- To be used to present better interface for domain types that have multiple
domains.
Tests:
- Unit tests pass.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- This can happen if a domain is added while the app is disabled.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This seems to be the most useful function for enabling/disabling dynamic DNS.
This is also what users are likely to expect.
Tests:
- Disable app. The domains will be removed from list of domains in Names app.
Installed applications will be reconfigured.
- Enable app. The domains will be added to list of domains in Names app.
Installed applications will be reconfigured.
- When app is disabled. Adding/removing domain does not trigger app
configuration apps. Domains are not added to Names app.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- In preparation for changes to domain type component.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- This would mean consistent interfacing with systemd instead of a split
approach.
Tests:
- Edit hostname page shows the current value of hostname correctly.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
The changes introduced in https://salsa.debian.org/freedombox-team/freedombox/-/merge_requests/2616
make the email app installation fail if it's installed for the first
time.
This patch ensures that 95-freedombox-sieve.conf is present and that
dovecot is restarted before privileged.setup_spam() is run. This way,
the sievec command can run.
Signed-off-by: Benedek Nagy <contact@nbenedek.me>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
dnsutils package is not available anymore.
Closes: #1094944
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
SOGo is an open source webmail client and groupware available in Debian.
Make a new FreedomBox app for it to be used with the local
Postfix/Dovecot email server.
SOGo requires a database to store events/tasks as well as user settings. Memcached
is also required for caching.
Users log in with their username (as opposed to username + domain on
Roundcube). The host header seen from the first login will be
associated with the user profile. So, if a user logs into SOGo from
freedombox.local and later configures the email server to use
example.com, they will manually have to edit their account(s) to show
the updated domain.
Authentication is done via openldap. It is possible to authenticate with
apache, however it is limited to http basic auth, so mod_auth_tkt cannot
be used. See: b40d777a86/SoObjects/SOGo/SOGoProxyAuthenticator.m (L137)
Configuring http basic auth in my opinion wouldn't add much to
the user experience. It would actually take away the usage of SOGO's built
in TOTP feature.
SOGo only accepts configurations from /etc/sogo/sogo.conf, other configs
from sogo.d don't get recognised.
Use the sogo icon from upstream source. Update sogo.png and sogo.svg to be the
same image (but resized) that is provided in the upstream source. The previous
image was download from Wikimedia Commons.
Update smtp settings so that messages can be sent
Test result for mail deliverability sent with SOGo: https://www.mail-tester.com/test-pdf2yzy6n
The result shows that the message is not DKIM signed. This seems to be
an issue not specific to SOGo. Mails sent from Thunderbird don't get
signed either.
Tests:
- Install app and log in with a FreedomBox user. Create a new event
titled "Lunch with 🍕 and fries". Confirm the pizza character displays properly.
- Backup the app and uninstall it.
- Restore from the backup, log in and confirm the event gets restored.
To-do:
- test ActiveSync
- create a fail2ban jail
- include the icons in the copyright file
- test sending email in a production setup
- test sieve filters
- write tests
https://salsa.debian.org/freedombox-team/freedombox/-/issues/56
[Sunil]
- App:
- Update icons to be uniform size as all other apps and copyright information.
- Since SOGo is not configured to trust the authentication from Apache, it
does not require FirewallLocalProtection. Remove it.
- Expand app description. Talk about Email Server app.
- Update to match recent tags related changes.
- Make memcached a shared daemon as other processes might use it.
- Added shared daemon for PostgreSQL.
- Don't start services when rerunning setup if the app is currently disabled.
- Don't restart memcached during a restore operation.
- Security:
- Add system security restrictions to the daemon.
- Don't use fail2ban jail. SOGo has a mechanism to lock users for a few
minutes. Use that instead.
- Apache:
- Make /.well-known URLs work by moving their definitions to global section.
- Remove old (<2.4) Apache authorization keywords.
- Simplify, indentation, new line at EOF.
- Manifest:
- Add more tags.
- Add SOGo connector, DAVx5, and GNOME Calendar to list of clients.
- Add 'sogo' to list of service to bring down during backup/restore.
- Privileged:
- Switch from MySQL to PostgreSQL as it is recommended by SOGo.
- Use existing utility to generate database password.
- Use plget and plmerge utilities from gnustep-common package to parse/edit
the configuration instead of augeas which don't have a dedicated lens.
- Don't reset the domain when rerunning setup.
- Ensure that the configuration file has proper ownership and permissions even
when it did not exist previously.
- Add typing information for most methods.
- Remove configuration file after uninstall.
- Configuration:
- Define database URLs for all seven database tables.
- Set calendar default roles as suggested in the installation guide.
- Refresh view automatically every minute to check for new mail.
- Use the mechanism to lock account after failed login attempts.
- Add folder name for Junk folder too explicitly.
- Tests: Add basic functional tests.
Tests:
- Functional tests work.
- Rerunning setup does not change the domain back to the primary domain of the
email server.
- Login works. Sending mail and reading mail works. Creating calendar events and
contact works.
- Changing the domain sets the domain value properly in the configuration file.
Configured domain is shown properly on the form.
- Backup and restore work as expected.
- When configuration file is removed and setup is re-run, then the file is
created with proper ownership and permissions.
- 'systemd-analyze security sogo.service' shows a good score.
Signed-off-by: Benedek Nagy <contact@nbenedek.me>
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Can be used to set the 'Expires:' header to cache static files for a long
time.
Tests:
- Without the patch 'a2query -m expires' shows that the module is not installed.
Applying the patches and restarting services shows that Apache app's setup is
run and 'a2query -m expires' shows that module is enabled.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- Without the patch, uninstall and reinstall will fail. With patch it passes.
- Rerunning setup does not destroy the contents of the database.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Add methods for creating/dropping user/database.
Tests:
- ttrss and miniflux functional tests work which check for backup/restore.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- Enabling/disabling app results in daemons enabling/disabling in correct order.
MySQL first and timer next when enabling. Reverse when disabling.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- This allows ttrss to disabled postgresql if it is not needed by any other app
and enable postgresql if it is disabled and ttrss is being enabled.
Tests:
- When disabling ttrss and it is the last app using postgresql, it will be
disabled too.
- When disabling ttrss and it is not the last app using postgresql, it will not
be disabled too.
- When enabling ttrss if postgresql is disabled, it will be enabled too.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- This allows miniflux to disabled postgresql if it is not needed by any other
app and enable postgresql if it is disabled and miniflux is being enabled.
Tests:
- When disabling miniflux and it is the last app using postgresql, it will be
disabled too.
- When disabling miniflux and it is not the last app using postgresql, it will
not be disabled too.
- When enabling miniflux if postgresql is disabled, it will be enabled too.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Thunderbird Mobile has been built on K-9 mail and is the future of the app[1].
Links:
1)
https://blog.thunderbird.net/2022/06/revealed-thunderbird-on-android-plans-k9/
Tests:
- Go to email app and expand the clients information. Verify the app store links
for Thunderbird Mobile.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
We were using the Unicode point "Katakana middle dot" which was not showing up
on some systems. Separators may not show up the same on all machines depending
on the font used. So, use an SVG image instead.
Tests:
- On the front page and apps page, the separators appears as expected.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Closes: Debian bug #1093065.
These files were only present to serve polkit = 105 in Debian bullseye.
Alternate files .rules already being shipped for polkit > 105.
Tests:
- Install infinoted and enable/disable firewalld. infinoted ports have been
enabled/disabled in the firewall as noticed using firewall-cmd.
- Creating/deleting network manager connections works well. nmcli shows the
updates.
- Add backup location page shows list of disks properly.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- Latest version of libjs-bootstrap5 depends on
node-popper2. However, version in Debian bookworm still continue to have
incorrect dependency. So, add explicit dependency on node-popper2 until we stop
supporting Bookworm.
Tests:
- In stable and testing VMs, install node-popper2 and notices that the following
work as expected:
- User menu dropdown in desktop and mobile layouts.
- Help menu dropdown in desktop and mobile layouts.
- Notification dropdown.
- App extra actions dropdown.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
Add two sieve scripts for spam/ham learning. When the user moves a mail
from anywhere to junk, or from junk to anywhere (except for trash) the
mail is piped into the respective rspamc learn_spam/learn_ham command.
The rspamc command is run as the mail user and the command requires that
the user can connect to localhost:11334. Because of that, add the mail
user to the allowed users that can access protected services.
The sievec compilation of the new scripts requre the dovecot-antispam
package, so install it and increment the email version number.
Closes: #2487
Imroves: #56
Tests done:
1. Apply the patches on an existing install
2. Confirm the firewall and the email app get updated
3. Move a mail from inbox to junk and confirm that rspamd statistics for
"Learned" mails increment by one.
4. Move back the mail from junk to inbox and confirm the number
increments again.
5. Move the mail to trash and confirm the script doesn't execute.
6. Repeat steps 3-5 with mail_debug = yes in /etc/dovecot/dovecot.conf
and confirm the script esxecution further by reading the debug logs.
[Sunil]
- Split the configuration file 90-freedombox-sieve.conf into
90-freedombox-imap.conf and merge the remaining with 95-freedombox-sieve.conf.
- These changes do not need dovecot-anitspam package. Remove it from packages
list for the app.
Signed-off-by: Benedek Nagy <contact@nbenedek.me>
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
- The DOM structure of the nextcloud UI seems to have changed.
Tests:
- In functional tests, with the updated code, test_create_folder test passes.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Closes: #2437
- The port part of the override domain was not being set properly. Set this
properly.
Tests:
- Running tests on am VM spawned by the container script works (it does not
require port).
- Running tests on Vagrant VM has not been tested.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Closes: #2488.
This is due to outdated django-bootstrap-form package that does not set
.form-select class on dropdowns as needed by Bootstrap 5.
Tests:
- On stable and testing VMs, dropdowns in the 'Add backup location' page show
arrows.
- On a mobile layout, the overflowing text does not overlap onto the dropdown
arrow.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- This app is useful for people who can connect a monitor, a keyboard, and a
mouse to their FreedomBox.
- Later this app allow a headless FreedomBox to be used as a remote desktop
server. Users will be able to connect and access desktop applications from LAN
or WAN.
- No functional tests as they will likely fail in CI and container setups.
Tests:
- In a VM, install the app. Installation succeeds.
- Disabling the app makes systemd switch to multi-user.target shutting down any
service that any mean for GUI such as gnome-remote-desktop.service. Graphical
login is not shown on the VM's virtual monitor.
- Enabling the app make systemd switch to graphical.target and all the services
are started again. Graphical login is shown on the VM's virtual monitor.
- Login to desktop using VM's graphical terminal works. Settings, apps, browser
etc. work.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- In tags cleanup code, the front page shortcut for email uses different tags
than those provided in the manifest. When the app is instantiated in privileged
code without setting up Django, this causes an error even though gettext_noop is
used. Workaround by using a custom method for this.
Tests:
- Installing, enabling/disabling email apps works.
- 'make update-translations' output shows that django.pot has been updated and
the tags in question are part of the POT file.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- For scheduled backups and automatic backups generated when uninstalling apps,
make the generated archive name similar to automatic name given no name is
specified when creating an archive.
Tests:
- Set schedule on a local repository, uninstall an application, and create a
backup archive without a name. The timestamp in generated backup archives in all
three cases is similar in format.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Closes: #2354.
- Process spawned for raw IO should be collected using wait(). Closing the
specially created pipe early causes an exception in the child process when it
tries to write to stderr the JSON result of executed method.
Tests:
- Monitor the output of 'journalctl -f'. Download and archive. Without the
patch, an error is printed as described in the bug. With the but no such error
is printed. Downloaded file is the same in both cases.
- Writing a log message in cleanup_func shows that the process has been waited
for and the FDs have been closed.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- Fill up disk to have very little space left. Perform a large backup operation
by writing a large file to one of the directories to be backed up. Try to
perform the backup and notice that a nice error message is shown that there is
not enough disk space instead of a generic error message.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Promote reverse DNS information to primary heading.
- Add information that only one domain have reverse DNS configured.
- Clarify that ISP are also responsible for reverse DNS.
- Show reverse DNS records only for primary domain.
Tests:
- View email app. List of domains is shown in the domain section. Primary domain
is marked with a special icon.
- Clicking on the domain works. DNS and reverse DNS information is shown. DKIM
key information is present.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Benedek Nagy <contact@nbenedek.me>
- Instead of just the primary domain. This bring us closer to working equally
well on all the domains.
- App version number has not be incremented because it has already been
incremented for this release cycle.
Tests:
- When re-running the setup of email app. Notice that all the domains have DKIM
keys now.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Benedek Nagy <contact@nbenedek.me>
- Drop the configuration field from all the forms.
- Those using a different value for public IP lookup URL must now set the value
again in the privacy app. Privacy app will show the review notification again
for this reason.
Tests:
- Functional and unit tests pass.
- Printing the external IP address during the update task shows correct value.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Benedek Nagy <contact@nbenedek.me>
- Since a new option has been introduced the privacy app.
Tests:
- When the patch is applied and service is restart, privacy app's setup is run
again and notification is shown when it has already been dismissed.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Benedek Nagy <contact@nbenedek.me>
- This will act as centralized location to set the URL to lookup IP addresses.
Tests:
- When no value is set initially, the URL for Foundation is shown. This also
happens when the value is removed from 'plinth_kvstore' sqlite3 table.
- When empty value is set it, the empty value is set in DB and show in the UI.
- When no value is changed and form is updated, message is shown that settings
have not changed.
- When value is changed and form is updated the updated value is shown in the
form, message is shown that configuration has been updated.
- Updated URL value reflects in the email app and errors change accordingly.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Benedek Nagy <contact@nbenedek.me>
Imroves: https://salsa.debian.org/freedombox-team/freedombox/-/issues/56
[sunil]
- Show reverse DNS records for both IPv4 and IPv6 addresses.
- Use utility to lookup public IP addresses.
- Rename the template context variable and method to use less technical terms.
- Use Python's ipaddress module to compute the PTR record's domain value.
- Don't retrieve primary domain at the module level.
Signed-off-by: Benedek Nagy <contact@nbenedek.me>
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Benedek Nagy <contact@nbenedek.me>
This will later become a setting in the privacy app. It will be used by email,
dynamicdns, and networks apps.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Benedek Nagy <contact@nbenedek.me>
- Also remove the extra unwanted space between the tags.
- This allows different shortcuts of the same app to have different tags on the
home page. Example: email shortcuts on the home page.
- This also allows custom shortcuts to have their own tags without being
attached to any app provided by FreedomBox.
- Filter shown menu items by tags on the menu item rather than tags on the app.
They could be different.
Tests:
- Home page shows shortcuts with tags.
- Apps and system pages show shortcuts with apps.
- Apps are properly filtered when tags are clicked on in the app page.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
- Earlier tags of all the apps from help, system, and apps pages were shown.
Now, only show tags from apps in the apps page.
- There is no need to override language since menu.tags which is sames as
info.tags is already a list of untranslated strings.
Tests:
- List of tags is shown in the dropdown when tag search bar is clicked. This
list contains translated tags when language is set to Spanish. The sort order is
per the translated locale.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
Since there are currently no apps with short description, it does not show
already anyway.
Tests:
- Installing an app works.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
Tests:
- Build developer documentation and ensure that there are no errors during build
and all changes are reflected.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
- Add typing information for init methods Info, Shortcut, and Menu to easily
identify problems.
- Update docstrings for these components.
- Updates test cases to deal with tags instead of short description.
- Update custom shortcuts code to read tags and ignore short description.
- Update API to send tags instead of custom shortcuts.
- OpenVPN special treatment of info.description in Shortcut
Tests:
- All unit tests pass and type checking succeeds.
- All apps show icons with tags in apps and system section.
- In help section cards don't show tags.
- In front page, enabled apps show shortcuts with tags.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
- When tags are added to Menu and Shortcut components, we will need to access
info.tags which tries to extract the original string from lazy proxy. This
requires Django initialized. When privileged process tries to initialize the app
without initializing Django, this leads to an error. Fix this by extracing the
original string from a lazy proxy a hacky way.
Tests:
- Running diagnostics does not show errors with Django initialization in checks
for configuration links.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
- Even though pexpect is set for override in pyproject.toml latest
mypy==1.13.0-2 on Debian testing throws an error here.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
Tests:
- All deluge functional tests pass and monitored that there are no
unreasonable delays in deluge web client while tests are running.
Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
- They should only be present in the <head>. Since all files are loaded with
'defer' attribute, it is no longer needed to place the JS files at the bottom of
the page.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- This improves page rendering time. If JS files are not loaded in deferred or
async mode, they will halt the page rendering until JS files are loaded from
network.
- 'defer' mode guarantees that the load order is same as the order in which JS
files appeared in the HTML page.
Tests:
- Run at least one function of each affected JS file and ensure that is works.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- Due to their fixed widths they were causing the drop down navigation bar to
placed incorrectly in mobile view.
Tests:
- In mobile view in home, apps, system, and help pages the navbar dropdown
button is placed correctly.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- When a template page is updated, we are having to restart service in order for
the new changes to reflect. This is due to caching of template files starting
Django 4.1[1]. Disable this behavior in development mode to allow reload the
browser page to see changes reflected.
Links:
https://docs.djangoproject.com/en/5.0/releases/4.1/#templates
Tests:
- Change a template file and reload the page without restarting service. The
changes should reflect immediately.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- Most notable of the problems is the missing hover color on cards.
Tests:
- Cards have a gray hover color.
- Forms with errors have input boxes with red borders and help text with red
color.
- Select all button in created backup has a border.
- UI is consistent across stable and testing for tested cases.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- Currently, there is a bug with section header with Bootstrap 5 migration in
stable. It causes the section headers not to have underline in Debian stable but
only in Debian testing. This is due to the variable --bs-secondar-border-subtle
being defined only in Bootstrap 5.3 (testing) but not in Bootstrap 5.2 (stable).
- The removal of the border is actually reducing visual noise. So, commit to it
by removing the border even on testing. To Increase contrast to the section
headers, increase their font size (but reduce font weight).
Tests:
- In testing and stable VMs, the style is same and as expected.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
Closes: #2484
Tests:
- Functional tests for users app works.
- When updating the user if the delete user is not checked, delete confirmation
dialog is not shown.
- When updating the user if the delete user is checked, delete confirmation
dialog is shown. It can be dismissed and re-shown many times. When confirm
button is clicked, the form is submitted and user is deleted.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- Enabling/disabling public share shows and hides the list of groups in share
edit page.
- When loading the share page, if public share is enabled, list of groups is
hidden.
- When loading the share page, if public share is disabled, list of groups is
shown.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- Modify or remove the sslCert/sslKey lines in mumble-server.ini. The
diagnostic is failed. After repair, the expected lines are restored,
and the diagnostic is passed.
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Tests:
- In testing container, install Mumble. /etc/mumble/mumble-server.ini
has settings for ssl cert and key.
- In stable container, install Mumble. /etc/mumble-server.ini has
settings for ssl cert and key.
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
See the spam score for an email sent with these settings:
https://www.mail-tester.com/test-jy6unbdzu
Tests done:
1. Install the email app with version 4, then check out the files:
```
ls -la /var/lib/rspamd/dkim/ ; cat /etc/rspamd/local.d/dkim_signing.conf
total 4
dr-x------ 1 _rspamd _rspamd 50 Jan 1 19:14 .
drwxr-x--- 1 _rspamd _rspamd 16936 Jan 1 20:21 ..
-r-------- 1 root root 1704 Jan 1 19:14 freedombox.local.dkim.key
cat: /etc/rspamd/local.d/dkim_signing.conf: No such file or directory
```
2. Apply the patches and update the app:
```
ls -la /var/lib/rspamd/dkim/ ; cat /etc/rspamd/local.d/dkim_signing.conf
total 4
dr-x------ 1 _rspamd _rspamd 50 Jan 1 19:14 .
drwxr-x--- 1 _rspamd _rspamd 16936 Jan 1 20:22 ..
-r-------- 1 _rspamd _rspamd 1704 Jan 1 19:14 freedombox.local.dkim.key
allow_username_mismatch = true;
sign_authenticated = true;
use_domain = "header";
domain {
freedombox.local {
path = "/var/lib/rspamd/dkim/freedombox.local.dkim.key";
selector = "dkim";
}
}
```
3. Configure example.com as a domain under Name Services, then also change the primary domain in the email app and confirm it completes without errors.
Also see:
```
ls -la /var/lib/rspamd/dkim/ ; cat /etc/rspamd/local.d/dkim_signing.conf
total 8
dr-x------ 1 _rspamd _rspamd 90 Jan 1 21:15 .
drwxr-x--- 1 _rspamd _rspamd 16936 Jan 1 21:17 ..
-r-------- 1 _rspamd _rspamd 1704 Jan 1 21:15 example.com.dkim.key
-r-------- 1 _rspamd _rspamd 1704 Jan 1 19:14 freedombox.local.dkim.key
allow_username_mismatch = true;
sign_authenticated = true;
use_domain = "header";
domain {
example.com {
path = "/var/lib/rspamd/dkim/example.com.dkim.key";
selector = "dkim";
}
}
```
4. Uninstall the app and perform a fresh install, confirm it completes succesfully.
The configurations in /etc/rspamd/local.d/dkim_signing.conf have been
verified to work on a throw-away VPS setup.
Once merged, this should be mentioned here: https://discuss.freedombox.org/t/solved-email-messages-not-signed-with-dkim/2387
Signed-off-by: Benedek Nagy <contact@nbenedek.me>
[sunil: Add comment explaining allow_username_mismatch option]
[sunil: Drop an unused variable, added docstrings]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
The last confirmed issue we had was fixed in Nov 2024, no new issues
have been repoerted since.
Signed-off-by: Benedek Nagy <contact@nbenedek.me>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
- Currently, when trying to create PPPoE connection, we get an exception that
dns_over_tls key is not found in the form's cleaned_data. Fix this by not
expecting the field to be present only for PPPoE connections.
Tests:
- Edit a regular Ethernet connection and change the value of DNS-over-TLS to all
the different values and notice that the value is updated as expected.
- Create a regular Ethernet connection with non-default value for DNS-over-TLS.
The value for DNS-over-TLS on the connection set as expected.
- Create/edit/delete of a PPPoE connection works.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- This extra margin was accidentally introduced when migrating to Bootstrap 5
and a generic rule was introduced to add spacing before each section that is not
the first one.
Tests:
- In app pages, icon and title are at the same level.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- So that on slow machines, the tests don't fail.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Closes: #2218.
- When borg can't acquire a lock due to it being busy, any borg operation can
fail. Show a readable message instead of a generic error.
- Also handle errors for archive already existing and archive to be deleted not
existing.
Tests:
- Functional tests for backup app work.
- Creating archive works with proper message. Providing the name of existing
archive shows proper error.
- Deleting archive works with proper message. Open two tabs by clicking on the
delete archive button. Then delete with one and try to delete the it again with
the next one. Proper error message is shown.
- While downloading an archive, delete an archive. Proper error message that
borg is busy is shown.
- Upload archive works. A proper success message is shown.
- Restore backup from archive works. A proper success message is shown.
- Restore backup from file upload works. A proper success message is shown after
upload and after restoration.
- Adding local repository works. A proper success message is shown.
- Adding remote repository works. A proper success message is shown when SSH key
is verified and repository is added.
- Removing repository works. A proper success message is shown.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Closes: #1603.
- This introduces seconds and timezone in the name of the archive. When seconds
are not used in the name, taking backups too quickly on after the other fails as
the names clash.
Tests:
- Taking a backup works and creates the name in the expected ISO time format.
- Changing the timezone and restarting service creates timestamps in that
timezone.
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- When archives are listed using list_archives() method, return datetime objects
instead of pre-formatted strings. datetime objects can be compared easily and
shown in a more human readable format.
Tests:
- Unit tests pass.
- Backups with a future date are ignored when considering recent backup
times (when they logged to console).
- Most recent scheduled backup times are retrieved correctly (when they logged
to console).
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- Sending GET requests to the two views by opening theirs URLs in the browser
show a blank page. Actions are not performed.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Currently, in the repository class, if an operation fails, the error messages
from borg are interpreted and re-raised. Everywhere else, the errors are
interpreted. Fix this by wrapping privileged methods at the privileged module
level instead of a context manager at the place of calling.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- So that we write decorators that can handle errors as needed by backups app.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Fixes#2460
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
[sunil: Update the style to provide spacing after tags lines]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
sunil:
- Add explicit dependency on libjs-jquery in janus even though another
dependency brings it in.
- Fix looking for elements before DOMContentLoaded is fired. Since most of the
scripts are added at the end of the page, it might work now, but doing this
properly after DOMContentLoaded allows us to relocate the scripts to the header
of the page and add 'defer' attribute on them.
- Fix issue with IPv6 method getting selected as 'dchp' in networks.js.
- Don't focus on the first element in the form after the page loads. This is bad
for accessibility.
- Fix issue with setting the readonly/required states of IPv4/IPv6 fields on
page load.
- Password fields can now be changed to text fields and vice versa without a
problem. Simplify.
- Fix incorrect repetition of code setting 'show' class in onInvalidEvent().
- Prefer exception getting raised instead of functionality silently failing when
expected elements are not found.
- Use 'const' instead of 'var' wherever possible.
- Prefer .closest() to get to ancestors instead of .parentNode;
- Don't CSS transitions when showing an element, 'transition' CSS property does
not work on 'display' property. Instead they have to implemented on 'height',
'opacity', etc.
- Minor styling changes. Consistent casing. Use arrow styled functions.
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Closes: #2476.
- The collapse click logic is triggered when clicking on the schedule button (or
the other buttons). In case of other buttons they do activate eventually but
the schedule button does not activate.
- Solve this properly by making sure that collapse logic is not triggered when
the buttons are clicked.
Tests:
- On stable and testing containers, ensure that collapse works. Collapse/expand
icon works. The three buttons work. And mobile view looks good.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- In current stable and testing, verifying SSH remote hosts using RSA is not
working. After selecting the verified RSA fingerprint, paramiko fails to connect
- A change introduced in paramiko 2.9 lead to failures when connecting to hosts
that have a verified RSA host key[1][2][3]. To fix the issue,
disabled_algorithms must be used to drop some of the other algorithms supported
by the server to force paramiko behavior. A better solution to the problem was
introduced in paramiko 3.2. Both these solutions require careful update to the
code. Considering the utility paramiko provides, the regression annoyance,
effort required for this fix, and the security implications (it is an completely
independent SSH implementation), the library does not seem to be worth the
effort in our case.
- Switch to using sshpass command line utility instead of paramiko library. The
only reason to use paramiko seems that 'ssh' command by default does not allow
us to input password easily while paramiko does.
- Another place where paramiko is being used is to check if a host is already
verified in the known_hosts file. This has been trivially replaced with
'ssh-keygen -F'.
- Exit codes provided by sshpass can replace the specific exception raised by
paramiko.
Links:
1) https://www.paramiko.org/changelog.html
2) https://github.com/paramiko/paramiko/issues/2017
3) https://github.com/paramiko/paramiko/issues/1984
Tests:
- Add a remote backup repository with and without encryption.
- Add remote backup repository with all three types of algorithms.
- Add a remote repository again with wrong password. Authentication error is
properly shown.
- Add a remote backup repository and remove it. Host remains verified. Add a
repository again.
- Add a remote backup repository and remove it. Host remains verified. Change
the fingerprint the /var/lib/plinth/.ssh/known_hosts file. Add a repository
again. A proper error is shown that remote host could not be verified.
- Add a remote backup repository and remove it. Host remains verified. Stop SSH
server on the remote host. A generic error is shown that ssh command on remote
host failed.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- The output of ssh-keyscan scan contain comments that start with '#'. When
these are present, they are incorrectly assumed to be valid keys. Ignore these
lines.
Tests:
- Output of ssh-keyscan with latest OpenSSH in Debian testing contains comments.
Trying to verify the identity of the remove host without the patch fails when
adding remote backup repository. When patch is applied, it works (except RSA
key).
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Currently, if an error occurred during diagnostics, just error
message (without traceback details) was supposed to be shown on the results
page. However, due to a bug in code related to showing repair button, a separate
exception is raised.
- Simplify the code by dropping all custom error display. Instead allow the
generic error display mechanism in the middleware to handle the error. This
keeps the code simple.
Tests:
- Raise an exception in diagnose() method of the 'users' app. Run the
diagnostics for the users app. Notice that Diagnostics app page is shown with
error alert containing full traceback details.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- Show a different message for them.
Test:
- Try to visit page like /plinth/apps/sharing/foo/edit/ where a share named
'foo' does not exist. The common error handling middleware is triggered and an
alert message 'Page not found' with exception trace back is shown.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- These could happen when a user tries to reload a page that only allows POST
requests.
- Or when the generic exception handling logic in the middleware redirects the
user to a page that only allows POST.
Tests:
- Insert a exception in the diagnose() of the 'users' app. Without the patch,
running diagnostics on the users app leads to a blank page. With the patch, the
user is redirected to Diagnostics app page and the original error is shown as a
alert message.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- In addition to the OperationalError, also handle all generic exceptions during
page submit and page load. Redirect to the same page or parent using
breadcrumbs.
- Log exceptions handled by common error middleware so that they are also part
of the system logs.
- Update kiwix test as needed.
- Refactor some test code that is setting up the menu items.
Tests:
- When an error occurs during form POST, the same page is show but with an error
message.
- When an error occurs in an app page during GET, the browser is redirected to
the parent section.
- When an error occurs in apps page during GET, the browser is redirected to the
home page.
- When an error occurs in home page during GET, the error is not handled and
default 500 handle is triggered.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- Instead of showing traceback details only for action exceptions, show them for
normal exceptions also.
- Also adjust the gap between the error message and the preformatted text to
make it appear better.
Tests:
- Alter code to raise an exception with the utility. See that details are as
expected.
- Raise an exception in a privileged action, ensure that the details shown as
before.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
Fixes an issue where the nslcd configuration option pam_authz_search is not
in effect after the users module setup.
Tests:
- Remove the pam_authz_search configuration option from /etc/nslcd.conf,
restart nslcd service, delete plinth.sqlite database to run first setup
after plinth start, start plinth. Do it twice:
1) before applying patch, users::test_user_states functional test fails.
2) after applying patch, users::test_user_states functional test pass.
- After applying patch, the nslcd service is restarted during module
upgrade.
- All the users module tests pass.
Relates to
https://salsa.debian.org/freedombox-team/freedombox/-/merge_requests/2594#note_565614.
Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
- It was never intended that breadcrumbs be shown in these pages.
Tests:
- When running first wizard, the busy page, the welcome page, user account
create page, and the next steps page are all shown without breadcrumbs. Same for
login page.
- Other pages which had breadcrumbs earlier continue to show them, that is, app
pages, system pages, help pages, and pages under those.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
Tests:
- All users tests pass.
Signed-off-by: Veiko Aasa <veiko17@disroot.org>
[sunil: Update to reflect the new utility function name]
[sunil: Update some more cases to use the utility]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Also, add a click_link_by_href helper function.
Signed-off-by: Veiko Aasa <veiko17@disroot.org>
[sunil: Update some more cases to use the utility function]
[sunil: Keep click() and rename new behavior to click_and_wait()]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This was needed temporarily when migrating from Tor to Tor Proxy
app. But now we should preserve the user's existing configuration
during app upgrade.
Tests:
- Install Tor Proxy version 1. "Download software packages over Tor"
is enabled. Upgrade to Tor Proxy version 2. "Download software
packages over Tor" is still enabled.
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Mask disabled Tor systemd services to prevent services starting by the Tor
master service after system reboot.
Also:
- Fix torproxy app always enabled after setup.
- Minor privileged code cleanup - removed unused functions.
Tests performed on Debian stable and testing:
- Installed and disabled the apps, rebooted the system, then applied the patch.
Ensured that apps are upgraded successfully and apps are disabled after
upgrade. Ensured that tor@default, tor@plinth and tor@fbxlocal services are
masked and not running.
- After 1)enabling and 2)disabling both apps and 3)rebooting the system:
- Ensured that the tor@default service is not running and is masked.
- Ensured that tor@plinth or tor@fbxproxy service states match the states
of the app.
- Uninstalled the apps, ensured that only the tor@default service masked
state remains in the systemd.
- All the tor and torproxy tests pass.
Closes#2369, #2454.
Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Since Minetest 5.8.0, there is no longer a "default" game, so the
--gameid argument must be used to select a game (from the list at
https://content.luanti.org/packages/?type=game).
Set minetest_game as the default game for FreedomBox. In the future,
we can consider providing a list of popular game IDs, or allow a
custom game ID.
Work around for Debian bug #1090067.
Closes: #2445.
Tests:
- Install Minetest on Debian testing. The service is running. Able to
connect a client to the server.
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
- Don't show them on section pages: home, apps, system and help pages.
- Tweak the appearance so that home icon is bigger, spacing between crumbs is
larger and to use '>' as separator.
- Change the name of the help menu item to show the value in breadcrumbs.
- Change the URLs for anchors in the help page so that they don't appear as part
of the breadcrumbs.
Tests:
- Section pages: home, apps, system and help pages don't have breadcrumbs.
- Visit various pages. Breadcrumbs are shown and all the links in the
breadcrumbs work as expected.
- Mobile view looks good.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- We were using hacky logic of assuming that if a page using the URL
/plinth/sys/..., then it belongs to 'system' section based on the URL match.
This won't work when the URL does not follow this pattern for any reason.
- Instead use the breadcrumbs mechanism which uses menu items and URL names to
determine the section a page belongs to.
Tests:
- Visit page, apps page, system page, help pages, an app page in apps sections,
an app page in system section, backups -> create backup page and notice that the
correct section is highlighted.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- Use virsh command line tool to create and control VMs.
- Use virtiofs for shared folder between host and guest.
Tests:
- Create a testing container and run unit tests on it.
- Create a testing VM.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- When fsid of the btrfs filesystem is updated, grub needs to updated too.
Otherwise, the image can't be booted into using a virtual machine.
- When fsid of the btrfs filesystem is updated, /etc/fstab needs to updated too.
Otherwise, the root file system can't be remounted as read-write.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- In anticipation of adding support to launch VMs using the same script.
- Assume image operations will be common other backends, even when they use
systemd-nspawn.
- Drop support for systemd-nspawn (<247). Bullseye ships with systemd-container
package 247.3. Remove version specific code that is no longer needed.
- Fix issue with checking if an image has been provisioned or not.
- Attempt to setup network manager connection every time container is launched
instead only once when image is setup. This ensures that if the connection is
removed after image setup, it will re-created when container is launched.
Tests:
- Run all the basic commands of the container and ensure they are working.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
[vexch: Removed unused argument in _setup_image() and fixed one typo]
Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
Tests:
- Run 'make build install' and notice that the file
/usr/share/freedombox/modules-enabled/i2p has been removed from the system if
present.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
- If for some reason, first setup is not completed yet, wait for it to complete.
- Update eventually() method to wait for page load errors to go away.
- If first wizard is already completed, don't try to run it again.
- We can eventually remove waiting for 'setup thread finished' in container
script. But not there yet.
Tests:
- Run transmission tests on a freshly created container.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
Closes: #1528.
Closes: #2041.
Closes: #2438.
- In Bullseye and Bookworm the app is not available.
- i2pd (written is C++) is available in Debian, but it is not a drop-in
replacement for i2p. First, it is only a client. Then has a differently
philosophy of not integrating apps inside it and let outside apps connect to it.
If i2pd is ever added to FreedomBox, it has to be added as a new app with no
possibility of migration from an unlikely old setups.
- Updated wiki pages to remove references to I2P.
Tests:
- Looked for all string references to 'i2p'.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- These tools are not strictly needed for FreedomBox operation in anyway.
- Slightly Reduce the size of the built images.
- Some of these tools are outdated or not typically used on a modern GNU/Linux
system and make FreedomBox seem less shiny.
- Originally thought of splitting them into a separate metapackage but it does
not seem worth it.
- killall from psmisc is used in the Makefile, it is kept for now.
- FreedomBox already has many dependency and so it is now important to start
paying attention to unnecessary ones.
Tests:
- For each binary executable provided in each of the packages, verify that it
not being used in our code anywhere.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- This is needed to run code quality check in the GitLab CI pipeline. Not sure
how it work before this.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- We don't support Debian Bullseye or older in latest versions of FreedomBox. We
can drop any minimum version specifications that are only relevant on those
release.
Tests:
- Potential issues with tomli/coverage will be caught during autopkgtests.
- For version specifications, it has been verified that for each of the
packages, version available in Bookworm is newer than the minimum version
specification.
- freedombox-setup and plinth packages don't exist on Bookworm or newer. We
don't support upgrade from older version with the latest code.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Closes: Debian bug #1088760.
- OpenSSL.crypto.sign has been deprecated and in the current version of
python3-openssl in Debian testing, it has been dropped. The recommended
alternative is cryptography.hazmat.primitives. So, use this instead.
- The entire OpenSSL.crypto module is planned to be deprecated in the future.
So, stop using it entirely by using cryptography.hazmat.primitives.
- sso app does not use openssl anymore, so drop dependency on it. Other apps
such as Let's Encrypt do depend on it and but they have their own dependency
declared. The freedombox package on the overall retains on 'openssl' package.
- We are not using the python OpenSSL module anywhere else, so drop dependency
on it.
- Use pathlib to simplify some code.
- Ensure proper permissions on private and public keys as they are being written
to.
Tests:
- Freshly setup container and ensure that first run succeeds. Permission on the
public/private key files and the parent directly are correct. Users are able
login to FreedomBox. SSO works when accessing apps such as transmission.
- Without patches, setup freedombox container. Apply patches. Permission for
keys directory is updated but keys are not overwritten. Login to FreedomBox
works. SSO works when accessing apps such as transmission.
- Run code to perform signatures using old code and ensure that newer code
generates bit-identical signatures.
- Running ./run --list-dependencies show 'openssl' and python3-cryptography.
- Running unit tests works.
- Building debian package works.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
- OpenVPN app uses openssl command line. Even though easy-rsa has dependency on
openssl, declare this explicitly.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
- Let Encrypt app uses openssl to determine the expiry date of a certificate.
So, declare and explicit dependency on it.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
- Use various action utilities to simplify daemon management.
- Instead of writing systemd service file to /etc ship an override file in
/usr/lib/systemd/system/*.d/. deluged and deluge-web both have systemd unit file
shipped. They are very close to what we want from them. Drop the old service file.
- Don't write /etc/default/deluged, it is not used in the systemd unit file.
- App's setup version has not been incremented as it has already been
incremented for the next release.
Tests:
- Fresh install of the app works in testing container. Functional tests work as
expected.
- /var/lib/deluged/config/web.conf is created when deluge-web is started
confirming that the correct configuration path is being used. Also app works on
/deluge web path.
- Old systemd unit file is removed when the setup is run when it is present to
due to deluge installation attempt previously.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- This could be used when the daemon can't be running while configuration is
being updated.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- Drop unnecessary code. Bootstrap does not style a:hover or table roes like
before.
- Use default table color variables from Bootstrap to work well with dark mode.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- When an item needs to be scrolled into view, the slow scrolling leads to an
early click causing the click to happen on an element that is not in view. Fix
this by disabling smooth scrolling in browser options.
-
https://salsa.debian.org/freedombox-team/freedombox/-/merge_requests/2576#note_558614
- https://github.com/SeleniumHQ/selenium/issues/11136#issuecomment-1370803713
Tests:
- Run functional tests on wordpress app.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
[vexch: Move importing from selenium into function to prevent unit tests depend
on selenium]
Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- When notifications badge is present in navigation bar, that could be confused
for a diagnostics failure. Make the diagnostics failure selector more specific
to avoid this.
- This was caused because of removing .badge-warning/error classes in favor of
.text-bg-warning/danger classes.
Tests:
- Enable ejabberd app and use 'systemctl stop ejabberd.service'. Run system-wide
diagnostics to see a notification with error it and error badge on the
notification icon. Then run functional tests on transmission app which includes
diagnostic tests.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- During the placement computation for the drop down menu, the height of the
dropdown-menu is very high and that leads to it getting placed at the top of the
page instead of the below the search element.
- To avoid the problem, cap the height of the dropdown. Somehow, the original
calculation for the height using CSS calc() does not seem to working as
expected.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- Custom CSS variables were declared with Bootstrap 4 since it did not use CSS
variables itself. In Boostrap 5, CSS variables are available. Use them to
eliminate custom color definitions. This means that when Bootstrap colors are
changed, custom colored elements will not look different.
- Use color utilities from Bootstratp instead of .processing, .warning, and
.normal.
- Collect more repeated colors into variables. This will make themeing easier.
- Using Bootstrap variables also makes implement dark mode easier.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- .nav-link classes are meant to be used in navbars and tab navigations. Don't
use them incorrectly in .card to avoid potential breakages and readability.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- This navigation item in the main header is only when Javascript is blocked.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- Notifications dropdown is shown briefly before page load. After the page load,
it disappears. This is quite annoying and happens due to the following reason.
- We add .no-js class to <html> tag and later remove using Javascript.
- We load most of our Javascirpt using 'defer' attribute leading display of
layout of content before Javascript is loaded.
- We also wait for DOMContentLoaded event to fire before removing the .no-js
class on <html> element.
- Solve the problem by adding special class to notifications dropdown to ensure
that it is not shown even when Javascript is not available.
- There might be a better fix to the problem.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- In mobile view, when the burger menu is clicked on, the menu is expanded and
options are shown. In those options, notifications icon is shown while the menu
is expanding but not when it is fully expanded. To fix this, hide it while
expanding too.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- In Bootstrap 5, dropdown button and dropdown menu not being siblings does not
work like it did in Bootstrap 4.
- Use collapse component instead of dropdown. Collapse component does not have
the same limitations. Apply some of the styling from dropdown-menu to restore
previous appearance.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- Workaround Debian bug #1087969. popper.js 2.x is needed for Bootstrap 5,
however, the current version on in Debian is 1.x. Implement a Popper 2.x method
that Bootstrap 5 is expecting and translate the call into Popper 1.x.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- Drop menu_link and menu_link_active classes and use the bootstrap's default
classes.
- Override values for bootstrap variables instead of overriding the styles
themselves.
Tests:
- Test that navbar shows same colors as before in mobile view and desktop view.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- Since django-bootstrap-form still generates styling for Bootstrap 3, we need
to adapt styling for Bootstrap 5 for it.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- In Bootstrap 5, .table-responsive does not seem to set 'width: 100%;'. This
leads to tables getting laid out between the disk name and disk free progress
bar since they are both floating elements. Fix this by using flex layout
instead.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- The new styling has much higher contrast compared to older styling.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- Tags have important text that is too small and could cause problems with users
with limited vision. Make them regular buttons. Make the buttons shorter and
rounder to resemble previous styling.
- Drop underlining of text in the process.
- In code, don't call them 'badges' anymore.
Tests:
- Run functional tests for tags.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- Bootstrap 5 underlines all links by default. Allow this change without
reverting as this is likely done to improve accessibility.
- In Networks diagram and firewall page, provide exception and remove the
underlining.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- Bootstrap 5, unlike Bootstrap 4 overrides button styling when hovered on and
disabled. Provide the values for these overrides using CSS variables.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- Styling for form-group has been removed in Bootstrap 5.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- Wrap each app's results in a <section>. Style section to maintain gap with
previous sections.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- A 'row' class is more suitable when we want to use the Bootstrap's 'Grid'
system. Bootstrap 5 sets 'width: 100%' on all children of a .row. So, use a
simpler 'display: flex' instead.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- So much spacing is not required as we have remove the background and borders.
- This is similar in approach to Bootstrap 4/5 which does not provide top
margins for heading elements and instead provides them only when they are not
the first element.
- Increase the margin between the end of a section and beginning of the next
heading.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- <div> is not allowed inside a <p> tag. Browsers will close and reopen <p> if
one tries to place a <div> inside a <p>. Avoid this.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- Also place the body content in <p> for improved semantics and suggested by
Bootstrap.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- Without the change, the exception information formatted in <pre> overflows the
alert's boundaries and make a long line. With the change, it now sows a
horizontal scrollbar instead.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- Same color as in Bootstrap 4 but removed in Bootstrap 5.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- This allows for system page to show 4 items in a row instead of 3.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- Ensure that .sr-only is replaced with newer classes.
- Ensure that icons are present for all alerts.
- Use flex-box for display of icons on the left center of the alert.
- .close has been renamed to .btn-close.
- × is no longer required for close buttons.
Tests:
- Visually verify all the changes by triggering them with code changes.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- We no longer print any passwords in the logs. Remove the wording in the notice
that indicates that we do.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- When apps are available only on 'internal' zone, a warning message is shown on
the app's page. This is a routine warning that requires no action from the user.
It is quite annoying to see it on a page like Samba where it is even implied.
Hence reduce the severity of the alert to 'info' from 'warning'.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- The form does not have DNS-over-TLS field and trying to set initial value for
it fails.
Tests:
- Load the PPPoE creation form. Without the patch, it fails with an exception.
With the patch it succeeds.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- Needed for many inline SVG images included by Bootstrap 5 using data: URLs.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- Keep the badge-{severity} classes as they are meant for convenience of mapping
severity to style.
- Match bootstrap colors to maintain consistency and contrast.
Tests:
- Visually confirm that all the changes effective.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- Check for availability of access_point.strength before using
access_point.strength.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
Closes: #2322.
On Debian stable, mark deluge app as not available because deluge-web is not
working in this distribution.
- Default deluged configuration directory location changed. I didn't do
migration from the old location because deluge app hasn't been working on
Debian stable.
- Make deluge-web systemd service start after deluged service to prevent
Connection Manager popup in deluge-web after system reboot.
Tests performed:
- On Debian stable:
- Deluge app is not installable from the app page.
- All functional tests are skipped.
- On Debian testing:
- All tests pass.
- After reboot, deluge-web service started after deluge service and there
is no Connection Manager popup in deluge web UI.
- Changing torrent download directory works.
Signed-off-by: Veiko Aasa <veiko17@disroot.org>
[sunil: Add type signature to an overridden method]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Fixes an issue where after clicking an app install button (that disables the
button), the app uninstall test is skipped because "App not available in
distribution".
Wait until the app install submit button is not present on the page after
clicking the install button.
Test performed:
- Increased sleep time to 10s in SetupView. The sharing app uninstall
functional test pass.
Signed-off-by: Veiko Aasa <veiko17@disroot.org>
[sunil: Use wait_for_page_update() instead of eventually]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Fixes an issue where app tests teardown fails if app installation fails
or app is not available for distribution.
Tests:
- On Debian Bookworm, all miniflux functional tests are skipped and
there are no errors.
- After running gitweb metadata functional test, the app is disabled.
Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
- Don't include the file if it does not exist to avoid a 404 error every time a
page it loaded.
- Load the file from a know path under the already known custom static path.
Tests:
- When the user.css file is created, it added to the web page. It is prioritized
over the main.css with CSS cascading rules.
- When the user.css file does not exist on the filesystem, it is not added to
the web page.
- When custom static directory (/var/www/plint) does not exist on the
filesystem, a debug log message is printed that this directory is not served.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Overall, this is something we can try out.
- This looks better in some cases
- Default large list of disabled apps
- Home page with very few icons
- Help index page /plinth/help
- Mobile views
- This looks somewhat worse in some cases
- Last row of a large list of apps, esp. when the number apps left is even and
the number of apps in the previous row is not (similarly with odd number of
apps).
- Mismatch between enabled/disabled app section.
Thanks to @Ged296123 and @fefekrzr for suggesting the change.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- So that the page appearance can be easily customized in CSS.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Fixes: #2468.
- Two browser tabs could be loaded with the interface and the same notification
could be dismissed twice. When dismissing the notification for the second time,
we currently throw a 404 error. Instead silently ignore the error.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- On a page without tags, tags.js still loads and initializes. When a tag input
search bar does not exist on the page, this leads to a harmless exception
getting printed on the browser console.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
Tests:
- Run diagnostics for nextcloud and notice that there is not check to reach
docker.com.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Should fix issues related to rate limiting on docker.io and improve privacy
for our users.
Tests:
- Install nextcloud, install succeeds. 'podman image list' shows that image is
from registry.freedombox.org.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Drop the box shadow around a card item. Applies to home, apps, system, and
help pages.
- Replace the box shadow on hover with gray background. This gives the card a
much flatter look.
- Drop the top and bottom padding for app title as this is no longer necessary
as the white space around the icon/text is not overwhelming.
- Add top padding for app titles to make them level with icon tops.
- Drop the margin around the cards as it is not needed anymore. This completely
removes non-clickable area between the cards (which is unnecessary).
- Increase the padding to compensate for the reduction in the total gap
between the cards.
- In system page, increase in top margin for the section title is needed to
compensate for the loss of bottom margin for cards.
- In system page, increase in the total width of the card is necessary to make
the total row size the size of the container.
Tests:
- In apps and system pages, gap between the section title and cards in the
previous row is sufficient.
- In system page, 4 cards fit exactly in each row given the screen is large
enough.
- In apps page, app titles margins appear pleasant.
- In system page, the app titles align with icon tops.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- When the box shadows are dropped, the cards overlay on those backgrounds is
not pleasant.
Tests:
- MediaWiki functional tests pass.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- When a link on 'Nearby Wi-Fi Networks' page is clicked, a new Wi-Fi connection
page is shown. In this form, the DNS-over-TLS and IPv6 method radio buttons are
not pre-selected with default value. Fix this by setting default values for
them.
Tests:
- On a system with Wi-Fi device, click on 'Nearby Wi-Fi Networks', click on a
Wi-Fi network and go to new Wi-Fi connection creation page. Notice that values
for DNS-over-TLS and IPv6 connection method are filled in. Simply clicking
'Submit' creates the connection.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
Fixes: #1725.
- Show multiple Wi-Fi devices in separate tables so that users can pick them
understanding what they are. Also avoids some confusion related to why APs are
duplicated.
- Request scanning if the last scan time was long ago.
- Show the last scanned time.
- Refresh page in 10 seconds if scan has been requested so that the results of
scan can be shown without user explicitly refreshing the page. Show spinner when
scan has been requested and we are awaiting results.
- Refresh page every 60 seconds in other cases.
- When an SSID can't be decoded into a string, don't show it.
- Don't show hidden networks with no SSID set.
- Improve the styling for signal strength.
- Show a message when no Wi-Fi devices are present.
- Show a message when no Wi-Fi networks are found for a device.
Tests:
- Test on a machine with Wi-Fi device available.
- When page is loaded is for the first time, spinner is shown and refresh
happens in 10 seconds. After refresh if the scan has not completed, again,
spinner is shown and page is reloaded in 10 seconds. Otherwise, spinner is not
shown and page is reloaded in 60 seconds.
- Hidden networks are not shown.
- On a machine with no Wi-Fi devices, 'No Wi-Fi device detected.' message is
shown.
- Clicking on a network takes us to new Wi-Fi network connection page with
'connection name', 'network interface' and SSID filled in correctly.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
- It appears from the functional tests run in Gitlab CI pipelines that visit()
is returning before the page has loaded fully. In the screenshots for help app
test failures, we see gitweb web page.
- To fix this, wait for a proper page load in visit().
- Cleanup syntax, rename the non-existent search class, and mechanism for
matching expected URLs.
- Also refactor waiting for uninstall page in uninstall() method. Using the
wait_for_page_update() method as context processor is more accurate.
Tests:
- Run all functional tests and ensure that there are no errors in visit()
method.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
Adds single quotes inside single-quoted string, for example bash command
`echo ' '"'"'test'"'"' '` prints ` 'test' `.
Also:
- Remove wrong comment in the same function.
- Fix quote usages in container script.
Tested that running bepasty tests with keyword expression filter
`-k "enable_disable or uninstall` works.
Signed-off-by: Veiko Aasa <veiko17@disroot.org>
[sunil: Use shlex.quote() for quoting]
[sunil: Pipe the script 'ssh sudo bash' instead of sending argument]
[sunil: enable color always for pytest]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
- Currently, after every test we disable the app and re-enable for the next
test. The original purpose of this disabling is to make sure that an app is
disabled after test on it. So, change the scope of disabling the app to ensure
that it is only disabled once after all the tests on the app. This should
improve the run time of the tests.
Tests:
- Run functional tests on bepasty app.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
Tests:
- With a locale that has translation for the 'FreedomBox' source string, check
the following locations have translated string for 'FreedomBox':
- Default backup repository label.
- Firewall app description.
- Network forms for: topology, internet connection type, and router
configuration.
- RSS-Bridge app description.
- TiddlyWiki app description.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- Many functional test failures in the Gitlab CI pipeline show that uninstall
form was attempted to submitted while still in the app page. After clicking on
the uninstall menu item, we are not waiting for the page to load fully. Fix this
by waiting for page load. This change is expected to fix most of the functional
tests failures in the pipeline.
Tests:
- Ran bepasty functional tests.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- Currently, strength and channel information is not shown for Wi-Fi connections
in connection information page. This is a regression related to handling SSID as
a binary string. Fix this.
- Also fix the styling to not make signal strength too prominent.
Tests:
- On a machine with Wi-Fi network device. Viewing the Wi-Fi connection
information does not signal strength and channel without patch but show with the
patch.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
In the list of Wi-Fi networks shown after scanning, the SSID shows as "b'myap'"
instead of "myap". Fix this.
Tests:
- On a machine with Wi-Fi network device, scan of Wi-Fi networks. Without the
patch, incorrect SSID labels show up. With patch, SSID is correct.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
Fixes: #2447.
- When editing an existing wireless connection, SSID field shows as "b'myap'"
instead of "myap". Fix this.
Tests:
- On a machine with a wireless connection, edit the connection. Without the
patch, form show SSID incorrectly. With the patch, it shows the correct value.
- Unit tests in test_network.py pass when run as root.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
Since the about page is now public, adding a link to it in the navbar allows the
users to easily discover it and find out about FreedomBox.
Tests:
- In mobile view, the hamburger menu show the icon and text. Link works.
- In desktop mode, only the icon is visible. Link works.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Make a separate image for 'FreedomBox Powered'.
- Link to the now publicly available about page.
Tests:
- Clicking on the new 'Powered' image leads to about page which is available to
logged in and logged out users.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Fixes: #2464.
- This page will act as replacement for the footer links in the home page.
- Remove link to FreedomBox Foundation and add link to Weblate project. We
already have a donate link to the foundation website.
Tests:
- About page is shown as expected. Old 'Learn more' button is no more. So is the
last paragraph.
- Styling is as expected. All the section have equal width.
- All links work.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- This page will replace the rather large footer in the front page.
Tests:
- Log out. Visit the help about page. It is available without redirection to
login page. Version related alert is not shown.
- Log in. Visit the help about page. It is available. Version related alert is
shown.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- The container border is, strictly speaking, no longer required as the background and
content container don't have different styles.
- This makes the mobile and desktop interfaces a lot more similar.
- Don't change any margins and padding for the content container.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Update the mediawiki functional tests which were using this image.
- Slightly increase the darkness of the shadow around the cards to compensate
for the loss of the contrast with the noise background.
Tests:
- Re-run mediawiki functional tests.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Fixes: #2418.
- This resolves a issue that icons being misaligned when the name of the app
flows into multiple lines. The increase in size of the card is not very
bothering as long as icons are not still aligning. If the noise background is
removed (to be proposed later), the increased size of the icon is even less
bothering.
- The other options would have been to reflect the increased size of the tile to
neighboring apps in that row (does not seem possible with CSS) or ellipsize the
title when it overflows.
- Redo all the spacing in spacing inside the card to better match the new
layout. The height of the card reduces slightly due this change, which looks
better and closer to other icons grids in other UIs.
Tests:
- In index, apps, and help:index pages, the title has change location. Spacings
are as expected and appealing. System page is unaffected.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Making most of text that is read in a page bold is useless. Emphasis should
instead be used for some text that should stand out of the rest of the text.
- The need to make the text bold goes away if the text color is not such a
lighter shade of gray. Reset this to the regular text color.
Tests:
- Observe changes in home, apps, system, and help index pages.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Fixes: #2179.
Tests:
- Set language to Magyar (hu). Test that items in the system page are large enough to
accommodate most names/descriptions.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Increase the width of the containers that hold home cards, app cards, system
cards, and help cards. This helps in:
- Showing system page layout better with wider cards for each item.
- Showing more apps in the app page. This does not decrease the readability in
the same way that increasing the size of the paragraph does beyond a certain
point.
- Also increase the width of the navbar to make it appear consistent.
- Other containers such as content container remain at the same width.
Increasing this width would make a reading a paragraph harder.
- Behavior is mobile layouts is unchanged.
Tests:
- Test that apps, system, home and help views show cards in a wider layout.
- Success/error messages shown in apps, system, home and help views are narrow
and are not effected.
- In home and help:index pages (reached when clicking help icon without JS), the
icons are wide but the content is narrow.
- Individual app pages, confirmation pages, and help pages remain at the older
width.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Fixes: #2364
Tests:
- Set language to English. Go to backups -> create. List of apps is sorted
alphabetically and case is ignored. Take a backup.
- Click on restore for the new backup. The list of apps is again sorted
alphabetically and case is ignored.
- Click on schedules. List of apps is sorted and alphabetically and case is
ignored.
- Repeat tests with Spanish locale.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
Fixes: #2115.
Tests:
- Visit the backups upload page. Notice that the new help text is as expected.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
This helps various clients to use MAM.
Fixes: #2338
Tests:
- Functional tests for ejabberd pass.
- Install ejabberd and enable MAM. Check that default is set to always
in the configuration.
- Without this change, install ejabberd and enable MAM. Then restart
plinth with this change. The configuration is changed from never to
always. After several minutes, ejabberd is running again.
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Tests performed in stable and testing containers:
- All the users module tests pass.
Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Adds ability to run local commands with functional tests.
By default, commands are run locally. It is possible to set remote
host connection parameters from pytest command line, for example:
`--hosts 'fbx@IP' --ssh-identity-file '.container/ssh/id_ed25519'`
For more options, see documentation
https://testinfra.readthedocs.io/en/latest/backends.html#ssh.
Includes a fixture `host_sudo` to run commands as sudo.
Relates to
https://salsa.debian.org/freedombox-team/freedombox/-/issues/2451#note_530752.
Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
On user deletion, user's home folder is also deleted. Admins have an
option to avoid deleting user's home by inactivating the user instead.
This commit also removes user deletion buttons from the user's list
page and adds this option to the user edit page. The user's edit form
asks for a confirmation if the user deletion is requested. This change
also means that the confirmation password is now required to delete a user.
Also:
- Add a simple username validation to the privileged actions.
- Functional tests: Create a fixture to login as an admin before every test.
- Functional tests: Add a test to check that SSH passwordless login works
after user is renamed to validate correct SSH related path permissions.
- Privileged tests: Add `test_` prefix to the generated random string which
makes easier to check and cleanup created home folders.
- Minor quote fixes.
Tests performed in stable and testing containers:
- Run all the users module tests twice, no failures in tests.
- When user is the last admin, both "Active" and "Delete user"
checkboxes are disabled.
Closes#2451.
[sunil]
- Refactor the JS code:
- Ensure that DOM elements are lookup after DOM content is loaded.
- Styling changes. Reduce the number of globals, name the global names
somewhat more unique.
- Click the button instead of submitting the form to disable the button.
- Template changes:
- Add a body for the confirmation dialog to talk about disabling the user and
deleting the home directory.
- Change the label of the confirm button to make it more
explicit (recommendation from many UX guides).
- Styling.
- Functional tests:
- Fix visibility checking of an element to use the correct splinter API.
- Simplify clicking the edit user link.
- Minor update to form checkbox help text.
Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
- Currently, we are taking a error string and formatting it before it can be
looked up for translation. This causes the lookups to always fail.
- Don't format the error messages and send them as is. Let the
Operation.translate_message and Notification take care of translation.
Formatting will be them after translation. Set the formatting keys as they need
so that exception string is inserted into the message
Tests:
- Set language to Spanish. Through code changes raise an exception in
bepasty.privileged.setup(). Try to install bepasty app. Setup will fail and
error message will shown. The error message will be localized and formatted with
the patch. This is true in the app error message and in the notification.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- Change locale to Spanish. Raise an exception in bepasty.privileged.setup().
Try to install bepasty. Without the patch, error is not translated. With the
patch, it is.
- Successful installation of an app shows translated success message.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- When an app install fails, there is a small chance that the failure message is
show in the area where operation spinner is shown. If that happens,
operation.translated_message is accessed from the HTML template. This throws an
exception if the error message that made contains excepted formatting keys.
Example:
"{include_once("/var/www/html/config/config.php");print($CONFIG["dbpassword"] ??
""); }".
- Also change the formatting key {exception_message} to {exception} as this
would help in translation when Notification is shown which has {exception} as
data dictionary value.
Tests:
- In the operation update message such as 'Installing app', insert unexpected
formatting strings. 'Installing app {foo}'. Notice the error without the patch
and how the patch fixes it.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Fixes: #2462.
- When there are field retrievals and subscript based retrievals in the format
string, exceptions are raised. Handle these safely.
- This eliminates are error such as "Notification missing required key during
translation: 'str' object has no attribute 'php");print($CONFIG'". when the
notification message contains
"{include_once("/var/www/html/config/config.php");print($CONFIG["dbpassword"] ??
""); }"
Tests:
- Updated unit tests pass.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Fixes: #2463.
- When FreedomBox service is run via systemd and if the unit has PrivateTmp=yes
as was recently introduced, then 'podman exec --user www-data' fails with error
'Error: unable to find user www-data: no matching entries in passwd file'.
- The problem seems isolated to this specific instance and does not seem to
effect the container start up (which happens via systemd).
Tests:
- Without the patch, start FreedomBox service via systemd and install Nextcloud.
It fails.
- With the patch, install succeeds and functional tests for Nextcloud succeed.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Makes it easy to investigate functional test failures as the test are run.
- This will help functional tests that are timing out before failure stack
traces can be shown.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
- Sort tags in the dropdown using user's locale.
- Fix localized tags being used for filtering. This happens when the application
freshly starts and list_tags() is called using user's non-default locale.
- Avoid using element.textContent in JS. Instead use datasets.
- Add functional test for checking localization issues.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
- Drop changing the history as even without it, back/forward work just fine.
- Drop debouncing as there was a bug that prevented it from working. Since we
have a small number of tags, running the operations immediately seems to work
fine.
- Update incorrect docstring.
- Flatten and isolate the event handlers code further for readability.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
- Use CSS based styling instead of styling based on bootstrap classes.
- Add a placeholder for the input box to easily locate it and convey what it
does.
- Drop dead code for '.tag-input .tag'.
- Drop some repeated data- attributes by using DOM navigation.
- Drop redundant styling.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
- We are using submenu.url to check for specific URLs and then highlight a menu
item. This is somewhat incorrect due to string search and not generic enough. We
have another mechanism 'active_menu_urls' to perform this. Improve and use this
instead.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
- Don't use title casing, instead use simple capitalization.
- Add some tags.
- Drop outdated tags like 'VoIP', 'IM' while emphasizing 'Audio chat', 'Video
chat', 'Encrypted messaging' instead.
- Try to clarify server vs. web client with tags.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
- Add tags to Info component of apps. Use only English tags for all operations.
Localized tags are used for presentation to the user only. Add tags to all the
apps. Conventions (English):
1. Tags describing use cases should be in kebab case.
2. Protocols in tag names should be in their canonical format.
3. Tags needn't be 100% technically correct. This can get in the way of
comparing apps using a tag. Words that describe use cases that users can
easily understand should be preferred over being pedantic.
4. Tags should be short, ideally not more than 2 words. Avoid conjunctions
like "and", "or" in tags.
5. Avoid redundant words like "server", or "web-clients". Most apps on
FreedomBox are either servers or web clients.
6. Keep your nouns singular in tags.
- Use query
params to filter the Apps page by tags. When all tags are removed, redirect to /apps.
- Add UI elements to add and remove tag filters in the Apps page. Make the UI
similar to GitLab issue tags. Since there are 40 apps, there will be at least 40
tags. Selecting a tag from a dropdown will be difficult on mobile devices. A
fuzzy search is useful to find tags to add to the filter. Allow user to find the
best match for the search term and highlight it visually. The user can then
press Enter to select the highlighted tag. Make tag search case-insensitive.
Make the dropdown menu scrollable with a fixed size. User input is debounced by
300 ms during search.
- tests: Add missing mock in test_module_loader.py
- Add functional tests
[sunil]
- 'list' can be used instead of 'List' for typing in recent Python versions.
- Reserve tripe-quoted strings for docstrings.
- Undo some changes in module initialization, use module_name for logging
errors.
- isort and yapf changes.
- Encode parameters before adding them to the URL.
Tests:
- Tested the functionality of filtering by tag with one tag and two tags.
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
- Useful for setting up a new gitlab runner that helps in running functional
tests.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
Fixes an issue where SSH server is available but users can't login because LDAP
user services are not yet started.
Tests performed:
- Installed new ssh systemd override conf, rebooted, ensured that the sshd
service starts after the nslcd service.
Relates to #2452.
Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
- When a library is added to using the FreedomBox interface and immediately
Calibre interface is loaded, the library does not immediately get listed in the
list of libraries. We will have to fresh the page to see the new library. Do
this.
Tests:
- Run functional tests for calibre on Testing distribution multiple times
without failures.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- In versions of WordPress in Debian Trixie and up the editing widget is inside
of an iframe instead of as a direct child of the main document. Elements inside
these iframes can't be queried directly and one must be the 'context' of the
iframe before querying elements inside.
- Fix the failures by using the splinter API to query inside iframe.
Tests:
- Run functional tests on WordPress in stable and testing containers twice.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
Syncthing from Debian testing uses new config directory if the
legacy configuration folder doesn't exist.
Tests performed in stable and testing containers:
- All syncthing tests pass when running twice.
Signed-off-by: Veiko Aasa <veiko17@disroot.org>
- Since there is no way to reach the next steps page from the interface, provide
a notification for it. Until the notification is dismissed, the user can reach
this page with the notification.
Tests:
- On testing and stable containers, remove the sqlite file start the service.
Complete the first setup wizard. After reaching the 'setup complete' page,
notice that there is a notification for next steps to take. Title, icon, message
and button text and styling are as expected.
- Clicking on 'See next steps' takes us to next steps page.
- Clicking on dismiss removes the notification.
- Restarting the service does not bring back the notification.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- Currently, after the user arrives the 'next steps' page after completing the
first setup, trying to refresh the page takes us away from the page to the index
page.
- Since this page lists a lot of steps, user can't be expected to memorize the
contents of the page and perform them one after the another. Opening the links
in popups instead of navigating away from page helps but not full solve the
problem.
- If the page is a regular page and not part of the first step wizard, this page
is a simple Django page. It can be refreshed. Back button can be used to view
the page after navigating from it again.
Tests:
- On stable and testing containers, remove the sqlite3 file and start the
service. This will trigger the first setup wizard. As a last step of the wizard,
the 'setup complete! Next steps:' page is shown.
- Refreshing the page works.
- Navigating away from the page and using the back button to return to it works.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- This is needed as we don't have software updates step during first setup
anymore.
Tests:
- Trigger first setup by removing /var/lib/plinth/plinth.sqlite3 and re-running
the service. After completing the setup, a notification is shown with correct
severity, title, app icon, message and options. Dismiss remove the
notifications. 'Go to Software Updates' takes us to updates app.
- After dismissing the notification, re-running the service does not show
notification again.
- Increasing the app version number also does not show notification again.
- Re-running the app setup does not show notification again.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- We have not yet implemented the main reason they exist. To guide users to
establish reachability with Tor hidden services, Pagekite, Dynamic DNS, etc.
- We now have a 'Next steps' page that talks about configuring network
connections. The networks page linked from here has these steps prominently
listed.
- In the future we will implement a wizard for reachability and these steps will
still be used. However, they don't have to part of first setup. They can add
them as notification and as part of next steps page.
- It is good to have a simplified first setup wizard. It is seldom tested
properly.
Tests:
- Run the first setup wizard by removing /var/lib/plinth/plinth.sqlite3 and
running the service. Notice that the software update step is not shown and
wizard completes successfully.
[vexch: Minor quote fix in functional tests]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- Remove the first setup wizard step to run security upgrades. At the time of
its introduction, it was felt that this is very important. Some things have
changed since then:
- We have mechanism for queuing package operations. Users can now trigger
software updates and start installing apps before that is completed. Or vice
versa. Earlier if the software updates were running, app install used to fail
with an error.
- There were no notifications. Since then we have added 'first setup'
notification for important topics such as Privacy. This step can be replaced
with a notification.
- Automatic diagnostics and a diagnostic to notify of updated packages also
helps bring attention to software updates if they are missed during first
setup.
- A proposed change will re-introduce an advice to run updates in the 'Next
steps' wizard step along with a button trigger it right there.
- The new notification for software updates will bring more attention to running
updates as part of first setup.
- It would be nice not be stuck in the first setup wizard for a long period and
make it look simple. It improves the fun factor of setting up FreedomBox.
- It would present an opportunity to utilize the parallel installation of
apps/updates to the full extent. Although this can also be done by skipping the
progress step after updates are run.
- First wizard steps tend to get less testing.
Tests:
- Run the first setup wizard by removing /var/lib/plinth/plinth.sqlite3 and
running the service. Notice that the software update step is not shown and
wizard completes successfully.
- On stable container, backports step is shown as expected (if not already
enabled).
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
Fix the following:
- In mobile layout, the logout button has incorrect text color and when
hovering, wrong background color.
- In mobile layout, when user menu is expanded, there is no spacing between the
end of the menu and the border for the expanded menu items.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
Only item in the navbar present during first boot in mobile layout is the
toggler. Set its height such that it maintains the height of the entire navbar.
Tests:
- After the account setup screen, switch to mobile layout. Notice that the
navbar is no longer tiny but the usual height.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
Fixes#2456.
- Replace the first setup wait message with a spinner. This is sufficient to let
the user know that they have to wait.
- The message does not convey anything more.
Tests:
- Remove /var/lib/plinth/plinth.sqlite3 and start the service. After the service
starts listening visit the web interface and notice that the first setup screen
shows up. The size and position of the spinner are as expected.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- Earlier the main logo image was not responsive. In a mobile layout, it would
overflow the page. Fix this by using correct CSS classes.
- Also move the message to bottom of the log (to be later replaced by the a
spinner).
Tests:
- Remove /var/lib/plinth/plinth.sqlite3 and start service. It will perform
first setup operations. During this time, visit web interface in mobile layout
and notice that logo is taking 100% of the width but not overflowing.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
Tests:
- Start first boot by removing /var/lib/plinth/plinth.sqlite3 and starting
service. Switch to responsive design mode and select a phone layout. Notice that
an inactive toggler appears during bootup/welcome/account first boot steps.
- With the patch, the toggler button does not appear during those steps. After
the account step, the toggler appears and is functional with help menu.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
Fixes: #888.
- Suggest all the steps that a typical user should likely take.
- Custom styling to make the page look good.
- Open the links in new windows as this page can't be reached again.
- Add a button for software updates as this can be done easily and the most
important step.
Tests:
- Trigger first setup by removing plinth.sqlite3. Notice the improved setup
complete page. Text and icons are as expected. Links work and open in a new
window. Clicking on 'Update now' button opens a page to software updates with
manual upgrade triggered.
- Mobile view looks good.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- Without this change when opening popups, Firefox throws the error 'Blocked
Page' under certain conditions.
- Complete a comment that was seemingly left unfinished.
Tests:
- With the changes installed with 'make build install', opening popups with
<a target="_blank"></a> works without 'Blocked page' error.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- Before rerunning setup operations.
Tests:
- Install version 28-fpm (one version older than the current stable). Then
change it stable-fpm and increment the nextcloud app version at the same time.
Start the service. Notice that nextcloud app setup is rerun, container will be
updated by podman to newer version. Setup completes successfully with the patch
but fails arbitrarily otherwise as the setup process does not wait for the
upgrade to complete and tries to prematurely re-run setup operations.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Fixes: #2433.
Tests:
- Without the patches, as described in the bug, create an installation that is
facing the problem. Ensure that 'podman exec --user www-data
nextcloud-freedombox /var/www/html/occ config:system:get overwrite.cli.url'
shows an empty value.
- Apply patches, nextcloud app is updated and configuration value is set to
'http://localhost/nextlcoud' by running 'podman exec --user www-data
nextcloud-freedombox /var/www/html/occ config:system:get overwrite.cli.url'.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- When freedombox is installed on a Debian system as a package, the folder
/var/lib/freedombox does not exist. When the service is run and systemd-resolved
is attempted to be installed, we try to hold the freedombox package. We also set
a flag to indicate this in /var/lib/freedombox. Since the folder does not exist,
it fails. Presumably this will also fail when installing any package. Fix this
by creating the parent directory.
Tests:
- On a fresh Debian system, install the freedombox package with these changes.
Wait for setup to run on names app. Install operation fails without this fix and
succeed with the fix (this only happens when names app is setup before backups
app as backups app creates /var/lib/freedombox directory).
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
Fixes: #2453
- It will be installed later.
Tests:
- Build the Debian package with all the changes and notice that it neither has
dependency on resolvconf nor on systemd-resolved.
- Version 24.18 can upgrade to this package using unattended-upgrade. For this
place the package in a folder repository and add this repository to apt
sources.list and tweak unattened-upgrades settings to accept the new repository.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- Don't schedule if the package is already installed.
Tests:
- With systemd-resolved installed and without internet connectivity start a
fresh instance (without first setup). Setup succeeds but systemd-resolved is not
installed.
- Wait in develop mode for 180 seconds. Setup for names app is re-run. Ensure
that internet connectivity is not available and systemd-package is not
installed. Setup still succeeds.
- On next run, ensure that internet connectivity is available, systemd-resolved
is installed. Setup succeeds.
- On next run, setup is not re-run for names app.
- When service is restarted, the task is not even scheduled.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- If installing systemd-resolved for the first time, set fallback DNS setting to
True irrespective of the app version.
Tests:
- Ensure that systemd-resolved is not installed. On a fresh systemd without
first setup done, run service.
- Names app setup is run and systemd-resolved is installed if internet
connection is available. Setup succeeds. Fallback DNS setting is true in privacy
app. systemd-resolved has been restarted and current DNS known to Network
Manager has been populated in it. Name resolution works.
- If Internet connection is not available, setup still succeeds but
systemd-resolved package is not installed.
- Rerun setup without internet connectivity. Setup succeeds without installing
systemd-resolved.
- Rerun setup with internet connectivity. Setup succeeds and installs
systemd-resolved. Fallback DNS setting is true in privacy app. systemd-resolved
has been restarted and current DNS known to Network Manager has been populated
in it. Name resolution works.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
Tests:
- Ensure that systemd-resolved is not installed.
- There is no warning showing that systemd-resolved daemon is not running.
- When re-running setup, systemd-resolved is not enabled.
- Diagnostic shows a warning that systemd-resolved is not installed.
- Ensure that systemd-resolved is installed.
- If daemon is not running, warning shown that it is not running.
- If daemon is running, warning is not shown.
- When re-running setup, systemd-resolved is enabled.
- Diagnostic shows that the daemon is running when running and not running when
it is not.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
Tests:
- Ensure that systemd-resolved package is not installed.
- Resolver status table is now shown.
- Instead a message is shown with button to re-run setup. Clicking the button
re-runs setup of the names app.
- Configuration form is also now shown.
- If systemd-resolved package is installed during re-run of setup, then status
table is shown.
- Message to install systemd-resolved is not shown.
- Configuration form is shown.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
Tests:
- Ensure that systemd-resolved is not installed. Run diagnostics on names app.
There should be no diagnostic related to resolving address for deb.debian.org.
- Ensure that systemd-resolved is installed. Run diagnostics on names app. There
should be diagnostic related to resolving address for deb.debian.org.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
Tests:
- Ensure that systemd-resolved is not installed. The privacy section is entirely
hidden in the connection information page.
- Ensure that systemd-resolved is installed. The privacy section is shown in the
connection information page.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
Tests:
- Ensure that systemd-resolved package is not installed. DNS-over-TLS field is
disabled.
- Submitting the form works with and without changes.
- Value of global DNS-over-TLS setting shows as 'unknown'.
- Current value of DNS-over-TLS for this connection is show in the form.
- Ensure that systemd-resolved package is installed. DNS-over-TLS field is
enabled.
- Submitting the form works with and without changes.
- Value of the global DNS-over-TLS setting shows the current value set in names
app.
- Current value of DNS-over-TLS for this connection is show in the form.
- Introduce an exception in get_resolved_configuration privileged action and
notice that value shows up as 'unknown' in the form.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
Tests:
- Ensure that systemd-resolved is not installed.
- Notice that form field for Fallback DNS servers is disabled. Form value is
unchecked (default value when initial value is not provided).
- Submitting the form works with and without changes.
- Ensure that systemd-resolved is installed.
- Notice that form field for Fallback DNS servers is not disabled. Form value
reflects the current state of fallback dns as shown in names app.
- Submitting the form works with and without changes.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
Tests performed in stable and testing containers:
- Run all the transmission tests twice - all pass.
Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
- When subprocess.call() fails and one of the arguments is a Path-like object,
the exception also contains a Path-like object. The default JSON encoder can't
handle this and will lead to failure when encoding the exception altogether
resulting in a generic exception.
Tests:
- Add an invalid .zim file to kiwix. It fails and shows a default error
exception. Without this patch, it fails.
- Functional tests for kiwix pass.
- Backups app can list archives. This is a result returned from a privileged
method.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
Tests:
- Without patch, upload an invalid zim file, 'Failed to add content'... message
is shown. The library's content directory contains that invalid file. Try to add
the file again and the message shown is 'File already exists'.
- With patch, upload an invalid zim file, 'Failed to add content'... message is
shown. The library's content directory does not contain that file. Try to add
the file again and the same message is shown.
- Functional tests for kiwix pass. Repeating just the test
test_add_invalid_zim_file works.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
Tests:
- Raise an error by editing code in create, upload, rename and delete
operations. Notice that the details error messages are shown with a drop-down.
- Upload a wiki and it works. The name is as expected.
- Upload the wiki again notice that the duplicate wiki error is shown.
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
[sunil: Use new utility for uploading]
[sunil: Better error message display in the UI]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
Tests:
- Raise an error by editing code in create, upload, rename and delete
operations. Notice that the details error messages are shown with a drop-down.
- Upload a wiki and it works. The name is as expected.
- Upload the wiki again notice that the duplicate wiki error is shown.
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
[sunil: Use new utility for uploading]
[sunil: Better error message display in the UI]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
Earlier, the uploaded ZIM file was being written to disk twice.
Manual Test
-----------
Without the changes in this commit, the English MediaWiki archive of
6.83 GB cannot be uploaded to the dev container of size 12 GB, since two
temporary files are created.
With the changes in this commit, the same file can be uploaded
successfully and accessed using Kiwix reader.
- Uploaded file has expected ownership and permissions.
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
[sunil: Handle error for uploading duplicate content.]
[sunil: Set root:root ownership on the uploaded file.]
[sunil: Use the action utility for checking that the upload file and moving it.]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
1. Set temporary directory to /var/tmp
2. Drop MemoryFileUploadHandler
Tests:
- During upload notice that file are in /var/tmp/system-private... folder
instead of /var/tmp.
- Upload a file but rename with another extension instead of moving to
destination through changes in code. Notice that the file is available in
/var/tmp/systemd-private... directory after the upload operation is completed.
Stop the service and notice that the file has been deleted. Folder is empty
after the service starts again.
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
[sunil: Add PrivateTmp=yes in plinth.service file]
[sunil: Update comments]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
Fixes an error in testing container where installing dependencies for
functional tests wants to uninstall system installed urllib3.
Also minor quotes fixes.
Note that dependencies are upgraded only in new dev environments where
geckodriver is not yet installed.
Tests performed, in both stable and testing containers:
- Run all tests, no upgrade related failures found. There were some
seemingly unrelated test failures in apps: calibre, ejabberd, deluged,
minetest, users, transmission , wordpress, zoph.
Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
- Insider a container, it is not possible to use loopback devices without
additional permissions. Skips tests that need loopback devices. This will
results in fewer errors when running './container run-tests'.
Tests:
- Run './container run-tests --pytest-args
plinth/modules/stroage/test_storage.py'. Notice that all tests are either
skipped or succeed.
- Run the tests on host machine and they all run without skipping.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
Reasons:
- Privileged action security: restoring Samba configuration from a backup file
could expose any folder in OS and allows to run any commmand as a root user.
- Samba backups aren't so useful as only app configuration is included.
Configured shares are trivial to enable without backups. Also, providing
backups could be misleading as stored user files aren't actually backupped.
Tests performed:
- All Samba functional tests pass.
- Restoring from an old backup that also includes Samba is not failing,
restoring Samba is skipped.
Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
- This was supposed to removed in MR #2309 in the commit
253540fb3d12254c920b632cc484be6a79d27229. It was overlooked.
- Version number of users app has not been incremented as it has already been
incremented in this release.
Tests:
- There is no directory /etc/security/access.conf.d.
- There are not directives in /etc/security/access.conf that are not commented
out.
- After applying the patch (assuming previously setup version is 24.20) and
manually removing the destination file, app setup for users app runs. It
succeeds. /etc/pam.d/common-account no longer contains the line 'account
required pam_access.so'.
- After the upgrade, users who are root and non-root are able to login via SSH
and Cockpit. After a reboot, users are able to login via SSH and Cockpit.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Since previous release 24.20 already has a increment to version 6, users app
version must be incremented in order for the changes related to inactive users
to take effect.
Tests:
- On applying the patches and running the service, upgrade to new app version
runs and succeeds. If there are inactive users presets, then before the setup()
privileged method is run, setup_and_sync_user_states() is run.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Disable and mask the nmb service, which is alias to the already
disabled nmbd service.
Tests performed:
- Upgrading Samba app works.
- Systemd doesn't show nmb.service in erroneous state after upgrade.
Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This restriction is also used by systemd:
0992a823a4
This is another attempt to fix#2450.
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
- Some trivial refactoring.
Tests:
- The default password policy works. Inactive users are unable to login via
console, SSH and cockpit.
- After the app is setup freshly and after it is upgraded from previous version,
the namedobject.schema has been ingested into the OpenLDAP configuration.
- Rerunning setup for users app works.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Previously, users were inactivated only in plinth users database. This change
adds ability to inactivate users in LDAP database.
Changes:
- Inactive users in plinth users database are also inactivated in LDAP
during app upgrade.
- Inactivated users can't login using LDAP password.
- Apache2 single-sign-on module now requires LDAP connection. SSO
sessions are now invalidated when users are inactivated.
- PAM/nslcd now performs authorization checks against LDAP, which means
inactivated users can't do passwordless ssh logins and running their
crontabs are blocked.
- When inactivating a user, all user's processes are killed.
Also, update LDAP diagnostics:
- Fix LDAP checks returned always passed results.
- Fix `ou=people` entry doesn't exist in LDAP.
- Add diagnostics checks for `ou=policies` and `cn=DefaultPPolicy`.
Tests performed:
- App upgrade works.
- App upgrade with previously disabled user works, user is inactivated
also in LDAP.
- App upgrade with disabled user that doesn't exists in LDAP database works.
- Increment app version again, to 7, app upgrade works second time.
- Inactivate user and test logins:
- can't login using direct LDAP (nextcloud, ejabberd, matrixsynapse)
- can't login using Apache2 LDAP module (gitweb, ikiwiki, rssbridge,
transmission)
- can't login using apache sso module (featherwiki, gitweb, rssbridge,
sharing, syncthing, tiddlywiki, transmission, wordpress).
- can't login using ssh with password or passwordless
- Inactivate user and test exsisting sessions:
- ssh, cockpit and samba sessions are killed.
- Configure crontab, configured crontab is failing to run after user
is inactivated.
- All the users app tests pass.
Notes:
- Only Apache2 SSO sessions are disabled. Apps that create their own
sessions keep working, like nextcloud, ejabberd, matrix-synapse,
ikiwiki. In the future, we could add a feature that apps can implement
their own users locking functions.
- When testing inactivated users, users and IP-s can be banned by the system,
banned IP-s/users can be viewed with commands `fail2ban-client banned` and
`pam_abl`.
- Existing sessions keep working when deleting a user or removing
a user from an access group.
- I didn't test e-mail app.
Signed-off-by: Veiko Aasa <veiko17@disroot.org>
I introduced this code quality issue when handling a merge conflict in
711c19b511f969d0dce5c36221428e8caa0e7473.
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
The latest version of miniflux can't connect to the database after a fresh
installation. This is due to incorrect ownership of /etc/miniflux/database file
which is owned by root (and correctly having the permissions 0600). After
changes in bug #1078416, miniflux no longer runs as root user and instead runs
as miniflux user. This user can't read the database file. The daemon silently
falls back to using built in defaults and fails to connect to PostgreSQL
database. This is originally caught by functional tests in FreedomBox's miniflux
integration.
Links:
1) https://bugs.debian.org/1081562
2) https://salsa.debian.org/go-team/packages/miniflux/-/merge_requests/2
Tests:
- Freshly install miniflux with the patch and the daemon is running. Ownership
for the file /etc/miniflux/database is as expected.
- Install miniflux without the patch. Daemon is not running. Apply patch and
restart service. miniflux app is updated. Daemon is running. Ownership for the
file /etc/miniflux/database is as expected.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
nscd daemon caches queries made to NSS via glibc. In our case queries to passwd
and group databases are cached. But this leads to many problems.
See: https://salsa.debian.org/freedombox-team/freedombox/-/merge_requests/2520
The bug that this MR fixes, that is, the inaccuracy of the authentication data,
is horrible and only acceptable if the caching provides very important
functionality. Already, having to purge nscd caches after modifying user
accounts is not nice.
I believe that we have encountered this bug before and blamed libpam-abl due to
the time sensitive nature of the problem.
nscd itself recommends that it should be used if NSS lookup are expensive (such
as in case of NIS, NIS+ queries according to /etc/init.d/nscd). In case of
FreedomBox, LDAP queries are unlikely to be made using network. LDAP server is
likely always local. I believe we can safely remove nscd by masking and stopping
nscd.service and unscd.service.
Tests:
- After applying the patches, users app setup is re-run. Service nscd is stopped
and masked. unscd is also masked.
- Running 'id tester' shows expected value 'uid=10001(tester) gid=100(users)
groups=100(users),10002(admin)'.
- Adding, removing, renaming a user immediately reflects in 'id <user>'.
- Adding and removing a user from groups immediately reflects in 'id <user>'.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
Don't delete overwrite.cli.url when the Nextcloud app's settings are
updated with no domain configured. Instead, set it to the default value
of http://localhost/nextcloud
We might want to consider updating existing, faulty setups.
Helps: #2433
Signed-off-by: Benedek Nagy <contact@nbenedek.me>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Fixes an issue where LDAP group membership info is not available long time
after system restart. This can happen when nscd cache is expired and name
service queries are made while nslcd is not yet started. As a result, nscd
group cache contains only local system groups and not LDAP groups. The issue
arises more likely in slow systems where slapd/nslcd startup can take minutes.
Could also depend on how long the device has been shut down before.
Tests performed:
- stop nscd service, start nslcd service, check form the logs that
nscd reload errors are ignored and nslcd service starts successfully.
- Test when nscd group cache is invalidated while nslcd is not running.
Run commands:
```
systemctl reload nscd
id tester
systemctl stop nslcd
nscd -i group
id tester
systemctl start nslcd
id tester
```
Result before patch applied.
```
uid=10001(tester) gid=100(users) groups=10002(admin),100(users)
uid=10001(tester) gid=100(users) groups=100(users)
uid=10001(tester) gid=100(users) groups=100(users)
```
Result after patch applied, tester is in the admins group at the end.
```
uid=10001(tester) gid=100(users) groups=10002(admin),100(users)
uid=10001(tester) gid=100(users) groups=100(users)
uid=10001(tester) gid=100(users) groups=10002(admin),100(users)
```
Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This is attempting to fix a test setup issue in Debian CI, see #2450.
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Fixes: #2271
When domain name is updated, it usually results in a error page as the HTTP
connection is broken in the middle of a page load. This is due to apache
restarting in the middle of domain change operation by letsencrypt component.
This also leads to several functional tests failing. To fix this, ensure that
letsencrypt does a reload on the apache2 daemon instead of restarting it.
'reload' operation on apache2 triggers the command 'apachectl graceful'. It
ensures that currently running continue to serve the open HTTP connection until
the page load has been completed. After that those connections stop. Meanwhile,
the server reloads configuration (and apparently the related TLS certificates too).
Tests:
- Unit tests pass.
- When self-signed certificate is updated with 'make-ssl-cert
generate-default-snakeoil --force-overwrite' and 'systemctl
try-reload-or-restart apache2' is called, the new certificate is loaded by
apache2. Browser shows the untrusted certificate warning again. The
certificate information in the connection details has been updated.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
Reload a service if it supports reloading, otherwise restart. Do nothing if
service is not running.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Likely helps: #2271.
When web server restarts we are shown an error page. Trying to lookup and
element in this error page still raises StaleElementReferenceException. However,
if the page was reloaded with driver.visit(), then trying to lookup the old
element does not throw StaleElementReferenceException. Instead the
NoSuchElementException is thrown. For this case, ensure that we stop waiting
appropriately. This is likely to solve the large waits and timeouts when testing
dynamicdns.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Tests:
- Config app description is as expected.
- Config form does not show domain name field anymore.
- Submitting the form with changes works.
- Names app has correct link for configuring static domain name. Clicking it
takes to page for setting domain name.
- On startup, static domian name signal is sent properly if set. Otherwise no
signal is send.
- Change domain name form shows correct value for current domain name.
- Change domain name form sets the value for domain name properly.
- Page title is correct.
- Validations works.
- Add/remove domain name signals are sent properly.
- Success message as shown expected
- /etc/hosts is updated as expected.
- Unit tests work.
- Functional tests on ejabberd, letsencrypt, matrix, email, jsxc, openvpn
- After freshly starting the service. Visiting names app shows correct list of
domains.
- ejabberd:
- Installs works as expected. Currently set domain_name is setup properly.
Copy certificate happens on proper domain.
- Changing the domain sets the domain properly in ejabberd configuration.
- Ejabberd app page shows link to name services instead of config app.
Clicking works as expected.
- letsencrypt:
- When no domains are configured, the link to 'Configure domains' is to the
names app.
- matrix-synapse:
- Domain name is properly shown in the status.
- email:
- Primary domain name is shows properly in the app page.
- Setting new primary domain works.
- When installing, domain set as static domain name is prioritized as primary
domain.
- jsxc:
- Show the current static domain name in the domain field. BOSH server is
available.
- openvpn:
- Show the current static domain in profile is set otherwise show the current
hostname.
- If domain name is not set, downloaded OpenVPN profile shows hostname.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
Tests:
- Config app description is as expected.
- Config form does not show hostname anymore.
- Submitting the form with changes works.
- Names app has correct link for configuring Local Domain Name. Clicking it
takes to page for setting hostname.
- Avahi shows the current .local domain correctly in Names app.
- Change hostname form shows correct value for current hostname.
- Change hostname form sets the value for hostname properly.
- Page title is correct.
- Validations works.
- Pre/post hostname change signals are sent properly
- Success message as shown expected
- hostnamectl shows the set domain
- If domain name is not set, downloaded OpenVPN profile shows hostname.
- Unit tests work.
- Functional tests on names/config/avahi apps work.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
Closes#2092
On testing and unstable systems, /etc/os-release does not contain
VERSION_ID. In this case, lsb_release will report the release as
"n/a".
For unstable, this means that backports can be enabled in development
mode. When this happens, trixie-backports will be added as an apt
repository. The repository already exists, so it does not cause any
problem.
Tests:
- In stable container, backports can be enabled.
- In stable container, dist-upgrade can be disable and enabled.
- In stable container, in development mode, dist-upgrade can be
started.
- In testing container, backports cannot be enabled.
- In testing container, dist-upgrade cannot be enabled or started.
- In testing container, in development mode, backports can be enabled.
- In testing container, in development mode, dist-upgrade cannot be
started.
- In unstable container, in development mode, backports can be enabled
(as trixie-backports).
- In unstable container, in development mode, dist-upgrade cannot be
started.
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
[sunil: Merge the case of outdated unstable distributions that return 'unstable'
as release and newer unstable distributions that return 'n/a']
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Closes: #707
Helps: #1570
- Network Manager's 'shared' connections use port 53 on those interfaces. Bind
by default also listens on them if possible. In some corner cases, this could
lead to a clash. This patch fixes to cases by making sure bind does not listen
on IP address likely used by Network Manager's 'shared' connections. If user
custom configures address, they will need to update the bind configuration
accordingly.
- App version increment is not necessary because in this release cycle we have
already incremented it once.
Tests:
- Install without patch. Increment the app version number (and the version
number in the privileged script). Notice that bind app setup is run again.
'listen-on' line is inserted into the configuration file as expected.
- Increment the version numbers again and a second 'listen-on' line is not
inserted.
- Without patch, on a machine with two network interfaces, start a 'shared'
network connection. Start bind. Notice the error that bind could not listen on
the shared network IP address.
- Without patch, on a machine with two network interface, start bind while
'shared' network connection is configured with just the IP address. Start bind
and it will listening on the IP address with shared network IP address.
Configure a shared connection and it fails to start.
- Apply the patch. Start 'shared' network connection. Start bind and notice that
bind does not attempt to listen on that shared network IP address and does not
print error message as well.
- Apply the patch. Start bind while 'shared' network connection is configured
with just the IP address. Bind does not attempt to listen on that shared network
IP address. Start the shared network connection. It start without issues.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- In create/edit network connection form, if the accordion is closed for
'General' section, Network Interface has not be selected yet and Submit button
is pressed, 'General' section should be expanded and focus should go to Network
Interface field. This is not working as expected as the code to expand
accordions didn't match 'select' type input fields properly. Fix this.
- Declare a common class name for both create and edit forms to make writing
queries easier.
- Drop console logs that where meant for debugging.
Tests:
- On both create and edit connection forms, set the value of network interface
to '--select--' and collapse the 'General' section. Press submit. The 'General'
section is expanded, Network Interface field is focus and scrolled into view.
- Do the same check for another field such as Connection Name and that works
too.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
This improves the user experience in many ways:
- Help user understand if DNSSEC is being used on the current DNS server in case
'allow-fallback' is supported.
- Nudges the user to explore enabling DNS-over-TLS and DNSSEC.
- Help user understand how global vs. link specific configuration works. Help
user understand if a global DNS is being used.
- Show the list of fallback DNS servers being used (as this poses privacy
concerns).
Also helps with debugging in problematic situations:
- Find out which DNS server is being used (and leading to problems) and show the
cycling mechanism.
Tests:
- Enable/disable fallback DNS server in privacy app. See that fallback servers
line is only shown when enabled.
- Set various global values of DNS-over-TLS and DNSSEC and see the status
changes.
- Set various values of DNS-over-TLS in the network connection settings and see
the changes in status.
- Set DNSSEC to allow-fallback. Perform a query and see that the value of
supported/unsupported changes.
- Set DNS servers with special configuration file in
/etc/systemd/resolved.conf.d/test.conf and restart systemd-resolved. See change
in status page. Notice that if connection specific DNS server is set to an
invalid server, global section has a current DNS server.
- Set SNI domain name and port for the an IPv4 DNS and an IPv6 DNS. See that the
display is as expected.
- Raise an exception in get_status() and notice that an error alert is show
properly.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewd-by: Veiko Aasa <veiko17@disroot.org>
Pass remaining failed checks to super.
Tests:
- Remove /etc/letsencrypt/renewal-hooks/deploy/50-freedombox so that
the diagnostic fails. Running repair causes the file to be
re-created.
- Set domain name to non-existing domain so that the diagnostic
fails. Running repair attempts to obtain the certificate.
- Have both diagnostics failing. Running repair will attempt to repair
both.
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
So that when users select 'Default' they understand what value applies and how
to change it.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- Reloading systemd-resolved does not seem to apply the DNS-over-TLS changes
fully. Although resolvectl shows the new status after a reload, systemd-resolved
seems to be using incorrect DNS-over-TLS setting.
Tests:
- Without the patch, set DNS server that does not support DNS-over-TLS such as
dnsmasq in Network Manager's 'shared' connection. Then enable DNS-over-TLS.
resolvectl shows that DNSOverTLS flag correctly. But name resolutions still
work.
- With the patch, repeat the above and notice that resolution does not work.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- Use deb.debian.org because it is already contacted regularly for
checking/downloading packages and updates.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
Tests:
- Visit the names app. New 'Domains' heading and configuration section appear.
- DNS-over-TLS configuration option is as expected.
- When the configuration file does not exist, the option selected is 'no'.
- When the configuration option is changed, 'resolvectl' shows the newly set
configuration. Using 'resolvectl query {domain}' does not work when DoT is on
and server does not support DoT. 'opportunistic' and 'no' work on those cases.
- When a DNS server supporting DoT (such as 1.1.1.1) is manually set, resolution
with all three settings works.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- Without selecting an option, trying to submit the form leads to an error.
Tests:
- Go to the new connection form, notice that the 'auto' method is selected by
default.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- If an existing network manager connection with the missing values is ever
edited, it leads an awkward interface.
- So, complete the setting by allowing values supported by Network Manager.
Tests:
- Create new connections with the new values 'link-local' and 'disabled'.
Connection creation succeeds.
- Editing connection to these values works too.
- When 'link-local' or 'disabled' values are selected, primary and secondary DNS
fields are disabled.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- Expose Network Manager per-connection setting for DNS-over-TLS. Support all
four values: default, no, opportunistic, and yes.
- Create a new collapsible section all 'Privacy' for this setting the connection
create/edit form. Strictly speaking this is related to security and censorship
resistance too.
- Don't show the DoT field for PPPoE connection types are DNS servers are not
relevant.
- Show the status of DoT for a connection in the connection status page.
Tests:
- In all Add New Connection forms except PPPoE form, the privacy
section shows up as expected.
- For each value for DoT, create a new connection and set the value for DoT to the
desired value and observe that the connection status page shows DoT to the set
value.
- For each value for DoT, edit an existing connection and set the value for the
DoT to the desired value and observe that the connection status page shows DoT
to the set value.
- Connection status page shows the values for DoT as expected.
- Update the primary Internet connection for the machine. Set the value to 'yes'
and notice that DNS resolutions fail. Set the value to 'opportunistic' or 'no'
and the DNS resolutions pass. In each case, 'resolvectl' shows the correct DoT
value for the connection. When 1.1.1.1 is set as DNS server, all values of DoT
in the connection succeed.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
Package holds are only expected when apps are being installed or
uninstalled, or during distribution upgrade process. At any other
time, package holds are not expected and should be released.
Tests:
- Place a hold on one package. Run the upgrades diagnostics, which
will have a failure. Try to repair the failure, and confirm that the
package is no longer held.
- Repeat with two or three packages being held.
[sunil]
- When the package 'needsrestart' is outdated and another package is held,
running repair unholds the package as well as runs setup() on the upgrades app
leading to 'needsrestart' package getting upgrade.
- When only failed diagnostic is for package holds. Running repair unholds the
packages but does not rung setup().
Helps: #2347
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Fixes: #2432
Tests:
- Without patch install MediaWiki. phpinfo() shows max execution time for 30
seconds. Apply patch, run 'make install' and restart service. Mediawiki app is
updated. Apache2 is reloaded. phpinfo() shows max execution time for 100
seconds.
- Create a script to 100% utilize the CPU for 90 seconds. It works.
- Create a script to 100% utilize the CPU for 110 seconds. It fails and get
killed after about 100 seconds.
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
Tested-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
- If provision fails and the container is in running state, then running
'./container up' does not lead to re-run of provisioning script. Fix this.
Tests:
- Without patch, insert 'exit 1' in provisioning script. Run './container
destroy; ./container up'. Provision script will fail. Re-run './container up'.
Provision script is not run and message that container is already running is
printed.
- With patch, insert 'exit 1' in provisioning script. Run './container destroy;
./container up'. Provision script will fail. Re-run './container up'. Provision
script is not run and message that container is already running is printed.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
Closes: #1196.
- systemd-resolved always contains the current list of known DNS servers taken
from systemd-networkd, network-manager, or by other means. It also has fallback
DNS servers. Forwarding requests to it allows correct and failsafe way to reach
external DNS servers.
Tests:
- Freshly install bind and notice that the fowarders list is set to 127.0.0.53.
- Install without the patch. Apply patch. Restart service. bind is upgraded to
new version and forwarder is set to 127.0.0.53 if it is blank. Otherwise, it
remains as is.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
Tests:
- Without patch, disable bind. Incrementing the app's version number results in
bind getting started.
- With patch, disable bind. Incrementing the app's version number does not
result in bind getting started.
- Without patch, disable bind. Update forwarders. Bind is running again.
- With patch, disable bind. Update forwarders. Bind is not running again.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- Before this change, when bind is disabled, dns port is removed from firewall
causing all 'shared' connection to not be able to resolve domains. This was
because no other application was declaring a need for 'dns' port to be kept
open. Declare a firewall component in the networks app needing 'dns' and 'dhcp'
services on the internal networks.
Tests:
- Without the patch, install and disable bind. 'dns' port is removed from
'internal' zone of the firewall.
- Install and disable bind. 'dns' port is not removed from 'internal' zone of
the firewall.
- On a fresh Debian machine. Install the freedombox package. 'http', 'https',
'dns' and 'dhcp' port are opened on the firewall as expected.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- To complete the provisioning process with container script and vagrant.
Tests:
- Start a fresh testing container, it should succeed. systemd-resolved is
running and resolving queries.
- Start a fresh stable container, it should succeed. systemd-resolved is running
and resolving queries.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
Tests:
- Without the patch, start the service and dismiss the privacy notification.
With the patch, the restart the service. Privacy app is updated and privacy
notification is shown again. Incrementing the version number of the privacy app
does not result in showing of the notification again.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- Using public DNS servers leads to user's domain queries being known to the
servers, violating privacy. However, it is necessary to address many corner
cases when DNS servers are not known to systemd-resolved but internet
connectivity is working. Allow users to disable fallback DNS servers.
Tests:
- After upgrade to latest version of FreedomBox, the setting is on by default.
- Disabling removes the /etc configuration file and resolvectl shows no fallback
DNS entries.
- Enabling add the /etc configuration file and resolvectl shows fallback
entries. After removing existing DNS servers using resolvectl, one can still
query using fallback servers.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- This avoids using fallback DNS servers in systemd-resolved soon after
systemd-resolved takes over /etc/resolv.conf and if network-manager knows some
DNS servers from the connections it has established.
- Version for the names app has already been incremented in this patch series.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- Disable mDNS resolution. While we can migrate our DNS-SD service definition
files to systemd-resolved and switch from using avahi to systemd-resolved, many
programs still solely depend on avahi-daemon. Examples include cups and GNOME.
It is not clear if they will work any mDNS daemon or if they interact with
avahi-daemon in other ways that the mDNS protocol. So, for now, disable mDNS in
systemd-resolved and continue to use avahi-daemon for it. This is also Fedora's
default.
- Re-introduce Fallback DNS servers with the value same as the upstream systemd
project. Debian removes the default fallback DNS servers likely because they
could be considered a privacy violation. However, when systemd-resolved package
is first installed, the post install script recommends a reboot instead of
feeding the currently configured nameservers from /etc/resolve.conf into
systemd-resolved. Immediately, this causes the system not be able to connect to
any external servers. While this may be acceptable solution for interactive
systems and pre-built images, FreedomBox has to a) be available for remote
access b) perform upgrades without user intervention (and without reboot until a
day). To mitigate privacy concerns, an option to disable these fallback servers
will be provided in the UI.
- systemd-resolved's stub resolver runs on 127.0.0.53%lo:53 and 127.0.0.54. This
does not conflict either with shared connections which listen on 10.42.x.1 or
with bind which listens on 127.0.0.1 (and other IP addresses). This MR does not
address the existing conflict between bind and shared network connections.
However, it does not cause any further conflicts.
Tests:
* mDNS
- Avahi diagnostics works. daemon is running. mdns port is exposed in the
firewall.
- systemd-resolved does not listen on mDNS ports.
- Running avahi-browse shows freedombox on local network.
- Running avahi-browse shows the services ssh, sftp-ssh, http and ejabberd.
- Machine can be discovered in Gnome Files.
* NetworkManager shared connections
- After install/upgrade to systemd-resolved, 'shared' connections can be
created.
- With a 'shared' connection configured and active, it is possible to upgrade to
using systemd-resolved.
- Resolving domains from a machine on shared network goes via systemd-resolved
on FreedomBox.
* Bind
- Installing, running tests on bind works.
- Programs connecting from outside network can connect to bind as expected.
- Programs connecting from local machine can connect to bind as expected.
* Upgrading works
- Upgrading to new FreedomBox package works
- systemd-resolved is installed and running. 'resolvectl' shows a proper name
server (or fallback nameserver like 1.1.1.1).
- libnss-resolve is installed and configured in /etc/nsswitch.conf
- /etc/resolv.conf has proper link to /run/systemd/resolve/stub-resolv.conf.
- Programs using /etc/resolv.conf directly work. Install python3-pycares.
python3 -m pycares freedombox.org.
- NetworkManager has passed on proper DNS entries. In logs dns=systemd-resolved,
rc-manager=unmanaged, plugin=systemd-resolved
- DNS resolution works after first setup. Installing packages works.
- 'resolvectl query' resolution works.
- Programs using glibc API resolution such as 'ping' work.
* Fresh image
- Building an image with new freedombox package works without error.
- Booting from fresh images works.
- systemd-resolved is installed and running. 'resolvectl' show proper name
server.
- libnss-resolve is installed and configured in /etc/nsswitch.conf
- /etc/resolv.conf has proper link to /run/systemd/resolve/stub-resolv.conf
- Programs using /etc/resolv.conf directly work. Install python3-pycares.
python3 -m pycares wikipedia.org
- NetworkManager has passed on proper DNS entries. In logs dns=systemd-resolved,
rc-manager=unmanaged, plugin=systemd-resolved
- DNS resolution works after first setup. Installing packages works.
* Installing package on Debian
- Installing new freedombox package in Debian machine works.
- systemd-resolved is installed and running.
- libnss-resolve is installed and configured.
- /etc/resolv.conf has proper link to /run
- NetworkManager has passed on proper DNS entries to systemd-resolved using
'nmcli reload dns-rc'.
- Resolution works with fallback DNS servers when network interfaces are
configured with /etc/network/interfaces
* OpenVPNs works
- As a server, we don't push DNS servers to the client. So, a client continues
to use its old DNS servers. With systemd-resolved running on server, the client
is able to connect to OpenVPN server, route traffic to the internet, and resolve
DNS queries.
* WireGuard works
- As a server, we can't push DNS servers to the client. So, a client continues
to use its old DNS servers. With systemd-resolved running on server, the client
is able to connect to WireGuard server, route traffic to the internet, and
resolve DNS queries.
- As a client, server does not push DNS servers to the client. So, a client
continues to use its old DNS servers. With systemd-resolved running on the
client, the client is able to connect to WireGuard server, route traffic to the
internet, and resolve DNS queries.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
On systems where the grub-pc package is not available (e.g. ARM),
dpkg-query will have an exit status of 1. Handle the error that is
raised in this case.
Tests:
- Added unit tests for storage._diagnose_grub_configured.
- Tested on Raspberry Pi 4.
Closes: #2441
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Closes: #2405.
- When Django module is mocked, there are some cases where modules using django
can't be imported due to errors.
- To fix that, don't mock the django module and require django and related
Debian packages to be installed on the system generate developer documentation.
- Initialize django in Sphinx configuration to allow django modules to be
imported without errors.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Fixes#2420.
Tests performed using Debian stable:
- Set user language to espanol. Install, repair and remove gitweb app.
Check that all app operation messages are in spanish.
- All unit tests pass.
Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Closes: Debian bug #1069240
Closes: Debian bug #877935
- libnss-gw-name resolves 'gateway.localhost' to the ip address currently
configured as default route. This has been abandoned upstream[2], deprecated in
Debian[1]. Using libnss-myhostname (part of systemd) instead is recommended[2].
- libnss-gw-name has been removed from testing and unstable. Installing
freedombox package in these distributions no longer installs the libnss-gw-name
package but freedombox installation succeeds as this is only a recommends.
Latest images don't contain the libnss-gw-name package either.
- We already recommend libnss-myhostname and this package is typically installed
along with freedombox package.
- libnss-myhostname resolves '_gateway' where as libnss-gw-name resolves
'gateway.localhost'. This is technically a breaking change. However, we have
neither used nor documented gateway resolution on FreedomBox machines. So, any
disruption is likely minimal.
Tests:
- On a FreedomBox container, running 'ping _gateway' shows that it resolves to
the same IP address as default route shown in 'ip route'.
Links:
1) https://www.debian.org/releases/stable/amd64/release-notes/ch-information.en.html#deprecated-components
2) https://github.com/nomeata/libnss-gw-name
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Add a new diagnostic check result for skipped tests.
Tests:
- Put a hold on a package. The diagnostic is failed.
- Remove the hold from the package. The diagnostic is passed.
- Start installing an app, then immediately run the upgrades
diagnostics. The diagnostic is skipped.
Helps: #2347
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
[sunil: Allow i18n for new state 'skipped']
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Closes: Debian bug #961733.
- The version of Linux kernel supported in FreedomBox is from Debian Bookworm
and that is 6.1, released on Sun, 11 Dec 2022[4][5].
- Around 2014, in Linux kernel version 5.4, a way to extract entropy from CPU
execution jitter every second was implemented. This is similar to
HAVAGE/havaged's approach[1][2]. This ensures that user space applications never
hang indefinitely when entropy is not available.
- Since 2020, /dev/random only blocks until it is initialized and after that
never blocks. It provides cryptographically secure psuedo-random numbers after
initialization (which is believed to be as good as blocking pool even for
security sensitive applications). This the same behavior as getrandom() call[6].
This means that even on embedded systems, haveged is not necessary once the
initialization of the random pool has been completed.
- Since Feb/Mar 2022, /dev/urandom no longer provides insecure random
numbers[3]. Earlier, if it was used before full initialization, it provided
insecure random numbers. Now it blocks the caller until initialization and then
provides cryptographically secure pseudo-random numbers. The initialization
itself won't take too much time due to the "Jitter Dance" technique of
extracting entropy from CPU execution jitter. The only way to request for
insecure random number (without even blocking for 1 second) is to use
getrandom(GRND_INSECURE) which systemd uses to initialize hash tables. This
change was reverted because Jitter Dance did not work on several architectures
including arm[3]. Later it was added back as an opportunistic approach, where
secure random numbers would be provided by urandom if Jitter Dance worked.
- Git repository for haveged mentions that it is less relevant now[7]. It also
lists circumstances where haveged might still help (old kernels, user-space RNG,
additional source of entry and early boot). Of these, only early boot scenario is
of interest for us.
- In summary, the understanding of relevance of haveged is as follows:
Request Random Number
---------------------
Is this during initialization of the random pool?
No:
- Linux never blocks after initialization. It uses CSPRNG now instead of
blocking for entropy.
Yes:
Is this for secure purposes?
No:
- It does not block and provides insecure (or secure in most practical
cases) numbers with getrandom(GRND_INSECURE), used by systemd hash tables,
etc.
Yes:
Does the architecture provide hardware random numbers?
Yes:
- Use RDSEED (Intel/AMD) CPU instruction or HWRNG (SOCs) to initialize the
random pool.
- If on virtual machine, use virtio-rng, ACPI VM ID, etc. to initialize the
random pool.
No:
Is this on architectures with time stamp counter?
Yes:
- The system will block for 1-2 seconds and provide secure random numbers
using "Jitter Dance" (similar to haveged).
- ARMv7 (Allwinner A20, etc.) the lowest ARM architecture we support,
seems to have time stamp counters but we not sure kernel uses it and
implements "Jitter Dance".
No:
- On urandom, The system will not block and provide insecure random
numbers. This is as per the original definition of /dev/urandom.
- The system will block until entropy is available through interrupts,
etc.
- haveged will likely not help here because it also requires time stamp
counter provided by CPU.
Links:
1) https://lwn.net/Articles/802360/
2) https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=50ee7529ec45
3) https://www.zx2c4.com/projects/linux-rng-5.17-5.18/
4) https://lkml.org/lkml/2022/12/11/206
5) https://packages.debian.org/search?searchon=names&keywords=linux-image-6.1.0
6) https://lwn.net/Articles/808575/
7) https://github.com/jirka-h/haveged
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
- Create new policy that allows forwarding between zones.
See: https://bugzilla.redhat.com/show_bug.cgi?id=2016864#c8
- Increment version to perform setup on upgrade.
Closes: #2355
Tests:
- Build freedombox package, and install on top of Bookworm VM The
firewall setup is performed. firewall-cmd lists the fbx_int_to_ext_fwd
policy, masquerade on external zone, and forward on internal zone.
Not tested:
- I did not test forwarding traffic from external to internal zone.
However, several users have reported following these instructions on
the forum, and that it solved the issue for them.
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
[sunil: Minor refactors for readability]
[sunil: Ensure that operation is idempotent]
[sunil: Reload instead of restarting firewalld]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
If the GRUB install device has not been selected, then grub package
configuration will fail during upgrades.
Tests:
- Install freedombox package with this change in a VM. Check that the
diagnostic is passed.
- Re-install the grub-pc package with DEBIAN_FRONTEND set to
noninteractive, so that it fails to be configured. Check that the
diagnostic is failed.
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
- All forms are rendered using django-bootstrap-form excep the
app enable/disable form. Render this one too using django-boostrap-form so that
the default.html is not used for rendering. Using default.html is deprecated in
Django 4.0 and in 5.0 will default to using div.html.
Tests:
- No change in HTML output, appearance or functionality for the enable/disable
button.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- Eliminate a Django warning message.
- This setting has been deprecated. It will be remove in Django 5.0 and is
always on.
Tests:
- On Debian stable, django.VERSION <= (4,0) evaluates to True and on testing it
evaluates to False.
- After the patch, the warning related to USE_L10N has disappeared.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
This is to ensure that secret parameter which must likely be marked as secret
are not marked as secret. The partially mitigates the biggest disadvantage of
printing all the parameters by default and marking exception, that is,
forgetting to mark.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- When privileged action is called, it is logged without arguments currently.
Extend this to log all arguments but excluding the parameters of type
secret_str.
- When error is raised, all arguments are being logged currently. Extend this to
exclude the parameters of type secret_str.
Tests:
- Privileged actions with secret strings log messages with '****' instead of
secret string.
- When an error is raised in a privileged action, an exception is logged. In the
exception message, the method and parameters are printed. Parameters that are
secret strings are shown as '****'.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- Run affected privileged actions through UI and notice that secret strings are
not logged (except initializing init/info a new SSH repository).
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- Run affected privileged actions through UI and notice that secret strings are
not logged (except deleting the last admin user).
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- Run affected privileged actions through UI and notice that secret strings are
not logged.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- Run affected privileged actions through UI and notice that secret strings are
not logged.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- Run affected privileged actions through UI and notice that secret strings are
not logged.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- Run affected privileged actions through UI and notice that secret strings are
not logged.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Fixes: #2435
Tests:
- Run affected privileged actions through UI and notice that secret strings are
not logged.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- Run affected privileged actions through UI and notice that secret strings are
not logged.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- Run affected privileged actions through UI and notice that secret strings are
not logged.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- Run affected privileged actions through UI and notice that secret strings are
not logged.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- Run affected privileged actions through UI and notice that secret strings are
not logged.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- Perform effected actions and ensure that secrets are not logged on the
console.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Method parameters marked with secret_str will not be logged.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
When older version is already built and later code is updated to newer version
and built multiple .whl files are present in dist/ directory. This confuses the
install script that assumes only one .whl is present. Pip refuses to install
multiple versions of the same package. This error was seen when bringing up the
'stable' container.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
TiddlyWiki uses almost the same Apache configuration as Feather Wiki,
with one difference - disabling gzip for the `HEAD` request.
The FreedomBox app for TiddlyWiki is identical to Feather Wiki in
every other aspect.
- Proxy download through freedombox.org. This serves two purposes:
1. Upstream's website cannot track the IP addresses of FreedomBox users.
2. We can update the versions of the empty quine files without making
code changes in FreedomBox.
[sunil]
- Update description to correct the list of users who can access the app.
- Update logo to adhere to the logo guidelines.
- Minor styling fix.
- Update the copyright on the logo based on information from upstream git
repository.
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This serves two purposes:
1. Upstream's website cannot track the IP addresses of FreedomBox users.
2. We can update the versions of the empty quine files without making
code changes in FreedomBox.
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
[sunil: Update description to reflect the change in upstream URL]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.or>g
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
- Uninstall deletes wikis & extensions
- Use Skylark (v1.8.0)
- Add option to upload existing wiki
- Open wiki links in new tab. Since Feather Wiki modifies browser history, it
takes several clicks to go back and reach the FreedomBox app for Feather Wiki if
the user wants to switch to another wiki file. Opening in a new tab also makes
it easy for the user to move text between wikis (i.e. the Refile use case).
- Improve HTML file path handling. Extract only the HTML file name from the URL.
Return a 404 status if the file cannot be found
- Place featherwiki_nest.cgi file in /usr/lib/cgi-bin. The file is installed as
part of the FreedomBox package, rather than a step in the installation of
Feather Wiki.
[sunil]
- Reorganized description to complete the introduction before talking about
FreedomBox implementation.
- Update description to say that only users of 'wiki' group can access.
- Update description to talk about where the wiki is downloaded from how to
upgrade it.
- Update short description to 'Personal Notebooks'.
- Add UsersAndGroups component and to reuse 'wiki' group properly.
- Reorder component to resemble other apps (could prove useful in future).
- Restrict frontpage shortcut to 'wiki' group users.
- Minor styling updates. Run isort.
- Use pathlib.Path object where possible instead of os.path.
- Perform sanitization in privileged methods instead of callers. This leads
better security if the service is compromised.
- Perform duplicate checking in privileged methods instead of callers.
- Check in privileged action that uploaded file originates from temporary
directory. Otherwise, arbitrary files can moved into DAV directory.
- Switch storage path to /var/lib/ which is an application data folder from
/var/www which is a user data folder.
- Add extra security to the DAV folder by explicitly rejecting .htaccess
directives, forcing mime type and removing all options.
- Update SVG/PNG logo icons to adhere to our guidelines.
- Minor template updates. Add required attributes. Improve i18n. Avoid <p>
inside <p>.
- Refactor tests for more code reuse and fewer globals.
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
- DAV can simplify hosting the Feather Wiki app.
- It can also potentially be used to share folders over HTTP to clients such a
GNOME/KDE file mangers.
- Enabling the modules by default should have few disadvantages other than
slight increase in memory. It needs to be enabled with 'DAV on' directive on the
specific directories.
Tests:
- Running the service after patch run apache setup and the modules are enabled.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
- The library performs a large number of tests to determine if various features
are available in the browser. In Debian most tests seem to be present unlike
other methods of distribution where users select which tests they want and build
a customized library for their app. This leads to increased page load time.
- The only functionality we use from Modernizr library are the .js and .no-js
classes we use in our CSS styling. Modernizr is not needed by Bootstrap library.
We don't use 'Modernizr.' properties in Javascript.
- A bug in the test to determine if an <input> element with type="number" allows
localization or not causes the page to scroll down to the end. This behavior
appeared in version 3.x of modernizr and despite the bug report and the fix, it
is not gone. Dropping modernizr fixes this issue.
Tests:
- The logout link in the header bar is visible only when Javascript is disabled.
- The dropdown icons next to header menus only appear when Javascript is
enabled.
- For each feature detection provided by Modernizr library, search if our
project is using that in CSS styling.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
When an app installs a python module as a dependency and imports it. CherryPy
will start monitoring it for changes. When the app is uninstalled, the module is
removed from the system leading to change detected by CherryPy. The entire
service is then restarted if it is in development mode. This could cause a
temporary failure in requests served leading to failures in functional tests.
Workaround this by preventing auto-reloading for some python modules.
Tests:
- Without changes, in develop mode, uninstall nextcloud and notice that
FreedomBox service is restarted. With changes, it does not restart.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- Without the changes, typing https://<domain>/nextcloud does not work. With the
changes it redirects to https://<domain>/nextcloud/.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
For test cases implemented in derived classes, autouse=True does not seem to
work. These test cases can explicitly request this fixture with the name.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Sometimes <input type='submit'> are used as submit buttons and at other times
<button type='submit'> is used.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- /etc/gitweb-freedombox.conf is a drop-in configuration file. It is provide in
/usr and linked into /etc/. It is overwritten when freedombox package is
upgraded. So, it is incorrect to backup/restore the file.
Tests:
- Run functional tests that include backup/restore.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
In some cases in the backup page, when trying to restore a backup, the button is
obscured and trying to click it fails. Handle such situations by scrolling the
element into view first and try to click on the element again. Ensure that our
navigation header does not obscure the element when scrolling it into view.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
When a click fails because the element is obscured or out of scroll port, the
fails with ElementClickInterceptedException. This normally fails the test
properly. However, when waiting for a page update, the wait loop silently
swallows the error causing the click failure to be ignored. This later leads to
a timeout waiting for page to be updated.
Handling this error separately and re-raising it ensures that the test fails
with the correct error allowing us to fix the problem.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- Run functional tests on miniflux app.
- Run backup and restore on ttrss app manually and notice that data is restored
and there are no errors.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
- When the password is changed during the reset-password test, running other
tests in a different test run fails the tests.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
- Check the exitstatus and signalstatus as seen from the ptyprocess module.
- Avoid accessing 'log' before is it initialized.
- When creating admin user, don't expect JSON message for all other types of
errors. They are simple strings.
Tests:
- Try to modify the password of a non-existent account. Notice the error message
is shown. Modify the password of an existing account and it succeeds.
- Create an account with username that already exists. Notice that error is
shown. Otherwise, it succeeds.
- Allow the UI to enter short passwords and notice that error is shown properly
during user creation and reset password.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
Tests:
- Reset the password of an account successfully. No error is shown.
- Reset the password of a non-existent account. Error is shown.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
GitLab wrongly identifies the license of FreedomBox as the non-free
Server Side Public License. A mention of the license in the README
can be useful to clarify this.
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Both postgres and postgres-contrib package seem to pull the postgres-16 package
ultimately.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
[sunil's changes]
- Add copyright information the logo.
- Deluge: undo an unintended change.
- Drop wrapper calls over privileged methods. The new privileged method
decorators make is easy to avoid these.
- Styling updates: docstrings, single quotes for strings, casing for UI strings.
- Drop "DO NOT EDIT" comment for files located in /usr as they are not expected
to be editable by the user.
- Fix 'miniflux' to 'Miniflux' in web client name.
- Overwrite FreedomBox settings onto the existing configuration file when setup
is re-run. This is to ensure that FreedomBox settings take priority.
- Use return value of the miniflux command to raise errors.
- Use pathlib module where possible.
- Move message parsing into the privileged module from views module.
- Resize SVG and PNG logo files for consistency with icon styling.
- Use hypens instead of underscores in URLs and Django URL names.
- Rename miniflux_configure.html to miniflux.html.
- Use base method for minor simplification in backup functional test. Ensure
that the test can be run independently when other tests are not run.
- Update tests to reflect code changes.
- Avoid concatenating internationalized strings so that they can be translated
properly.
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This fixes the problem of running over the limit of ARG_MAX of /bin/sh in the
dev container when copying the files of plinth modules.
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
- Not enabled by default currently. This can be changed after further
testing.
- Re-use existing operation from diagnostics run. However, this requires
changing the app_id of the operation for each app.
Tests:
- Enable automatic repair, and run diagnostics. See that repairs are
run.
- Enable automatic repair, and wait for daily diagnostics run. See that
repairs are run.
Closes: #2399.
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
@ -43,7 +43,7 @@ An alternative to downloading these images is to [[InstallingDebianOn/Allwinner|
=== Known Issues ===
* Revision G2 (written on the board): The current stable Debian11/bullseye image (from 2021-08-27) '''will not start an Ethernet connection!''' This means you can not continue with the installation process at first. This can be fixed by following [[https://wiki.debian.org/InstallingDebianOn/Allwinner#Olimex_A20-OLinuXino-LIME2__rev._F_and_newer_and_Debian11.2F_bullseye_kernel | this description]] after you [[https://wiki.debian.org/FreedomBox/Download#Installation | copied the image to your SD card]]. Or you Download and use the [[https://ftp.freedombox.org/pub/freedombox/pioneer/|Pioneer Edition image]] to fix the issue. It contains a slightly [[https://salsa.debian.org/freedombox-team/u-boot/commit/2cb18893ef|modified u-boot]].
* Revision G2 (written on the board): The current stable Debian11/bullseye image (from 2021-08-27) '''will not start an Ethernet connection!''' This means you can not continue with the installation process at first. This can be fixed by following [[https://wiki.debian.org/InstallingDebianOn/Allwinner#Olimex_A20-OLinuXino-LIME2__rev._F_and_newer_and_Debian11.2F_bullseye_kernel | this description]] after you [[https://wiki.debian.org/FreedomBox/Download#Installation | copied the image to your SD card]]. Or you Download and use the [[https://ftp.freedombox.org/pub/freedombox/hardware/pioneer/|Pioneer Edition image]] to fix the issue. It contains a slightly [[https://salsa.debian.org/freedombox-team/u-boot/commit/2cb18893ef|modified u-boot]].
* Revision G2 hardware has also [[DebianBug:927397|poor performance when transmitting Ethernet data in Gigabit mode]] for older FreedomBox releases. The procedure above or for rev. C fixes this.
* Revision C hardware has [[DebianBug:845128|poor performance when receiving Ethernet data in Gigabit mode]]. To workaround the problem, you can switch to 100 Mbps mode instead of Gigabit mode. Login to your !FreedomBox as root (or plugin the SD card into another computer) and create the file /etc/NetworkManager/dispatcher.d/20-fix-ethernet-problem with the following contents:
[[http://www.pcengines.ch/apu1d.htm|PC Engines APU 1D]] is a single board computer with 3 Gigabit ethernet ports, a powerful AMD APU and Coreboot firmware. !FreedomBox images built for AMD64 machines are tested to work well for it.
[[https://www.pcengines.ch/apu.htm|PC Engines APU]] boards are single board computers with 3 Gigabit ethernet ports, a powerful AMD64 APU and Coreboot firmware. !FreedomBox images built for AMD64 machines are tested to work well for [[http://www.pcengines.ch/apu1d.htm|APU1D]] and [[http://www.pcengines.ch/apu3b2.htm|APU3B ]] models and are expected to work also well on the other, very similar versions.
'''Important:''' Read [[FreedomBox/Hardware|general advice]] about hardware before building a !FreedomBox with this single board computer.
@ -21,31 +21,26 @@ Although untested, the following similar hardware is also likely to work well wi
!FreedomBox disk [[FreedomBox/Download|images]] for this hardware are available. Follow the instructions on the [[FreedomBox/Download|download]] page to create a !FreedomBox SD card, USB disk, SSD or hard drive and boot into !FreedomBox. Pick the image meant for all amd64 machines.
An alternative to downloading these images is to [[InstallingDebianOn/Alix3d2|install Debian]] on the APU and then [[FreedomBox/Hardware/Debian|install FreedomBox]] on it.
An [[https://github.com/huubsch/APU-Installation-HomeAssistant-Freedombox|installation manual]] tested on the APU3B is available on GitHub, including flashing with UEFI-BIOS
=== Networking ===
The first network port, the left most one in the above picture, is configured by !FreedomBox to be an upstream Internet link and the remaining 2 ports are configured for local computers to connect to.
=== Availability ===
PCEngines announced the [[https://www.pcengines.ch/eol.htm|phase-out]] of these boards in June 2023.
In 2024 [[https://pcengines.github.io/|Dasharo announced the support of APU-boards]] : coreboot + SeaBIOS and coreboot+UEFI.
* Price: 110 - 170 USD (depending on the board and supplier)
* [[http://www.pcengines.ch/order.htm|Full list of suppliers]]
@ -53,18 +48,17 @@ The first network port, the left most one in the above picture, is configured by
=== Hardware ===
* Open Hardware: No
* CPU: [[http://www.amd.com/en-gb/products/embedded/processors/g-series|AMD G series T40E]]
* RAM: 2 GB DDR3-1066 DRAM
* Storage: SD card, External USB
* CPU: [[http://www.amd.com/en-gb/products/embedded/processors/g-series|AMD G series T40E]]; [[https://teklager.se/en/amd-gx-412tc-cpu-specification/|GX-412TC]], 1 GHz quad core (depending on model)
* RAM: 2 GB DDR3-1066 DRAM - 4 GB (depending on model)
* Storage: SD card, External USB, mSATA module
* Architecture: amd64
* Ethernet: 3 Gigabit Ethernet ports
* !WiFi: None, use a [[FreedomBox/Hardware/USBWiFi|USB WiFi device]]
User websites is a standard location for webservers to allow host users to expose static files on the filesystem as a website to the local network and/or the internet according to the network and firewall setup.
User websites is a feature that allows any (even non-admin) user on a !FreedomBox to host their own website simply by copying files to well known location in their home directory on the !FreedomBox server. The URL for the website will look like `https://mydomain.example/~myusername/`. The website will be available on the local network and/or the internet according to the network and firewall setup. If the copied files are HTML pages, they will show up as a website. If they are other types of files such as photos or documents. A list of those files is shown and a visitor will be able to view or download them.
The standard webserver in !FreedomBox is Apache and this is implemented by means of a specific Apache module.
Apache is the web server used in !FreedomBox and this feature is implemented using an Apache module.
=== Screenshot ===
/* Add when/if an interface is made for FreedomBox */
{{attachment:user-websites-folder.png|User Website copied to FreedomBox using GNOME File Browser}}
{{attachment:user-websites-browser.png|User Website accessed using a browser}}
=== Using User Websites ===
@ -30,9 +32,8 @@ To serve documents, place the files in the designated directory in a !FreedomBox
This directory is: '''public_html'''
Thus the absolute path for the directory of a user named fbx with home directory in /home/fbx will be '''/home/fbx/public_html'''.
User websites will serve documents placed in this directory when requests for documents with the URI path "~fbx" are received. For the the `example.org` domain thus a request for the document `example.org/~fbx/index.html` will transfer the file in `/home/fbx/public_html/index.html`.
Thus, the absolute path for the directory of a user named ''fbx'' with home directory in ''/home/fbx'' will be '''/home/fbx/public_html'''.
The User Websites feature will serve documents placed in this directory when requests for documents with the URI path ''~fbx'' are received. For example, if `mydomain.example` is your domain then a request for the URL `https://mydomain.example/~fbx/photo.jpg` will display the file in `/home/fbx/public_html/photo.jpg`. If a file named ''index.html'' is placed in the directory, it will shown when no file name is provided in the URL. So, the URL `https://mydomain.example/~fbx/` will show the HTML page `/home/fbx/public_html/index.html`
=== Creating public_html folder and uploading documents ===
@ -44,7 +45,7 @@ Linux standard desktop file managers use to support remote filesystem access thr
* Gnome's Nautilus:
1. To lauch Nautilus you can seek its archive icon, or search ether its name or the word "file".
1. At the bottom of the left pane you'll find an option "+ Other locations".
1. It leads you to a list of locations. Find "`freedombox SFTP server`" (english literal for all desktop languages). Click on it.
1. It leads you to a list of locations. Find "`freedombox SFTP server`" (english literal for all desktop languages). Click on it. If you don't find this, you can instead type `sftp://username@freedombox.local` in the address bar.
1. The first time you'll be asked for your user and password. Enter your !FreedomBox user and its password. The dialog will also offer you some options to remember it for some time.
* Plasma file manager AKA Dolphin:
1. Click on the location bar at the top of the window.
@ -76,7 +77,8 @@ Usually any Unix system, including Linux in all (most) of its flavours and Mac,
Examples:
Connect to !FreedomBox via SSH:
1. (replacing `username` with a valid !FreedomBox user name and `freedombox.local` with your !FreedomBox's domain name or IP): {{{
1. (replacing `username` with a valid !FreedomBox user name and `freedombox.local` with your !FreedomBox's domain name or IP):
{{{
$ ssh username@freedombox.local
}}}
1. If your data is ok and your !FreedomBox reachable, the first time you'll be asked to confirm its signature.
1. When you create a folder, by default it belongs to you no matter where it is created. Thus you'll then need to set its ownership to the other user: {{{
@ -131,7 +131,7 @@ If you are a user experience designer, you can help !FreedomBox with the followi
* UI experience for the !FreedomBox Service web interface
* Web design for [[https://freedombox.org|freedombox.org]], [[https://freedomboxfoundation.org|freedomboxfoundation.org]] and the [[FreedomBox|wiki]] pages
* Logo and branding (we currently have [[https://salsa.debian.org/freedombox-team/freedombox/tree/master/static/themes/default|an identity manual and logos]])
* Logo and branding (we currently have [[https://salsa.debian.org/freedombox-team/freedombox/tree/main/static/themes/default|an identity manual and logos]])
* Possible designs for custom !FreedomBox cases on single board computers
@ -37,4 +37,4 @@ The Cubieboard 2 is a single board computer based on the Allwinner A20 processor
CategoryFreedomBox
Cubieboard 2 image is licensed under a Creative Commons Attribution-!ShareAlike 2.0 Generic License by [[https://www.flickr.com/photos/120586634@N05/14673300334/in/photolist-pMbdDm-omCuYN-o5kVMu-dy9jTD-dy99Kz|Flickr]].
Cubieboard 2 image is licensed under the [[https://creativecommons.org/licenses/by-sa/2.0/|Creative Commons Attribution-Share Alike 2.0 Generic license]] by [[https://commons.wikimedia.org/wiki/File:Cubieboard_2_-_Top_(14673300334).jpg|Gareth Halfacree]].
Though !FreedomBox's philosophy is to have the user make as few decisions as possible about the !FreedomBox itself, a few options for customization have been provided to facilitate some advanced use cases.
=== Change Default App ===
''Available since version:'' 0.36.0 <<BR>>
''Skill level:'' Basic
''Use Case'': A !FreedomBox that primarily runs only one public-facing application whose web application is set as the landing page when someone visits the domain name of the !FreedomBox over the internet. <<BR>>
e.g. A university using !MediaWiki running on !FreedomBox as a course wiki wants its students typing in the domain name into their browser to directly go to the wiki bypassing the !FreedomBox home page.
''Configuration:'' Change the [[FreedomBox/Manual/Configure#Default_App|Default App]] in the configure page to whichever app you want to be served as default.
=== Custom Shortcuts ===
''Available since version:'' 0.40.0 <<BR>>
''Skill level:'' Advanced
''Use Case:'' The administrator of a community deployment of !FreedomBox manually installs a few additional unsupported applications on the !FreedomBox and wants users to be able to transparently access them through the web and mobile applications of !FreedomBox.
''Note:'' This feature is meant to be used with applications that are end-user facing, i.e have a web or mobile client.
'''Configuration:'''
!FreedomBox reads custom shortcuts you have created from various files paths on the server. A shortcuts file can be any file with `.json` extension in the following directories: `/etc/freedombox/custom-shortcuts.json.d/`, `/var/lib/freedombox/custom-shortcuts.json.d/` and `/usr/share/freedombox/custom-shortcuts.json.d/`. Or they can be a file named `custom-shortcuts.json` in these directories: `/etc/freedombox/`, `/etc/plinth/` (only for compatibility), `/var/lib/freedombox/` and `/usr/share/freedombox/`. The file should follow the same JSON schema as the !FreedomBox API. You can refer to the JSON schema by visiting `https://<my-freedombox-url>/plinth/api/1/shortcuts`.
As an example, to add one additional shortcut for [[https://nextcloud.com|NextCloud]] app, create a file called `/etc/freedombox/custom-shortcuts.json.d/nextcloud.json` (create directories as needed).
{{{#!highlight json
{
"shortcuts": [{
"name": "NextCloud",
"description": ["Nextcloud is a suite of client-server software for creating and using file hosting services."],
The corresponding icons for the shortcuts listed in the above file should be placed in the directory `/var/www/plinth/custom/static/icons/`. The file names of the icons should match with those provided in `/etc/freedombox/custom-shortcuts.json.d/nextcloud.json`.
After adding an entry for !NextCloud in `nextcloud.json` and an icon, restart Plinth by executing the command {{{ systemctl restart plinth }}} on the !FreedomBox. You can also restart the !FreedomBox from the web interface.
After restart the Plinth home page will display an additional shortcut for !NextCloud as shown below: <<BR>>
{{attachment:nextcloud-frontpage-shortcut.png|NextCloud custom shortcut on the Plinth home page}}
The same shortcut will also be displayed in any Android apps connected to the !FreedomBox. <<BR>>
{{attachment:android-app-custom-shortcut.jpg|NextCloud custom shortcut in the Android app}}
=== Custom Styling ===
''Available since version:'' 24.25 <<BR>>
''Skill level:'' Advanced
''Use Case:'' The administrator of a community or home deployment of !FreedomBox wants to customize the web page styling of !FreedomBox.
''Configuration'': Create a file in the path `/var/www/plinth/custom/static/css/user.css` and write [[https://developer.mozilla.org/en-US/docs/Web/CSS|CSS]] styling rules. This
file has the highest priority as per the [[https://developer.mozilla.org/en-US/docs/Web/CSS/Cascade|cascading rules]]. Use the web browser's developer console to understand which rules to override and how much [[https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity|specificity]] is needed.
{{attachment:customization_styling.png|Home page with customized styling}}
@ -23,17 +23,11 @@ This page describes the process of installing !FreedomBox on a Debian system. Cu
Installing !FreedomBox changes your Debian system in many important ways. This includes installing a firewall and regenerating server certificates. It is hence recommended that you install !FreedomBox on a fresh Debian installation instead of an existing setup.
}}}
{{{#!wiki caution
'''Console/GUI logins for non-admin users will be disabled'''
After !FreedomBox is fully setup, your system will no longer allow users not belonging to the ''admin'' group to log in to the system via console, secure shell (SSH) or graphical login. This behaviour can be disabled from the [[FreedomBox/Manual/Security|Security]] page. Use the administrator account created during !FreedomBox first boot for console logins and add further user accounts to ''admin'' group, if necessary.
}}}
=== Installing on Debian 12 (bookworm) or newer ===
Check the Troubleshooting section below, for any tips or workarounds that might help during the install.
1. [[InstallingDebianOn|Install Debian]] 12 (bookworm), or Unstable (sid) on your hardware.
1. [[InstallingDebianOn|Install Debian]] 12 (Bookworm) or newer on your hardware. During installation choosing "Btrfs" for root filesystem type is recommended as !FreedomBox uses it take regular snapshots of the system.
!FreedomBox is built on the Debian operating system. Approximately every two years, there is a new stable Debian release. !FreedomBox provides the option of [[FreedomBox/Manual/Upgrades#Auto-Update_to_Next_Stable_Release|automatically handling the upgrade]] to the new version of Debian after it is released. A distribution update will bring in major features and changes. Sometimes, old features will stop working. This page documents the expected changes and transitions during a distribution upgrade. If you dislike these changes, you can keep each distribution for at least [[LTS|5 years]] before updating.
The current stable release is Debian 12 "bookworm". It was released on June 10, 2023. Below are additional considerations to have in mind when upgrading to a new release of Debian.
== Debian 13 "trixie" ==
Estimated release date is around August 2025.
=== TT-RSS no longer supported ===
The [[DebianPts:tt-rss]] package has been removed from the next Debian release. It is recommended to move to one of the following options as a replacement:
* [[FreedomBox/Manual/Miniflux|Miniflux]]
* [[FreedomBox/Manual/Nextcloud|Nextcloud News]]
=== Searx app no longer supported ===
The [[DebianPts:searx]] package has been removed from the next Debian release. There is currently no replacement for Searx app in !FreedomBox. Searx app will no longer received security updates, so it is recommended to stop using the app, and to uninstall it.
gpg: assuming signed data in 'freedombox-bookworm_all-amd64.img.xz'
gpg: Signature made Wed 14 Jun 2023 03:22:04 PM PDT
gpg: using RSA key D4B069124FCF43AA1FCD7FBC2ACFC1E15AF82D8C
@ -176,7 +151,7 @@ On MacOS (OSX) you can use programs like ''balenaetcher'' and ''rosaimagewriter'
=== From within FreedomBox ===
!FreedomBox is made up of several software programs and you can obtain the source code to any of them. These instructions are similar to obtaining and [[https://www.debian.org/doc/manuals/maint-guide/build.en.html|building]] [[https://www.debian.org/doc/manuals/apt-howto/ch-sourcehandling.en.html|source code]] [[https://wiki.debian.org/BuildingTutorial|for Debian]] since !FreedomBox is a pure blend of Debian. Using this process you can obtain the source code to the exact version of the package you are currently using in !FreedomBox.
!FreedomBox is made up of several software programs and you can obtain the source code to any of them. These instructions are similar to obtaining and [[https://www.debian.org/doc/manuals/maint-guide/build.en.html|building]] [[https://wiki.debian.org/Packaging/SourcePackage#How_to_Download_a_source_package|source code]] [[https://wiki.debian.org/BuildingTutorial|for Debian]] since !FreedomBox is a pure blend of Debian. Using this process you can obtain the source code to the exact version of the package you are currently using in !FreedomBox.
1. To see the list of software packages installed on your !FreedomBox, run the following in a terminal:
{{{
@ -223,7 +198,7 @@ cd <source_directory>
=== Building Disk Images ===
You can also build !FreedomBox disk images for various hardware platforms using the freedom-maker tool. This is also available as a Debian package and source code for it may be obtained using the above methods. [[https://salsa.debian.org/freedombox-team/freedom-maker/blob/master/README.md|Build instructions]] for creating disk images are available as part of the source code for freedom-maker package.
You can also build !FreedomBox disk images for various hardware platforms using the freedom-maker tool. This is also available as a Debian package and source code for it may be obtained using the above methods. [[https://salsa.debian.org/freedombox-team/freedom-maker/blob/main/README.md|Build instructions]] for creating disk images are available as part of the source code for freedom-maker package.
!FreedomBox disk images are built and uploaded to official servers using automated Continuous Integration infrastructure. This infrastructure is available as [[https://salsa.debian.org/freedombox-team/infrastructure|source code]] too and provides accurate information on how !FreedomBox images are built.
The resulting image will have the modified u-boot in it.
=== Old Signing Keys ===
Some very old disk images of !FreedomBox have been signed by different GPG keys than the one listed above. Those signatures are still valid and can be verified using the older keys.
@ -16,6 +16,12 @@ Dynamic DNS service providers assist in working around a problem. First they pr
For this to work, every time you connect to the Internet, you will have to tell your Dynamic DNS provider what your current IP address is. Hence you need special software on your server to perform this operation. The Dynamic DNS function in !FreedomBox will allow users without a static public IP address to push the current public IP address to a Dynamic DNS Server. This allows you to expose services on !FreedomBox, such as ownCloud, to the Internet.
=== A Free Domain for your FreedomBox ===
You can get a free domain name for your !FreedomBox using the free Dynamic DNS service provided by the !FreedomBox community at https://ddns.freedombox.org . With this service, your domain name will look like ''myaccount.fbx.one'' or ''myaccount.freedombox.rocks'' where ''myaccount'' is the account you created on the service.
The service also provides you with free unlimited number of subdomains. For this, login to the account, go to ''Change Settings'', check the option ''Wild Card'', and click ''Save Changes''. After this you can add any number of subdomains like ''foo.myaccount.fbx.one'' to your !FreedomBox in ''System -> Names -> Add Domain (regular)''. TLS certificates (for HTTPS) will be automatically obtained by !FreedomBox using Let's Encrypt for these subdomains. Subdomains are especially useful for applications that require being hosted on a separate domain, such as [[FreedomBox/Manual/HomeAssistant|Home Assistant]].
=== GnuDIP vs. Update URL ===
There are two main mechanism to notify the Dynamic DNS server of your new IP address; using the ''GnuDIP'' protocol and using the ''Update URL'' mechanism.
@ -27,7 +33,6 @@ On the other hand, the GnuDIP protocol will only transport a salted MD5 value of
=== Using the GnuDIP protocol ===
1. Register an account with any Dynamic DNS service provider. A free service provided by the !FreedomBox community is available at https://ddns.freedombox.org .
1. In !FreedomBox UI, enable the Dynamic DNS Service.
1. Select ''GnuDIP'' as ''Service type'', enter your Dynamic DNS service provider address (for example, ddns.freedombox.org) into ''GnuDIP Server Address'' field.
== Expose a Local Service to Internet using FreedomBox ==
This guide describes to expose a local service you have on your LAN to the internet using a !FreedomBox that is already exposed on the internet.
=== Goal ===
* ''You have a !FreedomBox running'' with a working domain already setup. You are able to access your !FreedomBox using a URL such as `https://www.mysite.example/` .
* ''You have a different server running a local service'' on LAN that you wish to expose to the Internet on the same domain as your !FreedomBox. The local service must be a web service using the HTTP protocol (it is also possible to setup non-HTTP service, but that is a different approach). Optionally, you can have special domain assigned specifically for this local service.
* You wish for ''!FreedomBox to handle the TLS certificates'' for this domain as !FreedomBox typically does. Your local service need not setup and manage TLS certificates.
* Optionally, you may want to ''limit access to local service using !FreedomBox credentials''. Only users with a !FreedomBox account (and belonging to a chosen group) will be able to access this service. The local service will not be available to general public on the Internet. This way you can host local services that don’t implement their own authentication or local services with their own authentication mechanisms disabled.
=== Exposing Local LAN servers ===
* To expose the service, create an Apache configuration file in `/etc/apache2/conf-available/` and write a `ProxyPass` directive. Assuming your local service is running on a computer with IP address `192.168.0.20` on port `3000`, you can do this by running a command (as a root user on the terminal):
* Then, enable this Apache configuration. Run the following command:
{{{#!highlight bash
a2enconf my-local-service
}}}
* Then reload Apache web server.
{{{#!highlight bash
systemctl reload apache2
}}}
You can now access your local service at the following URL `https://www.mysite.example/myservice/` . Note that the URL is a secure URL with `https://`. The certificates will be managed by FreedomBox/Let’s Encrypt. All your other apps and services work as usual. You can add any number services you want this way.
=== Running the Service on FreedomBox Itself ===
The above approach will also work if the local service is running on !FreedomBox itself. In this case, the `ProxyPass` directive in the configuration should be modified to look like `ProxyPass /myservice http://127.0.0.1:3000/`.
=== Disabling the service ===
To disable exposing the local service:
1. Disable the Apache configuration file.
{{{#!highlight bash
a2disconf my-local-service
}}}
1. Then, reload Apache web server.
{{{#!highlight bash
systemctl reload apache2
}}}
=== Adding Authentication ===
You can configure the service to be available to only users with !FreedomBox account. This is a good choice if:
* The local service that is exposed to the Internet should not be available to everyone. And,
* The local service does not provide its own authentication mechanism. Or,
* The local service provides it’s own authentication but you don’t want to maintain a different set of user accounts for that service and want to reuse your !FreedomBox user accounts.
1. Update the Apache configuration file `/etc/apache2/conf-available/my-local-service.conf` to look like the following.
{{{#!highlight apache
<Location /myservice/>
Include includes/freedombox-single-sign-on.conf
ProxyPass http://192.168.0.20:3000/
</Location>
}}}
1. Then, reload Apache web server.
{{{#!highlight bash
systemctl reload apache2
}}}
If you wish for only some groups of users to be able to access the service, another change to the configuration is needed. Make the configuration look like the following if you wish to allow users of “web-search” group and also users of “admin” group to access the local service. All other users even if they have a valid !FreedomBox account will be denied access.
{{{#!highlight apache
<Location /myservice/>
Include includes/freedombox-single-sign-on.conf
<IfModule mod_auth_pubtkt.c>
TKTAuthToken "web-search" "admin"
</IfModule>
ProxyPass http://192.168.0.20:3000/
</Location>
}}}
=== Hosting the Service on a Separate Domain ===
Some services and web applications hosted under a URL fragment such as `/myservice/` do not work well. They require an entire domain or subdomain to be dedicated to them. In these cases too, !FreedomBox can expose local services.
1. First acquire a domain or a subdomain.
* If your domain is a custom domain that you own, go to the DNS settings on your domain name provider and add a subdomain. You can create a CNAME record that simply points to the main domain.
* If you are using !FreedomBox Dynamic DNS service, then login into https://ddns.freedombox.org and enable the “Wildcard” option. With this change, for a domain (such as `example.fbx.one`), all subdomains (such as `myservice.example.fbx.one`) of your domain will point to your main domain.
1. Add the new domain into !FreedomBox. Goto System → Name Services → Domain (regular) → Add. For example, add `myservice.mysite.example`.
1. Then create an Apache configuration file at `/etc/apache2/includes/<domainname>-include.conf`. For our example this is: `/etc/apache2/includes/myservice.mysite.example-include.conf`. The contents of the file should be:
{{{#!highlight apache
ProxyPass / http://192.168.0.20:3000/
}}}
1. Modify the above file for authentication if necessary by adding the `Include` and `<IfModule>` configuration directives as shown in the authentication section above.
=== Troubleshooting ===
When your setup does not work as expected, to debug, run a temporary web service on your !FreedomBox.
1. Create a temporary directory with an index.html page on the !FreedomBox.
{{{#!highlight bash
mkdir temp
cd temp
cat > index.html <<EOL
<!DOCTYPE html>
<html>
<head>
<title>My test page</title>
</head>
<body>
<h1>Hello, World!</h1>
</body>
</html>
EOL
}}}
1. Run a temporary web server (press Control-C to terminate):
{{{#!highlight bash
python3 -m http.server 3000
}}}
1. Update the Apache configuration to point to this temporary service on !FreedomBox.
{{{#!highlight apache
ProxyPass /myservice http://127.0.0.1:3000/
}}}
=== Extras ===
There are many additional features that Apache can provide to improve the local service. For these, [[https://httpd.apache.org/docs/current/|explore Apache documentation]]. Some features include:
* Serving static files such as JS, CSS, and media files from local directory without invoking the local service to improve performance.
* Caching the responses from the local service to improve performance.
* Setting additional headers for security, cache control, etc.
* Modify the HTTP header responses from the service when it does not work well to hosting under a URL fragment such as `/myservice/`.
* Perform redirects from `http://` URL to `https://` and setting HSTS header.
* Load balancing among multiple local services for high availability, scaling, etc.
* And more.
## END_INCLUDE
Back to [[FreedomBox/Features|Features introduction]] or [[FreedomBox/Manual|manual]] pages.
||<tablestyle="float: right;"> {{attachment:Feather-Wiki-on-FreedomBox.png|Feather Wiki icon}} ||
'''Available since''': version 24.17
Feather Wiki is a simple tool to create personal wikis on the web. Each wiki is self-contained within a single HTML file stored on your !FreedomBox. Only !FreedomBox users can read or write to the wiki files. It is also possible to "publish" a Feather Wiki file from within the application.
=== A Nest of Feather Wikis ===
Feather Wiki is a web application that runs entirely in the browser. !FreedomBox implements a Feather Wiki Nest, i.e. an application that can store and manage several Feather Wiki files.
Feather Wiki is a web quine, like its more popular, older and more feature-rich cousin !TiddlyWiki. Every wiki file contains an entire copy of the source code (HTML, CSS and !JavaScript) along with your content, which makes it extremely portable.
The Nest is essentially a !WebDAV server provided by !FreedomBox's Apache web server, so Feather Wiki doesn't require installation of any additional packages. It requires no additional system resources either, since Apache is always running.
=== Setting up wikis ===
Creating and deleting wiki files is handled by the !FreedomBox app itself. Every new wiki file is created from the latest available version of the empty Feather Wiki file downloaded from the official website. Deletion cannot be undone. You have to either restore the deleted file from a backup or import any saved local copy into a new wiki file. Uploading your existing Feather Wiki files is supported if they are at least v1.8.0 (Skylark). For older Feather Wiki files, you can use the import option as described below.
To import an old Feather Wiki file, first create a new wiki on your !FreedomBox.The page called "Wiki Settings" in Feather Wiki provides a button that lets you import the contents of an existing wiki file into a new wiki by uploading the file from your local machine.
Upgrading Feather Wiki is a manual process that is very similar to importing.
1. Save a local copy of the wiki file.
2. Delete the wiki file from the server.
3. Create a new empty wiki file (this will be of the latest version by default).
4. Open the new wiki.
5. Import the contents of your local copy into the new wiki from the "Wiki Settings" page.
The Feather Wiki app on !FreedomBox doesn't provide a "public access" option, unlike !MediaWiki. To share your wiki file with someone who doesn't have an account on your !FreedomBox or to publish the file on the Internet, follow these steps:
1. Save a local copy of the wiki file.
2. Open the local copy in a web browser.
3. Go to "Wiki Settings" page and enable the "Publish" setting. (This makes the wiki non-editable. Hence the local copy.)
4. Save the local copy.
Now you can share the HTML file or publish it on the web using [[FreedomBox/Manual/Apache_userdir|Apache userdir]] or placing it under the /var/www/html directory on your !FreedomBox.
=== As many wikis as you need ===
The source code of Feather Wiki is tiny - less than 60 kilobytes. You are encouraged to create as many wiki files as you need, since the storage cost of each file is negligible, even on a !FreedomBox running from an SD card.
The shortcut for Feather Wiki app opens a page with the list of wiki files stored on !FreedomBox. Creating a front page shortcut for each wiki file (like Ikiwiki does) would clutter the front page, considering the number of Feather Wiki files people might create.
=== Use cases ===
* '''Notebook:''' A student can use Feather Wiki as a web notebook with one wiki file per course. About 40 files for a bachelor's degree!
* '''Self-publishing:''' An author can self-publish an online book using Feather Wiki as a !GitBook alternative.
* '''Refile:''' One wiki file as a general notes dump that can be refiled later into more organized formats.
* One wiki file for each issue of a magazine (indie web zine) maybe with some custom CSS added.
* Simple internal websites for organizations to publish information.
* One Feather Wiki file for each of your projects. Keep all project-related notes and tasks in one file.
* Shipping documentation/user-guide with your product, in a single file.
For more inspiration, see the [[https://feather.wiki/?page=gallery|Gallery]] on the official website.
You might want to configure your wiki with different [[https://feather.wiki/?page=extensions|extensions]] for Feather Wiki depending on the use case.
=== External links ===
* Website: https://feather.wiki
* Source code for Feather Wiki: https://codeberg.org/Alamantus/FeatherWiki
## END_INCLUDE
Back to [[FreedomBox/Features|Features introduction]] or [[FreedomBox/Manual|manual]] pages.
@ -12,7 +12,17 @@ In addition to supporting various single board computers and other devices, any
== Recommended Hardware ==
On April 22nd, 2019, the !FreedomBox Foundation announced the [[https://freedomboxfoundation.org/buy/|sales]] of the Pioneer Edition !FreedomBox Home Server Kits. This is the recommended pre-installed hardware for all users who don't wish to build their own !FreedomBox by choosing the right components, downloading the image and preparing an SD card with !FreedomBox.
=== Libre Crafts FreedomBox ===
Libre Crafts in an endeavor from the !FreedomBox developers themselves to bring you a powerful !FreedomBox device capable of hosting even the most demanding home server needs. The device is crafted, tested, and delivered to you by !FreedomBox developers. Your purchase helps !FreedomBox development.
This hardware features a powerful CPU, plenty of main memory, a fast OS disk, ability to add two high capacity hard disk drives, dual multi-gigabit Ethernet ports, all with a low power consumption. Use it to host all your photos, to backup all home devices, as a NAS, as home automation hub, as a desktop computer, and more all at once.
On April 22nd, 2019, the !FreedomBox Foundation announced the [[https://freedomboxfoundation.org/buy/|sales]] of the Pioneer Edition !FreedomBox Home Server Kits. This pre-installed hardware is for all users who don't wish to build their own !FreedomBox by choosing the right components, downloading the image and preparing an SD card with !FreedomBox.
The kit includes all the hardware needed for launching a !FreedomBox home server on an Olimex A20-OLinuXino-LIME2 board. This product provides the perfect combination of open source hardware and free and open source software. By purchasing this product, you also support the !FreedomBox Foundation's efforts to create and promote its free and open source server software.
@ -160,7 +170,6 @@ All !FreedomBox disk images for different hardware is built by the project using
Home Assistant is a home automation hub with emphasis on local control and privacy. It integrates with thousands of devices including smart bulbs, alarms, presence sensors, door bells, thermostats, irrigation timers, energy monitors, etc.
Please note that Home Assistant is installed and run inside a container provided by the Home Assistant project. Security, quality, privacy and legal reviews are done by the upstream project and not by Debian/FreedomBox. Updates are performed following an independent cycle.
Home Assistant app is considered experimental in !FreedomBox as it is fairly new to our ecosystem. You may face issues working with it or the app may undergo major breaking changes.
=== Hardware ===
Home Assistant can detect, configure, and use various devices on the local network. For example, if a device is connected using Wi-Fi or LAN to the same network as !FreedomBox, Home Assistant can detect, configure, and use the device. Other home automation protocols such as Thread, !ZigBee, and Z-Wave are also supported but require additional hardware to be connected to your !FreedomBox. For example, if you have a door sensor that speaks !ZigBee, you need to attach a !ZigBee USB dongle to your !FreedomBox. Home Assistant can then detect and use the door sensor on the !ZigBee network. '''Note:''' if you attach any such hardware to FreedomBox after you install the Home Assistant app, then you need to disable and re-enable the Home Assistant app before the hardware can be discovered and used by Home Assistant.
Home Assistant is a comprehensive solution for your home automation needs supporting thousands of devices. You can check whether a device is supported by Home Assistant by visiting the [[https://www.home-assistant.io/integrations/|integrations]] page. Other devices which are not listed may also be supported when they are similar to supported devices. It is recommended that you purchase hardware that advertises support for Home Assistant.
Many home automation devices connect to or send data to their manufacturers' servers. This can be a serious violation of your home's privacy. These devices may also stop working when their manufacturer goes bankrupt, decides to close the product line, or forces you to purchase newer models. It is strongly recommended that you purchase hardware that works locally with a home automation hub (in this case Home Assistant) without connecting to manufacturer's servers. These are listed under the categories "Local Push" or "Local Polling" in the Home Assistant's integrations page.
=== Need for Subdomain ===
Unlike most other apps in !FreedomBox which work on a path like `https://mydomain.example/app`, Home Assistant requires a separate dedicated subdomain such as `https://homeassistant.mydomain.example`. Before configuring the Home Assistant app, you must create a subdomain using System -> [[FreedomBox/Manual/NameServices|Name Services]]. See the documentation for Name Services to understand how you can acquire a subdomain.
=== Setup ===
After the app is installed, Home Assistant web interface must be setup. An administrator account is created at this time. Home Assistant maintains its own user accounts separate from user accounts created on !FreedomBox.
When new USB dongles are added to make Home Assistant talk to devices on networks like Thread, !ZigBee, and Z-Wave, then setup operation must be re-run on the app. This operation is available in the Extras menu drop down with gears icon in the Home Assistant app page. Setup must also be re-run when the hardware is removed. Otherwise, Home Assistant service will fail to start.
=== Usage ===
Home Assistant provides a fully functional web application and a mobile application. Simply login and start using:
{{attachment:homeassistant-login.png|Login}}
{{attachment:homeassistant-ui.png|Web UI}}
{{attachment:homeassistant-app.png|Mobile App}}
=== Advanced Manual Configuration ===
If you wish to perform your own customization to Home Assistant setup, feel free to edit Home Assistant configuration files manually. Configuration, scenes, automations, scripts, secrets, database, and log files are all stored in the directory `/var/lib/home-assistant-freedombox/config` directory. You will need to disable and re-enable the app after configuration changes for them to take effect. Note that when !FreedomBox itself modifies these files, it will not preserve comments and other formatting.
=== External links ===
* Website: https://www.home-assistant.io/
* Source code for Home Assistant: https://github.com/home-assistant/core
* Source code for Home Assistant container image: https://github.com/home-assistant/docker
## END_INCLUDE
Back to [[FreedomBox/Features|Features introduction]] or [[FreedomBox/Manual|manual]] pages.
The Invisible Internet Project is an anonymous network layer intended to protect communication from censorship and surveillance. I2P provides anonymity by sending encrypted traffic through a volunteer-run network distributed around the world.
=== Services Offered ===
The following services are offered via I2P in !FreedomBox by default. Additional services may be available when enabled from I2P router console that can be launched from !FreedomBox web interface.
* '''Anonymous Internet browsing''': I2P can be used to browse Internet anonymously. For this, configure your browser (preferable a Tor Browser) to connect to I2P proxy. This can be done by setting HTTP proxy and HTTPS proxy to ''freedombox.local'' (or your !FreedomBox's local IP address) and ports to ''4444'' and ''4445'' respectively. This service is available only when you are reaching !FreedomBox using local network (networks in internal zone) and not available when connecting to !FreedomBox from the Internet. One exception to this is when you connect to !FreedomBox's VPN service from Internet you can still use this service.
* '''Reaching eepsites''': I2P network can host websites that can remain anonymous. These are called eepsites and end with .i2p in their domain name. For example, http://i2p-projekt.i2p/ is the website for I2P project in the I2P network. eepsites are not reachable using a regular browser via regular Internet connection. To browse eepsites, your browser needs to be configured to use HTTP, HTTPS proxies as described above. This service is available only when you are reaching !FreedomBox using local network (networks in internal zone) and not available when connecting to !FreedomBox from the Internet. One exception to this is when you connect to !FreedomBox's VPN service from Internet you can still use this service.
* '''Anonymous torrent downloads''': I2PSnark, an application for anonymously downloading and sharing files over the !BitTorrent network is available in I2P and enabled by default in !FreedomBox. This application is controlled via a web interface that can be launched from 'Anonymous torrents' section of I2P app in !FreedomBox web interface or from the I2P router console interface. Only logged-in users belonging to 'Manage I2P application' group can use this service.
* '''IRC network''': I2P network contains an IRC network called Irc2P. This network hosts the I2P project's official IRC channel among other channels. This service is enabled by default in !FreedomBox. To use it, open your favourite IRC client. Then configure it to connect to host ''freedombox.local'' (or your !FreedomBox's local IP address) with port number ''6668''. This service is available only when you are reaching !FreedomBox using local network (networks in internal zone) and not available when connecting to !FreedomBox from the Internet. One exception to this is when you connect to !FreedomBox's VPN service from Internet you can still use this service.
* '''I2P router console''': This is the central management interface for I2P. It shows the current status of I2P, bandwidth statistics and allows modifying various configuration settings. You can tune your participation in the I2P network and use/edit a list of your favourite I2P sites (eepsites). Only logged-in users belonging to 'Manage I2P application' group can use this service.
=== External links ===
* Upstream website: https://geti2p.net/en/
* User documentation: https://i2pd.readthedocs.io/en/latest/
## END_INCLUDE
Back to [[FreedomBox/Features|Features introduction]] or [[FreedomBox/Manual|manual]] pages.
[[https://en.wikipedia.org/wiki/Kiwix|Kiwix]] can serve archives of websites offline. It was originally created to serve an offline version of Wikipedia, the free encyclopedia.
=== Use Cases ===
[[https://en.wikibooks.org/wiki/FreedomBox_for_Communities|FreedomBox for Communities]] was already using Kiwix years before it was officially included as an app. Kiwix was used to serve content over community Wi-Fi networks in [[https://en.wikipedia.org/wiki/Gangadevipalli#Free_Community_WiFi|villages]] of India with unreliable or insufficient Internet access. In addition to an offline Wikipedia, Kiwix served
* the archive "Wikipedia for Schools" which was used by school teachers and students for homework assignments and as a teaching aid.
* the archive "!WikiSource (in Telugu)" which served as a digital library.
Kiwix is also useful when you have reliable Internet access.
1. Archival and preservation: Archives of websites can be created and preserved as ZIM files. These archives can be served using Kiwix.
2. Fast access to slow websites: An offline archive can be faster to access than a website.
3. Access to websites that can be temporarily unavailable. For example, the Low Tech Magazine is hosted on a solar-powered single-board computer and could go offline sometimes. There is a Kiwix archive available for it which can be hosted locally.
=== Kiwix on FreedomBox ===
!FreedomBox serves the Debian package called kiwix-tools which allows managing and serving content archives in ZIM file format. ZIM files can be added or removed by a !FreedomBox administrator or any user in the "kiwix" user group.
Kiwix on !FreedomBox is available via web interface only. There are mobile and desktop clients for Kiwix, but they can only read local archives. They cannot pull content from Kiwix hosted on !FreedomBox.
The web interface of Kiwix is available for public access by default.
=== Finding content archives ===
To find content for Kiwix, go to [[https://library.kiwix.org|library.kiwix.org]]. You can download archives (called "books") using direct download or using BitTorrent. The website itself is a Kiwix installation, so you can have a preview of the content before downloading, to check that the archive is not broken.
An alternative source of the same files is [[https://wiki.kiwix.org/wiki/Main_Page|wiki.kiwix.org]], a wiki with download links and more information about the Kiwix project.
=== Creating content archives ===
The [[https://openzim.org/|OpenZim]] project maintains tools to create ZIM files. The tool [[https://github.com/openzim/zimit|zimit]] is a complete solution that can scrape a website and create a ZIM file. You can also request a ZIM archive using the website [[https://youzim.it|youzim.it]].
@ -24,7 +24,7 @@ Freedom Maker is [[https://www.gnu.org/philosophy/|Free Software]] licensed unde
=== Building FreedomBox Images ===
* You can get Freedom Maker from its [[https://salsa.debian.org/freedombox-team/freedom-maker.git|Git repository]] and follow the instructions in the README to [[https://salsa.debian.org/freedombox-team/freedom-maker/blob/master/README.md|build a FreedomBox image]].
* You can get Freedom Maker from its [[https://salsa.debian.org/freedombox-team/freedom-maker.git|Git repository]] and follow the instructions in the README to [[https://salsa.debian.org/freedombox-team/freedom-maker/blob/main/README.md|build a FreedomBox image]].
'''Available since:''' !FreedomBox on Debian 13 (Trixie)
Miniflux is a minimalist and opinionated news feed reader supporting a wide variety of feed formats - RSS, ATOM, RDF and JSON. It is an alternative to [[FreedomBox/Manual/TinyTinyRSS|Tiny Tiny RSS]] on !FreedomBox.
=== Clients ===
The primary web interface is mobile-friendly and optimized for readability. Miniflux is a progressive web application. It can be added to the home screen on mobile and accessed like a native application.
Miniflux server provides an API for clients. It is also compatible with existing applications built for Fever or Google Reader API. There is a listing of [[https://miniflux.app/docs/apps.html|clients]] for various desktop and mobile platforms on the official website.
=== Reader ===
Miniflux's reader supports several content types. In addition to the usual blog posts and comics which most feed readers support, you can also listen to podcasts and play videos from within Miniflux. !YouTube videos are played using youtube-nocookie.com or (optional) a proxy like invidious.io to prevent tracking your preferences across websites. Miniflux also removes tracking pixels and all external !JavaScript.
Miniflux has a content scraper that allows you to fetch and read the full article even if the site only publishes a summary in their feed. Only the relevant content is scraped, providing a reading experience similar to Firefox Reader View. This scraper is also capable of fetching the video duration from !YouTube or Invidious.
=== Other Features ===
Miniflux provides some quality-of-life features like full-text search (powered by PostgreSQL database), [[https://miniflux.app/docs/rules.html|filtering rules]], [[https://miniflux.app/docs/keyboard_shortcuts.html|keyboard shortcuts]] and touch events. There are integrations with several applications like read-it-later solutions, bookmarking tools (Shaarli) and messaging apps (Matrix). If you don't use Shaarli, starring an article within Miniflux is equivalent to bookmarking it.
Miniflux doesn't permit installing additional plugins or themes. You can pick one of the existing light/dark themes or install a browser extension to read in a different theme.
=== Miniflux on FreedomBox ===
==== User Management ====
Miniflux does not integrate with the existing single sign-on mechanisms in !FreedomBox. The !FreedomBox app for Miniflux provides an option to create administrator users. Once an administrator user is created, any further users (administrator or not) can be created and managed from within Miniflux settings.
The !FreedomBox app also provides an option to reset any Miniflux user's password. This is especially convenient in the case where there is only one person using Miniflux. Without this option, in case the only user of Miniflux forgets their password, another administrator user must be created to reset this user's password from Miniflux settings.
Since Miniflux accounts are not tied to !FreedomBox accounts, you can provide Miniflux accounts to your friends who do not have accounts on your !FreedomBox.
Name Services provides an overview of ways the box can be reached from the public Internet: domain name, Tor Onion Service, and Pagekite. For each type of name, it is shown whether the HTTP, HTTPS, and SSH services are enabled or disabled for incoming connections through the given name.
Name Services provides an overview of ways the box can be reached from the public Internet: domain name, Tor Onion Service, and Pagekite. For each type of name, it is shown whether the HTTP, HTTPS, and SSH services are enabled or disabled for incoming connections through the given name. It also shows and allows configuring how !FreedomBox performs domain name resolutions.
=== Adding Domain Name to FreedomBox ===
Domain names are unique names assigned to computers and servers to identify and reach them easily without having remember their more technical (IP) addresses.
Adding at least one domain name to your !FreedomBox through one of the supported methods is necessary if you wish to access various apps from outside of your home network. Even at home, adding a domain name allows you to have a TLS certificate that is essential for accessing apps securely through HTTPS. The following types of domains are supported:
* A regular domain that is purchased from a domain registrar. These domains looks like `mydomain.example`. These types of domains require that your !FreedomBox machine or your home network router have a public IP address provided by your ISP. All apps can be accessed using these domains.
* A dynamic domain that can obtained from a dynamic DNS provider. !FreedomBox foundation provides a free dynamic DNS domain for all !FreedomBox users at https://ddns.freedombox.org . These domains look like `mydomain.fbx.one` or `mydomain.freedombox.rocks`. These types of domains require that your !FreedomBox machine or your home network router have a public IP address provided by your ISP. The public IP may be changed by the ISP regularly and DNS records will be updated accordingly. All apps can be accessed using these domains. These types of domains are configured using the [[FreedomBox/Manual/DynamicDNS|Dynamic DNS]] app in !FreedomBox.
* A Tor Onion domain that can be obtained by setting up Tor app. These domains look like `mysitenameyx4fi3l6x2gyzmtmgxjyqyorj9qsb5r543izcwymle.onion`. These types of domains don't require a public IP address from your ISP. However, only web or SSH based services/apps work on this type of domain. Further, only users of Tor will be able to reach these domains. A regular browser will not be able to reach these services. These types of domains are configured using the [[FreedomBox/Manual/Tor|Tor]] app in !FreedomBox.
* A !PageKite domain that can obtained from a !PageKite service provider. This service can be purchased at https://pagekite.net . These domains look like `https://mydomain.pagekite.net`. These types of domains don't require a public IP address from your ISP. However, only web or SSH based services/apps work on this type of domain. These types of domains are configured using the [[FreedomBox/Manual/PageKite|PageKite]] app in !FreedomBox.
=== Subdomains ===
Subdomains are similar to domains, but reside under the a domain name. For example, for a domain `mydomain.example` a subdomain could be `myapp.mydomain.example`. Some applications such as [[FreedomBox/Manual/HomeAssistant|Home Assistant]] in !FreedomBox require you to setup and access them over a subdomain instead of a URL path. You can obtain and setup subdomains in the following ways:
* If you own a regular domain (as described above), you can login to the web console provided by your domain registrar and add a subdomain. Make the subdomain a CNAME of the original domain or assign A and AAAA records similar to the original domain. See your domain registrar's documentation for more information. After adding DNS entries for the subdomain, let !FreedomBox know that it can use the subdomain by adding it as another regular domain. TLS certificates (for HTTPS) will be automatically obtained by !FreedomBox using Let's Encrypt for these subdomains.
* If you have a dynamic domain name from !FreedomBox foundation, you can also get an unlimited number of free subdomains. For this, login to your account at https://ddns.freedombox.org, go to `Change Settings`, check the option `Wild Card`, and click `Save Changes`. After this you can add any number of subdomains like `foo.myaccount.fbx.one` to your !FreedomBox in `System` -> `Names` -> `Add Domain (regular)`. TLS certificates (for HTTPS) will be automatically obtained by !FreedomBox using Let's Encrypt for these subdomains. Also see [[FreedomBox/Manual/DynamicDNS|Dynamic DNS]] documentation page.
=== systemd-resolved ===
From release 24.19, !FreedomBox uses systemd-resolved as caching DNS resolver and replaces resolvconf for managing DNS server configuration. This improves privacy and security. Newer installations will come with systemd-resolved and older machines will automatically switch after an upgrade to this new release.
systemd-resolved automatically acquires DNS servers from Network Manager, the default and recommended way to configure networks on !FreedomBox. However, if you are manually managing network configuration by editing /etc/network/interfaces, you will need to ensure that the DNS servers acquired are passed on to systemd-resolved. Otherwise, Fallback DNS servers will be used. See below.
=== Support for DNS-over-TLS and DNSSEC ===
systemd-resolved supports DNS-over-TLS. This protocol allows encrypting DNS
communication between !FreedomBox and the DNS server if your DNS server
(typically provided by your ISP, sometimes a separate service) has support for
it. This improves both privacy and security as it makes it harder for
intermediaries to see the communication or manipulate it. New settings for
enabling DNS-over-TLS are available at the global level (for all network interfaces) in Name Services app and at the per-connection level in the Networks app's connection settings.
systemd-resolved supports DNSSEC. This standard allows website owners to sign
their DNS records allowing clients to authenticate them. This improves security
by making it harder to manipulate DNS responses. If your DNS server supports
this feature, it can be turned on. New setting for enabling DNSSEC is available
in the Name Services app.
You can detect whether your current DNS supports DNS-over-TLS and DNSSEC by turning them on in the settings one at a time and running the diagnostics for the Names app. There is a diagnostic check which detects whether you can successfully resolve the domain name deb.debian.org.
=== Setting a custom DNS server ===
If your current DNS server provided by your ISP does not support DNS-over-TLS or DNSSEC
features, is censoring some domains names, or if you don't trust them enough,
you can instead use one of the publicly available DNS servers. This can be done by
editing network connections in the Networks app and adding DNS servers manually.
You will need to deactivate and re-activate the network connection (or restart
!FreedomBox) for the settings to become active. After this, Names app will show you the
currently configured DNS servers.
=== Fallback DNS servers ===
In some cases, when internet connection is available to the system by no DNS servers are known to systemd-resolved, the fallback DNS servers are used. This may happen, for example, due to misconfiguration when manually managing network configuration instead of using !FreedomBox's default, the Network Manager. These fallback DNS servers, as defaulted by the upstream systemd project, include servers from Cloudflare and Google DNS servers. This has privacy implications but we felt that it was important to avoid !FreedomBox from becoming unreachable due to misconfiguration. It was a difficult decision. Once you have proper DNS configuration and you know that it works, you can turn off fallback DNS servers using a new setting in the Privacy app. There is also a renewed notification in the web interface that will attract your attention towards this. You may also edit the list of Fallback DNS servers by creating a configuration file for systemd-resolved. See [[https://www.freedesktop.org/software/systemd/man/latest/systemd-resolved.html|systemd-resolved documentation]].
This page is new and needs a Nexcloud user to help with the content. This could be you!
Nextcloud is a self-hosted productivity platform which provides private and secure functions for file sharing, collaborative work, and more. Nextcloud includes the Nextcloud server, client applications for desktop computers, and mobile clients. The Nextcloud server provides a well integrated web interface.
All users of !FreedomBox can use Nextcloud. To perform administrative actions, use the "nextcloud-admin" user after setting a password here.
Please note that Nextcloud is installed and run inside a container provided by the Nextcloud community. Security, quality, privacy and legal reviews are done by the upstream project and not by Debian/FreedomBox. Updates are performed following an independent cycle.
{{{#!wiki comment
=== Screenshot ===
Please add a screenshot of your Nextcloud suitable for public display.
}}}
{{{#!wiki comment
=== Using Nextcloud ===
If you are a Nextcloud user share how this is done.
If this app has or needs client applications (apart from a web browser) list these here. As a Debian pure-blend the FreedomBox wiki should be suggesting client software that adheres to the Debian Free Software Guidelines. If this is not possible it should be noted.
}}}
## END_INCLUDE
Back to [[FreedomBox/Features|Features introduction]] or [[FreedomBox/Manual|manual]] pages.
@ -25,7 +25,8 @@ The [[https://www.olimex.com/Products/OLinuXino/Home-Server/Pioneer-FreedomBox-H
* an optional storage add-on for hard disk (HDD) or solid-state drive (SSD)
=== Recommended Hardware ===
This is the hardware recommended for all users who just want a turn-key !FreedomBox, and '''don't''' want to '''build''' their own one.
This is a hardware recommended for all users who just want a turn-key !FreedomBox, and '''don't''' want to '''build''' their own one.
(Building your own !FreedomBox means some technical stuff like choosing and buying the right components, downloading the image and preparing the SD card).
@ -78,7 +79,7 @@ You can order a storage add-on along with the Pioneer Edition !FreedomBox Home S
The kits come with an SD card pre-loaded with !FreedomBox. There's '''NO need to download images'''.
However, if you wish to reset your devices to a pristine state, then you can do so with the image provided. Follow the instructions on the [[FreedomBox/Download|download]] page to create a !FreedomBox SD card and boot the device. Make sure to download the [[https://ftp.freedombox.org/pub/freedombox/pioneer/|Pioneer Edition]] images. These SD card images are meant for use with the on-board SD card slot and won't work when used with a separate SD card reader connected via USB.
However, if you wish to reset your devices to a pristine state, then you can do so with the image provided. Follow the instructions on the [[FreedomBox/Download|download]] page to create a !FreedomBox SD card and boot the device. Make sure to download the [[https://ftp.freedombox.org/pub/freedombox/hardware/pioneer/|Pioneer Edition]] images. These SD card images are meant for use with the on-board SD card slot and won't work when used with a separate SD card reader connected via USB.
An alternative to downloading these images is to [[InstallingDebianOn/Allwinner|install Debian]] on the device and then [[FreedomBox/Hardware/Debian|install FreedomBox]] on it.
@ -145,7 +146,7 @@ cd <source_directory>
==== Building Disk Images ====
You can also build !FreedomBox disk images for various hardware platforms using the freedom-maker tool. This is also available as a Debian package and source code for it may be obtained using the above methods. [[https://salsa.debian.org/freedombox-team/freedom-maker/blob/master/README.md|Build instructions]] for creating disk images are available as part of the source code for freedom-maker package.
You can also build !FreedomBox disk images for various hardware platforms using the freedom-maker tool. This is also available as a Debian package and source code for it may be obtained using the above methods. [[https://salsa.debian.org/freedombox-team/freedom-maker/blob/main/README.md|Build instructions]] for creating disk images are available as part of the source code for freedom-maker package.
!FreedomBox disk images are built and uploaded to official servers using automated Continuous Integration infrastructure. This infrastructure is available as [[https://salsa.debian.org/freedombox-team/infrastructure|source code]] too and provides accurate information on how !FreedomBox images are built.
* You can also get !FreedomBox Service from its [[https://salsa.debian.org/freedombox-team/freedombox/|Git repository]] and [[https://salsa.debian.org/freedombox-team/freedombox/blob/master/INSTALL.md|install from source]].
* You can also get !FreedomBox Service from its [[https://salsa.debian.org/freedombox-team/freedombox/|Git repository]] and [[https://salsa.debian.org/freedombox-team/freedombox/blob/main/INSTALL.md|install from source]].
=== Screenshots ===
@ -49,7 +49,7 @@ We are looking for help to improve !FreedomBox Service. You can contribute to !
* The primary Git repository is hosted at [[https://salsa.debian.org/freedombox-team/freedombox/|FreedomBox Salsa Page]].
* Instructions for [[https://salsa.debian.org/freedombox-team/freedombox/blob/master/INSTALL.md|installing from source]] and [[https://salsa.debian.org/freedombox-team/freedombox/blob/master/HACKING.md|hacking the source]] are available.
* Instructions for [[https://salsa.debian.org/freedombox-team/freedombox/blob/main/INSTALL.md|installing from source]] and [[https://salsa.debian.org/freedombox-team/freedombox/blob/main/HACKING.md|hacking the source]] are available.
* List of bugs, TODO items and feature requests are available on the [[https://salsa.debian.org/freedombox-team/freedombox/issues|issue tracker]].
@ -15,18 +15,35 @@ The easy way is to [[https://freedomboxfoundation.org/buy/|buy]] a !FreedomBox k
Alternatively you may choose to build it yourself, by gathering all the components:
* A supported [[FreedomBox/Hardware|device]] (including any device that can run Debian). We will call that the !FreedomBox in the rest of this manual.
* A power cable for your device.
* An ethernet cable.
* An Ethernet cable.
* A microSD card (or equivalent storage media for your device), prepared according to the instructions on the [[FreedomBox/Download|Download]] page.
== How to get started ==
1. Plug one end of your ethernet cord into your !FreedomBox's ethernet port, and plug the other end into your router.
1. Plug one end of your Ethernet cord into your !FreedomBox's Ethernet port, and plug the other end into your router.
1. Power on the !FreedomBox.
* '''Note:''' On most single board computers, don't expect any output on a monitor connected via HDMI as the support may not exist in the kernel. See below to access and control your !FreedomBox via network.
1. On first boot, !FreedomBox will perform its initial setup (older versions of !FreedomBox reboot after this step). This process may take several minutes on some machines. After giving it about 10 minutes, proceed to the next step.
1. After the !FreedomBox has finished its initial setup, you can access its web interface through your web browser.
* If your computer is connected directly to the !FreedomBox through a second (LAN) ethernet port, you can browse to: http://freedombox/ or http://10.42.0.1/.
* If your computer supports mDNS (GNU/Linux, Mac OSX or Windows with mDNS software installed), you can browse to: http://freedombox.local/ (or http://the-hostname-you-entered-during-install.local/)
* If your computer is connected to a monitor and !FreedomBox is able to display text to it, then the login prompt shows the web address. It looks like this:
{{{
Debian GNU/Linux 13 freedombox tty1
FreedomBox
To start using FreedomBox and to create an account, access using a web browser
one of the following URLs.
http://freedombox.local/
http://192.168.0.2/
http://[fe80::7207:12ff:fe34:5678]/
...
freedombox login:
}}}
* If your computer is connected directly to the !FreedomBox through a second (LAN) Ethernet port, you can browse to: http://freedombox/ or http://10.42.0.1/.
* If you know your way around the router's web interface, you can look up the IP address of the !FreedomBox there, and browse to that address.
* If none of these methods are available, then you will need to figure out the IP address of your !FreedomBox. You can use the "nmap" program from your computer to find its IP address:
{{{
@ -56,8 +73,7 @@ Alternatively you may choose to build it yourself, by gathering all the componen
1. On accessing !FreedomBox's web interface your browser will warn you that it communicates securely but that it regards the security certificate for doing so as invalid. This is a fact you need to accept because the certificate is auto generated on the box and therefore "self-signed" (the browser might also use words such as "untrusted", "not private", "privacy error" or "unknown issuer/authority"). Telling your browser that you are aware of this might involve pressing buttons such as "I understand the Risks", "proceed to ... (unsafe)" or "Add exception". After installation this certificate can be changed to a normal one using the Let's Encrypt option.
If the domain name you are using already has a valid certificate from a recognised Certificate Authority, such as from Let's Encrypt, you may not be able to access the web interface. This means that the option to continue will not be offered. This might occur, for example, if you are reinstalling your !FreedomBox or are otherwise reusing a domain name that has an associated certificate.
@ -74,8 +90,11 @@ Alternatively you may choose to build it yourself, by gathering all the componen
1. The next page asks you to provide a user name and password. Fill in the form, and then click "Create Account."
* Note: The user that you create here has ``Admin`` privileges and can also [[FreedomBox/Manual/SecureShell|log in using ssh]]. For additional security, you may want to use a separate account for administrative tasks and for your normal, daily use. You can add more users later.
1. After completing the form, you will be logged in to !FreedomBox's web interface and able to access apps and configuration through the interface.
1. After completing the form, you will be logged in to !FreedomBox's web interface and asked if you wish to receive more frequent updates (recommended).
1. Setup is complete. Now you can examine and possibly update several key configuration items or see which apps are available. Until you dismiss them, notifications accessible from the menu bar will remind you to review the key configuration items.
Now you can try [[FreedomBox/Features|any of the Apps]] that are available on !FreedomBox.
@ -93,7 +112,7 @@ The front page includes shortcuts to apps that have been installed and are enabl
=== Apps menu ===
The Apps menu can be accessed by clicking the grid icon, next to the !FreedomBox logo. This page lists all of the apps that are available for installing on !FreedomBox. Click the name of an app to visit its page, where you can install and configure it.
The Apps menu can be accessed by clicking the grid icon, next to the !FreedomBox logo. This page lists all of the apps that are available for installing on !FreedomBox. Click the name of an app to visit its page, where you can install and configure it. Currently installed and enabled apps are shown above the remaining available apps.
Pine64's [[https://www.pine64.org/rockpro64/|RockPro64]] is a powerful single board computer. It uses the Rockchip RK3399 Hexa Core ARM64 processor. !FreedomBox images are built and tested for this device.
Pine64's [[https://pine64.org/devices/rockpro64/|RockPro64]] is a powerful single board computer. It uses the Rockchip RK3399 Hexa Core ARM64 processor. !FreedomBox images are built and tested for this device.
'''Important:''' Read [[FreedomBox/Hardware|general advice]] about hardware before building a !FreedomBox with this single board computer.
@ -20,15 +20,13 @@ The content can be shared publicly or restricted to the users of listed allowed
=== Setting Up Shares ===
For the users to access the content through their browser it must exist and have a share. A share is an entry in the Sharing app relating:
* the Name (an thereby the URL) with which the users will ask for the content,
* the Disk Path of the content to be served and
* the sharing mode. On restricted mode, it also has the list of allowed groups.
Many shares can coexist in the same server.
Only admins can create, edit or remove shares. They'll find the Sharing app in the Apps section of !FreedomBox web interface. Sharing app is an easy to use web application with an evident interface.
Each share has its own sharing mode (public or restricted) setting. Only groups recognized by !FreedomBox service can be combined in the list of allowed groups. Groups created in the CLI won't be offered by the Sharing app.
* In !FreedomBox web interface, enable the Sharing App. Only admins can create, edit or remove shares. They'll find the Sharing app in the Apps section of the !FreedomBox web interface. Many shares can coexist in the same server.
* Add a new share
* Give it a name (an thereby the URL) with which the users will ask for the content. In the example above it would be called ''content_name''.
* The Disk Path of the content to be served. This path is relative to ''root'' on your !FreedomBox. For instance ''/var/lib/freedombox/sharing/content_name'' might be a choice.
* Sharing mode. On restricted mode, it also has the list of allowed groups. Only groups recognized by !FreedomBox service can be combined in the list of allowed groups. Groups created in the CLI won't be offered by the Sharing app.
* Create the directory specified under ''Disk Path'' on your !FreedomBox through ''Cockpit'', ''Nautilus'' or remote login.
* Make sure the user, who will provide the content, has write access to that directory for instance by making him the owner of that directory.
=== Providing/Updating Content ===
@ -46,8 +44,8 @@ Sharing will share the content using the built-in Apache web server.
!TiddlyWiki is an interactive, nonlinear web notebook for capturing and organizing complex information. It can serve as a knowledge management system for one person. It is portable (single HTML file), highly customizable and easy to use. Despite being a single HTML file, !TiddlyWiki can embed multiple types of media - images, audio, video and PDF files (or refer to them by file paths, not as portable). It can also store data in JSON format.
=== TiddlyWiki on FreedomBox ===
!FreedomBox includes a native implementation of a Feather Wiki Nest (a server to save your wiki files). The same is used to host !TiddlyWiki files. This implementation is not as efficient as the official !TiddlyWiki server which can save one Tiddler at a time, instead of saving the entire HTML file.
==== Bandwidth considerations with the Autosave setting ====
Each empty !TiddlyWiki file (2.4 MB) is 40x the size of an empty Feather Wiki file (60 KB). !TiddlyWiki has autosave enabled by default. This causes the entire wiki file to be transmitted to the server, each time an individual Tiddler is saved. You might write long wiki pages in Feather Wiki, but !TiddlyWiki encourages writing lots of short Tiddlers which results in more saves for the same amount of text. !TiddlyWiki files tend to grow large as you add media content, with people growing their wikis to 100 MB in size over the years.
If you are editing while using mobile data or you are connected via a dial-up connection, hundreds of (2.4 MB + content) saves can add up quickly. In such cases, it is recommended to disable autosave from the settings and save manually.
* '''Personal Wiki''': !TiddlyWiki can be used as a personal wiki to store all kinds of information in short notes called Tiddlers. It can hold a small database of your personal knowledge that is linked in a graph and easy to search and organize.
* '''Research Notes''': !TiddlyWiki can be used as a zettelkasten or a second brain. This can lead to new creative insights across different concepts.
* '''Encrypted Journal/Diary''': !TiddlyWiki supports [[https://tiddlywiki.com/static/Encryption.html|password-protection]] and journal entries (a Tiddler with today's date as the title). Your personal diary/journal can be one !TiddlyWiki file. Engineering Daybooks is a similar use case, but for work.
* !TiddlyWiki can be used as a project management tool, e.g. for wedding planning.
* !TiddlyWiki's !WikiText though declarative can be used to create interactive content such as flash cards and automatically-updating lists. There is support for templates and !JavaScript macros.
* '''Linkblog''': A !TiddlyWiki file can work as a replacement for Shaarli if you want to keep all of your bookmarks private.
* !TiddlyWiki can be used as a bug tracker for your projects on !GitWeb.
=== Upgrades ===
Upgrading !TiddlyWiki is a manual process.
1. Save a local copy of the file from your browser. Right click -> Save page as...
2. Use the web-based [[https://tiddlywiki.com/upgrade.html|Upgrade Wizard]] from the official website.
3. After downloading the upgraded file, load it into a browser to verify your content.
4. Replace the older file on your !FreedomBox with the upgraded file.
If you ever lose a !TiddlyWiki file, you can always retrieve a slightly outdated copy from the Backups app. It is better to keep your local copy after the upgrade, in case you want to revert.
=== Tips ===
==== Setting a favicon ====
Unlike Feather Wiki, !TiddlyWiki does not automatically use your !FreedomBox's favicon. To set it, follow these steps:
1. Create a new tiddler with the title `$:/favicon.ico`. Leave the content section empty
2. In the `Type` dropdown, select `ICO icon (image/x-icon)`
3. In the `Add a new field:` section, set the first field to `_canonical_uri` and the second field to `https://<your-freedombox-url>/favicon.ico`
4. Save the new tiddler and the wiki
'''Reference''': [[https://tiddlywiki.com/static/Setting%2520a%2520favicon.html|Setting a favicon: TiddlyWiki]]
You can also have a custom image as the favicon for each !TiddlyWiki. Using a distinct favicon makes it easier to identify the tab in your browser. Let's say your !TiddlyWiki file is your personal journal and you want to set the favicon to the image "notebook.png" which looks like a diary
1. Open the folder the image is in, using your desktop file explorer
2. Drag and drop the file into your !TiddlyWiki's browser tab
3. A special tiddler called `$:/import` will be opened
4. In the special tiddler, you will have an option to rename the file. Set the file name to `$:/favicon.ico`
'''Available since''': This app is no longer available since Debian Trixie. Please migrate to [[FreedomBox/Manual/Miniflux|Miniflux]] or [[FreedomBox/Manual/Nextcloud|Nextcloud News]].
Tiny Tiny RSS is a news feed (RSS/Atom) reader and aggregator, designed to allow reading news from any location, while feeling as close to a real desktop application as possible.
@ -90,8 +90,8 @@ To configure, first install the application, then in the setting page, set URL a
Tor is a network of servers operated by volunteers. It allows users of these servers to improve their privacy and security while surfing on the Internet. You and your friends are able to access to your !FreedomBox via Tor network without revealing its IP address. Activating Tor application on your !FreedomBox, you will be able to offer remote services (chat, wiki, file sharing, etc...) without showing your location. This application will give you a better protection than a public web server because you will be less exposed to intrusive people on the web.
To download software packages over Tor, or to run a SOCKS proxy, see the [[FreedomBox/Manual/TorProxy|Tor Proxy app]].
=== Using Tor to browse anonymously ===
Tor Browser is the recommended way to browse the web using Tor. You can download the Tor Browser from https://www.torproject.org/projects/torbrowser.html and follow the instructions on that site to install and run it.
@ -27,7 +29,7 @@ To enable Tor Onion Service, first navigate to the Anonymity Network (Tor) page.
After a while, the page will refresh and under Status, you will see a table listing the Onion Service .onion address. Copy the entire address (ending in .onion) and paste it into the Tor Browser's address field, and you should be able to access your !FreedomBox. (You may see a certificate warning because !FreedomBox has a self-signed certificate.)
Currently only HTTP (port 80), HTTPS (port 443), and SSH (port 22) are accessible through the Tor Onion Service configured on the !FreedomBox.
@ -53,45 +55,10 @@ The requirements to run a relay are listed in the [[https://community.torproject
* required that a Tor relay be allowed to use a minimum of 100 GByte of outbound and of incoming traffic per month.
* recommended that a <40 Mbit/s non-exit relay should have at least 512 MB of RAM available; A relay faster than 40 Mbit/s should have at least 1 GB of RAM.
=== (Advanced) Usage as a SOCKS proxy ===
!FreedomBox provides a Tor SOCKS port that other applications can connect to, in
order to route their traffic over the Tor network. This port is accessible on
any interfaces configured in the internal firewall zone. To configure the
application, set SOCKS Host to the internal network connection's IP address, and
set the SOCKS Port to 9050.
==== Example with Firefox ====
Your web browser can be configured to use the Tor network for all of your
browsing activity. This allows for censorship circumvention and also hides your
IP address from websites during regular browsing. For anonymity, using tor
browser is recommended.
Configure your local !FreedomBox IP address and port 9050 as a SOCKS v5 proxy in
Firefox. There are extensions to allow for easily turning the proxy on and off.
{{attachment:tor-socks-firefox.png|Configuring Firefox with Tor SOCKS proxy|width=800}}
With the SOCKS proxy configured, you can now access any onion URL directly
from Firefox. !FreedomBox itself has an onion v3 address that you can connect to
over the Tor network (bookmark this for use in emergency situations).
=== Circumventing Tor censorship ===
If your ISP is trying to block Tor traffic, you can use tor bridge relays to connect to the tor network.
1. Get the bridge configuration from the [[https://bridges.torproject.org/bridges|Tor BridgeDB]]
Tor is a network of servers operated by volunteers. It allows users of these servers to improve their privacy and security while surfing on the Internet.
The Tor Proxy app provides an option to download software packages over Tor for added anonymity. It also provides a web proxy on your !FreedomBox for internal networks, which can be used by various apps to access the internet via the Tor network. In case of ISP censorship, upstream bridges can be configured to circumvented the censorship.
For using Tor Onion Service, or running a Tor relay, see the [[FreedomBox/Manual/Tor|Tor app]] instead.
=== Using Tor Browser to browse anonymously ===
Tor Browser is the recommended way to browse the web using Tor. You can download the Tor Browser from https://www.torproject.org/projects/torbrowser.html and follow the instructions on that site to install and run it.
=== (Advanced) Using Tor Proxy as a SOCKS proxy ===
Tor Proxy provides a SOCKS port that other applications can connect to, in order to route their traffic over the Tor network. This port is accessible on any interfaces configured in the internal firewall zone. To configure the application, set SOCKS Host to the internal network connection's IP address, and set the SOCKS Port to 9050.
==== Example with Firefox ====
Your web browser can be configured to use the Tor network for all of your browsing activity. This allows for censorship circumvention and also hides your IP address from websites during regular browsing. For anonymity, using Tor Browser is recommended.
Configure your local !FreedomBox IP address and port 9050 as a SOCKS v5 proxy in Firefox. There are extensions to allow for easily turning the proxy on and off.
{{attachment:tor-socks-firefox.png|Configuring Firefox with Tor SOCKS proxy|width=800}}
With the SOCKS proxy configured, you can now access any onion URL directly from Firefox. If you have also enabled the [[FreedomBox/Manual/Tor|Tor app]], then !FreedomBox itself has an onion v3 address that you can connect to
over the Tor network (bookmark this for use in emergency situations).
=== Circumventing Tor censorship ===
If your ISP is trying to block Tor traffic, you can use tor bridge relays to connect to the Tor network.
1. Get the bridge configuration from the [[https://bridges.torproject.org/bridges|Tor BridgeDB]]
* Upstream end user documentation: https://support.torproject.org/
==== Client Apps ====
Links to recommended client apps, where applicable, can be found in !FreedomBox by select the Apps page, selecting the application tile, and clicking the '''> Client Apps''' button.
Tor Proxy may be used by configuring a proxy in your web browser. Alternately, you can use the Tor Browser.
* Tor Browser download: https://www.torproject.org/download/
## END_INCLUDE
Back to [[FreedomBox/Features|Features introduction]] or [[FreedomBox/Manual|manual]] pages.
<<Include(FreedomBox/Portal)>>
----
CategoryFreedomBox
Some files were not shown because too many files have changed in this diff
Show More
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.