3412 Commits

Author SHA1 Message Date
Sunil Mohan Adapa
f2ce5b7afd
users: Drop jQuery code as the library dependency has been removed
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>
2025-01-05 09:51:39 -05:00
Sunil Mohan Adapa
79482f7a38
sharing: Drop jQuery code as the library dependency has been removed
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>
2025-01-05 09:51:37 -05:00
James Valleroy
79999a9090
mumble: Add diagnostic for setup config changes
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>
2025-01-02 16:18:23 -08:00
James Valleroy
2274711c19
mumble: Support config file moved into /etc/mumble
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>
2025-01-02 16:18:13 -08:00
Benedek Nagy
69a18565ea
email: Fix DKIM signing by setting correct ownership on private keys
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>
2025-01-02 15:40:14 -08:00
Benedek Nagy
e510118453
nextcloud: remove experimental warning
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>
2025-01-01 19:35:07 -08:00
Sunil Mohan Adapa
c4b21b014b
networks: Fix error during creation of PPPoE connections
- 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>
2024-12-30 17:38:23 -05:00
James Valleroy
fa41257565
backups: Remove unused import contextlib
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2024-12-30 08:36:48 -05:00
Sunil Mohan Adapa
fd1b1c1cbf
backups: tests: functional: Wait for pages to load after click
- 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>
2024-12-30 08:34:17 -05:00
Sunil Mohan Adapa
e0aef43ece
backups: Handle common errors during borg operations
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>
2024-12-30 08:34:14 -05:00
Sunil Mohan Adapa
fd1d13f9af
backups: Use ISO timestamp for auto-naming archives
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>
2024-12-30 08:34:04 -05:00
Sunil Mohan Adapa
91270331cc
backups: Format better when showing archive time delete page
- 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>
2024-12-30 08:34:02 -05:00
Sunil Mohan Adapa
d423b40239
backups: Require POST method for mount/unmount operations
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>
2024-12-30 08:33:59 -05:00
Sunil Mohan Adapa
a6b16920e2
backups: Parse borg errors from all operations and not just some
- 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>
2024-12-30 08:33:57 -05:00
Sunil Mohan Adapa
3a0db947b2
system: Add tags to all remaining apps
Tests:

- Visit the system page and notice that tags appear as expected for all items on
the page.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2024-12-29 22:58:23 -08:00
Joseph Nuthalapati
0ae2df12a9
tags: Remove short description from system apps
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2024-12-29 22:58:20 -08:00
Joseph Nuthalapati
d5f840b6b1
tags: Add tags to system apps
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2024-12-29 22:58:17 -08:00
Joseph Nuthalapati
e206eb941c
zoph: Include tags from the manifest
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2024-12-29 22:56:35 -08:00
Joseph Nuthalapati
4a620fd1db
tags: Replace short description with tags in app pages
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>
2024-12-29 22:55:35 -08:00
Joseph Nuthalapati
68db1b9ee0
ui: Replace use of jQuery with plain JavaScript
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>
2024-12-29 14:15:04 -08:00
Sunil Mohan Adapa
7ea06bd635
backups: Fix issue clicking on schedule buttons with Bootstrap 5
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>
2024-12-29 14:01:07 -05:00
Sunil Mohan Adapa
c2007d0f6d
backups: Fix issue with verifying SSH hosts with RSA key
- 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>
2024-12-29 14:01:04 -05:00
Sunil Mohan Adapa
54538ed891
backups: Fix issue with verifying remote server identity
- 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>
2024-12-29 14:01:01 -05:00
Sunil Mohan Adapa
5cf89ad85c
diagnostics: Use generic handler to handle exceptions in diagnostics
- 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>
2024-12-29 17:17:01 +02:00
Sunil Mohan Adapa
407fccba2f
ui: Handle and show most page load errors as alerts
- 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>
2024-12-29 17:16:06 +02:00
Veiko Aasa
40e00423a8
users: Restart nslcd service after configuration changes during setup
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>
2024-12-28 10:13:15 -08:00
Sunil Mohan Adapa
526c5354aa
ui: Don't show breadcrumbs in login and first wizard pages
- 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>
2024-12-28 09:03:55 +02:00
Veiko Aasa
c17ef22bd8
users: tests: functional: Use click function from functional libary
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>
2024-12-27 16:43:43 -08:00
Veiko Aasa
eca6a65080
miniflux: tests: functional: Use helper functions from functional libary
Also, ignore pexpect module in mypy checks.

Tests:
  - All miniflux tests pass.

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
[sunil: Update to reflect the new utility function name]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2024-12-27 16:43:39 -08:00
Veiko Aasa
92c35e4640
mediawiki: tests: functional: Use click function from functional libary
Tests:
  - All mediawiki tests pass

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
[sunil: Update to reflect the new utility function name]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2024-12-27 16:43:36 -08:00
Veiko Aasa
b9fa1499d3
sharing: tests: functional: Use click function from functional libary
Tests:
  - All sharing tests pass.

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
[sunil: Update to reflect the new utility function name]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2024-12-27 16:43:33 -08:00
Veiko Aasa
459b084763
samba: tests: functional: Wait for page update after enable/disable share
Tests:
  - All samba tests pass.

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
[sunil: Update to reflect the new utility function name]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2024-12-27 16:43:30 -08:00
James Valleroy
f10c276aaa
torproxy: Don't disable apt-transport-tor in setup
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>
2024-12-27 16:35:15 -05:00
Veiko Aasa
2e7b9f8a8e
tor, torproxy: Fix daemon services are running after reboot when app is disabled
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>
2024-12-27 16:12:44 -05:00
James Valleroy
b1087b7650
minetest: Provide default gameid argument
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>
2024-12-27 11:05:34 -08:00
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
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
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
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
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
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
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
95c6a92ec3
ui: backups: Drop unused styling in verify host key page
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2024-12-12 12:55:01 +02:00
Sunil Mohan Adapa
adc615bc32
ui: diagnostics: Fix gap between headings
- 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>
2024-12-12 12:54:19 +02:00
Sunil Mohan Adapa
a2d5238dbc
ui: diagnostics: Fix layout of repair buttons
- 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>
2024-12-12 12:53:46 +02:00
Sunil Mohan Adapa
7602cf6172
ui: users: Fix close button for confirmation dialog for Bootstrap 5
- 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>
2024-12-12 12:50:50 +02:00