5963 Commits

Author SHA1 Message Date
Fioddor Superconcentrado
704826d1bc
Translated using Weblate (Spanish)
Currently translated at 100.0% (1354 of 1354 strings)
2020-10-22 13:26:54 +02:00
Fioddor Superconcentrado
c88acb36d0
networks: css: Make button wider in network list
testing:
- Might this impact somewhere else (same form-button combination)?
- Yapf: not applicable.
- Flake8: without errors or warnings for changed files.
- (Unit) tests: run without errors.

Signed-off-by: Fioddor Superconcentrado <fioddor@gmail.com>
[sunil: Use min width instead of fixed width]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-10-20 11:57:21 -07:00
Fioddor Superconcentrado
9cde408c86
notifications: i18n: Mark app names and extra data for translation
Helps: 1938.

Testing:
- 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 app_name with 'translate:' prefix]
[sunil: Also mark additional data]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-10-20 11:57:17 -07:00
Fioddor Superconcentrado
ff9d0ace31
networks: i18n: Mark various strings for translation
Helps: #1938.

- Translate various states passed in by Network Manager:
  - Device state
  - Device state reason
  - Device type
  - Firewall zone
  - IPv4/IPv6 connection method
  - Wireless mode
- forms.py: Move zones list to network.py, reuse in views.py.

Testing:
- Yapf applied.
- Flake8 without errors or warnings for changed files.
- (Unit) tests run without errors.
- Screnshots attached to #1938.

