mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-07-24 14:52:53 +02:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 02fe12a144 |
@@ -51,14 +51,7 @@ msg_ok "Ran Database Migrations"
|
||||
|
||||
msg_info "Creating Admin User"
|
||||
cd /opt/sync-in
|
||||
ADMIN_PASS=$(openssl rand -base64 18)
|
||||
$STD npx sync-in-server create-user --role admin --login admin --password "${ADMIN_PASS}"
|
||||
cat <<EOF >~/sync-in.creds
|
||||
Sync-in Credentials
|
||||
====================
|
||||
Login: admin
|
||||
Password: ${ADMIN_PASS}
|
||||
EOF
|
||||
$STD npx sync-in-server create-user
|
||||
msg_ok "Created Admin User"
|
||||
|
||||
VERSION=$(node -pe "require('/opt/sync-in/node_modules/@sync-in/server/package.json').version" 2>/dev/null || echo "")
|
||||
|
||||
@@ -147,12 +147,15 @@ update_os() {
|
||||
msg_warn "apk update failed (dl-cdn.alpinelinux.org), trying alternate mirrors..."
|
||||
local alpine_mirrors="mirror.init7.net ftp.halifax.rwth-aachen.de mirrors.edge.kernel.org alpine.mirror.wearetriple.com mirror.leaseweb.com uk.alpinelinux.org dl-2.alpinelinux.org dl-4.alpinelinux.org"
|
||||
local apk_ok=false
|
||||
local alpine_branch
|
||||
alpine_branch="v$(. /etc/os-release 2>/dev/null; printf '%s' "${VERSION_ID:-}" | cut -d. -f1,2)"
|
||||
[ "$alpine_branch" = "v" ] && alpine_branch="latest-stable"
|
||||
for m in $(printf '%s\n' $alpine_mirrors | shuf); do
|
||||
if timeout 2 bash -c "echo >/dev/tcp/$m/80" 2>/dev/null; then
|
||||
msg_custom "${INFO}" "${YW}" "Attempting mirror: ${m}"
|
||||
cat <<EOF >/etc/apk/repositories
|
||||
http://$m/alpine/latest-stable/main
|
||||
http://$m/alpine/latest-stable/community
|
||||
http://$m/alpine/${alpine_branch}/main
|
||||
http://$m/alpine/${alpine_branch}/community
|
||||
EOF
|
||||
if $STD apk -U upgrade; then
|
||||
msg_ok "CDN set to ${m}: tests passed"
|
||||
|
||||
+6
-5
@@ -4653,9 +4653,10 @@ EOF
|
||||
# Continue with standard container setup
|
||||
if [ "$var_os" == "alpine" ]; then
|
||||
sleep 3
|
||||
local alpine_repo_branch="v${var_version}"
|
||||
pct exec "$CTID" -- /bin/sh -c 'cat <<EOF >/etc/apk/repositories
|
||||
https://dl-cdn.alpinelinux.org/alpine/latest-stable/main
|
||||
https://dl-cdn.alpinelinux.org/alpine/latest-stable/community
|
||||
https://dl-cdn.alpinelinux.org/alpine/'"${alpine_repo_branch}"'/main
|
||||
https://dl-cdn.alpinelinux.org/alpine/'"${alpine_repo_branch}"'/community
|
||||
EOF'
|
||||
pct exec "$CTID" -- ash -c 'set -a; [ -f /etc/profile.d/90-http-proxy.sh ] && . /etc/profile.d/90-http-proxy.sh; set +a; apk add bash newt curl openssh nano mc ncurses jq' >>"$BUILD_LOG" 2>&1 || {
|
||||
msg_warn "apk install failed (dl-cdn.alpinelinux.org), trying alternate mirrors..."
|
||||
@@ -4666,11 +4667,11 @@ EOF'
|
||||
set +a
|
||||
ALPINE_MIRRORS="mirror.init7.net ftp.halifax.rwth-aachen.de mirrors.edge.kernel.org alpine.mirror.wearetriple.com mirror.leaseweb.com uk.alpinelinux.org dl-2.alpinelinux.org dl-4.alpinelinux.org"
|
||||
for m in $(printf "%s\n" $ALPINE_MIRRORS | shuf); do
|
||||
if wget -q --spider --timeout=2 "http://$m/alpine/latest-stable/main/" 2>/dev/null; then
|
||||
if wget -q --spider --timeout=2 "http://$m/alpine/'"${alpine_repo_branch}"'/main/" 2>/dev/null; then
|
||||
echo " Attempting mirror: $m"
|
||||
cat <<EOF >/etc/apk/repositories
|
||||
http://$m/alpine/latest-stable/main
|
||||
http://$m/alpine/latest-stable/community
|
||||
http://$m/alpine/'"${alpine_repo_branch}"'/main
|
||||
http://$m/alpine/'"${alpine_repo_branch}"'/community
|
||||
EOF
|
||||
if apk update >/dev/null 2>&1 && apk add bash newt curl openssh nano mc ncurses jq >/dev/null 2>&1; then
|
||||
echo " CDN set to $m: tests passed"
|
||||
|
||||
Reference in New Issue
Block a user