216 Commits

Author SHA1 Message Date
nbenedek
9efc56368c
rssbridge: New app to generate RSS feeds for websites
[sunil: Update description for simplicity, group info]
[sunil: Indentation fixes]
[sunil: End all URLs with a slash]
[sunil: Update frontpage shortcut to be a simple one]
[sunil: Enable single-sign-on for main interface only]
[sunil: In copyright file, merge with public-domain section]
[sunil: Simplify and vectorify the icon]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2022-07-17 09:04:48 -07:00
Sunil Mohan Adapa
a150cd15bd
static: js: css: Make multiple select fields work with Django 4.0
Closes: #2228.

- Django 4.0 changed to using <div> instead of using <ul> and <li> for multiple
choice select fields. Update code for the select-all button to work with the new
HTML structure.

- Add styling to ensure that multiple choice select field appears similar to
previous <ul> and <li> based style.

- This patch assumes that django-bootstrap-form has support for Django 4.0 as
seen in https://github.com/tzangms/django-bootstrap-form/pull/110 .

Tests:

- Radio select seem to have no issues. Checked in networks -> connection type
page.

- Open Backups -> Create backup page and ensure that select all button works
and appears same on testing (Django 3.2) and unstable (Django 4.0).

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-07-04 21:03:02 -04:00
James Valleroy
b7a1d4bf8f
janus: Add new app for lightweight WebRTC server
- Add basic video room based on demo.

- Set port range to use for RTP.

