6379 Commits

Author SHA1 Message Date
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
d042c3c60c
upgrades: Use codename to pin freedombox from backports
Skip writing apt preferences when running sid.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-07-13 14:42:22 -07:00
James Valleroy
92d39c0b6c
upgrades: Use current release codename when enabling backports
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-07-13 14:42:15 -07:00
James Valleroy
d758a917e3
upgrades: Parameterize backports dist name
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-07-13 14:42:06 -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
Sunil Mohan Adapa
b1f2c6e446
debian: Rename source package to freedombox from plinth
From documentation[1][2], it appears that the proper way to rename the source
package is simply to change the source package name. The binaries will be
treated generated from a new source package name. The old source package will
then not have any binaries associated with it. This will prompt the 'dak
cruft-report' tool to automatically remove the old source package[3]. No further
action will necessary to remove the old source package.

Links:

1) https://wiki.debian.org/RenamingPackages

2) https://www.debian.org/doc/manuals/developers-reference/pkgs.html#moving-removing-renaming-orphaning-adopting-and-reintroducing-packages

3) https://wiki.debian.org/ftpmaster_Removals

Tests:

- Build .deb package. Package is built successfully. Source package name is
'freedombox'.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-07-12 09:20:22 -04:00
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
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
7d143c9ef2
container: Remove external depenceny - dateutil
Used a function from the standard library instead.

Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-07-11 11:57:55 +03:00
Joseph Nuthalapati
359a0acd1a
container: Add option to update the container image
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-07-11 11:57:12 +03:00
James Valleroy
e7a4de1102
Release v20.12.1~bpo10+1 to buster-backports
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
v20.12.1bpo10+1
2020-07-08 06:47:22 -04:00
James Valleroy
bb4db7d17f Release v20.12.1 to unstable
-----BEGIN PGP SIGNATURE-----
 
 iQJKBAABCgA0FiEEfWrbdQ+RCFWJSEvmd8DHXntlCAgFAl8COFQWHGp2YWxsZXJv
 eUBtYWlsYm94Lm9yZwAKCRB3wMdee2UICJ8iEACRgDyjBSe/lb0qWxFNmzG3kX6o
 EWOS8f8Qgg3NkKIBBne57R/psPmYXo5HgczyaVDlmH7w4RWUev7bJuR2yGthXyOq
 QmW2RXD5oYsKenm9URP/FB28j7zv6Ymnf124nGQazTf877UKgb0vbfAOMf7jHSUJ
 l5DQEJK5+BFkS2jEvuePlqNENPynSJNkkAcpButUR0MYtYdgzz9PyijTY1Q7znfU
 VJuNiHYVWI1KXG9f0f5DsgU1UR7ho7f5/PAfx6K8cPZqWf+QncsU6FX33Lf61x2l
 x0DwqMOXQoZzifIiC1EywvBflWZrpeDsvDHZ7+ySX0yelFlMvUmjB79UKJJZTAJ+
 IACo3TFpSJJvUGNukIq0C5mp+Vxe93Ft4IQAOvL/vgl9/QSktczWm+TY6ULWmAUN
 oTmCw/5nxAC7LgzEC3RPno9hrRM502cyXTBJQYNMSQbQKdH6D2/6ex5CFaTZ45UV
 qP37G+92KNDI3JH1M1tLjOuHaNiSX8oFN8mjhn/K6rWOHWxnrQ2tuXSiADGa69Zl
 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1' into debian/buster-backports

Release v20.12.1 to unstable

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2020-07-08 06:45:38 -04: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>
v20.12.1
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
James Valleroy
7cfd6a436e
Release v20.12~bpo10+1 to buster-backports
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
v20.12bpo10+1
2020-07-02 09:00:23 -04:00
James Valleroy
2695c080c5 Release v20.12 to unstable
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEE5xPDY9ZyWnWupXSBQ+oc/wqnxfIFAl76kcQACgkQQ+oc/wqn
 xfJ8KBAAqcaEO3tV84OJ2te5Varbi/N0ojiiXMmrhBxY8Xy0naajE/gRouZfY/J9
 bpzxBlSTex1JY4I6BYUMDeSkWsyGPMFfKSl3UJ96J5V4/yZkZ5AepuOSlwMvp705
 ZyatEM9872ylpO/gXamltEyjqDE1G/538bNq8Mhh2rCTCXAaTGmPFHsc/6Up3+Oc
 6BSKfX3KeKQMBXaRz3putU3Kep8f6OZEO4qSPqU5dvgSoPQSA8rzrfe7fvRyiAfV
 WPEourSz1yN1tw/n8nwWSFqO8cq0vsC2l716wHX3mCYwHFRJt4rKfBwv9LhZPlHI
 NTmkhtQHfbR26QecbCaTWqDLBeDYa0mmrOOagA9P3CP/WSMX1BxpGSG55B/WsNTK
 HhncoDTFHR3CU24f6NM3zwup9RAfdyNfatfNa8s4XW3N++HutW1BRC27gG3F/BkQ
 dd0YAtGK1mCLgqSFI/QuWkwPmaJqPACu0wQgA+aw2ZzYYRphVUJC2nNNMrDcuyl+
 W8+WywkR+Fread3FnG8u8LGE8b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20.12' into debian/buster-backports

Release v20.12 to unstable

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2020-07-02 08:59:47 -04: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>
v20.12
2020-06-29 16:41:18 -07:00
Sunil Mohan Adapa
0a1fff30a7
doc: Fetch latest manual
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-06-29 16:37:38 -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
Sunil Mohan Adapa
8ab551f285
apache: Relax CSP to allow web workers for JSXC
Closes: #1893.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-06-29 23:31:03 +03: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
110ec7d744
apache: Set CSP and other common security headers
Tests performed:

- Fonts Lato is properly and displayed.

- No <frame>, <iframe>, <video>, <audio>, <track>, <embed>, <object>, <applet>
tags are used in FreedomBox source code.

- Checked that there are no images referring to external URLs. Most of the
common images such as apps lists, system list, networks and manual show images
properly.

- Styles specified in main.css work as well as page specific styles such as in
networks. Firefox developer console shows inline styles loaded.

- JSXC is able to make XHR requests to ejabberd.

- Able to launch <a> links with _target='blank' such as in /help/support/.

- When visiting external websites, such as in donate page, Referer header is not
sent. When visiting page within FreedomBox interface, Referer header is sent
with path.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-06-29 10:09:36 +03: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
James Valleroy
ba023c3ef8
upgrades: Skip enabling backports on testing and unstable
Uses lsb-release which is a dependency of unattended-upgrades.

Closes: #1844.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
[sunil: Minor change to the printed message]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-06-28 21:57:10 -07:00
Sunil Mohan Adapa
0c7c4b12fb
tests: Use develop configuration for most tests
- Use the test configuration only when needed. This simplifies having to load
test configuration properly for action tests.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-06-28 21:02:19 -04: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
60bbdfabf7
doc: Update manual page with configuration file changes
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-06-28 21:02:10 -04:00
Sunil Mohan Adapa
384c34bb3f
*: Drop files paths in data/var
data/var/log and data/var/run were not being used for a while.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-06-28 21:02:07 -04:00
Sunil Mohan Adapa
bf7a9b8c7a
d/rules: vagrant: INSTALL.md: Fix installing dependencies
- Using ./run --develop ensures that the last list of dependencies are picked up
from current source directory instead of list of dependencies from system
configuration.

- Using sudo -u plinth ensures that even if any temporary files are created,
they belong to the plinth user instead of root user.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-06-28 21:02:05 -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