135 Commits

Author SHA1 Message Date
Sunil Mohan Adapa
b253166f6d
*: Use action_utils.run instead of subprocess.check_output
- 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:56 +03:00
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
Sunil Mohan Adapa
007d8de346
apache, letsencrypt: Create a site specific config for all domains
- Instead of just the sites that have successfully obtain certificate. This
allows customization of configuration for those sites (especially useful when
testing where LE certs are not obtained).

Tests:

- When a domain is added to the system, an apache TLS configuration is created
for the domain even though the domain does not have a successfully obtained LE
cert.

- When a domain is removed, the TLS configuration for the domain is removed.

- Add a domain without the patches. Apply the patches and restart the service.
The domain added signals are fired during the startup. This results in site
specific TLS configuration files getting created and Apache reloads. When the
service is restarted, the files are not created and Apache is not reloaded.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2025-05-30 15:14:48 -04:00
Sunil Mohan Adapa
15f71fe7e0
letsencrypt: Drop old app migration code
- In version 23.6.2 (Debian Bookworm), the migration code is already present.
This means all users on bookworm would have migrated already. We don't have
support users upgrading directly from a version older than bookworm.

Tests:

- First setup works as expected when starting the service on a fresh container.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2025-05-30 15:14:02 -04:00
Sunil Mohan Adapa
aac12f4391
names: Sort domains by priority of their domain types
- First of the list is the most important one and may be used as "primary"
domain in apps.

- Change the return type of DomainName.list() from set to list so that order can
be preserved. Update all users of the API accordingly. Add type hints to all the
methods using this API to catch any errors.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2025-02-16 10:45:01 -05:00
Sunil Mohan Adapa
89bce7a344
app: Add tags to menu and frontpage components
- Add typing information for init methods Info, Shortcut, and Menu to easily
  identify problems.

- Update docstrings for these components.

- Updates test cases to deal with tags instead of short description.

- Update custom shortcuts code to read tags and ignore short description.

- Update API to send tags instead of custom shortcuts.

- OpenVPN special treatment of info.description in Shortcut

Tests:

- All unit tests pass and type checking succeeds.

- All apps show icons with tags in apps and system section.

- In help section cards don't show tags.

- In front page, enabled apps show shortcuts with tags.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
2025-01-09 21:08:10 +05:30
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
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
4d71e80b1e
ui: Drop use of badge-* utility classes for newer replacements
- Keep the badge-{severity} classes as they are meant for convenience of mapping
severity to style.

- Match bootstrap colors to maintain consistency and contrast.

Tests:

- Visually confirm that all the changes effective.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2024-12-12 12:30:28 +02:00
Sunil Mohan Adapa
f8d2cc7b0d
letsencrypt: Allow reloading daemons after cert changes
- Instead of restarting them.

Tests:

- Changing a domain name leads restarting of services postfix/dovecot services.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2024-09-19 16:17:28 +03:00
Sunil Mohan Adapa
9009cdafd6
config, names: Move domain name configuration to names app
Tests:

- Config app description is as expected.
- Config form does not show domain name field anymore.
  - Submitting the form with changes works.
- Names app has correct link for configuring static domain name. Clicking it
  takes to page for setting domain name.
- On startup, static domian name signal is sent properly if set. Otherwise no
  signal is send.
- Change domain name form shows correct value for current domain name.
- Change domain name form sets the value for domain name properly.
  - Page title is correct.
  - Validations works.
  - Add/remove domain name signals are sent properly.
  - Success message as shown expected
  - /etc/hosts is updated as expected.
- Unit tests work.
- Functional tests on ejabberd, letsencrypt, matrix, email, jsxc, openvpn
- After freshly starting the service. Visiting names app shows correct list of
  domains.
- ejabberd:
  - Installs works as expected. Currently set domain_name is setup properly.
    Copy certificate happens on proper domain.
  - Changing the domain sets the domain properly in ejabberd configuration.
  - Ejabberd app page shows link to name services instead of config app.
    Clicking works as expected.
- letsencrypt:
  - When no domains are configured, the link to 'Configure domains' is to the
    names app.
- matrix-synapse:
  - Domain name is properly shown in the status.
- email:
  - Primary domain name is shows properly in the app page.
  - Setting new primary domain works.
  - When installing, domain set as static domain name is prioritized as primary
    domain.
- jsxc:
  - Show the current static domain name in the domain field. BOSH server is
    available.
