Commit Graph
100 Commits
Author SHA1 Message Date
yukkop 70c44f1fa7 feat: include hectic-landing to hectic 2026-04-30 19:33:21 +00:00
yukkop 2eaa568f5b 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 31d2994997 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 58e9aa8fad 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 7d5300853b 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 e732ecb878 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 705f5bbd01 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
yukkopandSisyphus 06a5d16ee3 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 5713eaad14 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 b5dcbf08a1 feat(\db-tool\): introduce unified db-tool package with postgres harness and tests (T0-T8) 2026-04-30 09:06:44 +00:00
yukkop 395bddee94 Merge branch 'master' of github.com:hectic-lab/util.nix 2026-04-29 09:57:40 +00:00
yukkop 62757df384 fix(package): sentinèlla: use dig(1) instead of host(1) which is not in bind.dnsutils 2026-04-27 17:30:01 +00:00
yukkop f2ea372742 debug(package): sentinèlla: surface host(1) and SRV-parse failures in watcher 2026-04-27 17:28:01 +00:00
yukkop f158a80492 fix(package): sentinèlla: use ip(8) for local-IP detection (inetutils hostname lacks -I); harden numeric parsing 2026-04-27 17:21:00 +00:00
yukkop 0c81c0454d feat(package): sentinèlla: switch peer discovery from A records to SRV records 2026-04-27 14:08:23 +00:00
yukkop 7268ec3704 fix(package): sentinèlla: probe — use socat EXEC pipes to avoid pty CR/LF mangling 2026-04-27 13:34:52 +00:00
yukkop 0dfbee6472 feat: sentinella: some 2026-04-27 12:58:36 +00:00
yukkop 50d682d6f7 fix: hectic-lab: email name 2026-04-26 22:22:31 +00:00
yukkop 3ca4d4fb86 feat: sentinella: update 2026-04-26 22:22:15 +00:00
yukkop 4fae68764c feat(hectic-lab): enable sentinèlla watcher service
Enable the p2p watcher alongside the existing probe. Peers are discovered
via DNS name peers.hectic-lab.com. TG credentials are loaded from a SOPS
secret sentinèlla/watcher/environment (to be populated with TG_TOKEN and
TG_CHAT_ID).
2026-04-26 22:04:35 +00:00
yukkop 6035397e9b feat(sentinèlla): p2p topology with DNS peer discovery
- Replace central sentinel with watcher: each node polls peers discovered
  via a single DNS name with multiple A records (e.g. peers.sentinella.com)
- Auto-detect own IPs via hostname -I; SELF env var available as optional
  override for NAT/floating-IP setups
- Fix Basic Auth bug in router.sh: compare tok against AUTH_TOKENS instead
  of unset $USER/$PASS
- Rename sentinel binary to watcher; drop unused shellplot dep
- Add inetutils to watcher runtime deps for hostname -I
- Update NixOS module: replace sentinel options with watcher p2p options
  (peersDns, self, peersPort, peersScheme, pollingIntervalSec)
