Kumi
894b6f8c52
- Added file preview functionality, enabling users to view images, text, and markdown files directly within the app. - Updated project metadata: changed author to "Private.coffee Team" and updated URLs. - Introduced a main function to allow customizable host and port via environment variables. - Enhanced raw file serving with MIME type checks and content disposition for better file handling. - Fixed URL formats in templates for consistent navigation. These improvements enhance usability and maintainability, providing a richer user experience and preparing for future enhancements. |
||
---|---|---|
src/gitcloak | ||
.gitignore | ||
LICENSE | ||
pyproject.toml | ||
README.md | ||
test.py |
GitCloak
GitCloak is a simple web frontend that lets you browse GitHub repositories and view their contents. It provides an easy-to-use interface to navigate directories, view files, and also renders README.md
files. It is still a work in progress, but the basic functionality is there.
Instead of using the GitHub API or screen scraping, GitCloak interfaces directly with the GitHub repository using the git protocol. This should make it more resilient to changes on the GitHub side, and also allows future modifications or forks to support other git hosting services like Forgejo or GitLab instances.
Features
- Browse directories and files in GitHub repositories.
- View the content of files directly in the browser.
- Responsive design with Bootstrap for a clean and professional look.
Getting Started
Prerequisites
- Python 3 (tested with 3.12)
- pip
- venv (optional but recommended)
Production
-
Set up a virtual environment and activate it:
python -m venv venv source venv/bin/activate
-
Install GitCloak from PyPI:
pip install gitcloak
-
Run the GitCloak server:
gitcloak
-
Open your browser and navigate to:
http://localhost:8107/
Development
-
Clone the repository:
git clone https://git.private.coffee/PrivateCoffee/gitcloak cd gitcloak
-
Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate
-
Install the Python package:
pip install -Ue .
-
Run the development server:
gitcloak
-
Open your browser and navigate to:
http://localhost:8107/
Configuration
GitCloak currently supports the following environment variables:
PORT
: The port number to run the server on. Default is8107
.HOST
: The host to bind the server to. Default is127.0.0.1
.
Usage
-
Landing Page: The landing page provides information about the app and instructions on how to use it.
http://localhost:8107/
-
Browse Repository: To browse a repository, use the following URL format:
http://localhost:8107/<owner>/<repo>/
-
View Subdirectory: To view a specific directory, use the following URL format:
http://localhost:8107/<owner>/<repo>/tree/main/<path>
-
View File Content: To view the raw content of a specific file, use the following URL format:
http://localhost:8107/<owner>/<repo>/raw/main/<file_path>
Contributing
We welcome contributions to improve GitCloak! To contribute:
- Fork the repository.
- Create a new branch for your feature or bugfix.
- Make your changes and commit them.
- Push your changes to your fork.
- Create a pull request to merge your changes into the main repository.
License
This project is licensed under the MIT License. See the LICENSE file for more details.
Acknowledgments
- Flask - A lightweight WSGI web application framework in Python.
- Bootstrap - A powerful front-end framework for faster and easier web development.
- markdown2 - A fast and complete implementation of Markdown in Python.
- Phosphor Icons - Beautifully designed icons for use in web projects.