- openvpn:
  - Show the current static domain in profile is set otherwise show the current
    hostname.
  - If domain name is not set, downloaded OpenVPN profile shows hostname.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2024-09-19 13:43:32 +03:00
James Valleroy
58c7de8d66
letsencrypt: Handle both standard and custom repairs
Pass remaining failed checks to super.

Tests:

- Remove /etc/letsencrypt/renewal-hooks/deploy/50-freedombox so that
  the diagnostic fails. Running repair causes the file to be
  re-created.

- Set domain name to non-existing domain so that the diagnostic
  fails. Running repair attempts to obtain the certificate.

- Have both diagnostics failing. Running repair will attempt to repair
  both.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2024-09-07 07:28:43 -07:00
Sunil Mohan Adapa
75e99f28cd
letsencrypt: Remove unused imports
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2024-05-03 08:20:38 -07:00
James Valleroy
8ff1a14e84
letsencrypt: Re-obtain certificates during repair
- Set check_id and domain for domain diagnostic check

- If there is an error, store it in thread local storage.

- Drop checking for case when no domain is configured. This is better done after
initial setup via notification rather than in diagnostics. Proposed change also
will not show the warning if a .local domain is configured (almost always). Keep
checking for Check id to deal with older stored diagnostic results.

- Call obtain when certificate is not available. Call re-obtain otherwise. This
is important for properly calling the post-obtain operations.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
[sunil: Drop check for case when no domain is configured]
[sunil: Call either obtain or re-obtain based on current state of certificate]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2024-05-02 21:53:08 -07:00
Sunil Mohan Adapa
598d7570ff
letsencrypt: Remove unnecessary processing of the error messages
- This allows the certbot command output to be shown accurately in the HTML
error message.

Tests:

- Edit the code to show all the action buttons in the UI. Set domain to
mydomain.example. Run all four actions. Notice that HTML error message are shown
and certbot output is shown properly in stdout/stderr sections.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2024-03-19 11:46:37 -04:00
Sunil Mohan Adapa
cf4f29e848
letsencrypt: Show better error messages
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2024-03-19 11:46:32 -04:00
Sunil Mohan Adapa
8d5ba3d67a
letsencrypt: Simplify error warning when certificate revoke fails
- The privileged call already prints the log message with full error details.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2024-03-19 11:46:30 -04:00
Sunil Mohan Adapa
6e557dd1e9
system: Organize items into sections
Closes: #2161.

- Sections are ordered by importance on which administrator must act after
setting up the system.

- Consistent order across all the languages.

- Update the styling for the section hearers.

  - For system section, make them compact.

  - Make them look like a header text (with underline) rather than a
    divider (like in a menu).

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2024-03-16 09:17:35 +02:00
Sunil Mohan Adapa
4b09d91f93
*: Add type hints for diagnose method
Helps: #2410.

- Ensure that diagnostics methods and parameters are type checked so that we can
catch any potential issues.

- Move plinth/modules/diagnostics/check.py to plinth/diagnostic_check.py to
avoid many circular dependencies created. This is due to
plinth.modules.diagnostics automatically imported when
plinth.modules.diagnostics.check is imported. Also app.py is already (type)
dependent on diagnostic_check due to diagnose() method. To make the Check
classes independent of diagnostic module is okay.

Tests:

- Run make check-type.

- Run full diagnostics with following apps installed: torproxy, tor.
  - Test to netcat to 9051 in tor works.
  - Test 'port available for internal/external networks' in firewall works.
  - Test 'Package is latest' works.
  - Test 'Access url with proxy' in privoxy works.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
[jvalleroy: Also move tests for diagnostic_check]
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2024-03-09 14:23:33 -05:00
Sunil Mohan Adapa
f9b186e14f
*: Add type hints for app init methods
- This is so that the methods will be checked by mypy. This should help identify
any incorrect initialization of components.

- Remove unused self.repos in GitwebApp.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2024-03-09 14:22:14 -05:00
James Valleroy
3fcd6b9e58
diagnostics: Translate descriptions only in view
Tests:

- Enable all apps, and run diagnostics. Diagnostic descriptions are formatted
  as expected.

- Change the language to Spanish, and view the diagnostic results. Diagnostic
  descriptions are translated as expected.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2024-01-18 22:19:05 -08:00
Sunil Mohan Adapa
2dd00a8f08
*: Fix all typing hint related errors
- Try to mark class variables in component classes.

