Aller au contenu principal
Jahia Store
FR

OSGi Configurations Manager

community
Télécharger 1.0.4

Informations

Identifiant du module
osgi-configurations-manager
Identifiant de groupe
org.jahia.community
Statut
community
Catégorie
Admin Features
Auteur
dgigon@jahia.com
Site web du développeur
http://www.jahia.com
Nécessite Jahia
8.2.2.0
Mis à jour
2026-07-09
Source
scm:git:git@github.com:Jahia/osgi-configurations-manager.git
Étiquettes
  • osgi
  • configuration

OSGi Configurations Manager Overview

The OSGi Configurations Manager is a Jahia module that allows administrators to manage OSGi configuration files (.cfg, .yml) directly from the Jahia Administration interface.

Key Features

  • File Management: List, create, delete, and enable/disable (.disabled) configurations.
  • Advanced Search: Filter by name or perform a Deep Search within file content.
  • Visual Editor: Structured editing for .cfg files with drag-and-drop reordering.
  • Raw Editor: Integrated Monaco Editor with syntax highlighting for YAML and Properties.

Security & Traceability

  • Encryption: Built-in CryptoEngine supports ENC(...) values. Encryption can be toggled per property.
  • Audit Logging: All sensitive actions (Save, Delete, Toggle) are logged with the acting username.
  • File Filtering: Sensitive files can be hidden via org.jahia.modules.osgiconfigmanager.cfg using the filteredFiles property.

Developer Guide: Decrypting Properties

To use encrypted properties in your Java services, use the CryptoEngine:

import org.jahia.modules.osgiconfigmanager.admin.CryptoEngine;

public void update(Map<String, Object> properties) {
    String value = (String) properties.get("mySecret");
    if (value != null && value.startsWith("ENC(") && value.endsWith(")")) {
        String cipherText = value.substring(4, value.length() - 1);
        this.secret = CryptoEngine.decryptString(cipherText);
    }
}

Captures d'écran

Versions

Added

  • I added wildcard support to filteredFiles and allowedFiles, so entries such as org.apache.* and jmx.* can now match multiple configuration files.
  • I shipped a default module configuration file at src/main/resources/META-INF/configurations/org.jahia.modules.osgiconfigmanager.cfg.
  • I preconfigured the blacklist with: (if you already deployed a previous version, you will have to add these exclusions manually).
    • org.apache.*
    • jmx.*

Changed

  • I updated the documentation to explain where the default configuration file must be placed in a module project.
  • I updated the release process so generated frontend assets are ignored during release checks.

Tests

  • I added Java tests covering exact matches, wildcard matches, whitelist behavior, and factory PID handling.
Nécessite Jahia 8.2.2.0Mis à jour 2026-06-15

New features
Added a full Jahia/Moonstone UI refresh:

  • redesigned the file list and editor layout to better match Jahia administration patterns
  • moved global actions (New, Import, Refresh) to the top header
  • added a dedicated file action toolbar with Disable/Enable, Mark as default, Download, Delete and Raw Edit / Visual Edit
  • aligned dialogs, toolbars, badges and warnings with Moonstone components and variables

Added a Moonstone-based creation dialog:

  • replaced the custom create dialog with a real Moonstone Modal
  • added Moonstone tabs for:
    • manual file creation
    • creation from a simple PID
    • creation of a factory instance
  • improved footer actions and overall consistency with Jahia UI patterns

Added configurable visual formatting controls for the visual .cfg editor:

  • comments and empty lines are now hidden by default in visual mode
  • added a new OSGi configuration flag visualFormattingControlsEnabled
  • when enabled, the visual editor exposes controls to:
    • add comments
    • add empty lines
    • toggle comment visibility
    • toggle empty-line visibility

Improved configuration state rendering in the UI:

  • replaced custom badges with Moonstone Chip-based badges
  • added icon-based compact badges in the file list
  • improved contextual banners for MODULE and MODULE_DEFAULT
  • replaced the old file-status dot with a Jahia-style vertical status rail in the sidebar

Improved editor interactions and destructive flows:

  • added consistent unsaved-changes protection for:
    • file switching
    • create
    • upload
    • refresh
    • disable
    • mark as default
    • cancel
  • improved delete confirmation wording and destructive button styling
  • removed redundant mode-switch actions from the raw editor once the shared mode selector is available

