|
Xdev Host Manager
authored
a week ago
|
1
|
# Jumper Deployment
|
|
|
2
|
|
|
Bogdan Timofte
authored
5 days ago
|
3
|
Host Manager rulează pe jumper ca serviciu Perl local, ascultând numai pe `127.0.0.1:8088`. Nginx publică aplicația prin vhost HTTPS pe IP-ul de management `192.168.2.100:443`; portul `80` redirecționează către HTTPS.
|
|
Xdev Host Manager
authored
a week ago
|
4
|
|
|
|
5
|
Vhost implicit:
|
|
|
6
|
|
|
|
7
|
```text
|
|
Bogdan Timofte
authored
4 days ago
|
8
|
madagascar.xdev.ro
|
|
Xdev Host Manager
authored
a week ago
|
9
|
```
|
|
|
10
|
|
|
|
11
|
Instanța curentă este instalată pe jumper în `/usr/local/xdev-host-manager` și publicată prin nginx. `/opt` rămâne rezervat pentru aplicații 3rd party/vendor.
|
|
|
12
|
|
|
|
13
|
## Pachete
|
|
|
14
|
|
|
|
15
|
Se folosesc doar pachete din distribuție:
|
|
|
16
|
|
|
|
17
|
- `perl`
|
|
Bogdan Timofte
authored
4 days ago
|
18
|
- `perl-DBI` / `perl-DBD-SQLite` dacă nu sunt deja disponibile
|
|
|
19
|
- `sqlite`
|
|
Xdev Host Manager
authored
a week ago
|
20
|
- `nginx`
|
|
|
21
|
|
|
|
22
|
Nu se instalează npm, pip sau CPAN direct pe host.
|
|
|
23
|
|
|
|
24
|
Dacă nginx nu este instalat pe jumper, se instalează din repo-ul distribuției:
|
|
|
25
|
|
|
|
26
|
```bash
|
|
|
27
|
sudo dnf install nginx
|
|
|
28
|
```
|
|
|
29
|
|
|
|
30
|
## Layout recomandat
|
|
|
31
|
|
|
|
32
|
```text
|
|
|
33
|
/usr/local/xdev-host-manager
|
|
|
34
|
config/hosts.yaml
|
|
|
35
|
config/local-hosts.tsv
|
|
Bogdan Timofte
authored
4 days ago
|
36
|
var/host-manager.sqlite
|
|
Xdev Host Manager
authored
a week ago
|
37
|
scripts/host_manager.pl
|
|
Bogdan Timofte
authored
5 days ago
|
38
|
scripts/mdns_host_seed.pl
|
|
Xdev Host Manager
authored
a week ago
|
39
|
scripts/sync_local_hosts.sh
|
|
|
40
|
|
|
|
41
|
/etc/xdev/host-manager.env
|
|
|
42
|
/etc/systemd/system/host-manager.service
|
|
Bogdan Timofte
authored
5 days ago
|
43
|
/etc/systemd/system/host-manager-mdns.service
|
|
Bogdan Timofte
authored
4 days ago
|
44
|
/etc/nginx/conf.d/madagascar.xdev.ro.conf
|
|
Xdev Host Manager
authored
a week ago
|
45
|
```
|
|
|
46
|
|
|
|
47
|
## Instalare manuală
|
|
|
48
|
|
|
|
49
|
Pe jumper:
|
|
|
50
|
|
|
|
51
|
```bash
|
|
|
52
|
id -u host-manager >/dev/null 2>&1 || sudo useradd --system --home-dir /usr/local/xdev-host-manager --shell /usr/sbin/nologin host-manager
|
|
|
53
|
sudo install -d -o host-manager -g host-manager /usr/local/xdev-host-manager
|
|
|
54
|
sudo install -d -m 0750 /etc/xdev
|
|
|
55
|
sudo install -m 0644 deploy/jumper/host-manager.service /etc/systemd/system/host-manager.service
|
|
Bogdan Timofte
authored
5 days ago
|
56
|
sudo install -m 0644 deploy/jumper/host-manager-mdns.service /etc/systemd/system/host-manager-mdns.service
|
|
Bogdan Timofte
authored
4 days ago
|
57
|
sudo install -m 0644 deploy/jumper/nginx-host-manager.conf /etc/nginx/conf.d/madagascar.xdev.ro.conf
|
|
Xdev Host Manager
authored
a week ago
|
58
|
```
|
|
|
59
|
|
|
|
60
|
Copiază `deploy/jumper/host-manager.env.example` la `/etc/xdev/host-manager.env` și setează secretul TOTP real.
|
|
Bogdan Timofte
authored
4 days ago
|
61
|
Nginx așteaptă certificatul TLS local CA la `/etc/pki/tls/certs/madagascar.xdev.ro.crt` și cheia la `/etc/pki/tls/private/madagascar.xdev.ro.key`.
|
|
Xdev Host Manager
authored
a week ago
|
62
|
|
|
|
63
|
La instalarea inițială se poate genera automat secretul TOTP. URI-ul de bootstrap rămâne doar pe jumper, root-only:
|
|
|
64
|
|
|
|
65
|
```bash
|
|
|
66
|
sudo cat /etc/xdev/host-manager.totp-uri
|
|
|
67
|
```
|
|
|
68
|
|
|
|
69
|
Validare:
|
|
|
70
|
|
|
|
71
|
```bash
|
|
|
72
|
sudo systemctl daemon-reload
|
|
|
73
|
sudo systemctl enable --now host-manager
|
|
Bogdan Timofte
authored
5 days ago
|
74
|
sudo systemctl enable --now host-manager-mdns
|
|
Xdev Host Manager
authored
a week ago
|
75
|
sudo nginx -t
|
|
|
76
|
sudo systemctl reload nginx
|
|
|
77
|
curl -fsS http://127.0.0.1:8088/healthz
|
|
Bogdan Timofte
authored
4 days ago
|
78
|
curl -k -o /dev/null -w '%{http_code}\n' https://madagascar.xdev.ro/healthz
|
|
Bogdan Timofte
authored
5 days ago
|
79
|
# trebuie să întoarcă 404; healthcheck-ul public nu este expus prin nginx
|
|
Xdev Host Manager
authored
a week ago
|
80
|
```
|
|
|
81
|
|
|
|
82
|
Verificări de securitate de bază:
|
|
|
83
|
|
|
|
84
|
```bash
|
|
Bogdan Timofte
authored
4 days ago
|
85
|
curl -k -o /dev/null -w '%{http_code}\n' -X POST https://madagascar.xdev.ro/api/render/local-hosts-tsv
|
|
Xdev Host Manager
authored
a week ago
|
86
|
# trebuie să întoarcă 401 fără sesiune OTP
|
|
|
87
|
```
|
|
|
88
|
|
|
|
89
|
## DNS local
|
|
|
90
|
|
|
|
91
|
Vhost-ul trebuie să existe în registrul intern:
|
|
|
92
|
|
|
|
93
|
```text
|
|
Bogdan Timofte
authored
4 days ago
|
94
|
madagascar.xdev.ro -> jumper.madagascar.xdev.ro
|
|
Xdev Host Manager
authored
a week ago
|
95
|
```
|
|
|
96
|
|
|
|
97
|
Nu se adaugă wildcard local. Doar acest nume exact trebuie publicat.
|
|
Bogdan Timofte
authored
5 days ago
|
98
|
|
|
Bogdan Timofte
authored
4 days ago
|
99
|
## Runtime store
|
|
|
100
|
|
|
|
101
|
`var/host-manager.sqlite` este sursa de adevăr pentru registry și Work Orders. La prima pornire, aplicația seed-uiește documentele lipsă din `config/hosts.yaml` și `config/work-orders.yaml`; ulterior push-urile de cod nu trebuie să înlocuiască baza runtime.
|
|
|
102
|
|
|
Bogdan Timofte
authored
5 days ago
|
103
|
## mDNS discovery
|
|
|
104
|
|
|
Bogdan Timofte
authored
4 days ago
|
105
|
`host-manager-mdns` este un listener separat care observă mDNS și scrie direct în tabelul SQLite `mdns_observations`. Listenerul nu modifică host registry-ul, `config/hosts.yaml` sau `config/local-hosts.tsv`. Sync-ul resolverului citește manifestul runtime din SQLite, nu din exportul static.
|