[OCaml] Mobile-friendly clone of cgit.
Convert deploy README from Markdown to Org-mode
Changed files
deploy/README.md
@@ -1,71 +0,0 @@
1
Removed:
# Deploying ogit
2
Removed:
3
Removed:
## Prerequisites
4
Removed:
5
Removed:
- Debian 11 (or similar) x86_64 VPS
6
Removed:
- Nginx configured as a reverse proxy (not covered here)
7
Removed:
- Bare git repositories under a common root (e.g. `/srv/git`)
8
Removed:
9
Removed:
## Steps
10
Removed:
11
Removed:
### 1. Create the service user
12
Removed:
13
Removed:
```sh
14
Removed:
useradd --system --shell /usr/sbin/nologin --home-dir /nonexistent ogit
15
Removed:
```
16
Removed:
17
Removed:
Ensure the `ogit` user can read your git repositories:
18
Removed:
19
Removed:
```sh
20
Removed:
usermod -aG git ogit # if repos are group-readable by 'git'
21
Removed:
```
22
Removed:
23
Removed:
### 2. Install the binary
24
Removed:
25
Removed:
```sh
26
Removed:
cp dist/ogit /usr/local/bin/ogit
27
Removed:
chmod 755 /usr/local/bin/ogit
28
Removed:
```
29
Removed:
30
Removed:
### 3. Install the configuration
31
Removed:
32
Removed:
```sh
33
Removed:
mkdir -p /etc/ogit
34
Removed:
cp deploy/config.toml /etc/ogit/config.toml
35
Removed:
```
36
Removed:
37
Removed:
Edit `/etc/ogit/config.toml` to match your environment:
38
Removed:
39
Removed:
- `user` — displayed in the footer copyright
40
Removed:
- `git_project_root` — path to the directory containing your bare repos
41
Removed:
- `host` — bind address (keep `127.0.0.1` when behind Nginx)
42
Removed:
- `port` — port Nginx will proxy to
43
Removed:
44
Removed:
### 4. Install and start the service
45
Removed:
46
Removed:
```sh
47
Removed:
cp deploy/ogit.service /etc/systemd/system/ogit.service
48
Removed:
systemctl daemon-reload
49
Removed:
systemctl enable --now ogit
50
Removed:
```
51
Removed:
52
Removed:
### 5. Verify
53
Removed:
54
Removed:
```sh
55
Removed:
curl http://127.0.0.1:8081/
56
Removed:
systemctl status ogit
57
Removed:
```
58
Removed:
59
Removed:
## Updating
60
Removed:
61
Removed:
```sh
62
Removed:
systemctl stop ogit
63
Removed:
cp dist/ogit /usr/local/bin/ogit
64
Removed:
systemctl start ogit
65
Removed:
```
66
Removed:
67
Removed:
## Logs
68
Removed:
69
Removed:
```sh
70
Removed:
journalctl -u ogit -f
71
Removed:
```
deploy/README.org
@@ -0,0 +1,73 @@
1
Added:
# -*- mode: org; -*-
2
Added:
3
Added:
#+TITLE: Deploying ogit
4
Added:
5
Added:
* Prerequisites
6
Added:
7
Added:
- Debian 11 (or similar) x86_64 VPS
8
Added:
- Nginx configured as a reverse proxy (not covered here)
9
Added:
- Bare git repositories under a common root (e.g. ~/srv/git~)
10
Added:
11
Added:
* Steps
12
Added:
13
Added:
** 1. Create the service user
14
Added:
15
Added:
#+begin_src sh
16
Added:
useradd --system --shell /usr/sbin/nologin --home-dir /nonexistent ogit
17
Added:
#+end_src
18
Added:
19
Added:
Ensure the =ogit= user can read your git repositories:
20
Added:
21
Added:
#+begin_src sh
22
Added:
usermod -aG git ogit # if repos are group-readable by 'git'
23
Added:
#+end_src
24
Added:
25
Added:
** 2. Install the binary
26
Added:
27
Added:
#+begin_src sh
28
Added:
cp dist/ogit /usr/local/bin/ogit
29
Added:
chmod 755 /usr/local/bin/ogit
30
Added:
#+end_src
31
Added:
32
Added:
** 3. Install the configuration
33
Added:
34
Added:
#+begin_src sh
35
Added:
mkdir -p /etc/ogit
36
Added:
cp deploy/config.toml /etc/ogit/config.toml
37
Added:
#+end_src
38
Added:
39
Added:
Edit ~/etc/ogit/config.toml~ to match your environment:
40
Added:
41
Added:
- =user= — displayed in the footer copyright
42
Added:
- =git_project_root= — path to the directory containing your bare repos
43
Added:
- =host= — bind address (keep =127.0.0.1= when behind Nginx)
44
Added:
- =port= — port Nginx will proxy to
45
Added:
46
Added:
** 4. Install and start the service
47
Added:
48
Added:
#+begin_src sh
49
Added:
cp deploy/ogit.service /etc/systemd/system/ogit.service
50
Added:
systemctl daemon-reload
51
Added:
systemctl enable --now ogit
52
Added:
#+end_src
53
Added:
54
Added:
** 5. Verify
55
Added:
56
Added:
#+begin_src sh
57
Added:
curl http://127.0.0.1:8081/
58
Added:
systemctl status ogit
59
Added:
#+end_src
60
Added:
61
Added:
* Updating
62
Added:
63
Added:
#+begin_src sh
64
Added:
systemctl stop ogit
65
Added:
cp dist/ogit /usr/local/bin/ogit
66
Added:
systemctl start ogit
67
Added:
#+end_src
68
Added:
69
Added:
* Logs
70
Added:
71
Added:
#+begin_src sh
72
Added:
journalctl -u ogit -f
73
Added:
#+end_src
lib/views.ml
@@ -230,7 +230,7 @@
230
230
in
231
231
HTML.(nav [ class_ "breadcrumbs" ] (interleave (root_link :: crumbs)))
232
232
233
Removed:
let files repo (trail : (string * string) list) (tree : Resolvers.Tree.t) =
233
Added:
let files repo trail (tree : Resolvers.Tree.t) =
234
234
respond
235
235
@@ Page.render ~page_title:(page_title repo)
236
236
{
@@ -241,7 +241,7 @@
241
241
content = HTML.[ breadcrumbs repo trail; ul [] @@ List.map (li_of_entry repo) tree.entries ];
242
242
}
243
243
244
Removed:
let file repo (trail : (string * string) list) (blob : Resolvers.Blob.t) =
244
Added:
let file repo trail (blob : Resolvers.Blob.t) =
245
245
let to_numbered_line number line =
246
246
let n = number + 1 in
247
247
HTML.