Commit Graph
401 Commits
Author SHA1 Message Date
James Valleroy 93796b9479 doc: Fetch latest manual
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2024-12-16 21:31:58 -05:00
Sunil Mohan Adapa b64ea720fc sso: Switch using cryptography module instead of OpenSSL.crypto
Closes: Debian bug #1088760.

- OpenSSL.crypto.sign has been deprecated and in the current version of
python3-openssl in Debian testing, it has been dropped. The recommended
alternative is cryptography.hazmat.primitives. So, use this instead.

- The entire OpenSSL.crypto module is planned to be deprecated in the future.
So, stop using it entirely by using cryptography.hazmat.primitives.

- sso app does not use openssl anymore, so drop dependency on it. Other apps
such as Let's Encrypt do depend on it and but they have their own dependency
declared. The freedombox package on the overall retains on 'openssl' package.

- We are not using the python OpenSSL module anywhere else, so drop dependency
on it.

- Use pathlib to simplify some code.

- Ensure proper permissions on private and public keys as they are being written
to.

Tests:

- Freshly setup container and ensure that first run succeeds. Permission on the
public/private key files and the parent directly are correct. Users are able
login to FreedomBox. SSO works when accessing apps such as transmission.

- Without patches, setup freedombox container. Apply patches. Permission for
keys directory is updated but keys are not overwritten. Login to FreedomBox
works. SSO works when accessing apps such as transmission.

- Run code to perform signatures using old code and ensure that newer code
generates bit-identical signatures.

- Running ./run --list-dependencies show 'openssl' and python3-cryptography.

- Running unit tests works.

- Building debian package works.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
2024-12-14 23:41:13 +05:30
James Valleroy c4c071ddfd doc: Fetch latest manual
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2024-11-18 20:39:42 -05:00
James Valleroy e02ffd086c doc: Fetch latest manual
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2024-11-04 20:36:41 -05:00
James Valleroy 30c9609e04 doc: Fetch latest manual
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2024-10-21 20:42:31 -04:00
James Valleroy 70a92eb2f8 doc: Fetch latest manual
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2024-10-07 20:37:36 -04:00
James Valleroy d5070f62cc doc: Fetch latest manual
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2024-09-25 11:57:21 -04:00
James Valleroy c3e9dda748 doc: Fetch latest manual
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2024-09-23 20:42:18 -04:00
James Valleroy dc384f67a4 doc: Fetch latest manual
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2024-09-09 21:07:55 -04:00
James Valleroy 37b957e161 doc: Fetch latest manual
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2024-08-26 20:25:13 -04:00
Sunil Mohan Adapa a2159bdff0 doc/dev: Limit table of contents depth to 2 for clarity
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2024-08-26 18:29:58 -04:00
Sunil Mohan Adapa 70742bfd91 doc/dev: Fix Django related errors with auto-documentation
Closes: #2405.

- When Django module is mocked, there are some cases where modules using django
can't be imported due to errors.

- To fix that, don't mock the django module and require django and related
Debian packages to be installed on the system generate developer documentation.

- Initialize django in Sphinx configuration to allow django modules to be
imported without errors.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2024-08-26 18:29:55 -04:00
Sunil Mohan Adapa 3b5abf1ae9 doc/dev: Update copyright year
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2024-08-26 18:29:50 -04:00
James Valleroy 246e356fd6 doc: Fetch latest manual
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2024-08-12 22:10:19 -04:00
James Valleroy 2f82c484ae doc: Fetch latest manual
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2024-07-29 22:35:52 -04:00
James Valleroy 86557f7913 doc: Fetch latest manual
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2024-07-16 22:52:59 -04:00
James Valleroy 2a51fb8c9b doc: Fetch latest manual
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2024-07-01 20:55:10 -04:00
James Valleroy 15ff133166 doc: Fetch latest manual
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2024-06-17 20:47:37 -04:00
James Valleroy f6fc7614af doc: Fetch latest manual
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2024-06-03 20:34:50 -04:00
James Valleroy 7aefa4335a doc: Fetch latest manual
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2024-05-20 20:34:07 -04:00
James Valleroy 97bebf1a1e doc: Fetch latest manual
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2024-05-06 20:59:27 -04:00
James Valleroy 92a022260b doc: Fetch latest manual
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2024-04-22 20:32:24 -04:00
Sunil Mohan Adapa 4bbff86ff3 doc: Fetch latest manual
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2024-04-08 20:21:35 -07:00
James Valleroy ff403c8af6 doc: Fetch latest manual
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2024-04-08 22:41:42 -04:00
James Valleroy 5a7a0c1268 doc: Fetch latest manual
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2024-03-25 21:12:40 -04:00
James Valleroy d962e8b4c0 doc: Fetch latest manual
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2024-03-11 20:40:29 -04:00
Sunil Mohan Adapa 4b09d91f93 *: Add type hints for diagnose method
Helps: #2410.

- Ensure that diagnostics methods and parameters are type checked so that we can
catch any potential issues.

- Move plinth/modules/diagnostics/check.py to plinth/diagnostic_check.py to
avoid many circular dependencies created. This is due to
plinth.modules.diagnostics automatically imported when
plinth.modules.diagnostics.check is imported. Also app.py is already (type)
dependent on diagnostic_check due to diagnose() method. To make the Check
classes independent of diagnostic module is okay.

Tests:

- Run make check-type.

