Newer Older
88 lines | 2.362kb
Xdev Host Manager authored 2 days ago
1
# Jumper Deployment
2

            
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 pe IP-ul de management `192.168.2.100:80`.
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
34
  scripts/host_manager.pl
35
  scripts/sync_local_hosts.sh
36

            
37
/etc/xdev/host-manager.env
38
/etc/systemd/system/host-manager.service
39
/etc/nginx/conf.d/hosts.madagascar.xdev.ro.conf
40
```
41

            
42
## Instalare manuală
43

            
44
Pe jumper:
45

            
46
```bash
47
id -u host-manager >/dev/null 2>&1 || sudo useradd --system --home-dir /usr/local/xdev-host-manager --shell /usr/sbin/nologin host-manager
48
sudo install -d -o host-manager -g host-manager /usr/local/xdev-host-manager
49
sudo install -d -m 0750 /etc/xdev
50
sudo install -m 0644 deploy/jumper/host-manager.service /etc/systemd/system/host-manager.service
51
sudo install -m 0644 deploy/jumper/nginx-host-manager.conf /etc/nginx/conf.d/hosts.madagascar.xdev.ro.conf
52
```
53

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

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

            
58
```bash
59
sudo cat /etc/xdev/host-manager.totp-uri
60
```
61

            
62
Validare:
63

            
64
```bash
65
sudo systemctl daemon-reload
66
sudo systemctl enable --now host-manager
67
sudo nginx -t
68
sudo systemctl reload nginx
69
curl -fsS http://127.0.0.1:8088/healthz
70
curl -fsS http://hosts.madagascar.xdev.ro/healthz
71
```
72

            
73
Verificări de securitate de bază:
74

            
75
```bash
76
curl -o /dev/null -w '%{http_code}\n' -X POST http://hosts.madagascar.xdev.ro/api/render/local-hosts-tsv
77
# trebuie să întoarcă 401 fără sesiune OTP
78
```
79

            
80
## DNS local
81

            
82
Vhost-ul trebuie să existe în registrul intern:
83

            
84
```text
85
hosts.madagascar.xdev.ro -> 192.168.2.100
86
```
87

            
88
Nu se adaugă wildcard local. Doar acest nume exact trebuie publicat.