- If the STUN/TURN configuration is not managed by FreedomBox, the parameters
are left unchanged.
Tests:
- Install app after installing Coturn. Notice that STUN URI doesn't have a
'transport' parameter.
- Install app without the patches after installing Coturn. Notice that STUN URIs
have 'transport' parameter. Then apply patches. Setup is run. 'transport'
parameter is removed and only one STUN URI is present. matrix-synapse server
restarts successfully and don't have show any errors/warnings regarding
STUN/TURN configuration during startup.
- Install app without patches and set custom STUN/TURN URIs. Apply patches.
Setup is run. The URIs are not changed.
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- If the STUN/TURN configuration is not managed by FreedomBox, the parameters
are left unchanged.
Tests:
- Install app after installing Coturn. Notice that STUN URI doesn't have a
'transport' parameter.
- Install app without the patches after installing Coturn. Notice that STUN URIs
have 'transport' parameter. Then apply patches. Setup is run. 'transport'
parameter is removed and only one STUN URI is present. matrix-synapse server
restarts successfully and don't have show any errors/warnings regarding
STUN/TURN configuration during startup.
- Install app without patches and set custom STUN/TURN URIs. Apply patches.
Setup is run. The URIs are not changed.
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Closes: #2362.
Passing ?transport= parameter in STUN URIs is invalid. It always uses UDP.
Chrome and perhaps Firefox has recently started enforcing the correct syntax
leading to failures using the Coturn server URIs we set in Janus. This also
likely effects matrix-syanpse and ejabberd clients.
Links:
1) https://www.rfc-editor.org/rfc/rfc7064#section-3.1
2) https://bugs.chromium.org/p/chromium/issues/detail?id=1385735
Tests:
- Install Coturn. Observe that STUN URIs shown don't contain the 'transport'
parameter.
- Install Janus and launch the meeting room. Notice that the STUN URIs in the
room page don't have 'transport' parameter.
- Install ejabberd and notice that the auto-configured STUN URIs don't have
'transport' parameter.
- Install matrix-synapse and notice that the auto-configured STUN URIs don't
have 'transport' parameter.
- Install ejabberd and matrix-synapse. Ensure that STUN URIs manually. They are
not allowed to 'transport' parameter for the STUN URIs but must have transport
parameter for TURN URIs.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
When setup is run from the application thread after startup, it continuously
tries until it succeeds. However, after making the first attempt, it does not
collect the status of the operation keeping the operation object in operation
manager. When trying for the second time, trying to create operation with same
ID fails since the operation is already present.
Fix this by allowing the operation to be recreated if the existing operation has
failed.
Tests:
- Unit tests pass.
- Functional tests for bepasty app pass.
- Install an app. Create an error in the setup mechanism for an app. Increment
is app version number. Start the service and notice that setup of app is
attempted and fails. Few seconds later the setup is attempted again and the
process continues. Each time the failure is due to fault in the app's setup
method rather than operation not being accepted.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- We stop services before backup and restart them when backup is completed.
However, if backup fails, we are not restarting the services. With this change,
ensure that stopped services are restarted even if backup process fails.
- Similarly for restore operation.
Tests:
- Backup and restore of an app work.
- Functional tests for matrix-synapse work.
- Run the following two tests without the patch to ensure that the reported bug
is reproducible.
- Make a backup operation fail by raising an exception in the privileged code
that takes backup. Enable matrix-synapse app. Run backup including the
matrix-synapse app. Backup fails and shows an error. The service is
stopped before backup and restarted after backup failure.
- Make a restore operation fail by raising an exception in the privileged code
that does restore. Enable matrix-synapse app. Run backup including the
matrix-synapse app and try to restore it. Restore fails and shows an error. The
service is stopped before restore and restarted after restore failure.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Fixes: #2384
- This was missed during the original transition to DiagnosticCheck class for
returning diagnostic results.
Tests:
- In vagrant container, test that the diagnostic test result shows up in
datetime app and it passes.
- Running full diagnostics on the system works.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- When running diagnostics for an app, if there are any failures or warnings,
then show a button to re-run setup.
- When showing all diagnostics results, if there are any failures or warnings
for an app, then show a button to re-run setup for that app.
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
[sunil: Use Result class instead of strings for comparison]
[sunil: Use flex box's justify-content-between to improve button styling]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
[sunil: Add reference documentation for the DiagnosticCheck and Result classes]
[sunil: Add link to DiagnosticCheck class from docstring]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
See db.py for rationale.
Tests:
- Run functional tests and unit tests.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Kiwix content packages should be publicly accessible by default. Allow
the frontpage shortcut to be accessed without logging in.
Added a functional test to check that Kiwix library can be accessed
without logging in.
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
- When many tasks are scheduled at once, they will try to write to the database
at the same time. This happens prominently in develop mode when multiple
notifications are attempted to be shown.
- Also other resource contention may happen.
- Avoid this by adding or subtracting 5% to the provided task scheduling
interval time.
Tests:
- Print the interval times in the schedule() method and verify that the final
interval values are randomized and vary by only 5% from the provided interval.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- Print the interval time in schedule() method and verify that the times are as
expected in develop mode and production mode.
- Notification shows up for RAM usage if the check hardcoded to True.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
We already have one in /usr/share/freedombox/modules-enabled.
Tests:
- Run ./setup.py install and ensure that app shows up in the UI.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>