- Generating files in postinst script makes working with image-based systems
harder as postinst scripts are not run when booting from a pristine image. So,
move this to first_boot app's setup() method.
- This means that first wizard secret is no longer displayed during package
installation. This is a loss in usability, but might be acceptable:
- We want to reduce the number of dialog box messages shown to the user during
the installation of FreedomBox as a blend in Debian installer. Along with this
change, if we migrate away from LDAP, then no messages will be shown anymore.
- When users are installing using Debian installer, they don't have access to
console to note down the secret. They can only note down on a physical medium.
This is not the best way. Most of the time when I installed on machines, I
just looked at the secret file later.
- It is not expected that user will loose root access to the machine on which
they installed 'freedombox' package (manually or through Debian installer)
before they can type in the secret into the first wizard. Earlier, we had
restrictions on the type of users who can login to the console and this could
have happened.
- We can eliminate a lintian warning that we are showing messages in a dialog
in the postinst script instead of configure script.
Tests:
- Unit tests work.
- Building Debian package with changes works.
- Lintian warning about debconf has been eliminated.
- On a fresh Debian Trixie machine, installing the newly built Debian package
succeeds. It does not show first wizard secret related message. When web
interface is accessed, secret is asked. Skipping the secret is not possible.
Even before the creation of the secret file.
- Providing incorrect secret leads to error message. Secret file can be read by
root. The file is owned by plinth:plinth. The file has 0400 permissions.
- The secret file contains a newline at the file but entering the secret without
the newline character works.
- The secret contains uppercase and lowercase ASCII characters and digits. The
secret is 16 chars in length.
- Incrementing the version number of first_boot app does not lead to change in
the secret file contents.
- The message in the first wizard secret form is as expected.
- Building a disk image with newly built Debian package works. When the image is
booted, it does not ask for first wizard secret.
- When an existing machine is upgraded, if it is a disk image, first wizard
secret file is not created and first wizard is not shown to the user.
- When an existing machine is upgraded, if it is not a disk image, first wizard
secret file is not changed and first wizard is not shown to the user.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
[jvalleroy: Correct comment]
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Closes: #2575.
Tests:
- 'touch /etc/ssh/ssh_host_dsa_key.pub'. Try to load the SSH app page. It fails.
With the patch, it succeeds. A warning message is printed about failing to read
the key with proper returncode, stdout, and stderr.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- When watching journal using 'sudo freedombox-logs' command, the syslog
identifier for main service is 'freedombox' and for privileged service is
'freedombox-privileged'.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Closes: #2583.
Changes based on fix and workaround suggested by James Duncan (@jaduncan).
See: https://salsa.debian.org/freedombox-team/freedombox/-/work_items/2583
Tests:
- Home page, apps, system, and help icons appears as before.
- James Duncan (@jaduncan) reports that custom shortcut icons appear normal
after this change.
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Closes#1633.
[sunil: Move the button to the top of the apps page]
[sunil: Drop additional div nesting for 'available for install' section]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
See:
https://discuss.freedombox.org/t/error-when-uninstalling-tor-and-tor-proxy/4295
sunil: Use pathlib.Path.unlink()
Tests:
- Install Tor and Tor Proxy. Uninstall both. Uninstall is succesful.
- Install Tor and Tor Proxy. Manually delete
/var/run/tor-instances/*.defaults. Uninstall both apps. Uninstall is
successful. A warning is printed in the logs.
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>
Sunil:
- Simplify installation of Luanti client into a paragraph. Merge information
about default port into this paragraph.
- Minor formatting and punctuation.
- Drop format_lazy calls where not needed.
Signed-off-by: Frederico Gomes <fredericojfgomes@gmail.com>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Test was failing (on Ubuntu) after an unrelated systemd update caused
things to be reordered enough to cause the 30 second time limit to
overrun, meaning apache wouldn't be ready and the test would fail.
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Fixes: #2556
Should be merged after fix for https://bugs.debian.org/1122841 is in unstable.
- This fixes issue with Matrix Synapse app not being installable from current
unstable.
- matrix-synapse package depends on older version of python3-typing-extensions.
This causes the daemon to fail during startup when older version is installed.
This was reported as https://bugs.debian.org/1122841. After this bug is fixed
and a newer version of matrix-synapse is uploaded, the patch will work as
expected. An alternative was to allow unattended-upgrades to upgrade
python3-typing-extensions from unstable, but has to be done very carefully and
with a lot of testing.
Tests:
- Install Matrix Synapse apps works. This request installation of the latest
version python3-typing-extensions from unstable. The daemon is running properly
after installation.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This MR enables FreedomBox to connect as a "client" to a WireGuard
"server" using IPv6.
- Validate IPv4/6 with ip_interface
- Created helper functions to build NM settings for IPv4/6
- Modify get_settings to include settings for either IP version 4 or 6
- Created helper function to get NM address info
- Modify get_nm_info to work with IPv4 and IPv6
- Modified tests to use validate_ip_address_with_network
- Added IPv6 valid and invalid patterns to tests
Tested:
- IPv4 works unchanged
- IPv6 parsing + NM settings generation works
- IPv6 display in Show Server UI
Not tested:
- Needs IPv6 WireGuard server for full connectivity test
Closes: #1762
Signed-off-by: Frederico Gomes <fredericojfgomes@gmail.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>