6 Commits

Author SHA1 Message Date
Sunil Mohan Adapa
61ff15a04f
*: Use action_utils.run instead of subprocess.run
- 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>
2025-09-29 16:58:53 +03:00
Benedek Nagy
f4f417cbb6
syncthing: Extend setup process to recover from manual config errors
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>
2025-03-24 16:38:00 -07:00
Veiko Aasa
56791df57e
syncthing: Fix app setup in Debian testing
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>
2024-10-10 09:42:34 +03:00
nbenedek
6c14b9a304
syncthing: Remove unused pathlib import so job code-quality can pass
Signed-off-by: nbenedek <contact@nbenedek.me>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2023-04-16 09:58:47 +05:30
nbenedek
f1d2139c2d
syncthing: Completely uninstall app
Remove config file when app is uninstalled

Tests:
1. Install app and add a share
2. Reinstall app and confirm that the share doesn't exist

The order of the functional tests should be modified
since 'test_add_remove_folder' fails

Signed-off-by: nbenedek <contact@nbenedek.me>
[sunil: Update docstrings, make uninstall fail-safe]
[sunil: Remove the entire configuration directory]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2023-04-14 17:11:31 +05:30
Sunil Mohan Adapa
317e83c38f
syncthing: Use privileged decorator for actions
Tests:

- Functional tests succeed (noticed intermittent failure)
- Initial setup succeeds
  - User/group are created. /var/lib/syncthing is created with proper user/group
    ownership.
  - In configuration file, authentication notification is disabled
- Syncthing web interface is accessible
  - Authentication related notification is not shown.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-10-08 18:53:21 -04:00