Initial commit: git-hangman-lab and keycloak-hangman-lab skills

This commit is contained in:
lyn
2026-03-21 14:04:00 +00:00
commit ac457349af
18 changed files with 964 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
#!/bin/bash
# Get the directory where this script is located
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
# Parse arguments
while [[ $# -gt 0 ]]; do
case $1 in
--username)
username="$2"
shift 2
;;
--email)
email="$2"
shift 2
;;
*)
echo "Unknown option: $1"
exit 1
;;
esac
done
# Check if username and email are provided
if [[ -z "$username" || -z "$email" ]]; then
echo "Usage: $0 --username <username> --email <email>"
exit 1
fi
# Generate git credentials (do not print secret)
pass_mgr generate --username "$username" --key git >/dev/null
# Create gitea user
"$SCRIPT_DIR/gitea" admin user create \
--username "$(pass_mgr get-username --key git)" \
--password "$(pass_mgr get-secret --key git)" \
--email "$email" \
--must-change-password=false