Skip to content

Commit 440f50d

Browse files
authored
Merge pull request #498 from kissgyorgy/pypi-release
Pypi release
2 parents a66f6ef + 69a3878 commit 440f50d

File tree

4 files changed

+77
-56
lines changed

4 files changed

+77
-56
lines changed

.github/actions/setup-dependencies/action.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ inputs:
22
python-version:
33
description: "Python version to setup"
44
required: false
5-
default: 3.8
5+
default: "3.8"
6+
67
runs:
78
using: "composite"
89
steps:

.github/workflows/release.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: PyPI Release
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
release:
9+
runs-on: ubuntu-20.04
10+
11+
steps:
12+
- name: Checkout source code
13+
uses: actions/checkout@v2
14+
15+
- name: Setup dependencies
16+
uses: ./.github/actions/setup-dependencies
17+
18+
- run: poetry publish --build
19+
env:
20+
POETRY_PYPI_TOKEN_PYPI: ${{secrets.POETRY_PYPI_TOKEN_PYPI}}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Main
1+
name: Run checks and tests
22

33
on:
44
push:

docs/installation.md

Lines changed: 54 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,37 @@ hide:
55

66
# Installation
77

8+
Unblob consists of two main parts:
9+
10+
- unblob, the Python package (with optional Rust modules).
11+
- extractor command line tools like `7zip`, `unar`, etc. (See [Extractors](./extractors.md) for explanation.)
12+
13+
All of these need to be installed to make unblob fully functional.
14+
Depending the packaging solution you choose, you might need to
15+
install external extractors manually.
16+
17+
## Python package
18+
19+
unblob can be installed (without the extractors) from PyPI (Python Package Index).
20+
This might be the easiest method, depending on whether you have Python 3 installed already.
21+
22+
1. First, install the Python package:
23+
24+
python3 -m pip install --user unblob
25+
26+
This will install the `unblob` script in `~/.local/bin`. You can put that
27+
directory in your `PATH` environment variable, or call it directly.
28+
29+
!!! Warning
30+
31+
System-wide installation (with `sudo`) is not recommended, because it can potentially break your system.
32+
33+
2. Make sure to [install extractors](#install-extractors).
34+
35+
3. Check that everything works correctly:
36+
37+
unblob --show-external-dependencies
38+
839
## Docker image
940

1041
unblob can be used right away from a `docker` image: `ghcr.io/onekey-sec/unblob:latest`,
@@ -35,34 +66,33 @@ docker run --rm --pull always ghcr.io/onekey-sec/unblob:latest --help
3566
unblob can be built and run using the [Nix](https://nixos.org) package manager.
3667
The Nix derivation installs all 3rd party dependencies.
3768

38-
1. [Install and configure Nix](https://nixos.org/download.html).
69+
1. [Install and configure Nix](https://nixos.org/download.html).
3970

40-
1. _Optional_: enable the experimental features so that you don't need to pass
41-
`--extra-experimental-features "nix-command flakes"` to `nix` command invocations:
71+
1. _Optional_: enable the experimental features so that you don't need to pass
72+
`--extra-experimental-features "nix-command flakes"` to `nix` command invocations:
4273

43-
cat > ~/.config/nix/nix.conf <<EOF
44-
experimental-features = nix-command flakes
45-
EOF
74+
cat > ~/.config/nix/nix.conf <<EOF
75+
experimental-features = nix-command flakes
76+
EOF
4677

47-
1. _Optional_: use pre-built binaries from GitHub using [cachix](https://app.cachix.org/cache/unblob):
78+
1. _Optional_: use pre-built binaries from GitHub using [cachix](https://app.cachix.org/cache/unblob):
4879

4980
nix-env -iA cachix -f https://cachix.org/api/v1/install
5081
cachix use unblob
5182

52-
1. Install unblob:
83+
1. Install unblob:
5384

5485
nix profile install github:onekey-sec/unblob
5586

5687
- Check that everything works correctly:
5788

5889
unblob --show-external-dependencies
5990

60-
6191
## From source
6292

63-
1. Install [Git](https://git-scm.com/download/) if you don't have it yet.
64-
2. Install the [Poetry](https://python-poetry.org/docs/#installation) Python package manager.
65-
3. **Clone** the unblob **repository from GitHub**:
93+
1. Install [Git](https://git-scm.com/download/) if you don't have it yet.
94+
2. Install the [Poetry](https://python-poetry.org/docs/#installation) Python package manager.
95+
3. **Clone** the unblob **repository from GitHub**:
6696

6797
git clone https://github.com/onekey-sec/unblob.git
6898

@@ -74,56 +104,26 @@ The Nix derivation installs all 3rd party dependencies.
74104
cd unblob
75105
UNBLOB_BUILD_RUST_EXTENSION=1 poetry install --no-dev
76106

77-
2. Python packages only:
107+
2. Python packages only:
78108

79109
cd unblob
80110
poetry install --no-dev
81111

82-
5. Install **required extractors** with your operating system package manager:
83-
84-
- on Ubuntu 22.04, install extractors with APT:
85-
86-
sudo apt install e2fsprogs p7zip-full unar zlib1g-dev liblzo2-dev lzop lziprecover img2simg libhyperscan-dev zstd
87-
88-
- If you need squashfs support, install sasquatch:
112+
3. Make sure you [installed all extractors](#install-extractors).
89113

90-
curl -L -o sasquatch_1.0_amd64.deb https://github.com/onekey-sec/sasquatch/releases/download/sasquatch-v1.0/sasquatch_1.0_amd64.deb
91-
sudo dpkg -i sasquatch_1.0_amd64.deb
92-
rm sasquatch_1.0_amd64.deb
93-
94-
6. Check that everything works correctly:
95-
96-
unblob --show-external-dependencies
97-
98-
- Dependencies are all in place:
99-
```console
100-
$ poetry run unblob --show-external-dependencies
101-
The following executables found installed, which are needed by unblob:
102-
7z ✓
103-
debugfs ✓
104-
jefferson ✓
105-
lz4 ✓
106-
lziprecover ✓
107-
lzop ✓
108-
sasquatch ✓
109-
sasquatch-v4be ✓
110-
simg2img ✓
111-
ubireader_extract_files ✓
112-
ubireader_extract_images ✓
113-
unar ✓
114-
yaffshiv ✓
115-
zstd ✓
116-
```
114+
4. Check that everything works correctly:
117115

118-
7. (Optional) Install it system wide.
116+
poetry run unblob --show-external-dependencies
119117

120-
You can install unblob system wide in two operations:
118+
## Install extractors
121119

122-
1. Build the unblob distribution package:
120+
1. With your operating system package manager:
121+
On Ubuntu 22.04, install extractors with APT:
123122

124-
cd unblob
125-
poetry build
123+
sudo apt install e2fsprogs p7zip-full unar zlib1g-dev liblzo2-dev lzop lziprecover img2simg libhyperscan-dev zstd
126124

127-
2. Install the unblob distribution package:
125+
2. If you need **squashfs support**, install sasquatch:
128126

129-
sudo python3 -m pip install dist/unblob-<version>.tar.gz
127+
curl -L -o sasquatch_1.0_amd64.deb https://github.com/onekey-sec/sasquatch/releases/download/sasquatch-v1.0/sasquatch_1.0_amd64.deb
128+
sudo dpkg -i sasquatch_1.0_amd64.deb
129+
rm sasquatch_1.0_amd64.deb

0 commit comments

Comments
 (0)