@@ -53,28 +53,38 @@ if they still need it.
5353
5454==== Gremlin Server Initialization Without Groovy
5555
56- Gremlin Server no longer requires Groovy for server initialization. Three new YAML configuration mechanisms replace
57- the Groovy init scripts that were previously used to create `TraversalSource` bindings, load data, and run lifecycle
58- hooks.
56+ Previous versions of Gremlin Server relied on the Groovy script engine for basic server initialization; binding
57+ traversal sources, loading data, and running lifecycle hooks all required Groovy init scripts. This meant the Groovy
58+ script engine was active by default, even for users who only needed to send standard Gremlin queries. An active
59+ scripting engine capable of executing arbitrary code introduces a security surface that is difficult to harden and
60+ easy to misconfigure.
5961
60- ===== Auto-Created TraversalSources
62+ As of this release, Groovy is completely disabled by default throughout the entire server lifecycle. Server
63+ initialization is handled through new declarative YAML configuration, and standard Gremlin queries are processed by the
64+ `gremlin-lang` engine. Users who explicitly need Groovy script execution can still opt in, but it is no longer
65+ required for any standard usage.
6166
62- Any graph defined in the `graphs` section that does not have an explicit `traversalSources` entry will automatically
63- get a `TraversalSource` binding. A graph named `graph` is bound to `g`; all others are bound to `g_<name>`.
67+ ===== Simplified Server Configuration
6468
65- A minimal server configuration is now:
69+ The most basic server setup, initializing a basic graph with a traversal source, previously required a Groovy init
70+ script just to create the `g` binding. Now, any graph defined in the `graphs` section automatically gets a
71+ `TraversalSource` according to these rules:
72+
73+ * A graph named `graph` is implicitly bound to `g`
74+ * All others are bound to `g_<graph-name>` (e.g. `modern` gets `g_modern`)
75+
76+ A fully functional minimal configuration is now simply:
6677
6778[source,yaml]
6879----
6980graphs: {
7081 graph: conf/tinkergraph-empty.properties}
7182----
7283
73- This automatically creates a `g` binding — no init script needed.
74-
75- ===== Declarative `traversalSources`
84+ ===== Strategy Configuration via `traversalSources`
7685
77- A new `traversalSources` YAML section allows explicit `TraversalSource` creation with optional strategy configuration:
86+ For cases that require custom traversalSource naming or strategies on a `TraversalSource` (e.g. `ReadOnlyStrategy`), the
87+ `traversalSources` YAML section provides explicit control without scripting:
7888
7989[source,yaml]
8090----
@@ -85,14 +95,18 @@ traversalSources: {
8595
8696Each entry specifies:
8797
88- - `graph` (required) — references a key in the `graphs` section
89- - `gremlinExpression` (optional) — a Gremlin expression evaluated with a base traversal source bound as `g`
90- - `language` (optional) — which script engine to use for the expression (defaults to `gremlin-lang`, or the sole
98+ - `graph` (required): references a key in the `graphs` section
99+ - `gremlinExpression` (optional): a Gremlin expression evaluated with a base traversal source bound as `g`
100+ - `language` (optional): which script engine to use for the expression (defaults to `gremlin-lang`, or the sole
91101 configured engine if only one is present)
92102
93- ===== Java-Based `lifecycleHooks`
103+ Graphs with explicit `traversalSources` entries are excluded from the implicitly defined traversal sources described in
104+ the previous section.
94105
95- A new `lifecycleHooks` YAML section replaces Groovy-based `LifeCycleHook` creation:
106+ ===== Java-Based Lifecycle Hooks
107+
108+ For startup and shutdown logic that goes beyond declarative configuration such as loading sample data, initializing
109+ caches, or custom setup, Java-based `LifeCycleHook` implementations can now replace Groovy init scripts:
96110
97111[source,yaml]
98112----
@@ -102,16 +116,14 @@ lifecycleHooks:
102116----
103117
104118Each entry specifies a `className` implementing `LifeCycleHook` and an optional `config` map passed to the hook's
105- `init()` method. The built-in `TinkerFactoryDataLoader` supports datasets: `modern `, `classic `, `crew `, `grateful `,
106- `sink `, and `airroutes `.
119+ `init()` method. The built-in `TinkerFactoryDataLoader` supports datasets: `airroutes `, `modern `, `classic `, `crew `,
120+ `grateful `, and `sink `.
107121
108- ===== Deprecation of Groovy Init Scripts
122+ ===== Migrating from Groovy Init Scripts
109123
110124Creating `TraversalSource` and `LifeCycleHook` instances via Groovy init scripts is now deprecated. Existing scripts
111- continue to work, but a deprecation warning is logged at startup. Migrate to the YAML-based configuration described
112- above.
113-
114- ===== Migration Examples
125+ continue to work when `GremlinGroovyScriptEngine` is explicitly configured, but a deprecation warning is logged at
126+ startup. Support for Groovy script initialization and customization may be dropped in a future release.
115127
116128*Before (Groovy init script):*
117129
@@ -136,7 +148,7 @@ lifecycleHooks:
136148 - { className: org.apache.tinkerpop.gremlin.server.util.TinkerFactoryDataLoader, config: {graph: graph, dataset: modern}}
137149----
138150
139- The `g` binding is auto- created from the `graph` entry. No `scriptEngines` section is needed.
151+ The `g` binding is implicitly created from the `graph` entry. No `scriptEngines` section is needed.
140152
141153== TinkerPop 4.0.0-beta.2
142154
0 commit comments