Skip to content

Commit a8ed9e9

Browse files
committed
New folders, enterprise edition works fine
1 parent 8d06ec2 commit a8ed9e9

File tree

300 files changed

+25601
-35
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

300 files changed

+25601
-35
lines changed

.github/workflows/clippy.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,10 @@ jobs:
1414
- uses: actions-rs/clippy-check@v1
1515
with:
1616
token: ${{ secrets.GITHUB_TOKEN }}
17-
name: Clippy default
17+
name: Clippy - community
18+
args: --features=community
19+
- uses: actions-rs/clippy-check@v1
20+
with:
21+
token: ${{ secrets.GITHUB_TOKEN }}
22+
name: Clippy - enterprise
23+
args: --features=enterprise

.github/workflows/rust.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,15 @@ jobs:
2424
toolchain: nightly
2525
components: rustfmt, clippy
2626
- uses: actions/checkout@v3
27-
- name: Build
28-
run: cargo build --verbose
29-
- name: Run tests
30-
run: cargo test --verbose
31-
- name: Run tests (with address sanitizer)
32-
run: LSAN_OPTIONS=suppressions=san.supp RUSTFLAGS="-Zsanitizer=address" cargo +nightly test --verbose
27+
- name: Build - community
28+
run: cargo build --features=community --verbose
29+
- name: Build - enterprise
30+
run: cargo build --features=enterprise --verbose
31+
- name: Run tests - community
32+
run: cargo test --features=community --verbose
33+
- name: Run tests - enterprise
34+
run: cargo test --features=enterprise --verbose
35+
- name: Run tests (with address sanitizer) - community
36+
run: LSAN_OPTIONS=suppressions=san.supp RUSTFLAGS="-Zsanitizer=address" cargo +nightly test --features=community --verbose
37+
- name: Run tests (with address sanitizer) - enterprise
38+
run: LSAN_OPTIONS=suppressions=san.supp RUSTFLAGS="-Zsanitizer=address" cargo +nightly test --features=enterprise --verbose

Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,7 @@ incremental = false
3232
# See: https://github.com/johnthagen/min-sized-rust
3333

3434
[features]
35-
flaky-test = []
35+
community = []
36+
enterprise = []
37+
3638
unsafe-threads-test = []

Dockerfile

Lines changed: 37 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,53 @@
1-
FROM --platform=amd64 rust AS build
1+
FROM --platform=amd64 rust AS build_community
22
RUN apt-get update
33
RUN apt-get -y install clang
44
RUN mkdir /build
55
WORKDIR /build
66
ENV LIBCLANG_PATH=/usr/lib/llvm-11/lib/
77
ADD Cargo.toml Cargo.toml
88
ADD build.rs build.rs
9-
ADD libcblite libcblite
9+
ADD libcblite_community libcblite_community
1010
ADD src src
1111
RUN cargo c
12-
RUN cargo test -- --test-threads=1
12+
RUN cargo test --features=community -- --test-threads=1
1313

14-
FROM --platform=amd64 rust AS strip-stage
14+
FROM --platform=amd64 rust AS build_enterprise
15+
RUN apt-get update
16+
RUN apt-get -y install clang
17+
RUN mkdir /build
18+
WORKDIR /build
19+
ENV LIBCLANG_PATH=/usr/lib/llvm-11/lib/
20+
ADD Cargo.toml Cargo.toml
21+
ADD build.rs build.rs
22+
ADD libcblite_enterprise libcblite_enterprise
23+
ADD src src
24+
RUN cargo c
25+
RUN cargo test --features=enterprise -- --test-threads=1
26+
27+
FROM --platform=amd64 rust AS strip-stage_community
28+
RUN apt-get update
29+
RUN apt-get -y install binutils binutils-aarch64-linux-gnu
30+
RUN mkdir /build
31+
WORKDIR /build
32+
ADD libcblite_community libcblite_community
33+
RUN strip /build/libcblite_community/lib/x86_64-linux-android/libcblite.so -o /build/libcblite_community/lib/x86_64-linux-android/libcblite.stripped.so
34+
RUN strip /build/libcblite_community/lib/i686-linux-android/libcblite.so -o /build/libcblite_community/lib/i686-linux-android/libcblite.stripped.so
35+
RUN /usr/aarch64-linux-gnu/bin/strip /build/libcblite_community/lib/aarch64-linux-android/libcblite.so -o /build/libcblite_community/lib/aarch64-linux-android/libcblite.stripped.so
36+
RUN /usr/aarch64-linux-gnu/bin/strip /build/libcblite_community/lib/arm-linux-androideabi/libcblite.so -o /build/libcblite_community/lib/arm-linux-androideabi/libcblite.stripped.so
37+
RUN strip /build/libcblite_community/lib/x86_64-pc-windows-gnu/cblite.dll -o /build/libcblite_community/lib/x86_64-pc-windows-gnu/cblite.stripped.dll
38+
39+
FROM --platform=amd64 rust AS strip-stage_enterprise
1540
RUN apt-get update
1641
RUN apt-get -y install binutils binutils-aarch64-linux-gnu
1742
RUN mkdir /build
1843
WORKDIR /build
19-
ADD libcblite libcblite
20-
RUN strip /build/libcblite/lib/x86_64-linux-android/libcblite.so -o /build/libcblite/lib/x86_64-linux-android/libcblite.stripped.so
21-
RUN strip /build/libcblite/lib/i686-linux-android/libcblite.so -o /build/libcblite/lib/i686-linux-android/libcblite.stripped.so
22-
RUN /usr/aarch64-linux-gnu/bin/strip /build/libcblite/lib/aarch64-linux-android/libcblite.so -o /build/libcblite/lib/aarch64-linux-android/libcblite.stripped.so
23-
RUN /usr/aarch64-linux-gnu/bin/strip /build/libcblite/lib/arm-linux-androideabi/libcblite.so -o /build/libcblite/lib/arm-linux-androideabi/libcblite.stripped.so
24-
RUN strip /build/libcblite/lib/x86_64-pc-windows-gnu/cblite.dll -o /build/libcblite/lib/x86_64-pc-windows-gnu/cblite.stripped.dll
44+
ADD libcblite_enterprise libcblite_enterprise
45+
RUN strip /build/libcblite_enterprise/lib/x86_64-linux-android/libcblite.so -o /build/libcblite_enterprise/lib/x86_64-linux-android/libcblite.stripped.so
46+
RUN strip /build/libcblite_enterprise/lib/i686-linux-android/libcblite.so -o /build/libcblite_enterprise/lib/i686-linux-android/libcblite.stripped.so
47+
RUN /usr/aarch64-linux-gnu/bin/strip /build/libcblite_enterprise/lib/aarch64-linux-android/libcblite.so -o /build/libcblite_enterprise/lib/aarch64-linux-android/libcblite.stripped.so
48+
RUN /usr/aarch64-linux-gnu/bin/strip /build/libcblite_enterprise/lib/arm-linux-androideabi/libcblite.so -o /build/libcblite_enterprise/lib/arm-linux-androideabi/libcblite.stripped.so
49+
RUN strip /build/libcblite_enterprise/lib/x86_64-pc-windows-gnu/cblite.dll -o /build/libcblite_enterprise/lib/x86_64-pc-windows-gnu/cblite.stripped.dll
2550

2651
FROM scratch AS strip
27-
COPY --from=strip-stage /build/libcblite/ .
28-
COPY --from=strip-stage /build/libcblite/ .
52+
COPY --from=strip-stage_community /build/libcblite_community/ .
53+
COPY --from=strip-stage_enterprise /build/libcblite_enterprise/ .

README.md

Lines changed: 7 additions & 7 deletions

build.rs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@
2222
// - https://rust-lang.github.io/rust-bindgen/tutorial-3.html
2323
// - https://doc.rust-lang.org/cargo/reference/build-scripts.html
2424

25+
#[cfg(all(not(feature = "community"), not(feature = "enterprise")))]
26+
compile_error!("You need to have one the following features activated: community, enterprise");
27+
#[cfg(all(feature = "community", feature = "enterprise"))]
28+
compile_error!("You need to have one the following features activated: community, enterprise");
29+
2530
extern crate bindgen;
2631
extern crate fs_extra;
2732

@@ -32,8 +37,15 @@ use std::path::PathBuf;
3237
use std::process::Command;
3338
use fs_extra::dir;
3439

35-
static CBL_INCLUDE_DIR: &str = "libcblite/include";
36-
static CBL_LIB_DIR: &str = "libcblite/lib";
40+
#[cfg(feature = "community")]
41+
static CBL_INCLUDE_DIR: &str = "libcblite_community/include";
42+
#[cfg(feature = "enterprise")]
43+
static CBL_INCLUDE_DIR: &str = "libcblite_enterprise/include";
44+
45+
#[cfg(feature = "community")]
46+
static CBL_LIB_DIR: &str = "libcblite_community/lib";
47+
#[cfg(feature = "enterprise")]
48+
static CBL_LIB_DIR: &str = "libcblite_enterprise/lib";
3749

