Pass Gitea credentials to remote-install, clean up after clone

This commit is contained in:
2026-06-13 20:53:58 +02:00
parent 643b1ccc61
commit 2b9a926338
3 changed files with 12 additions and 2 deletions
+6
View File
@@ -3,6 +3,9 @@ set -e
: "${WEBROOT:?WEBROOT is not set}"
: "${USER_REPO:?USER_REPO is not set}"
: "${GITEA_HOST:?GITEA_HOST is not set}"
: "${GITEA_USER:?GITEA_USER is not set}"
: "${GITEA_TOKEN:?GITEA_TOKEN is not set}"
echo "==> Installing PHP extensions"
apt-get install -y php-curl php-gd php-mbstring php-xml php-zip php-yaml php-intl
@@ -15,8 +18,11 @@ mv grav-admin/* grav-admin/.htaccess .
rm -rf grav-admin grav-admin.zip
echo "==> Cloning user repo"
printf 'machine %s\nlogin %s\npassword %s\n' "$GITEA_HOST" "$GITEA_USER" "$GITEA_TOKEN" > ~/.netrc
chmod 600 ~/.netrc
rm -rf user
git clone "$USER_REPO" user
rm ~/.netrc
echo "==> Setting permissions"
find "$WEBROOT" -type f -exec chmod 664 {} \;