93 Commits

Author SHA1 Message Date
e12d04fe18
wip: feat(calendar): calculate fixed and floating yearl and monthly events 2026-09-16 16:39:54 -06:00
09459fc152
feat: add cmd/smbtest for debugging smb connection issues 2026-09-16 16:39:54 -06:00
d27f7c3b9c
ref(cmd/monorelease): fix tag and version output, start flagset 2026-09-16 16:39:54 -06:00
a8e0fbcb25
WIP: feat(cmd/monorelease): fix versioning 2026-09-16 16:39:54 -06:00
cc6ca7c886
WIP: feat(cmd/monorelease): better table 2026-09-16 16:39:54 -06:00
3a81162b4a
WIP: feat(cmd/monorelease): show table 2026-09-16 16:39:54 -06:00
5517514e05
WIP: feat(cmd/monorelease): show bins 2026-09-16 16:39:54 -06:00
f45dce7e7a
WIP: feat: add cmd/monorelease for checking version info 2026-09-16 16:39:54 -06:00
d6119ce46f
feat: add cmd/api-example as server boilerplate 2026-09-16 16:39:54 -06:00
c898659eaf
f: cmd/cli-example 2026-09-16 16:39:54 -06:00
a3a587e2be
feat: add cmd/cli-example for reference, and Ai context 2026-09-16 16:39:54 -06:00
b25b3295b8
fix(sqlmigrate): address high-severity review findings
- Collect: replace WalkDir with ReadDir to avoid subdirectory recursion
  and the risk of duplicate filenames silently overwriting each other
- shmigrate: check scanner.Err() after reading migrations log
- shmigrate: shell-quote all paths in generated scripts to prevent
  shell injection via migration filenames
- shmigrate: wrap errors with ErrQueryApplied sentinel for consistency
  with DB backends
- mustInit: remove stale err check that could never fire
- mustInit: fix swapped error messages (read vs create)
2026-09-16 16:39:54 -06:00
9a7a0f523c
chore: refresh downstream release checksums 2026-09-10 02:14:23 -06:00
ef11c70896
chore: use ippolicy v0.10.0 2026-09-10 02:13:21 -06:00
db2dbbc29c
chore: update stacked module releases 2026-09-10 02:09:48 -06:00
db1d4c55a9
refactor(sync): rename cacheable package 2026-09-10 02:08:36 -06:00
7990917414
chore(cmd/form2mail): update stacked release dependencies
(cherry picked from commit 97606f9d1d511cf76431843a989ed76bed9f39db)
2026-09-10 01:13:46 -06:00
3cbb52ee36
refactor(cmd/form2mail): rebase release onto main
(cherry picked from commit bf052b4904918913250a7108e704ef5ac4f1c725)
2026-09-10 01:13:46 -06:00
8648c5accb
refactor(cmd/check-ip): use released cache modules 2026-09-10 00:46:30 -06:00
4e85e00d5a
feat(cmd/check-ip): reference CLI exercising ipcohort + geoip + dataset 2026-09-10 00:46:30 -06:00
71671b7852
fix(sql-migrate): add missing period 'basename+".up.sql"' 2026-07-07 16:40:37 -06:00
bc3fb945af
chore(sql-migrate): lint 2026-07-07 16:30:13 -06:00
3e2b055c88
fix(sql-migrate): strip id\t prefix when parsing migrations.log
parseAndFixupBatches treated every line as a migration name, but the
new log format uses id\tname (tab-separated). This caused fixupMigration
to look for non-existent files like '05aba66a\t2026-06-03-003000_team-create.up.sql'.

Align with shmigrate.Applied() which already handles both formats.
2026-06-04 22:08:22 -06:00
5b3a4be3c2
fix(sql-migrate): remove local replace directives from go.mod
Replace directives pointing to local paths prevent `go install` from
working. Use published module versions (sqlmigrate v1.0.2, shmigrate
v1.0.2) so users can install with:

    go install github.com/therootcompany/golib/cmd/sql-migrate/v2@latest
