Newer Older
105 lines | 3.393kb
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
Bogdan Timofte authored 5 days ago
37
  var/mdns-observations.yaml
Xdev Host Manager authored a week ago
38
  scripts/host_manager.pl
Bogdan Timofte authored 5 days ago
39
  scripts/mdns_host_seed.pl
Xdev Host Manager authored a week ago
40
  scripts/sync_local_hosts.sh
41

            
42
/etc/xdev/host-manager.env
43
/etc/systemd/system/host-manager.service
Bogdan Timofte authored 5 days ago
44
/etc/systemd/system/host-manager-mdns.service
Xdev Host Manager authored a week ago
45
/etc/nginx/conf.d/hosts.madagascar.xdev.ro.conf
46
```
47

            
48
## Instalare manuală
49

            
50
Pe jumper:
51

            
52
```bash
53
id -u host-manager >/dev/null 2>&1 || sudo useradd --system --home-dir /usr/local/xdev-host-manager --shell /usr/sbin/nologin host-manager
54
sudo install -d -o host-manager -g host-manager /usr/local/xdev-host-manager
55
sudo install -d -m 0750 /etc/xdev
56
sudo install -m 0644 deploy/jumper/host-manager.service /etc/systemd/system/host-manager.service
Bogdan Timofte authored 5 days ago
57
sudo install -m 0644 deploy/jumper/host-manager-mdns.service /etc/systemd/system/host-manager-mdns.service
Xdev Host Manager authored a week ago
58
sudo install -m 0644 deploy/jumper/nginx-host-manager.conf /etc/nginx/conf.d/hosts.madagascar.xdev.ro.conf
59
```
60

            
61
Copiază `deploy/jumper/host-manager.env.example` la `/etc/xdev/host-manager.env` și setează secretul TOTP real.
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 5 days ago
78
curl -k -o /dev/null -w '%{http_code}\n' https://hosts.madagascar.xdev.ro/healthz
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 5 days ago
85
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
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
94
hosts.madagascar.xdev.ro -> 192.168.2.100
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 seeduiește `var/mdns-observations.yaml`. Listenerul nu modifică registry-ul SQLite, `config/hosts.yaml` sau `config/local-hosts.tsv`.