From de2341ff5b4a0cf956d8e31576fadb7243c9a2c6 Mon Sep 17 00:00:00 2001 From: Luka Hietala Date: Wed, 19 Nov 2025 19:22:43 +0200 Subject: [PATCH] some instructions on how to setup --- README.md | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3ee97a5..2fb74b8 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,37 @@ Fast webview using pygit2 (lib2git) bindings. For my personal use, for now ```bash pip install -r requirements.txt ``` +2. Create a git server: https://git-scm.com/book/en/v2/Git-on-the-Server-Setting-Up-the-Server +3. Set the `GIT_REPO_PATH` in .env to point to your git repositories dir +4. Create a systemd service to run the app (optional) +```ini +# /etc/systemd/system/py-gitweb.service +[Unit] +Description="mirrin lipasto" +After=network.target -2. Set the `GIT_REPO_PATH` in .env +[Service] +User=USERNAME +Group=www-data +SupplementaryGroups=GITUSERGROUP # optional +WorkingDirectory=/home/USERNAME/py-gitweb/ +Environment="PATH=/home/USERNAME/py-gitweb/.venv/bin:/usr/local/bin:/usr/bin:/bin" +ExecStart=/home/USERNAME/py-gitweb/.venv/bin/gunicorn --bind unix:py-gitweb.sock --workers=4 --log-level=debug -m 007 wsgi:app + +[Install] +WantedBy=multi-user.target +``` +5. Setup nginx or apache to serve the app (optional) +```nginx +# example nginx config +server { + server_name git.mirrinlipasto.fi; + location / { + include proxy_params; + proxy_pass http://unix:/home/USERNAME/py-gitweb/py-gitweb.sock; + } +} +``` + +Note: Libgit2 might have some issues with git.safe dir settings. If you run into issues, try setting `git config --global --add safe.directory '*'` -... \ No newline at end of file -- 2.47.3