- coturn: Add component for time-limited TURN configuration.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
[sunil: Don't error out when coturn is not installed/configured]
[sunil: Prepend data- to custom attribute in HTML]
[sunil: Convert SVG with embedded bitmap to vector graphics]
[sunil: Hide Javascript license information in footer]
[sunil: Minor changes to comments for styling]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2022-06-06 17:42:41 -07:00
Sunil Mohan Adapa
10606bfc69
email: Set an icon from Tango project
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-03-02 07:38:13 -05:00
Sunil Mohan Adapa
668da20a02
mldonkey: Drop app not available in Debian Bullseye and Bookworm
Closes: #2157.

Original author of the app J. Carlos Romero <juancarlos.romero@gmail.com> has
been contacted to see if there is interest in continuing to maintain the app.
There has been no response.

Since the app is not available even in the current stable (Bullseye), few users
are presumably using it on a supported FreedomBox distribution. Any users are
advised to maintain the manually instead of relying on FreedomBox for it.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-01-22 11:55:34 -05:00
Joseph Nuthalapati
b0305746c8
tahoe-lafs: Drop app as it is not being used
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
[sunil: Add to configuration file removal in Debian package and setup.py]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2021-12-20 15:12:11 -08:00
Joseph Nuthalapati
621cb67527
diaspora: Drop app that was never finished.
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
[sunil: Add to configuration file removal in Debian package]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2021-12-20 15:11:29 -08:00
Joseph Nuthalapati
60ef19b6ec
mediawiki: Switch to MediaWiki 2020 logo
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
[sunil: Added copyright year]
[sunil: Scaled the images to sizes commonly used for FreedomBox logos]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2021-09-05 13:33:10 -07:00
Sunil Mohan Adapa
efa615201b
wordpress: New app to manage a WordPress site/blog
- Use php-fpm instead of using mod-php.

- Create database and setup permissions manually. Tables and initial data are
created during the initial setup process done by WordPress. Database upgrades
are handled by WordPress. Minor versions are upgraded automatically and major
version need user intervention.

- Backup/restore functionality including database.

- Install recommended extensions for performance.

- Setup and run cron jobs to ensure that scheduled publications are
completed (among other things). Service has systemd security features. Timer is
set to run every 10 minutes.

- Functional tests for adding/removing posts and backup/restore.

- Increase file upload size limit to 128MiB.

- A private mode (default) for keeping the setup process secure. Should be
disabled after first setup is completed. This uses a new approach using
file-based flag for different Apache configurations.

TODO:

- Find a nice way to allow WordPress to upload plugins/themes. Currently this
operation files and users are expected to manually scp the files to
/var/lib/wordpress/wp-content/{plugins,themes} directory.

Tests:

- Functional tests.

- Schedule publishing of a post. Notice that post got published.

- Test uploading a file larger than 2MiB.

- Test enabling permalinks. This leads to nicer looking URLs.

- Test adding images to posts/pages.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2021-08-25 08:20:01 -04:00
Sunil Mohan Adapa
864de1be42
ui: Fix buttons jumping on click in snapshots page
Fixes: #2049.

This is regression introduced by me in 213cf16f8daa66dbfd3c761a61483c959c753559.
Although this case was tested for regression, the test setup was incorrect.

Tests:

- In networks page to details of a connection, the Delete button is aligned to
the right.

- In snapshots page, the Create Snapshot button is aligned to the left and
Delete Snapshots button is aligned to the right. Clicking on the buttons does
not change their position.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2021-02-18 18:07:52 -05:00
John Lines
f978d2f0d0
zoph: Add new app to organize photos
- Identify Freedbombox admin who installed the app to be zoph admin.

- Implement backup and restore.

- Photos directory should remain at /var/lib/zoph, for proper operation of
backups.

- There remains an issue that the App is enabled before it is configured but
will not work correctly until configuration.

- OpenStreetMap mapping is enabled. These should be configurable before
installation.

- Add initial forms.py and views.py to Zoph app, however these are currently
unused as urls.py does not invoke the view. When the view is not invoked the
Zoph App installs, with single signon, currently as the first LDAP user, rather
than the plinth user.

- The first user's preferences are not set, and need to be manually set to avoid
other errors.

* Sunil's changes

- Squash commits and re-split them.

- Drop documentation as it will be auto populated from wiki later.

- Remove outdated validation code from manifest.

- Drop some dead code.

- Don't send MySQL password over command line for improved security. Instead
  rely on Unix authentication of root user similar to backup/restore process.

- Use JSON for exchanging configuration dump to avoid encoding errors.

- Add username validation to avoid a potential SQL injection.

- Update description for neural tone and brevity. Add information about how user
  accounts work in FreedomBox

- Fix functional tests.

- Drop all code related to changing photos path until it is ready.

- Update URL from /zoph to /zoph/ to avoid another redirect.

- Fix disabling the app.

- Use icon that Zoph uses for favicon as logo. Update copyright file.

- Fix spelling unzip.

- Minor refactors. Run yapf and isort.

- Use subprocess.run() instead of os.popen() everywhere for better security with
argument parsing.

- Enable OpenStreetMap by default. User have a choice to disable it before using
the app. Add label to explain privacy concerns.

- Fix dropping database by using --force argument.

- Cleanup enabling the app to not enable the app when updating configuration.

- Use AppView's default template instead of overriding.

- Update functional tests to just check if the app is enabled/disabled as
expected. Checking that Zoph site is available will require reliable handling of
admin user.

Signed-off-by: John Lines <john@paladyn.org>
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2021-02-10 01:13:29 -08:00
Veiko Aasa
34f74a285f
plinth: Show running spinner when app installation is in progress
Add running spinner before every app installation step text, this
makes the fact that installation is in progress visually more noticeable.

Tested when installing the mediawiki app, the running spinner is shown
on every installation step.

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
[sunil: Horizontally align the text and spinner by the spinner inline]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2021-02-04 17:35:31 -08:00
Fioddor Superconcentrado
213cf16f8d
networks: Separate the delete button and color it differently
Pull the delete button in the connection show page to the right to prevent
hitting it by accident.

Signed-off-by: Fioddor Superconcentrado <fioddor@gmail.com>
[sunil: Use a new consistent style compatible with bootstrap4]
[sunil: Styled the delete button with danger color]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2021-01-25 15:40:30 -08:00
Sunil Mohan Adapa
d79f97f752
ui: css: New style for select all checkbox
- Make the box look different from the rest of the options so that this it does
not look like an option without label.

- Give it the appearance of a button so that it is becomes an operation rather
than option.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2021-01-21 20:33:34 -05:00
Sunil Mohan Adapa
9b8388734d
ui: js: Make select all checkbox option available more broadly
- Make the code work outside backups module.

- Move code to main.js so that any app can use this functionality.

- Make the code work for multiple such form fields in the same page.

- Use only pure JS, don't use jQuery.

- Add event handlers only after DOM content is loaded to avoid race conditions.

Tests performed:

- Checking the select-all button checks all options.

- De-checking the select-all button de-checks all options.

- De-checking one option when everything is checked, de-checks the select-all
button.

- Checking the last option when everything else is checked, checks the
select-all button.

- When loading a schedule page with all options checked, select-all button is
checked.

- When loading a schedule page with some option unchecked, select-all button is
unchecked.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2021-01-21 20:33:28 -05:00
Veiko Aasa
472590f6fc
javascript: Fix disabled submit buttons when navigating back to a page
When navigating back to a page, enable buttons that were previously
**temporarily** disabled.

Closes #1996

Tested that on the manage snapshots page, when browsing to delete view
and then back, the "Create Snapshot" button is enabled.

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-12-19 14:01:33 -08:00
Sunil Mohan Adapa
e6a858f3fe
ui: Fix warning button colors
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-12-19 16:26:54 +02:00
Sunil Mohan Adapa
83c0adf6cf
ui: Avoid inline styling for setting progress bar width
- attr() CSS function can't used practically on anything but the content
property.

- Introduce a hack for setting any arbitrary percentage width on an element
similar to w-25, w-50, w-75 and w-100 bootstrap utilities. This hack should not
be used widely.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-12-19 16:26:54 +02:00
Sunil Mohan Adapa
ae535268b2
ui: Use common styling to hide logo during firstboot
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-12-19 16:26:52 +02:00
Sunil Mohan Adapa
adb40218b0
ui: Introduce common styling for two column list group
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-12-19 16:26:45 +02:00
Sunil Mohan Adapa
836439e8a8
jslicense.html: Drop minor styling
- Will be disallowed by sandboxing content security policy.

- File will not be read by humans.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-12-19 16:26:44 +02:00
Sunil Mohan Adapa
b00c5994a3
ui: Fix form error styling using bootstrap 3 style
This is a temporary fix until proper bootstrap 4 forms are generated by
django-bootstrap-form.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-12-19 11:26:41 +02:00
Sunil Mohan Adapa
9c6ca18045
ui: Consistently use the btn-toolbar class for all toolbars
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-12-19 11:26:37 +02:00
Sunil Mohan Adapa
ed4a5655a1
ui: Drop italic style on app name and sections in card listing
- The emphasis brought by italics is wasted when all of the items have a same
style. Without it the style is simpler and more pleasent.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-12-19 11:26:35 +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
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
Veiko Aasa
5829fde5f4
templates: Make toggle button responsive
- Immediately after submitting a form with a toggle button, toggle and disable
the button and show a spinner on the button.
- Disable all other form button elements on the page when a form is submitted
to allow only one form submission at a time.

Closes #1993

Tests performed:
- Check that when enabling and disabling an app, the toggle button is responsive
- On the Samba app page, check that when enabling a share, the toggle button is
responsive and all other toggle buttons on the page are disabled.
- On the Samba app page, check that clicking the diagnostics button still works
while a share is being enabled or disabled.
- On the SSH confugration app page, check that after clicking the Update setup button,
a spinner is shown and the app enable/disable toggle button is disabled.
- Test on Firefox and Chromium.

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
[sunil: Narrow the scope to only toggle buttons excluding others cases]
[sunil: Minor cosmetic and styling changes]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-12-13 19:43:27 -08:00
Fioddor Superconcentrado
5f6add64bd
snapshots: Translate snapshot types (field description)
Helps: #1938

BTW, columns centered.

Signed-off-by: Fioddor Superconcentrado <fioddor@gmail.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-11-25 11:25:13 -05:00
Sunil Mohan Adapa
29e3c9eaa8
app: Make the donation button more prominent
This is high visibility to the donation link and almost prompts users to donate
instead of passively providing the information. Given how many free software
struggle to stay alive, this is needed.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-10-17 19:51:35 -04:00
Fioddor Superconcentrado
633f54b75c
diagnostics: Lazy format all diagnostic test strings properly
Helps: #1938.

Fixed application of available translations in daemon.py and apache,
diagnostics, networks, firewall and users modules.

diagnostics:
- __init__.py: return the app name along its results.
- diagnostics.html: display the app name instead of its id.
- diagnostics_results.html:
  - mark for translation,
  - apply class to results <td> HTML tag.

main.css: center-align the results.

Locale files excluded. Will be regenerated automatically and translations to be
done via Weblate.

original testing (rebased later):
- Yapf applied.
- Flake8 without errors or warnings for changed files.
- (Unit) tests run without errors.

Signed-off-by: Fioddor Superconcentrado <fioddor@gmail.com>
[sunil: Translate 'None' app name]
[sunil: Don't translate tests strings second time in template]
[sunil: Tweak the center rule]
[sunil: Don't split a translation string]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-10-13 15:43:44 -07:00
Fioddor Superconcentrado
f1f84a2509
upgrades: Add status section showing version and upgrade status
Closes: #1939.

- Force a delay before returning the upgrade result to allow upgrade to kick in.
Otherwise when the flow returns, get_context_data() creates the context too
early and finds the upgrade not yet busy, causing the refresh loop to miss it.
The page renders static and the user gets no clue to the upgrade executing in
the background.

Signed-off-by: Fioddor Superconcentrado <fioddor@gmail.com>
[sunil: Retain the styling for the remainder of the page]
[sunil: Re-style the status section as a simple web-page]
[sunil: Drop unused running-status CSS styles]
[sunil: Rename CSS variables, minor changes to color values]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-10-13 14:41:50 -07:00
Veiko Aasa
38a5730f14
notifications: Show severity level on every notification
Left side border of the notification is the color of the severity
level. Helps when there are multiple notifications with different
severity levels.

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
[sunil: Drop styling for unused 'notification-light' class]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-10-09 17:41:14 -07:00
Joseph Nuthalapati
6bfffeee13
calibre: Add new e-book library app
[joseph: initial code for the app]
Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
[sunil: use the modified framework API]
[sunil: simplify setup logic, move to service file]
[sunil: strict security for service file, dynamic users]
[sunil: interface for managing libraries]
[sunil: implement backup/restore]
[sunil: add functional, action, and view tests]
[sunil: use svg icon]
[sunil: update description]
[sunil: fix apache configuration]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
2020-09-27 22:16:07 +05:30
Sunil Mohan Adapa
7a11ba9fa3
deluge: Use older icon to drop CC 2.0 license
Tests:

- Check the interface in apps page and in the Deluge app page that icon has
changed.

- No lintian warnings related to debian/copyright file.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-09-15 15:23:32 -04:00
Sunil Mohan Adapa
4a6a936de4
js: Don't show running status on buttons pulled to right
This prevents incorrect animation for running status on first wizard steps.

Tests:

- In the first boot wizard, network topology step, click next and notice that
the running status does not appear next to 'skip wizard' link.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
2020-08-22 10:52:32 +05:30
Joseph Nuthalapati
4e9d22d376
apps: Remove Coquelicot
Bepasty is the replacement file-sharing app.

Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-08-21 15:42:14 -07:00
Sunil Mohan Adapa
289c033e1b
bepasty: Resize SVG to 512x512 for consistency with other icons
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
2020-08-21 22:42:03 +05:30
James Valleroy
7edc2f4e13
bepasty: New app for file upload and sharing
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-08-21 21:50:38 +05:30
Sunil Mohan Adapa
0247a0eacd
static: Drop unused link to Lato ttf font
Tests:

- Interface shows Lato font as usual in apps and system pages.

- Build .deb package. Lintian does not show a warning related override for the
TTF font.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-07-12 09:20:18 -04:00
Sunil Mohan Adapa
3efff2fa42
js: Simplify auto-refresh page logic
- Implement ability to refresh page at the framework level so that every page
does not need to handle it.

- Refresh after number of seconds specified in context of the view.

Tests performed:

- Trigger the following functions and ensure that page reload after 3 seconds
during the running operation while it does refresh before and after the
operation.
  - Diagnostics tests from the module.
  - Gitweb repository cloning.
  - Monkeysphere publish key to server.
  - OpenVPN setup.
  - Tor configuration update.
  - Manual software update.
  - App installation.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-06-29 10:09:04 +03:00
Sunil Mohan Adapa
ff84d3f97e
templates: Disable button and show spinner on submit for all forms
Tests performed:

- Submit a form and notice that button has a spinner soon after click.

- Select a from like Gitweb repository creation form and submit it. After submit
go back to previous form using back button. Notice that button has been restored
to proper state.

- Without filling valid information the form, press submit. Notice that the
button does not change to a spinner.

- Check installing an app, snapshots management, network forms, wireguard forms,
etc.

- Test on Firefox and Chromium.

- Test with LibreJS that the script is accepted as valid free software license.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-06-29 10:08:23 +03:00
Sunil Mohan Adapa
ac103d7132
*: Remove use of Turbolinks library
See #1841 for discussion on why Turbolinks needs to be removed.

Closes: #1841.
Closes: #1804.

Tests performed:

- There are no more references to 'turbolinks' in source code other than .po(t)
  files and the manual.

- When loading a page, turbolinks.js is no longer loaded.

- The following links don't have data-turbolinks attribute and work well when
  clicked.a
  - Gitweb repository links
  - Download manual links (en, es)
  - Ikiwiki wiki links
  - Sharing app web share links
  - TT-RSS mobile app link
  - 'Launch web client' button
  - 'Launch' button in web section of clients table
  - Active and regular front page shortcut

- Roundcube does not have a link to /roundcube in description.

- turblinks not present in /static/jslicense.html . LibreJs accepts all scripts.

Reported-by: Veiko Aasa <veiko17@disroot.org>
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Tested-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-06-03 10:29:19 +03:00
Sunil Mohan Adapa
b4e6c03bd7
coturn: New app to manage Coturn TURN/STUN server
- Shows URLs and shared secret that communication servers like matrix-synapse
should be configured to. Later we will implement auto-configuring those servers.

- Allow selecting domain for the sake of TLS/DTLS certificate installation.

- Simplify systemd service file options. Drop log file and pid file support as
they are not needed with systemd. Add security options.

- Set custom configuration file by overriding systemd service file options so
that we don't have a problem with conffile prompts.

- Implement functional tests (and automatic diagnostics).

- Custom icon selected from the Noun project as Coturn project does not have
one.

- Backup/restore configuration file and certificates.

- Document some questions regarding configuration options.

Tests performed:

- App is not listed in the app page if 'advanced' flag is disabled.

- App name, icon and short description shows up correctly in apps page.

- App name, icon, short description, description, manual link, enable/disable
button and diagnostics link show up currently in app page.

- Verify that configuration used by coturn server is the FreedomBox
configuration by checking the cert path in the log output.

- PID file is not created in /var/run/turnserver/. It goes into /dev/null
according to the log output.

- No log file is created other than what is collected by systemd from command
line.

- systemctl show coturn.service shows all the intended restrictions such as
NoNewPrivileges, Protect* options.

- Run functional tests.

- Ensure that backup of configuration file works by taking backup, changing the
secret and restoring. During backup and restore coturn should be stopped and
started as per logs.

- Build Debian package. No warnings about the copyright file.

- Enabling the app enables the service and runs it.

- Disabling the app disables the service and stop it.

- All diagnostics tests pass.

- Diagnostic tests show firewall port coturn-freedombox for internal and
external networks, service coturn, and each listening port for udp4, udp6, tcp4
and tcp6.

- Information in the firewall page shows up properly. Enabling the app opens
firewall ports, and disabling it closes them.

- When the app is installed, if a cert domain is available, it will be used.
When multiple domains are available, one of them is picked.

- Status shows 4 URLs with the currently selected domain and secret key.

- Changing domain to another domain succeeds and reflects in the status
information.

- When no domain is configured. Installing the app succeeds. No domain is shown
in the list of domains.

- When domain is changed, the certificates files in /etc/coturn/certs are
overwritten.

- Certificates have the ownership turnserver:turnserver. Public key is cert.pem
has 644 permissions. Private is pkey.pem has 600 permissions. /etc/coturn/certs
is owned by root:root.

- Let's encrypt certificates are setup immediately after install.

- Port forwarding information shows all ports except for relay ports.

- Trying to create a user with username 'turnserver' throws an error. This
happens even when coturn is not installed yet.

- After installing coturn, the configuration file /etc/coturn/freedombox.conf is
created with ownership root:turnserver and permissions 640. The directory
/etc/coturn is created with ownership root:root and permissions 755.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
[jvalleroy: Fix copied form_valid comment]
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-05-02 18:51:23 -04:00
Sunil Mohan Adapa
ff44a7de5a
static: Don't ship visual design file and unused images
- Move all the unused image files into doc/visual_design directory.

- Reduces the size of the shipped .deb binary significantly.

Closes: #1840.

Tests performed:

- Ensure that each of the files moves are not referenced anywhere in the source
code.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-04-24 16:10:02 -04:00
Sunil Mohan Adapa
e745031ab2
static: Reduce the size of the background noise image
Instead of tiling a 512px x 512px image, use 128px x 128px. The different is not
noticeable. Reduces the web page size for all pages by 120KiB. Also reduces the
shipped package size.

Tests performed:

- Visually compare the web page before and after the change. Notice no
difference.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-04-24 16:09:54 -04:00
Sunil Mohan Adapa
2526c98de6
static: Use SVG logo during first wizard welcome step
- This removes the need to ship a 67K file and scales better.

- Rename the file to have lowercase chars only for consistency.

Tests performed:

- Goto home page, see the logo at the bottom properly displayed.

- Goto the first wizard welcome page, notice that the logo is displayed. Also
the dimensions of the image are same as without the change.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-04-24 16:09:51 -04:00
Alice Kile
0b5b384651
app: Separate app enable/disable form from config form
- Introduce new API to mark an app that it can't be disabled.

- Mark jsxc, storage, config, upgrade and firewall apps as can't be disabled.

- Fixed functional tests

- Replaced AppForm with forms.Form in all modules' forms.py.

- Remove app.template.js.

- Remove unused styles.

- Remove app status checks in form_valid of Deluge, Diaspora, Matrix, Ejabberd,
MediaWiki, Storage, Transmission, Quassel

- Purge unused is_enabled context variables (Ikiwiki)

- ejabberd: Minor cleanup in template

- jsxc: Cleanup unneeded overrides

- tahoe: Cleanup unnecessary overrides

Tests performed:

- For all apps affected, test enable/disable button works and submitting
configuration form works: with changes updates message and without changes
'settings unchanged' message.
  - avahi
  - bind
  - cockpit
  - SKIP: coquelicot
  - datetime
  - deluge
  - SKIP: diaspora
  - ejabberd
  - gitweb
  - i2p
  - infinoted
  - ikiwiki
  - matrixsynapse
  - mediawiki
  - minetest
  - minidlna
  - mldonkey
  - mumble
  - pagekite
  - privoxy
  - quassel
  - radicale
  - roundcube
  - SKIP: samba
  - searx
  - SKIP: shaarli
  - shadowsocks
  - ssh
  - tahoe
  - transmission
  - FAIL: tt-rss (not installable)
  - wireguard
- Deluge test that configuration changes when app is disabled work
- Quassel test that setting the domain works when app is diabled
- Transmission test that setting the domain works when app is diabled
- Ikiwiki create form works properly
- Enable/disable button appears as expected when enabled and when disabled
- Enable/disable button works without Javascript
- Functional tests work for affected apps, Tor and OpenVPN
- AppForm is removed from developer documentation
  - Forms reference
  - Customizing tutorial
- Test all apps using directory select form
  - Transmission
  - Deluge
- Visit each template that overrides block configuration and ensure that it is
loaded properly and the display is as expected.
- All apps that use AppView that are not tested above should not have an
enable/disable button. That is JSXC, update, config, firewall, storage, users.

Signed-off-by: Alice Kile <buoyantair@protonmail.com>
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-03-29 09:42:31 +03:00
Sunil Mohan Adapa
673bd367b0
css: cosmetic: Rename plinth.css to main.css
Tests performed:

- Visit an app page, install page and home page.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-03-06 13:09:02 +02:00
Sunil Mohan Adapa
b51ccff743
css: Merge responsive.css into main style file
- Eliminate issue with collapsed navbar's drop-down menu text color when the
width is exactly 768px or less than 320px.

- Remove redundant footer's position: relative rule.

Tests performed:

- Change the browser width to 768px, the navbar is not collapsed and drop down
menu text color is black on white background.

- Change the browser width to 767px, the navbar is collapsed and drop down menu
text color is white on blue background.

- Change the browser width to less than 320px, the navbar is collapsed and drop
down menu text color is white on blue background.

- Footer on the main page and remaining pages is unchanged at <320px, =767px and
>= 768px.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-03-06 13:08:53 +02:00