summaryrefslogtreecommitdiff
path: root/start_container.sh
diff options
context:
space:
mode:
authorYour Name <you@example.com>2025-12-29 20:01:17 +0800
committerYour Name <you@example.com>2025-12-29 20:01:17 +0800
commit7bd52ea1ae10870cc2ff8aa5c237679c30ffda72 (patch)
treeaf72b9290a5e0cb7d2ae43752fb4ea3dba55bc1c /start_container.sh
parent745ca5a613d3dbac8143a62e4a90e9833422e023 (diff)
ssh keyfiles supportHEADmain
Diffstat (limited to 'start_container.sh')
-rwxr-xr-xstart_container.sh12
1 files changed, 11 insertions, 1 deletions
diff --git a/start_container.sh b/start_container.sh
index bf1c167..25fcb10 100755
--- a/start_container.sh
+++ b/start_container.sh
@@ -17,6 +17,16 @@ podman stop ${CONTAINER_NAME} 2>/dev/null || true
17podman rm ${CONTAINER_NAME} 2>/dev/null || true 17podman rm ${CONTAINER_NAME} 2>/dev/null || true
18ip route del ${PUBLIC_IP}/32 2>/dev/null || true 18ip route del ${PUBLIC_IP}/32 2>/dev/null || true
19 19
20# Rebuild authorized_keys from .pub files
21mkdir -p /git/.ssh
22rm -f /git/.ssh/authorized_keys
23cat /git/.ssh/*.pub > /git/.ssh/authorized_keys 2>/dev/null || true
24chmod 600 /git/.ssh/authorized_keys
25
26# Build image
27echo "Building image..."
28podman build -t cgit "$(dirname "$0")"
29
20# Run container 30# Run container
21podman run -d \ 31podman run -d \
22 --name ${CONTAINER_NAME} \ 32 --name ${CONTAINER_NAME} \
@@ -26,7 +36,7 @@ podman run -d \
26 --env-file "$(dirname "$0")/config.env" \ 36 --env-file "$(dirname "$0")/config.env" \
27 -v ${CONTAINER_NAME}_data:/data \ 37 -v ${CONTAINER_NAME}_data:/data \
28 -v /git:/git \ 38 -v /git:/git \
29 localhost/cgit-caddy 39 localhost/cgit
30 40
31# Setup public IP 41# Setup public IP
32sleep 2 42sleep 2