Commit Graph

295 Commits

Author SHA1 Message Date
yukkop 53dfd60b4c feat(package): gitea: add heatmap contribution model 2026-06-06 19:20:37 +00:00
yukkop 3299daf061 feat: db-tool: update hook realization 2026-06-06 18:17:16 +00:00
yukkop 592d1f04c5 feat: element-web: video messages 2026-06-06 05:25:02 +00:00
yukkop d76c0b0273 feat: vendor element-web 2026-06-05 18:55:22 +00:00
yukkop a30d1a93dd fix: element things 2026-06-05 10:55:51 +00:00
yukkop 35af6720ef fix 2026-06-03 15:03:05 +00:00
yukkop a33432d5de fix 2026-06-03 14:55:20 +00:00
yukkop 7152eb03de fix 2026-06-03 13:03:29 +00:00
yukkop 8e5ba8de7f fix 2026-06-03 12:37:44 +00:00
yukkop 7c10fda451 fix 2026-06-03 12:22:42 +00:00
yukkop ca88f92b1a fix 2026-06-03 09:19:12 +00:00
yukkop 5b5f119a65 fix 2026-06-03 09:08:05 +00:00
yukkop 8caf575946 fix 2026-06-03 08:54:08 +00:00
yukkop d644d390a7 fix 2026-06-03 08:36:42 +00:00
yukkop b56dc50e50 feat: db-tool: normalize-backup 2026-06-03 08:14:22 +00:00
yukkop c74992ea85 fix: db-tool: generic for dbname in diff 2026-06-02 20:33:52 +00:00
yukkop 882b4ec871 feat: db-tool: fail on migration error in diff 2026-06-02 19:38:59 +00:00
yukkop 09acaaa9b6 fix: some 2026-06-02 17:54:29 +00:00
yukkop 54798b4615 feat: vendor gitea 1.16.2 2026-06-02 08:36:01 +00:00
yukkop cb50e80989 feat: gitea: vendor + fix heatmap 2026-05-31 23:17:43 +00:00
yukkop d2bdcb3667 fix: media-browser: view button 2026-05-23 12:18:05 +00:00
yukkop 56f369cf61 fix: media-browser: synced files 2026-05-23 12:03:56 +00:00
yukkop e4b0b3d96e feat: media-browser: preview for local files 2026-05-23 11:56:04 +00:00
yukkop 3de60e9701 feat: media-browser for matrix 2026-05-23 11:46:58 +00:00
yukkop 990e184ae3 fix?: support bot 2026-05-23 08:50:10 +00:00
yukkop 87aff4e447 feat: +package merge-archive 2026-05-22 07:45:47 +00:00
yukkop 2cabde19fe feat: deploy: 1 no tty option 2026-05-05 20:19:52 +00:00
yukkop 36052b9602 fix: db-tool: NO_TTY 2026-05-03 15:35:22 +00:00
yukkop fa510a08cb fix(db-tool): prevent fd leak from logger to long-running daemons
The hectic logger opens fd 3 as a dup of stderr. Child processes inherit
this fd, and daemonized PostgreSQL/PostgREST keeping it open prevents the
terminal from returning to the prompt after the spawning script exits.

- Add with_closed_fds helper that runs commands in a subshell with fds
  3-9 redirected to /dev/null
- Inline the helper into both database and postgres-init builds
- Wrap pg_ctl start and postgrest with the helper
2026-05-03 03:14:15 +00:00
yukkop 9d2d6c15c9 feat: windows-devshell 2026-05-02 15:31:26 +00:00
yukkop f9903206af fix: linux-devshell for ubuntu 2026-05-01 23:11:23 +00:00
yukkop 47c43e0d9d fix: linux-devshell from root 2026-05-01 22:56:03 +00:00
yukkop 7c12d2dfeb chore: fix nixpkgs 25.05 deprecation warnings 2026-05-01 22:26:29 +00:00
yukkop ff608e56c5 test: fix: . 2026-05-01 22:19:43 +00:00
yukkop 7c0a25eb15 test: linux-devshell 2026-05-01 21:13:15 +00:00
yukkop 433d8283fb feat: linux-devshell: init 2026-05-01 20:39:38 +00:00
yukkop fa97bb9d38 fix: db-tool: envcontent 2026-05-01 12:31:44 +00:00
yukkop f4e73e934b fix(db-tool): typo hydate.stdout.log -> hydrate.stdout.log 2026-04-30 23:10:46 +00:00
yukkop df8bce0132 docs(postgres-hooks): document hectic bundle + responsibility split
Add lib/hook/sql/README.md describing bundle layout, apply order, Nix API
(self.lib.hectic.*), shell helper contract, and the steps for adding a new
SQL file. Rewrite db-tool README's hectic section: drop stale
PG_HECTIC_INHERITANCE / HECTIC_INHERITANCE_SQL env vars, add
HECTIC_DOTENV_FILE, document the postgres-init / migrator init / database
hydrate responsibility split.
2026-04-30 22:12:18 +00:00
yukkop 6ef0d8338a feat: postgres hooks 2026-04-30 21:59:53 +00:00
yukkop c2edda9c20 feat: start impliment postgres hooks 2026-04-30 21:36:22 +00:00
yukkop 72955d606a feat(db-tool): hectic-inheritance: add hectic.immutable + diff coverage
Add a hectic.immutable parent table. Tables inheriting it get auto-attached
BEFORE INSERT/UPDATE/DELETE/TRUNCATE row+statement triggers that block DML
unless the session sets hectic.migration_mode='on' (intended use: SET LOCAL
inside a migration transaction). Same exemptions as the rest of the bundle
apply (hectic schema, partitions, temp tables, GUC-excluded schemas).