- Leave typing hints generic, such as 'list' and 'dict' where content is usually
not filled, too complex, or context is unimportant.

- backups: Handle failure for tarfile extraction so that methods are not called
on potentially None valued variables.

- backups: Prevent potentially passing a keyword argument twice.

- dynamicdns: Deal properly with outcome of urlparsing.

- ejabberd: Deal with failed regex match

- email: Fix a mypy compliant when iterating a filtered list.

- tor: Don't reuse variables for different typed values.

- tor: Don't reuse variables for different typed values.

- operation: Return None explicitly.

- operation: Ensure that keyword argument is not repeated.

Tests:

- Where only typing hints were modified and no syntax error came up, additional
testing was not done.

- `mypy --ignore-missing-imports .` run successfully.

- Generate developer documentation.

- Service runs without errors upon start up.

- backups: Listing and restoring specific apps from a backup works.

- backups: Mounting a remote backup repository works.

- NOT TESTED: dynamicdns: Migrating from old style configuration works.

- ejabberd: Verify that setting coturn configuration works.

- email: Test that showing configuration from postfix works.

- tor: Orport value is properly shown.

- transmission: Configuration values are properly set.

- users: Running unit tests as root works.

- operation: Operation status messages are show properly during app install.

- ./setup.py install runs

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2023-09-25 20:03:24 -04:00
Sunil Mohan Adapa
0e82c58f1b
letsencrypt: Use drop-in config component for /etc files
Tests:

- Config files are all symlinks in /etc/
- Unable to test renewal hook

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2023-06-05 20:29:10 -04:00
Sunil Mohan Adapa
40eecb6446
*: Move modules-enabled files to /usr/share
- This will leave /etc/{plinth,freedombox} empty by default making service more
robust to run across various environments and situations. See systemd's
explanation for more details.

- Use Debian maintainer scripts remove all the existing files in
/etc/plinth/modules-enabled.

- Read from /usr/share/freedombox/modules-enabled then from
/etc/plinth/modules-enabled and finally from /etc/freedombox/modules-enabled.
Later read ones override previously read files. Any file pointing to /dev/null
will mean the module must be ignored.

Tests:

- Clean up /etc/plinth, /etc/freedombox and
/usr/share/freedombox/modules-enabled. Run service and notice that files are
getting loaded from development folder using a debug message.

- Run setup.py and notice that files get installed in
/usr/share/freedombox/modules-enabled/ and in the next run they get loaded from
there.

- Create a override file in /etc/plinth/modules-enabled/transmission and notice
that overriden file gets priority over the one in
/usr/share/freedombox/modules-enabled.

- Link the file /etc/plinth/modules-enabled/transmission to /dev/null and notice
that is not loaded.

- Create another file in /etc/freedombox/modules-enabled/transmission and notice
that it overrides the previous two files.

- All affected modules are loaded.

- Build a new Debian package and ensure that upgrading 23.8 to new version
removes are all configuration files.

- Build developer documentation and test that Tutorial -> Full Code and Tutorial
-> Skeleton sections have been updated with references to
-.../modules-enabled/... paths.

- Install quassel and notice that certificates were copied to /var/lib/quassel
directory. Change domain to another domain and notice that certificates were
copied again to that directory.

Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2023-05-13 07:08:43 -04:00
Sunil Mohan Adapa
4c5344dfa0
letsencrypt: Fix regression with comparing certificate
Closes: #2295.

_assert_managed_path() expects pathlib.Path. Due to a typo, a string is being
sent instead.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-10-24 20:11:17 -04:00
Sunil Mohan Adapa
222563a482
*: Use privileged decorator for service actions
Tests:

- DONE: Unit tests work
- DONE: Transmission
  - DONE: Enabling/disabling an app with a daemon works: transmission
  - DONE: Showing the status of whether the app is enabled with daemon
    is-enabled works.
  - DONE: A message is shown if app is enabled and service is not running
  - DONE: Service is stopped and re-started during backup
  - DONE: Adding user to share group during initial setup restarts the service
- Not tested: Enabling/disabling a service with alias works (no such apps)
- DONE: Restarting/try-restarting a service works
- DONE: Masking/unmasking works
  - DONE: rsyslog is masked after initial setup
  - DONE: systemd-journald is try-restarted during initial setup
- DONE: Avahi, email, security initial setup works
  - DONE: Fail2ban is unmasked and enabled
