gitten
Type | Name |
---|---|
tree | server |
tree | source |
tree | static |
tree | templates |
blob | .gitignore |
blob | COPYING |
blob | Cargo.lock |
blob | Cargo.toml |
blob | README.md |
Gitten
Gitten is a self-hosted, read-only, light-weight Git frontend designed to showcase personal projects.
Building
You will need a recent version of the Rust toolchain.
Run the following command in the repository root:
cargo build --release
The Gitten binary will be at ./target/release/gitten
.
Installing
Gitten is designed to be run as a local service behind a real HTTP server, such as apache or nginx. Configuring this is out of the scope of this document, but if you don't know where to start, look up how to set up a reverse proxy with your chosen web server.
1: Create folder structure
First, create a folder at /opt/gitten
. You can create it somewhere else, but you will need to edit
the systemd service file if you do this. Create the following folder structure inside:
/opt/gitten
/bin
/lib
/systemd
/system
/templates
/static
2: Copy files
Copy the following files from the repository into the folder structure you just created:
target/release/gitten
goes into/opt/gitten/bin
server/lib/systemd/system/gitten.service
goes into/opt/gitten/lib/systemd/system
- All the files in
templates
go into/opt/gitten/templates
- All the files in
static
go into/opt/gitten/static
server/gitten.example.toml
goes into/opt/gitten
(rename this togitten.toml
)
3: Configure the Gitten service
Edit gitten.toml
. The contents will be specific to your machine, but in particular:
- The
git.root
parameter must be set to the path to the folder where your Git repositories are - The
network.host
andnetwork.port
parameters should be set to match the reverse proxy settings you configured in your web server - The
site.name
parameter controls what Gitten will put in the browser's title bar and in the site header - The
site.link
parameter controls where the link in the site header will lead
4: Add the service to systemd
Create a symbolic link from /etc/systemd/system/gitten.service
to
/opt/gitten/lib/systemd/system/gitten.service
.
5: Check ownership and permissions
Gitten needs to be able to read your Git repositories in order to query their contents and render
them in the browser. The default configuration assumes you have a user and group named git
that
can read everything under the git.root
you configured in gitten.toml
. Either create this user
and set the ownership of your repositories appropriately, or change the User=
and Group=
settings in gitten.service
to the user and group you want to use instead.
6: Start the Gitten service
Run these commands:
systemctl start gitten
systemctl status gitten
If all is well, you should see the string active (running)
in the output of the status
command.