Showing 4 changed files with 157 additions and 0 deletions
+100 -0
.doc/development-log.md
@@ -0,0 +1,100 @@
1
+# Development Log
2
+
3
+Acest fișier păstrează deciziile care schimbă scopul aplicației, regulile de operare sau modelul de deployment. Nu înlocuiește git history; explică de ce au apărut schimbările mari.
4
+
5
+## 2026-06-06 - Repository and Deployment Split
6
+
7
+Decizie: codul aplicației se dezvoltă local și se publică în GitPrep. Jumper rămâne runtime/deploy target.
8
+
9
+Locații:
10
+
11
+- checkout local: `/Users/bogdan/Documents/Workspaces/Xdev/Madagascar/LocalAuthority`
12
+- GitPrep canonical remote: `git@192.168.2.102:repositories/bogdan/LocalAuthority.git`
13
+- GitPrep web: `http://192.168.2.102:3000/bogdan/LocalAuthority`
14
+- runtime jumper: `/usr/local/xdev-host-manager`
15
+
16
+Motiv:
17
+
18
+- editarea directă pe jumper amesteca dezvoltarea cu runtime-ul
19
+- aplicația are acum scope mai mare și va continua să evolueze
20
+- avem nevoie de istoric, review și deploy controlat
21
+
22
+Regulă:
23
+
24
+- `scripts/deploy_to_jumper.sh` publică aplicația pe jumper
25
+- `config/` nu se copiază implicit
26
+- `config/` se copiază doar cu `--include-config`, la cerere explicită
27
+
28
+## 2026-06-06 - Scope Expanded Beyond Host Registry
29
+
30
+Aplicația a pornit ca manager pentru registrul de hosturi, dar scope-ul curent include:
31
+
32
+- registry de hosturi Madagascar
33
+- manifest DNS local pentru jumper și as01
34
+- Work Orders pentru schimbări operaționale confirmabile
35
+- autoritate locală de certificate pentru hosturi
36
+- exporturi pentru servicii consumatoare, preferabil prin git
37
+
38
+Numele de produs a devenit `Madagascar Local Authority`.
39
+
40
+Numele tehnice rămân stabile pentru compatibilitate:
41
+
42
+- service systemd: `host-manager`
43
+- user Unix: `host-manager`
44
+- runtime path: `/usr/local/xdev-host-manager`
45
+- environment file: `/etc/xdev/host-manager.env`
46
+
47
+## 2026-06-06 - Work Orders Before Destructive Registry Changes
48
+
49
+Decizie: numele cu impact operațional nu se șterg direct din UI.
50
+
51
+Exemplu inițial:
52
+
53
+- `pmx.*.madagascar.xdev.ro`
54
+- `pbs.*.madagascar.xdev.ro`
55
+
56
+Aceste nume au fost create pentru vhosturi nginx cu certificate Let's Encrypt. Odată cu CA-ul local, intenția este retragerea lor, dar eliminarea din registry se face doar după:
57
+
58
+- inventarierea vhosturilor
59
+- crearea și instalarea certificatelor locale
60
+- eliminarea configurațiilor legacy
61
+- testarea accesului prin numele canonice
62
+- verificarea că numele nu mai sunt folosite
63
+- aprobarea finală a operatorului
64
+
65
+Confirmarea unui WO este blocată dacă checklist-ul nu este complet.
66
+
67
+## 2026-06-06 - Local DNS Resolution Rules
68
+
69
+Regulă: local nu se folosește wildcard pentru `*.madagascar.xdev.ro`.
70
+
71
+Doar numele cunoscute din manifestul local trebuie să se rezolve intern. Numele necunoscute trebuie să întoarcă `NXDOMAIN`, chiar dacă DNS public poate avea wildcard către IP-ul public.
72
+
73
+Resolverele interne sunt:
74
+
75
+- jumper: `192.168.2.100`
76
+- as01: `192.168.2.2`
77
+
78
+Sync-ul rămâne explicit:
79
+
80
+```bash
81
+./scripts/sync_local_hosts.sh --apply --verify
82
+```
83
+
84
+## 2026-06-06 - Dependency Policy
85
+
86
+Regulă: nu se instalează npm, pip sau CPAN direct pe hosturi.
87
+
88
+Acceptat:
89
+
90
+- pachete din distribuție, când sunt necesare
91
+- Perl din distribuție
92
+- module Perl core/distribution
93
+
94
+CPAN se folosește doar dacă pachetul ajunge prin repo-ul local auditat.
95
+
96
+Pachete de sistem instalate în timpul evoluției:
97
+
98
+- `ripgrep` pe jumper
99
+- `rsync` pe jumper
100
+- `sqlite3` pe mazeri/GitPrep
+2 -0
.doc/host-manager.md
@@ -4,6 +4,8 @@ Madagascar Local Authority este o aplicație web locală, Perl-only, pentru regi
4 4
 
