Newer Older
104 lines | 3.373kb
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
8
hosts.madagascar.xdev.ro
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
Xdev Host Manager authored a week ago
44
/etc/nginx/conf.d/hosts.madagascar.xdev.ro.conf
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
Xdev Host Manager authored a week ago
57
sudo install -m 0644 deploy/jumper/nginx-host-manager.conf /etc/nginx/conf.d/hosts.madagascar.xdev.ro.conf
58
```
59

            
60
Copiază `deploy/jumper/host-manager.env.example` la `/etc/xdev/host-manager.env` și setează secretul TOTP real.
61

            
62
La instalarea inițială se poate genera automat secretul TOTP. URI-ul de bootstrap rămâne doar pe jumper, root-only:
63

            
64
```bash
65
sudo cat /etc/xdev/host-manager.totp-uri
66
```
67

            
68
Validare:
69

            
70
```bash
71
sudo systemctl daemon-reload
72
sudo systemctl enable --now host-manager
Bogdan Timofte authored 5 days ago
73
sudo systemctl enable --now host-manager-mdns
Xdev Host Manager authored a week ago
74
sudo nginx -t
75
sudo systemctl reload nginx
76
curl -fsS http://127.0.0.1:8088/healthz
Bogdan Timofte authored 5 days ago
77
curl -k -o /dev/null -w '%{http_code}\n' https://hosts.madagascar.xdev.ro/healthz
78
# trebuie să întoarcă 404; healthcheck-ul public nu este expus prin nginx
Xdev Host Manager authored a week ago
79
```
80

            
81
Verificări de securitate de bază:
82

            
83
```bash
Bogdan Timofte authored 5 days ago
84
curl -k -o /dev/null -w '%{http_code}\n' -X POST https://hosts.madagascar.xdev.ro/api/render/local-hosts-tsv
Xdev Host Manager authored a week ago
85
# trebuie să întoarcă 401 fără sesiune OTP
86
```
87

            
88
## DNS local
89

            
90
Vhost-ul trebuie să existe în registrul intern:
91

            
92
```text
93
hosts.madagascar.xdev.ro -> 192.168.2.100
94
```
95

            
96
Nu se adaugă wildcard local. Doar acest nume exact trebuie publicat.
Bogdan Timofte authored 5 days ago
97

            
Bogdan Timofte authored 4 days ago
98
## Runtime store
99

            
100
`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.
101

            
Bogdan Timofte authored 5 days ago
102
## mDNS discovery
103

            
Bogdan Timofte authored 4 days ago
104
`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`.