Commit Graph
24560 Commits
Author SHA1 Message Date
tammi-23 f626a77862 fix(http): write the dumped headers in a stable order
The headers were written in map iteration order, which made the HTTP dump
tests flaky and the trace logs harder to compare.
2026-10-31 00:09:52 +01:00
tammi-23 faae9f4628 test(groupware): skip the groupware integration tests like the JMAP integration tests when there is no Docker 2026-10-31 00:09:52 +01:00
tammi-23 5355325b84 fix(groupware): build on 32-bit platforms
The release pipeline also builds linux/386, where uint and int are 32 bits
wide: comparing the days of the related emails filter with math.MaxInt64
and the 20 GB disk quota of the Stalwart test users didn't compile there.

Also cap the days so that the time.Duration can't overflow.
2026-10-31 00:09:52 +01:00
tammi-23 522e7d125d test(jscontact): expect the RFC 9553 phone feature mobile instead of the vCard type cell 2026-10-31 00:09:52 +01:00
tammi-23 544e800100 groupware: upgrade Stalwart from 0.16.12 to 0.16.27 and stalwart-cli to 1.0.13
- jmaptest and opencloud_full: use Stalwart 0.16.27 and stalwart-cli 1.0.13
- use the BCP 47 locale "en-US" in the Stalwart configuration snapshots,
  Stalwart rejects "en_US" since 0.16.20
- TestGroupwareVacation: Stalwart 0.16.27 keeps isEnabled when other
  vacation properties change, expect true now
- TestWs: Stalwart may return a different but equivalent newState when
  nothing changed, and announces new mail with EmailDelivery (since 0.16.16)
2026-10-31 00:09:52 +01:00
tammi-23 435463af41 fix(groupware): request the JMAP capabilities required by identity, submission and address book calls
Identity/get and EmailSubmission were sent without
urn:ietf:params:jmap:submission, and all address book calls were sent with
the mail instead of the contacts capability. Stalwart rejects such calls
with unknownMethod since 0.16.x, which breaks the account bootstrap
(GET /groupware/accounts) and the address books.

Also use the calendar type for creating, updating and deleting calendars
(same capability, no change in behaviour).
2026-10-31 00:09:52 +01:00
Pascal Bleser 4888d96705 groupware: go back to Go 1.26 after rebasing onto main
The groupware branch had downgraded the go directive to 1.25 because the
build images were only available for 1.25 at the time. main requires
Go 1.26 by now (e.g. github.com/go-acme/lego/v5), so use 1.26.0 again,
like main does.

Assisted-by: Claude Code:claude-opus-5-5
2026-10-30 23:24:02 +01:00
Pascal Bleser 80e6efbcf0 opencloud_full: upgrade Stalwart from 0.16.9 to 0.16.12 2026-10-30 23:20:51 +01:00
Pascal Bleser 92ca22e910 groupware: upgrade Stalwart to 0.16.12 + fix modifying the VacationResponse
* fix jmap.SetVacationResponse: was using JMAP create instead of update
   with a patch; did so by using the modify template function as with
   most other JMAP APIs

 * better HTTP status code handling for the responses received from
   Stalwart

 * add support for not caching JMAP session retrieval failures in the
   Groupware backend, by setting the error TTL to 0
2026-10-30 23:20:51 +01:00
Pascal Bleser 6c3ebc7f7e groupware: move plain http functions to pkg/http
* introduce a new toplevel package pkg/http for plain HTTP related
   functions

 * move these functions from pkg/jmap to pkg/http, including tests:
   - PeekResponse
   - DumpHttpRequest
   - DumpHttpResponse
2026-10-30 23:20:51 +01:00
Pascal Bleser 72f4d0c6d6 groupware: add test for vacation responses, and fix issue found during testing 2026-10-30 23:20:51 +01:00
Pascal Bleser 4a55d016fe groupware: add response peeking 2026-10-30 23:20:51 +01:00
Pascal Bleser b5d9b20e55 groupware: introduce support for OC_INSECURE
* also look into the OC_INSECURE environment variable to allow
   accepting insecure TLS certificates

 * rename GROUPWARE_ALLOW_INSECURE_TLS to GROUPWARE_TLS_INSECURE to
   align with the nomenclature used by other backend services
