Skip to content

Commit

Permalink
feat(cli): add ability to parse pst files (#335)
Browse files Browse the repository at this point in the history
  • Loading branch information
joe-prosser authored Feb 10, 2025
1 parent 092785d commit 6f7d10e
Show file tree
Hide file tree
Showing 19 changed files with 1,836 additions and 23 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, macos-15]
os: [ubuntu-24.04, macos-15]
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
- uses: actions/checkout@v4
- uses: actions/cache@v4
if: ${{ matrix.os != 'macos-15' }}
with:
path: |
Expand Down Expand Up @@ -47,7 +47,7 @@ jobs:
env:
BUILD_PLATFORM: ${{ matrix.os }}
- name: Publish Crates
if: ${{ matrix.os == 'ubuntu-20.04' }}
if: ${{ matrix.os == 'ubuntu-24.04' }}
run: |
cargo login ${{ secrets.CRATES_IO_TOKEN }}
./scripts/publish
46 changes: 38 additions & 8 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,34 +12,64 @@ env:

jobs:
clippy:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
- uses: actions/checkout@v4

- uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-clippy
cli/libpff-20231205
key: ${{ runner.os }}-build-${{ hashFiles('**/Cargo.lock', 'scripts/build-install') }}

- name: Install build dependencies
run: sudo apt install git autoconf automake autopoint libtool pkg-config
# Needs to be separate job because clippy currently (incorrectly) shares cache with cargo
# (See https://github.com/rust-lang/rust-clippy/issues/4612)

- name: Run clippy
run: cargo clippy --all-targets --locked -- -D warnings

build:
runs-on: ubuntu-20.04
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-24.04, macos-15]
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
- uses: actions/checkout@v4

- name: Setup mac dependencies
if: matrix.os == 'macos-15'
run: |
# Create directory for Macport installs
sudo mkdir -p /opt/local
# Conigure permissions on that directory
sudo chmod -R 777 /opt/local
# Add the path to GITHUB_PATH
echo "/opt/local/bin:/opt/local/sbin" >> "$GITHUB_PATH"
- uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
cli/libpff-20231205
/opt/local
key: ${{ runner.os }}-build-${{ hashFiles('**/Cargo.lock', 'scripts/build-install') }}

- name: Install build deps
run: ./scripts/build-install
env:
BUILD_PLATFORM: ${{ matrix.os }}

- name: Build
run: ./scripts/build

- name: Run tests
run: ./scripts/check
env:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/target
**/*.rs.bk
/cli/libpff-*
54 changes: 47 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ members = [
"api",
"cli",
]
resolver = "2"


[profile.release]
Expand Down
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,20 @@ Ensure you have the cargo bin directory in your path (typically `~/.cargo/bin`).

#### Manual

Make sure you have the following build dependencies installed:

##### Debian/Ubuntu

```
sudo apt install autoconf automake autopoint libtool pkg-config
```

##### macOS

```
sudo port install autoconf automake gettext libtool pkgconfig
```

Build it the usual way using cargo

```
Expand Down
2 changes: 1 addition & 1 deletion api/src/resources/email.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ impl FromStr for Id {
}
}

#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq)]
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq, Default)]
pub struct EmailMetadata {
#[serde(skip_serializing_if = "Option::is_none")]
pub sensitivity: Option<String>,
Expand Down
5 changes: 5 additions & 0 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ authors = ["reinfer Ltd. <[email protected]>"]
license = "Apache-2.0"
edition = "2021"
autotests = false
build = "build.rs"

[[bin]]
name = "re"
Expand Down Expand Up @@ -45,6 +46,10 @@ mailparse = "0.14.0"
diff = "0.1.13"
rand = "0.8.5"
csv = "1.3.0"
libc = "0.2.169"
itertools = "0.14.0"
mime_guess = "2.0.5"
libz-sys = { version = "1.1.8", features = ["static"] }

[dev-dependencies]
pretty_assertions = "1.3.0"
Expand Down
Loading

0 comments on commit 6f7d10e

Please sign in to comment.