- Run full diagnostics with following apps installed: torproxy, tor.
  - Test to netcat to 9051 in tor works.
  - Test 'port available for internal/external networks' in firewall works.
  - Test 'Package is latest' works.
  - Test 'Access url with proxy' in privoxy works.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
[jvalleroy: Also move tests for diagnostic_check]
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2024-03-09 14:23:33 -05:00
James Valleroy 169eb9854f doc: Fetch latest manual
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2024-02-26 20:58:28 -05:00
Sunil Mohan Adapa 02e409a3a1 daemon: Add new component for daemons shared across apps
- This is useful for managing redis service needed by the upcoming Nextcloud
app.

- Disable the daemon only if all the apps using it are disabled. Enable it when
even one of the them is enabled.

- The component is not a 'leader' component as it does not decide the
enabled/disabled status of the app.

Tests:

- Unit tests pass.

- Install zoph and wordpress with full patch series. If one of the apps is
disabled, mysql service is still enabled and running. If both apps are disabled,
then mysql service is disabled and not running. Enabled/disabled status of apps
are accurate after they are enabled/disabled.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2024-02-21 20:54:49 -05:00
James Valleroy 13793fee1f doc: Fetch latest manual
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2024-02-12 21:23:44 -05:00
Sunil Mohan Adapa 808380ff52 doc: dev: Update all references to setup.py
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2024-02-12 19:17:11 -05:00
Sunil Mohan Adapa 812ed5d60d *: Introduce make file based build, eliminate setup.py
- 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>
2024-02-12 19:17:09 -05:00
Sunil Mohan Adapa 54f447785d doc: Install man1 page using Makefile
- Also fix a typo with target name.

- Remove redundant OUTPUT= declarations.

- Make sure that 'manual-pages' PHONY target is not attempted to be removed on
clean.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2024-02-12 19:17:04 -05:00
James Valleroy 4585748fe8 doc: Fetch latest manual
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2024-01-29 20:47:49 -05:00
James Valleroy 012cc31f5a doc: Fetch latest manual
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2024-01-15 21:30:17 -05:00
James Valleroy 873afaef4b doc: Fetch latest manual
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2024-01-01 20:59:56 -05:00
James Valleroy 63edda2a29 doc: Fetch latest manual
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2023-11-20 21:05:55 -05:00
James Valleroy 441eee7e1f doc: Fetch latest manual
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2023-11-06 21:02:47 -05:00
James Valleroy 2a8b9b94ba app: Update diagnose() docstring
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
[sunil: Add reference documentation for the DiagnosticCheck and Result classes]
[sunil: Add link to DiagnosticCheck class from docstring]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2023-10-30 22:09:00 -07:00
James Valleroy dabd09a364 doc: Fetch latest manual
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2023-10-23 20:35:23 -04:00
James Valleroy c73e24708d doc: Fetch latest manual
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2023-09-25 20:46:55 -04:00
Sunil Mohan Adapa 38ece87c6c *: Utilize newer 3.10 syntax for type hints
Tests:

- mypy does not show any errors.

- Installing ejabberd app works. Privileged actions run fine.

- Unit tests work.

- No additional testing was done as type annotations don't have any effect at
runtime.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2023-09-25 20:03:34 -04:00
Sunil Mohan Adapa 2dd00a8f08 *: Fix all typing hint related errors
- Try to mark class variables in component classes.

- Leave typing hints generic, such as 'list' and 'dict' where content is usually
not filled, too complex, or context is unimportant.

- backups: Handle failure for tarfile extraction so that methods are not called
on potentially None valued variables.

- backups: Prevent potentially passing a keyword argument twice.

- dynamicdns: Deal properly with outcome of urlparsing.

- ejabberd: Deal with failed regex match

- email: Fix a mypy compliant when iterating a filtered list.

- tor: Don't reuse variables for different typed values.

- tor: Don't reuse variables for different typed values.

- operation: Return None explicitly.

- operation: Ensure that keyword argument is not repeated.

Tests:

- Where only typing hints were modified and no syntax error came up, additional
testing was not done.

- `mypy --ignore-missing-imports .` run successfully.

- Generate developer documentation.

- Service runs without errors upon start up.

- backups: Listing and restoring specific apps from a backup works.

- backups: Mounting a remote backup repository works.

- NOT TESTED: dynamicdns: Migrating from old style configuration works.

- ejabberd: Verify that setting coturn configuration works.

- email: Test that showing configuration from postfix works.

- tor: Orport value is properly shown.

- transmission: Configuration values are properly set.

- users: Running unit tests as root works.

- operation: Operation status messages are show properly during app install.

- ./setup.py install runs

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2023-09-25 20:03:24 -04:00
James Valleroy a2c5e315d8 doc: Fetch latest manual 2023-09-11 20:46:40 -04:00
James Valleroy bc90be15f3 doc: Fetch latest manual
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2023-08-28 20:46:06 -04:00
James Valleroy 63bba4cb8f doc: Fetch latest manual
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2023-08-14 21:08:00 -04:00
James Valleroy 13f0896853 doc: Fetch latest manual
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2023-07-31 20:38:07 -04:00
James Valleroy 4232bc1ec2 doc: Fetch latest manual
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2023-07-17 22:01:05 -04:00
James Valleroy 6201d91b44 doc: Fetch latest manual
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2023-06-19 20:44:24 -04:00
James Valleroy 855fe8fc20 doc: Fetch latest manual
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2023-06-05 22:06:21 -04:00