Fixes: #2551.
Tests:
- In a VM visit the storage page. Without the patch, an exception is logged when
there is no space to expand the partition. With the patch, the exception is not
logged.
- Raise an exception in the storage.usage_info() method and notice that the
exception is logged when visiting the Storage app page.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- In the Calibre app page, the enable/disable toggle button has dark colors in
dark theme mode. The colors are proper when enabled, disabled, enabling,
disabling, hover.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- Select-all button in create backup page has mostly unchanged color in light
mode and more consistent color in dark mode.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- Main header's shadow is unchanged in light mode. In dark mode, it is still the
same and not really visible. This is better than casting a white shadow.
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- Insert event.preventDefault() in form submission code for submission buttons.
- For various button styles, submit the form. Running status indicator appears
on the form button. The styles for the indicator is appropriate in dark and
light themes.
- Calibre delete library confirmation page has btn-danger.
- Software Update, configuration update button has btn-primary.
- Software Update, 'update now' button has btn-default.
- Change a button from btn-primary to btn-link. Running status is not shown
for this type of button.
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- They were only present for compatibility with Bootstrap 5.2. The values were
picked directly from Bootstrap 5.3. So, there is no change in output.
Tests:
- Go to user creation form and make errors. A form element with error has red
outline like more. The help text and error message are also in red like before.
In dark mode, they are more appropriate with the rest of the page and with
higher contrast.
- On default styled button, background color on hover is also improved
similarly.
- The border for select-all button in the create new backup page is also
improved similarly.
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- In apps and system pages, the tags text in a card is unchanged in light theme.
In dark theme, it is more consistent with the rest of the page.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- In network connection editing page, find some form elements that are disabled
and their light mode color is mostly unchanged. In dark mode, it looks
consistent with the rest of the page.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Use color variables provided by Bootstrap. These automatically adjust to light
and dark themes.
Tests:
- In light mode, the style for 'Update now' button in Software Update app is
close to what it was before. In dark mode, the styling is consistent with the
rest of the page.
- Same is true for Calibre app 'Delete Library' button and extra options button
in an app.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Use the right CSS variable.
Tests:
- In a form, the help text for an input is unchanged in light mode. And in dark
mode, it is more appropriate.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- In the app header as well as tag search bar.
- De-emphasize the tag buttons in app header so that users won't see them as
sections of the page.
- Add a bullet Unicode character between the tags in app header to separate them
properly with new de-emphasized styling.
- Fix vertical alignment of text between tag buttons in app header and the close
button in tags in tag search bar.
Tests:
- In the app header, styling has been de-emphasized and tags now look more like
simple text. They are a separated with a bullet Unicode character. Vertical
alignment of bullets is accurate.
- In the tag search bar, tags continue to look like buttons but more like default
buttons. Vertical alignment of close button is accurate.
- In both areas tags look properly in dark and light color themes.
- In mobile view when there are a lot of tags, tags flow into second line.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- This simplifies the implementation and gets it ready for dark/light mode.
Tests:
- In the upgrades main view, set is_busy = True and disable setting
refresh_page_sec. Load the upgrades app and notice that the 'Updating...' button
is showing proper styling in light anddark modes.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Add a toggle menu for selecting the color scheme. JS code largely taken from
Bootstrap documentation and slightly customized.
- Use local storage to store the setting for dark/light/auto. Default to auto
which means browser level preference is picked up (which could be system level
preference).
Tests:
- Appearance of the toggle menu is consistent. Check box is shown on the
currently selected value.
- Deleting the local storage value reverts the preference to browser set value.
- Menu is collapsed at smaller screen sizes. Appearance and functionality as
expected.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- pytest runs the expected tests for Home Assistant.
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
- Without the CSP, during loading there are no errors in the console. However,
during chatting, some styling related error show up.
Tests:
- Ensure that there are no CSP related errors in the browser console.
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Fixes: #2547.
- Earlier, FreedomBox itself depended on Bootstrap 4 as needed by the room we
built for JSXC. Since FreedomBox moved to Bootstrap 5 this library is no longer
available for JSXC. libjs-jsxc itself depends on libjs-bootstrap which is of
version 3.
- Also fix the path for jquery-slimscroll. This is was likely updated for Trixie
cycle.
Tests:
- Connect to JSXC with two different browsers. Add contacts. Initiate chat and
send messages.
- Re-run app setup and it succeeds.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- The following messages was seen on the ddns.freedombox.org server:
"Unserviceable IP address from <ipv6_address>: user <username>.fbx.one - IP:
<ipv6_address>". This is due to code that checks for validity of incoming IP
address and fails. The current configuration only handles IPv4 address. Even if
this restriction is lifted, GnuDIP code does not contain code to add/remove AAAA
records.
- Fix this by forcing GnuDIP HTTP update requests to go on IPv4.
Tests:
- Copy the code for _request_get_ipv4() into a python3 console and run
_request_get_ipv4('https://ddns.freedombox.org/ip'). Do this on a dual stack
machine with both public IPv4 and IPv6 addresses. Only IPv4 address returned.
Changing the AF to AF_INET6 returns only the IPv6 address.
- Take a test DDNS account offline. Configure it in FreedomBox stable VM. The IP
address is properly updated.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- If an app declares dependency on package that is also a dependency for
freedombox, then during the app's uninstall, the dependency is attempt to be
removed and will fail (because freedombox package will be held state).
- Add freedombox (and thus its dependencies) to the list packages that should be
removed from list of packages to be removed during app uninstall.
- In test case, update list of packages attempted removal as the 'freedombox'
package is installed only in some environments.
Tests:
- Uninstall janus works. Log messages show that libjs-bootstrap5 and
node-popper2 are in the list of packages originally set to removed during app
uninstall but are later filtered out.
- Run pytest with 'freedombox' package installed and ensure all tests pass.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Bootswatch is a theme library for bootstrap. In Debian, only 3.x version of
the package is available. It is compatible with bootstrap 3.x but not bootstrap
5. Drop the theming altogether and use the basic bootstrap style (which is
already very close to the theme).
- Updated copyright year, mention the video room files in debian/copyright.
- Drop libjs-spin.js which is no longer used by the updated code.
- Change bootstrap version to 5.x from the earlier 4.x. Also add node-popper2
library (needed by bootstrap5 and video room code) as explicit dependency.
- Add missing style for btn-default class dropped in bootstrap 5.
- .simulcast-button CSS style is not longer needed as updated code used flex box
with .d-flex bootstrap class.
Tests:
- Compare the files in janus source code around Mar 2022 with the files in
FreedomBox source code before this patch. Compare latest janus source code with
the files after this patch. Both sets of changes are very similar.
- Connect to video room using two browser windows. Connection is successful and
2 video streams are shown in each of the browser windows.
- Styling looks close to the demo on janus website and is acceptable.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Needed for the new video room code to run without CSP errors in the browser
console. JS error happens immediately after loading the page before Janus
initialization. Styling related errors happen after joining the room despite
eliminating use of'style=' attributes from JS code.
Tests:
- The video room works for a conference without showing any
Content-Security-Policy header related errors in the Firefox developer console.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Janus is currently not installable in Trixie because Janus was temporarily
removed during the release process of Trixie.
- Installing it from unstable, despite the instability is better than keeping
the app unavailable. Users have reported using the app.
Tests:
- Restarting the service after applying the patch leads to setup for upgrades
app to run. Apt preferences for janus packages are set. App is shown as
available. It can be installed.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- This allows overriding these headers in individual pages easily instead of
relaxing global policy.
- Drop the obsolete CSP directive "block-all-mixed-content" and avoid a console
warning in Firefox.
Tests:
- Load a page and notice in the browser developer tools that the three headers
referrer-policy, content-security-policy, and x-content-type-options are set as
before.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>