GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - huoyijie/gitcode: gitcode is a personal lightweight self-hosted git server written in Go

BranchesTags
Open more actions menu

Latest commit

 

History

94 Commits
94 Commits

Folders and files

NameName
Last commit message
Last commit date
docs/images
docs/images
 
 
examples
examples
 
 
templates
templates
 
 
.gitignore
.gitignore
 
 
.nojekyll
.nojekyll
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
auth.go
auth.go
 
 
encrypt.go
encrypt.go
 
 
gitcode.go
gitcode.go
 
 
go.mod
go.mod
 
 
go.sum
go.sum
 
 

Repository files navigation

Gitcode

Introduction

gitcode is a personal lightweight self-hosted git server written in Go. It stands on top of git, go-git, and powered by Bootstrap, Vue, Docsify and Prismjs. It's about the same as gitweb now.

My personal gitcodes

Features

  • Support organization

e.g.: git clone [email protected]:go/gitcode.git, gitcode.git repository stored in organization go

  • Support new repository
  • Support authorization by repository
  • Browse or clone authorized code repositories
  • Support markdown automatic rendering
  • Support code highlighting

Home

Markdown

Code highlights

Prerequisites

  • Go 1.20+

Install

$ [email protected]:huoyijie/gitcode.git

$ cd gitcode

$ go install .
$ gitcode -h
Usage of gitcode:
  -host string
    	the host that server listen on (default "127.0.0.1")
  -hostname string
    	the host name of the server (default "huoyijie.cn")
  -port int
    	the port that server listen on (default 8000)
  -repos string
    	the director where repos store (default "/home/git")

Run gitcode

server

Run gitcode manually

# Listen on 127.0.0.1:8787
$ gitcode -port 8787 -repos /home/git

Run gitcode as a service

Create a systemd config file /etc/systemd/system/gitcode.service

[Unit]
Description=Gitcode

[Service]
User=git
Group=git
Type=idle
Environment="GIN_MODE=release"
ExecStart=/home/ubuntu/go/bin/gitcode -port 8787 -repos /home/git
Restart=always
KillMode=process

[Install]
WantedBy=multi-user.target

Start gitcode service

$ sudo systemctl daemon-reload
$ sudo systemctl enable --now gitcode

View logs

$ systemctl -fu gitcode

client

Access gitcode server through SSH tunnel

$ ssh -N -L 8787:127.0.0.1:8787 -o ServerAliveInterval=5 [email protected]

Open http://127.0.0.1:8787/ with the browser

In order to safely access gitcode througth the public network, you can configure nginx reverse proxy and TLS.

e.g.: Demo

Authorization (based on casbin)

You can take a look at examples directory.

  • RBAC model
[request_definition]
r = sub, obj, act

[policy_definition]
p = sub, obj, act

[role_definition]
g = _, _

[policy_effect]
e = some(where (p.eft == allow))

[matchers]
m = g(r.sub, p.sub) && r.obj == p.obj && r.act == p.act
  • RBAC policy
p, role_admin, efs, read
p, role_admin, efs, write
p, role_admin, huoyijie, read
p, role_admin, huoyijie, write
p, role_guest, huoyijie, read
g, gitcode, role_admin
g, guest, role_guest

TODO

  • show binary files done
  • show submodules done
  • show breadcrumb done
  • ssh proxy/ssh clone done
  • render markdown/readme done
  • create new repo done
  • sign in/sign out/auth by role done

Future

  • code highlights, auto load script file
  • show commits (very slow)
  • show branchs/tags
  • search repo
  • search code
  • issues
  • pull request
  • code diff
  • merge request
  • hook and build docker image
  • publish with k8s

About

gitcode is a personal lightweight self-hosted git server written in Go

huoyijie.cn:1024

Topics

bootstrapgin-gonicgitgitservergo-gitgolangmarkdownvue

Resources

Readme
MIT license
Activity

Stars

11 stars

Watchers

1 watching

Forks

4 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.