database diff now appends an --- IMMUTABLE TABLE DATA --- section to its
output, with per-table unified row diffs of every table inheriting
hectic.immutable, surfacing drift in 'frozen' reference data alongside schema
drift. Subcommand exits non-zero when either schema or data differs.

Test postgres-init-hectic-inheritance extended to 10 cases covering
immutable triggers, DML blocked outside migration_mode, SET LOCAL allowing
DML inside a transaction, GUC not leaking past COMMIT, and TRUNCATE under
migration_mode.
2026-04-30 16:10:38 +00:00
yukkop 3cf28f2dac feat(db-tool): postgres-init: apply hectic-inheritance by default
Flip PG_HECTIC_INHERITANCE default 0 -> 1. Set PG_HECTIC_INHERITANCE=0 to opt out.
2026-04-30 15:48:33 +00:00
yukkop 1d1c28f7f3 feat(db-tool): hectic-inheritance: bootstrap hectic.created_at / hectic.updated_at inheritance hook
Adds a SQL bundle plus event triggers that enforce `INHERITS (hectic.created_at)`
on every user CREATE TABLE and auto-attach a BEFORE UPDATE row trigger when a
table inherits `hectic.updated_at`. Always-exempt: `hectic`, `information_schema`,
`pg_*`, declarative partitions, temp tables. Per-DB opt-out via the GUC
`hectic.inheritance_extra_excluded_schemas`.

Exposed three ways:
  * `pkgs.hectic.hectic-inheritance` — derivation with the SQL at
    $out/share/hectic/hectic-inheritance.sql
  * `self.lib.hecticInheritance.{sql,path}` — pkgs-free Nix surface
  * `postgres-init` opt-in via `PG_HECTIC_INHERITANCE=1` (HECTIC_INHERITANCE_SQL
    overrides the default)

Test postgres-init-hectic-inheritance covers all six branches: bootstrap,
non-inheriting reject, accepting inheritance, auto updated_at trigger fires,
GUC exclusion, declarative partition exemption.
2026-04-30 15:16:57 +00:00
yukkop 47c7fa9bf8 fix(db-tool): postgres-init: createdb on reuse when target DB missing
Previously when PG_REUSE=1 and PG_VERSION existed but the target database had
never been successfully created (e.g. devshell exited mid-init in a prior run),
postgres-init skipped createdb and the subsequent psql connection failed with
'database "<db>" does not exist'.

Now on reuse path we probe pg_database and create the target DB if missing,
making postgres-init fully idempotent across stale-state recovery.

Adds postgres-init-reuse-missing-db test.
2026-04-30 12:16:09 +00:00
yukkop 3e4ce505c3 feat(db-tool): expose overridable postgresql arg and PG_CONF_FILE env
Wrap db-tool, postgres-init, postgres-cleanup with lib.makeOverridable so
consumers can inject extension-enabled PostgreSQL via .override { postgresql = ...; }.
Add PG_CONF_FILE: when set, replaces script-generated postgresql.conf entirely
(runtime port and unix_socket_directories still appended/overridden).
2026-04-30 12:00:08 +00:00
yukkop 94dd68587b fix(db-tool): postgres-init: always invoke main so sourcing exports vars
Previous basename guard only ran the function when invoked as the
postgres-init binary, but consumer shellHooks source the script to
inherit POSTGRESQL_HOST/PGURL/etc. Sourcing left the function defined
but never called, leaving WIPE_PGURL/PGURL unset and breaking devshell
entry in proxydoe and ruststats.
2026-04-30 11:37:19 +00:00
yukkop e67c2e0c47 fix(package): db-tool: call postgres-init/cleanup binaries instead of local devshell scripts
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-30 10:10:11 +00:00
yukkop 26010eebbf fix(package): db-tool: default PGURL to empty in dispatch to fix pull_staging exit=3 contract 2026-04-30 09:24:58 +00:00
yukkop 977b2cfa95 feat(\db-tool\): introduce unified db-tool package with postgres harness and tests (T0-T8) 2026-04-30 09:06:44 +00:00