4011 Commits

Author SHA1 Message Date
Doma Gergő
a1d2a55bd1
Translated using Weblate (Hungarian)
Currently translated at 80.7% (1038 of 1286 strings)
2020-07-16 18:41:53 +02:00
Yogesh
d1232b49f9
Translated using Weblate (Kannada)
Currently translated at 0.1% (2 of 1286 strings)
2020-07-16 18:41:53 +02:00
Allan Nordhøy
665072d7f2
Translated using Weblate (Swedish)
Currently translated at 99.0% (1274 of 1286 strings)
2020-07-15 11:41:53 +02:00
Allan Nordhøy
154d0978b9
Translated using Weblate (Norwegian Bokmål)
Currently translated at 85.4% (1099 of 1286 strings)
2020-07-15 11:41:53 +02:00
Adolfo Jayme Barrientos
91486654cf
Translated using Weblate (Spanish)
Currently translated at 99.1% (1275 of 1286 strings)
2020-07-15 11:41:52 +02:00
James Valleroy
d5bebba6e7
Prepare for v20.13 release
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2020-07-13 19:06:50 -04:00
James Valleroy
aa0ec071c3
locale: Update translation strings
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2020-07-13 18:34:13 -04:00
Doma Gergő
bda7202837
Translated using Weblate (Hungarian)
Currently translated at 81.0% (1038 of 1280 strings)
2020-07-14 00:29:40 +02:00
Tang Zongxun
fa7e62a6e1
Translated using Weblate (Chinese (Simplified))
Currently translated at 48.8% (625 of 1280 strings)
2020-07-14 00:29:40 +02:00
Allan Nordhøy
7dde001ad5
Translated using Weblate (Norwegian Bokmål)
Currently translated at 85.0% (1089 of 1280 strings)
2020-07-14 00:29:39 +02:00
James Valleroy
f8eb6c8cc6
upgrades: Refactor use of lsb_release
Tests:
- On unstable and testing:
  - Ran functional tests for upgrades.
  - Ran actions "upgrades setup" and "upgrades setup-repositories".
- On testing:
  - In develop mode, activated backports.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-07-13 14:44:32 -07:00
James Valleroy
a60341f0d8
upgrades: Split apt preferences into 2 files
- 50freedombox4.pref handles freedombox package from current
  backports. Whenever upgrading to a new Debian release, backports can
  be activated for the new release, and will always include the
  freedombox package at the start.

- 51freedombox-apps.pref handles apps, and each entry is particular to
  a Debian release. For example, after bullseye release, entries from
  bullseye-backports can be added, and entries from buster-backports
  can be removed.

Tests:
- In testing container, run setup in development mode. Apt preferences
  files have the expected content.
- In stable vagrant box, install deb with these changes. Apt
  preferences files have the expected content.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-07-13 14:44:29 -07:00
James Valleroy
2f1a6dc0f7
upgrades: Show dist of backports to be activated
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-07-13 14:44:26 -07:00
James Valleroy
6ac3d85bae
upgrades: Enable backports for testing only in development mode
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-07-13 14:44:23 -07:00
James Valleroy
ca91120fdc
upgrades: Check that backports is for current release
- If backports is for older release, then it can be activated again to
  upgrade to latest release. (Plan is to make this automatic, but
  leave the manual option as a fallback.)

- Security notice still shown if older backports are enabled.

Tests:

- On Buster system, change distribution in
  /etc/apt/sources.list.d/freedombox2.list to
  stretch-backports. Updates page shows button to activate backports
  again. Activate and check the source list to confirm that it has
  buster-backports again.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-07-13 14:44:16 -07:00
James Valleroy
6b0744c1c7
upgrades: Use only sources file to determine if backports enabled
Tests:
- Build deb and install in buster image. Manually remove backports
  sources file. Security page does not show backports notice. Updates
  page shows button to activate backports.
- Activate backports from updates page. Success message is shown and
  button to activate backports is removed. Security page shows
  backports notice.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-07-13 14:44:13 -07:00
James Valleroy
7caed57caf
upgrades: Add button to activate backports
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-07-13 14:44:10 -07:00
James Valleroy
f41cc116a1
security: Move backports notice to security page
Move get_backports_in_use to upgrades.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-07-13 14:42:29 -07:00
James Valleroy
172ffe106b
upgrades: Update apt cache before manual update
Test:
- Run manual update. `journalctl -u freedombox-manual-upgrade` shows
  that apt cache was updated.

