From e89d591cb43099de94fcf447c9a08049da60f77a Mon Sep 17 00:00:00 2001 From: dennis zhuang Date: Fri, 26 Jun 2026 14:31:02 +0800 Subject: [PATCH] chore: declare GreptimeDB Enterprise License for enterprise-gated sources (#8364) * chore: declare GreptimeDB Enterprise License for enterprise-gated sources The `enterprise`-feature-gated sources (triggers, mito2 extension) were excluded from the Apache-2.0 header check but carried no license of their own. Declare a separate GreptimeDB Enterprise License and enforce it. - Add LICENSE-ENTERPRISE (open-core split; core stays Apache-2.0). - Add an Enterprise License header to each enterprise source file. - Add licenserc-enterprise.toml and a second hawkeye step in CI to enforce the Enterprise header on exactly those files. - Cross-reference the two complementary file lists; document the layout in licenses/README.md and the README License section. Signed-off-by: Dennis Zhuang * chore: reference per-customer Enterprise Agreement instead of a terms URL There is no public enterprise-terms page; each customer signs an individually negotiated agreement. Point the license at a "separate written commercial agreement with GrepTime Inc." and direct readers to the existing contact page. Signed-off-by: Dennis Zhuang --------- Signed-off-by: Dennis Zhuang --- .github/workflows/develop.yml | 4 ++ LICENSE-ENTERPRISE | 56 ++++++++++++++++++++ README.md | 8 ++- licenserc-enterprise.toml | 30 +++++++++++ licenserc.toml | 4 +- licenses/README.md | 36 +++++++++++++ licenses/enterprise-header.txt | 10 ++++ src/common/meta/src/rpc/ddl/trigger.rs | 11 ++++ src/mito2/src/extension.rs | 11 ++++ src/operator/src/expr_helper/trigger.rs | 11 ++++ src/sql/src/parsers/alter_parser/trigger.rs | 11 ++++ src/sql/src/parsers/create_parser/trigger.rs | 11 ++++ src/sql/src/parsers/show_parser/trigger.rs | 11 ++++ src/sql/src/statements/alter/trigger.rs | 11 ++++ src/sql/src/statements/create/trigger.rs | 11 ++++ src/sql/src/statements/drop/trigger.rs | 11 ++++ src/sql/src/statements/show/trigger.rs | 11 ++++ 17 files changed, 256 insertions(+), 2 deletions(-) create mode 100644 LICENSE-ENTERPRISE create mode 100644 licenserc-enterprise.toml create mode 100644 licenses/README.md create mode 100644 licenses/enterprise-header.txt diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml index a030b5f8cb..a79dad1ab7 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -46,6 +46,10 @@ jobs: with: persist-credentials: false - uses: korandoru/hawkeye@v5 + - name: Check enterprise license header + uses: korandoru/hawkeye@v5 + with: + config: licenserc-enterprise.toml check: if: ${{ github.repository == 'GreptimeTeam/greptimedb' }} diff --git a/LICENSE-ENTERPRISE b/LICENSE-ENTERPRISE new file mode 100644 index 0000000000..6e49abf138 --- /dev/null +++ b/LICENSE-ENTERPRISE @@ -0,0 +1,56 @@ +START NOTE +GreptimeDB is an open-core project. The core of GreptimeDB is permissively +licensed under the Apache License, Version 2.0. Certain peripheral features are +commercially licensed and governed by this Enterprise License. + +For the avoidance of doubt, this license does NOT apply to the core of +GreptimeDB as defined by its license in the repository root file "/LICENSE" +(as opposed to this file "/LICENSE-ENTERPRISE"). The core can be used and run +without infringing the license and licensed materials described below. + +Source files governed by this Enterprise License carry an explicit Enterprise +License header and are gated behind the `enterprise` Cargo feature; they are not +compiled into the default open-source build. +END NOTE + +START OF LICENSE +GreptimeDB Enterprise License (the "Enterprise License" or "EE License") + +Copyright (c) 2023-2026 GrepTime Inc. + +With regard to the GreptimeDB Enterprise Software: + +This software and associated documentation files (the "Software") may only be +used if you (and any entity that you represent) have entered into, and are in +compliance with, a separate written commercial agreement with GrepTime Inc. +governing the use of the Software (the "Enterprise Agreement"), and otherwise +have a valid GreptimeDB Enterprise License. The terms of each Enterprise +Agreement are negotiated and executed individually; to obtain one, contact +GrepTime Inc. at https://greptime.com/contactus. + +Subject to the foregoing sentence, you are free to modify this Software and +publish patches to the Software. You agree that GrepTime and/or its licensors +(as applicable) retain all right, title and interest in and to all such +modifications and/or patches, and all such modifications and/or patches may only +be used, copied, modified, displayed, distributed, or otherwise exploited with a +valid GreptimeDB Enterprise License. Notwithstanding the foregoing, you may copy +and modify the Software for development and testing purposes, without requiring a +subscription. You agree that GrepTime Inc. and/or its licensors (as applicable) +retain all right, title and interest in and to all such modifications. You are +not granted any other rights beyond what is expressly stated herein. Subject to +the foregoing, it is forbidden to copy, merge, publish, distribute, sublicense, +and/or sell the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +For all third party components incorporated into the GreptimeDB Software, those +components are licensed under the original license provided by the owner of the +applicable component. + +END OF LICENSE diff --git a/README.md b/README.md index 127dd1ba85..3ba52bc526 100644 --- a/README.md +++ b/README.md @@ -227,7 +227,13 @@ We invite you to engage and contribute! ## License -GreptimeDB is licensed under the [Apache License 2.0](https://apache.org/licenses/LICENSE-2.0.txt). +GreptimeDB is an open-core project. Its core is licensed under the +[Apache License 2.0](https://apache.org/licenses/LICENSE-2.0.txt). + +A small set of peripheral, enterprise-only features are gated behind the +`enterprise` Cargo feature (not built by default) and are governed by the +separate [GreptimeDB Enterprise License](LICENSE-ENTERPRISE). Source files under +that license carry an explicit Enterprise License header. ## Commercial Support diff --git a/licenserc-enterprise.toml b/licenserc-enterprise.toml new file mode 100644 index 0000000000..3ab432e1f5 --- /dev/null +++ b/licenserc-enterprise.toml @@ -0,0 +1,30 @@ +# License-header config for GreptimeDB Enterprise Edition source files. +# +# These files are commercially licensed under the GreptimeDB Enterprise License +# (see /LICENSE-ENTERPRISE), NOT Apache-2.0. They are kept out of the main +# Apache-2.0 header check in `licenserc.toml` (listed under its `excludes`) and +# are instead enforced here. Run with: +# +# hawkeye check --config licenserc-enterprise.toml +# hawkeye format --config licenserc-enterprise.toml # to apply/fix headers + +headerPath = "licenses/enterprise-header.txt" + +# Only the enterprise-gated sources. Keep this list in sync with the +# "# enterprise" block in `licenserc.toml`'s `excludes`. +includes = [ + "src/common/meta/src/rpc/ddl/trigger.rs", + "src/operator/src/expr_helper/trigger.rs", + "src/sql/src/statements/alter/trigger.rs", + "src/sql/src/statements/create/trigger.rs", + "src/sql/src/statements/show/trigger.rs", + "src/sql/src/statements/drop/trigger.rs", + "src/sql/src/parsers/alter_parser/trigger.rs", + "src/sql/src/parsers/create_parser/trigger.rs", + "src/sql/src/parsers/show_parser/trigger.rs", + "src/mito2/src/extension.rs", +] + +[properties] +inceptionYear = 2023 +copyrightOwner = "GrepTime Inc." diff --git a/licenserc.toml b/licenserc.toml index 7bebc5fd23..d74293847f 100644 --- a/licenserc.toml +++ b/licenserc.toml @@ -26,7 +26,9 @@ excludes = [ "src/common/base/src/secrets.rs", "src/servers/src/repeated_field.rs", "src/servers/src/http/test_helpers.rs", - # enterprise + # enterprise: Apache-2.0 header is NOT applied to these. They are governed by + # the GreptimeDB Enterprise License and checked via `licenserc-enterprise.toml`. + # Keep this list in sync with that file's `includes`. "src/common/meta/src/rpc/ddl/trigger.rs", "src/operator/src/expr_helper/trigger.rs", "src/sql/src/statements/alter/trigger.rs", diff --git a/licenses/README.md b/licenses/README.md new file mode 100644 index 0000000000..3fadc6d14c --- /dev/null +++ b/licenses/README.md @@ -0,0 +1,36 @@ +# Licensing + +GreptimeDB is an open-core project with a dual-license layout. + +| Scope | License | Where it's declared | +| --- | --- | --- | +| Core (default build) | Apache-2.0 | [`/LICENSE`](../LICENSE); per-file Apache header enforced by [`/licenserc.toml`](../licenserc.toml) | +| Enterprise features | GreptimeDB Enterprise License | [`/LICENSE-ENTERPRISE`](../LICENSE-ENTERPRISE); per-file Enterprise header enforced by [`/licenserc-enterprise.toml`](../licenserc-enterprise.toml) | + +Enterprise sources are gated behind the `enterprise` Cargo feature and are **not** +compiled into the default open-source build. Each one carries an explicit +Enterprise License header generated from [`enterprise-header.txt`](enterprise-header.txt). + +## How it's enforced + +CI (`license-header-check` in `.github/workflows/develop.yml`) runs +[hawkeye](https://github.com/korandoru/hawkeye) twice: + +1. Default config — applies the Apache-2.0 header to all sources, **excluding** + the enterprise files. +2. `licenserc-enterprise.toml` — applies the Enterprise header to **only** the + enterprise files. + +The two file lists are complementary and must stay in sync: + +- `licenserc.toml` `excludes` — the `# enterprise` block. +- `licenserc-enterprise.toml` `includes`. + +## Adding a new enterprise file + +1. Add its path to **both** lists above. +2. Apply the header: `hawkeye format --config licenserc-enterprise.toml`. +3. Verify: `hawkeye check --config licenserc-enterprise.toml`. + +Do not put an Apache-2.0 header on an enterprise file, and do not leave an +enterprise file without a header — CI fails in both cases. diff --git a/licenses/enterprise-header.txt b/licenses/enterprise-header.txt new file mode 100644 index 0000000000..b4497871c4 --- /dev/null +++ b/licenses/enterprise-header.txt @@ -0,0 +1,10 @@ +Copyright 2023-2026 GrepTime Inc. + +This file is part of the GreptimeDB Enterprise Edition and is licensed under +the GreptimeDB Enterprise License. You may not use this file except in +compliance with that license. A copy of the license is available at the root +of this repository in the file LICENSE-ENTERPRISE. + +Unless required by applicable law or agreed to in writing, this software is +distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +either express or implied. diff --git a/src/common/meta/src/rpc/ddl/trigger.rs b/src/common/meta/src/rpc/ddl/trigger.rs index bcce5ea371..1f1307a362 100644 --- a/src/common/meta/src/rpc/ddl/trigger.rs +++ b/src/common/meta/src/rpc/ddl/trigger.rs @@ -1,3 +1,14 @@ +// Copyright 2023-2026 GrepTime Inc. +// +// This file is part of the GreptimeDB Enterprise Edition and is licensed under +// the GreptimeDB Enterprise License. You may not use this file except in +// compliance with that license. A copy of the license is available at the root +// of this repository in the file LICENSE-ENTERPRISE. +// +// Unless required by applicable law or agreed to in writing, this software is +// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +// either express or implied. + use std::collections::HashMap; use std::time::Duration; diff --git a/src/mito2/src/extension.rs b/src/mito2/src/extension.rs index b31d006c27..2a9b2d2880 100644 --- a/src/mito2/src/extension.rs +++ b/src/mito2/src/extension.rs @@ -1,3 +1,14 @@ +// Copyright 2023-2026 GrepTime Inc. +// +// This file is part of the GreptimeDB Enterprise Edition and is licensed under +// the GreptimeDB Enterprise License. You may not use this file except in +// compliance with that license. A copy of the license is available at the root +// of this repository in the file LICENSE-ENTERPRISE. +// +// Unless required by applicable law or agreed to in writing, this software is +// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +// either express or implied. + use std::fmt::Debug; use std::sync::Arc; diff --git a/src/operator/src/expr_helper/trigger.rs b/src/operator/src/expr_helper/trigger.rs index a5af9a1924..a1998fd3ec 100644 --- a/src/operator/src/expr_helper/trigger.rs +++ b/src/operator/src/expr_helper/trigger.rs @@ -1,3 +1,14 @@ +// Copyright 2023-2026 GrepTime Inc. +// +// This file is part of the GreptimeDB Enterprise Edition and is licensed under +// the GreptimeDB Enterprise License. You may not use this file except in +// compliance with that license. A copy of the license is available at the root +// of this repository in the file LICENSE-ENTERPRISE. +// +// Unless required by applicable law or agreed to in writing, this software is +// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +// either express or implied. + use api::v1::notify_channel::ChannelType as PbChannelType; use api::v1::{ CreateTriggerExpr as PbCreateTriggerExpr, NotifyChannel as PbNotifyChannel, diff --git a/src/sql/src/parsers/alter_parser/trigger.rs b/src/sql/src/parsers/alter_parser/trigger.rs index 4fd5af8473..b2d55d41dc 100644 --- a/src/sql/src/parsers/alter_parser/trigger.rs +++ b/src/sql/src/parsers/alter_parser/trigger.rs @@ -1,3 +1,14 @@ +// Copyright 2023-2026 GrepTime Inc. +// +// This file is part of the GreptimeDB Enterprise Edition and is licensed under +// the GreptimeDB Enterprise License. You may not use this file except in +// compliance with that license. A copy of the license is available at the root +// of this repository in the file LICENSE-ENTERPRISE. +// +// Unless required by applicable law or agreed to in writing, this software is +// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +// either express or implied. + use snafu::{ResultExt, ensure}; use sqlparser::ast::Ident; use sqlparser::parser::Parser; diff --git a/src/sql/src/parsers/create_parser/trigger.rs b/src/sql/src/parsers/create_parser/trigger.rs index 8699ceb834..8d47b426bf 100644 --- a/src/sql/src/parsers/create_parser/trigger.rs +++ b/src/sql/src/parsers/create_parser/trigger.rs @@ -1,3 +1,14 @@ +// Copyright 2023-2026 GrepTime Inc. +// +// This file is part of the GreptimeDB Enterprise Edition and is licensed under +// the GreptimeDB Enterprise License. You may not use this file except in +// compliance with that license. A copy of the license is available at the root +// of this repository in the file LICENSE-ENTERPRISE. +// +// Unless required by applicable law or agreed to in writing, this software is +// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +// either express or implied. + use std::time::Duration; use snafu::{OptionExt, ResultExt, ensure}; diff --git a/src/sql/src/parsers/show_parser/trigger.rs b/src/sql/src/parsers/show_parser/trigger.rs index 10054ba4a4..acfde7b80e 100644 --- a/src/sql/src/parsers/show_parser/trigger.rs +++ b/src/sql/src/parsers/show_parser/trigger.rs @@ -1,3 +1,14 @@ +// Copyright 2023-2026 GrepTime Inc. +// +// This file is part of the GreptimeDB Enterprise Edition and is licensed under +// the GreptimeDB Enterprise License. You may not use this file except in +// compliance with that license. A copy of the license is available at the root +// of this repository in the file LICENSE-ENTERPRISE. +// +// Unless required by applicable law or agreed to in writing, this software is +// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +// either express or implied. + use snafu::{ResultExt, ensure}; use crate::error::{self, Result}; diff --git a/src/sql/src/statements/alter/trigger.rs b/src/sql/src/statements/alter/trigger.rs index f84dfccf4d..1552f86700 100644 --- a/src/sql/src/statements/alter/trigger.rs +++ b/src/sql/src/statements/alter/trigger.rs @@ -1,3 +1,14 @@ +// Copyright 2023-2026 GrepTime Inc. +// +// This file is part of the GreptimeDB Enterprise Edition and is licensed under +// the GreptimeDB Enterprise License. You may not use this file except in +// compliance with that license. A copy of the license is available at the root +// of this repository in the file LICENSE-ENTERPRISE. +// +// Unless required by applicable law or agreed to in writing, this software is +// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +// either express or implied. + use std::fmt::{Display, Formatter}; use serde::Serialize; diff --git a/src/sql/src/statements/create/trigger.rs b/src/sql/src/statements/create/trigger.rs index 146913c0cf..8579c5332e 100644 --- a/src/sql/src/statements/create/trigger.rs +++ b/src/sql/src/statements/create/trigger.rs @@ -1,3 +1,14 @@ +// Copyright 2023-2026 GrepTime Inc. +// +// This file is part of the GreptimeDB Enterprise Edition and is licensed under +// the GreptimeDB Enterprise License. You may not use this file except in +// compliance with that license. A copy of the license is available at the root +// of this repository in the file LICENSE-ENTERPRISE. +// +// Unless required by applicable law or agreed to in writing, this software is +// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +// either express or implied. + use std::fmt::{Display, Formatter}; use std::ops::ControlFlow; use std::time::Duration; diff --git a/src/sql/src/statements/drop/trigger.rs b/src/sql/src/statements/drop/trigger.rs index 358d77c5c3..b4bec4e140 100644 --- a/src/sql/src/statements/drop/trigger.rs +++ b/src/sql/src/statements/drop/trigger.rs @@ -1,3 +1,14 @@ +// Copyright 2023-2026 GrepTime Inc. +// +// This file is part of the GreptimeDB Enterprise Edition and is licensed under +// the GreptimeDB Enterprise License. You may not use this file except in +// compliance with that license. A copy of the license is available at the root +// of this repository in the file LICENSE-ENTERPRISE. +// +// Unless required by applicable law or agreed to in writing, this software is +// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +// either express or implied. + use std::fmt::Display; use serde::Serialize; diff --git a/src/sql/src/statements/show/trigger.rs b/src/sql/src/statements/show/trigger.rs index 507045fcd4..7da7090b4c 100644 --- a/src/sql/src/statements/show/trigger.rs +++ b/src/sql/src/statements/show/trigger.rs @@ -1,3 +1,14 @@ +// Copyright 2023-2026 GrepTime Inc. +// +// This file is part of the GreptimeDB Enterprise Edition and is licensed under +// the GreptimeDB Enterprise License. You may not use this file except in +// compliance with that license. A copy of the license is available at the root +// of this repository in the file LICENSE-ENTERPRISE. +// +// Unless required by applicable law or agreed to in writing, this software is +// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +// either express or implied. + use std::fmt::{self, Display}; use serde::Serialize;