5713 Commits

Author SHA1 Message Date
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
 UukhHM6DNW4KmRTCIMKWIATEwblvvb0hK3q6MmlkiEjwP5gBapYSjPo4l+ibm/Ja
 pCGvh7Xj/UKhLYkVrvsC2Bt7MR7UuoaTcGmNV2pIEv5qCCBaxCctnVFjD4PJfot6
 6Qi3fhD4DDitDsAxlw==
 =XwTV
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQJKBAABCgA0FiEEfWrbdQ+RCFWJSEvmd8DHXntlCAgFAl8Fo9YWHGp2YWxsZXJv
 eUBtYWlsYm94Lm9yZwAKCRB3wMdee2UICLOAD/9kdmXccPoCF3tUnWtCHXmMGzaW
 QhN4nMQN6Z5wuc4tDMK2V6fjmJln5b3cJKouQmaCctWiZMbPyFzN9s+mo8Mjd/6a
 u8PlPb1n7FQp7m2ij16T0GFYxtxj8hIUUz0IHcMj9orAc7BxdqNS9tJEsi/1EsKW
 o/RtQlgWqIhdR3HJXnwqZAQsWDbZt8ye98PnrbNmQY6g1hgha0kGDPcuAOb8FZFz
 YTHSY1iVd8eLqVoFT+LSRuHAsYSwtWDREPSxJ32BF8IM0MEhAaDWCAvHqHa0wByh
 I0/r1ZKz0kBKECcZzb0JdkI2UAEcyhuquHUg4SFkzt8T8liAdK2ZHIxHj/R0F7jC
 qtoGK+hLXUcSvHdZ+sJFiUbd6EPVc0p04xXtNEEmYoUGoKVdhFeeejBOezUKXloc
 pehiO7U+Iwae9I6/Y1gIhoBbqo2jZIVku9eoMnenCK+e2ktafLoktGkz4pFGFWOC
 l4NP2Pck5+sVsfmeTR1pRP73fvdArkk9Sdlxqyx3aYVKpIG/Me196gruFK0HN/LF
 LnyJ0qhFws03E2oAQ1m5xWQDxrVL4bIYGTF2uEKLhS02naNJpL+G3v6Y6ZcxsSKI
 iIblJLMskYtlYWmpjK1fIZHk1/2AIt1Y6G5i5rg078Ak0a9NaPGIAr8vfuVuzJhW
 mYgo8zOGaWPyORdgRQ==
 =6trw
 -----END PGP SIGNATURE-----

Merge tag 'v20.12.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
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+Fread3FnG8u8LGE8bFPWhI4+q3yp8a10tccON/i8Wx5oELNm4M1Su5X
 WQuNbRWEbFAafKKXIaP/eE0X1NHEWzu8zeitKiGjEWiwiukUEtYZVwsfaBrWf3vV
 Ms+PNEAgEnP93nuSB60bRvoGpJRiLyNN0otVIvVq+xsJ0I4YPeA=
 =clcr
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQJKBAABCgA0FiEEfWrbdQ+RCFWJSEvmd8DHXntlCAgFAl792kgWHGp2YWxsZXJv
 eUBtYWlsYm94Lm9yZwAKCRB3wMdee2UICEUPEADBuS+NldPwel2RETC5znM+pbRO
 iA1YlytqRDGOlyKXhCmt7RLJk5FV9jDMy0FW0LV/VT8aSbhq1Kwrh9tiad22MmwS
 jhggN3TUNWpjwjHNt8DCc3bwQjOWuSL9Hd9wcMHtzGvaCcy/FjA5lahSe4yiyCzB
 Vb3BbXb8LB4+ri+izYFzf3vvVR7ta3GR7WfFeXs6ol7/N8TshQj00lUsl3kRZ/LH
 2jvRMjh/beAenpatLP9cOE5kNYAEt5BfOa0wQ8RM6c2Ywh4uvdiHuqPMieFLVSLD
 mm8bSU3V5J7QgDUMRR++f8DVRl+TFLNH7TZGvXQRetjIEaWavROdGTIs+GD1svpz
 YyO1GWlvPeqtoyo/ODB69z7hs8uMABdH9MFv9f2awVZI+LCtQvyY7oVpmf2qMC5n
 MYJHzFE2Evm85oCpA37GlFseMvrSCj1ZQwlq3Pk7aDAfxiQddgc69uWNhtCvw22b
 xrZ8WmxsQxlGrP88RVkgqVu/vQ98SIrNzI+tV3HBgMhhupNmjcwdOxUhzdYGrrph
 2r00AZMKmK+Kd9P+1kzQJr6vxIoJ8PAsI8AUzQ/q17slwuMZ+BoNNb9xXLJwdUxA
 mlcEIYlIYJ5A6uwWIjTPrfzv5o/e3qjo/Mu94CB6MXRSO7VZ/qwgh8/CjQ+ZGqPf
 4Qcv+HrsTkAOqh1zwQ==
 =wN2z
 -----END PGP SIGNATURE-----

