From c863e5fe21a245f6e5c11325f9cfddb19c4fd977 Mon Sep 17 00:00:00 2001 From: Philipp Date: Wed, 17 Sep 2025 15:26:20 +0200 Subject: [PATCH] cleanup deployment --- Makefile | 4 ++-- backup.sh | 6 ++++++ compose.yml | 15 --------------- 3 files changed, 8 insertions(+), 17 deletions(-) create mode 100644 backup.sh diff --git a/Makefile b/Makefile index a152205..11ba6f3 100644 --- a/Makefile +++ b/Makefile @@ -8,9 +8,9 @@ psql: update: read -p "Update will cause downtime of the server. Are you sure you want to continue? Press Ctrl+c to abort!" _ - $(COMPOSE) down $(COMPOSE) pull - $(COMPOSE) run inventree-server invoke update + $(COMPOSE) down + $(COMPOSE) run --rm inventree-server invoke update $(COMPOSE) up -d data: # podman does not autocreate data folder diff --git a/backup.sh b/backup.sh new file mode 100644 index 0000000..81ad1e5 --- /dev/null +++ b/backup.sh @@ -0,0 +1,6 @@ +#!/bin/sh +time=$(date +"%Y-%m-%dT%H:%M:%S%z") +dir=backup +[ -d "${dir}" ] || mkdir -p "${dir}" +docker compose run --rm -u postgres inventree-db sh -c 'PGPASSWORD=$POSTGRES_PASSWORD pg_dump -h inventree-db -p 5432 -U $POSTGRES_USER inventree' > "${dir}/${time}.sql" +# to restore: pg_restore -d newdb db.dump diff --git a/compose.yml b/compose.yml index b5c9c21..efafa65 100644 --- a/compose.yml +++ b/compose.yml @@ -79,21 +79,6 @@ services: - 8000 env_file: - .env - environment: - INVENTREE_SOCIAL_PROVIDERS: | - { - "openid_connect": { - "SERVERS": [{ - "id": "oidc", - "name": "Hacknang SSO", - "server_url": "${HKNG_OIDC_URL:?You must provide the 'HKNG_OIDC_URL' variable in the .env file}", - "APP": { - "client_id": "${HKNG_OIDC_CLIENT_ID:?You must provide the 'HKNG_OIDC_CLIENT_ID' variable in the .env file}", - "secret": "${HKNG_OIDC_CLIENT_SECRET:?You must provide the 'HKNG_OIDC_CLIENT_SECRET' variable in the .env file}" - } - }] - } - } depends_on: - inventree-db volumes: