- Generating files in postinst script makes working with image-based systems
harder as postinst scripts are not run when booting from a pristine image. So,
move this to first_boot app's setup() method.
- This means that first wizard secret is no longer displayed during package
installation. This is a loss in usability, but might be acceptable:
- We want to reduce the number of dialog box messages shown to the user during
the installation of FreedomBox as a blend in Debian installer. Along with this
change, if we migrate away from LDAP, then no messages will be shown anymore.
- When users are installing using Debian installer, they don't have access to
console to note down the secret. They can only note down on a physical medium.
This is not the best way. Most of the time when I installed on machines, I
just looked at the secret file later.
- It is not expected that user will loose root access to the machine on which
they installed 'freedombox' package (manually or through Debian installer)
before they can type in the secret into the first wizard. Earlier, we had
restrictions on the type of users who can login to the console and this could
have happened.
- We can eliminate a lintian warning that we are showing messages in a dialog
in the postinst script instead of configure script.
Tests:
- Unit tests work.
- Building Debian package with changes works.
- Lintian warning about debconf has been eliminated.
- On a fresh Debian Trixie machine, installing the newly built Debian package
succeeds. It does not show first wizard secret related message. When web
interface is accessed, secret is asked. Skipping the secret is not possible.
Even before the creation of the secret file.
- Providing incorrect secret leads to error message. Secret file can be read by
root. The file is owned by plinth:plinth. The file has 0400 permissions.
- The secret file contains a newline at the file but entering the secret without
the newline character works.
- The secret contains uppercase and lowercase ASCII characters and digits. The
secret is 16 chars in length.
- Incrementing the version number of first_boot app does not lead to change in
the secret file contents.
- The message in the first wizard secret form is as expected.
- Building a disk image with newly built Debian package works. When the image is
booted, it does not ask for first wizard secret.
- When an existing machine is upgraded, if it is a disk image, first wizard
secret file is not created and first wizard is not shown to the user.
- When an existing machine is upgraded, if it is not a disk image, first wizard
secret file is not changed and first wizard is not shown to the user.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
[jvalleroy: Correct comment]
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Test was failing (on Ubuntu) after an unrelated systemd update caused
things to be reordered enough to cause the 30 second time limit to
overrun, meaning apache wouldn't be ready and the test would fail.
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
sysusers.d/tmpfiles.d config files allow a package to use
declarative configuration instead of manually written maintainer
scripts. This also allows image-based systems to be created
with /usr/ only, and also allows for factory resetting a system
and recreating /etc/ on boot.
https://www.freedesktop.org/software/systemd/man/latest/sysusers.d.htmlhttps://www.freedesktop.org/software/systemd/man/latest/tmpfiles.d.html
Tests:
- /var/lib/plinth and /var/lib/plinth/sessions/ are created on package install.
Ownership is plinth:plinth. 0755 is permissions.
- /var/lib/plinth/firstboot-wizard-secret file is created on package install.
Ownership is plinth:plinth. 0400 is permissions. During first wizard,
providing the secret works.
- /var/lib/plinth/backups-data is owned by root:root.
- When upgrading from old package to new the permissions don't change.
- When reinstalling the new package, the permissions do not change.
- User is created same as before.
plinth❌987:987:FreedomBox service:/var/lib/plinth:/usr/sbin/nologin
- Group is created same as before.
plinth❌987:
- id plinth
uid=987(plinth) gid=987(plinth) groups=987(plinth)
- Upgrading from old package to new does not change user and group records.
- Reinstalling new version does not change user and group records.
[sunil: Don't recursively change ownership for /var/lib/plinth/]
[sunil: Change ownership specifically for /var/lib/plinth/firstboot-wizard-secret]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Tested-by: Sunil Mohan Adapa <sunil@medhas.org>
This is widely considered bad practice, as the kernel recycles
UIDs/GIDs. So any potential leftover file/directory can then
become owned by the next user/group that gets added, with
unpredictable consequences.
Tests:
- Build the Debian package and run autopkgtest with qemu backend. The
test is passed.
- Revert the recent fix for loading icons. Build the Debian package
and run autopkgtests again. It is failed due to maximum redirects
followed.
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Tests:
- Building the package using cowbuilder works.
- Building the package using nocheck profile works.
- On a fresh stable machine, installing the package and patches works.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Closes: #2343.
- SVG icons from the project have been imported into the static/theme/icons
directory. In future, more icons from this and projects will be included in this
directory. We no longer use glyphicons from a font file.
- SVG icons are more flexible as we can mix and match icons from different
projects like fork-awesome. Each file can be individually tweaked to our needs.
- They do not get anti-aliased like icons from font files.
- They could end being much smaller than a font file which usually 100KiB+. Only
icons used on a page are included in the page.
- They work when font resources are blocked for security reasons like in case of
NoScript extension.
- They don't require separate resource to be loaded as SVG is typically inlined
in the HTML file. This should improve page load time.
- They can be animated and tweaked with CSS/JS.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- All the icons appear as before.
- They change colors in light/dark mode.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- Icons works in light/dark mode.
- All icons appear as expected.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Add a component to easily manage registration of client applications.
Tests:
- Package build is successful has dependency on python3-django-auto-toolkit
- python3-django-oauth-toolkit can be installed on stable, testing and unstable
containers
- /.well-known/openid-configuration and /.well-known/jwks.json are servered
properly.
- /o/ URLs don't require login to access
- When logging in list of claims includes 'sub', email, freedombox_groups.
- Logging in using IP address works. Also works with a port.
- Logging in using 127.0.0.1 address works. Also works with a port.
- Logging in using localhost works. Also works with a port.
- Logging in with IPv6 address works. Also works with a port.
- Logging in with IPv6 [::1] address works. Also works with a port.
- Logging in with IPv6 link-local address with zone ID is not possible (as
browsers don't support them).
- When authorization page is enabled, scopes show description as expected.
- When domain name is added/removed, all OIDC components are updated with
expected domains
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Without the --git-export-dir option, gbp builds from the current directory
which contains .container and many other large files. All of these files will
get included into the tarball by default when 'gbp buildpackage' is executed in
an unclean folder.
- With the --git-export-dir option set, 'git export' is first executed to a
temporary directory and this git operation respects patterns in .gitignore. Thus
only expected files end up in the freedombox package source tarball.
Tests:
- When the source directory contains files in ./container, running 'gbp
buildpackage' results in freedombox*.tar.xz containing the disk images of the
containers. With this change, the tarball is clean and none of the files in
.gitignore endup in the tarball.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>