- DONE: Enabling/disabling fail2ban is security app works
- DONE: Enabling/disabling password authentication in SSH works
- ?? Let's encrypt
  - Services are try-restarted during certificate setup, obtain, renew
- Not tested: upgrade pagekite from version 1

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-10-08 18:53:55 -04:00
Sunil Mohan Adapa
c1cf5699c2
letsencrypt: Use privileged decorator for actions
Tests:

- DONE: Initial setup works
- DONE: Certificate events on FreedomBox startup work
- DONE: Basic operations work: obtain, revoke, delete
- DONE: Status of certificates is shown properly
- DONE: Domain add/remove hooks work, errors are handled
- Not tested: Removing old hooks
- DONE: Errors are shown properly on failure: revoke, obtain, reobtain, delete

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-10-08 18:52:17 -04:00
Sunil Mohan Adapa
493071bfe0
letsencrypt: Use AppView for app page
Tests:

- Enable/disable button is not shown.

- List of certificates in the system is shown.

- Diagnostics menu item is shown and works.

- Certificate operations work.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-08-29 08:29:14 -04:00
Sunil Mohan Adapa
900c0d30b9
*: Drop module level app property
module.app property usage is greatly reduced because setup() and force_upgrade()
method are now part of App class instead of at the module level. Remove the
remaining minor cases of usage and drop the property altogether.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-08-15 10:36:29 -04:00
Sunil Mohan Adapa
75f6abac1e
*: Make setup method part of App class for all apps
- Primary purpose is to complete the App API and allow for multiple apps to be
present in a module without a single clashing setup() method. Secondary
objective is to get rid of SetupHelper instance simple use App instance instead.

- This brings us closer to not needing to implement setup() method for some of
the typical apps.

- Remove default value None for old_version parameter.

  - A valid integer value is always passed to this call.

  - The value of None is undefined.

  - Simplifies the App API slightly.

- Drop setting 'pre', 'post' values to indicate the stage of setup for the App.

  - Simplifies the setup methods significantly. Eliminates a class of
  bugs (some of them seen earlier).

  - The UI can show a simple 'installing...' or progress spinner instead of
  individual stages.

  - There are currently many inconsistencies where many operations are not
  wrapped in helper.call() calls.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-08-15 10:36:16 -04:00
Sunil Mohan Adapa
aff62d4d85
letsencrypt: Handle cert setup when an app wants all domains
Currently, when domains is for an app's LE component is set as '*'. Calling
setup_certificates() results in copying certificate for the '*' domain instead
copying certificates for each of the domains on the system. Fix this by
implementing a special case where certificates are copied for all domains that
can have certificates.

Tests:

- Implement and run unit tests.

- Certificates are copied to /etc/{postfix,dovecot}/letsencrypt/ when email
server uses LE components with '*' for domains parameter.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2021-12-14 18:22:41 -05:00
Sunil Mohan Adapa
b1740eee79
letsencrypt: On domain removal, don't revoke certificate, keep it
Closes: #2156.

Tests:

- Remove a domain from System -> Config, 'letsencrypt revoke' action is not
invoked.

- Triggering a manual revoke operation still leads to action getting triggered.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2021-12-06 18:25:20 -05:00
Sunil Mohan Adapa
019a785cc3
*: Drop module level depends declaration
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2021-12-04 16:39:49 -05:00
Sunil Mohan Adapa
603b63bbac
module_loader, app: Move app init to app module
- Don't try to get the depends from module level and sort modules based on that.

- Instead after all App instances are created, sort the apps based on
app.info.depends and app.info.is_essential.

- Print message that apps have been initialized instead of printing before they
are initialized. The correct order of apps is only known after they have been
initialized and sorted.

- Avoid circular import on module_loader and setup.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2021-12-04 16:39:40 -05:00
Sunil Mohan Adapa
a3d4d99b33
*: Drop use of module level version
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2021-12-04 16:38:08 -05:00
Sunil Mohan Adapa
cf36a9d385
*: Drop use of module level is_essential flag
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2021-12-04 16:37:59 -05:00
Sunil Mohan Adapa
4bf57c5707
*: Drop use of managed_packages and rely on Packages component
- For zoph, drop dependency on php7.4 as it will cause issues for future
versions of php. The dependency was a hack and not needed for Bullseye and
higher.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2021-12-04 16:34:52 -05:00
Sunil Mohan Adapa
32d7ce9b38
letencrypt: Split app initialization
Tests:

- On startup, LE tries to obtain certs during post app initialization.

