@nightowne/tas-cli 1.1.1 → 2.1.0
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.
- package/README.md +102 -97
- package/package.json +3 -3
- package/src/cli.js +212 -147
- package/src/crypto/encryption.js +128 -0
- package/src/db/index.js +86 -0
- package/src/fuse/mount.js +104 -40
- package/src/index.js +173 -103
- package/src/share/server.js +441 -0
- package/src/sync/sync.js +54 -35
- package/src/telegram/client.js +45 -17
- package/src/utils/chunker.js +11 -1
- package/src/utils/cli-helpers.js +145 -0
- package/src/utils/compression.js +30 -0
- package/src/utils/throttle.js +26 -0
package/README.md
CHANGED
|
@@ -1,14 +1,25 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="assets/demo.gif" alt="TAS Demo" width="600">
|
|
3
|
+
</p>
|
|
2
4
|
|
|
3
|
-
|
|
4
|
-
[](https://www.npmjs.com/package/@nightowne/tas-cli)
|
|
5
|
-
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
<h1 align="center">Telegram as Storage</h1>
|
|
6
6
|
|
|
7
7
|
<p align="center">
|
|
8
|
-
<
|
|
8
|
+
<strong>Free, encrypted, unlimited cloud storage — inside Telegram.</strong>
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
<p align="center">
|
|
12
|
+
<a href="https://github.com/ixchio/tas/actions/workflows/ci.yml"><img src="https://github.com/ixchio/tas/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
|
|
13
|
+
<a href="https://www.npmjs.com/package/@nightowne/tas-cli"><img src="https://img.shields.io/npm/v/@nightowne/tas-cli" alt="npm"></a>
|
|
14
|
+
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT"></a>
|
|
15
|
+
<a href="https://www.npmjs.com/package/@nightowne/tas-cli"><img src="https://img.shields.io/npm/dm/@nightowne/tas-cli" alt="Downloads"></a>
|
|
9
16
|
</p>
|
|
10
17
|
|
|
11
|
-
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
I built this because I wanted encrypted cloud storage that's actually free. Google Drive reads your files. Dropbox costs money. Telegram gives you unlimited storage with a bot API — so I wrote a CLI that turns it into a proper encrypted drive.
|
|
21
|
+
|
|
22
|
+
**What this does:** Compresses, encrypts (AES-256-GCM), and uploads your files to your own private Telegram bot chat. Mount it as a folder, sync directories, or share files with expiring links.
|
|
12
23
|
|
|
13
24
|
```
|
|
14
25
|
┌─────────────┐ ┌───────────────┐ ┌──────────────┐
|
|
@@ -22,136 +33,130 @@ A CLI tool that uses your Telegram bot as encrypted file storage. Files are comp
|
|
|
22
33
|
└─────────────┘ └───────────────┘ └──────────────┘
|
|
23
34
|
```
|
|
24
35
|
|
|
25
|
-
##
|
|
26
|
-
|
|
27
|
-
| Feature | TAS | Session-based tools (e.g. teldrive) |
|
|
28
|
-
|---------|:---:|:-----------------------------------:|
|
|
29
|
-
| Account ban risk | **None** (Bot API) | High (session hijack detection) |
|
|
30
|
-
| Encryption | AES-256-GCM | Usually none |
|
|
31
|
-
| Dependencies | SQLite only | Rclone, external DB |
|
|
32
|
-
| Setup complexity | 2 minutes | Docker + multiple services |
|
|
36
|
+
## ⚡ Quick Start
|
|
33
37
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
## Security Model
|
|
41
|
-
|
|
42
|
-
| Component | Implementation |
|
|
43
|
-
|-----------|----------------|
|
|
44
|
-
| Cipher | AES-256-GCM |
|
|
45
|
-
| Key derivation | PBKDF2-SHA512, 100,000 iterations |
|
|
46
|
-
| Salt | 32 bytes, random per file |
|
|
47
|
-
| IV | 12 bytes, random per file |
|
|
48
|
-
| Auth tag | 16 bytes (integrity) |
|
|
49
|
-
|
|
50
|
-
Your password never leaves your machine. Telegram stores encrypted blobs.
|
|
38
|
+
```bash
|
|
39
|
+
npm install -g @nightowne/tas-cli
|
|
40
|
+
tas init # 2-minute setup wizard
|
|
41
|
+
tas push secret.pdf
|
|
42
|
+
tas pull secret.pdf
|
|
43
|
+
```
|
|
51
44
|
|
|
52
|
-
##
|
|
45
|
+
## 🔥 Features
|
|
53
46
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
47
|
+
### Mount as a folder
|
|
48
|
+
```bash
|
|
49
|
+
tas mount ~/cloud # FUSE mount — drag & drop files
|
|
50
|
+
tas unmount ~/cloud
|
|
51
|
+
```
|
|
52
|
+
Requires `libfuse` (`apt install fuse libfuse-dev` on Debian/Ubuntu, `brew install macfuse` on macOS).
|
|
59
53
|
|
|
60
|
-
|
|
54
|
+
### Auto-sync folders
|
|
55
|
+
```bash
|
|
56
|
+
tas sync add ~/Documents # Register
|
|
57
|
+
tas sync start # Watch for changes, auto-upload
|
|
58
|
+
tas sync pull # Download everything back
|
|
59
|
+
```
|
|
61
60
|
|
|
61
|
+
### Share files with expiring links
|
|
62
62
|
```bash
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
tas share create secret.pdf --expire 1h --max-downloads 3
|
|
64
|
+
# → http://localhost:3000/d/a1b2c3d4...
|
|
65
65
|
|
|
66
|
-
|
|
67
|
-
tas
|
|
66
|
+
tas share list # Active shares
|
|
67
|
+
tas share revoke a1b2c3d4 # Revoke
|
|
68
|
+
```
|
|
69
|
+
Spins up a local HTTP server. File is downloaded from Telegram, decrypted, and served. Dark-themed download page with file info.
|
|
68
70
|
|
|
69
|
-
|
|
70
|
-
tas push secret.pdf
|
|
71
|
+
## 🛡️ Security
|
|
71
72
|
|
|
72
|
-
|
|
73
|
-
|
|
73
|
+
| Component | Implementation |
|
|
74
|
+
|-----------|----------------|
|
|
75
|
+
| Cipher | AES-256-GCM |
|
|
76
|
+
| Key derivation | PBKDF2-SHA512, 100k iterations |
|
|
77
|
+
| Salt | 32 bytes, random per file |
|
|
78
|
+
| IV | 12 bytes, random per file |
|
|
79
|
+
| Auth tag | 16 bytes (integrity verification) |
|
|
74
80
|
|
|
75
|
-
|
|
76
|
-
tas mount ~/cloud
|
|
77
|
-
```
|
|
81
|
+
Your password **never** leaves your machine. Telegram only sees encrypted blobs. Even if someone accesses your bot chat, they get meaningless data without your password.
|
|
78
82
|
|
|
79
|
-
|
|
80
|
-
- Node.js ≥18
|
|
81
|
-
- Telegram account + bot token from [@BotFather](https://t.me/BotFather)
|
|
82
|
-
- `libfuse` for mount feature:
|
|
83
|
-
```bash
|
|
84
|
-
# Debian/Ubuntu
|
|
85
|
-
sudo apt install fuse libfuse-dev
|
|
86
|
-
|
|
87
|
-
# Fedora
|
|
88
|
-
sudo dnf install fuse fuse-devel
|
|
89
|
-
|
|
90
|
-
# macOS
|
|
91
|
-
brew install macfuse
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
## CLI Reference
|
|
83
|
+
## 📋 Full CLI Reference
|
|
95
84
|
|
|
96
85
|
```bash
|
|
97
86
|
# Core
|
|
98
87
|
tas init # Setup wizard
|
|
99
|
-
tas push <file> # Upload
|
|
100
|
-
tas pull <file|hash> # Download
|
|
101
|
-
tas list [-l] # List files
|
|
102
|
-
tas delete <file|hash> #
|
|
103
|
-
tas status #
|
|
104
|
-
|
|
105
|
-
# Search & Resume (v1.1.0)
|
|
106
|
-
tas search <query> # Search by filename
|
|
107
|
-
tas search -t <query> # Search by tag
|
|
88
|
+
tas push <file> # Upload
|
|
89
|
+
tas pull <file|hash> # Download
|
|
90
|
+
tas list [-l] # List files
|
|
91
|
+
tas delete <file|hash> # Delete
|
|
92
|
+
tas status # Stats
|
|
93
|
+
tas search <query> # Search files
|
|
108
94
|
tas resume # Resume interrupted uploads
|
|
95
|
+
tas verify # Check integrity
|
|
109
96
|
|
|
110
97
|
# FUSE Mount
|
|
111
98
|
tas mount <path> # Mount as folder
|
|
112
99
|
tas unmount <path> # Unmount
|
|
113
100
|
|
|
101
|
+
# Sync
|
|
102
|
+
tas sync add <folder> # Register folder
|
|
103
|
+
tas sync start # Start watching
|
|
104
|
+
tas sync pull # Download all
|
|
105
|
+
tas sync status # Show status
|
|
106
|
+
|
|
107
|
+
# Share
|
|
108
|
+
tas share create <file> # Create download link
|
|
109
|
+
tas share list # Active shares
|
|
110
|
+
tas share revoke <token> # Revoke
|
|
111
|
+
|
|
114
112
|
# Tags
|
|
115
|
-
tas tag add <file> <tags...>
|
|
116
|
-
tas tag remove <file> <tags...>
|
|
117
|
-
tas tag list [tag]
|
|
113
|
+
tas tag add <file> <tags...>
|
|
114
|
+
tas tag remove <file> <tags...>
|
|
115
|
+
tas tag list [tag]
|
|
116
|
+
```
|
|
118
117
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
118
|
+
## 🤖 Automation
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
# Skip password prompts
|
|
122
|
+
export TAS_PASSWORD="your-password"
|
|
123
|
+
tas push file.pdf
|
|
124
124
|
|
|
125
|
-
#
|
|
126
|
-
tas
|
|
125
|
+
# Or inline
|
|
126
|
+
tas push -p "password" file.pdf
|
|
127
127
|
```
|
|
128
128
|
|
|
129
|
-
|
|
129
|
+
Works with cron, GitHub Actions, Docker, or any CI/CD.
|
|
130
130
|
|
|
131
|
-
|
|
131
|
+
## ⚠️ Limitations
|
|
132
|
+
|
|
133
|
+
- **Not a backup** — Telegram can delete content without notice
|
|
134
|
+
- **No versioning** — overwriting deletes the old version
|
|
135
|
+
- **49MB chunks** — files split due to Bot API limits
|
|
136
|
+
- **Single user** — personal use, not multi-tenant
|
|
137
|
+
- **FUSE required** — mount feature needs libfuse
|
|
132
138
|
|
|
133
|
-
## Development
|
|
139
|
+
## 🛠️ Development
|
|
134
140
|
|
|
135
141
|
```bash
|
|
136
142
|
git clone https://github.com/ixchio/tas
|
|
137
|
-
cd tas
|
|
138
|
-
npm
|
|
139
|
-
npm test # 28 tests
|
|
143
|
+
cd tas && npm install
|
|
144
|
+
npm test # 43 tests
|
|
140
145
|
```
|
|
141
146
|
|
|
142
|
-
### Project Structure
|
|
143
147
|
```
|
|
144
148
|
src/
|
|
145
|
-
├── cli.js #
|
|
149
|
+
├── cli.js # Commands
|
|
146
150
|
├── index.js # Upload/download pipeline
|
|
147
|
-
├── crypto/ # AES-256-GCM
|
|
148
|
-
├── db/ # SQLite
|
|
149
|
-
├── fuse/ # FUSE filesystem
|
|
151
|
+
├── crypto/ # AES-256-GCM
|
|
152
|
+
├── db/ # SQLite index
|
|
153
|
+
├── fuse/ # FUSE filesystem
|
|
154
|
+
├── share/ # HTTP share server
|
|
150
155
|
├── sync/ # Folder sync engine
|
|
151
156
|
├── telegram/ # Bot API client
|
|
152
157
|
└── utils/ # Compression, chunking
|
|
153
158
|
```
|
|
154
159
|
|
|
155
|
-
## License
|
|
160
|
+
## 📄 License
|
|
156
161
|
|
|
157
|
-
MIT
|
|
162
|
+
MIT — do whatever you want with it.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nightowne/tas-cli",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "2.1.0",
|
|
4
|
+
"description": "Telegram as Storage - Automated encrypted cloud backup. Free, encrypted, scriptable. Mount as folder or use with cron/Docker.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
7
7
|
"bin": {
|
|
@@ -54,4 +54,4 @@
|
|
|
54
54
|
"engines": {
|
|
55
55
|
"node": ">=18.0.0"
|
|
56
56
|
}
|
|
57
|
-
}
|
|
57
|
+
}
|