107 Commits

Author SHA1 Message Date
Gabriel Roldan
0307a076d6
Revert "Set version to 2.28.1.1"
This reverts commit afe3865df52d38b769092803e21357edf85e21f4.
2025-12-02 17:48:33 -03:00
Gabriel Roldan
d62972cb6d
Set version to 2.28.1.1 2025-12-02 17:48:33 -03:00
Gabriel Roldan
4f34696238
Add Control Flow extension 2025-11-30 19:43:17 -03:00
Gabriel Roldan
f5831bdcd9
Set version to 2.28.2-SNAPSHOT 2025-11-25 12:22:14 -03:00
Gabriel Roldan
3abc358364 Upgrade to GeoServer 2.28.1.0 2025-11-25 16:20:46 +01:00
Gabriel Roldan
dc60f8ef22
Revert "Set version to 2.28.0.2"
This reverts commit c9c252edd37944231fd25dfac16220d6939e8fb9.
2025-11-08 17:49:56 -03:00
Gabriel Roldan
c9c252edd3
Set version to 2.28.0.2 2025-11-07 16:37:01 -03:00
Gabriel Roldan
98b7a680c8
Add simple monitoring stack for development (Prometheus/Grafana)
Add basic Prometheus/Grafana setup for local development observability
and as a starting point for building custom production monitoring.

Usage: ./pgconfig -f monitoring.yml up -d
- Grafana at http://localhost:3000 (admin/admin)
- Prometheus at http://localhost:9091 with Eureka service discovery

Includes basic dashboard showing JVM metrics, HTTP rates, service health,
and resource usage. Intentionally kept simple - users should customize for
production with alerting, persistence, security, and integration with
existing observability platforms.

Features:
- Auto-discovery of scaled replicas via Eureka
- Comprehensive monitoring guide
- Example queries and dashboard customization tips

This is a development tool and foundation, not production-ready monitoring.
2025-11-06 22:23:01 -03:00
Gabriel Roldan
b77b89c8f4
Configure separate bind mount directories for development and acceptance tests
Use separate bind mount directory for acceptance tests

Configure catalog-datadir bind mount path via environment variable to
isolate acceptance test data from development data.

- catalog-datadir.yml: Use ${CATALOG_DATADIR_PATH:-$PWD/catalog-datadir}
- acceptance_datadir: Use catalog-datadir_acceptance directory
- compose/.gitignore: Ignore catalog-datadir_acceptance/

