5253 Commits

Author SHA1 Message Date
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
James Valleroy
60d997b15a
Release v20.2.1 to unstable
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2020-02-21 22:46:56 -05:00
Joseph Nuthalapati
5944e13cf0
searx: Update search engines for 0.16.0
- Handle gzipped example settings files

- Fix yaml.load deprecation warnings

Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-02-21 21:47:54 -05:00
Thomas Vincent
cb7a9475bc
Translated using Weblate (French)
Currently translated at 93.9% (1173 of 1248 strings)
2020-02-22 00:32:52 +01:00
Joseph Nuthalapati
bb668e0f52
samba: Add link to manual page
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
2020-02-21 21:57:46 +05:30
Alice Kile
92d60ab7b4
gitignore: Add .vscode & segregate editor settings
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
2020-02-21 20:32:09 +05:30
Sunil Mohan Adapa
3e8c052258
deluge: More reliable initial configuration setup
Closes: #1779.

Wait until configuration files are created the deluge services.

- Deluged service on Debian Stable creates the core configuration file after
first exit. The version on Debian Testing creates the configuration file during
first run.

- deluge-web seems to create web.conf on first run.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-02-21 12:42:18 +02:00
Sunil Mohan Adapa
10d66d76ce
deluge: Don't use code execution for editing configuration
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-02-21 12:41:24 +02:00
Sunil Mohan Adapa
5c17c8c31e
firewalld: Ignore errors with DBus API when firewalld is not running
Closes: #1782.

This restores the API to the earlier behavior of ignoring errors when firewalld
is not running. This may not be the best approach however.

- Ignore errors on all operations when firewalld is not running. This include
enable/disable service, list interfaces of a zone, get service ports and get
enabled service.

- Log errors when firewalld is not running.

- ALREADY_ENABLE and NOT_ENABLED errors already ignored during enable/disable
service operations respectively.

Tests successfully executed:

- Turn off firewalld and perform following operations. They should all log an
error that firewalld is not running.

  - Visit app page of an app that works only on internal networks such as
  Privoxy. It should show that there are no internal networks.

  - Run diagnostics of an app. It should show ports for a service as empty list.

  - Enable/disable an app, it should enable/disable without failure.

  - Visit firewall app page. It should show that firewalld is not running.

- Perform all the about operations without error message showing up and with
expected results.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-02-20 12:37:10 +02:00
Radek Pasiok
50a087dfee
Translated using Weblate (Polish)
Currently translated at 29.0% (363 of 1248 strings)
2020-02-19 23:47:05 +01:00
Sunil Mohan Adapa
b14ccdadba
css: Add missing license identifier on some CSS files
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-02-19 14:41:13 +02:00