README.md (1875B)
1 # Git Web Hosting (OpenBSD + httpd + stagit) 2 3 Static git web interface using bare repos, httpd, and stagit. 4 5 ## Directory Structure 6 7 Example directory structure: 8 9 ``` 10 scm.mydomain.com/ 11 ├── raw-git/ ← Mirrored bare repos (git-http-backend) 12 └── git/ ← Stagit HTML (static web pages) 13 ``` 14 15 ## Scripts 16 17 ### mirror-git.sh - Mirror bare git repos 18 19 20 `mirror-git.sh` replicates bare Git repositories from a secure central server to a 21 web-accessible location, enabling HTTP(S) Git access and static HTML generation 22 (stagit/gitpages) while keeping push targets isolated from public web exposure. 23 24 ``` 25 ./mirror-git.sh /home/vcs/git /var/www/htdocs/scm.mydomain.com/raw-git 26 ``` 27 28 ### gitpages-init.sh - Initial setup 29 30 `gitpages-init.sh` mirrors Git repositories and generates HTML files in one go. 31 32 ``` 33 ./init-gitweb.sh /home/vcs/git /var/www/htdocs/scm.mydomain.com/raw-git /var/www/htdocs/scm.mydomain.com/git 34 ``` 35 36 ### gitpages.sh - Generate HTML only 37 38 A single repo: 39 40 ``` 41 ./gitpages.sh /raw-git/myrepo.git /git/ 42 ``` 43 44 All repos: 45 46 ``` 47 ./gitpages.sh /raw-git/ /git/ 48 ``` 49 50 With assets: 51 52 ``` 53 ./gitpages.sh /raw-git/ /git/ /assets/ 54 ``` 55 56 When `ASSETS_DIR` is given: 57 58 - Assets are copied into the gitpages root 59 - Then symlinked into every repo‑HTML directory (e.g., `git/myrepo/favicon.ico` → `../favicon.ico`) 60 61 ### Customizing HTML 62 63 You can use an optional config file `gitpages.conf` to change titles and 64 descriptions in stagit and stagit-index output. 65 66 Example: 67 68 ```ini 69 SITE_NAME=mycompany 70 INDEX_TITLE=New Title 71 INDEX_DESCRIPTION=New Description 72 REPO_TITLE_DESCRIPTION= | $SITE_NAME 73 ``` 74 75 If gitpages.conf exists or is passed with -c, gitpages.sh rewrites: 76 77 - index.html title and description: 78 79 ```html 80 <title>New Title</title> 81 <span class="desc">New Description</span> 82 ``` 83 84 - repository pages title tags: 85 86 ```html 87 <title>Log - myrepo | mycompany</title> 88 ```