webgate 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 (67) hide show
  1. webgate-0.1.0/.dockerignore +18 -0
  2. webgate-0.1.0/.github/workflows/docs.yml +33 -0
  3. webgate-0.1.0/.gitignore +39 -0
  4. webgate-0.1.0/CHANGELOG.md +27 -0
  5. webgate-0.1.0/Dockerfile +39 -0
  6. webgate-0.1.0/Dockerfile.ssh-demo +29 -0
  7. webgate-0.1.0/LICENSE +21 -0
  8. webgate-0.1.0/PKG-INFO +557 -0
  9. webgate-0.1.0/README.md +513 -0
  10. webgate-0.1.0/VERSION +1 -0
  11. webgate-0.1.0/compose.dev.yml +24 -0
  12. webgate-0.1.0/compose.yml +15 -0
  13. webgate-0.1.0/docs/api/auth.md +106 -0
  14. webgate-0.1.0/docs/api/files.md +104 -0
  15. webgate-0.1.0/docs/api/servers.md +87 -0
  16. webgate-0.1.0/docs/api/terminal.md +59 -0
  17. webgate-0.1.0/docs/changelog.md +27 -0
  18. webgate-0.1.0/docs/getting-started/installation.md +81 -0
  19. webgate-0.1.0/docs/getting-started/quickstart.md +65 -0
  20. webgate-0.1.0/docs/guide/files.md +54 -0
  21. webgate-0.1.0/docs/guide/servers.md +67 -0
  22. webgate-0.1.0/docs/guide/split.md +26 -0
  23. webgate-0.1.0/docs/guide/terminal.md +29 -0
  24. webgate-0.1.0/docs/guide/users.md +63 -0
  25. webgate-0.1.0/docs/index.md +63 -0
  26. webgate-0.1.0/docs/screenshots/editor.png +0 -0
  27. webgate-0.1.0/docs/screenshots/login.png +0 -0
  28. webgate-0.1.0/docs/screenshots/sftp.png +0 -0
  29. webgate-0.1.0/docs/screenshots/site-manager.png +0 -0
  30. webgate-0.1.0/docs/screenshots/terminal.png +0 -0
  31. webgate-0.1.0/mkdocs.yml +76 -0
  32. webgate-0.1.0/pyproject.toml +89 -0
  33. webgate-0.1.0/src/webgate/__init__.py +1 -0
  34. webgate-0.1.0/src/webgate/__main__.py +18 -0
  35. webgate-0.1.0/src/webgate/app.py +58 -0
  36. webgate-0.1.0/src/webgate/audit/__init__.py +0 -0
  37. webgate-0.1.0/src/webgate/audit/models.py +31 -0
  38. webgate-0.1.0/src/webgate/audit/service.py +44 -0
  39. webgate-0.1.0/src/webgate/auth/__init__.py +0 -0
  40. webgate-0.1.0/src/webgate/auth/models.py +70 -0
  41. webgate-0.1.0/src/webgate/auth/routes.py +175 -0
  42. webgate-0.1.0/src/webgate/auth/service.py +115 -0
  43. webgate-0.1.0/src/webgate/config.py +28 -0
  44. webgate-0.1.0/src/webgate/db/__init__.py +0 -0
  45. webgate-0.1.0/src/webgate/db/engine.py +36 -0
  46. webgate-0.1.0/src/webgate/files/__init__.py +0 -0
  47. webgate-0.1.0/src/webgate/files/models.py +36 -0
  48. webgate-0.1.0/src/webgate/files/pool.py +139 -0
  49. webgate-0.1.0/src/webgate/files/routes.py +192 -0
  50. webgate-0.1.0/src/webgate/files/sftp_service.py +186 -0
  51. webgate-0.1.0/src/webgate/servers/__init__.py +0 -0
  52. webgate-0.1.0/src/webgate/servers/crypto.py +27 -0
  53. webgate-0.1.0/src/webgate/servers/models.py +72 -0
  54. webgate-0.1.0/src/webgate/servers/routes.py +129 -0
  55. webgate-0.1.0/src/webgate/servers/service.py +201 -0
  56. webgate-0.1.0/src/webgate/static/index.html +1090 -0
  57. webgate-0.1.0/src/webgate/terminal/__init__.py +0 -0
  58. webgate-0.1.0/src/webgate/terminal/routes.py +110 -0
  59. webgate-0.1.0/src/webgate/terminal/ssh_session.py +83 -0
  60. webgate-0.1.0/src/webgate/terminal/ws_handler.py +90 -0
  61. webgate-0.1.0/tests/__init__.py +0 -0
  62. webgate-0.1.0/tests/conftest.py +68 -0
  63. webgate-0.1.0/tests/test_auth.py +77 -0
  64. webgate-0.1.0/tests/test_files.py +45 -0
  65. webgate-0.1.0/tests/test_servers.py +140 -0
  66. webgate-0.1.0/tests/test_terminal.py +60 -0
  67. webgate-0.1.0/uv.lock +1874 -0
