Skip to content

Commit 219f56d

Browse files
feat: add InnoDB conversion, composite indexes, and optional Redis accounting (#5)
* feat: add InnoDB conversion, composite indexes, and optional Redis accounting - Convert MyISAM tables (radcheck, radreply, radusergroup, radgroupcheck, radgroupreply) to InnoDB for transaction support and crash recovery - Add composite indexes for freeradius-api query patterns - Add optional Redis accounting: buffer Interim-Update packets in Redis for batch processing (ACCT_REDIS_ENABLED=true, default: off) - Start/Stop packets always go to SQL for durability - Add freeradius-redis package to Docker image - Add Redis service to Docker Compose, Kubernetes, and Helm chart - Falls back to SQL-only if Redis is unreachable at startup * fix: update CI test for Redis service (3 healthy services, add Redis env vars)
1 parent 7ac782d commit 219f56d

19 files changed

Lines changed: 1543 additions & 2 deletions

.github/workflows/ci.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,11 @@ jobs:
194194
HEALTHCHECK_SECRET=testing123
195195
TZ=UTC
196196
RADIUS_ALLOW_PRIVATE_NETWORKS=true
197+
ACCT_REDIS_ENABLED=false
198+
REDIS_HOST=redis
199+
REDIS_PORT=6379
200+
REDIS_PASSWORD=
201+
REDIS_DB=0
197202
EOF
198203
# Strip leading whitespace from .env
199204
sed -i 's/^[[:space:]]*//' .env
@@ -209,7 +214,7 @@ jobs:
209214
HEALTHY=$(docker compose ps --format json | grep -c '"healthy"' || true)
210215
TOTAL=$(docker compose ps --format json | wc -l | tr -d ' ')
211216
echo " Healthy: $HEALTHY / $TOTAL ($i/90)"
212-
if [ "$HEALTHY" -ge 2 ] 2>/dev/null; then
217+
if [ "$HEALTHY" -ge 3 ] 2>/dev/null; then
213218
echo "All services are healthy!"
214219
break
215220
fi

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,7 @@ backups/
1010

1111
# Database dumps (prevent accidental commit of sensitive data)
1212
**/*.sql.gz
13-
**/*.sql
13+
**/*.sql
14+
15+
# Allow SQL migration scripts
16+
!scripts/*.sql

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Added
11+
12+
- Post-schema migration system: automatically applies InnoDB conversion and composite indexes after FreeRADIUS default schema import
13+
- Optional Redis accounting: buffer Interim-Update packets in Redis for batch processing (`ACCT_REDIS_ENABLED=true`)
14+
- Redis service in Docker Compose (always available, accounting opt-in via env var)
15+
- Redis Deployment and Service for Kubernetes
16+
- Redis StatefulSet for Helm chart with persistence and external Redis support
17+
- New environment variables: `ACCT_REDIS_ENABLED`, `REDIS_HOST`, `REDIS_PORT`, `REDIS_PASSWORD`, `REDIS_DB`
18+
- `freeradius-redis` package in Docker image for `rlm_redis` module
19+
1020
### Changed
1121

22+
- Tables `radcheck`, `radreply`, `radusergroup`, `radgroupcheck`, `radgroupreply` converted from MyISAM to InnoDB (enables transactions, row-level locking, crash recovery)
23+
- Added composite indexes: `radusergroup(username, groupname)`, `radgroupcheck(groupname, attribute)`, `radgroupreply(groupname, attribute)`, `radacct(username, acctstoptime)`, `radpostauth(authdate)`
24+
1225
- Upgraded FreeRADIUS to 3.2.8 from Debian sid with apt pinning
1326
- Replaced all `:latest` image tags with semantic versioning (`3.2.8`)
1427
- Removed `:latest` tag from CI pipeline (only semantic versions pushed)

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ RUN echo "deb http://deb.debian.org/debian sid main" > /etc/apt/sources.list.d/s
3232
RUN apt-get update && apt-get install -y --no-install-recommends \
3333
freeradius \
3434
freeradius-mysql \
35+
freeradius-redis \
3536
freeradius-utils \
3637
mariadb-client \
3738
gosu \
@@ -55,6 +56,7 @@ RUN usermod -aG freerad root \
5556

5657
# Copy entrypoint and set permissions
5758
COPY --link --chmod=755 scripts/entrypoint.sh /entrypoint.sh
59+
COPY --link scripts/post-schema.sql /entrypoint-post-schema.sql
5860

5961
EXPOSE 1812/udp 1813/udp
6062

0 commit comments

Comments
 (0)