5 5
 Numele de produs este `Madagascar Local Authority`. Numele tehnic al serviciului, userului Unix, path-ului și fișierelor de environment rămâne `host-manager`.
6 6
 
7
+Pentru deciziile de evoluție și schimbările de scope, vezi `.doc/development-log.md`.
8
+
7 9
 ## Politica de dependențe
8 10
 
9 11
 Perl-ul livrat de distribuție este acceptat ca bază de runtime. Modulele Perl incluse în distribuție sau în core pot fi folosite direct.
+7 -0
README.md
@@ -37,6 +37,13 @@ The product name is **Madagascar Local Authority**. The technical service, Unix
37 37
 
38 38
 The web UI is OTP-protected for all registry data, downloads, exports, and writes. Automation should consume this repository through git with dedicated read-only keys, not through unauthenticated HTTP.
39 39
 
40
+For agent/operator context, see:
41
+
42
+- [`agents.md`](agents.md)
43
+- [`.doc/development-log.md`](.doc/development-log.md)
44
+- [`.doc/host-manager.md`](.doc/host-manager.md)
45
+- [`.doc/local-hosts.md`](.doc/local-hosts.md)
46
+
40 47
 ## Local development and deployment
41 48
 
42 49
 Work on application code locally, commit changes, then deploy to jumper:
+48 -0
agents.md
@@ -0,0 +1,48 @@
1
+# Agent Notes
2
+
3
+Madagascar Local Authority is the local authority application for the Madagascar network.
4
+
5
+Start with these documents:
6
+
7
+- [README.md](README.md) - current repository, deployment model, runtime paths, GitPrep remote.
8
+- [.doc/host-manager.md](.doc/host-manager.md) - application behavior, OTP, Work Orders, local CA, registry rules.
9
+- [.doc/local-hosts.md](.doc/local-hosts.md) - local DNS rules, resolver sync, source priority.
10
+- [.doc/development-log.md](.doc/development-log.md) - scope and architecture decisions over time.
11
+
12
+Operational rules:
13
+
14
+- Develop in this checkout: `/Users/bogdan/Documents/Workspaces/Xdev/Madagascar/LocalAuthority`.
15
+- Canonical git remote is GitPrep: `git@192.168.2.102:repositories/bogdan/LocalAuthority.git`.
16
+- Jumper is the runtime/deployment target, not the primary editing location.
17
+- Deploy application code with `scripts/deploy_to_jumper.sh`.
18
+- Do not deploy `config/` unless the user explicitly asks to replace runtime registry data.
19
+- Treat `config/hosts.yaml`, `config/local-hosts.tsv`, and `config/work-orders.yaml` as operational data that may be changed by the live app.
20
+- Do not install npm, pip, or CPAN packages directly on hosts. Distribution packages are acceptable when needed.
21
+- Perl from the distribution and core/distribution modules are allowed.
22
+- CPAN dependencies must come from the audited local repository if they become necessary.
23
+- Secrets live outside git, mainly under `/etc/xdev/host-manager.env` on jumper.
24
+
25
+Before code changes:
26
+
27
+```bash
28
+git status --short
29
+```
30
+
31
+Before deployment:
32
+
33
+```bash
34
+perl -c scripts/host_manager.pl
35
+scripts/deploy_to_jumper.sh --dry-run --allow-dirty
36
+```
37
+
38
+Normal deployment after a committed change:
39
+
40
+```bash
41
+scripts/deploy_to_jumper.sh
42
+```
43
+
44
+After deployment, verify:
45
+
46
+```bash
47
+ssh jumper.madagascar.xdev.ro 'systemctl is-active host-manager && curl -fsS http://127.0.0.1:8088/healthz >/dev/null'
48
+```