don't recreate /var/www/html if it's already setup

This commit is contained in:
Jacob Lifshay 2026-08-16 19:58:31 -07:00
parent 6cd4e0c3b8
commit 774cc02ac3
Signed by: programmerjake
SSH key fingerprint: SHA256:HnFTLGpSm4Q4Fj502oCFisjZSoakwEuTsJJMSke63RQ

View file

@ -158,12 +158,14 @@ user_1000="$(getent passwd 1000)"
sudo -u git chmod 600 ~git/.ssh/authorized_keys
write_config --src templates/usr/local/bin/gitea --dest /usr/local/bin/gitea --mode 755
mkdir -p /etc/forgejo
rm -rf /var/www/html
mkdir -p /var/www/html
chown git:git /var/www/html
chmod 775 /var/www/html
(cd /var/www/html && sudo -u git git init --no-initial-branch)
(cd /var/www/html && sudo -u git git remote add -t heads/rendered --mirror=fetch origin /data/git/repositories/libre-chip/website.git)
if [[ ! -d /var/www/html/.git ]]; then
rm -rf /var/www/html
mkdir -p /var/www/html
chown git:git /var/www/html
chmod 775 /var/www/html
(cd /var/www/html && sudo -u git git init --no-initial-branch)
(cd /var/www/html && sudo -u git git remote add -t heads/rendered --mirror=fetch origin /data/git/repositories/libre-chip/website.git)
fi
chown root:git /etc/forgejo
chmod 770 /etc/forgejo
if [[ ! -f /etc/forgejo/app.ini ]]; then