feat: complete local camera and operations acceptance
Heimdall Gitea / Detect CI scope (pull_request) Successful in 1m27s
Heimdall Gitea / Build and tests (pull_request) Failing after 12m27s
Heimdall Gitea / Build and scan server image (pull_request) Skipped
Heimdall Gitea / Build and scan agent image (pull_request) Skipped
Heimdall Gitea / Build and scan NVIDIA Agent image (pull_request) Skipped
Heimdall Gitea / Publish Docker Hub latest tags (pull_request) Skipped
Heimdall Gitea / Publish versioned release (pull_request) Skipped
Heimdall Gitea / CI policy (pull_request) Failing after 4s
Heimdall Gitea / Detect CI scope (pull_request) Successful in 1m27s
Heimdall Gitea / Build and tests (pull_request) Failing after 12m27s
Heimdall Gitea / Build and scan server image (pull_request) Skipped
Heimdall Gitea / Build and scan agent image (pull_request) Skipped
Heimdall Gitea / Build and scan NVIDIA Agent image (pull_request) Skipped
Heimdall Gitea / Publish Docker Hub latest tags (pull_request) Skipped
Heimdall Gitea / Publish versioned release (pull_request) Skipped
Heimdall Gitea / CI policy (pull_request) Failing after 4s
This commit is contained in:
1 parent
ae3203222b
commit
3208bc93fe
52 files changed
+1193
-106
No files matched your search
+1
-1
@@ -10,7 +10,7 @@ RUN dotnet publish src/Heimdall.Web/Heimdall.Web.csproj -c Release --no-restore
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:10.0-noble@sha256:de0ee358cdd672f7017a003bed21e9ac9ed48a27c922a59b18175b6e82fa7fee
|
||||
WORKDIR /app
|
||||
RUN apt-get update -qq && apt-get install -y --no-install-recommends wget tzdata && rm -rf /var/lib/apt/lists/*
|
||||
RUN apt-get update -qq && apt-get install -y --no-install-recommends wget tzdata tesseract-ocr tesseract-ocr-eng && rm -rf /var/lib/apt/lists/*
|
||||
ENV ASPNETCORE_URLS=http://+:8080
|
||||
COPY --from=build /out/ ./
|
||||
EXPOSE 8080
|
||||
|
||||
@@ -22,7 +22,8 @@ docker compose --env-file .env -f docker-compose.backup.yml up -d
|
||||
|
||||
Le Central et PostgreSQL doivent d'abord être démarrés. Le service `backup`
|
||||
rejoint le réseau partagé et tourne dans un conteneur PostgreSQL 17-alpine
|
||||
avec crontab interne. Les dumps sont stockés dans `backup_data`; l'upload
|
||||
avec crontab interne, AWS CLI et GNU coreutils (pour le calcul portable des seuils
|
||||
de rétention Alpine). Les dumps sont stockés dans `backup_data`; l'upload
|
||||
RustFS/S3 est facultatif.
|
||||
Le service monte aussi le volume `heimdall_data` du Compose Central : les
|
||||
objets stockés localement et les clés Data Protection sont archivés ensemble.
|
||||
|
||||
@@ -19,4 +19,7 @@ services:
|
||||
capabilities: [gpu]
|
||||
|
||||
agent-state-init:
|
||||
image: heimdall-agent:local
|
||||
image: heimdall-agent:gpu-local
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: docker/Dockerfile.agent.gpu
|
||||
@@ -30,10 +30,9 @@ services:
|
||||
entrypoint: ["/bin/sh", "-c"]
|
||||
command:
|
||||
- |
|
||||
set -e
|
||||
export POSTGRES_PASSWORD="$$(cat /run/secrets/db_password)"
|
||||
apk add --no-cache curl bash >/dev/null 2>&1 || true
|
||||
curl -fsSL https://dl.min.io/client/mc/release/linux-amd64/mc -o /usr/local/bin/mc || true
|
||||
chmod +x /usr/local/bin/mc 2>/dev/null || true
|
||||
apk add --no-cache aws-cli bash coreutils
|
||||
echo '0 2 * * * bash /scripts/backup.sh >> /var/log/backup.log 2>&1' > /tmp/crontab.txt
|
||||
echo '15 2 * * * bash /scripts/backup-protected-data.sh >> /var/log/backup-protected-data.log 2>&1' >> /tmp/crontab.txt
|
||||
echo '0 3 * * 0 bash /scripts/backup-rustfs.sh >> /var/log/backup-rustfs.log 2>&1' >> /tmp/crontab.txt
|
||||
|
||||
@@ -53,6 +53,7 @@ services:
|
||||
LiveMedia__IceServers__0__Urls__0: ${HEIMDALL_STUN_URL:-}
|
||||
LiveMedia__Turn__Urls__0: ${HEIMDALL_TURN_URL:-}
|
||||
LiveMedia__Turn__SharedSecret: ${HEIMDALL_TURN_SHARED_SECRET:-}
|
||||
Recordings__StorageQuota__MaxBytes: ${RECORDING_STORAGE_QUOTA_MAX_BYTES:-1099511627776}
|
||||
Sentry__Dsn: ${SENTRY_DSN:-}
|
||||
Sentry__TracesSampleRate: ${SENTRY_TRACES_SAMPLE_RATE:-0.05}
|
||||
Sentry__Release: ${SENTRY_RELEASE:-}
|
||||
|
||||
@@ -7,10 +7,14 @@ services:
|
||||
HEIMDALL_WEBRTC_ALLOWED_ORIGIN: ${HEIMDALL_WEBRTC_ALLOWED_ORIGIN:?Set the local Central origin}
|
||||
MTX_AUTHMETHOD: http
|
||||
MTX_AUTHHTTPADDRESS: ${HEIMDALL_MEDIAMTX_AUTH_URL:?Set the Central callback URL}
|
||||
MTX_WEBRTCALLOWORIGINS: ${HEIMDALL_WEBRTC_ALLOWED_ORIGIN:?Set the local Central origin}
|
||||
# The browser receives this ICE port in SDP; keep the published host port
|
||||
# identical so Docker NAT does not advertise an unreachable container port.
|
||||
MTX_WEBRTCLOCALUDPADDRESS: :${HEIMDALL_TEST_ICE_PORT:-18189}
|
||||
ports:
|
||||
- "127.0.0.1:${HEIMDALL_TEST_PUBLISH_PORT:-18555}:8554/tcp"
|
||||
- "127.0.0.1:${HEIMDALL_TEST_WHEP_PORT:-18889}:8889/tcp"
|
||||
- "127.0.0.1:${HEIMDALL_TEST_ICE_PORT:-18189}:8189/udp"
|
||||
- "127.0.0.1:${HEIMDALL_TEST_ICE_PORT:-18189}:${HEIMDALL_TEST_ICE_PORT:-18189}/udp"
|
||||
volumes:
|
||||
- ./mediamtx.local-test.yml:/mediamtx.yml:ro
|
||||
networks:
|
||||
|
||||
@@ -9,6 +9,8 @@ services:
|
||||
HEIMDALL_WEBRTC_ALLOWED_ORIGIN: ${HEIMDALL_WEBRTC_ALLOWED_ORIGIN:?Set the Central browser origin}
|
||||
MTX_AUTHMETHOD: http
|
||||
MTX_AUTHHTTPADDRESS: ${HEIMDALL_MEDIAMTX_AUTH_URL:?Set the Central MediaMTX callback URL}
|
||||
MTX_WEBRTCALLOWORIGINS: ${HEIMDALL_WEBRTC_ALLOWED_ORIGIN:?Set the Central browser origin}
|
||||
MTX_WEBRTCADDITIONALHOSTS: ${HEIMDALL_WEBRTC_PUBLIC_HOST:?Set the public WebRTC hostname}
|
||||
ports:
|
||||
- "${HEIMDALL_RTSPS_PORT:-8322}:8322/tcp"
|
||||
- "${HEIMDALL_WHEP_PORT:-8889}:8889/tcp"
|
||||
|
||||
@@ -43,6 +43,7 @@ services:
|
||||
LiveMedia__IceServers__0__Urls__0: ${HEIMDALL_STUN_URL:-}
|
||||
LiveMedia__Turn__Urls__0: ${HEIMDALL_TURN_URL:-}
|
||||
LiveMedia__Turn__SharedSecret: ${HEIMDALL_TURN_SHARED_SECRET:-}
|
||||
Recordings__StorageQuota__MaxBytes: ${RECORDING_STORAGE_QUOTA_MAX_BYTES:-1099511627776}
|
||||
ports:
|
||||
- "${WEB_PORT:-5000}:8080"
|
||||
volumes:
|
||||
|
||||
+2
-2
@@ -11,9 +11,9 @@ webrtcAddress: :8889
|
||||
webrtcEncryption: true
|
||||
webrtcServerCert: /certs/server.crt
|
||||
webrtcServerKey: /certs/server.key
|
||||
webrtcAllowOrigins: ['${HEIMDALL_WEBRTC_ALLOWED_ORIGIN}']
|
||||
webrtcAllowOrigins: []
|
||||
webrtcLocalUDPAddress: :8189
|
||||
webrtcAdditionalHosts: ['${HEIMDALL_WEBRTC_PUBLIC_HOST}']
|
||||
webrtcAdditionalHosts: []
|
||||
|
||||
pathDefaults:
|
||||
source: publisher
|
||||
|
||||
@@ -35,9 +35,14 @@ find "$ARCHIVE_DIR" -type f -name 'heimdall-data-*.tar.gz' -mtime "+$RETENTION_D
|
||||
if [[ "$SKIP_S3_UPLOAD" == "1" ]]; then
|
||||
log "S3 upload disabled by BACKUP_SKIP_S3_UPLOAD"
|
||||
elif [[ -n "$S3_ENDPOINT" && -n "$S3_ACCESS_KEY" && -n "$S3_SECRET_KEY" ]]; then
|
||||
command -v mc >/dev/null 2>&1 || die "mc is required to upload protected data backups"
|
||||
mc alias set heimdall-backup "$S3_ENDPOINT" "$S3_ACCESS_KEY" "$S3_SECRET_KEY" --api S3v4 >/dev/null
|
||||
mc cp "$ARCHIVE" "heimdall-backup/${S3_BUCKET}/backup/protected-data/$(basename "$ARCHIVE")"
|
||||
if command -v mc >/dev/null 2>&1; then
|
||||
mc alias set heimdall-backup "$S3_ENDPOINT" "$S3_ACCESS_KEY" "$S3_SECRET_KEY" --api S3v4 >/dev/null
|
||||
mc cp "$ARCHIVE" "heimdall-backup/${S3_BUCKET}/backup/protected-data/$(basename "$ARCHIVE")"
|
||||
elif command -v aws >/dev/null 2>&1; then
|
||||
AWS_ACCESS_KEY_ID="$S3_ACCESS_KEY" AWS_SECRET_ACCESS_KEY="$S3_SECRET_KEY" AWS_DEFAULT_REGION="${AWS_DEFAULT_REGION:-us-east-1}" aws --endpoint-url "$S3_ENDPOINT" s3 cp "$ARCHIVE" "s3://${S3_BUCKET}/backup/protected-data/$(basename "$ARCHIVE")"
|
||||
else
|
||||
die "Neither mc nor aws CLI is available to upload protected data backups"
|
||||
fi
|
||||
log "Uploaded protected data archive to the configured object store"
|
||||
else
|
||||
log "S3 credentials are not configured; the archive remains in the local backup volume"
|
||||
|
||||
@@ -76,7 +76,7 @@ else
|
||||
2>&1 | tail -10
|
||||
else
|
||||
# AWS CLI: sync with exclusion
|
||||
aws --endpoint-url "$S3_ENDPOINT" s3 sync \
|
||||
AWS_ACCESS_KEY_ID="$S3_ACCESS_KEY" AWS_SECRET_ACCESS_KEY="$S3_SECRET_KEY" AWS_DEFAULT_REGION="${AWS_DEFAULT_REGION:-us-east-1}" aws --endpoint-url "$S3_ENDPOINT" s3 sync \
|
||||
"s3://${S3_BUCKET}" \
|
||||
"s3://${S3_BUCKET}/${BACKUP_PREFIX}/${WEEK_TAG}" \
|
||||
--exclude "backup/*" \
|
||||
@@ -102,6 +102,14 @@ if [[ -n "$CUTOFF_WEEK" ]]; then
|
||||
mc rm --recursive --force "heimdall-backup/${S3_BUCKET}/${BACKUP_PREFIX}/${week}/" 2>/dev/null || true
|
||||
fi
|
||||
done
|
||||
else
|
||||
AWS_ACCESS_KEY_ID="$S3_ACCESS_KEY" AWS_SECRET_ACCESS_KEY="$S3_SECRET_KEY" AWS_DEFAULT_REGION="${AWS_DEFAULT_REGION:-us-east-1}" aws --endpoint-url "$S3_ENDPOINT" s3 ls "s3://${S3_BUCKET}/${BACKUP_PREFIX}/" 2>/dev/null | awk '$1 == "PRE" {print $2}' | while read -r week; do
|
||||
week="${week%/}"
|
||||
if [[ "$week" < "$CUTOFF_WEEK" ]]; then
|
||||
log " Deleting: ${BACKUP_PREFIX}/${week}/"
|
||||
AWS_ACCESS_KEY_ID="$S3_ACCESS_KEY" AWS_SECRET_ACCESS_KEY="$S3_SECRET_KEY" AWS_DEFAULT_REGION="${AWS_DEFAULT_REGION:-us-east-1}" aws --endpoint-url "$S3_ENDPOINT" s3 rm --recursive "s3://${S3_BUCKET}/${BACKUP_PREFIX}/${week}/" >/dev/null
|
||||
fi
|
||||
done
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
@@ -131,7 +139,7 @@ Total: ${TOTAL_SIZE} bytes
|
||||
if [[ "$CLIENT" == "mc" ]]; then
|
||||
echo "$MANIFEST" | mc pipe "heimdall-backup/${S3_BUCKET}/${MANIFEST_KEY}" 2>/dev/null
|
||||
else
|
||||
echo "$MANIFEST" | aws --endpoint-url "$S3_ENDPOINT" s3 cp - "s3://${S3_BUCKET}/${MANIFEST_KEY}" 2>/dev/null
|
||||
echo "$MANIFEST" | AWS_ACCESS_KEY_ID="$S3_ACCESS_KEY" AWS_SECRET_ACCESS_KEY="$S3_SECRET_KEY" AWS_DEFAULT_REGION="${AWS_DEFAULT_REGION:-us-east-1}" aws --endpoint-url "$S3_ENDPOINT" s3 cp - "s3://${S3_BUCKET}/${MANIFEST_KEY}" 2>/dev/null
|
||||
fi
|
||||
log "Manifest written: ${MANIFEST_KEY}"
|
||||
fi
|
||||
|
||||
@@ -109,8 +109,8 @@ if [[ -n "$S3_ENDPOINT" ]]; then
|
||||
mc cp "$DUMP_FILE" "heimdall-backup/${S3_BUCKET}/${S3_KEY}" 2>&1 | tail -3
|
||||
mc cp "$DUMP_FILE" "heimdall-backup/${S3_BUCKET}/${S3_LATEST_KEY}" 2>&1 | tail -3
|
||||
else
|
||||
aws --endpoint-url "$S3_ENDPOINT" s3 cp "$DUMP_FILE" "s3://${S3_BUCKET}/${S3_KEY}" 2>&1 | tail -3
|
||||
aws --endpoint-url "$S3_ENDPOINT" s3 cp "$DUMP_FILE" "s3://${S3_BUCKET}/${S3_LATEST_KEY}" 2>&1 | tail -3
|
||||
AWS_ACCESS_KEY_ID="$S3_ACCESS_KEY" AWS_SECRET_ACCESS_KEY="$S3_SECRET_KEY" AWS_DEFAULT_REGION="${AWS_DEFAULT_REGION:-us-east-1}" aws --endpoint-url "$S3_ENDPOINT" s3 cp "$DUMP_FILE" "s3://${S3_BUCKET}/${S3_KEY}" 2>&1 | tail -3
|
||||
AWS_ACCESS_KEY_ID="$S3_ACCESS_KEY" AWS_SECRET_ACCESS_KEY="$S3_SECRET_KEY" AWS_DEFAULT_REGION="${AWS_DEFAULT_REGION:-us-east-1}" aws --endpoint-url "$S3_ENDPOINT" s3 cp "$DUMP_FILE" "s3://${S3_BUCKET}/${S3_LATEST_KEY}" 2>&1 | tail -3
|
||||
fi
|
||||
log "Upload complete"
|
||||
fi
|
||||
@@ -141,6 +141,13 @@ if [[ -n "$S3_ENDPOINT" && "$IS_DRY_RUN" != "1" ]]; then
|
||||
mc rm "heimdall-backup/${S3_BUCKET}/${key}" 2>/dev/null || true
|
||||
fi
|
||||
done
|
||||
elif command -v aws >/dev/null 2>&1; then
|
||||
AWS_ACCESS_KEY_ID="$S3_ACCESS_KEY" AWS_SECRET_ACCESS_KEY="$S3_SECRET_KEY" AWS_DEFAULT_REGION="${AWS_DEFAULT_REGION:-us-east-1}" aws --endpoint-url "$S3_ENDPOINT" s3 ls "s3://${S3_BUCKET}/${S3_PREFIX}/" --recursive 2>/dev/null | awk '{print $4}' | while read -r key; do
|
||||
if [[ "$key" =~ ([0-9]{4}-[0-9]{2}-[0-9]{2})/ ]] && [[ "${BASH_REMATCH[1]}" < "$CUTOFF_DATE" ]]; then
|
||||
log " Deleting: $key"
|
||||
AWS_ACCESS_KEY_ID="$S3_ACCESS_KEY" AWS_SECRET_ACCESS_KEY="$S3_SECRET_KEY" AWS_DEFAULT_REGION="${AWS_DEFAULT_REGION:-us-east-1}" aws --endpoint-url "$S3_ENDPOINT" s3 rm "s3://${S3_BUCKET}/${key}" >/dev/null
|
||||
fi
|
||||
done
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -124,7 +124,7 @@ if [[ -n "$S3_KEY" ]]; then
|
||||
mc alias set heimdall-backup "$S3_ENDPOINT" "$S3_ACCESS_KEY" "$S3_SECRET_KEY" --api S3v4 2>/dev/null
|
||||
mc cp "heimdall-backup/${S3_BUCKET}/${S3_KEY}" "$FILE" 2>&1 | tail -3
|
||||
else
|
||||
aws --endpoint-url "$S3_ENDPOINT" s3 cp "s3://${S3_BUCKET}/${S3_KEY}" "$FILE" 2>&1 | tail -3
|
||||
AWS_ACCESS_KEY_ID="$S3_ACCESS_KEY" AWS_SECRET_ACCESS_KEY="$S3_SECRET_KEY" AWS_DEFAULT_REGION="${AWS_DEFAULT_REGION:-us-east-1}" aws --endpoint-url "$S3_ENDPOINT" s3 cp "s3://${S3_BUCKET}/${S3_KEY}" "$FILE" 2>&1 | tail -3
|
||||
fi
|
||||
log "Downloaded: $(du -h "$FILE" | cut -f1)"
|
||||
fi
|
||||
|
||||
Reference in new issue
Block a user