- When domain is added, LE tried to obtain certificates.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2021-11-15 10:13:17 -05:00
Joseph Nuthalapati
cd4bd17173
components: Introduce new component - Packages
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
[sunil: isort all files]
[sunil: Remove component in datetime component as managed_packages is empty]
[sunil: Minor refactor in minidlna for consistency]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2021-11-08 16:03:42 -08:00
Sunil Mohan Adapa
cd2b2f5f2c
*: Use django.urls.re_path() instead of its alias url()
- In Django 2.2 django.conf.urls.url() is an alias to django.urls.re_path().

- In Django 4.0, url() function will be removed. On Django 3.2, it throws a
warning that this function will be removed in future.

Tests:

- Run unit tests with Django 3.2 and Django 2.2.

- With Django 3.2 there are no warnings when running unit tests and when running
FreedomBox Service.

- Visit a few affected apps with both Django versions.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2021-09-20 16:50:47 -04:00
Sunil Mohan Adapa
74214c18ae
*: Use Django gettext functions instead of ugettext
- ugettext functions will be removed in Django 4.0. Each use emits a warning
when running with Django 3.2. Since we have warnings enabled in developer mode,
we see quite a few messages because of this.

- ugettext is already a simple alias of gettext. So, no regressions are
expected.

Tests:

- Accessing an affected app in UI with Django 3.2 and Django 2.2 works fine.

- Using Django 3.2 there are no warnings related to removal of ugettext
functions.

- Ran regular unit tests.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2021-09-20 16:50:16 -04:00
James Valleroy
c293a01a1f
letsencrypt: Always return a diagnostics result
Return a warning result if no domains are configured.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2021-04-02 19:54:36 +03:00
Sunil Mohan Adapa
fb1898befc
backups: Use the backup component in all apps
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2021-01-04 13:47:38 +02:00
Sunil Mohan Adapa
ccefd98135
letsencrypt: Split CSS styling into a separate file
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-12-19 16:26:51 +02:00
Sunil Mohan Adapa
f4a48f3e36
ui: css: Use rem as the primary unit
- When the base font size is changed, all the measure will scale appropriately.

- Bootstrap 4 has done the same.

- Keep using px for responsive lengths and some border widths that need not
scale.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-12-19 11:26:34 +02:00
Sunil Mohan Adapa
83dcafac55
ui: Make all tables responsive
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-12-19 11:26:34 +02:00
Sunil Mohan Adapa
fef8da230f
ui: Adopt a consistent and new table style
Rows in bootstrap 4 tables are taller by default. This is better suited for
mobile layouts and look prettier on desktops too. Adopting this approach instead
of condensed tables eliminates the need for striping, bordering and narrower
tables.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-12-19 11:26:33 +02:00
achalaramu
00bc55f762
Migrate bootstrap 4 from bootstrap 3
Closes: #1818. The new navbar collapse handles items better without a scrollbar.

- Switch dependency to newer bootstrap4 library.

- Bootstrap 4 has 5 grid levels instead of 4. Adjust all classes accordingly to
retain current semantics.

- Update for newer markup for dropdowns.

- Replace use for labels with badges. Labels have been removed. Use
badge-secondary instead of label-default.

- Replace use of btn-xs with btn-sm. Size is roughly the same.

- Accommodate removal of form-horizontal.

- .hidden* and .visible* classes have been removed. Use alternate utilities.

- Replace use of table-condensed with table-sm.

- Update progress bar background styling. .progress-bar-* have been replaced
with bg-*.

- Drop support for IE9 and below. Bootstrap 4 does not support those browsers.

- Use the new simplified markup for navs, navbar and navbar-toggler. Accommodate
removal of .navbar-fixed-top.

- Update the JSXC page too.

- Update all values that are using rem units. The base font size is now 1rem =
16px instead of 1rem = 10px. This the default for bootstrap 4.

- A button inside a dropdown menu is natively supported by bootstrap 4. Remove
custom styling done earlier.

- Drop use of removed class thumbnail.

- Override colors for buttons and warnings to keep the old style.

- Use new markup for close buttons inside alerts.

- Use .collapse.show instead of .collapse.in as per bootstrap 4 styling.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-12-19 11:26:32 +02:00
James Valleroy
f88ced9706
app: Add donation links in dropdown menu
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
[sunil: Undo a minor isort refactor in searx]
[sunil: Change the menu label to 'Donate']
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-10-11 19:49:22 -07:00