2026-04-09 16:51:56 -06:00
dda4491c94
chore: golint fixes across all modules
Run scripts/golint: goimports, go fix, go vet, go mod tidy.
2026-04-09 14:23:33 -06:00
2256b12223
feat(sql-migrate): add sqlite and sqlcmd --sql-command aliases
- Use full flag names in command defaults (--no-align, --tuples-only, etc.)
- Add sqlite/sqlite3/lite alias for SQLite
- Add sqlcmd/mssql/sqlserver alias for SQL Server (go-sqlcmd, TDS 8.0)
- Add SQL Server help text with SQLCMD env vars and TLS docs
- Add sqlite and sqlcmd SELECT expressions for id+name migration log
2026-04-09 13:26:40 -06:00
9d4b0ab4af
fix(sql-migrate): remove accidental junk from go.* 2026-04-09 03:37:20 -06:00
5783d4fc7a
ref(backends): update all backends and sql-migrate to sqlmigrate v1.0.2
ExecUp/ExecDown now take (ctx, Migration, sql string) instead of
(ctx, Migration) with embedded Up/Down fields. Applied returns
[]Migration instead of []AppliedMigration.

- pgmigrate, mymigrate, litemigrate, msmigrate: new interface, v1.0.2 dep
- shmigrate: v1.0.2 dep, remove temporary replace directive
- cmd/sql-migrate: v1.0.2 dep
2026-04-09 03:27:35 -06:00
75e4a883b7
ref(sqlmigrate): split Migration into Migration + Script
Migration{ID, Name} is the identity type returned by Up/Down/Latest/Drop.
Script{Migration, Up, Down} holds collected SQL content from Collect().

Migrator interface now takes SQL as a separate parameter:
  ExecUp(ctx, Migration, sql string)
  ExecDown(ctx, Migration, sql string)

This separates identity from content — callers that track what ran
don't need to carry around SQL strings they'll never use.

Updates shmigrate to match (ignores the sql parameter, references
files on disk instead).
2026-04-09 03:21:46 -06:00
55298ac018
feat(sql-migrate): add ID-in-log for tab-delimited migration tracking
- logMigrationsSelect() returns DB-specific SELECT for id+name output,
  matching psql explicitly and erroring on unrecognized --sql-command
- logMigrationsQueryNote const for the comment header
- maybeUpgradeLogQuery() auto-upgrades old _migrations.sql on first run,
  replacing only the matching SELECT line
- Add UPGRADING help section pointing to sync subcommand
2026-04-08 17:23:50 -06:00
3e51c7b67a
fix(sqlmigrate): make n=0 an error in Up/Down, use -1 for "all"
Passing 0 to Up() or Down() is an easy mistake — it silently means
"all" which could be destructive. Now n=0 returns ErrInvalidN.
Convention: n > 0 for a specific count, n < 0 (typically -1) for all.
2026-04-08 15:51:25 -06:00
3547b7e409
ref(database/sqlmigrate): extract migration library with shmigrate backend
Factor the inline migration logic from cmd/sql-migrate into reusable
packages: database/sqlmigrate (core types, matching, file collection)
and database/sqlmigrate/shmigrate (shell script generation backend).

