]> git.ardis.lu - git.ardis.lu/summary
 
descriptionConfigurations and scripts for my self-hosted git server.
last changeSun, 27 Sep 2026 03:58:24 +0000 (20:58 -0700)
readme

git.ardis.lu

Configurations and scripts for my self-hosted git server.

Tested and running on Debian but these directions should work on any similar systemd distribution.

Code repository mirrors: GitHub, Codeberg, git.ardis.lu

Setup

  1. Install required software:
sudo apt install git gitweb highlight ufw fcgiwrap

See Caddy: Install for directions on installing caddy.

See Comrak for installing comrak.

Explanation:

  1. Clone this repo somewhere on the server.

  2. Update ./srv/git/.ssh/authorized_keys to include all admin SSH keys that should have write access to repos.

  3. Run setup.sh to create or update the git user, git scripts, the git repo directory /srv/git, and gitweb configurations:

sudo ./setup.sh
  1. Open port 443 to allow access over HTTPS (UDP for HTTP/3):
sudo ufw allow "WWW Secure"
sudo ufw allow 443/udp

View and clone repos

Browse existing repos using the web view: https://git.ardis.lu

Support for read/write:

Transport protocol Read Write Authorization required?
ssh:// Yes Yes Yes
https:// Yes No No
http:// No No N/A
git:// No No N/A

http:// and git:// are disabled because (1) it simplifies server administration and (2) the lack of integrity checks or encryption makes them subject to tampering. This configuration matches GitHub's.

URLs to clone individual repos can be found within the repo page on the web view.

Helper scripts

A minimal set of administrative commands.

init

Create a new repo and optionally set its description for the web view.

Single quote characters (') MUST be escaped using a backslash.

ssh git@git.ardis.lu init <repository_name> [repository_description]

rm

Delete a repo.

ssh git@git.ardis.lu rm <repository_name>

Uninstall

To reverse the steps in setup.sh.

  1. (From another computer) Use the rm helper script to delete all repos:
ssh git@git.ardis.lu rm <repository_name>
  1. Delete the git user and its home directory /srv/git:
sudo deluser --remove-home git
  1. (Optional) Delete git-shell from /etc/shells:
sudo vim /etc/shells

Disable git-daemon

These steps are for reference only, they are not needed because git-daemon is not enabled on the server.

  1. Delete the ufw rule to open port 9418 for git-daemon:
sudo ufw delete limit 9418/tcp
  1. Stop and delete git-daemon.service:
sudo systemctl stop git-daemon
sudo systemctl disable git-daemon
sudo rm /etc/systemd/system/git-daemon.service
sudo systemctl daemon-reload
sudo systemctl reset-failed
shortlog
2026-09-27 Ardis LuAdd ASCII art to success message main
2026-08-21 Ardis LuIncrease `line-height` of README text
2026-08-01 Ardis LuImprove `<blockquote>` styling
2026-07-31 Ardis LuUndo gitweb's text-align for table cells
2026-07-28 Ardis LuMake regex more explicit
2026-07-23 Ardis LuEnable GitHub-style admonitions ("alerts")
2026-06-17 Ardis LuAdd step to open `443/udp` for HTTP/3
2026-05-08 Ardis LuImprove styling for other search inputs
2026-05-07 Ardis LuImprove search input box styling
2026-04-13 Ardis LuMake the init message more useful
2026-04-08 Ardis LuChange syntax highlighting theme to light to match...
2026-04-08 Ardis LuSpecify theme for syntax highlighting
2026-04-04 Ardis LuAdd Cache-Control to response headers
2026-01-01 Ardis LuRemove hardcoded page header height
2025-12-31 Ardis LuStick diff headers
2025-12-31 Ardis LuAdd overflow
...
heads
3 weeks ago main
This page took 0.050526 seconds and 7 git commands to generate.