ssh-docs 0.1.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,392 @@
1
+ Metadata-Version: 2.4
2
+ Name: ssh-docs
3
+ Version: 0.1.0
4
+ Summary: Expose documentation via SSH - browse docs using familiar Unix commands
5
+ Author: SSH-Docs Contributors
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/ssh-docs/ssh-docs
8
+ Project-URL: Documentation, https://github.com/ssh-docs/ssh-docs#readme
9
+ Project-URL: Repository, https://github.com/ssh-docs/ssh-docs
10
+ Project-URL: Issues, https://github.com/ssh-docs/ssh-docs/issues
11
+ Keywords: ssh,documentation,docs,server,cli
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
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: Topic :: Software Development :: Documentation
22
+ Classifier: Topic :: System :: Shells
23
+ Requires-Python: >=3.8
24
+ Description-Content-Type: text/markdown
25
+ Requires-Dist: asyncssh>=2.13.0
26
+ Requires-Dist: click>=8.0.0
27
+ Requires-Dist: pyyaml>=6.0
28
+ Provides-Extra: dev
29
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
30
+ Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
31
+ Requires-Dist: black>=23.0.0; extra == "dev"
32
+ Requires-Dist: mypy>=1.0.0; extra == "dev"
33
+
34
+ # SSH-Docs
35
+
36
+ **Expose documentation via SSH** - Browse your documentation using familiar Unix commands over SSH.
37
+
38
+ ## Features
39
+
40
+ - 🔒 **Secure SSH Access** - Standard SSH protocol with authentication options
41
+ - 📁 **Read-Only Browsing** - Safe exploration of documentation files
42
+ - 🛠️ **Unix Commands** - Familiar commands: `ls`, `cd`, `cat`, `grep`, `find`, `head`, `tail`
43
+ - ⚙️ **Zero Config** - Works out of the box with sensible defaults
44
+ - 🎨 **Customizable** - Optional YAML configuration for advanced setups
45
+ - 🚀 **Easy Setup** - Single command to start serving docs
46
+
47
+ ## Installation
48
+
49
+ ```bash
50
+ pip install ssh-docs
51
+ ```
52
+
53
+ ## Quick Start
54
+
55
+ ### Serve Documentation (Zero Config)
56
+
57
+ ```bash
58
+ # Serve current directory
59
+ ssh-docs serve
60
+
61
+ # Serve specific directory
62
+ ssh-docs serve ./docs
63
+
64
+ # Custom port
65
+ ssh-docs serve ./docs -p 3000
66
+ ```
67
+
68
+ Then connect:
69
+
70
+ ```bash
71
+ ssh localhost -p 2222
72
+ ```
73
+
74
+ ### Basic Commands
75
+
76
+ Once connected, use familiar Unix commands:
77
+
78
+ ```bash
79
+ /site$ ls # List files
80
+ /site$ cd docs # Change directory
81
+ /site$ cat README.md # View file
82
+ /site$ grep "API" -R . # Search content
83
+ /site$ find . -name "*.md" # Find files
84
+ /site$ head -n 20 file.txt # First 20 lines
85
+ /site$ tail -n 10 file.txt # Last 10 lines
86
+ /site$ pwd # Current directory
87
+ /site$ help # Show commands
88
+ /site$ exit # Close session
89
+ ```
90
+
91
+ ## Configuration
92
+
93
+ ### Initialize Config File
94
+
95
+ ```bash
96
+ # Create .ssh-docs.yml with defaults
97
+ ssh-docs init
98
+
99
+ # Interactive setup
100
+ ssh-docs init --interactive
101
+ ```
102
+
103
+ ### Configuration File (.ssh-docs.yml)
104
+
105
+ ```yaml
106
+ # Basic settings
107
+ site_name: "My Project Documentation"
108
+ content_root: "./docs"
109
+ port: 2222
110
+ host: "0.0.0.0"
111
+
112
+ # Authentication
113
+ auth:
114
+ type: "public" # Options: public, key, password
115
+ # For key-based auth:
116
+ # authorized_keys: "~/.ssh/authorized_keys"
117
+ # For password auth:
118
+ # password: "${SSH_DOCS_PASSWORD}"
119
+
120
+ # Server settings
121
+ server:
122
+ banner: |
123
+ Welcome to {site_name} Documentation
124
+ Type 'help' for available commands
125
+ max_connections: 10
126
+ timeout: 300
127
+ log_level: "info"
128
+
129
+ # Ignore patterns
130
+ ignore:
131
+ - "*.pyc"
132
+ - "__pycache__"
133
+ - ".git"
134
+ - "node_modules"
135
+ ```
136
+
137
+ ## Authentication
138
+
139
+ ### Public Access (Default)
140
+
141
+ No authentication required - anyone can connect:
142
+
143
+ ```bash
144
+ ssh-docs serve ./docs
145
+ ```
146
+
147
+ ### Password Authentication
148
+
149
+ ```bash
150
+ ssh-docs serve ./docs --auth password --password secret123
151
+ ```
152
+
153
+ Or use environment variable:
154
+
155
+ ```bash
156
+ export SSH_DOCS_PASSWORD="secret123"
157
+ ssh-docs serve ./docs --auth password
158
+ ```
159
+
160
+ ### Key-Based Authentication
161
+
162
+ ```bash
163
+ ssh-docs serve ./docs --auth key --keys-file ~/.ssh/authorized_keys
164
+ ```
165
+
166
+ ## Advanced Usage
167
+
168
+ ### Generate Host Keys
169
+
170
+ ```bash
171
+ # Generate keys in default location
172
+ ssh-docs keygen
173
+
174
+ # Custom location
175
+ ssh-docs keygen --output-dir ./keys
176
+ ```
177
+
178
+ ### Validate Configuration
179
+
180
+ ```bash
181
+ # Validate default config
182
+ ssh-docs validate
183
+
184
+ # Validate specific config
185
+ ssh-docs validate custom-config.yml
186
+ ```
187
+
188
+ ### Using Config File
189
+
190
+ ```bash
191
+ # Use default .ssh-docs.yml
192
+ ssh-docs serve
193
+
194
+ # Use custom config
195
+ ssh-docs serve --config production.yml
196
+
197
+ # Ignore config file
198
+ ssh-docs serve --no-config
199
+ ```
200
+
201
+ ## CLI Reference
202
+
203
+ ### `ssh-docs serve`
204
+
205
+ Start SSH documentation server.
206
+
207
+ **Options:**
208
+ - `CONTENT_DIR` - Directory to serve (default: auto-detect)
209
+ - `-p, --port` - Port to listen on (default: 2222)
210
+ - `-n, --site-name` - Site name for banner (default: auto-detect)
211
+ - `-c, --config` - Config file path (default: .ssh-docs.yml)
212
+ - `--host` - Host to bind to (default: 0.0.0.0)
213
+ - `--auth` - Auth type: public, key, password (default: public)
214
+ - `--keys-file` - Authorized keys file (for key auth)
215
+ - `--password` - Password (for password auth)
216
+ - `--no-config` - Ignore config file
217
+ - `--log-level` - Log level: debug, info, warn, error
218
+
219
+ **Examples:**
220
+
221
+ ```bash
222
+ # Basic usage
223
+ ssh-docs serve ./docs
224
+
225
+ # Custom port and name
226
+ ssh-docs serve ./docs -p 3000 -n "My API Docs"
227
+
228
+ # Password auth
229
+ ssh-docs serve --auth password --password secret123
230
+
231
+ # Use config file
232
+ ssh-docs serve --config production.yml
233
+ ```
234
+
235
+ ### `ssh-docs init`
236
+
237
+ Initialize configuration file.
238
+
239
+ **Options:**
240
+ - `--interactive` - Interactive setup wizard
241
+ - `--template` - Template: basic, advanced
242
+
243
+ **Examples:**
244
+
245
+ ```bash
246
+ # Create basic config
247
+ ssh-docs init
248
+
249
+ # Interactive setup
250
+ ssh-docs init --interactive
251
+ ```
252
+
253
+ ### `ssh-docs validate`
254
+
255
+ Validate configuration file.
256
+
257
+ **Examples:**
258
+
259
+ ```bash
260
+ # Validate default config
261
+ ssh-docs validate
262
+
263
+ # Validate specific config
264
+ ssh-docs validate custom-config.yml
265
+ ```
266
+
267
+ ### `ssh-docs keygen`
268
+
269
+ Generate SSH host keys.
270
+
271
+ **Options:**
272
+ - `--output-dir` - Where to save keys (default: ~/.ssh-docs/keys)
273
+ - `--force` - Overwrite existing keys
274
+
275
+ **Examples:**
276
+
277
+ ```bash
278
+ # Generate in default location
279
+ ssh-docs keygen
280
+
281
+ # Custom location
282
+ ssh-docs keygen --output-dir ./keys
283
+ ```
284
+
285
+ ## Use Cases
286
+
287
+ ### Local Development
288
+
289
+ ```bash
290
+ # Serve docs while developing
291
+ cd my-project
292
+ ssh-docs serve ./docs
293
+ ```
294
+
295
+ ### CI/CD Integration
296
+
297
+ ```bash
298
+ # In Dockerfile or CI script
299
+ pip install ssh-docs
300
+ ssh-docs serve /app/docs --port 2222 &
301
+ ```
302
+
303
+ ### Production Deployment
304
+
305
+ ```yaml
306
+ # docker-compose.yml
307
+ services:
308
+ docs:
309
+ image: python:3.11
310
+ command: sh -c "pip install ssh-docs && ssh-docs serve /docs"
311
+ ports:
312
+ - "2222:2222"
313
+ volumes:
314
+ - ./docs:/docs:ro
315
+ ```
316
+
317
+ ### Documentation Server
318
+
319
+ ```bash
320
+ # Production setup with auth
321
+ ssh-docs init --interactive
322
+ ssh-docs keygen
323
+ ssh-docs serve --auth key --keys-file ~/.ssh/authorized_keys
324
+ ```
325
+
326
+ ## Security Considerations
327
+
328
+ - **Read-Only**: All operations are read-only by default
329
+ - **Path Traversal Protection**: Prevents access outside content root
330
+ - **Authentication**: Supports password and key-based auth
331
+ - **Connection Limits**: Configurable max connections
332
+ - **Timeouts**: Automatic session timeouts
333
+
334
+ ## Auto-Detection
335
+
336
+ SSH-Docs automatically detects:
337
+
338
+ - **Content Directory**: Looks for `docs/`, `documentation/`, `public/`, `dist/`
339
+ - **Site Name**: Reads from `package.json`, `pyproject.toml`, or directory name
340
+ - **Host Keys**: Generates if not present
341
+
342
+ ## Requirements
343
+
344
+ - Python 3.8+
345
+ - asyncssh
346
+ - click
347
+ - pyyaml (optional, for config files)
348
+
349
+ ## Development
350
+
351
+ ```bash
352
+ # Clone repository
353
+ git clone https://github.com/ssh-docs/ssh-docs.git
354
+ cd ssh-docs
355
+
356
+ # Install in development mode
357
+ pip install -e .
358
+
359
+ # Run tests
360
+ pytest
361
+
362
+ # Run locally
363
+ python -m ssh_docs serve ./demo-website
364
+ ```
365
+
366
+ ## License
367
+
368
+ MIT License - see LICENSE file for details.
369
+
370
+ ## Contributing
371
+
372
+ Contributions welcome! Please open an issue or submit a pull request.
373
+
374
+ ## Support
375
+
376
+ - GitHub Issues: https://github.com/ssh-docs/ssh-docs/issues
377
+ - Documentation: https://github.com/ssh-docs/ssh-docs#readme
378
+
379
+ ## Roadmap
380
+
381
+ - [ ] Syntax highlighting for code files
382
+ - [ ] Search index for faster grep
383
+ - [ ] Custom command plugins
384
+ - [ ] Docker image
385
+ - [ ] NPM package wrapper
386
+ - [ ] Web-based terminal viewer
387
+ - [ ] Session recording/replay
388
+ - [ ] Multi-user support with permissions
389
+
390
+ ---
391
+
392
+ **Made with ❤️ for developers who love the terminal**