Compare commits

..

2 Commits

Author SHA1 Message Date
a4cdb7c125 Add require_daily_dashboard_visit setting
Add an optional setting (Settings > General > Navigation) that redirects
authenticated users to the dashboard on their first page view each day.
Includes the SystemSettings column, migration, settings form handling, and
UI toggle. Default is off.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-18 11:46:27 +02:00
1005f9459d Restore git operations in build-and-push.sh release mode and add self-update check
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-18 11:43:56 +02:00
2 changed files with 92 additions and 9 deletions

View File

@ -8,10 +8,9 @@ set -euo pipefail
# - Build & push Docker images for each service under ./containers/*
# - Two modes:
# t (test) = only push :dev
# r (release) = push :<version>, :dev, :latest
# version is read from the top of changelog.md
#
# No git operations: committing and tagging is done manually.
# r (release) = push :<version>, :dev, :latest, then commit + tag and
# push a release/<version> branch + tag to origin.
# Version is read from the top of changelog.md.
#
# Usage:
# ./build-and-push.sh [mode]
@ -25,14 +24,67 @@ set -euo pipefail
# ## vX.Y.Z — YYYY-MM-DD
# (the version is parsed from the first such line)
# - One Dockerfile per service under ./containers/<service>/Dockerfile
#
# ----------------------------------------------------------------------------
# Self-update notice (for humans AND for Claude):
#
# The canonical/master copy of this script lives at:
# /docker/develop/shared-integrations/tooling/docker-build-and-push/build-and-push.sh
#
# When this script is copied into a project repo, it may drift from master.
# On startup the script compares its own SCRIPT_VERSION to the master copy and
# warns if a newer version exists. It does NOT auto-overwrite (too risky during
# a release run).
#
# CLAUDE INSTRUCTION:
# If you (Claude) are about to invoke this script in a project repo, first
# check whether the master copy at the path above is newer (different
# SCRIPT_VERSION or differing file contents). If so, copy the master over
# the local copy BEFORE running, then proceed. Mention the update to the user.
# ============================================================================
SCRIPT_VERSION="1.2.0"
SCRIPT_MASTER_PATH="/docker/develop/shared-integrations/tooling/docker-build-and-push/build-and-push.sh"
DOCKER_REGISTRY="gitea.oskamp.info"
DOCKER_NAMESPACE="ivooskamp"
CHANGELOG_FILE="docs/changelog.md"
CONTAINERS_DIR="containers"
# --- Self-update check -------------------------------------------------------
# Compare this script to the canonical master copy and warn (don't overwrite).
self_update_check() {
local self_path="${BASH_SOURCE[0]}"
# Resolve to absolute path so a comparison against itself is detected.
local self_abs
self_abs="$(cd "$(dirname "$self_path")" 2>/dev/null && pwd)/$(basename "$self_path")" || self_abs="$self_path"
if [[ "$self_abs" == "$SCRIPT_MASTER_PATH" ]]; then
return 0 # We ARE the master copy.
fi
if [[ ! -f "$SCRIPT_MASTER_PATH" ]]; then
return 0 # Master not reachable from this host; silently skip.
fi
local master_version
master_version="$(grep -m1 -E '^SCRIPT_VERSION=' "$SCRIPT_MASTER_PATH" | sed -E 's/.*"([^"]+)".*/\1/')"
if [[ -n "$master_version" && "$master_version" != "$SCRIPT_VERSION" ]]; then
echo "[WARN] A newer build-and-push.sh is available."
echo " local : $SCRIPT_VERSION"
echo " master : $master_version ($SCRIPT_MASTER_PATH)"
echo " Update with: cp \"$SCRIPT_MASTER_PATH\" \"$self_abs\""
echo ""
elif ! cmp -s "$self_abs" "$SCRIPT_MASTER_PATH"; then
echo "[WARN] Local build-and-push.sh differs from master (same SCRIPT_VERSION=$SCRIPT_VERSION)."
echo " master : $SCRIPT_MASTER_PATH"
echo " Diff or update with: cp \"$SCRIPT_MASTER_PATH\" \"$self_abs\""
echo ""
fi
}
self_update_check
# --- Input: prompt if missing ------------------------------------------------
MODE="${1:-}"
if [[ -z "${MODE}" ]]; then
@ -227,10 +279,33 @@ for img in "${BUILT_IMAGES[@]}"; do
done
echo "============================================================"
echo ""
echo "[REMINDER] No git operations were performed. If this was a release,"
echo " commit and tag manually, e.g.:"
# --- Git: commit + release branch + tag (release mode only) -----------------
if [[ "$MODE" == "r" ]]; then
echo " git add -A && git commit -m \"Release ${VERSION}\""
echo " git tag -a ${VERSION} -m \"Release ${VERSION}\""
echo " git push && git push --tags"
if [[ ! -d ".git" ]]; then
echo "[WARN] Not a git checkout — skipping git commit/tag/push."
exit 0
fi
RELEASE_BRANCH="release/${VERSION}"
echo "[INFO] Preparing git release: branch=${RELEASE_BRANCH}, tag=${VERSION}"
# Stage everything and commit only if there's something to commit.
git add -A
if git diff --cached --quiet; then
echo "[INFO] Working tree clean — no commit needed."
else
git commit -m "Release ${VERSION}"
fi
# Create or move the annotated tag to current HEAD.
if git rev-parse -q --verify "refs/tags/${VERSION}" >/dev/null; then
echo "[WARN] Tag ${VERSION} already exists locally — leaving it as-is."
else
git tag -a "${VERSION}" -m "Release ${VERSION}"
fi
git push origin "HEAD:refs/heads/${RELEASE_BRANCH}"
git push origin "refs/tags/${VERSION}"
echo "[INFO] Pushed ${RELEASE_BRANCH} and tag ${VERSION} to origin."
fi

View File

@ -2,6 +2,14 @@
This file is the long-form append-only development log. It captures every change in detail and is summarised into `docs/changelog.md` at release time. Release markers (`## YYYY-MM-DD — Released as vX.Y.Z`) indicate which entries are already published.
## [2026-06-18] — Daily dashboard-visit setting
### Added
- **Optional "require dashboard visit on first page view each day" setting** (Settings → General → Navigation). New `require_daily_dashboard_visit` boolean column on `SystemSettings` (default `FALSE`), added by migration `migrate_system_settings_require_daily_dashboard_visit`. When enabled, authenticated users are redirected to the dashboard on their first page load each day before they can navigate elsewhere; when disabled (the default) the redirect logic in `create_app()` short-circuits and users can deep-link to any page. The General-tab form processes the checkbox alongside `ui_timezone`.
### Changed
- **`build-and-push.sh`: restored git operations in release mode and added a self-update check.** Release mode (`r`) again commits, tags, and pushes a `release/<version>` branch + tag to origin. On startup the script compares its `SCRIPT_VERSION` (now `1.2.0`) against the canonical master copy under `shared-integrations/tooling/docker-build-and-push/` and warns (without overwriting) when it has drifted.
## [2026-05-01d]
### Added