strawberry/OFFLINE_INSTALL.md
trvon dc50f06f8d
Some checks failed
Build and Test / build (debug, clang) (push) Has been cancelled
Build and Test / build (debug, gcc) (push) Has been cancelled
Build and Test / build (release, clang) (push) Has been cancelled
Build and Test / build (release, gcc) (push) Has been cancelled
Build and Test / docker (push) Has been cancelled
Drop unqlite-cpp and import legacy databases
Nothing shipped used the library after the event store landed. A small
reader/writer for its file format (src/store/legacy_kv) replaces it for
the legacy code, and the submodule, subproject and library test are
removed.

A writer open now imports a legacy database.db file into the event
store: indicators are replayed in an order consistent with the old
hash/rule indexes, the result is verified against the old file, the
old file is kept as database.db.migrated-<ts>, and an import
interrupted between its final renames is finished on the next open.
Read-only handles read a legacy file directly and switch to the store
once it is imported. Ids re-stored under another hash are reported
(their old index entries cannot be carried over).

Tests: legacy import properties I1-I6 (locked and corrupt files are
left untouched), the differential test now shares its comparisons, and
fuzz_legacy_kv covers the file parser. A copy of a real 137 KB legacy
database imported cleanly into 7 KB.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 18:46:21 -06:00

172 lines
3.8 KiB
Markdown

# Offline / air-gapped install
Strawberry now supports a hybrid offline dependency strategy:
1. **Conan 2 consumer recipe**
- `conanfile.py` resolves OpenSSL, nlohmann_json, zstd and optional extras like libbpf.
2. **Local/private recipes when needed**
- Strawberry now seeds a local `yara/4.5.5` recipe under `conan/local_recipes_index/`.
3. **Conan cache export/import**
- package binaries can be moved between connected and air-gapped machines.
The root `conanfile.py` also forces the generated Meson native file to use a
C++23 dialect for Strawberry itself, so a default `conan profile detect`
result does not accidentally downshift the build below C++23.
## What the root Conan recipe manages
Always:
- `openssl/3.6.2`
Optional:
- `libbpf/1.3.0` with `-o '&:with_libbpf=True'`
- YARA via a user-supplied reference with:
- `-o '&:with_yara=True'`
- `-c user.strawberry:yara_reference=<your-yara-ref>`
The repo already includes a local YARA recipe reference you can use:
- `yara/4.5.5`
That local recipe currently:
- targets Linux/macOS Autotools-style builds
- uses Conan tool requirements for `autoconf`, `automake`, `libtool`, and `pkgconf`
- disables extra YARA modules like cuckoo, dex, magic, and macho by default
- keeps `with_crypto=True` by default so Strawberry's libyara path matches the OpenSSL-backed build
Optional packaged tools:
- `meson/1.10.1`
- `ninja/1.13.2`
- `pkgconf/2.5.1`
Enable those with:
```bash
-o '&:with_packaged_tools=True'
```
## Online preparation machine
### 1. Detect profile
```bash
conan profile detect --force
```
### 2. Install and populate cache
Minimal offline dependency set:
```bash
conan install . -of build/conan --build=missing
```
Include libbpf:
```bash
conan install . \
-of build/conan \
--build=missing \
-o '&:with_libbpf=True'
```
Include packaged Meson/Ninja/pkgconf tools too:
```bash
conan install . \
-of build/conan \
--build=missing \
-o '&:with_packaged_tools=True'
```
If you have a local/private YARA recipe:
```bash
conan remote add strawberry-local-recipes ./conan/local_recipes_index --allowed-packages="yara/*"
conan install . \
-of build/conan \
--build=missing \
-o '&:with_yara=True' \
-c user.strawberry:yara_reference=yara/4.5.5
```
If you are using the seeded YARA recipe, save its build tools too:
```bash
conan cache save \
"openssl/*:*" \
"yara/*:*" \
"autoconf/*:*" \
"automake/*:*" \
"libtool/*:*" \
"pkgconf/*:*" \
--file strawberry-conan-cache.tgz
```
### 3. Save cache contents for transfer
Example saving the current Strawberry-related cache contents:
```bash
conan cache save "openssl/*:*" --file strawberry-conan-cache.tgz
```
If you also used libbpf, packaged tools, or a YARA recipe, save those too. For example:
```bash
conan cache save \
"openssl/*:*" \
"libbpf/*:*" \
"meson/*:*" \
"ninja/*:*" \
"pkgconf/*:*" \
--file strawberry-conan-cache.tgz
```
## Air-gapped machine
### 1. Detect profile
```bash
conan profile detect --force
```
### 2. Restore cache
```bash
conan cache restore strawberry-conan-cache.tgz
```
### 3. Install without contacting remotes
```bash
conan install . -of build/conan -nr
```
Add the same options/conf you used when preparing the cache. Example:
```bash
conan install . \
-of build/conan \
-nr \
-o '&:with_libbpf=True' \
-o '&:with_packaged_tools=True'
```
### 4. Build Strawberry against Conan-generated files
```bash
. build/conan/generators/conanbuild.sh
meson setup builddir --native-file build/conan/generators/conan_meson_native.ini -Denable_tests=true
meson compile -C builddir
meson test -C builddir --verbose
```
## Notes
- The Conan cache save/restore flow is best used for air-gap transfer and CI handoff, not as a long-term package server substitute.
- `conan/local_recipes_index/` now includes a seeded `yara/4.5.5` recipe plus version mapping.