Newer Older
98 lines | 3.008kb
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`
18
- `nginx`
19

            
20
Nu se instalează npm, pip sau CPAN direct pe host.
21

            
22
Dacă nginx nu este instalat pe jumper, se instalează din repo-ul distribuției:
23

            
24
```bash
25
sudo dnf install nginx
26
```
27

            
28
## Layout recomandat
29

            
30
```text
31
/usr/local/xdev-host-manager
32
  config/hosts.yaml
33
  config/local-hosts.tsv
Bogdan Timofte authored 5 days ago
34
  var/mdns-observations.yaml
Xdev Host Manager authored a week ago
35
  scripts/host_manager.pl
Bogdan Timofte authored 5 days ago
36
  scripts/mdns_host_seed.pl
Xdev Host Manager authored a week ago
37
  scripts/sync_local_hosts.sh
38

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

            
45
## Instalare manuală
46

            
47
Pe jumper:
48

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

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

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

            
62
```bash
63
sudo cat /etc/xdev/host-manager.totp-uri
64
```
65

            
66
Validare:
67

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

            
79
Verificări de securitate de bază:
80

            
81
```bash
Bogdan Timofte authored 5 days ago
82
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
83
# trebuie să întoarcă 401 fără sesiune OTP
84
```
85

            
86
## DNS local
87

            
88
Vhost-ul trebuie să existe în registrul intern:
89

            
90
```text
91
hosts.madagascar.xdev.ro -> 192.168.2.100
92
```
93

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

            
96
## mDNS discovery
97

            
98
`host-manager-mdns` este un listener separat care observă mDNS și seeduiește `var/mdns-observations.yaml`. `config/hosts.yaml` rămâne output generat din surse și nu este modificat direct de listener.