|
Xdev Host Manager
authored
2 days ago
|
1
|
# Jumper Deployment
|
|
|
2
|
|
|
Bogdan Timofte
authored
8 hours 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
2 days 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
|
|
|
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
|
|
Bogdan Timofte
authored
8 hours ago
|
70
|
curl -k -o /dev/null -w '%{http_code}\n' https://hosts.madagascar.xdev.ro/healthz
|
|
|
71
|
# trebuie să întoarcă 404; healthcheck-ul public nu este expus prin nginx
|
|
Xdev Host Manager
authored
2 days ago
|
72
|
```
|
|
|
73
|
|
|
|
74
|
Verificări de securitate de bază:
|
|
|
75
|
|
|
|
76
|
```bash
|
|
Bogdan Timofte
authored
8 hours ago
|
77
|
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
2 days ago
|
78
|
# trebuie să întoarcă 401 fără sesiune OTP
|
|
|
79
|
```
|
|
|
80
|
|
|
|
81
|
## DNS local
|
|
|
82
|
|
|
|
83
|
Vhost-ul trebuie să existe în registrul intern:
|
|
|
84
|
|
|
|
85
|
```text
|
|
|
86
|
hosts.madagascar.xdev.ro -> 192.168.2.100
|
|
|
87
|
```
|
|
|
88
|
|
|
|
89
|
Nu se adaugă wildcard local. Doar acest nume exact trebuie publicat.
|