feat(shangwutong): sync classifications and update conversations
This commit is contained in:
@@ -65,16 +65,16 @@ if ! offsite_info=$(findmnt -M "$offsite_dir" -n -o SOURCE,FSTYPE,MAJ:MIN); then
|
||||
echo "GOCHAT_BACKUP_OFFSITE_DIR must be an existing external mount point" >&2
|
||||
exit 1
|
||||
fi
|
||||
read -r offsite_source offsite_type offsite_device <<< "$offsite_info"
|
||||
read -r offsite_source offsite_type offsite_device <<<"$offsite_info"
|
||||
if [[ $offsite_source != "$GOCHAT_BACKUP_OFFSITE_SOURCE" || $offsite_type != "$GOCHAT_BACKUP_OFFSITE_FSTYPE" ]]; then
|
||||
echo "GOCHAT_BACKUP_OFFSITE_DIR mount source/type does not match the approved values" >&2
|
||||
exit 1
|
||||
fi
|
||||
case $offsite_type in
|
||||
tmpfs | devtmpfs | ramfs)
|
||||
echo "GOCHAT_BACKUP_OFFSITE_DIR must not use an in-memory filesystem" >&2
|
||||
exit 1
|
||||
;;
|
||||
tmpfs | devtmpfs | ramfs)
|
||||
echo "GOCHAT_BACKUP_OFFSITE_DIR must not use an in-memory filesystem" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
local_probe=${GOCHAT_BACKUP_DIR:-./backups/local}
|
||||
@@ -152,5 +152,5 @@ while IFS= read -r image; do
|
||||
fi
|
||||
echo "production image must be pinned to a sha256 digest: $image" >&2
|
||||
exit 1
|
||||
done <<< "$images"
|
||||
done <<<"$images"
|
||||
echo "production preflight passed"
|
||||
|
||||
@@ -12,7 +12,7 @@ cp "$tmp/external-db-client.crt" "$tmp/external-db-ca.crt"
|
||||
chmod 0644 "$tmp/external-db-ca.crt" "$tmp/external-db-client.crt"
|
||||
chmod 0640 "$tmp/external-db-client.key"
|
||||
|
||||
cat > "$tmp/bin/findmnt" <<'EOF'
|
||||
cat >"$tmp/bin/findmnt" <<'EOF'
|
||||
#!/usr/bin/env bash
|
||||
if [[ $1 == -M && $2 == "$GOCHAT_BACKUP_OFFSITE_DIR" ]]; then
|
||||
printf '%s %s %s\n' "$TEST_OFFSITE_SOURCE" "$TEST_OFFSITE_FSTYPE" "$TEST_OFFSITE_DEVICE"
|
||||
@@ -22,7 +22,7 @@ else
|
||||
exit 1
|
||||
fi
|
||||
EOF
|
||||
cat > "$tmp/bin/docker" <<'EOF'
|
||||
cat >"$tmp/bin/docker" <<'EOF'
|
||||
#!/usr/bin/env bash
|
||||
if [[ -n ${TEST_MUTABLE_IMAGE:-} ]]; then
|
||||
echo 'pgvector/pgvector:pg16'
|
||||
@@ -55,7 +55,7 @@ export TEST_LOCAL_SOURCE=/dev/sda1
|
||||
export TEST_LOCAL_DEVICE=8:1
|
||||
|
||||
run_preflight() {
|
||||
"$root/deploy/docker/preflight.sh" > "$tmp/output" 2>&1
|
||||
"$root/deploy/docker/preflight.sh" >"$tmp/output" 2>&1
|
||||
}
|
||||
|
||||
expect_failure() {
|
||||
@@ -101,7 +101,7 @@ printf '%s\n' 'https://alerts.example.test/gochat' >"$ALERTMANAGER_WEBHOOK_URL_F
|
||||
TEST_MUTABLE_IMAGE=1
|
||||
export TEST_MUTABLE_IMAGE
|
||||
expect_failure 'a mutable production image' 'must be pinned to a sha256 digest'
|
||||
"$root/deploy/docker/preflight.sh" --allow-local-images > "$tmp/output" 2>&1
|
||||
"$root/deploy/docker/preflight.sh" --allow-local-images >"$tmp/output" 2>&1
|
||||
grep -F 'production preflight passed' "$tmp/output" >/dev/null
|
||||
unset TEST_MUTABLE_IMAGE
|
||||
|
||||
@@ -116,7 +116,7 @@ GOCHAT_DATABASE_DSN='postgres://external_user:external_password@db.example.test:
|
||||
expect_failure 'duplicate allowed sslmode parameters' 'must contain exactly one sslmode'
|
||||
while IFS='|' read -r name GOCHAT_DATABASE_DSN; do
|
||||
expect_failure "$name" 'must use an external PostgreSQL host'
|
||||
done < "$root/deploy/docker/database_host_rejection_cases.txt"
|
||||
done <"$root/deploy/docker/database_host_rejection_cases.txt"
|
||||
GOCHAT_DATABASE_DSN='postgres://external_user:external_password@db.example.test:5432/gochat?sslmode=verify-full&sslrootcert=/tmp/ca.crt&sslcert=/run/secrets/external-db-client.crt&sslkey=/run/secrets/external-db-client.key'
|
||||
expect_failure 'a non-fixed certificate path' 'sslrootcert must use /run/secrets/external-db-ca.crt'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user