aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2024-06-14 08:00:00 +0800
committerRunxi Yu <me@runxiyu.org>2024-07-26 08:00:00 +0800
commit5cb75c1af0a0418974e1b20368e4fbf940912f9e (patch)
tree36aa7e46432257700291be8f927f06856c4b3c75
parentgit: use system's git upload-pack (diff)
downloadlegitrx-5cb75c1af0a0418974e1b20368e4fbf940912f9e.tar.gz
legitrx-5cb75c1af0a0418974e1b20368e4fbf940912f9e.tar.zst
legitrx-5cb75c1af0a0418974e1b20368e4fbf940912f9e.zip
Fork init
-rw-r--r--.gitignore1
-rw-r--r--LICENSE (renamed from license)0
-rw-r--r--README.md67
-rw-r--r--config.yaml10
-rw-r--r--contrib/legit.service8
-rw-r--r--readme87
-rw-r--r--templates/404.html1
-rw-r--r--templates/500.html1
-rw-r--r--templates/commit.html1
-rw-r--r--templates/file.html1
-rw-r--r--templates/index.html1
-rw-r--r--templates/log.html1
-rw-r--r--templates/refs.html1
-rw-r--r--templates/repo.html1
-rw-r--r--templates/tree.html1
15 files changed, 86 insertions, 96 deletions
diff --git a/.gitignore b/.gitignore
index 46ecc00..12a68f2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
legit
result
+legitrx
diff --git a/license b/LICENSE
index fc9152a..fc9152a 100644
--- a/license
+++ b/LICENSE
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..fdcd067
--- /dev/null
+++ b/README.md
@@ -0,0 +1,67 @@
+# Legitrx
+
+This is [Runxi Yu](https://runxiyu.org)'s fork of
+[icyphox](https://icyphox.sh/)'s [legit](https://git.icyphox.sh/legit/)
+project. It aims to replace the use of
+[cgit](https://git.zx2c4.com/cgit/about/) Runxi's servers.
+
+At its current state, you should not use this fork. Use upstream instead.
+
+## Features
+
+- Customizable templates and stylesheets.
+- Cloning over HTTPS.
+- Not CGI.
+
+## Building
+
+```sh
+git clone https://git.sr.ht/~runxiyu/legitrx
+go build
+```
+
+## Configuration
+
+If no filename is specified via the `--config` option, it looks for `config.yaml` in the current working directory.
+
+```yaml
+repo:
+ scanPath: /srv/git
+ readme:
+ - README
+ - README.md
+ mainBranch:
+ - master
+ - main
+ ignore:
+ - repo-to-hide
+dirs:
+ templates: ./templates
+ static: ./static
+meta:
+ title: Legitrx
+ description: Testing
+server:
+ name: git.runxiyu.org
+ host: 127.0.0.1
+ port: 5555
+ ```
+
+`server.name` is used for `go import` meta tags and clone URLs.
+
+## Notes
+
+- Run legitrx behind a TLS terminating proxy like
+ [relayd(8)](https://man.openbsd.org/relayd.8) or nginx.
+- Cloning only works in bare repos.
+- Pushing over https, while supported, is disabled because auth is a pain. Use
+ ssh or [Gitolite](https://gitolite.com/gitolite/).
+- Paths are [unveil(2)](https://man.openbsd.org/unveil.2)'d on OpenBSD.
+
+## Ideas
+
+- Code highlighting support.
+
+## License
+
+Legitrx is licensed under the MIT license.
diff --git a/config.yaml b/config.yaml
index 7a6066f..909509f 100644
--- a/config.yaml
+++ b/config.yaml
@@ -1,5 +1,5 @@
repo:
- scanPath: /var/www/git
+ scanPath: /srv/git
readme:
- readme
- README
@@ -12,9 +12,9 @@ dirs:
templates: ./templates
static: ./static
meta:
- title: icy does git
- description: come get your free software
+ title: legitrx
+ description: no description yet
server:
- name: git.icyphox.sh
- host: 0.0.0.0
+ name: git.runxiyu.org
+ host: 127.0.0.1
port: 5555
diff --git a/contrib/legit.service b/contrib/legit.service
index e0193ed..a17fd4c 100644
--- a/contrib/legit.service
+++ b/contrib/legit.service
@@ -1,12 +1,12 @@
[Unit]
-Description=legit Server
+Description=legitrx
After=network-online.target
Requires=network-online.target
[Service]
-User=git
-Group=git
-ExecStart=/usr/bin/legit -config /etc/legit/config.yaml
+User=legitrx
+Group=legitrx
+ExecStart=/usr/local/bin/legitrx -config /etc/legitrx.yaml
ProtectSystem=strict
ProtectHome=strict
NoNewPrivileges=true
diff --git a/readme b/readme
deleted file mode 100644
index d242cd4..0000000
--- a/readme
+++ /dev/null
@@ -1,87 +0,0 @@
-legit
------
-
-A git web frontend written in Go.
-
-Pronounced however you like; I prefer channeling my inner beret-wearing
-Frenchman, and saying "Oui, il est le git!"
-
-But yeah it's pretty legit, no cap on god fr fr.
-
-
-FEATURES
-
-• Fully customizable templates and stylesheets.
-• Cloning over http(s).
-• Less archaic HTML.
-• Not CGI.
-
-
-INSTALLING
-
-Clone it, 'go build' it.
-
-
-CONFIG
-
-Uses yaml for configuration. Looks for a 'config.yaml' in the current
-directory by default; pass the '--config' flag to point it elsewhere.
-
-Example config.yaml:
-
- repo:
- scanPath: /var/www/git
- readme:
- - readme
- - README
- - readme.md
- - README.md
- mainBranch:
- - master
- - main
- ignore:
- - foo
- - bar
- dirs:
- templates: ./templates
- static: ./static
- meta:
- title: git good
- description: i think it's a skill issue
- server:
- name: git.icyphox.sh
- host: 127.0.0.1
- port: 5555
-
-These options are fairly self-explanatory, but of note are:
-
-• repo.scanPath: where all your git repos live (or die). legit doesn't
- traverse subdirs yet.
-• dirs: use this to override the default templates and static assets.
-• repo.readme: readme files to look for.
-• repo.mainBranch: main branch names to look for.
-• repo.ignore: repos to ignore, relative to scanPath.
-• server.name: used for go-import meta tags and clone URLs.
-
-
-NOTES
-
-• Run legit behind a TLS terminating proxy like relayd(8) or nginx.
-• Cloning only works in bare repos -- this is a limitation inherent to git. You
- can still view non-bare repos just fine in legit.
-• The default head.html template uses my CDN to fetch fonts -- you may
- or may not want this.
-• Pushing over https, while supported, is disabled because auth is a
- pain. Use ssh.
-• Paths are unveil(2)'d on OpenBSD.
-
-
-IDEAS
-
-• "Private" repos only available over Tailscale.
-• Support or cgit-like filters (for readmes etc.).
-
-
-LICENSE
-
-legit is licensed under MIT.
diff --git a/templates/404.html b/templates/404.html
index 8c40cd1..bca9d35 100644
--- a/templates/404.html
+++ b/templates/404.html
@@ -1,4 +1,5 @@
{{ define "404" }}
+<!DOCTYPE html>
<html>
<title>404</title>
{{ template "head" . }}
diff --git a/templates/500.html b/templates/500.html
index 53c605f..164700c 100644
--- a/templates/500.html
+++ b/templates/500.html
@@ -1,4 +1,5 @@
{{ define "500" }}
+<!DOCTYPE html>
<html>
<title>500</title>
{{ template "head" . }}
diff --git a/templates/commit.html b/templates/commit.html
index c1def17..49f4574 100644
--- a/templates/commit.html
+++ b/templates/commit.html
@@ -1,4 +1,5 @@
{{ define "commit" }}
+<!DOCTYPE html>
<html>
{{ template "head" . }}
diff --git a/templates/file.html b/templates/file.html
index 23187ec..d18340a 100644
--- a/templates/file.html
+++ b/templates/file.html
@@ -1,4 +1,5 @@
{{ define "file" }}
+<!DOCTYPE html>
<html>
{{ template "head" . }}
{{ template "repoheader" . }}
diff --git a/templates/index.html b/templates/index.html
index 7a77aec..740d2b3 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -1,4 +1,5 @@
{{ define "index" }}
+<!DOCTYPE html>
<html>
{{ template "head" . }}
diff --git a/templates/log.html b/templates/log.html
index 7d74cb3..d097990 100644
--- a/templates/log.html
+++ b/templates/log.html
@@ -1,4 +1,5 @@
{{ define "log" }}
+<!DOCTYPE html>
<html>
{{ template "head" . }}
diff --git a/templates/refs.html b/templates/refs.html
index 00058d5..f0e591f 100644
--- a/templates/refs.html
+++ b/templates/refs.html
@@ -1,4 +1,5 @@
{{ define "refs" }}
+<!DOCTYPE html>
<html>
{{ template "head" . }}
diff --git a/templates/repo.html b/templates/repo.html
index 1cd9b5c..68ab269 100644
--- a/templates/repo.html
+++ b/templates/repo.html
@@ -1,4 +1,5 @@
{{ define "repo" }}
+<!DOCTYPE html>
<html>
{{ template "head" . }}
diff --git a/templates/tree.html b/templates/tree.html
index c4b7e4f..7ba065b 100644
--- a/templates/tree.html
+++ b/templates/tree.html
@@ -1,4 +1,5 @@
{{ define "tree" }}
+<!DOCTYPE html>
<html>
{{ template "head" . }}