diff --git a/Makefile b/Makefile index b59f8b73..7eed7013 100644 --- a/Makefile +++ b/Makefile @@ -59,7 +59,7 @@ all: bun run dev 2>&1 | tee ~/logs/`date '+%d-%m-%Y_%H:%M:%S'`.log update-dwd-klimafaktoren-cron: - pm2 start bun --name "update-dwd-klimafaktoren-cron" --cron "0 12 28 * *" -- src/cronjobs/update-dwd-klimafaktoren.ts + pm2 start bun --name "update-dwd-klimafaktoren-cron" --no-autorestart --cron "0 12 28 * *" -- src/cronjobs/update-dwd-klimafaktoren.ts prod: install-dependencies prisma-studio backup-database-cronjob update-dwd-klimafaktoren-cron bun run build diff --git a/docker-compose.yml b/docker-compose.yml index a96bb452..81ed8964 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,5 @@ version: '3' +name: database services: database: build: ./ diff --git a/recover-db-dev.bash b/recover-db-dev.bash index a26cf714..ca6d43b2 100644 --- a/recover-db-dev.bash +++ b/recover-db-dev.bash @@ -3,27 +3,33 @@ # === Configuration === BUCKET_NAME="ibc-db-backup" ENDPOINT_URL="https://s3.eu-central-3.ionoscloud.com" -LOCAL_DOWNLOAD_DIR="./" # Where to save the file +LOCAL_DOWNLOAD_DIR="./" -# === Get latest file from IONOS S3 bucket === -LATEST_FILE=$(aws s3api list-objects-v2 \ - --bucket "$BUCKET_NAME" \ - --prefix "data-dump" \ - --endpoint-url "$ENDPOINT_URL" \ - --query 'Contents | sort_by(@, &LastModified) | [-1].Key' \ - --output text) +# === Use filename from argument if provided === +if [ -n "$1" ]; then + LATEST_FILE="$1" +else + echo "📡 No filename provided, fetching latest..." + # === Get latest file from IONOS S3 bucket === + LATEST_FILE=$(aws --profile ionos s3api list-objects-v2 \ + --bucket "$BUCKET_NAME" \ + --prefix "full-dump" \ + --endpoint-url "$ENDPOINT_URL" \ + --query 'Contents | sort_by(@, &LastModified) | [-1].Key' \ + --output text) -# === Check if file was found === -if [ "$LATEST_FILE" == "None" ] || [ -z "$LATEST_FILE" ]; then - echo "❌ No matching .sql.br file found." - exit 1 + # === Check if file was found === + if [ "$LATEST_FILE" == "None" ] || [ -z "$LATEST_FILE" ]; then + echo "❌ No matching .sql.br file found." + exit 1 + fi fi FILENAME=$(basename "$LATEST_FILE") SQL_FILE="${FILENAME%.br}" # Remove .br suffix echo "📥 Downloading $LATEST_FILE" -aws s3 cp "s3://$BUCKET_NAME/$LATEST_FILE" "$LOCAL_DOWNLOAD_DIR" \ +aws --profile ionos s3 cp "s3://$BUCKET_NAME/$LATEST_FILE" "$LOCAL_DOWNLOAD_DIR" \ --endpoint-url "$ENDPOINT_URL" # === Decompress with Brotli === @@ -31,8 +37,8 @@ echo "🗜️ Decompressing $FILENAME -> $SQL_FILE" brotli -d "$FILENAME" # === Import into Postgres inside Docker === -echo "🐘 Importing into PostgreSQL (online-energieausweis-database-1:main)" -docker exec -i "online-energieausweis-database-1" env PGPASSWORD="hHMP8cd^N3SnzGRR" \ +echo "🐘 Importing into PostgreSQL (database:main)" +docker exec -i "database" env PGPASSWORD="hHMP8cd^N3SnzGRR" \ psql -U "main" -d "main" < "$SQL_FILE" echo "✅ Import complete." diff --git a/src/astro-typesafe-api-caller.ts b/src/astro-typesafe-api-caller.ts index c1e5a9e7..a9498bdd 100644 --- a/src/astro-typesafe-api-caller.ts +++ b/src/astro-typesafe-api-caller.ts @@ -17,8 +17,11 @@ export const createCaller = createCallerFactory({ "auth/access-token": await import("../src/pages/api/auth/access-token.ts"), "auth/passwort-vergessen": await import("../src/pages/api/auth/passwort-vergessen.ts"), "auth/refresh-token": await import("../src/pages/api/auth/refresh-token.ts"), + "auth/verification-code": await import("../src/pages/api/auth/verification-code.ts"), + "aufnahme": await import("../src/pages/api/aufnahme/index.ts"), "bedarfsausweis-gewerbe/[id]": await import("../src/pages/api/bedarfsausweis-gewerbe/[id].ts"), "bedarfsausweis-gewerbe": await import("../src/pages/api/bedarfsausweis-gewerbe/index.ts"), + "ausweise": await import("../src/pages/api/ausweise/index.ts"), "bedarfsausweis-wohnen/[id]": await import("../src/pages/api/bedarfsausweis-wohnen/[id].ts"), "bedarfsausweis-wohnen": await import("../src/pages/api/bedarfsausweis-wohnen/index.ts"), "bilder/[id]": await import("../src/pages/api/bilder/[id].ts"), diff --git a/src/components/Abrechnung/AbrechungTable.svelte b/src/components/Abrechnung/AbrechungTable.svelte index 03aa4efb..7cf3ba60 100644 --- a/src/components/Abrechnung/AbrechungTable.svelte +++ b/src/components/Abrechnung/AbrechungTable.svelte @@ -1,7 +1,6 @@ -