Project: pygitweb

2a910f8 # PyGitWeb: Project hosting with FastAPI and PyGit2
63e6094 PyGitWeb and its bundled tools allow users to:
- Self-host git repositories (+ associated settings, permissions, and metadata)
- Manage projects and teams; built-in issues and kanban boards
1860ffb - Assist with info security including code signing and secret scanning, plus much more with custom hooks.
- Use OAuth2 flows to allow secure authentication without forcing account creation.
120b3f3 PyGitTools, the core package of PyGitWeb, allows users to (without involving the web server):
d4c095c - Script Python workflows with Tasks, Merge Requests, and Hooks within a repositories
2a910f8 - Setup hooks and actions; Actions are defined in configuration and can be used to
120b3f3 - Use the bundled git terminal app (pgt) to quickly perform git actions and even manage tasks from the cli.
63e6094
## Installation and Usage
120b3f3 To run with UV in bash _or_ powershell:
```bash
2a910f8 uv run --with pygitweb uvicorn pygitweb.main:app
63e6094 ```
120b3f3
By default, this will set up local authenication and generate an `admin` account with a randomly generated password.
If you are running locally with a firewall and NO reverse proxy or other risk of external traffic, you can run with auth disabled by setting `PYGITWEB_AUTH` falsy:
```bash
2a910f8 PYGITWEB_AUTH=0 uv run --with pygitweb uvicorn pygitweb.main:app
120b3f3 ```
```powershell
2a910f8 $env:PYGITWEB_AUTH=0; uv run --with pygitweb uvicorn pygitweb.main:app
120b3f3 ```
Furthermore, if you just want to evalute `pgt` (the terminal app for using git) without involving the web server, use the following command in a project folder:
```bash
2a910f8 uv tool install pygittools
pgt # run this from within a git repo dir
63e6094 ```
## Installation with Docker
(todo)
## Installation for Development
1860ffb Clone the repo over smart-http:
120b3f3 ```bash
1860ffb git clone https://app.pygitweb.com/http/pygitweb;
120b3f3 cd pygitweb; uv sync --all-packages --all-groups;
2a910f8 uv run uvicorn pygitweb.main:app --reload
63e6094 ```
2a910f8 The pre-commit actions are defined in pyproject.toml, but effectively boil down to:
120b3f3
```bash
d4c095c uv run ruff check --fix;
uv run ruff format --preview;
120b3f3 uv run mypy .;
uv run pytest .;
```
2a910f8 There are optional playwright tests triggerable with `uv run pytest . --playwright --js-tests`
120b3f3
2a910f8 To generate a coverage report, do
120b3f3
```bash
uv run coverage run -m pytest .;
uv run coverage html;
63e6094 ```