sitrtech 1.2.4__tar.gz → 1.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sitrtech-1.3.0/PKG-INFO +350 -0
- sitrtech-1.3.0/README.md +319 -0
- {sitrtech-1.2.4 → sitrtech-1.3.0}/pyproject.toml +5 -3
- {sitrtech-1.2.4 → sitrtech-1.3.0}/src/sitrtech/__init__.py +1 -1
- {sitrtech-1.2.4 → sitrtech-1.3.0}/src/sitrtech/cli.py +2 -2
- {sitrtech-1.2.4 → sitrtech-1.3.0}/src/sitrtech/engine.py +50 -0
- {sitrtech-1.2.4 → sitrtech-1.3.0}/src/sitrtech/local.py +37 -6
- {sitrtech-1.2.4 → sitrtech-1.3.0}/src/sitrtech/runtime.py +32 -0
- sitrtech-1.3.0/src/sitrtech.egg-info/PKG-INFO +350 -0
- sitrtech-1.2.4/PKG-INFO +0 -286
- sitrtech-1.2.4/README.md +0 -255
- sitrtech-1.2.4/src/sitrtech.egg-info/PKG-INFO +0 -286
- {sitrtech-1.2.4 → sitrtech-1.3.0}/setup.cfg +0 -0
- {sitrtech-1.2.4 → sitrtech-1.3.0}/src/sitrtech/php.py +0 -0
- {sitrtech-1.2.4 → sitrtech-1.3.0}/src/sitrtech.egg-info/SOURCES.txt +0 -0
- {sitrtech-1.2.4 → sitrtech-1.3.0}/src/sitrtech.egg-info/dependency_links.txt +0 -0
- {sitrtech-1.2.4 → sitrtech-1.3.0}/src/sitrtech.egg-info/entry_points.txt +0 -0
- {sitrtech-1.2.4 → sitrtech-1.3.0}/src/sitrtech.egg-info/requires.txt +0 -0
- {sitrtech-1.2.4 → sitrtech-1.3.0}/src/sitrtech.egg-info/top_level.txt +0 -0
sitrtech-1.3.0/PKG-INFO
ADDED
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: sitrtech
|
|
3
|
+
Version: 1.3.0
|
|
4
|
+
Summary: Encrypt & license-lock Python source (Odoo, Django, Flask, FastAPI, Tornado) with AES-256 and a native runtime loader
|
|
5
|
+
Author-email: SitrTech <info@sitrtech.com>
|
|
6
|
+
License: Proprietary
|
|
7
|
+
Project-URL: Homepage, https://sitrtech.com
|
|
8
|
+
Project-URL: Docs, https://sitrtech.com/docs
|
|
9
|
+
Project-URL: Repository, https://sitrtech.com
|
|
10
|
+
Project-URL: Bug Tracker, https://sitrtech.com/support
|
|
11
|
+
Keywords: odoo,django,flask,fastapi,tornado,encryption,aes-256,licensing,license-key,code-protection,source-protection,obfuscation,anti-reverse-engineering,intellectual-property
|
|
12
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
13
|
+
Classifier: Environment :: Console
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
23
|
+
Classifier: Topic :: Security :: Cryptography
|
|
24
|
+
Classifier: Topic :: Software Development :: Build Tools
|
|
25
|
+
Requires-Python: >=3.8
|
|
26
|
+
Description-Content-Type: text/markdown
|
|
27
|
+
Requires-Dist: requests>=2.31
|
|
28
|
+
Requires-Dist: rich>=13
|
|
29
|
+
Requires-Dist: click>=8
|
|
30
|
+
Requires-Dist: cryptography>=41
|
|
31
|
+
|
|
32
|
+
# SitrTech — Python Source Code Encryption & Licensing
|
|
33
|
+
|
|
34
|
+
[](https://pypi.org/project/sitrtech/)
|
|
35
|
+
[](https://pypi.org/project/sitrtech/)
|
|
36
|
+
[](https://sitrtech.com/docs)
|
|
37
|
+
[](https://sitrtech.com/docs)
|
|
38
|
+
|
|
39
|
+
Ship your **Odoo, Django, Flask, FastAPI, or Tornado** project as encrypted Python
|
|
40
|
+
that runs at native speed — while your source stays unreadable, license-locked, and
|
|
41
|
+
optionally bound to a machine, network, or time window. One command, in your CI or on
|
|
42
|
+
your laptop.
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
pipx install sitrtech # recommended for CLI tools
|
|
46
|
+
sitr encrypt my_module.zip --framework odoo --secret sk-...
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## Why SitrTech
|
|
52
|
+
|
|
53
|
+
- **Real encryption, not obfuscation.** Every `.py` becomes a `.pye` sealed with
|
|
54
|
+
**AES-256-GCM** under a per-file key. There is no de-obfuscator to reverse — without
|
|
55
|
+
the key, the bytes are ciphertext.
|
|
56
|
+
- **A compiled native loader does the unwrapping.** Decryption keys live only inside a
|
|
57
|
+
compiled C extension, never in readable Python. The master secret is **never** present
|
|
58
|
+
in this package or on your machine.
|
|
59
|
+
- **Zero runtime tax.** Modules are decrypted once at import time, then execute as normal
|
|
60
|
+
CPython bytecode. No per-call overhead.
|
|
61
|
+
- **License binding built in.** Lock code to an expiry date, start date, IP/CIDR, MAC,
|
|
62
|
+
machine ID, hostname, disk serial, Odoo database, or domain — combinable with AND logic,
|
|
63
|
+
enforced at import.
|
|
64
|
+
- **Local mode.** Encrypt entirely on your own machine: your source is **never uploaded**.
|
|
65
|
+
Only signed, tamper-proof line counts are exchanged for metering.
|
|
66
|
+
- **Built for CI.** Incremental, parallel batch encryption of hundreds of modules, plus an
|
|
67
|
+
offline mode for air-gapped or maintenance windows.
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Installation
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
# pipx — best for CLI tools; isolated, works on Ubuntu/Debian/macOS without conflicts
|
|
75
|
+
pipx install sitrtech
|
|
76
|
+
pipx upgrade sitrtech
|
|
77
|
+
|
|
78
|
+
# pip — standard package manager
|
|
79
|
+
pip install sitrtech # latest stable
|
|
80
|
+
pip install --upgrade sitrtech
|
|
81
|
+
pip install "sitrtech==1.3.0" # pin a version
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
> **Ubuntu / Debian:** if you hit `externally-managed-environment`, use
|
|
85
|
+
> `pipx install sitrtech`.
|
|
86
|
+
|
|
87
|
+
**Compatibility**
|
|
88
|
+
|
|
89
|
+
| Component | Supported |
|
|
90
|
+
|-----------|-----------|
|
|
91
|
+
| **CLI** (this package) | Python **3.8 – 3.14** · Linux, macOS, Windows |
|
|
92
|
+
| **Encrypted runtime** (where your protected app runs) | Python **3.7 – 3.14** · Linux (manylinux/musllinux, x86-64 & aarch64), macOS (Intel & Apple Silicon), Windows (x64/x86) |
|
|
93
|
+
|
|
94
|
+
The right native loader for the deployment machine is selected automatically — no manual
|
|
95
|
+
setup on your servers.
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## Quick start
|
|
100
|
+
|
|
101
|
+
Get an API secret key from **[sitrtech.com/api-keys](https://sitrtech.com/api-keys)**,
|
|
102
|
+
then export it once:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
export SITR_SECRET=sk-your-key-here
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
# Encrypt an Odoo addon
|
|
110
|
+
sitr encrypt hr_module.zip --framework odoo
|
|
111
|
+
|
|
112
|
+
# Encrypt a Django project, expiring end of 2026, limited to one network
|
|
113
|
+
sitr encrypt backend.zip -f django --expiry 2026-12-31 --network 10.0.0.0/24
|
|
114
|
+
|
|
115
|
+
# Encrypt on your own machine — source never leaves it
|
|
116
|
+
sitr encrypt api.zip -f fastapi --local
|
|
117
|
+
|
|
118
|
+
# Check your token balance
|
|
119
|
+
sitr balance
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## Commands
|
|
125
|
+
|
|
126
|
+
| Command | Purpose |
|
|
127
|
+
|---------|---------|
|
|
128
|
+
| `sitr encrypt <FILE.zip>` | Encrypt one zipped project |
|
|
129
|
+
| `sitr encrypt-dir <DIR>` | Encrypt many modules — incremental, parallel |
|
|
130
|
+
| `sitr offline fetch \| sync \| status` | Work without live platform access |
|
|
131
|
+
| `sitr balance` | Show tokens, plan, and per-line rate |
|
|
132
|
+
| `sitr info` | List frameworks and required project layout |
|
|
133
|
+
| `sitr version` | Print the CLI version |
|
|
134
|
+
|
|
135
|
+
Run `sitr <command> --help` for full options.
|
|
136
|
+
|
|
137
|
+
### `sitr encrypt`
|
|
138
|
+
|
|
139
|
+
```
|
|
140
|
+
sitr encrypt <FILE.zip> [OPTIONS]
|
|
141
|
+
|
|
142
|
+
-f, --framework TEXT odoo | django | flask | fastapi | tornado [default: odoo]
|
|
143
|
+
-v, --version TEXT Framework version (e.g. 17.0 for Odoo)
|
|
144
|
+
-o, --output PATH Output file [default: <input>_encrypted.zip]
|
|
145
|
+
--local Encrypt locally — source is never uploaded
|
|
146
|
+
-s, --secret TEXT API secret key [env: SITR_SECRET]
|
|
147
|
+
-b, --base URL Override API base URL [env: SITR_BASE]
|
|
148
|
+
|
|
149
|
+
Binding (all optional, combinable):
|
|
150
|
+
-e, --expiry DATE stop working after this date/time
|
|
151
|
+
--start DATE not valid before this date/time
|
|
152
|
+
-n, --network CIDR allowed IP / CIDR / range (repeatable)
|
|
153
|
+
--mac MAC allowed MAC address (repeatable)
|
|
154
|
+
--machine-id ID machine fingerprint (repeatable)
|
|
155
|
+
--hostname HOST allowed hostname (repeatable)
|
|
156
|
+
--disk-serial SN allowed disk / volume serial (repeatable)
|
|
157
|
+
--odoo-db DB allowed Odoo database name (repeatable)
|
|
158
|
+
--domain DOMAIN allowed domain / base URL (repeatable)
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### `sitr encrypt-dir` — batch, incremental, parallel
|
|
162
|
+
|
|
163
|
+
Built for teams shipping **dozens of modules across many projects, daily**. No manual
|
|
164
|
+
zipping; source never leaves your machine; only **changed** modules are re-encrypted each
|
|
165
|
+
run (state tracked in `<output>/.sitr_state.json`).
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
# Encrypt every Odoo module under ./addons — locally, in parallel, incrementally
|
|
169
|
+
sitr encrypt-dir ./addons --framework odoo
|
|
170
|
+
|
|
171
|
+
# With binding + expiry, into a custom output directory
|
|
172
|
+
sitr encrypt-dir ./addons -f odoo -o ./dist \
|
|
173
|
+
--expiry 2026-12-31 --network 10.0.0.0/24 --mac 00:1a:2b:3c:4d:5e
|
|
174
|
+
|
|
175
|
+
sitr encrypt-dir ./addons --full # force a full re-encryption
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
| Option | Meaning |
|
|
179
|
+
|--------|---------|
|
|
180
|
+
| `-o, --output DIR` | output directory (default `<source>_encrypted`) |
|
|
181
|
+
| `-j, --jobs N` | parallel workers (default: CPU count) |
|
|
182
|
+
| `--full` | ignore incremental state; re-encrypt everything |
|
|
183
|
+
| *all binding flags* | `--expiry --start --network --mac --machine-id --hostname --disk-serial --odoo-db --domain` |
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
## Local mode — your source never leaves your machine
|
|
188
|
+
|
|
189
|
+
Add `--local` to encrypt entirely on your own hardware. Your code is read, encrypted, and
|
|
190
|
+
written **on the spot**; the platform only ever sees what it needs to meter usage.
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
sitr encrypt my_addon.zip --framework odoo --local
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
**How it stays honest without seeing your code**
|
|
197
|
+
|
|
198
|
+
1. **Authorize** — the CLI reserves tokens and receives a signed, one-time job key.
|
|
199
|
+
2. **Encrypt locally** — every file is sealed with AES-256-GCM using that key.
|
|
200
|
+
3. **Attest & commit** — the compiled loader (the only local component that can) signs a
|
|
201
|
+
proof of the **actual line count** over the encrypted output. The platform verifies that
|
|
202
|
+
signature before charging, so counts can be neither over- nor under-reported.
|
|
203
|
+
|
|
204
|
+
No valid authorization ⇒ nothing is encrypted. The master secret is never on your machine.
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
## Binding & protection
|
|
209
|
+
|
|
210
|
+
Lock encrypted code to a place, machine, or time window. Rules combine with **AND** — every
|
|
211
|
+
rule present must pass at import time. Works in both normal and `--local` modes.
|
|
212
|
+
|
|
213
|
+
| Option | Binds the code to… |
|
|
214
|
+
|--------|--------------------|
|
|
215
|
+
| `-e, --expiry DATE` | stops working after this date/time |
|
|
216
|
+
| `--start DATE` | not valid before this date/time |
|
|
217
|
+
| `-n, --network CIDR` | allowed IPs / CIDR / ranges |
|
|
218
|
+
| `--mac MAC` | allowed MAC address(es) |
|
|
219
|
+
| `--machine-id ID` | machine fingerprint (Linux `machine-id` / Windows `MachineGuid`) |
|
|
220
|
+
| `--hostname HOST` | allowed hostname(s) |
|
|
221
|
+
| `--disk-serial SN` | allowed disk / volume serial(s) |
|
|
222
|
+
| `--odoo-db DB` | allowed Odoo database name(s) |
|
|
223
|
+
| `--domain DOMAIN` | allowed domain / base URL(s) |
|
|
224
|
+
|
|
225
|
+
```bash
|
|
226
|
+
# Bind to one machine + network, expiring end of 2026
|
|
227
|
+
sitr encrypt hr_module.zip -f odoo --local \
|
|
228
|
+
--expiry 2026-12-31 \
|
|
229
|
+
--network 10.0.0.0/24 \
|
|
230
|
+
--mac 00:1a:2b:3c:4d:5e \
|
|
231
|
+
--machine-id "$(cat /etc/machine-id)"
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
---
|
|
235
|
+
|
|
236
|
+
## Offline mode
|
|
237
|
+
|
|
238
|
+
Pre-authorize work so encryption keeps running when the platform is unreachable
|
|
239
|
+
(maintenance, air-gapped build hosts). Quota is reserved up front and reconciled later.
|
|
240
|
+
|
|
241
|
+
```bash
|
|
242
|
+
sitr offline fetch --quota 200000 --days 14 # pre-authorize while online
|
|
243
|
+
sitr encrypt-dir ./addons -f odoo # ...later, encrypt with no connectivity
|
|
244
|
+
sitr offline sync # reconcile real usage once back online
|
|
245
|
+
sitr offline status # show the cached grant and remaining quota
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
---
|
|
249
|
+
|
|
250
|
+
## Project structure
|
|
251
|
+
|
|
252
|
+
| Framework | Required entry-point file |
|
|
253
|
+
|-----------|---------------------------|
|
|
254
|
+
| Odoo | `__manifest__.py` |
|
|
255
|
+
| Django | `manage.py` |
|
|
256
|
+
| Flask | `app.py` or `wsgi.py` |
|
|
257
|
+
| FastAPI | `main.py` or `asgi.py` |
|
|
258
|
+
| Tornado | `main.py` or `server.py` |
|
|
259
|
+
|
|
260
|
+
**Always zip the root folder — not its contents:**
|
|
261
|
+
|
|
262
|
+
```bash
|
|
263
|
+
# Correct ✓
|
|
264
|
+
zip -r my_addon.zip my_addon/
|
|
265
|
+
|
|
266
|
+
# Wrong ✗
|
|
267
|
+
cd my_addon && zip -r ../my_addon.zip .
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
---
|
|
271
|
+
|
|
272
|
+
## CI/CD
|
|
273
|
+
|
|
274
|
+
### GitHub Actions — daily encryption of all modules
|
|
275
|
+
|
|
276
|
+
```yaml
|
|
277
|
+
name: Encrypt & deploy addons
|
|
278
|
+
on:
|
|
279
|
+
schedule: [{ cron: "0 2 * * *" }] # daily at 02:00
|
|
280
|
+
workflow_dispatch:
|
|
281
|
+
jobs:
|
|
282
|
+
encrypt:
|
|
283
|
+
runs-on: ubuntu-latest
|
|
284
|
+
steps:
|
|
285
|
+
- uses: actions/checkout@v4
|
|
286
|
+
- uses: actions/setup-python@v5
|
|
287
|
+
with: { python-version: "3.12" }
|
|
288
|
+
# cache incremental state so only changed modules re-encrypt
|
|
289
|
+
- uses: actions/cache@v4
|
|
290
|
+
with: { path: dist/.sitr_state.json, key: sitr-state-${{ github.ref }} }
|
|
291
|
+
- run: pipx install sitrtech
|
|
292
|
+
- name: Encrypt all modules (source never leaves the runner)
|
|
293
|
+
env: { SITR_SECRET: ${{ secrets.SITR_SECRET }} }
|
|
294
|
+
run: sitr encrypt-dir ./addons -f odoo -o ./dist --expiry 2026-12-31
|
|
295
|
+
- name: Deploy encrypted modules
|
|
296
|
+
run: rsync -az ./dist/ user@server:/opt/odoo/addons/
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
### GitLab CI
|
|
300
|
+
|
|
301
|
+
```yaml
|
|
302
|
+
encrypt:
|
|
303
|
+
image: python:3.12
|
|
304
|
+
cache: { paths: [dist/.sitr_state.json] }
|
|
305
|
+
variables: { SITR_SECRET: $SITR_SECRET }
|
|
306
|
+
script:
|
|
307
|
+
- pip install sitrtech
|
|
308
|
+
- sitr encrypt-dir ./addons -f odoo -o ./dist
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
### Docker one-liner
|
|
312
|
+
|
|
313
|
+
```bash
|
|
314
|
+
docker run --rm -e SITR_SECRET -v "$PWD/addons:/src:ro" -v "$PWD/dist:/out" \
|
|
315
|
+
python:3.12-slim sh -c "pip install -q sitrtech && sitr encrypt-dir /src -f odoo -o /out"
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
---
|
|
319
|
+
|
|
320
|
+
## Environment variables
|
|
321
|
+
|
|
322
|
+
| Variable | Description |
|
|
323
|
+
|----------|-------------|
|
|
324
|
+
| `SITR_SECRET` | API secret key (so you don't pass `--secret` each time) |
|
|
325
|
+
| `SITR_BASE` | Override the API base URL (default: `https://sitrtech.com`) |
|
|
326
|
+
|
|
327
|
+
---
|
|
328
|
+
|
|
329
|
+
## How it works
|
|
330
|
+
|
|
331
|
+
1. **Per-file sealing.** Each source file is encrypted with a fresh AES-256-GCM key; that
|
|
332
|
+
file key is itself wrapped under a one-time, per-job key.
|
|
333
|
+
2. **Native loader.** A compiled C extension is placed alongside your code. At import it
|
|
334
|
+
unwraps the job key and decrypts modules in memory — key material never exists as
|
|
335
|
+
readable Python, and the platform master secret is never distributed.
|
|
336
|
+
3. **License gate.** If you set any binding, the loader validates every rule (expiry, start,
|
|
337
|
+
network, MAC, machine ID, hostname, disk serial, Odoo DB, domain) before a module runs.
|
|
338
|
+
4. **Metered fairly.** Billing is per line of code. In local mode the loader
|
|
339
|
+
**cryptographically attests** the real line count, so metering is trustworthy without the
|
|
340
|
+
platform ever seeing your source.
|
|
341
|
+
|
|
342
|
+
---
|
|
343
|
+
|
|
344
|
+
## Links
|
|
345
|
+
|
|
346
|
+
- **Documentation** — <https://sitrtech.com/docs>
|
|
347
|
+
- **API keys** — <https://sitrtech.com/api-keys>
|
|
348
|
+
- **Support** — <https://sitrtech.com/support> · support@sitrtech.com
|
|
349
|
+
|
|
350
|
+
© SitrTech. Proprietary. All rights reserved.
|
sitrtech-1.3.0/README.md
ADDED
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
# SitrTech — Python Source Code Encryption & Licensing
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/sitrtech/)
|
|
4
|
+
[](https://pypi.org/project/sitrtech/)
|
|
5
|
+
[](https://sitrtech.com/docs)
|
|
6
|
+
[](https://sitrtech.com/docs)
|
|
7
|
+
|
|
8
|
+
Ship your **Odoo, Django, Flask, FastAPI, or Tornado** project as encrypted Python
|
|
9
|
+
that runs at native speed — while your source stays unreadable, license-locked, and
|
|
10
|
+
optionally bound to a machine, network, or time window. One command, in your CI or on
|
|
11
|
+
your laptop.
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
pipx install sitrtech # recommended for CLI tools
|
|
15
|
+
sitr encrypt my_module.zip --framework odoo --secret sk-...
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Why SitrTech
|
|
21
|
+
|
|
22
|
+
- **Real encryption, not obfuscation.** Every `.py` becomes a `.pye` sealed with
|
|
23
|
+
**AES-256-GCM** under a per-file key. There is no de-obfuscator to reverse — without
|
|
24
|
+
the key, the bytes are ciphertext.
|
|
25
|
+
- **A compiled native loader does the unwrapping.** Decryption keys live only inside a
|
|
26
|
+
compiled C extension, never in readable Python. The master secret is **never** present
|
|
27
|
+
in this package or on your machine.
|
|
28
|
+
- **Zero runtime tax.** Modules are decrypted once at import time, then execute as normal
|
|
29
|
+
CPython bytecode. No per-call overhead.
|
|
30
|
+
- **License binding built in.** Lock code to an expiry date, start date, IP/CIDR, MAC,
|
|
31
|
+
machine ID, hostname, disk serial, Odoo database, or domain — combinable with AND logic,
|
|
32
|
+
enforced at import.
|
|
33
|
+
- **Local mode.** Encrypt entirely on your own machine: your source is **never uploaded**.
|
|
34
|
+
Only signed, tamper-proof line counts are exchanged for metering.
|
|
35
|
+
- **Built for CI.** Incremental, parallel batch encryption of hundreds of modules, plus an
|
|
36
|
+
offline mode for air-gapped or maintenance windows.
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Installation
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
# pipx — best for CLI tools; isolated, works on Ubuntu/Debian/macOS without conflicts
|
|
44
|
+
pipx install sitrtech
|
|
45
|
+
pipx upgrade sitrtech
|
|
46
|
+
|
|
47
|
+
# pip — standard package manager
|
|
48
|
+
pip install sitrtech # latest stable
|
|
49
|
+
pip install --upgrade sitrtech
|
|
50
|
+
pip install "sitrtech==1.3.0" # pin a version
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
> **Ubuntu / Debian:** if you hit `externally-managed-environment`, use
|
|
54
|
+
> `pipx install sitrtech`.
|
|
55
|
+
|
|
56
|
+
**Compatibility**
|
|
57
|
+
|
|
58
|
+
| Component | Supported |
|
|
59
|
+
|-----------|-----------|
|
|
60
|
+
| **CLI** (this package) | Python **3.8 – 3.14** · Linux, macOS, Windows |
|
|
61
|
+
| **Encrypted runtime** (where your protected app runs) | Python **3.7 – 3.14** · Linux (manylinux/musllinux, x86-64 & aarch64), macOS (Intel & Apple Silicon), Windows (x64/x86) |
|
|
62
|
+
|
|
63
|
+
The right native loader for the deployment machine is selected automatically — no manual
|
|
64
|
+
setup on your servers.
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Quick start
|
|
69
|
+
|
|
70
|
+
Get an API secret key from **[sitrtech.com/api-keys](https://sitrtech.com/api-keys)**,
|
|
71
|
+
then export it once:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
export SITR_SECRET=sk-your-key-here
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
# Encrypt an Odoo addon
|
|
79
|
+
sitr encrypt hr_module.zip --framework odoo
|
|
80
|
+
|
|
81
|
+
# Encrypt a Django project, expiring end of 2026, limited to one network
|
|
82
|
+
sitr encrypt backend.zip -f django --expiry 2026-12-31 --network 10.0.0.0/24
|
|
83
|
+
|
|
84
|
+
# Encrypt on your own machine — source never leaves it
|
|
85
|
+
sitr encrypt api.zip -f fastapi --local
|
|
86
|
+
|
|
87
|
+
# Check your token balance
|
|
88
|
+
sitr balance
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## Commands
|
|
94
|
+
|
|
95
|
+
| Command | Purpose |
|
|
96
|
+
|---------|---------|
|
|
97
|
+
| `sitr encrypt <FILE.zip>` | Encrypt one zipped project |
|
|
98
|
+
| `sitr encrypt-dir <DIR>` | Encrypt many modules — incremental, parallel |
|
|
99
|
+
| `sitr offline fetch \| sync \| status` | Work without live platform access |
|
|
100
|
+
| `sitr balance` | Show tokens, plan, and per-line rate |
|
|
101
|
+
| `sitr info` | List frameworks and required project layout |
|
|
102
|
+
| `sitr version` | Print the CLI version |
|
|
103
|
+
|
|
104
|
+
Run `sitr <command> --help` for full options.
|
|
105
|
+
|
|
106
|
+
### `sitr encrypt`
|
|
107
|
+
|
|
108
|
+
```
|
|
109
|
+
sitr encrypt <FILE.zip> [OPTIONS]
|
|
110
|
+
|
|
111
|
+
-f, --framework TEXT odoo | django | flask | fastapi | tornado [default: odoo]
|
|
112
|
+
-v, --version TEXT Framework version (e.g. 17.0 for Odoo)
|
|
113
|
+
-o, --output PATH Output file [default: <input>_encrypted.zip]
|
|
114
|
+
--local Encrypt locally — source is never uploaded
|
|
115
|
+
-s, --secret TEXT API secret key [env: SITR_SECRET]
|
|
116
|
+
-b, --base URL Override API base URL [env: SITR_BASE]
|
|
117
|
+
|
|
118
|
+
Binding (all optional, combinable):
|
|
119
|
+
-e, --expiry DATE stop working after this date/time
|
|
120
|
+
--start DATE not valid before this date/time
|
|
121
|
+
-n, --network CIDR allowed IP / CIDR / range (repeatable)
|
|
122
|
+
--mac MAC allowed MAC address (repeatable)
|
|
123
|
+
--machine-id ID machine fingerprint (repeatable)
|
|
124
|
+
--hostname HOST allowed hostname (repeatable)
|
|
125
|
+
--disk-serial SN allowed disk / volume serial (repeatable)
|
|
126
|
+
--odoo-db DB allowed Odoo database name (repeatable)
|
|
127
|
+
--domain DOMAIN allowed domain / base URL (repeatable)
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### `sitr encrypt-dir` — batch, incremental, parallel
|
|
131
|
+
|
|
132
|
+
Built for teams shipping **dozens of modules across many projects, daily**. No manual
|
|
133
|
+
zipping; source never leaves your machine; only **changed** modules are re-encrypted each
|
|
134
|
+
run (state tracked in `<output>/.sitr_state.json`).
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
# Encrypt every Odoo module under ./addons — locally, in parallel, incrementally
|
|
138
|
+
sitr encrypt-dir ./addons --framework odoo
|
|
139
|
+
|
|
140
|
+
# With binding + expiry, into a custom output directory
|
|
141
|
+
sitr encrypt-dir ./addons -f odoo -o ./dist \
|
|
142
|
+
--expiry 2026-12-31 --network 10.0.0.0/24 --mac 00:1a:2b:3c:4d:5e
|
|
143
|
+
|
|
144
|
+
sitr encrypt-dir ./addons --full # force a full re-encryption
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
| Option | Meaning |
|
|
148
|
+
|--------|---------|
|
|
149
|
+
| `-o, --output DIR` | output directory (default `<source>_encrypted`) |
|
|
150
|
+
| `-j, --jobs N` | parallel workers (default: CPU count) |
|
|
151
|
+
| `--full` | ignore incremental state; re-encrypt everything |
|
|
152
|
+
| *all binding flags* | `--expiry --start --network --mac --machine-id --hostname --disk-serial --odoo-db --domain` |
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
## Local mode — your source never leaves your machine
|
|
157
|
+
|
|
158
|
+
Add `--local` to encrypt entirely on your own hardware. Your code is read, encrypted, and
|
|
159
|
+
written **on the spot**; the platform only ever sees what it needs to meter usage.
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
sitr encrypt my_addon.zip --framework odoo --local
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
**How it stays honest without seeing your code**
|
|
166
|
+
|
|
167
|
+
1. **Authorize** — the CLI reserves tokens and receives a signed, one-time job key.
|
|
168
|
+
2. **Encrypt locally** — every file is sealed with AES-256-GCM using that key.
|
|
169
|
+
3. **Attest & commit** — the compiled loader (the only local component that can) signs a
|
|
170
|
+
proof of the **actual line count** over the encrypted output. The platform verifies that
|
|
171
|
+
signature before charging, so counts can be neither over- nor under-reported.
|
|
172
|
+
|
|
173
|
+
No valid authorization ⇒ nothing is encrypted. The master secret is never on your machine.
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
## Binding & protection
|
|
178
|
+
|
|
179
|
+
Lock encrypted code to a place, machine, or time window. Rules combine with **AND** — every
|
|
180
|
+
rule present must pass at import time. Works in both normal and `--local` modes.
|
|
181
|
+
|
|
182
|
+
| Option | Binds the code to… |
|
|
183
|
+
|--------|--------------------|
|
|
184
|
+
| `-e, --expiry DATE` | stops working after this date/time |
|
|
185
|
+
| `--start DATE` | not valid before this date/time |
|
|
186
|
+
| `-n, --network CIDR` | allowed IPs / CIDR / ranges |
|
|
187
|
+
| `--mac MAC` | allowed MAC address(es) |
|
|
188
|
+
| `--machine-id ID` | machine fingerprint (Linux `machine-id` / Windows `MachineGuid`) |
|
|
189
|
+
| `--hostname HOST` | allowed hostname(s) |
|
|
190
|
+
| `--disk-serial SN` | allowed disk / volume serial(s) |
|
|
191
|
+
| `--odoo-db DB` | allowed Odoo database name(s) |
|
|
192
|
+
| `--domain DOMAIN` | allowed domain / base URL(s) |
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
# Bind to one machine + network, expiring end of 2026
|
|
196
|
+
sitr encrypt hr_module.zip -f odoo --local \
|
|
197
|
+
--expiry 2026-12-31 \
|
|
198
|
+
--network 10.0.0.0/24 \
|
|
199
|
+
--mac 00:1a:2b:3c:4d:5e \
|
|
200
|
+
--machine-id "$(cat /etc/machine-id)"
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
---
|
|
204
|
+
|
|
205
|
+
## Offline mode
|
|
206
|
+
|
|
207
|
+
Pre-authorize work so encryption keeps running when the platform is unreachable
|
|
208
|
+
(maintenance, air-gapped build hosts). Quota is reserved up front and reconciled later.
|
|
209
|
+
|
|
210
|
+
```bash
|
|
211
|
+
sitr offline fetch --quota 200000 --days 14 # pre-authorize while online
|
|
212
|
+
sitr encrypt-dir ./addons -f odoo # ...later, encrypt with no connectivity
|
|
213
|
+
sitr offline sync # reconcile real usage once back online
|
|
214
|
+
sitr offline status # show the cached grant and remaining quota
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
---
|
|
218
|
+
|
|
219
|
+
## Project structure
|
|
220
|
+
|
|
221
|
+
| Framework | Required entry-point file |
|
|
222
|
+
|-----------|---------------------------|
|
|
223
|
+
| Odoo | `__manifest__.py` |
|
|
224
|
+
| Django | `manage.py` |
|
|
225
|
+
| Flask | `app.py` or `wsgi.py` |
|
|
226
|
+
| FastAPI | `main.py` or `asgi.py` |
|
|
227
|
+
| Tornado | `main.py` or `server.py` |
|
|
228
|
+
|
|
229
|
+
**Always zip the root folder — not its contents:**
|
|
230
|
+
|
|
231
|
+
```bash
|
|
232
|
+
# Correct ✓
|
|
233
|
+
zip -r my_addon.zip my_addon/
|
|
234
|
+
|
|
235
|
+
# Wrong ✗
|
|
236
|
+
cd my_addon && zip -r ../my_addon.zip .
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
## CI/CD
|
|
242
|
+
|
|
243
|
+
### GitHub Actions — daily encryption of all modules
|
|
244
|
+
|
|
245
|
+
```yaml
|
|
246
|
+
name: Encrypt & deploy addons
|
|
247
|
+
on:
|
|
248
|
+
schedule: [{ cron: "0 2 * * *" }] # daily at 02:00
|
|
249
|
+
workflow_dispatch:
|
|
250
|
+
jobs:
|
|
251
|
+
encrypt:
|
|
252
|
+
runs-on: ubuntu-latest
|
|
253
|
+
steps:
|
|
254
|
+
- uses: actions/checkout@v4
|
|
255
|
+
- uses: actions/setup-python@v5
|
|
256
|
+
with: { python-version: "3.12" }
|
|
257
|
+
# cache incremental state so only changed modules re-encrypt
|
|
258
|
+
- uses: actions/cache@v4
|
|
259
|
+
with: { path: dist/.sitr_state.json, key: sitr-state-${{ github.ref }} }
|
|
260
|
+
- run: pipx install sitrtech
|
|
261
|
+
- name: Encrypt all modules (source never leaves the runner)
|
|
262
|
+
env: { SITR_SECRET: ${{ secrets.SITR_SECRET }} }
|
|
263
|
+
run: sitr encrypt-dir ./addons -f odoo -o ./dist --expiry 2026-12-31
|
|
264
|
+
- name: Deploy encrypted modules
|
|
265
|
+
run: rsync -az ./dist/ user@server:/opt/odoo/addons/
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
### GitLab CI
|
|
269
|
+
|
|
270
|
+
```yaml
|
|
271
|
+
encrypt:
|
|
272
|
+
image: python:3.12
|
|
273
|
+
cache: { paths: [dist/.sitr_state.json] }
|
|
274
|
+
variables: { SITR_SECRET: $SITR_SECRET }
|
|
275
|
+
script:
|
|
276
|
+
- pip install sitrtech
|
|
277
|
+
- sitr encrypt-dir ./addons -f odoo -o ./dist
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
### Docker one-liner
|
|
281
|
+
|
|
282
|
+
```bash
|
|
283
|
+
docker run --rm -e SITR_SECRET -v "$PWD/addons:/src:ro" -v "$PWD/dist:/out" \
|
|
284
|
+
python:3.12-slim sh -c "pip install -q sitrtech && sitr encrypt-dir /src -f odoo -o /out"
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
---
|
|
288
|
+
|
|
289
|
+
## Environment variables
|
|
290
|
+
|
|
291
|
+
| Variable | Description |
|
|
292
|
+
|----------|-------------|
|
|
293
|
+
| `SITR_SECRET` | API secret key (so you don't pass `--secret` each time) |
|
|
294
|
+
| `SITR_BASE` | Override the API base URL (default: `https://sitrtech.com`) |
|
|
295
|
+
|
|
296
|
+
---
|
|
297
|
+
|
|
298
|
+
## How it works
|
|
299
|
+
|
|
300
|
+
1. **Per-file sealing.** Each source file is encrypted with a fresh AES-256-GCM key; that
|
|
301
|
+
file key is itself wrapped under a one-time, per-job key.
|
|
302
|
+
2. **Native loader.** A compiled C extension is placed alongside your code. At import it
|
|
303
|
+
unwraps the job key and decrypts modules in memory — key material never exists as
|
|
304
|
+
readable Python, and the platform master secret is never distributed.
|
|
305
|
+
3. **License gate.** If you set any binding, the loader validates every rule (expiry, start,
|
|
306
|
+
network, MAC, machine ID, hostname, disk serial, Odoo DB, domain) before a module runs.
|
|
307
|
+
4. **Metered fairly.** Billing is per line of code. In local mode the loader
|
|
308
|
+
**cryptographically attests** the real line count, so metering is trustworthy without the
|
|
309
|
+
platform ever seeing your source.
|
|
310
|
+
|
|
311
|
+
---
|
|
312
|
+
|
|
313
|
+
## Links
|
|
314
|
+
|
|
315
|
+
- **Documentation** — <https://sitrtech.com/docs>
|
|
316
|
+
- **API keys** — <https://sitrtech.com/api-keys>
|
|
317
|
+
- **Support** — <https://sitrtech.com/support> · support@sitrtech.com
|
|
318
|
+
|
|
319
|
+
© SitrTech. Proprietary. All rights reserved.
|
|
@@ -4,15 +4,17 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "sitrtech"
|
|
7
|
-
version = "1.
|
|
8
|
-
description = "
|
|
7
|
+
version = "1.3.0"
|
|
8
|
+
description = "Encrypt & license-lock Python source (Odoo, Django, Flask, FastAPI, Tornado) with AES-256 and a native runtime loader"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = { text = "Proprietary" }
|
|
11
11
|
requires-python = ">=3.8"
|
|
12
12
|
authors = [{ name = "SitrTech", email = "info@sitrtech.com" }]
|
|
13
13
|
keywords = [
|
|
14
14
|
"odoo", "django", "flask", "fastapi", "tornado",
|
|
15
|
-
"encryption", "
|
|
15
|
+
"encryption", "aes-256", "licensing", "license-key",
|
|
16
|
+
"code-protection", "source-protection", "obfuscation",
|
|
17
|
+
"anti-reverse-engineering", "intellectual-property",
|
|
16
18
|
]
|
|
17
19
|
classifiers = [
|
|
18
20
|
"Development Status :: 5 - Production/Stable",
|