Improved header and toolbar behavior:

  • Save and Cancel now behave as the main state indicators for pending changes
  • cleaned up unnecessary labels and redundant actions
  • restored tooltips on action buttons and improved long-tooltip rendering for translated labels

Quality
Improved automated test coverage and maintainability:

  • split the previous monolithic Cypress spec into feature-oriented specs
  • added coverage for:
    • app shell
    • config lifecycle
    • creation flows
    • sidebar and header behavior
    • visual editor
    • raw editor
    • unsaved-changes confirmation flows
  • added targeted unit tests for config state badges and visual editor behavior
  • reduced duplication in shared UI actions to improve Sonar compatibility
  • validated the module with:
    • yarn test --runInBand
    • yarn build
    • mvn clean install sonar:sonar

Documentation
Updated project documentation with:

  • the new Jahia-aligned UI structure
  • header-based global actions
  • the new visualFormattingControlsEnabled configuration flag
  • updated Cypress/testing documentation
  • current build and Sonar validation commands
Nécessite Jahia 8.2.2.0Mis à jour 2026-04-24

New features

Added support for a white list of configuration files:

  • expose only an explicit subset of .cfg / .yml files in the manager
  • when a white list is defined, it takes precedence over the black list
  • only whitelisted files can be viewed, edited, uploaded, created, deleted or toggled through the tool

Added a root-only manager configuration:

  • the module now exposes its own configuration through OSGi Metatype
  • the manager configuration can be created from Metatype if it does not exist yet
  • only the root user can see, create or edit this configuration

Added Jahia configuration state awareness in the UI:

  • detect and display MODULE, MODULE_DEFAULT, and USER configurations
  • show badges in the file list and editor header
  • show contextual warnings for module-managed files
  • allow marking eligible files as MODULE_DEFAULT directly from the UI

Added Metatype assistance to the visual .cfg editor:

  • Add Property now opens a searchable Metatype-aware dialog when metadata is available
  • the same dialog still allows creating a custom property not declared in Metatype
  • Metatype-backed properties can be inserted with their default value
  • known properties now expose hover documentation in the visual editor

Added empty line visibility toggle in the visual .cfg editor:

  • show or hide empty lines independently from comments
  • preference is persisted like comment visibility
  • adding a new empty line automatically re-enables empty-line display

Updated README documentation with:

  • white list behavior
  • root-only manager configuration
  • visual editor Metatype assistance
  • empty-line toggle behavior

Security

Hardened backend file handling:

  • stricter filename validation
  • normalized path resolution under karaf/etc
  • blocked invalid paths and unauthorized target files more defensively

Improved crypto handling:

  • removed the weaker CBC fallback
  • restricted decryption flow to the stronger AES/GCM path

Updated project dependencies to address GitHub security and Dependabot alerts.

Nécessite Jahia 8.2.2.0Mis à jour 2026-04-17

New features

  • Added Metatype-aware assistance in the raw .cfg editor:
    • property discovery panel
    • inline completion for keys and values
    • hover documentation
    • default values and allowed values display
    • light warning for properties not declared in the Metatype
  • Added first-level Metatype assistance in the raw .yml editor:
    • property panel
    • hover documentation
    • completion for root-level keys and simple values
    • light warning for unknown root-level keys
  • Added Metatype-driven configuration creation:
    • create a .cfg file from an available OSGi PID that has no file yet
    • generated files are prefilled with commented default values
  • Added factory configuration creation:
    • list factory-capable configurations
    • display existing instances
    • create new instances with an explicit identifier
  • Added a tabbed “Create configuration” dialog for:
    • manual file creation
    • creation from a simple PID
    • creation of a factory instance

Improvements

  • Added a warning confirmation dialog before disabling a configuration file from the toggle action
  • Improved raw editor usability with richer contextual help from OSGi Metatype metadata
  • Improved the property insertion side panel UI for long property names
  • Added double-click insertion support from the available-properties panel
  • Improved Cypress coverage for creation flows, toggle warning behavior, and Metatype-assisted editing
  • Added helper scripts for end-to-end testing:
    • tests/run-e2e-docker.sh
    • tests/run-e2e-local.sh

Build and maintenance

  • Standardized the project on Yarn
  • Updated the Jahia parent to 8.2.2.0
  • Reduced Maven build noise and improved build compatibility
  • Refactored backend code to reduce duplication and satisfy Sonar quality checks
Nécessite Jahia 8.2.2.0Mis à jour 2026-04-16
Nécessite Jahia 8.2.0.0Mis à jour 2026-03-17