summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorYour Name <you@example.com>2026-02-07 19:58:55 +0800
committerYour Name <you@example.com>2026-02-07 19:58:55 +0800
commitd1cebc658174a16014c2a3847bdf55bb3553b7fb (patch)
tree843abd31aabf15bdf9c78314c69922a5df586531 /docs
parent7bd52ea1ae10870cc2ff8aa5c237679c30ffda72 (diff)
more robust for ssh floods
Diffstat (limited to 'docs')
-rw-r--r--docs62
1 files changed, 62 insertions, 0 deletions
diff --git a/docs b/docs
new file mode 100644
index 0000000..89d3373
--- /dev/null
+++ b/docs
@@ -0,0 +1,62 @@
1CGIT CONTAINER
2
3Cgit with automatic HTTPS (cgit + caddy + Let's Encrypt).
4
5Requirements:
6 - Public IPv4 address
7 - Domain pointing to the IP
8 - /git directory for bare repos
9
10Host setup (one-time):
11 cat > /etc/sysctl.d/99-container-routing.conf << 'EOF'
12 net.ipv4.ip_forward=1
13 net.ipv4.conf.enp1s0.proxy_arp=1
14 EOF
15 sysctl -p /etc/sysctl.d/99-container-routing.conf
16 mkdir -p /git/.ssh
17
18Run:
19 ./start_container.sh
20
21Run (manual):
22 podman run -d \
23 --name cgit \
24 --network public-routed \
25 --ip 10.89.0.2 \
26 --cap-add=NET_ADMIN \
27 --env-file config.env \
28 -v cgit_data:/data \
29 -v /git:/git \
30 localhost/cgit
31
32 sleep 2
33 podman exec cgit ip addr add 37.27.166.242/32 dev eth0
34 ip route add 37.27.166.242/32 via 10.89.0.2
35
36SSH keys:
37 Drop .pub files in /git/.ssh/, they're combined into authorized_keys on run.
38
39Create repo:
40 git init --bare /git/myrepo
41
42Restart:
43 podman restart cgit
44
45Stop:
46 podman stop cgit && podman rm cgit && ip route del 37.27.166.242/32
47
48Cleanup:
49 podman stop cgit
50 podman rm cgit
51 podman volume rm cgit_data
52 ip route del 37.27.166.242/32
53 podman network rm public-routed # only if no other containers use it
54
55Logs:
56 podman logs -f cgit
57
58Processes:
59 podman exec cgit ps aux
60
61Shell:
62 podman exec -it cgit sh