2026-10-30 23:20:51 +01:00
Pascal Bleser d7cfccee69 jmap: remove unneeded function 2026-10-30 23:20:51 +01:00
Pascal Bleser 5d5e246a65 groupware: fix sorting emails in reverse order 2026-10-30 23:20:51 +01:00
Pascal Bleser ee03db134d groupware: add Groupware integration testing
* split off the Stalwart integration test boilerplate into a new
   jmaptest package, in order to be able to use it from the groupware
   package as well

 * remove the JMAP Session patching in tests and, instead, pick random
   free local ports for HTTP and IMAPS manually, and set those
   explicitly in the Stalwart testcontainer, so that we can set the
   PUBLIC_URL environment variable that Stalwart then uses to define the
   URLs that are served as part of the JMAP Sessions (API URL, etc...)
2026-10-30 23:20:51 +01:00
Pascal Bleser e3d635c25c groupware: introduce a new package 'jmaptest' in order to be able to reuse the Stalwart test fixture for Groupware tests 2026-10-30 23:20:51 +01:00
Pascal Bleser 73817a2b66 groupware: vscode launcher: enable /metrics endpoint on port 9203 2026-10-30 23:20:51 +01:00
Pascal Bleser a585c1ace8 groupware: add body tracing to WS, fix metrics registrations, add operation identifiers for metrics 2026-10-30 23:20:51 +01:00
Pascal Bleser ad66875349 groupware: add better HTTP logging
* introduce configuration settings for TLS insecurity, tracing requests
   and responses

 * use more secure implementation when replacing JMAP placeholders in
   URL templates, path escaping them to avoid injection

 * add more efficient tracing of HTTP requests and responses between the
   Groupware backend and the JMAP server, with the possibility of
   specifying a maximum body size to trace, to avoid blowing up the logs

 * use more efficient string building for HTTP Authorization headers

 * change internal API to use streams (io.Reader) instead of reading
   JSON responses fully into memory before parsing them
2026-10-30 23:20:51 +01:00
Pascal Bleser 473086531d groupware: slightly improve the implementation of e77250b7c4 2026-10-30 23:20:51 +01:00
Pascal Bleser 0560d7c9e9 groupware: opencloud_full: change Stalwart container healthcheck interval to 10m to reduce the noise in the logs 2026-10-30 23:20:51 +01:00
Pascal Bleser 56e561bd86 groupware: add workaround when using the master/impersonation account: in that case, don't use impersonation but the impersonation account directly 2026-10-30 23:20:51 +01:00
Pascal Bleser 8e678e797a groupware: enable GROUPWARE_ENABLE_MOCK_DATA for testing from within VSCode 2026-10-30 23:20:51 +01:00
Pascal Bleser 4af171aff8 groupware: fully implement suppliers for addressbooks and contacts
* implement supplier templating to allow addressbooks and contacts to
   come from various sources ("suppliers", thus) as opposed to solely
   from JMAP

 * add creating, deleting, updating, getting changes

 * add some search filter parameters, currently incomplete
2026-10-30 23:20:51 +01:00
Pascal Bleser 24ee690692 groupware: add suppliers support for object changes 2026-10-30 23:20:51 +01:00
Pascal Bleser 7c3aabb41c groupware: rename supplier implementations files 2026-10-30 23:20:51 +01:00
Pascal Bleser b5714c31a1 groupware: add support for multi-supplier getting a Contact by ID 2026-10-30 23:20:51 +01:00
Pascal Bleser 2ab47208ec groupware: rebump go from 1.25.0 to 1.25.8, as done by dependeabot in 5e27a70 2026-10-30 23:20:51 +01:00
Pascal Bleser 3ee15455d0 groupware: fix query objects in a container with multiple suppliers
* by adding a predicate that can analyze a filter and inform the
   template methods whether the filter is applicable for that supplier
   or not

 * this fixed /groupware/accounts/.../addressbooks/.../contacts
