mirror of
https://github.com/multipleof4/git.planetrenox.com.git
synced 2026-01-14 00:17:57 +00:00
Update init.sh
This commit is contained in:
32
init.sh
32
init.sh
@@ -1,35 +1,9 @@
|
||||
#!/usr/bin/env sh
|
||||
set -eu
|
||||
mkdir -p /data/gitea/conf /data/gitea/custom /data/custom /data/caddy
|
||||
|
||||
# Bootstrap Gitea
|
||||
mkdir -p /data/gitea/conf /data/gitea/custom
|
||||
if [ ! -f /data/.bootstrapped ]; then
|
||||
/usr/local/bin/gitea migrate
|
||||
/usr/local/bin/gitea admin user create --admin \
|
||||
--username "${GITEA_ADMIN_USER}" \
|
||||
--password "${GITEA_ADMIN_PASSWD}" \
|
||||
--email "${GITEA_ADMIN_EMAIL}" || true
|
||||
/usr/local/bin/gitea admin user create --admin --username "${GITEA_ADMIN_USER}" --password "${GITEA_ADMIN_PASSWD}" --email "${GITEA_ADMIN_EMAIL}" || true
|
||||
touch /data/.bootstrapped
|
||||
fi
|
||||
|
||||
# Pull Gitea customizations
|
||||
if [ -n "${CUSTOM_REPO_URL:-}" ]; then
|
||||
if [ ! -d /data/custom/.git ]; then
|
||||
git clone --depth 1 "${CUSTOM_REPO_URL}" /data/custom || true
|
||||
else
|
||||
git -C /data/custom pull --ff-only || true
|
||||
fi
|
||||
rsync -a --delete /data/custom/ /data/gitea/custom/
|
||||
fi
|
||||
|
||||
# Pull Caddy config
|
||||
if [ -n "${CADDY_REPO_URL:-}" ]; then
|
||||
if [ ! -d /data/caddyrepo/.git ]; then
|
||||
git clone --depth 1 "${CADDY_REPO_URL}" /data/caddyrepo || true
|
||||
else
|
||||
git -C /data/caddyrepo pull --ff-only || true
|
||||
fi
|
||||
if [ -f "/data/caddyrepo/Caddyfile" ]; then
|
||||
cp "/data/caddyrepo/Caddyfile" /data/caddy/Caddyfile
|
||||
fi
|
||||
fi
|
||||
exec /usr/local/bin/gitea
|
||||
|
||||
Reference in New Issue
Block a user