Skip to content

Kitsumizy/hxgit-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hxgit-server

hxgit-server is a minimalist Git server written in Haxe, designed for cloning, exploring, and managing repositories via HTTP, with authentication, user profiles, and a modern web interface.

Main Features

  • Git Smart HTTP: Supports clone, fetch, and push over HTTP.
  • Frontend SPA: Responsive web interface with file explorer, commits, profiles, and admin panel.
  • JWT Authentication: Register, login, and profile editing with secure tokens.
  • Private/Public Repos: Visibility control, only the owner can change it.
  • Admin Panel: Ban/unban users, manage accounts.
  • Avatars: Upload and view profile images.
  • Internationalization: Multi-language support (es/en/pt).
  • SQLite: Integrated database for users, repos, and bans.
  • File Explorer: View blobs, images, audio, video, and text with syntax highlighting.
  • REST API: Endpoints for users, repos, blobs, commits, branches, etc.

Project Structure

  • src/ — Haxe source code (backend)
    • Main.hx — Entry point, loads config and starts the server.
    • SimpleHttpServer.hx — Basic HTTP server.
    • git/ — Git logic, handlers, API, utilities.
  • public/web/ — Frontend SPA (HTML, CSS, JS)
  • repos/ — Bare Git repositories folder.
  • .env — Sensitive config (port, paths, secrets).
  • build.hxml / run.hxml — Build and run scripts.

Installation & Usage

  1. Configure .env:

    • PORT — Server port (default: 8080)
    • REPO_PATH — Repo folder (default: ./repos)
    • DB_PATH — SQLite database path
    • APP_PEPPER and JWT_SECRET — Long secrets for security
  2. Build and run:

    haxe build.hxml
    neko server.n
  3. Access the frontend:

    • Go to http://localhost:8080 to use the web interface.

Endpoints & API

  • Auth: /api/auth/register, /api/auth/login, /api/auth/logout
  • Users: /api/users, /api/users/:u/profile, /api/users/:u/repos, /api/users/:u/avatar
  • Repos: /repos/:u/:r (create), /repos/:u/:r/privacy (visibility)
  • View: /api/repos/:u/:r/info, /branches, /commits, /tree, /blob
  • Admin: /api/admin/ban, /api/admin/unban
  • Git: /info/refs, /git-upload-pack, /git-receive-pack
  • Avatars: /public/users/:u.png
  • SPA: / (explore), /~user, /~user/repo, etc.

Requirements

  • Haxe 4.x
  • Neko VM
  • Git installed on the system

Example Workflow

  1. Register and log in.
  2. Create a repo from the frontend.
  3. Clone the repo:
    git clone http://localhost:8080/repos/your_user/your_repo.git
  4. Push, explore files, review commits, and manage your profile.

Security

  • Passwords hashed with salt and pepper.
  • JWT for sessions.
  • Bans and admin control.
  • Private repos only visible to the owner.

License

This project is experimental and comes with no warranty. Use at your own risk.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors