5263 Commits

Author SHA1 Message Date
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
Sunil Mohan Adapa
4e24eca25d
backups: cosmetic: Rename .inc file to .html
Tests performed:

- Go to backups page.

- Take a backup and see it listed in list of repositories.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-03-06 13:08:43 +02:00
Sunil Mohan Adapa
d8e5d63616
diagnostics: Rename views modules, move utilities to main module
Tests performed:

- Visit diagnostics app.

- Run diagnostics for all apps.

- Go to privoxy app and run diagnostics.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-03-06 13:08:29 +02:00
Sunil Mohan Adapa
cfc3b1924f
networks: Rename views modules as 'views'
Tests performed:

- Visit networks main view to list network connections.

- Add an Ethernet connection, view it and delete it.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-03-06 13:08:18 +02:00
Sunil Mohan Adapa
95d0923788
help: Rename views modules as 'views'
Tests performed:

- Visit help main view by visiting URL /plinth/help/.

- Visit pages: about, manual, get support, submit feedback, contribute.

- Download manual.

- Raise an exception in a view, visit the view in non-develop mode, see the
status log.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-03-06 13:08:08 +02:00
Sunil Mohan Adapa
ea1e7e953f
infinoted: Move views to a separate views module
Tests performed:

- Visit infinoted app view.

- Enable/disable infinoted.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-03-06 13:07:59 +02:00
Sunil Mohan Adapa
fe5bdf290b
privoxy: Use generic app view
Tests performed:

- Visit privoxy app view.

- Enable/disable privoxy app.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-03-06 13:07:49 +02:00
Sunil Mohan Adapa
1dd75990b1
avahi: Use generic app view
Tests performed:

- Visit avahi app view.

- Enable/disable avahi.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-03-06 13:06:32 +02:00
Veiko Aasa
995af05866
apps: Do not show status block if service is running
If at least one related service/daemon is not running, show the alert if app
is enabled, otherwise set alert as hidden (for functional tests).

Closes #1752

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
[sunil: Minor code simplification in app template, status section]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-03-05 12:28:14 -08:00
Veiko Aasa
b668e62f6f
upgrades: Clean apt cache every week
Closes #973

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-03-04 20:33:15 -08:00
Veiko Aasa
04b9538deb
plinth: Increase sqlite busy timeout from default 5s to 30s
Reduces the probability that plinth gives an error 500 because
the database is locked.

Test performed:
1) Lock the database:
> sqlite3 data/var/lib/plinth/plinth.sqlite3
sqlite> PRAGMA locking_mode = EXCLUSIVE;
sqlite> BEGIN EXCLUSIVE;
2) Visit plinth/apps/
3) Only after 30s plinth logs an exception:
django.db.utils.OperationalError: database is locked

Closes #1786
Related to #1443

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
[sunil: Move the timeout value to settings module as it is static]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-03-04 19:42:58 -08:00
Luis A. Arizmendi
ef4bd69c2a
Translated using Weblate (Spanish)
Currently translated at 100.0% (1265 of 1265 strings)
2020-03-04 23:32:52 +01:00
Veiko Aasa
141ef33f7e
transmission: Allow to submit download directory if it is creatable
transmission-deamon creates the directory if it doesn't exist.

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-03-02 20:51:44 -05:00
Veiko Aasa
e7afa69155
storage: Directory selection form improvements
- Action script:
  - must not be root when validating directory
  - return only first validation error
- Directory selection form, transmission, deluge:
  show the download path as it is in the configuration,
  the path is resolved only on form submit.
- Tests: add relative path checks, refactor parametrize code

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-03-02 20:51:41 -05:00
Thomas Vincent
03b4accefb
Translated using Weblate (French)
Currently translated at 96.7% (1224 of 1265 strings)
2020-03-01 15:33:02 +01:00
Joseph Nuthalapati
a0b5655196
Translated using Weblate (Telugu)
Currently translated at 64.6% (818 of 1265 strings)
2020-03-01 15:32:59 +01:00
Sunil Mohan Adapa
b5f6821fd7
networks: Fixes for networks wizards
- Make first wizard steps for router configuration and Internet connection type
private. Since they run after the admin user page, the steps can run for logged
in users.

- Add option to the Internet connection type wizard, to let the user say that
they don't know the type. This allows them to have a stress-free first setup
experience. The option can act as if they have don't have public IP address at
all. This is an extension of the proposed user experience.

- Implement class based views for simplicity.