This prevents acceptance tests from failing when the development datadir
contains non-empty data, while preserving development data across runs.
2025-11-06 21:35:27 -03:00
Gabriel Roldan
849f6702c1
Revert "Set version to 2.28.0.1"
This reverts commit 234669be0a57d57c51156d9de33495895e07ed4d.
2025-11-06 13:27:28 -03:00
Gabriel Roldan
9d1d9395e0
Set version to 2.28.0.1 2025-11-03 22:27:59 -03:00
Gabriel Roldan
b33a27b9f6
Change volume mounts from /mnt/* to /opt/* 2025-10-31 20:34:28 -03:00
Cécile Vuilleumier
b368bcfdd5
Fix acceptance tests startup (#709) 2025-10-29 10:39:09 +01:00
Gabriel Roldan
74a0bef614
Add README with simple instructions for the development compose files 2025-10-23 10:47:53 -03:00
Gabriel Roldan
fe660177a5
Default to using the compose/catalog-datadir/ directory to simplify joining the cluster from an IDE 2025-10-23 10:43:41 -03:00
Gabriel Roldan
942a55b90e
Revert "Set version to 2.28.0.0"
This reverts commit 63773a3e3ef3fdd9c969b71b752686e2a336ab5d.
2025-10-16 11:59:36 -03:00
Gabriel Roldan
63773a3e3e
Set version to 2.28.0.0 2025-10-16 11:57:02 -03:00
Gabriel Roldan
036207be9b
Update GeoServer to 2.28.0.0, ACL to 2.4.0 2025-10-16 10:44:07 -03:00
Gabriel Roldan
df79d3c103
Build geoserver apps docker images in parallel 2025-10-01 21:44:48 -03:00
Gabriel Roldan
7261c14e83
Use a single database for development 2025-07-14 15:53:03 -03:00
Gabriel Roldan
ff7ae93b53
Expose config and discovery ports only when using 2025-07-14 11:42:27 -03:00
Gabriel Roldan
47ff586e2b
Consolidate ImageMosaic acceptance tests
- Add comprehensive ImageMosaic test coverage: direct directory, manual granules,
  empty store workflows, and XML-based store creation
- Fix file path handling: use direct paths instead of file:// URLs for local files
- Update documentation to mention shared mount volume at /mnt/geoserver_data
- Add version testing examples (TAG=2.27.1.0, TAG=2.26.2.0) to README

Tests pass with datadir backend but show limitations with pgconfig backend.
Provides comprehensive test coverage for realistic ImageMosaic workflows.
2025-07-12 00:50:00 -03:00
Gabriel Roldan
e460030859 Set version to 2.28.0-SNAPSHOT, upgrade to GeoServer 2.28.0-SNAPSHOT 2025-04-24 14:45:52 -03:00
Gabriel Roldan
d652e95926 Set version to 2.27.1-SNAPSHOT 2025-04-24 14:45:52 -03:00
Gabriel Roldan
84cbf1d351 Re-set version to 2.27.0.0 with gs.version 2.27.0.1
Revert "Set version to 2.27.1-SNAPSHOT" and set gs.version 2.27.0.1

This reverts commit 7bafa0519d4a2b4d9b4bc6e37b0ffe88fbbc7890.
2025-04-24 14:45:52 -03:00
Gabriel Roldan
7bafa0519d
Set version to 2.27.1-SNAPSHOT 2025-04-24 09:56:11 -03:00
Gabriel Roldan
ad6c222c80
Set version to 2.27.0.0 2025-04-23 22:51:04 -03:00
Gabriel Roldan
2b75ba065e
Upgrade geoserver-acl to 2.3.2 2025-04-14 12:48:48 -03:00
Gabriel Roldan
cec047f3a9
Run acceptance tests in standalone mode to reduce startup time 2025-04-08 20:45:10 -03:00
Gabriel Roldan
598b3ccc85
Add configurable filter for vector and raster formats
This commit adds support for filtering GeoTools DataAccessFactory and
GridFormatFactorySpi implementations available in GeoServer Cloud, providing
fine-grained control through YAML configuration.

Key features:
- Control which vector and raster data source formats are available through configuration
- Configuration uses user-friendly display names with placeholder resolution
- Auto-configuration runs before catalog initialization
- Vector formats filtered by deregistering DataAccessFactory instances
- Raster formats filtered using a custom FilteringFactoryCreator
- Format filtering persists even when formats are reloaded via scanForPlugins()

Configuration example:

Documentation has been added to:
- src/starters/vector-formats/README.md
- src/starters/raster-formats/README.md
- docs/configuration/index.md
2025-04-06 12:56:04 -03:00
Gabriel Roldan
dc44b9fb6f
Enable pgconfig acceptance tests CI job 2025-02-28 18:34:18 -03:00
Gabriel Roldan
cde210a500
chore: Fix several spelling errors 2025-02-20 17:09:50 -03:00
Gabriel Roldan
dc349c2351
Fix GeoServer LDAP Authentication
This commit fixes an issue where GeoServer Cloud's LDAP authentication
was failing due to the JNDI context builder not correctly handling a
parameterized `java.naming.factory.initial` value.

- **Fixed `SimpleNamingContextBuilder` to respect a provided `INITIAL_CONTEXT_FACTORY` parameter**:
  - If a JNDI environment specifies `java.naming.factory.initial`,
    the builder now correctly instantiates and returns the corresponding `InitialContextFactory`.
  - Previously, the builder ignored the parameter, always returning the default
    `SimpleNamingContextFactory`, preventing external JNDI implementations (such as LDAP) from being used.
  - Refactored logic into `createFromEnvironment()` for better readability and maintainability.

- **Enhanced tests for `SimpleNamingContextBuilder`**:
  - Added a test case to verify that a custom JNDI factory (e.g., `com.sun.jndi.ldap.LdapCtxFactory`)
    is instantiated when specified.
  - Ensured incorrect values (e.g., non-class types, invalid class names) trigger expected exceptions.
  - Refactored test class to use `@TestMethodOrder` to ensure execution order consistency.

- **Added a sample OpenLDAP service to `infra.yml`**:
  - Provides a test LDAP server for validating authentication against GeoServer Cloud.
  - Includes setup instructions for configuring LDAP authentication in GeoServer.

1. Run the updated GeoServer Cloud stack with the new LDAP service:
```
   cd compose/
   ./datadir up -d
   ./datadir scale ldap=1
```

(or `./pgconfig` instead of `./datadir`)

2. Configure LDAP authentication in GeoServer:
   - Go to **Authentication → Authentication Providers → Add new → LDAP**.
   - Set **Server URL**: `ldap://ldap:389/dc=georchestra,dc=org`.
   - Configure:
     - **User lookup pattern**: `uid={0},ou=users`
     - **Enable LDAP groups for authorization**: check
     - **Enable Hierarchical groups search**: check
     - **Nested group search filter**: `member={0}`

3. Save and add the new LDAP provider to the authentication chain.

4. Test authentication using:
   - Username: `testadmin`, Password: `testadmin`
   - Username: `testuser`, Password: `testuser`

5. Check the logs to ensure no `NotContextException` errors occur.

- Fixes LDAP authentication issues when running GeoServer Cloud with JNDI-based user authentication.
- Improves modularity and correctness of JNDI context initialization.
- Allows external authentication providers to function as expected.
2025-02-18 23:06:45 -03:00
Gabriel Roldan
990193b135
Refactor (dev) Docker Compose files for Improved Reusability and Consistency
Refactor the Docker Compose configurations to improve maintainability, reduce
duplication, and ensure consistent environment variable management across all services.

- **Extracted reusable volume and environment variable definitions** using YAML anchors:
  - `&geoserver_environment`: Defines common environment variables for GeoServer services.
  - `&geoserver_volumes`: Standardizes shared volume mounts.
  - `&gs-dependencies`: Centralized service dependencies.
- **Standardized environment variables** across all services:
  - Replaced repetitive `SPRING_PROFILES_ACTIVE` definitions with a shared `x-geoserver-env` anchor.
  - Removed redundant service-specific `JAVA_OPTS` definitions, replacing them with `JAVA_OPTS_DEFAULT`.
- **Updated `.env` file**:
  - Consolidated logging and default profile variables.
  - Cleaned up and reordered variables for clarity.
  - Removed unused `GATEWAY_SHARED_AUTH` and per-service `JAVA_OPTS_*` entries.
- **Refactored service definitions**:
  - Applied `x-geoserver-env` to all GeoServer services.
  - Applied `x-geoserver-volumes` to services requiring volume mounts.
  - Applied `x-gs-dependencies` to all dependent services.
- **Improved volume handling**:
  - Unified the `data_directory` and `geowebcache_data` volumes.
  - Ensured volumes are correctly referenced in all catalog configurations (`datadir`, `jdbcconfig`, `pgconfig`).

- **Reduces duplication**: Less repetition in `compose.yml` files.
- **Improves maintainability**: Easier to modify environment variables and dependencies in one place.
- **Ensures consistency**: All services use the same configuration structure.
- **Enhances readability**: More structured and understandable YAML files.

This refactor does not introduce functional changes but significantly improves configuration management.
2025-02-18 16:29:20 -03:00
Gabriel Roldan
655bc33537
Run catalog-datadir dev compose with a Docker-managed volume
This commit updates the **catalog-datadir** development environment
to use a **Docker-managed volume** instead of a bind mount.

This improves portability, simplifies volume management, and avoids
potential permission issues when running on different environments.

---

- **Replaced `datadir` bind-mounted volume** with a **Docker-managed volume (`data_directory`)**.
- **Updated `Makefile` cleanup process**:
  - Removed manual deletion of `compose/catalog-datadir/*` to prevent conflicts with Docker-managed volumes.
  - Deleted the `.keep` file since the directory is now managed by Docker.
- **Updated all services (`wfs`, `wms`, `wcs`, `wps`, `rest`, `webui`, `gwc`)** to use `data_directory` instead of `datadir`.

---

 **Improves portability** – Works across environments without needing to manually create `catalog-datadir/`.
 **Fixes permission issues** – Avoids bind-mounting a directory owned by the host, which could cause write issues inside containers.
 **Simplifies cleanup** – No need to manually delete files; Docker handles volume persistence.
2025-02-16 23:59:27 -03:00
Gabriel Roldan
a419e114c6
Upgrade GeoServer ACL 2.3.1 -> 2.4-SNAPSHOT 2025-02-04 01:30:50 -03:00
Gabriel Roldan
be5ff0690c
update version number in compose/.env 2025-01-28 13:37:58 -03:00
Gabriel Roldan
2320454a71
Upgrade dev compose to rabbitmq 4, and use the management instance for the webui 2025-01-26 23:47:58 -03:00
Gabriel Roldan
bca5b02603
Make runtime and AppCDs build steps have matching +UseCompressedOops JVM setting 2025-01-06 22:00:41 -03:00
Gabriel Roldan
45b2d1bfb0
Add access log configuration for geoserver
Introduce an `AccessLogFilter` to log incoming requests based on
the following configuration in `geoserver_logging.yml`, allowing
to enable/disable the access log, and define which URIs to log
when the `logging.level.org.geoserver.cloud.accesslog` logging
topic is set to different levels:

```yaml
logging:
  # Control behavior of the org.geoserver.cloud.accesslog logging topic. When enabled, the request logs will include the URI's that match
  # the following regular expressions at the spefified level. The defafult level is info (see logging.level.org.geoserver.cloud.accesslog below)
  # Additionally, if the json-logs spring profile is enabled, the log entries will include MDC attributes configured in the logging.mdc.include.* properties bellow
  accesslog:
    enabled: true
    # A list of java regular expressions applied to the request URL for logging at info level
    # The default behavior is to log all requests to the REST API
    info:
    - .*\/(rest|gwc\/rest)(\/.*|\?.*)?$
    # A list of java regular expressions applied to the request URL for logging at debug level
    # The default behavior is to log OWS requests
    debug:
    - .*\/(ows|ogc|wms|wfs|wcs|wps)(\/.*|\?.*)?$
    # A list of java regular expressions applied to the request URL for logging at trace level
    # The default behavior is to EXCLUDE only webui's static resources and known image extensions
    trace:
    - ^(?!.*\/web\/wicket\/resource\/)(?!.*\.(png|jpg|jpeg|gif|svg|webp|ico)(\\?.*)?$).*$
```

For example, the following request:

```shell
curl -u admin:geoserver -X POST -H "Content-Type: application/xml" \
http://localhost:9090/geoserver/cloud/rest/workspaces \
-d '<workspace><name>testws</name></workspace>'
```

Will produce a log entry like this (except the JSON formatting, which is
added for clarity):

```json
{
  "@timestamp": "2024-12-16T04:51:11.229-03:00",
  "@version": "1",
  "message": "POST 201 /geoserver/cloud/rest/workspaces ",
  "logger_name": "org.geoserver.cloud.accesslog",
  "thread_name": "http-nio-9105-exec-2",
  "level": "INFO",
  "level_value": 20000,
  "enduser.authenticated": "true",
  "application.instance.id": "restconfig-v1:192.168.86.128:9105",
  "enduser.id": "admin",
  "http.request.method": "POST",
  "application.version": "1.10-SNAPSHOT",
  "http.request.id": "01jf9sjy4ndynkd2bq7g6qx6x7",
  "http.request.url": "/geoserver/cloud/rest/workspaces",
  "application.name": "restconfig-v1"
}
```
2024-12-17 05:15:37 -03:00
Gabriel Roldan
767861d763
Set version to 1.10-SNAPSHOT 2024-12-05 11:34:34 -03:00
Gabriel Roldan
74fe7a29f5
Set version to 1.9.0 2024-11-29 17:02:32 -03:00
Gabriel Roldan
d4efdb73de
Keep the reload/reset event processing logic at the event processing level
* Prevent double event dispatching. Reload implies reset, avoid
  sending both events on reload().

* Revert changes to GeoServerImpl (overloading of resert() and reload()
  with a bolean `silent` argument). It doesn't prevent that once the
  Catalog and/or the GeoServer are reloaded, while the newly loaded
  objects are sync'ed to the in-memory one, CatalogInfoAdded and
  ConfigInfoAdded events are sent to all pods, and these ones in turn
  also do so, resulting in an explosion of events.
  Instead, disable event publishing completely while reload() and
  reset() are being processed:

  * `CatalogApplicationEventPublisher` gets new methods:
    `disable()`, `enable()`, and `enabled():boolean`.
  * `GeoServerLifecycleEventPublisher.beforeReload()` sends the
    `ReloadEvent` and disables event publishing while `reload()` is
    processed locally.
  * `GeoServerLifecycleEventPublisher.reloaded()` re-enables event
    publishing.
2024-11-29 01:46:39 -03:00
Gabriel Roldan
57de781522 Fix commit 22c729ba, :z shall be put in the service volume mount point 2024-11-02 14:28:40 -03:00
Gabriel Roldan
22c729ba6a
Add :z SELinux label to bind mounts in dev and sample docker compose files
`:z` tells Docker to label the volume for shared access among multiple containers.

Turns out to be important when there's for example a geopackage
in a shared data directory.
2024-10-31 20:42:43 -03:00
Gabriel Roldan
4931a9125b
Set default values for min/max heap memory percentage in the base JRE image
Add `-XX:MaxRAMPercentage=80 -XX:InitialRAMPercentage=30` to the
`DEFAULT_JAVA_TOOL_OPTIONS` env var in the base JRE docker image
as they're good defaults so people doesn't need to be figuring
it out themselves.
2024-10-30 14:40:02 -03:00
Gabriel Roldan
33dfdc50d7
Fix saving workspace services not working with pgconfig
Saving the workspace services not working with pgconfig when
caching is enabled. `CachingGeoServerFacade` assumed there's
nothing to do when a `ServiceInfo` is added for a workspace,
but it was caching the `null` value, which is expected to save
db roundtrips.

- Add missing treatment of `ServiceInfoAdded` and `SettingInfoAdded`
to `CachingGeoServerFacade`.

- Add referential integrity for settingsinfo and serviceinfo

Now the flyway migration will add referential integrity for:

 - `settingsinfo(workspace) -> workspaceindo(id)`
 - `serviceinfo(workspace) -> workspaceinfo(id)`

And unique indexes for:

- `settingsinfo(workspace)`
- `serviceinfo("@type", workspace)`

As a side effect of the caching facade returning null once a
`ServiceInfo` as added, you could add multiple services of the
same kind for a workspace. The referential integrity checks will
avoid that, and the FlyWay migration will delete existing duplicates.
2024-10-25 22:07:55 -03:00
Gabriel Roldan
4aec64e5c8
Rename UID and GID env variables in the acceptance compose scripts
with UID and GID, I'm getting the following error in macos, renamed
as GSUID and GSGID.

```
UID: readonly variable
```
2024-10-25 13:53:06 -03:00
Gabriel Roldan
2684f12bed
Enable AppCDS creation during Docker image build
AppCDS (Application Class Data Sharing) is a JVM feature that allows preloading
and sharing class metadata across JVM instances. This can significantly improve
startup time and reduce memory usage, especially for large applications with
many dependencies.

This patch launches the applications during the Docker image build process for a
short period of time (until the spring context is first refreshed) to build the
AppCDS archive, and introduces an `AutoConfiguration` that:

- Allows passing a JVM argument (`-Dspring.context.exit=<event>`) to terminate
  the application upon specific Spring `ApplicationContextEvent` events.
- Facilitates starting the application during Docker image builds to create the
  AppCDS archive, improving startup performance.

Supported events include:
- `onPrepared`
- `onRefreshed`
- `onStarted`
- `onReady`

Note: Spring Boot 3.2+ natively supports `spring.context.exit=onRefresh` as of
[this commit](eb3982b6c2),
so this feature may not be necessary post-upgrade from Spring Boot 2.7.

Additional events are included for cases where certain applications may require
different startup stages for proper initialization. The new `offline` embedded
Spring profile should also facilitate starting without Spring Cloud Bus, ACL,
etc.
2024-10-22 19:47:16 -03:00
Gabriel Roldan
091e95d7c7
lower down number of cpus for gateway and gwc in dev compose, committed accidentally with 8 cpus 2024-10-22 09:29:51 -03:00