Tests:
- /usr/share/plinth/actions/actions is not installed.
- Code check works on plinth directory and container script only
- Provisioning a container does not add sudo configuration for actions. 'fbx'
user can perform 'sudo' operations.
- Make install does not install actions based sudo configuration. Admin users
can perform sudo operations.
- Exporting backup archive works. Validating a transmission directory works.
Some of the privileged operations works.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
- As reported on IRC, links to source code files in Weblate are broken. This is
due to incorrect paths to files inside the POT file. Instead of plinth/views.py
it contains views.py. This might be a regression introduced when switching to
Makefile for all build tasks.
- To fix, we need to run 'django-admin makemessages' command at the topic level
directory in the source code repository. However, running at the top-level has
problems:
- Various unnecessary directories are considered. This was remedied using
--ignore aruments.
- The default locales directory was not being detected. This was remedied
using LOCALE_PATHS in Django settings.
- Django settings file was not being picked up. This was remedied using
--settings option.
- Django settings were being picked up from system's module path. This was
remedied using --pythonpath . option.
Tests:
- Running 'make update-translations' updates all the files. Newly generated POT
file contains plinth/ in the file paths. All locales were updated. There are no
other major changes POT or language files (other than what seemed to be pending
updates).
- Running freedombox-develop, locale can be changed to Spanish. The changed
locale is visible in UI. Changes to .po file are reflected in the UI after
running 'django-admin compilemessages'.
- After running freedombox using plinth.service systemd unit, locale can be
changed to Spanish. The changed locale is visible in UI. Changes to .po file are
reflected in the UI after running 'make build install'.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
Tests:
- When a new container image is provisioned, developer configuration is set on
privileged daemon as seen with 'systemctl show freedombox-privileged.service'.
freedombox-privileged.socket is enabled and running (socket is being listened
on).
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
- So that it can be invoked easily from the command line and systemd service.
Tests:
- make install creates /usr/bin/freedombox-privileged daemon which can be run as
root.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
Tests:
- Run 'make build install' and notice that the file
/usr/share/freedombox/modules-enabled/i2p has been removed from the system if
present.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
- To complete the provisioning process with container script and vagrant.
Tests:
- Start a fresh testing container, it should succeed. systemd-resolved is
running and resolving queries.
- Start a fresh stable container, it should succeed. systemd-resolved is running
and resolving queries.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
When older version is already built and later code is updated to newer version
and built multiple .whl files are present in dist/ directory. This confuses the
install script that assumes only one .whl is present. Pip refuses to install
multiple versions of the same package. This error was seen when bringing up the
'stable' container.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This fixes the problem of running over the limit of ARG_MAX of /bin/sh in the
dev container when copying the files of plinth modules.
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
- This allows those tests to be invoked on console and not just in CI pipelines.
Tests:
- Running make check works.
- CI pipeline succeeds.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
[jvalleroy: Remove phony test target]
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- setuptools aims to a build library instead of being invoked by setup.py.
Launching setup tools using ./setup.py is deprecated. Launching it using
generic build tools that use pyproject.toml is recommended.
- With the new approach customizing the build is not possible to the earlier
extent. So, introduce is a simple and sufficient build system using 'make'.
Tests:
- Check the pyproject.toml using validate-pyproject tool.
- Run diffoscope on old and new packages and verify that no unexpected changes
were introduced by the build system change.
- None of the files part of .deb package have different file permissions
compared to before.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is big because anything small breaks the code.
- Django dispatcher is based on regular expressions and does not need a tree structure
- Reduces a lot of unnecessary dependencies among modules
- Use Django sessions middlewear instead of CherryPy sessions
- Introduce dependency based modules instead of numeric load order
- Remove PagePlugin and simply use Django views
- Eliminate page rendering wrappers in favor of Django context processors
- Use custom auth for now until replaced by Django auth middlewear
- Use Django templated 404 and 500 error pages
python2.7 is what we should depend on. libpython2.7-stdlib a dependency
for python2.7 contains all the standard libraries. libpython2.7, I believe, is
required only for using python modules written in C.
Simplejson is an externally mainainted version of json library available in
Python 2.6 and up. It supports Python 2.5 which were are not targetting.
It also boasts better speed which is not at all a factor for us.
Twitter Bootstrap provides good styling for forms. Our current
theme does not ouput forms in bootstrap styles although for
everything else, it does. The python-bootstrap from is a simple
Django helper application to render Django forms into bootstrap
theme.
Django forms themselves provide numerous advantages over the
current incomplete homegrown solution. It also has solutions for
problems such as CSRF attacks which the current application is
vulnerable to.
- Basic information about each service is available for consumers
- Information about whether service is enabled or disabled is available
- Interested parties may listen to enabling/disabling of a service
- Information about some core services are made available
- contract module has not see a release since 2010
- Corresponding PEP has been deferred
- python-contract module in Debian is orphaned
- We are only using contract module in one method of one module
- That can be replaced with one line of check instead of depending on an
entire module
- The code using contract module does not work
- There is already replacement one line code that is actually working
James added the Apache Headers module to the makefile, but not the
FreedomBox-Setup configuration script. However, it's ridiculous to
have multiple locations for that same logic, so now the makefile uses
the setup script for the Apache configuration instead.
Also, the modules are now fancy and alphabetized.
There's no point to having two copies of what's essentially the same
file. In the long term, this means the distributions will need to
patch out cfg.py directories instead of plinth.sample.fhs.config. So,
if diff plinth.sample.config plinth.sample.fhs.config reveals
anything relevant, put that in your patch.
Apache configuration was missing a few modules, and the server needs
to be restarted after those modules are enabled. Also, the server
needs to be reloaded after the Plinth site is enabled.