- Update various IDs for consistency (even though other IDs in the networks
module don't conform).

- Iron out inconsistent terminology. Setup vs Configuration, Help vs. Wizard,
etc.

Tests performed:

- Run first boot wizard from the beginning. Notice that both the wizard steps
appear properly after the user login step (without permission denied problems).
When not logged in, accessing the wizard steps with URL should redirect to login
page.

- During first boot wizard, select 'Skip this step' in both the steps after
selecting non-default options. Values set should be default options as confirmed
from networks page.

- During first boot wizard, select non-default values, the values should be set
properly as confirmed from networks page.

- From the networks page select each value of the wizard. The option should get
saved properly.

- In case of Internet connection type, when the wizard values changes, the
networks page should reflect the value properly. This should also show properly
after skipping the step during first boot.

- During first boot, the default value for Internet connection type should be 'I
don't know' and router configuration should be 'Not configured'.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Nektarios Katakis <iam@nektarioskatakis.xyz>
2020-02-27 20:07:59 +00:00
Thomas Vincent
276893b302
Translated using Weblate (French)
Currently translated at 94.6% (1197 of 1265 strings)
2020-02-27 00:32:53 +01:00
James Valleroy
68fbc0b70c
Release v20.3 to unstable
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
v20.3
2020-02-24 20:17:01 -05:00
James Valleroy
9fe17fe7ea
doc: Fetch latest manual
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2020-02-24 20:15:50 -05:00
James Valleroy
25777a570e
locale: Update translation strings
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2020-02-24 19:13:54 -05:00
Joseph Nuthalapati
976668d89b
shadowsocks: Fix shadowsocks not able to start
Shadowsocks is unable to read its own configuration file because it
doesn't have read permissions to the file.

Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
[jvalleroy: Add comment about security concerns]
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-02-24 18:42:30 -05:00
Sunil Mohan Adapa
61545d1b8d
web_framework: Cleanup expired sessions every week
Currently, sessions are created as files in /var/lib/plinth/sessions. If a user
does not logout, the sessions remains there ever after expiry. Cleanup these
accumulating files by running a cleanup job every week.

Adding django.contrib.sessions to apps list necessary to ensure that
'clearsessions' management command is available. This creates an empty database
table for session storage but is harmless.

Tests performed:

- When run with the change for first time, migration is run for
django.contrib.sessions app.

- Change the scheduled interval to 30 seconds in the code. Login as a user. A
new session file is created in data/var/lib/plinth/sessions. Forward the system
clock by at least 2 weeks. The session expires. Within 30 seconds the file is
also removed.

- Login, then remove the django-secret.key. In 30 seconds we see a message that
the session data is corrupt. Advance the clock by at least 2 weeks. The session
file is removed and the message about session data is no longer printed.

- Repeat for system level plinth after `./setup.py install` and `sudo -u plinth
plinth`.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-02-24 18:04:26 -05:00
Sunil Mohan Adapa
fd345aca80
web_framework: Generate and retain a secret key
- Secret is important for various functions of Django. There is no impact on
existing installations due to the change. Improves the security of existing
functions in minor ways and will be useful in future usage of Django.

- Create the file in /var/lib/plinth/ with 0o600 permissions.

- Make git ignore the file in code folder.

- Don't copy the file during './setup.py install' operation.

Impact to users after upgrade:

- All existing sessions will get logged out. This is because SECRET_KEY is used
to generate user session hash that is used to logout users when their password
changes.

Tests performed:

- Run development version of service. File should get created in
data/var/lib/plinth/django-secret.key. Permissions should be 0o600.

- Run again, the file should not be overwritten. Printing
django.conf.settings.SECRET_KEY should match the one in the file.

- Run `setup.py install`. This should not install django-secret.key in
/var/lib/plinth.

- Run `sudo -u plinth plinth`. This should create the secret key file in
/var/lib/plinth/django-secret.key. Permissions on the file should be 0o600.
Ownership should be plinth:plinth.

- Remove the file in both cases, a fresh new file should get created with new key.

- Truncate the file to less than 128 chars, the existing file should get
overwritten with new key.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-02-24 18:04:20 -05:00
Michael Breidenbach
1548785a09
Translated using Weblate (Swedish)
Currently translated at 100.0% (1248 of 1248 strings)
2020-02-24 22:32:59 +01:00
Luis A. Arizmendi
89ffe398f3
Translated using Weblate (Spanish)
Currently translated at 100.0% (1248 of 1248 strings)
2020-02-24 22:32:57 +01:00
Jaime Marquínez Ferrándiz
6604763401
Translated using Weblate (Spanish)
Currently translated at 100.0% (1248 of 1248 strings)
2020-02-24 22:32:56 +01:00
Dietmar
f984de4b53
Translated using Weblate (Italian)
Currently translated at 51.9% (648 of 1248 strings)
2020-02-24 22:32:55 +01:00
Michael Breidenbach
48282f46d0
Translated using Weblate (German)
Currently translated at 100.0% (1248 of 1248 strings)
2020-02-24 22:32:51 +01:00
Sunil Mohan Adapa
3e8ce0c6bd
networks: Minor changes to router/internet configuration forms
- Cosmetic styling fixes. Having doc string as suggested by Python doc string
guidelines.

- 'connected to the Internet' seems much more popular phrase than 'connected on
the Internet' judging by web search results.

- Stylize as 'Internet' for consistency although 'internet' is correct too.

- Add space at the end of main radio button option text as translators seems to
understand it incorrectly. See current Spanish translation.

- Recommend 'DMZ' for router configuration.

- Remove incorrect title casing port forwarding text.

- Internationalize some strings.

- Update the default value for router configuration to 'not_configured'.

- Update the default value for Internet connection type to None so that nothing
is selected by default. We could consider introducing a fourth option
'not_configured'.

- Update the ID of first boot wizard step for Internet connectivity.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-02-24 12:36:44 -05:00
Sunil Mohan Adapa
1ba55e793f
networks: Fix i18n for wizard forms
- Using Markup on format_lazy objects seems to convert negate their lazy
behavior.

- Extend the format_lazy() utility method to handle markup.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-02-24 12:36:41 -05:00
Nektarios Katakis
9fda18b859
networks: Show internet connectivity string in main page
Closes: #1558

Signed-off-by: Nektarios Katakis <iam@nektarioskatakis.xyz>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-02-24 12:36:38 -05:00
Nektarios Katakis
5e6d6d1cd1
networks: Refactor connections list template
Signed-off-by: Nektarios Katakis <iam@nektarioskatakis.xyz>
[sunil: Use SPDX license identifier]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-02-24 12:36:34 -05:00
Nektarios Katakis
a8cd9c0b4a
networks: Save to kvstore internet connectivity type
Signed-off-by: Nektarios Katakis <iam@nektarioskatakis.xyz>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-02-24 12:36:31 -05:00
Nektarios Katakis
a95e59460e
networks: Add first boot step for internet connection type
Signed-off-by: Nektarios Katakis <iam@nektarioskatakis.xyz>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-02-24 12:36:28 -05:00
Nektarios Katakis
eb016bc686
networks: All first step wizard form for internet connection type
Signed-off-by: Nektarios Katakis <iam@nektarioskatakis.xyz>
[sunil: Use SPDX license identifier]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-02-24 12:36:24 -05:00
Nektarios Katakis
4ad2d7b2cf
networks: Link internet connection help page with networks page.
Signed-off-by: Nektarios Katakis <iam@nektarioskatakis.xyz>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-02-24 12:36:21 -05:00
Nektarios Katakis
bcd4c52851
networks: Add network view and url for internet connection help page
Signed-off-by: Nektarios Katakis <iam@nektarioskatakis.xyz>
[sunil: Use SPDX license identifier]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-02-24 12:36:18 -05:00
Nektarios Katakis
8134371bbb
networks: Add form for internet connection type
Signed-off-by: Nektarios Katakis <iam@nektarioskatakis.xyz>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-02-24 12:36:15 -05:00
Sunil Mohan Adapa
b5e19726fe
app: Show short description as secondary title
Closes: #1721

Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-02-23 08:31:33 -05:00
Sunil Mohan Adapa
90d3736431
app: cosmetic: Rename header.html to app-header.html
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-02-23 08:31:29 -05:00
Sunil Mohan Adapa
55bee19963
app: cosmetic: Rename a CSS style class in app header
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-02-23 08:31:26 -05:00
Sunil Mohan Adapa
d99fd41fff
app: Simplify some header styling
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-02-23 08:31:23 -05:00
Sunil Mohan Adapa
62cf6a11e0
app: cosmetic: Minor refactoring of header styling
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-02-23 08:31:19 -05:00
Sunil Mohan Adapa
ddc90ff511
app: Drop border shadow for app icon in mobile view
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-02-23 08:31:10 -05:00
Sunil Mohan Adapa
58640f6dfb
app: Update style for toggle button
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-02-23 08:31:05 -05:00
Sunil Mohan Adapa
6c426c1f20
doc/dev: Update copyright year
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-02-22 15:51:51 -05:00
Sunil Mohan Adapa
22c3241a52
notification: Add developer documentation
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-02-22 15:51:47 -05:00
Sunil Mohan Adapa
94df52ba73
doc/dev: Allow all modules to be imported by Sphinx
Setup Django in Sphinx conf.py so that any Django models can be imported.

Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-02-22 15:51:44 -05:00
Sunil Mohan Adapa
837e8fc6e1
web_framework: Separate out Django settings into module
This allows for many cases of having to deal with Django objects such as models.

- Allows all modules including ones with models to be imported by Sphinx.

- Run most of the management commands using django-admin.

- Make it simpler to import all modules on REPL interactive Python shells.

Does not change any of the settings that we are passing to Django for
configuration.

Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-02-22 15:51:41 -05:00