Closes: #1708.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
[sunil: Split the update command into ExecStartPre= with return code ignored]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-07-12 20:39:34 -07:00
Benjamin Ortiz
5e6a661648
backups: Allow remote repository usernames to start with numbers
Although useradd recommends starting with either a lowercase letter or an
underscore, there is nothing that consistently adheres to this recommendation
across systems. Because some systems do not follow this recommendation and this
recommendation is not a hard requirement, we should not prevent connections at
the validation stage.

Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-07-12 19:26:54 -07:00
Veiko Aasa
b9fe3fb491
minidlna: Do not expose statistics over public web
Tested that after this change, only admins can see the MiniDLNA
statistics page https://<freedombox>/_minidlna/ over the web.

Everybody can still see the page on local network using
an address http://<freedombox>:8200/

MiniDLNA web page shows how many media files are served and
some information (IP, MAC address) about the connected clients.

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-07-12 10:11:51 -04:00
Doma Gergő
23bc27291a
Translated using Weblate (Hungarian)
Currently translated at 80.8% (1035 of 1280 strings)
2020-07-11 17:41:48 +02:00
Joseph Nuthalapati
01a757c38a
functional-tests: Fail fast on install failure
Tested against ejabberd's failing installation. The entire test suite
gets marked as failed if the application installation fails.

Fixes #1902 #1895

Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-07-08 12:50:22 +03:00
James Valleroy
c544160a94
Release v20.12.1 to unstable
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2020-07-05 15:41:09 -04:00
Milo Ivir
4cc254da1e
Translated using Weblate (German)
Currently translated at 100.0% (1280 of 1280 strings)
2020-07-05 21:35:03 +02:00
Sunil Mohan Adapa
144c8c9d95
cfg, frontpage: Ignore errors while reading config and shortcuts
- Ignore errors while trying to expand a file path list into its .d components
path list.

- Ignore errors when reading shortcuts fails a file for any reason.

- Errors when reading configuration file already ignored. os.path.isfile() and
configparser.Configparser.read() do not raise an exception under any
circumstances.

Analysis:

Regression in 20.12 reported at
https://discuss.freedombox.org/t/fb-20-12-solved-plinth-fails-to-start-due-to-new-frontpage-py-shortcuts-and-filesystem-permissions/994/4

- freedom-maker creates /var/lib/freedombox/ with mode 755 as root but this only
applies for disk images.

- freedombox.postinst, networks, apache check for the existence of
/var/lib/freedombox/is-freedombox-disk-image .

- Samba creates /var/lib/freedombox with mode 755 as root.

- Backups creates /var/lib/freedombox/borgbackup but not the parent directory?

- Shortcuts are now read from /var/lib/freedombox/.

Tests performed:

- Create directories /var/lib/freedombox and /etc/freedombox with permission set
to 750. In case of configuration, an early warning message is printed and in
case of shortcuts warnings are printed but service starts properly. Changing the
permission to 755 removes the warnings.

- Ensure 755 permission on above two directories. Create non-empty files
custom-shortcuts.json and freedombox.config with permissions 640. In case of
config no warning is printed (silently ignored) and in case of shortcuts,
warning is printed that file could not be read but service starts properly.
Changing the permission to 644, no warnings are printed.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-07-05 15:29:36 -04:00
Petter Reinholdtsen
00b38c8bdb
Translated using Weblate (Norwegian Bokmål)
Currently translated at 85.0% (1089 of 1280 strings)
2020-07-04 21:41:46 +02:00
J. Lavoie
96caad1bce
Translated using Weblate (French)
Currently translated at 99.0% (1268 of 1280 strings)
2020-07-03 00:41:46 +02:00
Robert Pollak
6f085abcb1
Translated using Weblate (German)
Currently translated at 99.7% (1277 of 1280 strings)
2020-07-03 00:41:46 +02:00
nautilusx
7fdf0601fc
Translated using Weblate (German)
Currently translated at 99.8% (1278 of 1280 strings)
2020-07-01 18:41:46 +02:00
Sunil Mohan Adapa
af276461fc
Release v20.12 to unstable
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-06-29 16:41:18 -07:00
Sunil Mohan Adapa
0800afb58e
locale: Update translation strings
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-06-29 15:46:25 -07:00
James Valleroy
41dc3b4f96
networks: Correct wording of internet connection form
Change "overtime" to "over time", also matches the other choice in the
form.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-06-29 09:47:09 -07:00
Sunil Mohan Adapa
c865a1cd89
jsxc: Remove inline javascript
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-06-29 10:09:20 +03: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
1b5a10a628
backups: Remove custom handling of progress on the restore button
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-06-29 10:08:47 +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
James Valleroy
994a7a1d4b
networks: Remove firewall zone warning
Mention that interface is automatically assigned to external zone.

