homehost 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.
Files changed (87) hide show
  1. homehost-0.1.0/.github/ISSUE_TEMPLATE/bug_report.md +36 -0
  2. homehost-0.1.0/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
  3. homehost-0.1.0/.github/PULL_REQUEST_TEMPLATE.md +46 -0
  4. homehost-0.1.0/.github/workflows/ci.yml +63 -0
  5. homehost-0.1.0/.gitignore +100 -0
  6. homehost-0.1.0/CHANGELOG.md +123 -0
  7. homehost-0.1.0/CONTRIBUTING.md +432 -0
  8. homehost-0.1.0/LICENSE +21 -0
  9. homehost-0.1.0/PKG-INFO +414 -0
  10. homehost-0.1.0/README.md +340 -0
  11. homehost-0.1.0/docs/architecture.md +292 -0
  12. homehost-0.1.0/docs/quickstart.md +358 -0
  13. homehost-0.1.0/docs/security.md +219 -0
  14. homehost-0.1.0/docs/troubleshooting.md +495 -0
  15. homehost-0.1.0/homehost/__init__.py +5 -0
  16. homehost-0.1.0/homehost/__main__.py +6 -0
  17. homehost-0.1.0/homehost/cli.py +1036 -0
  18. homehost-0.1.0/homehost/core/__init__.py +0 -0
  19. homehost-0.1.0/homehost/core/config.py +320 -0
  20. homehost-0.1.0/homehost/core/detector.py +374 -0
  21. homehost-0.1.0/homehost/core/process.py +345 -0
  22. homehost-0.1.0/homehost/core/project.py +258 -0
  23. homehost-0.1.0/homehost/core/server.py +285 -0
  24. homehost-0.1.0/homehost/dashboard/__init__.py +5 -0
  25. homehost-0.1.0/homehost/dashboard/api.py +461 -0
  26. homehost-0.1.0/homehost/dashboard/server.py +157 -0
  27. homehost-0.1.0/homehost/dashboard/static/app.js +736 -0
  28. homehost-0.1.0/homehost/dashboard/static/index.html +864 -0
  29. homehost-0.1.0/homehost/dashboard/static/styles.css +404 -0
  30. homehost-0.1.0/homehost/deploy/__init__.py +33 -0
  31. homehost-0.1.0/homehost/deploy/git.py +106 -0
  32. homehost-0.1.0/homehost/deploy/scaffold.py +133 -0
  33. homehost-0.1.0/homehost/deploy/watcher.py +216 -0
  34. homehost-0.1.0/homehost/network/__init__.py +50 -0
  35. homehost-0.1.0/homehost/network/dns.py +235 -0
  36. homehost-0.1.0/homehost/network/firewall.py +518 -0
  37. homehost-0.1.0/homehost/network/local.py +301 -0
  38. homehost-0.1.0/homehost/network/ssl.py +187 -0
  39. homehost-0.1.0/homehost/network/tunnel.py +311 -0
  40. homehost-0.1.0/homehost/security/__init__.py +0 -0
  41. homehost-0.1.0/homehost/security/audit.py +571 -0
  42. homehost-0.1.0/homehost/security/hardening.py +398 -0
  43. homehost-0.1.0/homehost/security/secrets.py +400 -0
  44. homehost-0.1.0/homehost/servers/__init__.py +0 -0
  45. homehost-0.1.0/homehost/servers/caddy.py +391 -0
  46. homehost-0.1.0/homehost/servers/installer.py +495 -0
  47. homehost-0.1.0/homehost/servers/reverse_proxy.py +504 -0
  48. homehost-0.1.0/homehost/servers/static.py +288 -0
  49. homehost-0.1.0/homehost/tui/__init__.py +7 -0
  50. homehost-0.1.0/homehost/tui/app.py +234 -0
  51. homehost-0.1.0/homehost/tui/screens/__init__.py +17 -0
  52. homehost-0.1.0/homehost/tui/screens/manage.py +545 -0
  53. homehost-0.1.0/homehost/tui/screens/setup.py +688 -0
  54. homehost-0.1.0/homehost/tui/screens/status.py +289 -0
  55. homehost-0.1.0/homehost/tui/screens/uninstall.py +334 -0
  56. homehost-0.1.0/homehost/tui/screens/welcome.py +317 -0
  57. homehost-0.1.0/homehost/tui/widgets/__init__.py +13 -0
  58. homehost-0.1.0/homehost/tui/widgets/log_viewer.py +230 -0
  59. homehost-0.1.0/homehost/tui/widgets/server_card.py +311 -0
  60. homehost-0.1.0/homehost/tui/widgets/url_display.py +242 -0
  61. homehost-0.1.0/homehost/utils/__init__.py +71 -0
  62. homehost-0.1.0/homehost/utils/logger.py +161 -0
  63. homehost-0.1.0/homehost/utils/network.py +207 -0
  64. homehost-0.1.0/homehost/utils/platform.py +255 -0
  65. homehost-0.1.0/homehost/utils/updater.py +130 -0
  66. homehost-0.1.0/pyproject.toml +115 -0
  67. homehost-0.1.0/scripts/install_caddy_mac.sh +224 -0
  68. homehost-0.1.0/scripts/install_caddy_win.ps1 +282 -0
  69. homehost-0.1.0/scripts/release.py +457 -0
  70. homehost-0.1.0/templates/fastapi-app/main.py +227 -0
  71. homehost-0.1.0/templates/fastapi-app/requirements.txt +2 -0
  72. homehost-0.1.0/templates/flask-app/app.py +36 -0
  73. homehost-0.1.0/templates/flask-app/requirements.txt +2 -0
  74. homehost-0.1.0/templates/flask-app/templates/index.html +260 -0
  75. homehost-0.1.0/templates/static-html/index.html +168 -0
  76. homehost-0.1.0/templates/static-html/script.js +139 -0
  77. homehost-0.1.0/templates/static-html/styles.css +548 -0
  78. homehost-0.1.0/tests/__init__.py +0 -0
  79. homehost-0.1.0/tests/conftest.py +77 -0
  80. homehost-0.1.0/tests/e2e/__init__.py +0 -0
  81. homehost-0.1.0/tests/integration/__init__.py +0 -0
  82. homehost-0.1.0/tests/unit/__init__.py +0 -0
  83. homehost-0.1.0/tests/unit/test_config.py +282 -0
  84. homehost-0.1.0/tests/unit/test_detector.py +296 -0
  85. homehost-0.1.0/tests/unit/test_network_utils.py +215 -0
  86. homehost-0.1.0/tests/unit/test_project_detection.py +263 -0
  87. homehost-0.1.0/tests/unit/test_security.py +253 -0