3850
fn main() -> Result<(), Box<dyn Error>> {
3951
generate_bindings()?;
Binary file not shown.
Binary file not shown.
Binary file not shown.

libcblite_community/LICENSE.txt

Lines changed: 199 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,199 @@
1+
Community Edition License Agreement
2+
3+
This Couchbase Community Edition License Agreement between you and
4+
Couchbase, Inc. governs your use of the community edition of Couchbase's
5+
software accompanying this agreement, including but not limited to
6+
Couchbase Server Community Edition, Couchbase Sync Gateway Community
7+
Edition and Couchbase Lite Community Edition, and any Couchbase services
8+
or updates for such software, in addition to all versions of Couchbase's
9+
community software described in Section 1 below (together, the "Community
10+
Software"). The software license provided through this agreement excludes
11+
the cross datacenter replication ("XDCR") feature and any other excluded
12+
features as described in Couchbase documentation.
13+
14+
BY INSTALLING OR OTHERWISE USING THE COMMUNITY SOFTWARE, YOU AGREE TO
15+
THE TERMS OF THIS AGREEMENT. IF YOU DO NOT AGREE TO ANY TERMS OF THIS
16+
AGREEMENT, YOU MUST IMMEDIATELY CEASE USING THE COMMUNITY SOFTWARE AND
17+
UNINSTALL AND DELETE ALL COPIES OF THE COMMUNITY SOFTWARE.
18+
19+
If you are installing or using the Community Software on behalf of an
20+
organization or are otherwise entering into this agreement on behalf of an
21+
organization, you represent and warrant that you are authorized to enter
22+
into this agreement on behalf of your organization. In consideration
23+
of the rights granted to you in this agreement, you must comply with
24+
all the terms in this agreement.
25+
26+
1. Application of Agreement.
27+
If you have installed or used any prior version of the community edition
28+
of our software under any other license terms, by installing or using
29+
the version of the Community Software that accompanies this agreement,
30+
you agree that this agreement replaces those other license terms in
31+
their entirety and will also govern your use of all prior versions of
32+
the Community Software.
33+
34+
2. Term and Termination.
35+
This agreement will continue to apply until (a) you terminate this
36+
agreement at any time by uninstalling and deleting all copies of the
37+
Community Software in your possession or control; or (b) we terminate
38+
this agreement. We may terminate this agreement at any time for any
39+
reason (including but not limited to your breach of this agreement)
40+
in our sole discretion by providing you with notice. If we notify
41+
you of our termination, you must uninstall and delete all copies of
42+
the Community Software in your possession or control. Upon request,
43+
you shall provide written certification that you have uninstalled,
44+
deleted and ceased all usage of the Community Software within five (5)
45+
business days of our request. If you represent an organization, then
46+
such certification must be signed by an authorized representative of
47+
your organization on behalf of your organization.
48+
49+
3. Modification of Agreement.
50+
We may modify this agreement or replace this agreement with new terms
51+
from time to time with any update or new version of the Community Software
52+
or with notice to you.
53+
54+
4. License Grant.
55+
The Community Software is licensed, not sold, to you. During the term
56+
of this agreement and subject to your compliance with this agreement,
57+
we grant you a non-exclusive, non-transferable, non-assignable,
58+
non-sublicensable, revocable and personal license to install and use the
59+
Community Software at no charge for your internal business purposes and
60+
to develop or commercialize products that interact with the Community
61+
Software, subject to the restrictions in Section 5 and provided that
62+
you ensure that users of your products also comply with the applicable
63+
restrictions in Section 5.
64+
65+
5. License Restrictions.
66+
This agreement does not grant any rights to our source code or to any
67+
commercial or enterprise (i.e. non-community) edition of our software or
68+
services, which are subject to separate terms. In addition to the other
69+
restrictions and limitations in this agreement, you must not, and you must
70+
not assist or authorize others to: (a) work around or bypass any technical
71+
limitations, protections, or security measures used for or contained in
72+
the Community Software; (b) decompile, reverse engineer, disassemble,
73+
attempt to derive the source code of, modify, or create derivative works
74+
of the Community Software (except the extent prohibited by applicable
75+
law or to the extent permitted by the licensing terms governing use of
76+
any open source components included with the Community Software); (c)
77+
use the Community Software in any manner that violates applicable law,
78+
including but not limited to transferring the Community Software to any
79+
country or recipient in violation of any sanctions or export control
80+
laws or regulations, or that infringes, misappropriates or otherwise
81+
violates any right of any third party; (d) commercialize (other than as
82+
permitted by Section 4 above) or otherwise distribute, offer, provide,
83+
share, sell, transfer, license or sublicense the Community Software; (e)
84+
make any representations or warranties regarding the Community Software;
85+
(f) use or deploy Couchbase Server Community in clusters comprised of
86+
more than five (5) node instances of Couchbase Server Community running
87+
on a server, including a physical server, server blade, virtual machine,
88+
software container, or cloud server; or (g) use or deploy the Community
89+
Software to support an application or workload also supported by any
90+
commercial or enterprise Couchbase offering (including without limitation
91+
Couchbase Enterprise Edition software or Couchbase Capella). Furthermore,
92+
this agreement does not grant you any rights to the XDCR functionality
93+
provided by Couchbase.
94+
95+
6. Verification of Use.
96+
We may verify that you are using the Community Software in compliance
97+
with this agreement, including without limitation through technological
98+
features in the Community Software that may transmit to us data relating
99+
to your use of the Community Software. Upon our request, you will
100+
provide us promptly and in any event within five (5) business days with
101+
system-generated information verifying that your use of the Community
102+
Software complies with this agreement. If you are found to be using the
103+
Community Software in breach of this agreement, then without limiting
104+
any other rights or remedies we may have, you must immediately pay us
105+
a license fee for such usage of the Community Software that is equal
106+
to the amount you would have paid if you had licensed the commercial
107+
or enterprise version Couchbase's software. If you do not comply with
108+
this agreement and we do not take immediate action, we reserve and do
109+
not waive the right to take action in the future.
110+
111+
7. Privacy and Data Security.
112+
Our use of any personal data collected by us under this
113+
agreement is governed by our privacy policy, currently located at:
114+
https://www.couchbase.com/privacy-policy/. Your use of the Community
115+
Software operates as a consent to the practices described in our privacy
116+
policy.
117+
118+
8. No Support Services.
119+
Because this is the free community edition of our software, all Community
120+
Software is provided "as is" without any services or support. We are
121+
under no obligation to provide or continue to provide the Community
122+
Software (including any update, upgrade or new version) to you.
123+
124+
9. Disclaimer of Warranties.
125+
TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW: (A) USE OF ANY
126+
COMMUNITY SOFTWARE IS AT YOUR SOLE RISK, INCLUDING THE ENTIRE RISK
127+
AS TO SATISFACTORY QUALITY, PERFORMANCE, ACCURACY AND EFFORT; (B) THE
128+
COMMUNITY SOFTWARE IS LICENSED TO YOU ON AN "AS IS" AND "AS AVAILABLE"
129+
BASIS, WITH ALL FAULTS AND WITHOUT WARRANTY OF ANY KIND, AND WE DISCLAIM
130+
ALL WARRANTIES, EITHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT
131+
LIMITED TO IMPLIED WARRANTIES OF MERCHANTABILITY, SATISFACTORY QUALITY,
132+
FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, QUIET ENJOYMENT, AVAILABILITY
133+
AND NON-INFRINGEMENT; AND (C) WITHOUT LIMITING THE FOREGOING, WE DO NOT
134+
WARRANT THAT THE COMMUNITY SOFTWARE WILL MEET YOUR REQUIREMENTS, THAT ITS
135+
OPERATION WILL BE UNINTERRUPTED OR ERROR-FREE, OR THAT DEFECTS WILL BE
136+
CORRECTED. NO INFORMATION OR ADVICE GIVEN BY US WILL CREATE ANY WARRANTY.
137+
138+
10. LIMITATION OF LIABILITY.
139+
TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW: (A) IN NO EVENT WILL WE
140+
BE LIABLE FOR ANY INCIDENTAL, SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES
141+
WHATSOEVER, OR DAMAGES FOR LOSS OF PROFITS, LOSS OR CORRUPTION OF DATA,
142+
LOSS OF GOODWILL, BUSINESS INTERRUPTION OR ANY OTHER DAMAGES OR LOSSES,
143+
ARISING OUT OF OR RELATED TO YOUR USE OF OR INABILITY TO USE THE COMMUNITY
144+
SOFTWARE; AND (B) IN NO EVENT WILL OUR TOTAL LIABILITY TO YOU FOR ALL
145+
LOSS, CLAIMS AND DAMAGES EXCEED THE AMOUNT OF FIFTY DOLLARS (USD 50.00).
146+
ALL LIMITATIONS AND EXCLUSIONS OF LIABILITY IN THIS AGREEMENT WILL APPLY
147+
EVEN IF THE ABOVE STATED REMEDIES FAIL OF THEIR ESSENTIAL PURPOSE AND
148+
REGARDLESS OF THE FORM OR SOURCE OF CLAIM OR LOSS, WHETHER THE CLAIM OR
149+
LOSS WAS FORESEEABLE, AND WHETHER WE HAVE BEEN ADVISED OF THE POSSIBILITY
150+
OF THE CLAIM OR LOSS.
151+
152+
11. Non-Assignment.
153+
You may not assign or otherwise transfer your rights and obligations under
154+
this agreement, in whole or in part, without our written consent, and
155+
any such attempt will be void. We may transfer our rights or obligations
156+
under this agreement to a third party at our sole discretion.
157+
158+
12. Dispute Resolution.
159+
If you have any concern or dispute, you must first try to resolve the
160+
dispute informally by contacting us. If your dispute is not resolved
161+
within thirty (30) days of submission, any resulting legal actions
162+
must be resolved through final and binding arbitration. If you reside
163+
in the Americas, JAMS will administer the arbitration in Santa Clara
164+
County, California pursuant to its Comprehensive Arbitration Rules
165+
and Procedures. If you reside in Australia, New Zealand, Japan, the
166+
People's Republic of China, Hong Kong S.A.R., Macau S.A.R., Taiwan,
167+
South Korea, India, Sri Lanka, Bangladesh, Nepal, or a member state
168+
of the Association of Southeast Asian Nations, then the Singapore
169+
International Arbitration Centre will administer the arbitration in
170+
Singapore under its Rules of Arbitration, which rules are deemed to be
171+
incorporated by reference in this section. Otherwise, the London Court
172+
of International Arbitration (LCIA) will administer the arbitration in
173+
London under the LCIA Arbitration Rules. You agree to appear in the
174+
identified and applicable forum stated in this paragraph, and to be
175+
bound by the results of the arbitration. There will be one arbitrator
176+
that you and we mutually select. The arbitration will be conducted in
177+
the English language. Judgment upon the award rendered may be entered
178+
and will be enforceable in any court of competent jurisdiction having
179+
jurisdiction over you and us.
180+
181+
13. No Class Actions; Injunctive Relief; Governing Law; Severability.
182+
You may only resolve disputes with us on an individual basis, and you
183+
may not bring a claim as a plaintiff or a class member in a class,
184+
consolidated, or representative action. Notwithstanding anything else
185+
in this agreement, if you use the Community Software in violation of
186+
this agreement, we are entitled to apply for injunctive remedies (or
187+
an equivalent type of urgent legal relief) in any jurisdiction. This
188+
agreement will be governed by and construed in accordance with the
189+
substantive laws of the State of California. By using the Community
190+
Software you represent that you will comply with, and acknowledge that
191+
the software and any related technology or documentation is subject
192+
to, U.S. sanctions and export control laws and regulations. If any
193+
part of this agreement is held invalid, the remainder of the agreement
194+
will continue in full force and effect. If you have other rights not
195+
described in this agreement, including consumer rights, under the laws
196+
of your state or country, this agreement does not change those other
197+
rights if the laws of your state or country do not permit it to do so.
198+
199+
Community Edition License Agreement (May 2024)
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
//
2+
// CBL_Edition.h
3+
//
4+
// Copyright (c) 2018 Couchbase, Inc All rights reserved.
5+
//
6+
// Licensed under the Apache License, Version 2.0 (the "License");
7+
// you may not use this file except in compliance with the License.
8+
// You may obtain a copy of the License at
9+
//
10+
// http://www.apache.org/licenses/LICENSE-2.0
11+
//
12+
// Unless required by applicable law or agreed to in writing, software
13+
// distributed under the License is distributed on an "AS IS" BASIS,
14+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
// See the License for the specific language governing permissions and
16+
// limitations under the License.
17+
//
18+
19+
#ifndef COUCHBASE_ENTERPRISE
20+
/* #undef COUCHBASE_ENTERPRISE */
21+
#endif
22+
23+
#define CBLITE_VERSION "3.2.1"
24+
#define CBLITE_VERSION_NUMBER 3002001
25+
#define CBLITE_BUILD_NUMBER 9
26+
#define CBLITE_SOURCE_ID "e322f9b"
27+
#define CBLITE_BUILD_TIMESTAMP "2024-10-30T14:23:40Z"
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)