Test:
- Re-assigned host0 interface to public zone. Disabled firewalld to
still access interface. Firewall zone is shown as "external" with the
note about automatic assignment.

Closes: #1858.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-06-28 22:25:25 -07:00
Sunil Mohan Adapa
41fc24d296
actions: tests: Fix test failures due order of fixtures
Ensuring that load_cfg fixture is ordered first will ensure that configuration
is properly restored after test and that changes in other fixtures take effect.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-06-28 21:02:17 -04:00
Sunil Mohan Adapa
618501f8e6
storage: tests: Ignore cases needing loop devices when not available
- In containers, loopback devices may not be available. Skip tests in this case
by looking at the output of losetup setup utility.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-06-28 21:02:14 -04:00
Sunil Mohan Adapa
86829a29c1
network: test: Fix race condition when deleting connections
When deleting connections after editing, sometimes the connection is not found.
Wait until the connection settles down to avoid connection not found errors
during cleanup. Seems to work for now but still not the best way to handle this.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-06-28 21:02:12 -04:00
Sunil Mohan Adapa
5d3c010b2e
main: List dependencies without writing to disk
- Don't run the second phase of web framework initialization. This avoids
writing to the DB file.

- Set log level to ERROR so that no messages get printed even to stderr while
listing dependencies.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-06-28 21:02:02 -04:00
Sunil Mohan Adapa
a145742ebc
log: Allow setting the default log level before log configuration
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-06-28 21:02:00 -04:00
Sunil Mohan Adapa
e5177289dc
web_framework: Don't create Django secret key when listing depends
This allows --list-dependencies to run without having to write to disk.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-06-28 21:01:57 -04:00
Sunil Mohan Adapa
28fe8c8c3e
web_framework: Split initialization into two parts
A simple Django configuration does not need to create the database whereas DB
migration requires creating the database.

In some operations such as listing dependencies, we can skip running the second
part and so writing to database will no longer be necessary during such
operations.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-06-28 21:01:55 -04:00
Sunil Mohan Adapa
91c4d6742e
cfg: In develop mode, use /var/lib for DB and sessions
- Only effects develop mode.

- To primarily avoid writing to the source code directory. Multiple containers
or VMs using the source folder won't fight with the database file (the overlay
file system plan is not working out well for containers #1873).

- In the earlier days, we used to allow running from source code directory
without even doing ./setup.py install. Currently it is not possible anyway. We
pretty much install freedombox package before running from source directory.

- If the build process itself learns not to write to source directory, then
containers/VMs won't have to write to source directory at all.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-06-28 21:01:53 -04:00
Sunil Mohan Adapa
a2281aaf07
cfg: Remove comments in test data
The file is not meant for human reading. The comments are already part of the
code.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-06-28 21:01:50 -04:00
Sunil Mohan Adapa
a33160d6a4
cfg: Remove redundant data in develop.config
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-06-28 21:01:47 -04:00
Sunil Mohan Adapa
3dfceda785
frontpage: Read from .d files too
Read from following paths:

/etc/freedombox/custom-shortcuts.json
/etc/freedombox/custom-shortcuts.json.d/*.json
/etc/plinth/custom-shortcuts.json
/etc/plinth/custom-shortcuts.json.d/*.json
/var/lib/freedombox/custom-shortcuts.json
/var/lib/freedombox/custom-shortcuts.json.d/*.json
/usr/share/freedombox/custom-shortcuts.json
/usr/share/freedombox/custom-shortcuts.json.d/*.json

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-06-28 21:01:45 -04:00
Sunil Mohan Adapa
4ea2e755db
frontpage: Load shortcuts from .d directories too
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-06-28 21:01:43 -04:00