@@ -0,0 +1,36 @@
1
+ ---
2
+ name: Bug report
3
+ about: Something isn't working
4
+ labels: bug
5
+ ---
6
+
7
+ **Describe the bug**
8
+ A clear and concise description of what the bug is.
9
+
10
+ **To reproduce**
11
+ Steps to reproduce the behavior:
12
+ 1. Run `homehost ...`
13
+ 2. See error
14
+
15
+ **Expected behavior**
16
+ A clear and concise description of what you expected to happen.
17
+
18
+ **Actual behavior**
19
+ What actually happened. Include the full error message / stack trace if there is one.
20
+
21
+ **System info**
22
+ Run `homehost doctor` and paste the output here.
23
+
24
+ ```
25
+ # paste output here
26
+ ```
27
+
28
+ **HomeHost version**
29
+ Run `homehost --version` and paste here.
30
+
31
+ ```
32
+ # paste output here
33
+ ```
34
+
35
+ **Additional context**
36
+ Add any other context about the problem here (e.g. project type, OS quirks, recent system changes).
@@ -0,0 +1,20 @@
1
+ ---
2
+ name: Feature request
3
+ about: Suggest an idea for HomeHost
4
+ labels: enhancement
5
+ ---
6
+
7
+ **Is your feature request related to a problem? Please describe.**
8
+ A clear and concise description of what the problem is. Example: "I'm always frustrated when..."
9
+
10
+ **Describe the solution you'd like**
11
+ A clear and concise description of what you want to happen.
12
+
13
+ **Describe alternatives you've considered**
14
+ A clear and concise description of any alternative solutions or features you've considered.
15
+
16
+ **Who would benefit from this feature?**
17
+ Describe the target audience (e.g. "developers hosting Flask apps", "non-technical users", etc.).
18
+
19
+ **Additional context**
20
+ Add any other context, mockups, or screenshots about the feature request here.
@@ -0,0 +1,46 @@
1
+ ## Summary
2
+
3
+ <!-- What does this PR do? Bullet-point the key changes. -->
4
+
5
+ -
6
+ -
7
+
8
+ ## Motivation
9
+
10
+ <!-- Why is this change needed? Link related issues with "Fixes #123" or "Closes #123". -->
11
+
12
+ ## Type of change
13
+
14
+ <!-- Check all that apply -->
15
+
16
+ - [ ] Bug fix (non-breaking change that fixes an issue)
17
+ - [ ] New feature (non-breaking change that adds functionality)
18
+ - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
19
+ - [ ] Refactor / code quality improvement
20
+ - [ ] Documentation update
21
+ - [ ] CI / tooling change
22
+
23
+ ## Test plan
24
+
25
+ <!-- How did you verify this works? Check all completed items. -->
26
+
27
+ - [ ] Added / updated unit tests in `tests/unit/`
28
+ - [ ] All existing tests pass (`pytest tests/unit/ -v`)
29
+ - [ ] Manually tested on macOS
30
+ - [ ] Manually tested on Windows (if applicable)
31
+ - [ ] Ran `homehost doctor` and confirmed no regressions
32
+ - [ ] Linting passes (`ruff check homehost/`)
33
+ - [ ] Type checks pass (`mypy homehost/ --ignore-missing-imports`)
34
+ - [ ] Formatting is correct (`black --check homehost/ tests/`)
35
+
36
+ ## Screenshots / output
37
+
38
+ <!-- For UI or CLI changes, paste terminal output or attach screenshots. -->
39
+
40
+ ## Checklist
41
+
42
+ - [ ] My code follows the project's style guidelines
43
+ - [ ] I have added docstrings to new public functions / classes
44
+ - [ ] I have updated `CHANGELOG.md` if this is a user-facing change
45
+ - [ ] Secrets and credentials are NOT hard-coded anywhere in my changes
46
+ - [ ] I have read the [CONTRIBUTING](../CONTRIBUTING.md) guide (if it exists)
@@ -0,0 +1,63 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main, "feature/**"]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ test:
11
+ name: Test Python ${{ matrix.python-version }} on ${{ matrix.os }}
12
+ runs-on: ${{ matrix.os }}
13
+ strategy:
14
+ fail-fast: false
15
+ matrix:
16
+ os: [macos-latest, windows-latest]
17
+ python-version: ["3.10", "3.11", "3.12"]
18
+
19
+ steps:
20
+ - uses: actions/checkout@v4
21
+
22
+ - uses: actions/setup-python@v5
23
+ with:
24
+ python-version: ${{ matrix.python-version }}
25
+ cache: pip
26
+
27
+ - name: Install dependencies
28
+ run: pip install -e ".[dev]"
29
+
30
+ - name: Lint (ruff)
31
+ run: ruff check homehost/
32
+
33
+ - name: Type check (mypy)
34
+ run: mypy homehost/ --ignore-missing-imports
35
+
36
+ - name: Format check (black)
37
+ run: black --check homehost/ tests/
38
+
39
+ - name: Run tests
40
+ run: pytest tests/unit/ -v --cov=homehost --cov-report=xml
41
+
42
+ - name: Upload coverage
43
+ uses: codecov/codecov-action@v4
44
+ with:
45
+ file: ./coverage.xml
46
+ fail_ci_if_error: false
47
+
48
+ lint-only:
49
+ name: Lint & Format
50
+ runs-on: ubuntu-latest
51
+ steps:
52
+ - uses: actions/checkout@v4
53
+
54
+ - uses: actions/setup-python@v5
55
+ with:
56
+ python-version: "3.12"
57
+ cache: pip
58
+
59
+ - run: pip install ruff black mypy
60
+
61
+ - run: ruff check homehost/
62
+
63
+ - run: black --check homehost/ tests/
@@ -0,0 +1,100 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ .Python
7
+ build/
8
+ develop-eggs/
9
+ dist/
10
+ downloads/
11
+ eggs/
12
+ .eggs/
13
+ lib/
14
+ lib64/
15
+ parts/
16
+ sdist/
17
+ var/
18
+ wheels/
19
+ share/python-wheels/
20
+ *.egg-info/
21
+ .installed.cfg
22
+ *.egg
23
+ MANIFEST
24
+ *.pyo
25
+ .venv/
26
+ venv/
27
+ ENV/
28
+ env.bak/
29
+ venv.bak/
30
+ .python-version
31
+
32
+ # Testing
33
+ .tox/
34
+ .nox/
35
+ .cache
36
+ .pytest_cache/
37
+ .coverage
38
+ .coverage.*
39
+ coverage.xml
40
+ htmlcov/
41
+ .hypothesis/
42
+
43
+ # Type checking
44
+ .mypy_cache/
45
+ .dmypy.json
46
+ dmypy.json
47
+ .pyre/
48
+ .pytype/
49
+
50
+ # IDE
51
+ .idea/
52
+ .vscode/
53
+ *.swp
54
+ *.swo
55
+ *~
56
+ .DS_Store
57
+ Thumbs.db
58
+
59
+ # HomeHost runtime data
60
+ .homehost/
61
+ caddy_data/
62
+ cloudflared_config/
63
+
64
+ # Caddy
65
+ Caddyfile.local
66
+ caddy.log
67
+
68
+ # Secrets and environment
69
+ .env
70
+ .env.*
71
+ *.key
72
+ *.pem
73
+ *.cert
74
+ *.csr
75
+
76
+ # Logs
77
+ *.log
78
+ logs/
79
+
80
+ # Node.js (for template testing)
81
+ node_modules/
82
+ .npm
83
+ .yarn/
84
+ .pnp.*
85
+
86
+ # Build artifacts
87
+ dist/
88
+ build/
89
+ out/
90
+ .next/
91
+ .nuxt/
92
+
93
+ # OS
94
+ .DS_Store
95
+ .DS_Store?
96
+ ._*
97
+ .Spotlight-V100
98
+ .Trashes
99
+ ehthumbs.db
100
+ desktop.ini
@@ -0,0 +1,123 @@
1
+ # Changelog
2
+
3
+ All notable changes to HomeHost are documented in this file.
4
+
5
+ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [0.1.0] - 2026-05-30
11
+
12
+ ### Added
13
+
14
+ #### Core
15
+ - Initial public release of HomeHost
16
+ - `homehost serve <path>` — serve any project from a local directory
17
+ - `homehost setup` — interactive first-time setup wizard that installs Caddy and cloudflared
18
+ - `homehost doctor` — diagnostic tool that checks the full installation and environment
19
+ - `homehost new <template> <name>` — scaffold new projects from built-in starter templates
20
+ - `homehost list` — list all currently running HomeHost projects
21
+ - `homehost stop <name>` / `homehost stop --all` — stop one or all running projects
22
+ - `homehost logs <name>` — stream live logs for a running project
23
+ - `homehost config` — open the global config file in your default editor
24
+ - `homehost update` — self-update HomeHost and managed binaries
25
+ - `homehost version` — print version and dependency information
26
+
27
+ #### Project Auto-detection
28
+ - Automatic project type detection from directory contents (no config required)
29
+ - Support for Static HTML/CSS/JS sites
30
+ - Support for React apps (Create React App and Vite)
31
+ - Support for Next.js apps (Pages Router and App Router)
32
+ - Support for Express / generic Node.js servers
33
+ - Support for Flask apps
34
+ - Support for FastAPI apps
35
+ - Support for Django apps
36
+ - Support for generic Python apps (`main.py` / `app.py`)
37
+ - Manual override via `homehost.toml` in project root
38
+
39
+ #### Web Server
40
+ - Caddy-based web serving with automatic binary management
41
+ - Static file serving with directory listings disabled by default
42
+ - Reverse proxy mode for app servers
43
+ - Automatic Caddy installation on first run (macOS and Windows)
44
+ - Automatic Caddy restart on configuration changes
45
+
46
+ #### Public Tunneling
47
+ - Cloudflare Tunnel integration via `cloudflared` for public HTTPS access
48
+ - Automatic `cloudflared` binary installation on first run
49
+ - Random subdomain generation (`https://<adjective>-<animal>-<n>.trycloudflare.com`)
50
+ - Toggle tunnel on/off at runtime from TUI or web dashboard
51
+ - Public URL displayed prominently in TUI with QR code
52
+
53
+ #### TUI Dashboard (Terminal UI)
54
+ - Textual-based full-screen TUI with real-time updates
55
+ - Live log streaming from Caddy, app server, and cloudflared
56
+ - Color-coded request log with method, path, status, and latency
57
+ - Project status bar (running / stopped / error)
58
+ - Keyboard shortcuts: `t` to toggle tunnel, `r` to restart, `q` to quit, `l` to clear logs
59
+ - QR code display for instant mobile access to the public URL
60
+ - Multi-project tab view when multiple projects are running
61
+
62
+ #### Web Dashboard
63
+ - FastAPI-backed dashboard at `http://localhost:9111`
64
+ - Request log with filtering by status code, method, and path
65
+ - Live traffic graph (requests per minute)
66
+ - Project configuration viewer and editor
67
+ - One-click tunnel toggle
68
+ - Process health status for Caddy, app server, and cloudflared
69
+ - Log download as plain text
70
+
71
+ #### File Watcher / Auto-reload
72
+ - `watchdog`-based file watcher for all project types
73
+ - Debounced restarts to avoid churn during rapid file saves
74
+ - Configurable watch paths and ignore patterns per project
75
+ - Visual indicator in TUI when a reload is triggered
76
+
77
+ #### Security
78
+ - Automatic security headers on all responses:
79
+ - `Content-Security-Policy` (default-src 'self')
80
+ - `Strict-Transport-Security` (max-age=31536000; includeSubDomains)
81
+ - `X-Frame-Options: DENY`
82
+ - `X-Content-Type-Options: nosniff`
83
+ - `Referrer-Policy: strict-origin-when-cross-origin`
84
+ - `Permissions-Policy` (camera=(), microphone=(), geolocation=())
85
+ - Rate limiting at 300 requests per minute per IP (configurable)
86
+ - Optional HTTP Basic Auth (`homehost serve . --auth`)
87
+ - bcrypt password hashing for stored credentials
88
+ - No direct IP exposure (traffic routed through Cloudflare Tunnel)
89
+
90
+ #### Configuration
91
+ - Global config at `~/.homehost/config.toml` (auto-created on first run)
92
+ - Per-project config via `homehost.toml` in project directory
93
+ - Environment variable support via `--env-file` flag (defaults to `.env`)
94
+ - All defaults sensible out of the box — config is optional
95
+
96
+ #### Multi-project Support
97
+ - Run multiple projects simultaneously on different ports
98
+ - Each project gets its own Caddy process and optional tunnel
99
+ - Unified TUI with tab navigation between projects
100
+ - Web dashboard shows all projects in a sidebar
101
+
102
+ #### Starter Templates
103
+ - `static` — HTML/CSS/JS starter with responsive layout and modern CSS reset
104
+ - `flask` — Flask app with SQLite, Jinja2 templates, and `.env` support
105
+ - `fastapi` — FastAPI app with Pydantic models, auto-docs, and async routes
106
+ - `nextjs` — Next.js 14 App Router starter with TypeScript and Tailwind CSS
107
+ - `react` — React 18 + Vite starter with TypeScript
108
+
109
+ #### Platform Support
110
+ - macOS 12 (Monterey) and later
111
+ - Windows 10 and Windows 11
112
+ - Python 3.10, 3.11, and 3.12
113
+
114
+ #### Developer Experience
115
+ - Structured logging via `structlog`
116
+ - Log files written to `~/.homehost/logs/`
117
+ - Descriptive error codes (HH-1xx through HH-5xx) for all failure modes
118
+ - `homehost doctor` outputs a shareable diagnostic report
119
+
120
+ ---
121
+
122
+ [Unreleased]: https://github.com/homehost-dev/homehost/compare/v0.1.0...HEAD
123
+ [0.1.0]: https://github.com/homehost-dev/homehost/releases/tag/v0.1.0