Metadata-Version: 2.3
Name: gitcloak
Version: 0.0.2
Summary: Simple Python-based private frontend for GitHub repositories
Project-URL: Homepage, https://git.private.coffee/PrivateCoffee/gitcloak
Project-URL: Bug Tracker, https://git.private.coffee/PrivateCoffee/gitcloak/issues
Author-email: "Private.coffee Team" <support@private.coffee>
License: Copyright (c) 2024 Private.coffee Team <support@private.coffee>
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.10
Requires-Dist: flask
Requires-Dist: markdown2[all]
Requires-Dist: requests
Description-Content-Type: text/markdown

# 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

1. Set up a virtual environment and activate it:

   ```sh
   python -m venv venv
   source venv/bin/activate
   ```

2. Install GitCloak from PyPI:

   ```sh
   pip install gitcloak
   ```

3. Run the GitCloak server:

   ```sh
    gitcloak
   ```

4. Open your browser and navigate to:
   ```
   http://localhost:8107/
   ```

### Development

1. Clone the repository:

   ```sh
   git clone https://git.private.coffee/PrivateCoffee/gitcloak
   cd gitcloak
   ```

2. Create a virtual environment and activate it:

   ```sh
   python -m venv venv
   source venv/bin/activate
   ```

3. Install the Python package:

   ```sh
   pip install -Ue .

   ```

4. Run the development server:

   ```sh
   gitcloak
   ```

5. 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 is `8107`.
- `HOST`: The host to bind the server to. Default is `127.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:

1. Fork the repository.
2. Create a new branch for your feature or bugfix.
3. Make your changes and commit them.
4. Push your changes to your fork.
5. Create a pull request to merge your changes into the main repository.

## License

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more details.

## Acknowledgments

- [Flask](https://flask.palletsprojects.com/) - A lightweight WSGI web application framework in Python.
- [Bootstrap](https://getbootstrap.com/) - A powerful front-end framework for faster and easier web development.
- [markdown2](https://github.com/trentm/python-markdown2) - A fast and complete implementation of Markdown in Python.
- [Phosphor Icons](https://phosphoricons.com/) - Beautifully designed icons for use in web projects.
