c885aba313
infra/dev: compose stack on the Mac (server kvitt-server:dev, on-demand backup), .env.example, build/up/logs/backup/copy-google-services scripts. No Caddy, no TLS (debug builds accept http to private LAN addresses, AC-2.8). Bind-mounted data. infra/backup: alpine 3.24.2 image and backup.sh (SPEC 10.9; Drive upload skipped when RCLONE_FOLDER_ID is empty). infra/README.md for the dev stack and Firebase. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
22 lines
993 B
Bash
Executable File
22 lines
993 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Copies the Firebase config (both Android clients, se.hagstedt.kvitt and se.hagstedt.kvitt.debug) from
|
|
# infra/secrets/google-services.json to android/app/google-services.json in this checkout. Both are git-ignored.
|
|
# Usage: infra/dev/copy-google-services.sh [source checkout] (default: this checkout; in a worktree, pass the main checkout)
|
|
set -euo pipefail
|
|
# shellcheck source=lib.sh
|
|
. "$(dirname "$0")/lib.sh"
|
|
|
|
src_root="${1:-$repo_root}"
|
|
src="$src_root/infra/secrets/google-services.json"
|
|
dst="$repo_root/android/app/google-services.json"
|
|
|
|
[[ -f "$src" ]] || { echo "copy-google-services.sh: $src not found (created by the M2c-dev Firebase setup)." >&2; exit 1; }
|
|
git -C "$repo_root" check-ignore -q "android/app/google-services.json" || {
|
|
echo "copy-google-services.sh: android/app/google-services.json is not git-ignored; refusing to copy." >&2
|
|
exit 1
|
|
}
|
|
mkdir -p "$(dirname "$dst")"
|
|
cp "$src" "$dst"
|
|
chmod 600 "$dst"
|
|
echo "Copied google-services.json to $dst"
|