ProductPromotion
Logo

Open.Source

made by https://0x3d.site

GitHub - w4/rgit: 🏯 a gitweb interface written in rust
🏯 a gitweb interface written in rust. Contribute to w4/rgit development by creating an account on GitHub.
Visit Site

GitHub - w4/rgit: 🏯 a gitweb interface written in rust

GitHub - w4/rgit: 🏯 a gitweb interface written in rust

rgit

Introduction

See it in action!

A gitweb/cgit-like interface for the modern age. Written in Rust using Axum, gitoxide, Askama and RocksDB.

Includes a dark mode for late night committing.

Table of Contents

Features

  • Efficient Metadata Storage
    RocksDB is used to store all metadata about a repository, including commits, branches, and tags. Metadata is reindexed, and the reindex interval is configurable (default: every 5 minutes), resulting in up to 97% faster load times for large repositories.

  • On-Demand Loading
    Files, trees, and diffs are loaded using gitoxide directly upon request. A small in-memory cache is included for rendered READMEs and diffs, enhancing performance.

  • Dark Mode Support
    Enjoy a dark mode for late-night committing, providing a visually comfortable experience during extended coding sessions.

Getting Started

Before you begin, ensure that you have the Rust toolchain and Cargo installed. If you haven't installed them yet, you can do so by following the instructions provided on the official Rust website:

Once you have Rust and Cargo installed, you can proceed with setting up and running the project.

Note: This software is designed to work exclusively with bare Git repositories. Make sure to set up bare repositories beforehand by following the Git on the Server documentation.

Installation

Cargo (automatic)

cargo install --git https://github.com/w4/rgit

From Source (manually)

Clone the repository and build:

git clone https://github.com/w4/rgit.git
cd rgit
cargo build --release

The rgit binary will be found in the target/release directory.

Usage

To get up and running quickly, run rgit with the following:

rgit [::]:3333 /path/to/my-bare-repos -d /tmp/rgit-cache.db

Notes:

  • Repository indexing is recursive.
  • The database is quick to generate, so this can be pointed to temporary storage.

Configuration

Repository Description

To set a repository description, edit the file named description inside the bare git repository. Add your desired description text to this file.

Repository Owner

To assign an owner to a repository, edit the file named config inside the bare git repository and include the following content:

[gitweb]
    owner = "Al Gorithm"

Replace Al Gorithm with the desired owner's name.

NixOS

Running rgit on NixOS is straightforward, simply import the module into your flake.nix and use the provided service:

{
  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05";

    rgit = {
      url = "github:w4/rgit";
      inputs.nixpkgs = "nixpkgs";
    };
  };

  outputs = { nixpkgs, ... }: {
    nixosConfigurations.mySystem = nixpkgs.lib.nixosSystem {
      modules = [
        rgit.nixosModules.default
        {
          services.rgit = {
            enable = true;
            bindAddress = "[::]:3333";
            dbStorePath = "/tmp/rgit.db";
            repositoryStorePath = "/path/to/my-bare-repos";
          };
        }
        ...
      ];
    };
  };
}

Docker

Running rgit in Docker is straightforward. Follow these steps, ensuring that your repository directory is correctly mounted:

docker run --mount type=bind,source=/path/to/my-bare-repos,target=/git \
  --user $UID:$GID \
  -it ghcr.io/w4/rgit:main

Note: Replace $UID and $GID with the UID and GID of the user that owns the directory containing your repositories. If these values are incorrect, errors will occur. Learn how to find the UID of a user here.

Docker Compose

An example docker-compose.yml is provided for those who prefer using Compose. To configure the UID and GID, the user can be specified in docker-compose.override.yml.

An example override file has been has been provided with the repository. To use it, remove the .example extension from docker-compose.override.yml.example, and adjust the UID and GID to match the user that owns the directory containing your repositories.

To configure automatic refresh in Docker, an environment variable is also provided.

services:
  rgit:
    environment:
      - REFRESH_INTERVAL=5m

Afterwards, bring up the container with docker-compose up to make sure everything works.

Contributing

Pull requests are welcome via GitHub or git-send-email.

License

rgit is licensed under the WTFPL.

Troubleshooting

Cloning Repositories

Repository not exported

Symptom: When attempting to clone repositories via HTTPS, you encounter the error message:

Git returned an error: Repository not exported

Solution: Create a file named git-daemon-export-ok in the bare git repository. This file signals to the git daemon that the repository is exportable.

Launching the Application

...is not owned by the current user

Symptom: When launching the application, you receive the error message:

repository path '/git/path/to/my/repository.git/' is not owned by the current user

Solution: Ensure that the user launching rgit or the Docker container has the same permissions as the user that owns the repositories directory.

Application Usage

Newly initialized repositories do not appear

Symptom: When using the application, a newly initialized bare repository without commits does not appear in the list.

Solution: Run the following command inside the repository to initialize it:

git pack-refs --all

Alternatively, push a commit with at least one file to the repository. This will also make the repository appear in the list.

Articles
to learn more about the open-source concepts.

Resources
which are currently available to browse on.

mail [email protected] to add your project or resources here 🔥.

FAQ's
to know more about the topic.

mail [email protected] to add your project or resources here 🔥.

Queries
or most google FAQ's about Open-Source.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory