summaryrefslogtreecommitdiff
path: root/README
diff options
context:
space:
mode:
Diffstat (limited to 'README')
-rw-r--r--README29
1 files changed, 14 insertions, 15 deletions
diff --git a/README b/README
index 99ecf57..c71655b 100644
--- a/README
+++ b/README
@@ -1,12 +1,11 @@
1CGIT-CADDY CONTAINER 1CGIT CONTAINER
2 2
3Cgit with automatic HTTPS (cgit + caddy + Let's Encrypt). 3Cgit with automatic HTTPS (cgit + caddy + Let's Encrypt).
4 4
5Requirements: 5Requirements:
6 - Public IPv4 address pointed to this machine 6 - Public IPv4 address
7 - /git directory on host for bare git repos 7 - Domain pointing to the IP
8 - Domain name pointing to the public IP 8 - /git directory for bare repos
9TLS certificates are auto-generated by Caddy and stored in a container volume.
10 9
11Host setup (one-time): 10Host setup (one-time):
12 cat > /etc/sysctl.d/99-container-routing.conf << 'EOF' 11 cat > /etc/sysctl.d/99-container-routing.conf << 'EOF'
@@ -14,12 +13,9 @@ Host setup (one-time):
14 net.ipv4.conf.enp1s0.proxy_arp=1 13 net.ipv4.conf.enp1s0.proxy_arp=1
15 EOF 14 EOF
16 sysctl -p /etc/sysctl.d/99-container-routing.conf 15 sysctl -p /etc/sysctl.d/99-container-routing.conf
17 mkdir -p /git 16 mkdir -p /git/.ssh
18 17
19Build: 18Run:
20 podman build -t cgit-caddy .
21
22Run (first time or after changes):
23 ./start_container.sh 19 ./start_container.sh
24 20
25Run (manual): 21Run (manual):
@@ -31,19 +27,25 @@ Run (manual):
31 --env-file config.env \ 27 --env-file config.env \
32 -v cgit_data:/data \ 28 -v cgit_data:/data \
33 -v /git:/git \ 29 -v /git:/git \
34 localhost/cgit-caddy 30 localhost/cgit
35 31
36 sleep 2 32 sleep 2
37 podman exec cgit ip addr add 37.27.166.242/32 dev eth0 33 podman exec cgit ip addr add 37.27.166.242/32 dev eth0
38 ip route add 37.27.166.242/32 via 10.89.0.2 34 ip route add 37.27.166.242/32 via 10.89.0.2
39 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
40Restart: 42Restart:
41 podman restart cgit 43 podman restart cgit
42 44
43Stop: 45Stop:
44 podman stop cgit && podman rm cgit && ip route del 37.27.166.242/32 46 podman stop cgit && podman rm cgit && ip route del 37.27.166.242/32
45 47
46Cleanup (remove everything): 48Cleanup:
47 podman stop cgit 49 podman stop cgit
48 podman rm cgit 50 podman rm cgit
49 podman volume rm cgit_data 51 podman volume rm cgit_data
@@ -55,6 +57,3 @@ Logs:
55 57
56Shell: 58Shell:
57 podman exec -it cgit sh 59 podman exec -it cgit sh
58
59Create repo:
60 git init --bare /git/myrepo