https://github.com/blmayer/gwi
A library that let's you create a web interface for your repos.
https://github.com/blmayer/gwi
git go
Last synced: about 2 months ago
JSON representation
A library that let's you create a web interface for your repos.
- Host: GitHub
- URL: https://github.com/blmayer/gwi
- Owner: blmayer
- License: other
- Created: 2023-04-21T21:35:31.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-10-12T17:29:10.000Z (over 2 years ago)
- Last Synced: 2025-05-31T13:11:56.506Z (about 1 year ago)
- Topics: git, go
- Language: Go
- Homepage:
- Size: 121 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
GWI stands for Git Web Interface, that is it delivers a ready to use
visualization and management tool atop of your git repositories.
With GWI you can easily host your own git platform customized
to your needs. Some features are:
- Easy to setup
- Pages are templates you can customize
- Does not depend on git or CGI scripts
- Lightweight
- Free
- Under active development
This project is in early stages of development, and some features may be
missing. If you want to request a feature or report a bug, follow the
instructions at [the author's git](https://blmayer.dev/x).
[](https://goreportcard.com/report/blmayer.dev/x/gwi)
[](https://pkg.go.dev/blmayer.dev/x/gwi)
If you like to star it on GitHub, we have a mirror repo there:
[GitHub](https://github.com/blmayer/gwi)
Thank you!
# Usage
The simplest way of using this project is the following example:
```
package main
import (
"net/http"
"blmayer.dev/gwi"
)
func main() {
// init user vault
v, err := NewFileVault("users.json", "--salt--")
// handle error
// gwi config struct
c := gwi.Config{
Root: "path/to/git/folder",
PagesRoot: "path/to/html-templates",
...
}
g, _ := gwi.NewFromConfig(c, v)
// handle error
err := http.ListenAndServe(":8080", g.Handle())
// handle err
}
```
## Examples
### Users
To get a list of your users is simple:
```
- {{.}}
{{range users}}
{{end}}
```
### File tree
To get the file tree for the current reference:
```
Mode
Size
Name
{{range tree .Ref}}
{{.Mode}}
{{.Size}}
{{.Name}}
{{end}}
```
Will print a nice list of your project files.
### Commits
Using the functions `commits` and `commit` you're able to see a list of
commits and check details of each one:
```
Time
Author
Message
{{range commits .Ref}}
{{.Author.When.String}}
{{.Author.Name}}
{{.Message}}
{{end}}
```
To get the list, and the following show a commit's details:
```
{{with commit .Ref}}
Commited at: {{.Committer.When.String}}
Author: {{.Committer.Name}} ({{.Committer.Email}})
Message:
{{.Message}}
{{end}}
```