Commit graph

499 commits

Author SHA1 Message Date
55a369df83 Add debug sqlalchemy logs (disabled by default) 2024-01-08 22:45:59 +01:00
cd67b0934e Unify configuration requirements 2024-01-08 22:19:10 +01:00
276e0d0cd4 Use one config for cron and daemon tests 2024-01-07 21:52:52 +01:00
bc2fc53416 Update gitignore: generated config, project name 2024-01-06 15:46:33 +01:00
260a3f3e9c Configure pooling for cron tests 2024-01-06 15:26:18 +01:00
a943b50adb Update test configuration after renaming 2024-01-06 15:06:36 +01:00
a98ff611ee Continue renaming: config files, tests, docs 2024-01-06 14:45:09 +01:00
ad3a54fcd7 Rename GPG-Mailgate to Lacre
Update naming in documentation and the source code.
2024-01-06 14:34:54 +01:00
7208f66527 Improve simple filter structure 2024-01-05 22:21:20 +01:00
a09fd67a59 Make keys unexpirable 2024-01-05 22:11:14 +01:00
pfm
748fd00957 Merge pull request 'lacre.repositories: Configure SQLAlchemy connection pooling' (#136) from connection-pooling into main
Reviewed-on: #136
2024-01-04 18:52:03 +00:00
8f8f081d28 Fix key-removal condition, improve logging 2024-01-04 19:45:25 +01:00
07539a97d3 Improve logging
- Don't re-configure lacre.notify logger.
- Issue more DEBUG logs when deleting keys.
2023-12-20 23:03:04 +01:00
5c327b166a webgate-cron: Log more information, including exceptions 2023-12-19 18:21:00 +01:00
41b7535412 Add more logging, add --delete option to admin queue sub-command 2023-12-19 09:02:42 +01:00
9b5d578985 lacre.config: Make both enums case-insensitive
Also: use PGPStyle in lacre.core.
2023-12-17 20:42:57 +01:00
ff429c93e6 Convert pooling parameters to integers 2023-12-17 14:12:52 +01:00
90da933bf9 Make disconnect handling configuration explicit
- Provide a new reuqired parameter: [database]pooling_mode and use it during
  SQLAlchemy engine initialisation.

- Update tests and configuration (including sample configuration).

- Adjust repository unit test to load config during setup.

- Pass an engine instance to repository constructors instead of connections.
  Engine keeps a connection pool and we rely on it.
2023-12-17 14:03:20 +01:00
86cc27e918 lacre.repositories: Configure SQLAlchemy connection pooling
Provide 3 new configuration parameters in database section:

- max_connection_age --- number of seconds before an idle connection is
  "recycled", i.e. replaced with a new one;

- pool_size --- number of simultaneous connections kept in the pool;

- max_overflow --- maximum number of simultaneous connections we could make to
  the database.

Update sample config, including links to documentation.
2023-12-16 23:32:27 +01:00
pfm
18a64bcd72 Merge pull request 'Add ability to deliver cleartext when keys can't be loaded' (#135) from fix/keys-not-loaded into main
Reviewed-on: #135
2023-12-10 20:41:48 +00:00
e8d0d248b3 lacre.repositories: Add missing import 2023-12-10 21:39:59 +01:00
23a05c11ac Remove EncryptionException formatting test 2023-12-10 21:35:35 +01:00
8cc1136a90 lacre.daemon: When keys can't be loaded, fail gracefully
- Introduce '[daemon]bounce_on_keys_missing' option to let the admin decide if
  they want Lacre to deliver cleartext message when identity database is
  unreachable or throws exceptions.  It defaults to 'no'.

- In IdentityRepository, use option mentioned above to decide what to do when
  an exception is caught.
2023-12-10 21:27:05 +01:00
pfm
628de8a28d Merge pull request 'Fix cron script and more' (#134) from fix/cron-script into main
Reviewed-on: #134
2023-12-09 20:26:37 +00:00
c0b98649d4 lacre.admin: Document import command 2023-12-09 21:14:35 +01:00
fe2c0cbf76 Fix unprintable exception issue 2023-12-09 20:57:09 +01:00
75c48282b0 Rework encryption exception handling
Also: remove misleading comment about message.defects.
2023-12-09 20:38:46 +01:00
fc08813bdc Improve unencryptable message logs 2023-12-09 19:48:20 +01:00
d51c675881 lacre.admin: Make import -r option a flag (Boolean) 2023-12-05 21:51:35 +01:00
abaf8820d7 lacre.admin: Add -r / --reload option to import command
With -r option, import command will first remove all identities and then load
them again from pubring.kbx.
2023-12-05 21:49:23 +01:00
94d0a62766 Identity removal: execute prepared DELETE 2023-12-05 21:33:19 +01:00
cc1bacbe3d Move some imports to lacre.notify 2023-12-05 21:13:02 +01:00
pfm
4c603839b5 Merge pull request 'lacre.repositories: Fix IdentityRepository existence predicate' (#133) from 132-fix-repo-upsert into main
Reviewed-on: #133
2023-12-04 21:59:00 +00:00
0d852bc279 lacre.repositories: Fix IdentityRepository existence predicate 2023-12-04 22:57:43 +01:00
pfm
b7713207ab Merge pull request 'Fix unencrypted delivery and key removal' (#130) from 129-key-removal into main
Reviewed-on: #130
2023-12-02 20:59:13 +00:00
ac5dddfa98 Remove configuration options no longer used 2023-12-02 21:48:17 +01:00
052551072e Change table prefix from 'gpgmw' to 'lacre' 2023-12-02 20:02:59 +01:00
0975ce3a69 lacre.admin: Handle database exceptions 2023-11-26 19:52:58 +01:00
b44bd7b150 lacre.admin: Implement identity import, fix identity list
- Let the user specify a directory, using the one from configuration by
  default.

- If user requested identity list without a specific email, list all.  Drop
  support for '-a' option.
2023-11-26 18:30:25 +01:00
0fe5e6b3dc Make GnuPG.public_keys docstring more complete 2023-11-26 18:29:43 +01:00
aa8c353a05 Replace NBSP in doc/admin.md with a regular space 2023-11-26 18:29:09 +01:00
97c4f9f14a lacre.repositories: Fix naming after refactoring 2023-11-25 16:09:23 +01:00
626fce5f2c lacre.admin: Implement 'identities' sub-command 2023-11-25 16:08:54 +01:00
95c5802c38 Add test/lacre.db to gitignore 2023-11-25 15:09:00 +01:00
9b5c43b769 Fix crontest config, polish Makefile 2023-11-25 15:05:27 +01:00
7fe52ae8b5 Don't pass table definition to KeyConfirmationQueue 2023-11-25 15:02:48 +01:00
1ad0d2df0e Implement lacre.admin CLI tool 2023-11-25 14:07:10 +01:00
becb39f139 Clean up database access
- Don't pass table definitions to repository constructors.

- Keep an internal reference to Engine in lacre.repository.

- Implement KeyConfirmationQueue.count_keys.
2023-11-25 14:04:32 +01:00
4950e0b9c3 Keep secondary keyring for test purposes 2023-11-25 01:13:43 +01:00
acd33fec1e Fix inheritance issues
- Use accessor methods.
- Avoid data duplication.
2023-11-25 01:11:44 +01:00