2026-10-30 23:20:51 +01:00
Pascal Bleser 64b03203f1 groupware: fix NPE when flattening durations in slist() 2026-10-30 23:20:51 +01:00
Pascal Bleser 9b78c967a3 groupware: upgrade traefik in opencloud_full from 3.3.1 to 3.7.5 2026-10-30 23:20:51 +01:00
Pascal Bleser d747b908a9 stalwart.yml: remove image tag for stalwart-import, which makes a 'docker compose pull' fail needlessly 2026-10-30 23:20:51 +01:00
Pascal Bleser f65a719381 stalwart-snapshot-passwords: fix for Node, and beautify 2026-10-30 23:20:51 +01:00
Pascal Bleser 17e5bfb71d groupware: introduce temporary configuration property GROUPWARE_ENABLE_MOCK_DATA that controls whether the mock addressbook and mock contacts should be injected or not; default is false/disabled since it is not fully functional yet 2026-10-30 23:20:51 +01:00
Pascal Bleser 3bcfea817f groupware: upgrade Stalwart to 0.16.9 in opencloud_full 2026-10-30 23:20:51 +01:00
Pascal Bleser 1a909bedb7 groupware: upgrade Stalwart to 0.16.9 for integration tests 2026-10-30 23:20:51 +01:00
Pascal Bleser 176598efc2 groupware: remove middleware.RealIP, as it has been deprecated and we currently do not have a use for it 2026-10-30 23:20:51 +01:00
Pascal Bleser a210032103 groupware: downgrade to Go 1.25 since our building images are only available for 1.25 at the moment
* retrofit from using self-referencing generics parameters that were
   introduced with Go 1.26, will re-enable when we upgrade to 1.26

 * re-introduce a 'ptr' func since we don't have the new 'new' func yet
   that comes with 1.26
2026-10-30 23:20:51 +01:00
Pascal Bleser a99b9b10e2 opencloud_full: add healthchecks for traefik, opencloud and stalwart to the docker compose project 2026-10-30 23:20:51 +01:00
Pascal Bleser b61ddf5758 groupware: fix GROUPWARE_JMAP_MASTER_USERNAME to Stalwart 0.16 requirements for using the primary email instead of the username 2026-10-30 23:20:51 +01:00
Pascal Bleser 4624236f23 groupware: fix building the stalwart:cli container
* fix the inline dockerfile for building the stalwart:cli container,
   cannot be based on scratch since we need a shell and wget, and it
   should thus retain the alpine container as its base

 * remove stdin_open and tty from the container attributes, not needed
2026-10-30 23:20:51 +01:00
Pascal Bleser 4cde585d39 groupware: fix the 'opencloud-certs' container to set necessary permissions on the files or the opencloud container can't access them 2026-10-30 23:20:51 +01:00
Pascal Bleser 38fc26e1ea groupware: update developer guide
* add instructions and container to create a key and certificate pair
   for the built-in IDM LDAP as we need it to listen on LDAPS for
   Stalwart, which has been disabled by default with
   https://github.com/opencloud-eu/opencloud/pull/2880

 * add environment variables to point to the certificates

 * update services/groupware/DEVELOPERS.md with up-to-date instructions,
   using Stalwart 0.16
2026-10-30 23:20:51 +01:00
Pascal Bleser 050323147d groupware: minor fix for the mock addressbook supplier 2026-10-30 23:20:51 +01:00
Pascal Bleser 439c3aa6e2 groupware: VSCode launcher: change GROUPWARE_JMAP_MASTER_USERNAME from 'master' to 'admin@example.org' to make it work with Stalwart >= 0.16 2026-10-30 23:20:51 +01:00
Pascal Bleser e6bf657ec9 groupware: move prefixed writer into export_integration_test.go + upgrade integration tests to Stalwart 0.16.8 + update Stalwart configuration to include necessary default roles 2026-10-30 23:20:51 +01:00
Pascal Bleser d057fc5e7b groupware: upgrade opencloud_full to Stalwart 0.16.8 and fix configuration by adding default roles as well as adding the 'impersonate' permission on the admin@example.org user 2026-10-30 23:20:51 +01:00
Pascal Bleser 527c6e668c groupware: jmap: add a test for Invocation seriaization 2026-10-30 23:20:51 +01:00
Pascal Bleser 5b936bae7b groupware: port opencloud_full to Stalwart 0.16 (only the built-in IDM LDAP option for now) 2026-10-30 23:20:51 +01:00