- Add sentinèlla test suite: probe-status-empty, probe-disk, watcher-state-file
2026-04-26 21:54:07 +00:00
yukkop 249d027f6b docs: +plan 2026-04-26 14:11:37 +00:00
yukkop 3343a8be6e Merge branch 'merge-hectic-lab' 2026-04-26 13:52:17 +00:00
yukkop b8fc0971c6 fix: hectic-lab: something 2026-04-26 13:48:36 +00:00
yukkop 406acf662e feat: hectic-lab: mail server 2026-04-26 10:33:28 +00:00
yukkop 970c1214af chore: config 2026-04-25 15:18:01 +00:00
yukkop 0316d0b535 zalupa 2026-04-18 20:53:44 +00:00
yukkop 305efdbbae feat: work on profinity 2026-04-14 08:43:56 +00:00
yukkop 6e72841337 docs: neuro: router forwarding 2026-03-31 20:09:27 +00:00
yukkop 29acdc9ad6 feat: bfs: add xray package 2026-03-31 19:59:40 +00:00
yukkop 04bc83e004 chore: bfs: add 3 cert 2026-03-23 19:47:54 +00:00
yukkop 2513b76658 some jitsi shit 2026-03-23 19:22:40 +00:00
yukkop 62b7742ef0 some 2026-03-22 06:55:10 +00:00
yukkop f23720e151 feat: wsl: some things 2026-03-15 10:59:19 +00:00
yukkop b9730784ba fix: deploy: logs 2026-03-01 09:36:22 +00:00
yukkop 577c167d5a feat: migrator: +multifiles migrations 2026-02-28 21:19:29 +00:00
yukkop 525c6a220b chore: 2026-02-28 20:25:13 +00:00
yukkop bf41ee6e0a feat: merge own wsl config 2026-02-28 01:57:42 +00:00
yukkop cfcd6647ae feat: init hectic-lab merge 2026-02-27 19:57:44 +00:00
yukkop 4e2264dc03 feat: neuro: some 2026-02-27 12:53:51 +00:00
yukkop 3414edf2a8 fix: some warnings 2026-02-23 18:27:36 +00:00
yukkop 0d7b84e3bc refactor: derustification 2026-02-20 17:36:20 +00:00
yukkop bea9ca602e fix: +fixed nixpkgs 2026-02-20 17:30:36 +00:00
yukkop d8a51cd389 refactor: update to 25.11 2026-02-20 17:18:38 +00:00
yukkop f93e12accd feat: nixvim + zsh, fix: warnings 2026-02-20 16:41:18 +00:00
yukkop 63a7fd716f apply patch from neuro 2026-02-20 12:51:32 +00:00
yukkop 799ad9a15d feat: +neuro devshell 2026-02-20 12:06:55 +00:00
yukkop 9010b2678e refactor: deploy: update logs 2026-02-20 12:04:15 +00:00
yukkop 26bdecb8e0 fix: migrator: more accurate check for hectic.migrator isntalled 2026-02-17 16:50:08 +00:00
yukkop ff87e8c411 chore: something about hemar tree sitter 2026-02-17 16:17:47 +00:00
yukkop d7ada535d4 feat: +pol bfs server 2026-02-17 16:13:58 +00:00
yukkop 7490ef2fe9 fix: nvim-pager close all pages on q 2026-02-17 08:55:41 +00:00
yukkop a7cb54d04c hz 2026-02-14 18:35:04 +00:00
yukkop 0f4f6a6339 hz 2026-02-14 15:59:13 +00:00
yukkop 043b333654 feat: migrator: colorize help in migrator.sh 2026-02-06 08:38:36 +00:00
yukkop 683370a71c feat: stong &2 in log.sh 2026-02-05 06:50:54 +00:00
yukkop 2724295bcf feat(nixos): postgresql: +settings script 2026-01-29 18:56:22 +00:00
yukkop 78a3329271 Merge branch 'master' of github.com:hectic-lab/util.nix 2026-01-16 16:16:43 +00:00
yukkop a61f2cfe5e feat(nixos): +zombro hardware 2026-01-16 16:16:13 +00:00
yukkop 8ffe9ad244 iso 2026-01-13 15:04:33 +00:00
yukkop bf72ac7e97 feat(template): +nodejs 2026-01-04 20:40:43 +00:00
yukkop 4a9bb42015 feat(nixos): some moves to nixos server 2025-12-28 19:18:15 +00:00
yukkop 96782b7b51 feat(nixos): +neuro system 2025-12-26 20:04:42 +00:00
yukkop 3d84864382 fix(package): migrator: sqlite transactions 2025-12-23 19:31:44 +00:00
yukkop cb96de6125 fix(package): migrator: handle sqlite posible settings 2025-12-23 18:30:26 +00:00
yukkop 686a794a69 fix(pakcage): migrator: -z -> +x 2025-12-23 18:18:51 +00:00
yukkop 2ffe187b12 fix(package): migrator: awk dependency 2025-12-21 13:19:46 +00:00
yukkop 89ab7d56af feat(pakcage): migrator: add dependency 2025-12-20 01:19:40 +00:00
yukkop 01f13723a8 feat(package): migrator: up to latest 2025-12-18 00:45:09 +00:00
yukkop 9c25e82c79 fix(package): migrator: uncomplite RAISE on sqlite 2025-12-17 03:28:03 +00:00
yukkop 956239ab79 feat(package): migrator: ! sqlite support 2025-12-17 03:24:59 +00:00
yukkop bb2ae34758 feat(package): migrator: mvp 2025-12-16 17:28:36 +00:00
yukkop 13fdfac2ef test(hemar): update parser test to match better paths 2025-12-09 14:21:03 +00:00
yukkop 93a7636c61 fix(package): hemar: paths better handling 2025-12-09 14:13:34 +00:00
yukkop 6fb3ee1af8 test(hemar): many tests but not pass 2025-12-09 13:49:43 +00:00
yukkop 73dc9aee9e feat(package): hemar: json_escape() 2025-12-09 03:47:27 +00:00
yukkop 71082b6414 feat(package): hemar: interpolation 2025-12-08 23:47:33 +00:00
yukkop 65a96c860b feat(package): accord: some cli things 2025-12-08 01:55:33 +00:00
yukkop 9b9254bb93 feat(nixos): bgs: vless 2025-12-07 03:40:07 +00:00
yukkop 1beb980b95 refactor(nixos): bfs: some secrets 2025-12-07 02:25:29 +00:00
yukkop 082b80f252 feate(package): accord: init 2025-12-06 23:49:14 +00:00
yukkop f4a65afb01 Merge branch 'master' of github.com:hectic-lab/util.nix 2025-12-06 04:47:46 +00:00
yukkop 373a3fe3f0 fix(package): migrator: index_of subshell issue 2025-12-06 04:47:31 +00:00
yukkop 3b506a7888 fix: bfs nixosConfiguration check 2025-12-05 21:01:53 +00:00
yukkop 9a5bfa3f80 feate(nixos) bfs: matrix, element, bla bla bla 2025-12-05 19:36:53 +00:00
yukkop 5177f9a1f6 feat(nixos): bfs: fix: element-rtc 2025-12-05 18:17:41 +00:00
yukkop 49bf4c6d91 feat(nixos): bfs: +matrix, very unsave 2025-12-05 16:30:34 +00:00
yukkop 9d914ed863 feat(nixos): netherlands xray 2025-12-05 00:56:08 +00:00
yukkop 3e6bf6ce7f feat(nixos): xray 2025-12-04 21:03:01 +00:00
yukkop b786098867 feat(package): migrator: something 2025-12-04 21:02:38 +00:00
yukkop dfa76b2a19 feat(package): hemar: more grammar parsing 2025-11-30 13:31:40 +00:00
yukkop 6dad0d95fb fix(nixos): generic postgresql 2025-11-29 13:48:57 +00:00
yukkop 78f4777141 feat(package): hemar: some parser work 2025-11-29 00:30:27 +00:00
yukkop 48077aaccc feat(package): hemar: add indexes to tree-sitter 2025-11-28 10:29:59 +00:00
yukkop 4b4ea7a1d2 feat(package): hemar: add tree sitter hightlights 2025-11-27 19:45:12 +00:00
yukkop d1353d3a36 fix(package): hemar: treesitter language name 2025-11-27 19:15:35 +00:00
yukkop 8048c4adff fix(package): hemar: treesitter language name 2025-11-27 19:13:07 +00:00
yukkop 345f94742e feat(package): hemar: tree sitter grammar 2025-11-27 17:53:49 +00:00
yukkop 777d48bf3d feat(package): hemar: antlr grammar, but still does not work 2025-11-26 14:48:51 +00:00
yukkop 8a08272f68 feat(package): hemar: I think I was wrong 2025-11-25 15:45:02 +00:00