Merge tag 'v20.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
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
Sunil Mohan Adapa
aaa306aef5
cfg: Read configuration from .d files and multiple locations
- Read configuration files from three different locations.
/usr/share/freedombox/freedombox.config, /etc/plinth/plinth.config and
/etc/freedombox/freedombox.conf. Later listed has higher priority.

- Provide backward compatibility for /etc/plinth/plinth.config files. With lower
priority than /etc/freedombox but higher priority than /usr/share/.

- Read sorted files from config.d directories with the same suffix as original
configuration file. Parse them by priority. This allows administrator/programs
to drop in configuration bits without worry about editing files.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-06-28 21:01:40 -04:00
Sunil Mohan Adapa
823735729b
d/tests/control: Rename Plinth to FreedomBox in a comment
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-06-28 21:01:38 -04:00
Sunil Mohan Adapa
6b1622bcec
cfg: Rename configuration file to freedombox.config
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-06-28 21:01:35 -04:00
Sunil Mohan Adapa
50ef5861d0
cfg: Move /plinth.config to plinth/develop.config
- Avoid a top level source code file.

- Makes it clear that the configuration file is only meant for development
purposes.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-06-28 21:01:33 -04:00
Sunil Mohan Adapa
62fc33e12c
cfg: Eliminate the need for 'root' directory in configuration
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-06-28 21:01:31 -04:00
Sunil Mohan Adapa
40663b7b5a
context_processor: tests: Use already available config fixture
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-06-28 21:01:28 -04:00
Sunil Mohan Adapa
8d2c33bf71
cfg: For develop mode, overlay on top of regular configuration
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-06-28 21:01:25 -04:00
Sunil Mohan Adapa
2a38e60d1c
cfg: Allow loading multiple configuration files
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-06-28 21:01:23 -04:00
Sunil Mohan Adapa
9def9750c0
frontpage: Drop empty custom shortcut files
Installing an empty file in /etc/ that is meant to be modified is an unnecessary
invitation to upgrade issues.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-06-28 21:01:20 -04:00
Sunil Mohan Adapa
5b579ff06d
frontpage: Read custom shortcuts from multiple locations
Read from /etc/plinth, /usr/share/plinth and /var/lib/plinth.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-06-28 21:01:17 -04:00
Sunil Mohan Adapa
4263f9e2c8
cfg: Drop the default configuration file
- The configuration module defaults to values in the production configuration
file.

- If the file is found, it is read and the read values overwrite the defaults.
If the file is not found, no error is raised. This allows us to not ship the
configuration file. User may create the configuration if they want to change the
defaults. This eases upgrades when configuration is edited. This also make
FreedomBox robust to deployments where /etc/ is not populated by default such as
OSTree. It is also a good practice for daemons as followed by the likes of
systemd.

- If the file partly populated only the values read override the defaults and
the remaining values don't change. This allows the user to write simpler
configuration file.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-06-28 21:01:15 -04:00
Sunil Mohan Adapa
64b1c21fe0
cfg: Don't fallback to develop config if main is not found
This was needed when our behavior for reading production vs. development
configuration depended on the presence of configuration files in expected
locations. The current behavior is based on whether --develop option is given or
not. This behavior is safer and more predictable.

So, remove the option to fallback to develop configuration if the production
configuration is not found.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-06-28 21:01:12 -04:00