No behavior changes — the CLI produces identical output. The shmigrate
package implements the sqlmigrate.Migrator interface so other backends
(pgmigrate, mymigrate, etc.) can follow the same pattern.
2026-04-08 15:37:03 -06:00
c4964a5b65
chore(sql-migrate): remove dead subcmd != "create" checks in status/list cases
Go switch cases don't fall through, so subcmd can never be "create"
when we're inside the "status" or "list" case.
2026-04-08 15:21:04 -06:00
da7f45438c
doc(sql-migrate): add PGOPTIONS multi-tenant schema docs to help text
Document how to use PGOPTIONS="-c search_path=..." for multi-tenant
PostgreSQL migrations. Each schema gets its own _migrations table,
so tenants are migrated independently.
2026-04-08 15:06:41 -06:00
2080ae223d
fix(sql-migrate): reject explicit 'up 0' and 'down 0' as invalid
An explicit 0 argument should error, not silently run all pending (up)
or get handled as a special case (down). Change the guard from < 0 to
< 1 in both subcommands so '0' is treated as invalid input.
2026-04-08 14:57:55 -06:00
03d81a2b76
fix(sql-migrate): reject explicit 'up 0' as invalid
An explicit 0 argument to 'up' should error (like 'down 0' already
does), not silently run all pending migrations. Change the guard
from < 0 to < 1 to match 'down' behavior.
2026-04-08 14:41:09 -06:00
40fa1e876c
fix(sql-migrate): add missing --tuples-only to psql examples in help text
The psql command constant uses -A -t (--no-align --tuples-only) but
the help text and code comments only showed --no-align. Without
--tuples-only, psql prints column headers into migrations.log,
corrupting it.
2026-04-08 13:45:11 -06:00
404079f154
fix(sql-migrate): use goreleaser ldflags for version info
Replace hardcoded version const with var block populated by goreleaser
ldflags (version, commit, date). Add printVersion() matching the pattern
used by sibling commands (tcpfwd, smsapid, auth-proxy). Fix date var
shadowing in main() by renaming local to today.
2026-04-08 02:57:53 -06:00
075cc7b286
fix(sql-migrate): add missing ! to shebang in generated scripts
Generated shell scripts had `#/bin/sh` instead of `#!/bin/sh`,
meaning the shebang was treated as a comment rather than an
interpreter directive.
2026-04-06 00:39:36 -06:00
4a9c331ef9
Fix INSERT INTO _migrations ordering in create and fixup
The create subcommand generated .up.sql files with INSERT INTO
_migrations as the FIRST statement, before the actual DDL. If the
DDL fails, the migration is incorrectly marked as applied. Move the
INSERT to be the LAST statement, matching how .down.sql already puts
DELETE FROM _migrations last.

Also fix the automatic fixup logic to append (not prepend) missing
INSERT statements to existing .up.sql files.

Fixes #86
2026-03-30 15:58:21 -06:00
87b666ffd3
chore(cmd/sql-migrate): add .goreleaser.yaml 2026-03-28 17:16:40 -06:00
690cf90d67
chore(cmd/sql-migrate): add .goreleaser.yaml 2026-03-23 11:43:08 -06:00
1f61095873
feat(sql-migrate): add sync subcommand
Adds `sql-migrate sync` which outputs a shell script that refreshes
the local migrations.log from the DB by running _migrations.sql.
Uses `|| true` so a fresh DB with no _migrations table yields an
empty log (all migrations pending) rather than an error.

Usage:
  sql-migrate -d ./db/migrations sync | sh
  sql-migrate -d ./db/migrations up | sh
2026-03-23 11:42:23 -06:00
b50696f64d feat(sql-migrate): skip +-prefixed files in migrations directory (refs #68) 2026-03-23 11:39:49 -06:00
3487702bf7 fix(sql-migrate): use 6-digit zero-padded number in init migration filename (refs #68) 2026-03-23 11:39:49 -06:00
4895012d67 fix(sql-migrate): use portable SQL in _migrations table (closes #37) 2026-03-23 11:39:49 -06:00
a4cb1e3bfd
doc: clarify how to create users and tokens
Signed-off-by: AJ ONeal <aj@therootcompany.com>
2026-03-19 21:17:57 -06:00
516b23eac3
feat+ref(cmd/smsapid): add sms:* endpoints, csvauth, cli flags, etc 2026-03-03 03:11:26 -07:00
4bda5b4580
ref(cmd/auth-proxy): consolidate generic token logic in auth package 2026-03-03 03:08:27 -07:00
6e4f25ff5e
chore(release): add .goreleaser.yaml for auth-proxy 2026-03-01 01:20:48 -07:00