Signed-off-by: Fioddor Superconcentrado <fioddor@gmail.com>
[sunil: Add strings for many more states]
[sunil: Don't allow None to be selected as firewall zone]
[sunil: Drop forced_literals.py as it reduces modularity of the code]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-10-20 11:57:12 -07:00
Fioddor Superconcentrado
67edecb8ab
networks: i18n: Mark string for translation on delete page
Helps: #1938.

Signed-off-by: Fioddor Superconcentrado <fioddor@gmail.com>
[sunil: Don't split the string into two, mark it in full]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-10-20 11:57:08 -07:00
Sunil Mohan Adapa
b1f64bb7bd
backups: i18n: Mark form success messages for translation
Helps: #1938.

Signed-off-by: Fioddor Superconcentrado <fioddor@gmail.com>
[sunil: Also mark restore success message]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-10-20 11:57:03 -07:00
Fioddor Superconcentrado
d1f9f4bfcc
package: i18n: Mark progress status strings for translation
Help: #1938.

- package.py: ugettext_lazy applied to 'installing', 'downloading' and other
statuses.
- setup.html: trans function applied to "Check again" in template.

Signed-off-by: Fioddor Superconcentrado <fioddor@gmail.com>
[sunil: Mark remaining to status strings also]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-10-20 11:56:57 -07:00
James Valleroy
e03161201c
Release v20.16 to unstable
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
v20.16
2020-10-19 20:43:03 -04:00
James Valleroy
d4d4f0939e
doc: Fetch latest manual
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2020-10-19 20:38:37 -04:00
James Valleroy
538e95250b
locale: Update translation strings
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2020-10-19 20:13:10 -04:00
Fioddor Superconcentrado
4ea6e952c9
updates: Eliminate delay and better status for manual upgrade
Helps: #1939.

Implements a proposal by Sunil Mohan Adapa in !1936.

Signed-off-by: Fioddor Superconcentrado <fioddor@gmail.com>
[sunil: Cosmetic changes]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-10-19 16:57:37 -07:00
Fioddor Superconcentrado
792c2cd00f
help: Link to updates page when new version is available
Closes: #1332.

Signed-off-by: Fioddor Superconcentrado <fioddor@gmail.com>
[sunil: Simplify the message for link to upgrade page]
[sunil: Use url method instead of hard-coded path]
[sunil: Cosmetic changes]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-10-19 16:57:34 -07:00
James Valleroy
a7829d3bf7
debian: Add Brazilian Portuguese debconf templates translation
Closes: #972449.

Thanks to Adriano Rafael Gomes for the translation.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2020-10-19 17:30:34 -04:00
Sunil Mohan Adapa
9c013be54b
calibre: Update group description to reflect 'using' app
- It is incorrect to say that group membership is needed to administer calibre.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-10-18 14:47:26 -04: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
Sunil Mohan Adapa
f9fd278e8c
calibre: Add link to donation page
- This is the link open by the desktop application when donate button is hit.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-10-17 19:51:32 -04:00
Michael Breidenbach
9aceb33597
Translated using Weblate (Swedish)
Currently translated at 100.0% (1345 of 1345 strings)
2020-10-16 00:26:45 +02:00
Burak Yavuz
efff63d514
Translated using Weblate (Turkish)
Currently translated at 100.0% (1345 of 1345 strings)
2020-10-16 00:26:44 +02:00
Fioddor Superconcentrado
1a65c9a0ba
Translated using Weblate (Spanish)
Currently translated at 100.0% (1345 of 1345 strings)
2020-10-16 00:26:44 +02:00
Allan Nordhøy
81567cdc4e
Translated using Weblate (Norwegian Bokmål)
Currently translated at 86.2% (1160 of 1345 strings)
2020-10-14 09:26:44 +02: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
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
Coucouf
67eb6befd7
Translated using Weblate (French)
Currently translated at 100.0% (1345 of 1345 strings)
2020-10-10 20:20:11 +02: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
Veiko Aasa
d93f2f634d
diagnostics: Show low system memory notifications
Containers specific case: if total memory taken from cgroups is lower
than system memory taken from psutil, calculate memory usage based on
information from cgroups. The formula idea is taken from
https://github.com/moby/moby/issues/40727#issuecomment-604155288

Closes #1780

Tests performed:
- In a non-container environment, filled the memory 90%
```
stress-ng --vm-bytes $(awk '/MemAvailable/{printf "%d\n", $2 * 0.9;}' \
< /proc/meminfo)k --vm-keep -m 1
```
and ensured that correct notification is shown.
- In a container, if no memory limitations are set, notifications are
based on host memory usage
- In a container, if memory limits are set
```
systemctl set-property systemd-nspawn@fbx-testing.service MemoryMax=200M
```
ensured that the notification is shown and is calculated based on
cgroups.

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
[sunil: Fix i18n for notification message]
[sunil: Drop unnecessary type conversion]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-10-09 17:41:04 -07:00
Allan Nordhøy
0960a13d49
Translated using Weblate (Greek)
Currently translated at 80.2% (1079 of 1345 strings)
2020-10-09 01:26:47 +02:00
Allan Nordhøy
655dd586f7
Translated using Weblate (Slovenian)
Currently translated at 6.6% (89 of 1345 strings)
2020-10-09 01:26:46 +02:00
Allan Nordhøy
ca58154ffa
Translated using Weblate (Chinese (Simplified))
Currently translated at 45.5% (613 of 1345 strings)
2020-10-09 01:26:46 +02:00
Allan Nordhøy
895acb09c2
Translated using Weblate (Norwegian Bokmål)
Currently translated at 81.3% (1094 of 1345 strings)
2020-10-09 01:26:45 +02:00
Nikita Epifanov
a1966e18ce
Translated using Weblate (Russian)
Currently translated at 100.0% (1345 of 1345 strings)
2020-10-07 16:26:41 +02:00
Burak Yavuz
554dbb8a78
Translated using Weblate (Turkish)
Currently translated at 100.0% (1345 of 1345 strings)
2020-10-07 16:26:41 +02:00
Oğuz Ersen
9e5dbae41f
Translated using Weblate (Turkish)
Currently translated at 100.0% (1345 of 1345 strings)
2020-10-06 09:11:45 +02:00
James Valleroy
0457792ba4
Release v20.15 to unstable
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
v20.15
2020-10-05 19:26:19 -04:00
James Valleroy
47c82e4241
doc: Fetch latest manual
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2020-10-05 19:25:31 -04:00
James Valleroy
6b6dbb4bd3
locale: Update translation strings
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2020-10-05 19:00:22 -04:00
Coucouf
c38d93e8e1
Translated using Weblate (French)
Currently translated at 100.0% (1321 of 1321 strings)
2020-10-06 00:58:07 +02:00
Fioddor Superconcentrado
af48bead58
Translated using Weblate (Spanish)
Currently translated at 100.0% (1321 of 1321 strings)
2020-10-06 00:58:07 +02:00
James Valleroy
0e9e80f435
upgrades: Check free space before dist-upgrade
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-10-05 15:12:37 -07:00
James Valleroy
bacfc4bcee
upgrades: Set a flag so interrupted dist-upgrade can be continued
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-10-05 15:12:34 -07:00
James Valleroy
0308d783e3
upgrades: Detect and upgrade to next stable release
Process can be tested by upgrading to testing:
$ sudo ./actions/upgrades --develop --test-upgrade

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
[sunil: cosmetic: isort fixes]
[sunil: Restore BACKPORTS_REQUESTED_KEY that was accidentally removed]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-10-05 15:11:19 -07:00
James Valleroy
036f917efb
upgrades: Extend function to check for normal dist availability
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-10-05 15:09:47 -07:00
Veiko Aasa
819520466a
container: Assign virtual network interface to trusted firewall zone
If firewalld is running, the virtual network interface created by
systemd-nspawn gets assigned to the home zone by default. Because
of this, DHCP server is not availabe for the container and most
of the incoming ports are closed.

This commit assigns the network interface created by systemd-nspawn to
the trusted network zone if firewalld is running, so that all network
connections are accepted.

Signed-off-by: Veiko Aasa veiko17@disroot.org
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-10-05 11:44:38 -07:00
Fioddor Superconcentrado
6bb5d34132
HACKING.md: Re-organised contents according to onboarding journey
See MR#1919.note_194567.

Since the documents and some chapters are long a table of contents has been
added at the beginning along with navigation links pointing back to it at the
end of main sections and long chapters.

Signed-off-by: Fioddor Superconcentrado <fioddor@gmail.com>
[sunil: Drop periods at the end of TOC entries]
[sunil: Re-title some sections]
[sunil: Add links to Django i18n documentation and IRC chatroom]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-10-05 01:22:39 -07:00
Sunil Mohan Adapa
fe183dbc72
debian/control: Add sshpass as build dependency
- Required only by tests when run as superuser. However, it's addition makes it
  very uniform to ensure that all dependencies are pre-installed in a container
  when running tests.

- We may find ways to run root user tests in future.

- The package seems very stable.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-10-05 00:05:57 -07:00
Sunil Mohan Adapa
9ef9a0fb1c
*: Minor flake8 fixes
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-10-05 00:05:54 -07:00
Sunil Mohan Adapa
e5cd5bd796
users: cosmetic: Yapf refactoring
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-10-05 00:05:51 -07:00
Sunil Mohan Adapa
30c326523e
users: Deal with admin user already existing during first boot
- Trying to create another admin user using the first boot wizard will certainly
fail.

- Show the list of admin users in the system so that they an be deleted and
creation of admin by first boot wizard can continue.

- If existing account can already work (such as when Plinth and LDAP entries
exist) allow skipping the step.

- Since the scenario is mostly like encountered only during advanced usage and
not for most regular users, the technical nature of solutions is okay.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-10-05 00:05:47 -07:00
Veiko Aasa
dfaf009d3c
users: Require admin credentials when creating or editing a user
This change prevents the plinth user to become a superuser without
knowing an admin password.

Users module and action script:
- User credentials are now required for the subcommands: create-user,
  set-user-password, add-user-to-group (if the group is admin),
  remove-user-from-group (if the group is admin), set-user-status,
  remove-user (if the removed user is the last admin user.
  Note: the web UI doesn't allow to delete last admin user).
- subcommand remove-users requires authentication if the user is last
  admin user. Password must be provided through standard input.
- subcommand remove-group: do not allow to remove group 'admin'
- User credentials must be provided using the argument
  --auth-user and a passsword must be provided through standard input.
- If there are no users in the admin group, no admin password is
  required and if the --auth-user argument is required, it can be an
  empty string.

Users web UI:
- An admin needs to enter current password to create and edit a user
  and to change user's password.
- Show more detailed error text on exceptions when submitting forms.
- Show page title on the edit and create user pages.

Users unit and functional tests:
- Added a configuration parameters to the pytest configuration file
  to set current admin user/password.
- Added a configuration parameter 'ssh_port' to the functional tests.
  You can overwrite this with the FREEDOMBOX_SSH_PORT environment
  variable. Modified HACKING.md accordingly.
- Added an unit test:
     - test changing the password as a non-admin user.
     - test invalid admin password input.
     - test that removing the admin group fails.
- Capture stdout and stderr in the unit tests when calling an action
  script to be able to see more info on exceptions.
- Added functional tests for setting ssh keys and changing passwords
  for admin and non-admin users.
- Added a functional test for setting a user as active/inactive.

Changes during review [sunil]:
- Move uncommon functional step definitions to users module from global. This is
  keep the common functional step definitions to minimal level and promote when
  needed.
- Minor styling changes, flake8 fixes.
- Don't require pampy module when running non-admin tests. This allows tests to
  be run from outside the container on the host machine without python3-pam
  installed.
- Call the confirm password field 'Authorization Password'. This avoid confusion
  with a very common field 'Confirm Password' which essentially means retype
  your password to ensure you didn't get it wrong. Add label explaining why the
  field exists.
- Don't hard-code /tmp path in test_actions.py. Use tmp_path_factory fixture
  provided by pytest.
- Remove unused _get_password_hash() from actions/users.
- Undo splitting ldapgid output before parsing. It does not seem correct and
  could introduce problems when field values contain spaces.

Tests performed:
- No failed unit tests (run with and without sudo).
- All 'users' functional tests pass.
- Creating an admin user during the first boot wizard succeeds.
- Creating a user using the web UI with an empty or wrong admin
  password fails and with the correct admin password succeeds.
- Editing a user using the web UI with an empty or wrong admin
  password fails and with the correct admin password succeeds.
- Changing user's password using the web UI with an empty or wrong
  admin password fails and with the correct admin password succeeds.
- Above mentioned user action script commands can't be run without
  correct credentials.
- Adding the daemon user to the freedombox-share group succeeds when
  installing certain apps (deluge, mldonkey, syncthing, transmission).

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
[sunil: Move uncommon functional step definitions to users module from global]
[sunil: Minor styling changes, flake8 fixes]
[sunil: Don't require pampy module when running non-admin tests]
[sunil: Call the confirm password field 'Authorization Password']
[sunil: Don't hard-code /tmp path in test_actions.py]
[sunil: Remove unused _get_password_hash() from actions/users]
[sunil: Undo splitting ldapgid output before parsing]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-10-05 00:05:44 -07:00
Veiko Aasa
6b61ca2f18
ssh: action script: Require user credentials when editing ssh keys
This change prevents the plinth user to set the ssh-keys without
knowing the user password.

- Debian: added new dependency python3-pampy to authenticate users.
- Added additional required parameter --auth-user to the
  'actions/ssh set-keys' command. A password should be
  provided through STDIN.

Tests performed:
- running 'actions/ssh set-keys' with empty or wrong admin credentials
  fails.
- running 'actions/ssh set-keys' with correct admin credentials
  succeeds.
- running 'actions/ssh set-keys' with correct non-admin credentials
  succeeds if the --username is the same user.
- running 'actions/ssh set-keys' with correct non-admin credentials
  fails if the --username is a different user.

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-10-05 00:05:41 -07:00