Files
dawnline/scripts/release-notes.sh
T
Aemeath 34293fb8e5
Build packages / Version (push) Waiting to run
Dawnline 0.4.0
- Components tab replaces Updates: Dawnline, the AmneziaWG build for this
  firmware (Slava-Shchipunov 2.0 or 2Grey 3.1, Russian translation) and
  the system packages Dawnline adds, each checked, installed, reinstalled
  or rolled back in place, with What's new, versions and an activity log
- Automatic updates: daily check, install at a set time or right away,
  per component; AmneziaWG is left out by default and an automatic run
  never switches its build or generation
- Downloads verified against GitHub's sha256; mirrors are used only when
  GitHub is unreachable and the hash is known
- New installer: checks firmware, clock, space and DNS, lets you pick a
  release, shows the plan and asks first; --dry-run
- New uninstaller removes everything Dawnline added (cron, nft, firewall,
  routing, interfaces, packages it installed); --dry-run
- Works without AmneziaWG on the router: Overview, the setup wizard,
  Health and Components say what is missing and offer to install it
- Overview shows failed health checks as notices with their fix
- People list no longer reads the config from the browser: private keys
  stay on the router; personal links are fetched on demand
- Config changes are serialized under one lock, the nft table loads
  atomically and fails closed, and Dawnline never touches network
  sections it did not create
- The portal never opens system ports, keeps disabled devices disabled,
  rate-limits per address and counts days by the router's clock
- Settings and Diagnostics load their heavy parts in the background
- Release notes are written from the commits since the previous release
- Backend and admin UI split into small single-purpose modules
2026-10-16 02:14:15 +03:00

73 lines
2.7 KiB
Bash
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/sh
# shellcheck shell=dash
#
# Release notes for a tag, from the commits since the previous tag:
# scripts/release-notes.sh v0.3.1 [repository]
# PREV_TAG=v0.1.1 scripts/release-notes.sh v0.3.0 (compare with another tag)
#
# Release commits ("Dawnline 0.3.1") list their changes as "- " lines in the
# body: those become the points. Other commits add their title; merges are
# skipped. Wrapped points are joined into one line, so the Components tab
# (and anything else reading the release) gets one change per line.
set -eu
TAG="${1:?usage: release-notes.sh <tag> [owner/repo]}"
REPO="${2:-tickcount/luci-app-dawnline}"
git rev-parse -q --verify "$TAG^{commit}" >/dev/null || {
echo "release-notes: no tag $TAG" >&2
exit 1
}
# The previous release: the nearest older tag, or PREV_TAG when a tag was never published.
PREV="${PREV_TAG:-$(git describe --tags --abbrev=0 --match 'v[0-9]*' "$TAG^" 2>/dev/null || true)}"
if [ -n "$PREV" ] && ! git rev-parse -q --verify "$PREV^{commit}" >/dev/null; then
echo "release-notes: no tag $PREV" >&2
exit 1
fi
RANGE="$TAG"
[ -n "$PREV" ] && RANGE="$PREV..$TAG"
# git log runs alone first: a failure must stop the script, not vanish into the pipe.
git log --no-merges --format='%s' "$RANGE" >/dev/null
# One record per commit, newest first: the subject, then the body; records end with RS (\036).
points="$(git log --no-merges --format='%s%n%b%x1e' "$RANGE" | awk '
BEGIN { RS = "\036" }
{
n = split($0, line, "\n")
title = ""
for (i = 1; i <= n; i++) if (line[i] != "") { title = line[i]; start = i + 1; break }
if (title == "") next
got = 0; cur = ""
for (i = start; i <= n; i++) {
if (line[i] ~ /^[ \t]*[-*][ \t]+/) {
if (cur != "") { print "- " cur; got = 1 }
cur = line[i]; sub(/^[ \t]*[-*][ \t]+/, "", cur)
} else if (cur != "" && line[i] ~ /^[ \t]+[^ \t]/) {
l = line[i]; sub(/^[ \t]+/, "", l); cur = cur " " l
} else if (cur != "") { print "- " cur; got = 1; cur = "" }
}
if (cur != "") { print "- " cur; got = 1 }
# A release commit without a list says nothing new; any other commit is its title.
if (!got && title !~ /^(Dawnline )?v?[0-9]+\.[0-9]+(\.[0-9]+)?$/) print "- " title
}')"
if [ -n "$points" ]; then
printf "## What’s new\n\n%s\n\n" "$points"
fi
cat <<EOF
## Install
Install or upgrade on the router (OpenWrt 24.10 with opkg, or 25.12 with apk):
\`\`\`sh
sh -c "\$(wget -qO- https://raw.githubusercontent.com/$REPO/main/install.sh)"
\`\`\`
Or update from LuCI → Network → Dawnline → Components.
EOF
if [ -n "$PREV" ]; then
printf '\n**Full Changelog**: https://github.com/%s/compare/%s...%s\n' "$REPO" "$PREV" "$TAG"
else
printf '\n**Full Changelog**: https://github.com/%s/commits/%s\n' "$REPO" "$TAG"
fi