@@ -0,0 +1,18 @@
1
+ .git
2
+ .venv
3
+ __pycache__
4
+ *.pyc
5
+ tests/
6
+ .pytest_cache/
7
+ .ruff_cache/
8
+ .mypy_cache/
9
+ *.egg-info
10
+ dist/
11
+ build/
12
+ CLAUDE.md
13
+ CLAUDE.local.md
14
+ .env
15
+ docs/
16
+ README.md
17
+ *.png
18
+ .playwright-cli/
@@ -0,0 +1,33 @@
1
+ name: Deploy docs
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+
7
+ permissions:
8
+ contents: read
9
+ pages: write
10
+ id-token: write
11
+
12
+ concurrency:
13
+ group: pages
14
+ cancel-in-progress: true
15
+
16
+ jobs:
17
+ deploy:
18
+ environment:
19
+ name: github-pages
20
+ url: ${{ steps.deployment.outputs.page_url }}
21
+ runs-on: ubuntu-latest
22
+ steps:
23
+ - uses: actions/checkout@v4
24
+ - uses: actions/setup-python@v5
25
+ with:
26
+ python-version: "3.13"
27
+ - run: pip install mkdocs-material mkdocstrings mkdocstrings-python
28
+ - run: mkdocs build --strict
29
+ - uses: actions/upload-pages-artifact@v3
30
+ with:
31
+ path: site
32
+ - uses: actions/deploy-pages@v4
33
+ id: deployment
@@ -0,0 +1,39 @@
1
+ # Python
2
+ __pycache__/
3
+ *.pyc
4
+ *.pyo
5
+ *.egg-info/
6
+ dist/
7
+ build/
8
+ .venv/
9
+
10
+ # IDE
11
+ .idea/
12
+ .vscode/
13
+ *.swp
14
+ *.swo
15
+
16
+ # Testing
17
+ .pytest_cache/
18
+ .ruff_cache/
19
+ .mypy_cache/
20
+ .coverage
21
+ htmlcov/
22
+
23
+ # Environment
24
+ .env
25
+ .env.local
26
+
27
+ # Database
28
+ *.db
29
+
30
+ # OS
31
+ .DS_Store
32
+ Thumbs.db
33
+
34
+ # Project
35
+ CLAUDE.md
36
+ CLAUDE.local.md
37
+ .claude/
38
+ .playwright-cli/
39
+ site/
@@ -0,0 +1,27 @@
1
+ # Changelog
2
+
3
+ ## v0.1.0 (2026-04-08)
4
+
5
+ First public release.
6
+
7
+ ### Features
8
+
9
+ - SSH web terminal (xterm.js + asyncssh WebSocket bridge)
10
+ - SFTP file browser (directory listing, upload, download, rename, delete, mkdir, chmod)
11
+ - In-browser text editor (CodeMirror 6 with oneDark theme)
12
+ - PDF and image preview (PDF, PNG, JPG, GIF, SVG, WebP)
13
+ - Server registry with groups, tags, and encrypted credentials (Fernet)
14
+ - Quick Connect toolbar for one-off SSH connections
15
+ - Admin/user role system with group-based access control
16
+ - Default admin account with forced password change on first login
17
+ - User management panel (create, delete, assign groups)
18
+ - Multi-tab split pane (terminal + file browser side by side)
19
+ - File search/filter within SFTP listings
20
+ - Server import/export (JSON) from the UI
21
+ - Session persistence across page reloads
22
+ - Rate limiting on auth endpoints (slowapi)
23
+ - Audit log (admin-viewable action history)
24
+ - SFTP connection pool (reuse per server, 5 min TTL)
25
+ - Modern dark UI (GitHub-inspired theme)
26
+ - Docker multi-stage build with demo SSH container
27
+ - 34 automated tests
@@ -0,0 +1,39 @@
1
+ # --- Stage 1: build ---
2
+ FROM python:3.13-slim AS builder
3
+
4
+ WORKDIR /app
5
+ COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
6
+
7
+ COPY pyproject.toml uv.lock ./
8
+ RUN uv sync --frozen --no-dev --no-editable
9
+
10
+ COPY src/ src/
11
+
12
+ # --- Stage 2: runtime ---
13
+ FROM python:3.13-slim
14
+
15
+ RUN groupadd -r webgate && useradd -r -g webgate -m webgate
16
+
17
+ WORKDIR /app
18
+ COPY --from=builder /app/.venv /app/.venv
19
+ COPY --from=builder /app/src /app/src
20
+
21
+ # Data directory for SQLite DB + uploaded SSH keys
22
+ RUN mkdir -p /data && chown webgate:webgate /data
23
+ VOLUME /data
24
+
25
+ ENV PATH="/app/.venv/bin:$PATH" \
26
+ PYTHONPATH="/app/src" \
27
+ WEBGATE_HOST=0.0.0.0 \
28
+ WEBGATE_PORT=8443 \
29
+ WEBGATE_DB_URL=sqlite+aiosqlite:////data/webgate.db \
30
+ WEBGATE_LOG_LEVEL=info
31
+
32
+ EXPOSE 8443
33
+
34
+ USER webgate
35
+
36
+ HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
37
+ CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:8443/api/health')"
38
+
39
+ CMD ["python", "-m", "webgate"]
@@ -0,0 +1,29 @@
1
+ FROM debian:bookworm-slim
2
+
3
+ RUN apt-get update && \
4
+ apt-get install -y --no-install-recommends openssh-server procps curl nano htop tree && \
5
+ rm -rf /var/lib/apt/lists/*
6
+
7
+ RUN mkdir /run/sshd && \
8
+ echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config && \
9
+ echo 'PasswordAuthentication yes' >> /etc/ssh/sshd_config
10
+
11
+ # Create demo user
12
+ RUN useradd -m -s /bin/bash demo && \
13
+ echo 'demo:demo' | chpasswd && \
14
+ echo 'root:root' | chpasswd
15
+
16
+ # Create some sample files for SFTP browsing
17
+ RUN mkdir -p /home/demo/projects/webgate /home/demo/projects/api-server \
18
+ /home/demo/documents /home/demo/logs /home/demo/scripts && \
19
+ echo '# webgate\nSelf-hosted SSH + SFTP manager' > /home/demo/projects/webgate/README.md && \
20
+ echo '{"name":"api-server","version":"2.1.0"}' > /home/demo/projects/api-server/package.json && \
21
+ echo 'Hello from demo server!' > /home/demo/documents/welcome.txt && \
22
+ echo '2026-04-08 10:00:00 INFO Server started on port 8080' > /home/demo/logs/app.log && \
23
+ echo '#!/bin/bash\necho "Deploy complete"' > /home/demo/scripts/deploy.sh && \
24
+ chmod +x /home/demo/scripts/deploy.sh && \
25
+ chown -R demo:demo /home/demo
26
+
27
+ EXPOSE 22
28
+
29
+ CMD ["/usr/sbin/sshd", "-D"]
webgate-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Kevin Nolasco
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.