9165 Commits

Author SHA1 Message Date
Sunil Mohan Adapa
4e900be128
ui: Show breadcrumbs on deeper pages
- 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>
2024-12-25 12:25:05 +02:00
Sunil Mohan Adapa
016b6d0c29
menu: Ensure that all menu items have names for use by breadcrumbs
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2024-12-25 12:24:50 +02:00
Sunil Mohan Adapa
36c4bc30fb
context_processors: Use breadcrumbs to highlight current section
- 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>
2024-12-25 12:24:29 +02:00
Sunil Mohan Adapa
a29fb97dd9
views: Implement retrieving breadcrumbs of a page
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2024-12-25 12:23:52 +02:00
Sunil Mohan Adapa
86031d25f1
menu: Implement a helper method to lookup menu items using URL name
- This will used to create breadcumbs.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2024-12-25 12:23:16 +02:00
Sunil Mohan Adapa
296c25627e
container: Add support for VMs using libvirt
- 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>
2024-12-22 12:58:39 +02:00
Sunil Mohan Adapa
43d625f6f8
container: Generalize language in output messages for VMs
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2024-12-22 12:58:39 +02:00
Sunil Mohan Adapa
81cd17247a
container: Minor refactoring to reduce repeated code
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2024-12-22 12:58:39 +02:00
Sunil Mohan Adapa
6f6e2bc876
container: Update FSID inside the image file to keep it bootable
- 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>
2024-12-22 12:58:38 +02:00
Sunil Mohan Adapa
4f9e5e9e14
container: Refactor nspawn specific operations into a separate class
- 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>
2024-12-22 12:58:38 +02:00
Sunil Mohan Adapa
83acf5cb64
Makefile: Add i2p to list of apps to remove
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>
2024-12-21 11:56:52 -08:00
大王叫我来巡山
4faa49d422
Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 63.8% (1126 of 1764 strings)
2024-12-19 05:00:35 +01:00
Ettore Atalan
66d40194c9
Translated using Weblate (German)
Currently translated at 98.6% (1741 of 1764 strings)
2024-12-19 05:00:33 +01:00
Besnik Bleta
399979aa34
Translated using Weblate (Albanian)
Currently translated at 99.7% (1760 of 1764 strings)
2024-12-18 03:16:31 +01:00
109247019824
414ffaca64
Translated using Weblate (Bulgarian)
Currently translated at 47.2% (834 of 1764 strings)
2024-12-18 03:16:31 +01:00
Burak Yavuz
ce5968aa57
Translated using Weblate (Turkish)
Currently translated at 100.0% (1764 of 1764 strings)
2024-12-18 03:16:28 +01:00
Sunil Mohan Adapa
0d9bd8d23e
tests: functional: Make first wizard run more robust
- 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>
2024-12-17 22:07:38 +02:00
James Valleroy
5062cb2585
Release v24.25 to unstable
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
v24.25
2024-12-16 21:44:38 -05:00
James Valleroy
93796b9479
doc: Fetch latest manual
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2024-12-16 21:31:58 -05:00
James Valleroy
d4bfb993b7
locale: Update translation strings
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2024-12-16 21:13:06 -05:00
Sunil Mohan Adapa
e523a83f1a
i2p: Drop app as it has not been available in Debian for a while
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>
2024-12-16 21:09:40 -05:00
Sunil Mohan Adapa
11aa36f6ca
d/control: Drop unnecessary recommendations
- 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>
2024-12-16 20:01:37 -05:00
Sunil Mohan Adapa
b78b76a692
ci: Add flake8 to gitlabci container
- 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>
2024-12-16 19:36:08 -05:00
James Valleroy
86ca8164d3
d/control: Drop version specification on dependencies for Bookworm
- 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>
2024-12-16 13:31:11 -05:00
Sunil Mohan Adapa
b64ea720fc
sso: Switch using cryptography module instead of OpenSSL.crypto
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>
2024-12-14 23:41:13 +05:30
Sunil Mohan Adapa
235a3cd139
openvpn: Declare explicit dependency on openssl
- 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>
2024-12-14 23:40:59 +05:30
Sunil Mohan Adapa
10602619b6
letsencrypt: Declare explicit dependency on openssl
- 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>
2024-12-14 23:40:39 +05:30
Sunil Mohan Adapa
b8b2c85eea
deluge: Cleanup and simplify setup code
- 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>
2024-12-13 13:48:51 +02:00
Sunil Mohan Adapa
f501bc99ab
action_utils: Add utility to ensure that service is stopped
- 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>
2024-12-13 13:48:21 +02:00
Sunil Mohan Adapa
0ea0a8b33c
ui: help: Fix alignment issue with footer links in about page
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2024-12-13 11:58:33 +02:00
Sunil Mohan Adapa
1c1cc82f55
ui: backups: Use Bootstrap color variables instead of static values
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2024-12-13 11:58:16 +02:00
Sunil Mohan Adapa
132d577a8a
ui: firewall: Fix styling with Bootstrap 5
- 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>
2024-12-13 11:57:25 +02:00
Sunil Mohan Adapa
2aa9f72ea1
tests: functional: Disable smooth scrolling from Bootstrap 5
- 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>
2024-12-12 13:07:21 +02:00
Sunil Mohan Adapa
765e3176fa
diagnostics: tests: functional: Pick errors more specifically
- 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>
2024-12-12 13:05:12 +02:00
Sunil Mohan Adapa
4fdf6a7ffe
ui: Fix placement of tags menu under tags input with Bootstrap 5
- 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>
2024-12-12 13:04:01 +02:00
Sunil Mohan Adapa
1a01f672d6
ui: Cleanup use of colors with CSS variables
- 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>
2024-12-12 13:03:12 +02:00
Sunil Mohan Adapa
1de071cceb
ui: Don't use nav-link inside card
- .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>
2024-12-12 13:02:45 +02:00
Sunil Mohan Adapa
b97cd9094e
ui: Style the 'Log out' item properly
- 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>
2024-12-12 13:02:31 +02:00
Sunil Mohan Adapa
be7910e901
ui: Fix flash of notifications popdown during page load
- 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>
2024-12-12 13:01:43 +02:00
Sunil Mohan Adapa
ab0e127378
ui: Fix issue with notifications icon showing twice in mobile view
- 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>
2024-12-12 13:01:25 +02:00
Sunil Mohan Adapa
fb6cd03b5a
ui: Use collapse instead of dropdown for notification in Bootstrap 5
- 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>
2024-12-12 13:00:48 +02:00
Sunil Mohan Adapa
9aa81e5c58
ui: Workaround dropdowns not working with Bootstrap 5
- 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>
2024-12-12 13:00:15 +02:00
Sunil Mohan Adapa
3b369cd90f
ui: Update styling for navbar menu items
- 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>
2024-12-12 12:59:44 +02:00
Sunil Mohan Adapa
fb95c5dce2
ui: Fix styling in dismiss button in form errors for Bootstrap 5
- 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>
2024-12-12 12:58:26 +02:00
Sunil Mohan Adapa
36c5ffd3af
ui: samba: Fix layout regressions with Bootstrap 5
- 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>
2024-12-12 12:58:13 +02:00
Sunil Mohan Adapa
efe278cd08
ui: Update custom button styles for Bootstrap 5
- Use CSS variables instead of overwritten style.

- Fix some missing styles for btn-default.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2024-12-12 12:57:51 +02:00
Sunil Mohan Adapa
9299a682e5
ui: Accept default styling of Bootstrap 5 for warning button
- 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>
2024-12-12 12:57:33 +02:00
Sunil Mohan Adapa
a4017b2bf2
ui: Restyle tags, remove underlining of text
- 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>
2024-12-12 12:56:37 +02:00
Sunil Mohan Adapa
a094f2a357
ui: Allow underlining for most links due to Bootstrap 5
- 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>
2024-12-12 12:56:19 +02:00
Sunil Mohan Adapa
c842397292
ui: Fix toggle button styling for Bootstrap 5
- 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>
2024-12-12 12:56:03 +02:00