televault 0.1.0__tar.gz → 2.0.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.
@@ -0,0 +1,310 @@
1
+ Metadata-Version: 2.4
2
+ Name: televault
3
+ Version: 2.0.0
4
+ Summary: Unlimited cloud storage using Telegram MTProto. No local DB - everything on Telegram.
5
+ Project-URL: Homepage, https://github.com/YahyaToubali/televault
6
+ Project-URL: Repository, https://github.com/YahyaToubali/televault
7
+ Author-email: Yahya Toubali <contact@yahyatoubali.me>
8
+ License: MIT
9
+ Keywords: backup,cloud,mtproto,storage,telegram
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Environment :: Console
12
+ Classifier: Intended Audience :: End Users/Desktop
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Topic :: System :: Archiving :: Backup
18
+ Requires-Python: >=3.11
19
+ Requires-Dist: aiofiles>=23.2.0
20
+ Requires-Dist: blake3>=0.4.0
21
+ Requires-Dist: click>=8.1.0
22
+ Requires-Dist: cryptography>=42.0.0
23
+ Requires-Dist: rich>=13.7.0
24
+ Requires-Dist: telethon>=1.36.0
25
+ Requires-Dist: textual>=0.47.0
26
+ Requires-Dist: zstandard>=0.22.0
27
+ Provides-Extra: dev
28
+ Requires-Dist: mypy>=1.8.0; extra == 'dev'
29
+ Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
30
+ Requires-Dist: pytest>=8.0.0; extra == 'dev'
31
+ Requires-Dist: ruff>=0.2.0; extra == 'dev'
32
+ Description-Content-Type: text/markdown
33
+
34
+ # TeleVault
35
+
36
+ Unlimited cloud storage using your **own** Telegram account. No local database — everything lives in a private Telegram channel, encrypted on your machine before upload.
37
+
38
+ ---
39
+
40
+ ## Install
41
+
42
+ ```bash
43
+ pip install televault
44
+ ```
45
+
46
+ Python 3.11+ is recommended.
47
+
48
+ ---
49
+
50
+ ## Quick Start
51
+
52
+ ```bash
53
+ # 1) Set up your Telegram API credentials (one-time setup)
54
+ export TELEGRAM_API_ID=your_api_id
55
+ export TELEGRAM_API_HASH=your_api_hash
56
+
57
+ # 2) Login with your Telegram account (MTProto, not bot API)
58
+ televault login
59
+
60
+ # 3) Set up storage channel (interactive)
61
+ televault setup
62
+
63
+ # 4) Upload
64
+ TELEVAULT_PASSWORD="strong-password" televault push /path/to/file
65
+
66
+ # 5) List & download
67
+ televault ls
68
+ TELEVAULT_PASSWORD="strong-password" televault pull <file_id_or_name>
69
+ ```
70
+
71
+ Basic commands:
72
+
73
+ - `televault login` – authenticate with Telegram
74
+ - `televault setup` – set up storage channel (interactive or CLI flags)
75
+ - `televault push` – upload files / folders (`-r` for recursive)
76
+ - `televault pull` – download by id or name
77
+ - `televault ls` – list files with size/chunks/encryption
78
+ - `televault search` – fuzzy search by name
79
+ - `televault status` – overall vault stats
80
+ - `televault whoami` – show current Telegram account
81
+ - `televault logout` – clear session
82
+
83
+ All commands check authentication first and will prompt you to run `televault login` if needed.
84
+
85
+ ---
86
+
87
+ ## Interactive TUI
88
+
89
+ TeleVault includes a rich Terminal User Interface (TUI) for visual file management:
90
+
91
+ ```bash
92
+ # Launch the TUI
93
+ televault tui
94
+ # or
95
+ televault-tui
96
+ ```
97
+
98
+ ### TUI Features:
99
+
100
+ - **📁 File Browser** – Browse all files with details (size, chunks, encryption status)
101
+ - **🔍 Search** – Real-time search through your files
102
+ - **📤 Upload** – Interactive file upload with password protection
103
+ - **📥 Download** – One-click file download
104
+ - **📊 Statistics** – View vault stats (total files, storage used)
105
+ - **⌨️ Keyboard Shortcuts**:
106
+ - `q` - Quit
107
+ - `r` - Refresh file list
108
+ - `u` - Upload file
109
+ - `d` - Download selected file
110
+ - `s` - Search files
111
+ - `l` - Login
112
+ - `Delete` - Delete selected file
113
+ - `Enter` - Download selected file
114
+
115
+ The TUI provides a more visual and interactive way to manage your vault compared to the CLI commands.
116
+
117
+ ---
118
+
119
+ ## Storage Channel Setup
120
+
121
+ The `televault setup` command provides three ways to configure your storage:
122
+
123
+ ### Interactive Mode (Recommended)
124
+ ```bash
125
+ televault setup
126
+ ```
127
+
128
+ You'll be prompted to choose:
129
+ ```
130
+ TeleVault Storage Channel Setup
131
+
132
+ How would you like to set up your storage?
133
+ 1. Create a new private channel (recommended)
134
+ 2. Use an existing channel by ID
135
+
136
+ Enter your choice (1 or 2):
137
+ ```
138
+
139
+ ### Non-Interactive Options
140
+
141
+ **Auto-create a new channel:**
142
+ ```bash
143
+ televault setup --auto-create
144
+ ```
145
+
146
+ **Use an existing channel:**
147
+ ```bash
148
+ televault setup --channel-id -1001234567890
149
+ ```
150
+
151
+ > **Note:** Channel IDs should start with `-100` (e.g., `-1001234567890`). Make sure the bot is a member of the channel if using an existing one.
152
+
153
+ ---
154
+
155
+ ## Project Vision
156
+
157
+ TeleVault is not a SaaS. The goal is to give hackers and power users a **simple, encrypted off‑site backup tool** built on top of infrastructure they already use every day.
158
+
159
+ - **Turn Telegram into your personal encrypted blob store** instead of spinning up S3 buckets, servers, or dashboards.
160
+ - **Stay client‑side by design** – TeleVault handles chunking, indexing, and crypto; Telegram just stores opaque data.
161
+ - **Be as easy to adopt as `pip install` + `televault login`**, with no extra services to maintain.
162
+ - **Stay portable** – future tooling should make it easy to export / migrate data so you’re never locked into Telegram.
163
+
164
+ This should feel closer to `restic`/`borg` than a cloud app: a sharp, scriptable tool that respects your threat model.
165
+
166
+ ---
167
+
168
+ ## Features
169
+
170
+ - **MTProto direct** – Uses Telethon + MTProto (no bot API limits)
171
+ - **Encrypted-by-default** – Client-side AES‑256‑GCM, password-derived keys
172
+ - **Zero local DB** – Metadata index is stored on Telegram itself
173
+ - **Chunked uploads** – Large files split into chunks (up to Telegram's per-file limit)
174
+ - **Resumable transfers** – Can continue interrupted uploads/downloads
175
+ - **Folder support** – Upload directories while preserving structure
176
+ - **Rich CLI** – Progress bars, colored output, and helpful error messages
177
+ - **Interactive TUI** – Full terminal UI with file browser, search, and management
178
+ - **Interactive setup** – Choose between creating new channel or using existing one
179
+
180
+ ---
181
+
182
+ ## Security Model
183
+
184
+ TeleVault is designed so that Telegram sees only encrypted blobs and JSON metadata; your password never leaves your machine.
185
+
186
+ - **Encryption**
187
+ - Files are optionally compressed and then encrypted with **AES‑256‑GCM**.
188
+ - Keys are derived from your password using **scrypt** (memory‑hard KDF).
189
+ - Encryption happens **before** data is sent to Telegram.
190
+
191
+ - **Indexing & Metadata**
192
+ - Each file has a small JSON metadata message (size, name, chunk ids, hash).
193
+ - A pinned "index" message in your channel maps file IDs → Telegram message IDs.
194
+ - No external database or server is required.
195
+
196
+ - **Sessions & Accounts**
197
+ - TeleVault authenticates using a standard Telethon session file.
198
+ - That session lives in your config directory (see below) and is not uploaded.
199
+
200
+ - **Threat Model (summary)**
201
+ - If someone gets access to your Telegram account **and** your password, they can read your data.
202
+ - If they only get Telegram’s servers or just the channel history, they only see encrypted chunks + metadata.
203
+
204
+ > Important: **Don’t lose your password.** There is no recovery if you forget it and have encryption enabled.
205
+
206
+ ---
207
+
208
+ ## Configuration
209
+
210
+ Configuration is stored under:
211
+
212
+ ```text
213
+ ~/.config/televault/config.json
214
+ ```
215
+
216
+ Example:
217
+
218
+ ```json
219
+ {
220
+ "channel_id": -1003652003243,
221
+ "chunk_size": 104857600,
222
+ "compression": true,
223
+ "encryption": true,
224
+ "parallel_uploads": 3,
225
+ "parallel_downloads": 5,
226
+ "max_retries": 3,
227
+ "retry_delay": 1.0
228
+ }
229
+ ```
230
+
231
+ You can override encryption on a per-command basis:
232
+
233
+ ```bash
234
+ # disable encryption for this upload only
235
+ televault push movie.mkv --no-encrypt
236
+
237
+ # disable compression
238
+ televault push backup.tar --no-compress
239
+ ```
240
+
241
+ The default password can also be set via environment variable:
242
+
243
+ ```bash
244
+ export TELEVAULT_PASSWORD="strong-password"
245
+ televault push secrets.zip
246
+ ```
247
+
248
+ ---
249
+
250
+ ## From Source (dev)
251
+
252
+ ```bash
253
+ git clone https://github.com/YahyaToubali/televault.git
254
+ cd televault
255
+
256
+ # create an isolated env (recommended)
257
+ python -m venv .venv
258
+ source .venv/bin/activate
259
+
260
+ pip install -e .[dev]
261
+ ```
262
+
263
+ Run tests:
264
+
265
+ ```bash
266
+ pytest
267
+ ```
268
+
269
+ ---
270
+
271
+ ## Roadmap (early ideas)
272
+
273
+ This is intentionally small for now; priorities will change as you use it.
274
+
275
+ - **Snapshots & versioning**
276
+ - `televault snapshot ~/Projects` with named snapshots and retention rules.
277
+ - Simple policies like "keep daily snapshots for 7 days, weekly for 4 weeks".
278
+ - **Smarter TUI**
279
+ - Better file browser, filters (by size/date/encrypted), and batch actions.
280
+ - **Scheduling helpers**
281
+ - Tiny helper commands or docs for cron/systemd timers ("backup this folder nightly").
282
+ - **Export / migrate tooling**
283
+ - One‑shot export from Telegram → local disk or other storage (S3, filesystem, etc.).
284
+ - **Multi‑vault support**
285
+ - Multiple channels as separate vaults (e.g. `personal`, `work`, `archives`).
286
+
287
+ If you’re reading this on GitHub and want to use TeleVault seriously, open an issue with your use case so priorities can be adjusted.
288
+
289
+ ---
290
+
291
+ ## Requirements
292
+
293
+ - Telegram account + API credentials from [my.telegram.org](https://my.telegram.org)
294
+ - Create an app to get your `api_id` and `api_hash`
295
+ - Set them as environment variables:
296
+ ```bash
297
+ export TELEGRAM_API_ID=your_api_id
298
+ export TELEGRAM_API_HASH=your_api_hash
299
+ ```
300
+ - Python 3.11 or newer
301
+
302
+ > **Tip:** Add the export lines to your `~/.bashrc`, `~/.zshrc`, or `~/.profile` to make them persistent.
303
+
304
+ ---
305
+
306
+ ## License
307
+
308
+ MIT
309
+
310
+ Author: **Yahya Toubali** · [@yahyatoubali](https://github.com/YahyaToubali)
@@ -0,0 +1,277 @@
1
+ # TeleVault
2
+
3
+ Unlimited cloud storage using your **own** Telegram account. No local database — everything lives in a private Telegram channel, encrypted on your machine before upload.
4
+
5
+ ---
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ pip install televault
11
+ ```
12
+
13
+ Python 3.11+ is recommended.
14
+
15
+ ---
16
+
17
+ ## Quick Start
18
+
19
+ ```bash
20
+ # 1) Set up your Telegram API credentials (one-time setup)
21
+ export TELEGRAM_API_ID=your_api_id
22
+ export TELEGRAM_API_HASH=your_api_hash
23
+
24
+ # 2) Login with your Telegram account (MTProto, not bot API)
25
+ televault login
26
+
27
+ # 3) Set up storage channel (interactive)
28
+ televault setup
29
+
30
+ # 4) Upload
31
+ TELEVAULT_PASSWORD="strong-password" televault push /path/to/file
32
+
33
+ # 5) List & download
34
+ televault ls
35
+ TELEVAULT_PASSWORD="strong-password" televault pull <file_id_or_name>
36
+ ```
37
+
38
+ Basic commands:
39
+
40
+ - `televault login` – authenticate with Telegram
41
+ - `televault setup` – set up storage channel (interactive or CLI flags)
42
+ - `televault push` – upload files / folders (`-r` for recursive)
43
+ - `televault pull` – download by id or name
44
+ - `televault ls` – list files with size/chunks/encryption
45
+ - `televault search` – fuzzy search by name
46
+ - `televault status` – overall vault stats
47
+ - `televault whoami` – show current Telegram account
48
+ - `televault logout` – clear session
49
+
50
+ All commands check authentication first and will prompt you to run `televault login` if needed.
51
+
52
+ ---
53
+
54
+ ## Interactive TUI
55
+
56
+ TeleVault includes a rich Terminal User Interface (TUI) for visual file management:
57
+
58
+ ```bash
59
+ # Launch the TUI
60
+ televault tui
61
+ # or
62
+ televault-tui
63
+ ```
64
+
65
+ ### TUI Features:
66
+
67
+ - **📁 File Browser** – Browse all files with details (size, chunks, encryption status)
68
+ - **🔍 Search** – Real-time search through your files
69
+ - **📤 Upload** – Interactive file upload with password protection
70
+ - **📥 Download** – One-click file download
71
+ - **📊 Statistics** – View vault stats (total files, storage used)
72
+ - **⌨️ Keyboard Shortcuts**:
73
+ - `q` - Quit
74
+ - `r` - Refresh file list
75
+ - `u` - Upload file
76
+ - `d` - Download selected file
77
+ - `s` - Search files
78
+ - `l` - Login
79
+ - `Delete` - Delete selected file
80
+ - `Enter` - Download selected file
81
+
82
+ The TUI provides a more visual and interactive way to manage your vault compared to the CLI commands.
83
+
84
+ ---
85
+
86
+ ## Storage Channel Setup
87
+
88
+ The `televault setup` command provides three ways to configure your storage:
89
+
90
+ ### Interactive Mode (Recommended)
91
+ ```bash
92
+ televault setup
93
+ ```
94
+
95
+ You'll be prompted to choose:
96
+ ```
97
+ TeleVault Storage Channel Setup
98
+
99
+ How would you like to set up your storage?
100
+ 1. Create a new private channel (recommended)
101
+ 2. Use an existing channel by ID
102
+
103
+ Enter your choice (1 or 2):
104
+ ```
105
+
106
+ ### Non-Interactive Options
107
+
108
+ **Auto-create a new channel:**
109
+ ```bash
110
+ televault setup --auto-create
111
+ ```
112
+
113
+ **Use an existing channel:**
114
+ ```bash
115
+ televault setup --channel-id -1001234567890
116
+ ```
117
+
118
+ > **Note:** Channel IDs should start with `-100` (e.g., `-1001234567890`). Make sure the bot is a member of the channel if using an existing one.
119
+
120
+ ---
121
+
122
+ ## Project Vision
123
+
124
+ TeleVault is not a SaaS. The goal is to give hackers and power users a **simple, encrypted off‑site backup tool** built on top of infrastructure they already use every day.
125
+
126
+ - **Turn Telegram into your personal encrypted blob store** instead of spinning up S3 buckets, servers, or dashboards.
127
+ - **Stay client‑side by design** – TeleVault handles chunking, indexing, and crypto; Telegram just stores opaque data.
128
+ - **Be as easy to adopt as `pip install` + `televault login`**, with no extra services to maintain.
129
+ - **Stay portable** – future tooling should make it easy to export / migrate data so you’re never locked into Telegram.
130
+
131
+ This should feel closer to `restic`/`borg` than a cloud app: a sharp, scriptable tool that respects your threat model.
132
+
133
+ ---
134
+
135
+ ## Features
136
+
137
+ - **MTProto direct** – Uses Telethon + MTProto (no bot API limits)
138
+ - **Encrypted-by-default** – Client-side AES‑256‑GCM, password-derived keys
139
+ - **Zero local DB** – Metadata index is stored on Telegram itself
140
+ - **Chunked uploads** – Large files split into chunks (up to Telegram's per-file limit)
141
+ - **Resumable transfers** – Can continue interrupted uploads/downloads
142
+ - **Folder support** – Upload directories while preserving structure
143
+ - **Rich CLI** – Progress bars, colored output, and helpful error messages
144
+ - **Interactive TUI** – Full terminal UI with file browser, search, and management
145
+ - **Interactive setup** – Choose between creating new channel or using existing one
146
+
147
+ ---
148
+
149
+ ## Security Model
150
+
151
+ TeleVault is designed so that Telegram sees only encrypted blobs and JSON metadata; your password never leaves your machine.
152
+
153
+ - **Encryption**
154
+ - Files are optionally compressed and then encrypted with **AES‑256‑GCM**.
155
+ - Keys are derived from your password using **scrypt** (memory‑hard KDF).
156
+ - Encryption happens **before** data is sent to Telegram.
157
+
158
+ - **Indexing & Metadata**
159
+ - Each file has a small JSON metadata message (size, name, chunk ids, hash).
160
+ - A pinned "index" message in your channel maps file IDs → Telegram message IDs.
161
+ - No external database or server is required.
162
+
163
+ - **Sessions & Accounts**
164
+ - TeleVault authenticates using a standard Telethon session file.
165
+ - That session lives in your config directory (see below) and is not uploaded.
166
+
167
+ - **Threat Model (summary)**
168
+ - If someone gets access to your Telegram account **and** your password, they can read your data.
169
+ - If they only get Telegram’s servers or just the channel history, they only see encrypted chunks + metadata.
170
+
171
+ > Important: **Don’t lose your password.** There is no recovery if you forget it and have encryption enabled.
172
+
173
+ ---
174
+
175
+ ## Configuration
176
+
177
+ Configuration is stored under:
178
+
179
+ ```text
180
+ ~/.config/televault/config.json
181
+ ```
182
+
183
+ Example:
184
+
185
+ ```json
186
+ {
187
+ "channel_id": -1003652003243,
188
+ "chunk_size": 104857600,
189
+ "compression": true,
190
+ "encryption": true,
191
+ "parallel_uploads": 3,
192
+ "parallel_downloads": 5,
193
+ "max_retries": 3,
194
+ "retry_delay": 1.0
195
+ }
196
+ ```
197
+
198
+ You can override encryption on a per-command basis:
199
+
200
+ ```bash
201
+ # disable encryption for this upload only
202
+ televault push movie.mkv --no-encrypt
203
+
204
+ # disable compression
205
+ televault push backup.tar --no-compress
206
+ ```
207
+
208
+ The default password can also be set via environment variable:
209
+
210
+ ```bash
211
+ export TELEVAULT_PASSWORD="strong-password"
212
+ televault push secrets.zip
213
+ ```
214
+
215
+ ---
216
+
217
+ ## From Source (dev)
218
+
219
+ ```bash
220
+ git clone https://github.com/YahyaToubali/televault.git
221
+ cd televault
222
+
223
+ # create an isolated env (recommended)
224
+ python -m venv .venv
225
+ source .venv/bin/activate
226
+
227
+ pip install -e .[dev]
228
+ ```
229
+
230
+ Run tests:
231
+
232
+ ```bash
233
+ pytest
234
+ ```
235
+
236
+ ---
237
+
238
+ ## Roadmap (early ideas)
239
+
240
+ This is intentionally small for now; priorities will change as you use it.
241
+
242
+ - **Snapshots & versioning**
243
+ - `televault snapshot ~/Projects` with named snapshots and retention rules.
244
+ - Simple policies like "keep daily snapshots for 7 days, weekly for 4 weeks".
245
+ - **Smarter TUI**
246
+ - Better file browser, filters (by size/date/encrypted), and batch actions.
247
+ - **Scheduling helpers**
248
+ - Tiny helper commands or docs for cron/systemd timers ("backup this folder nightly").
249
+ - **Export / migrate tooling**
250
+ - One‑shot export from Telegram → local disk or other storage (S3, filesystem, etc.).
251
+ - **Multi‑vault support**
252
+ - Multiple channels as separate vaults (e.g. `personal`, `work`, `archives`).
253
+
254
+ If you’re reading this on GitHub and want to use TeleVault seriously, open an issue with your use case so priorities can be adjusted.
255
+
256
+ ---
257
+
258
+ ## Requirements
259
+
260
+ - Telegram account + API credentials from [my.telegram.org](https://my.telegram.org)
261
+ - Create an app to get your `api_id` and `api_hash`
262
+ - Set them as environment variables:
263
+ ```bash
264
+ export TELEGRAM_API_ID=your_api_id
265
+ export TELEGRAM_API_HASH=your_api_hash
266
+ ```
267
+ - Python 3.11 or newer
268
+
269
+ > **Tip:** Add the export lines to your `~/.bashrc`, `~/.zshrc`, or `~/.profile` to make them persistent.
270
+
271
+ ---
272
+
273
+ ## License
274
+
275
+ MIT
276
+
277
+ Author: **Yahya Toubali** · [@yahyatoubali](https://github.com/YahyaToubali)
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "televault"
3
- version = "0.1.0"
3
+ version = "2.0.0"
4
4
  description = "Unlimited cloud storage using Telegram MTProto. No local DB - everything on Telegram."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
@@ -40,6 +40,7 @@ dev = [
40
40
  [project.scripts]
41
41
  televault = "televault.cli:main"
42
42
  tv = "televault.cli:main"
43
+ televault-tui = "televault.tui:run_tui"
43
44
 
44
45
  [project.urls]
45
46
  Homepage = "https://github.com/YahyaToubali/televault"
@@ -13,4 +13,4 @@ __version__ = "1.0.0"
13
13
  __author__ = "Yahya Toubali"
14
14
  __email__ = "yahya@yahyatoubali.me"
15
15
  __license__ = "MIT"
16
- __url__ = "https://github.com/yahyatoubali/televault"
16
+ __url__ = "https://github.com/yahyatoubali/televault"