aboutsummaryrefslogtreecommitdiff
path: root/init.sh
diff options
context:
space:
mode:
authoronelin <oscar@nelin.dk>2026-04-01 20:12:10 +0000
committeronelin <oscar@nelin.dk>2026-04-01 20:12:10 +0000
commit2489faf7ac22f45ab92545db1216ce8cfa4fae98 (patch)
tree6afe926498111511b9a2251d842948672493ad50 /init.sh
Initial commit
Diffstat (limited to 'init.sh')
-rw-r--r--init.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/init.sh b/init.sh
new file mode 100644
index 0000000..0734004
--- /dev/null
+++ b/init.sh
@@ -0,0 +1,21 @@
+#!/usr/bin/env sh
+set -e
+
+# Only create a new keypair if one does not exist
+! [ -f "$(whoami).pub" ] && ssh-keygen -f $(whoami) -t rsa -b 4096
+
+# Add the keyname and public key to .env file
+echo "SSH_KEY='$(cat $(whoami).pub)'" > .env
+echo "SSH_KEY_NAME='$(whoami)'" >> .env
+
+DOMAIN="localhost"
+echo -n "Enter a domain [${DOMAIN}]: "
+read ENTRY_DOMAIN
+DOMAIN="${ENTRY_DOMAIN:-$DOMAIN}"
+echo "DOMAIN=${DOMAIN}" >> .env
+
+# Build the image, and run initial setup
+docker-compose build gitolite
+docker-compose -f docker-compose-setup.yml up -d gitolite
+echo "All set."
+echo "Start the containers with docker-compose up -d"