Some miscellaneous things I've used for setting up Gogs on git.cryto.net.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
689 B

HOSTNAME="git.cryto.net"
BASEPATH="/home/git/old-repositories/projects/joepie91"
OWNER_ID="$1"
CSRF=`cat ./cookies.txt | grep _csrf | cut -f 7`
while read REPO; do
REPONAME=`echo "$REPO" | sed "s/\.git\$//"`
curl "https://$HOSTNAME/repo/migrate" \
-b "./cookies.txt" \
-H 'origin: null' \
-H 'content-type: application/x-www-form-urlencoded' \
-H "authority: $HOSTNAME" \
--data "_csrf=$CSRF" \
--data-urlencode "clone_addr=$BASEPATH/$REPO" \
--data-urlencode "uid=$OWNER_ID" \
--data-urlencode "auth_username=" \
--data-urlencode "auth_password=" \
--data-urlencode "repo_name=$REPONAME" \
--data-urlencode "description=Automatically migrated from Gitolite"
done