Adminoberflaeche erreichbar machen - ueber einen Namen oder ueber die Wurzel
Unter einem Unterpfad wie /npm bleibt die Oberflaeche des Proxy Managers
weiss. Sie ist eine Single-Page-Anwendung und laedt ihre Dateien ueber
absolute Pfade; nur die Startseite kommt an, alles Weitere landet bei
dem, was auf der Wurzel liegt. An einem laufenden Proxy Manager
gemessen: /npm liefert 200, /images/... dagegen 502. Checkmk funktioniert
unter /cmk/ nur deshalb, weil es fuer einen URL-Praefix gebaut ist.
"proxy admin" kann beides, und beides kommt mit dem einen freien Port
aus:
proxy admin --domain npm.example.local
Eigener Proxy-Host, Oberflaeche auf "/". Welcher Server-Block
greift, entscheidet der Name (SNI), nicht der Port. Setzt
Namensaufloesung voraus - notfalls eine Zeile in der hosts-Datei.
proxy admin --root
Ohne Namensaufloesung: die Wurzel zeigt auf die Adminoberflaeche,
das bisherige Ziel wandert auf /<site>. Checkmk belegt ohnehin nur
seinen Site-Pfad.
proxy admin --root --off nimmt das wieder zurueck
proxy admin zeigt den Stand
Beide Wege sind ueber die IP ohne SNI durchgemessen: Startseite,
/images, /login und die Anmeldung per POST /api/tokens antworten mit
200. In der Oberflaeche liegt das unter Proxy-Hosts >
"Adminoberflaeche erreichbar machen".
Dabei ist ein aelterer Fehler aufgefallen: "die" ruft exit auf, und die
Oberflaeche ruft cmd_* direkt auf - ein Fehlerfall beendete damit die
ganze Oberflaeche, statt ihn anzuzeigen. Betraf auch bestehende
Menuepunkte wie "Einzelheiten eines Proxy-Hosts" (stirbt bei unbekanntem
Namen) und die Jobliste. Alle 24 Aufrufe laufen jetzt in einer Subshell.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1227,6 +1227,7 @@ erzwingen, HTTP/2 und Websockets einschalten und den empfohlenen
|
|||||||
| `proxy edit --id N …` | vorhandenen Proxy-Host ändern – nur die angegebenen Felder |
|
| `proxy edit --id N …` | vorhandenen Proxy-Host ändern – nur die angegebenen Felder |
|
||||||
| `proxy default --domain X` | HTTPS über die blanke IP ermöglichen (spiegelt X in einen Standard-Server) |
|
| `proxy default --domain X` | HTTPS über die blanke IP ermöglichen (spiegelt X in einen Standard-Server) |
|
||||||
| `proxy default --off` | diese Spiegelung wieder entfernen |
|
| `proxy default --off` | diese Spiegelung wieder entfernen |
|
||||||
|
| `proxy admin --domain X` / `--root` | Adminoberfläche erreichbar machen – per Name oder über die Wurzel |
|
||||||
| `proxy reload` | nginx die Konfiguration neu einlesen lassen – ohne Unterbrechung |
|
| `proxy reload` | nginx die Konfiguration neu einlesen lassen – ohne Unterbrechung |
|
||||||
| `proxy restart` | den Proxy-Manager-Container neu starten |
|
| `proxy restart` | den Proxy-Manager-Container neu starten |
|
||||||
|
|
||||||
@@ -1606,6 +1607,76 @@ dahinter braucht länger, und ein „fertig" wäre sonst gelogen.
|
|||||||
In der Oberfläche liegt beides unter **Proxy-Hosts → Proxy Manager neu starten
|
In der Oberfläche liegt beides unter **Proxy-Hosts → Proxy Manager neu starten
|
||||||
/ nginx neu laden**.
|
/ nginx neu laden**.
|
||||||
|
|
||||||
|
### 10.11 Die Adminoberfläche des Proxy Managers erreichbar machen
|
||||||
|
|
||||||
|
Sie ist eine Single-Page-Anwendung und lädt ihre Dateien über **absolute**
|
||||||
|
Pfade:
|
||||||
|
|
||||||
|
```html
|
||||||
|
<link rel="preload" href="/images/logo-no-text.svg" ...>
|
||||||
|
```
|
||||||
|
|
||||||
|
Unter einem Unterpfad wie `/npm` kommt deshalb nur die Startseite an, alles
|
||||||
|
Weitere landet bei dem, was auf der Wurzel liegt – im Browser eine **weiße
|
||||||
|
Seite**. Gemessen an einem laufenden Proxy Manager:
|
||||||
|
|
||||||
|
| Zugriff | `/` | `/images/…` | Anmeldung (`POST /api/tokens`) |
|
||||||
|
|---|---|---|---|
|
||||||
|
| Unterpfad `/npm` | 200 | **502** | – |
|
||||||
|
| eigener Name | 200 | 200 | 200 |
|
||||||
|
| Wurzel | 200 | 200 | 200 |
|
||||||
|
|
||||||
|
Checkmk funktioniert unter `/cmk/` nur deshalb, weil es für einen URL-Präfix
|
||||||
|
gebaut ist und ihn in jede erzeugte Adresse einsetzt. Der Proxy Manager kann
|
||||||
|
das nicht. Es bleiben zwei Wege – **beide kommen mit dem einen freien Port
|
||||||
|
aus**:
|
||||||
|
|
||||||
|
**Variante A – eigener Name** (wenn es Namensauflösung gibt):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./scripts/cmk-manage.sh proxy admin --domain npm.example.local
|
||||||
|
./scripts/cmk-manage.sh proxy reload
|
||||||
|
```
|
||||||
|
|
||||||
|
Legt einen Proxy-Host an, der auf `127.0.0.1:81` zeigt – die Oberfläche liegt
|
||||||
|
dort auf `/`, alles funktioniert. Checkmk bleibt unter seinem eigenen Namen
|
||||||
|
oder unter der IP erreichbar; welcher Server-Block greift, entscheidet der
|
||||||
|
Name (SNI), nicht der Port. Ohne DNS genügt eine Zeile in der `hosts`-Datei
|
||||||
|
der Arbeitsplätze.
|
||||||
|
|
||||||
|
**Variante B – Wurzel** (wenn es *keine* Namensauflösung gibt):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./scripts/cmk-manage.sh proxy admin --root
|
||||||
|
./scripts/cmk-manage.sh proxy default --domain <name> --restart # falls eingerichtet
|
||||||
|
```
|
||||||
|
|
||||||
|
Die Wurzel des vorhandenen Proxy-Hosts zeigt danach auf die Adminoberfläche,
|
||||||
|
das bisherige Ziel wandert auf `/cmk` (bzw. `CMK_SITE_ID`):
|
||||||
|
|
||||||
|
```
|
||||||
|
https://172.0.250.82/ Adminoberfläche des Proxy Managers
|
||||||
|
https://172.0.250.82/cmk/ Checkmk
|
||||||
|
```
|
||||||
|
|
||||||
|
Das geht, weil Checkmk nur seinen Site-Pfad belegt – der Rest der Wurzel ist
|
||||||
|
frei. Zurück:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./scripts/cmk-manage.sh proxy admin --root --off
|
||||||
|
```
|
||||||
|
|
||||||
|
> Bei Variante B liegt die **Anmeldemaske offen im Netz**. Für die Dauer einer
|
||||||
|
> Einrichtung ist das vertretbar; danach entweder zurücknehmen oder den Zugang
|
||||||
|
> per Firewall auf das Adminnetz begrenzen.
|
||||||
|
|
||||||
|
Weitere Angaben: `--id N` bzw. `--host NAME`, wenn es mehrere Proxy-Hosts gibt,
|
||||||
|
`--path /pfad` für einen abweichenden Site-Pfad, `--cert self|letsencrypt|none`
|
||||||
|
bei Variante A. Ohne Angabe zeigt `proxy admin` den Stand.
|
||||||
|
|
||||||
|
In der Oberfläche liegt beides unter **Proxy-Hosts → Adminoberfläche erreichbar
|
||||||
|
machen**.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 11. Proxy Manager lokal einrichten (Terminal-Browser)
|
## 11. Proxy Manager lokal einrichten (Terminal-Browser)
|
||||||
|
|||||||
@@ -1226,6 +1226,7 @@ HTTPS, enables HTTP/2 and websockets, and sets the recommended
|
|||||||
| `proxy edit --id N …` | change an existing proxy host – only the fields you name |
|
| `proxy edit --id N …` | change an existing proxy host – only the fields you name |
|
||||||
| `proxy default --domain X` | enable HTTPS on the bare IP (mirrors X into a default server) |
|
| `proxy default --domain X` | enable HTTPS on the bare IP (mirrors X into a default server) |
|
||||||
| `proxy default --off` | remove that mirror again |
|
| `proxy default --off` | remove that mirror again |
|
||||||
|
| `proxy admin --domain X` / `--root` | make the admin interface reachable – by name or via the root |
|
||||||
| `proxy reload` | make nginx re-read its configuration – without interruption |
|
| `proxy reload` | make nginx re-read its configuration – without interruption |
|
||||||
| `proxy restart` | restart the Proxy Manager container |
|
| `proxy restart` | restart the Proxy Manager container |
|
||||||
|
|
||||||
@@ -1601,6 +1602,72 @@ longer, and a "done" would otherwise be a lie.
|
|||||||
The GUI has both under **Proxy-Hosts → Proxy Manager neu starten / nginx neu
|
The GUI has both under **Proxy-Hosts → Proxy Manager neu starten / nginx neu
|
||||||
laden**.
|
laden**.
|
||||||
|
|
||||||
|
### 10.11 Making the Proxy Manager's admin interface reachable
|
||||||
|
|
||||||
|
It is a single-page application and loads its files over **absolute** paths:
|
||||||
|
|
||||||
|
```html
|
||||||
|
<link rel="preload" href="/images/logo-no-text.svg" ...>
|
||||||
|
```
|
||||||
|
|
||||||
|
Under a sub-path such as `/npm` only the start page arrives; everything else
|
||||||
|
lands on whatever sits at the root – a **blank page** in the browser. Measured
|
||||||
|
against a running Proxy Manager:
|
||||||
|
|
||||||
|
| Access | `/` | `/images/…` | login (`POST /api/tokens`) |
|
||||||
|
|---|---|---|---|
|
||||||
|
| sub-path `/npm` | 200 | **502** | – |
|
||||||
|
| own name | 200 | 200 | 200 |
|
||||||
|
| root | 200 | 200 | 200 |
|
||||||
|
|
||||||
|
Checkmk works under `/cmk/` only because it is built for a URL prefix and puts
|
||||||
|
it into every address it generates. The Proxy Manager cannot do that. Two ways
|
||||||
|
remain – **both work with the single free port**:
|
||||||
|
|
||||||
|
**Option A – own name** (if name resolution exists):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./scripts/cmk-manage.sh proxy admin --domain npm.example.local
|
||||||
|
./scripts/cmk-manage.sh proxy reload
|
||||||
|
```
|
||||||
|
|
||||||
|
Creates a proxy host pointing at `127.0.0.1:81` – the interface sits at `/`
|
||||||
|
there and everything works. Checkmk stays reachable under its own name or the
|
||||||
|
IP; which server block applies is decided by the name (SNI), not the port.
|
||||||
|
Without DNS, one line in the workstations' `hosts` file is enough.
|
||||||
|
|
||||||
|
**Option B – root** (if there is *no* name resolution):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./scripts/cmk-manage.sh proxy admin --root
|
||||||
|
./scripts/cmk-manage.sh proxy default --domain <name> --restart # if set up
|
||||||
|
```
|
||||||
|
|
||||||
|
The root of the existing proxy host then points at the admin interface, and the
|
||||||
|
previous target moves to `/cmk` (or `CMK_SITE_ID`):
|
||||||
|
|
||||||
|
```
|
||||||
|
https://172.0.250.82/ Proxy Manager admin interface
|
||||||
|
https://172.0.250.82/cmk/ Checkmk
|
||||||
|
```
|
||||||
|
|
||||||
|
This works because Checkmk only occupies its site path – the rest of the root
|
||||||
|
is free. To undo:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./scripts/cmk-manage.sh proxy admin --root --off
|
||||||
|
```
|
||||||
|
|
||||||
|
> With option B the **login form is exposed to the network**. For the duration
|
||||||
|
> of a setup that is acceptable; afterwards either undo it or restrict access
|
||||||
|
> to the administration network with the firewall.
|
||||||
|
|
||||||
|
Further options: `--id N` or `--host NAME` when there are several proxy hosts,
|
||||||
|
`--path /path` for a different site path, `--cert self|letsencrypt|none` with
|
||||||
|
option A. Without arguments `proxy admin` shows the current state.
|
||||||
|
|
||||||
|
The GUI has both under **Proxy-Hosts → Adminoberfläche erreichbar machen**.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 11. Configuring the Proxy Manager locally (terminal browser)
|
## 11. Configuring the Proxy Manager locally (terminal browser)
|
||||||
|
|||||||
+264
-25
@@ -2876,6 +2876,7 @@ npm_custom_conf_path() {
|
|||||||
printf '%s/%s\n' "$(npm_data_dir_abs)" "$NPM_CUSTOM_CONF_REL"
|
printf '%s/%s\n' "$(npm_data_dir_abs)" "$NPM_CUSTOM_CONF_REL"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NPM_INTERNAL_ADMIN_PORT=81 # fest im Abbild: "listen 81"
|
||||||
NPM_DEF_START="# >>> cmk-manage.sh: HTTPS ohne SNI - nicht von Hand aendern >>>"
|
NPM_DEF_START="# >>> cmk-manage.sh: HTTPS ohne SNI - nicht von Hand aendern >>>"
|
||||||
NPM_DEF_END="# <<< cmk-manage.sh: HTTPS ohne SNI <<<"
|
NPM_DEF_END="# <<< cmk-manage.sh: HTTPS ohne SNI <<<"
|
||||||
|
|
||||||
@@ -4024,6 +4025,186 @@ cmd_proxy() {
|
|||||||
echo
|
echo
|
||||||
return 0 ;;
|
return 0 ;;
|
||||||
|
|
||||||
|
admin|adminui)
|
||||||
|
local dom="" root="" off="" pid="" host="" path="" cert=self
|
||||||
|
while [ $# -gt 0 ]; do
|
||||||
|
case "$1" in
|
||||||
|
--domain) dom="$2"; shift 2 ;;
|
||||||
|
--root) root=1; shift ;;
|
||||||
|
--off|--aus) off=1; shift ;;
|
||||||
|
--id) pid="$2"; shift 2 ;;
|
||||||
|
--host) host="$2"; shift 2 ;;
|
||||||
|
--path) path="$2"; shift 2 ;;
|
||||||
|
--cert) cert="$2"; shift 2 ;;
|
||||||
|
--help|-h)
|
||||||
|
cat <<EOF
|
||||||
|
|
||||||
|
Die Adminoberflaeche des Proxy Managers erreichbar machen.
|
||||||
|
|
||||||
|
Sie ist eine Single-Page-Anwendung und laedt ihre Dateien ueber
|
||||||
|
ABSOLUTE Pfade (/images/..., /api/...). Unter einem Unterpfad wie /npm
|
||||||
|
kommt deshalb nur die Startseite an, alles Weitere landet bei dem, was
|
||||||
|
auf der Wurzel liegt - im Browser eine weisse Seite. Es bleiben zwei
|
||||||
|
Wege, und beide kommen mit dem einen freien Port aus:
|
||||||
|
|
||||||
|
$SELF proxy admin --domain npm.example.local
|
||||||
|
Eigener Proxy-Host auf einen Namen. Die Oberflaeche liegt dort
|
||||||
|
auf "/", alles funktioniert. Setzt voraus, dass der Name im Netz
|
||||||
|
aufgeloest wird (DNS oder hosts-Datei der Arbeitsplaetze).
|
||||||
|
|
||||||
|
$SELF proxy admin --root
|
||||||
|
Ohne Namensaufloesung: die WURZEL des vorhandenen Proxy-Hosts
|
||||||
|
zeigt auf die Adminoberflaeche, das bisherige Ziel wandert auf
|
||||||
|
/${CMK_SITE_ID:-cmk}. Checkmk belegt ohnehin nur seinen
|
||||||
|
Site-Pfad, der Rest der Wurzel ist frei.
|
||||||
|
https://<IP>/ Adminoberflaeche
|
||||||
|
https://<IP>/${CMK_SITE_ID:-cmk}/ Checkmk
|
||||||
|
|
||||||
|
$SELF proxy admin --root --off
|
||||||
|
Zurueck: die Wurzel zeigt wieder auf das urspruengliche Ziel.
|
||||||
|
|
||||||
|
Weitere Angaben
|
||||||
|
--id N | --host NAME welcher Proxy-Host (bei mehreren)
|
||||||
|
--path /pfad abweichender Site-Pfad (Vorgabe /${CMK_SITE_ID:-cmk})
|
||||||
|
--cert self|letsencrypt|none nur bei --domain
|
||||||
|
|
||||||
|
Ohne Angabe wird der Stand gezeigt.
|
||||||
|
EOF
|
||||||
|
return 0 ;;
|
||||||
|
*) die "Unbekannte Option fuer 'proxy admin': $1" ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
[ -n "$path" ] || path="/${CMK_SITE_ID:-cmk}"
|
||||||
|
case "$path" in /*) : ;; *) path="/$path" ;; esac
|
||||||
|
|
||||||
|
npm_require_running || return 1
|
||||||
|
NPM_TOKEN="$(npm_api_token)" || return 1
|
||||||
|
|
||||||
|
# --- Variante A: eigener Name -----------------------------------
|
||||||
|
if [ -n "$dom" ]; then
|
||||||
|
log "Lege einen Proxy-Host fuer die Adminoberflaeche an: $dom"
|
||||||
|
PROXY_ADD_URLPATH=/ cmd_proxy add --domain "$dom" --forward-host 127.0.0.1 \
|
||||||
|
--forward-port "$NPM_INTERNAL_ADMIN_PORT" \
|
||||||
|
--cert "$cert" --update || return 1
|
||||||
|
printf '\n Die Oberflaeche liegt dort auf "/" - damit funktionieren auch
|
||||||
|
/images, /api und die Anmeldung.
|
||||||
|
|
||||||
|
Noetig ist nur, dass "%s" im Netz aufgeloest wird. Ohne DNS
|
||||||
|
genuegt eine Zeile in der hosts-Datei der Arbeitsplaetze:
|
||||||
|
%s %s\n' "$dom" "$(primary_ip)" "$dom"
|
||||||
|
npm_reload_hint ""
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# --- Proxy-Host bestimmen ---------------------------------------
|
||||||
|
local all i o
|
||||||
|
if [ -z "$pid" ]; then
|
||||||
|
all="$(npm_api GET /api/nginx/proxy-hosts)"
|
||||||
|
if [ -n "$host" ]; then
|
||||||
|
for i in $(json_ids "$all"); do
|
||||||
|
if ( set +o pipefail; npm_api GET "/api/nginx/proxy-hosts/$i" | grep -qF "\"$host\"" ); then
|
||||||
|
pid="$i"; break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
[ -n "$pid" ] || die "Kein Proxy-Host fuer '$host' gefunden."
|
||||||
|
else
|
||||||
|
local -a ids=(); mapfile -t ids < <(json_ids "$all")
|
||||||
|
case "${#ids[@]}" in
|
||||||
|
0) die "Es gibt noch keinen Proxy-Host.
|
||||||
|
Erst einen anlegen: $SELF proxy add --domain <name-oder-ip>" ;;
|
||||||
|
1) pid="${ids[0]}" ;;
|
||||||
|
*) die "Es gibt mehrere Proxy-Hosts - welcher?
|
||||||
|
$SELF proxy admin --root --id N ('$SELF proxy list' zeigt die IDs)" ;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
o="$(npm_api GET "/api/nginx/proxy-hosts/$pid")"
|
||||||
|
[ -n "$(json_num "$o" id)" ] || die "Proxy-Host $pid gibt es nicht."
|
||||||
|
|
||||||
|
local rh rp
|
||||||
|
rh="$(json_str "$o" forward_host)"; rp="$(json_num "$o" forward_port)"
|
||||||
|
|
||||||
|
# --- Stand anzeigen ---------------------------------------------
|
||||||
|
if [ -z "$root" ]; then
|
||||||
|
printf '\n%sAdminoberflaeche des Proxy Managers%s\n' "$C_BLD" "$C_RST"
|
||||||
|
printf ' Proxy-Host %s, Wurzel zeigt auf: %s:%s\n' "$pid" "$rh" "$rp"
|
||||||
|
if [ "$rp" = "$NPM_INTERNAL_ADMIN_PORT" ]; then
|
||||||
|
test_result ok "Die Wurzel zeigt auf die Adminoberflaeche."
|
||||||
|
printf ' https://%s/ Adminoberflaeche\n' "$(primary_ip)"
|
||||||
|
printf ' https://%s%s/ Checkmk\n' "$(primary_ip)" "$path"
|
||||||
|
printf '\n Zurueck: %s proxy admin --root --off\n\n' "$SELF"
|
||||||
|
else
|
||||||
|
test_result warn "Die Adminoberflaeche ist ueber diesen Proxy-Host nicht erreichbar."
|
||||||
|
printf '\n Zwei Wege (siehe %s proxy admin --help):
|
||||||
|
mit Namensaufloesung : %s proxy admin --domain npm.example.local
|
||||||
|
ohne : %s proxy admin --root\n\n' "$SELF" "$SELF" "$SELF"
|
||||||
|
fi
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# --- Variante B: Wurzel ------------------------------------------
|
||||||
|
local cur; cur="$(json_raw "$o" locations)"
|
||||||
|
local -a keep=()
|
||||||
|
local el elpath lh lp lsch found=""
|
||||||
|
while IFS= read -r el; do
|
||||||
|
[ -n "$el" ] || continue
|
||||||
|
elpath="$(json_str "$el" path)"
|
||||||
|
if [ "$elpath" = "$path" ]; then
|
||||||
|
found="$el"
|
||||||
|
if [ -n "$off" ]; then continue; fi
|
||||||
|
fi
|
||||||
|
keep+=("$el")
|
||||||
|
done < <(json_split_array "$cur")
|
||||||
|
|
||||||
|
if [ -n "$off" ]; then
|
||||||
|
[ -n "$found" ] || die "Es gibt keinen Pfad '$path' - da ist nichts zurueckzunehmen."
|
||||||
|
lsch="$(json_str "$found" forward_scheme)"; [ -n "$lsch" ] || lsch=http
|
||||||
|
lh="$(json_str "$found" forward_host)"; lp="$(json_num "$found" forward_port)"
|
||||||
|
local joined=""
|
||||||
|
for el in ${keep[@]+"${keep[@]}"}; do
|
||||||
|
if [ -n "$joined" ]; then joined="$joined,$el"; else joined="$el"; fi
|
||||||
|
done
|
||||||
|
npm_api PUT "/api/nginx/proxy-hosts/$pid" \
|
||||||
|
"{\"forward_scheme\":\"$lsch\",\"forward_host\":\"$lh\",\"forward_port\":$lp,\"locations\":[$joined]}" >/dev/null
|
||||||
|
case "$(npm_code)" in 200|201) : ;; *) die "Zuruecknehmen fehlgeschlagen (HTTP $(npm_code))." ;; esac
|
||||||
|
ok "Die Wurzel zeigt wieder auf $lsch://$lh:$lp, der Pfad $path ist entfernt."
|
||||||
|
else
|
||||||
|
if [ "$rp" = "$NPM_INTERNAL_ADMIN_PORT" ] && [ "$rh" = 127.0.0.1 ]; then
|
||||||
|
ok "Die Wurzel zeigt bereits auf die Adminoberflaeche."
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
# Bisheriges Wurzelziel auf den Site-Pfad umziehen
|
||||||
|
if [ -z "$found" ]; then
|
||||||
|
keep+=("$(proxy_location_json "$path=$rh:$rp")") || return 1
|
||||||
|
log "Bisheriges Ziel $rh:$rp wandert auf $path."
|
||||||
|
else
|
||||||
|
log "Pfad $path gibt es schon - er bleibt, wie er ist."
|
||||||
|
fi
|
||||||
|
local joined=""
|
||||||
|
for el in ${keep[@]+"${keep[@]}"}; do
|
||||||
|
if [ -n "$joined" ]; then joined="$joined,$el"; else joined="$el"; fi
|
||||||
|
done
|
||||||
|
npm_api PUT "/api/nginx/proxy-hosts/$pid" \
|
||||||
|
"{\"forward_scheme\":\"http\",\"forward_host\":\"127.0.0.1\",\"forward_port\":$NPM_INTERNAL_ADMIN_PORT,\"locations\":[$joined]}" >/dev/null
|
||||||
|
case "$(npm_code)" in 200|201) : ;; *) die "Aenderung fehlgeschlagen (HTTP $(npm_code))." ;; esac
|
||||||
|
ok "Die Wurzel zeigt jetzt auf die Adminoberflaeche."
|
||||||
|
local ip; ip="$(primary_ip)"
|
||||||
|
printf ' https://%s/ Adminoberflaeche des Proxy Managers\n' "$ip"
|
||||||
|
printf ' https://%s%s/ Checkmk\n' "$ip" "$path"
|
||||||
|
printf '\n %sDie Anmeldemaske liegt damit offen im Netz.%s Wer das nicht will,
|
||||||
|
nimmt es nach getaner Arbeit wieder zurueck:
|
||||||
|
%s proxy admin --root --off\n' "$C_YEL" "$C_RST" "$SELF"
|
||||||
|
fi
|
||||||
|
|
||||||
|
local conf; conf="$(npm_custom_conf_path)"
|
||||||
|
if grep -qsF "$NPM_DEF_START" "$conf"; then
|
||||||
|
local d2; d2="$(printf '%s' "$o" | sed -n 's/.*"domain_names"[[:space:]]*:[[:space:]]*\[[[:space:]]*"\([^"]*\)".*/\1/p')"
|
||||||
|
log "Der Standard-Server fuer den IP-Zugang muss nachgezogen werden:
|
||||||
|
$SELF proxy default --domain ${d2:-<name>} --restart"
|
||||||
|
fi
|
||||||
|
echo
|
||||||
|
return 0 ;;
|
||||||
|
|
||||||
reload|restart)
|
reload|restart)
|
||||||
npm_enabled || die "Der NGINX Proxy Manager ist abgeschaltet (NPM_ENABLED=off).
|
npm_enabled || die "Der NGINX Proxy Manager ist abgeschaltet (NPM_ENABLED=off).
|
||||||
Einschalten: $SELF npm-enable on"
|
Einschalten: $SELF npm-enable on"
|
||||||
@@ -4552,7 +4733,7 @@ EOF
|
|||||||
cat <<EOF
|
cat <<EOF
|
||||||
|
|
||||||
${C_BLD}Erreichbar${C_RST}
|
${C_BLD}Erreichbar${C_RST}
|
||||||
https://$domain/${CMK_SITE_ID:-cmk}/ (HTTPS auf Port 443)
|
https://$domain${PROXY_ADD_URLPATH-/${CMK_SITE_ID:-cmk}/} (HTTPS auf Port 443)
|
||||||
http://$domain/ -> $([ "$force_ssl" = true ] && echo 'Weiterleitung auf HTTPS' || echo 'unverschluesselt')
|
http://$domain/ -> $([ "$force_ssl" = true ] && echo 'Weiterleitung auf HTTPS' || echo 'unverschluesselt')
|
||||||
|
|
||||||
$([ "$cert" = self ] && printf '%s\n' "Das Zertifikat ist selbstsigniert. Damit Browser und Agents ihm
|
$([ "$cert" = self ] && printf '%s\n' "Das Zertifikat ist selbstsigniert. Damit Browser und Agents ihm
|
||||||
@@ -4563,7 +4744,7 @@ EOF
|
|||||||
|
|
||||||
*) die "Unbekanntes Unterkommando 'proxy $sub'.
|
*) die "Unbekanntes Unterkommando 'proxy $sub'.
|
||||||
Moeglich: status | list | show | certs | add | edit | del | default
|
Moeglich: status | list | show | certs | add | edit | del | default
|
||||||
| reload | restart" ;;
|
| admin | reload | restart" ;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4714,7 +4895,7 @@ gui_pick_backup() { # -> Datei auf stdout
|
|||||||
|
|
||||||
gui_status() {
|
gui_status() {
|
||||||
local f; f="$(mktemp)"
|
local f; f="$(mktemp)"
|
||||||
NO_COLOR=1 cmd_status >"$f" 2>&1 || true
|
( NO_COLOR=1 cmd_status ) >"$f" 2>&1 || true
|
||||||
ui_text "Status" "$f"
|
ui_text "Status" "$f"
|
||||||
rm -f "$f"
|
rm -f "$f"
|
||||||
}
|
}
|
||||||
@@ -4801,7 +4982,7 @@ Automatische Ausfuehrung: $auto" \
|
|||||||
manuell) gui_backup || true ;;
|
manuell) gui_backup || true ;;
|
||||||
jobs) gui_jobs_menu || true ;;
|
jobs) gui_jobs_menu || true ;;
|
||||||
auto) gui_backup_auto || true ;;
|
auto) gui_backup_auto || true ;;
|
||||||
status) local f; f="$(mktemp)"; NO_COLOR=1 cmd_job status >"$f" 2>&1 || true
|
status) local f; f="$(mktemp)"; ( NO_COLOR=1 cmd_job status ) >"$f" 2>&1 || true
|
||||||
ui_text "Backup-Zeitplan" "$f"; rm -f "$f" ;;
|
ui_text "Backup-Zeitplan" "$f"; rm -f "$f" ;;
|
||||||
jetzt) gui_job_run_now || true ;;
|
jetzt) gui_job_run_now || true ;;
|
||||||
back) return 0 ;;
|
back) return 0 ;;
|
||||||
@@ -5048,7 +5229,7 @@ gui_backups_menu() {
|
|||||||
del "Backup loeschen" \
|
del "Backup loeschen" \
|
||||||
back "zurueck")" || return 0
|
back "zurueck")" || return 0
|
||||||
case "$sel" in
|
case "$sel" in
|
||||||
list) local f; f="$(mktemp)"; NO_COLOR=1 cmd_list >"$f" 2>&1 || true
|
list) local f; f="$(mktemp)"; ( NO_COLOR=1 cmd_list ) >"$f" 2>&1 || true
|
||||||
ui_text "Backups" "$f"; rm -f "$f" ;;
|
ui_text "Backups" "$f"; rm -f "$f" ;;
|
||||||
info) local b; b="$(gui_pick_backup)" || continue; [ -n "$b" ] || continue
|
info) local b; b="$(gui_pick_backup)" || continue; [ -n "$b" ] || continue
|
||||||
local f2; f2="$(mktemp)"; bundle_show "$b" >"$f2" 2>&1 || true
|
local f2; f2="$(mktemp)"; bundle_show "$b" >"$f2" 2>&1 || true
|
||||||
@@ -5074,7 +5255,7 @@ gui_sites_menu() {
|
|||||||
all "alle Sites starten" \
|
all "alle Sites starten" \
|
||||||
back "zurueck")" || return 0
|
back "zurueck")" || return 0
|
||||||
case "$sel" in
|
case "$sel" in
|
||||||
list) local f; f="$(mktemp)"; cmd_sites >"$f" 2>&1 || true; ui_text "Sites" "$f"; rm -f "$f" ;;
|
list) local f; f="$(mktemp)"; ( cmd_sites ) >"$f" 2>&1 || true; ui_text "Sites" "$f"; rm -f "$f" ;;
|
||||||
start) local s; s="$(gui_pick_site)" || continue; [ -n "$s" ] || continue
|
start) local s; s="$(gui_pick_site)" || continue; [ -n "$s" ] || continue
|
||||||
ui_run "Site starten" bash -c "cd '$PROJECT_DIR' && '$SELF' $SELF_ENV site-start '$s'" ;;
|
ui_run "Site starten" bash -c "cd '$PROJECT_DIR' && '$SELF' $SELF_ENV site-start '$s'" ;;
|
||||||
stop) local s2; s2="$(gui_pick_site)" || continue; [ -n "$s2" ] || continue
|
stop) local s2; s2="$(gui_pick_site)" || continue; [ -n "$s2" ] || continue
|
||||||
@@ -5099,7 +5280,7 @@ Edition/Version: ${CMK_EDITION:-raw} / ${CMK_VERSION:-?}" \
|
|||||||
use "Vorhandenes lokales Image auswaehlen" \
|
use "Vorhandenes lokales Image auswaehlen" \
|
||||||
back "zurueck")" || return 0
|
back "zurueck")" || return 0
|
||||||
case "$sel" in
|
case "$sel" in
|
||||||
status) local f; f="$(mktemp)"; NO_COLOR=1 cmd_image status >"$f" 2>&1 || true
|
status) local f; f="$(mktemp)"; ( NO_COLOR=1 cmd_image status ) >"$f" 2>&1 || true
|
||||||
ui_text "Image-Status" "$f"; rm -f "$f" ;;
|
ui_text "Image-Status" "$f"; rm -f "$f" ;;
|
||||||
versions) gui_image_versions || true ;;
|
versions) gui_image_versions || true ;;
|
||||||
holen) gui_image_get || true ;;
|
holen) gui_image_get || true ;;
|
||||||
@@ -5373,7 +5554,7 @@ Woher soll das Image geholt werden?" \
|
|||||||
load_env "${ENV_FILE:-$PROJECT_DIR/.env}"
|
load_env "${ENV_FILE:-$PROJECT_DIR/.env}"
|
||||||
|
|
||||||
local f; f="$(mktemp)"
|
local f; f="$(mktemp)"
|
||||||
NO_COLOR=1 cmd_image status >"$f" 2>&1 || true
|
( NO_COLOR=1 cmd_image status ) >"$f" 2>&1 || true
|
||||||
ui_text "Stand nach dem Holen" "$f"; rm -f "$f"
|
ui_text "Stand nach dem Holen" "$f"; rm -f "$f"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5382,7 +5563,7 @@ gui_image_versions() {
|
|||||||
ed="$(gui_image_pick_edition)" || return 0
|
ed="$(gui_image_pick_edition)" || return 0
|
||||||
local f; f="$(mktemp)"
|
local f; f="$(mktemp)"
|
||||||
ui_info "Versionen abrufen" "Frage Versionsarchiv, Registry und Downloadportal ab ...\n\nDas kann einen Moment dauern."
|
ui_info "Versionen abrufen" "Frage Versionsarchiv, Registry und Downloadportal ab ...\n\nDas kann einen Moment dauern."
|
||||||
NO_COLOR=1 cmd_image versions --edition "$ed" --limit 30 >"$f" 2>&1 || true
|
( NO_COLOR=1 cmd_image versions --edition "$ed" --limit 30 ) >"$f" 2>&1 || true
|
||||||
ui_text "Verfuegbare Versionen - $ed" "$f"
|
ui_text "Verfuegbare Versionen - $ed" "$f"
|
||||||
rm -f "$f"
|
rm -f "$f"
|
||||||
}
|
}
|
||||||
@@ -5624,7 +5805,7 @@ gui_settings_category() {
|
|||||||
__fwapply__) gui_firewall_apply || true; continue ;;
|
__fwapply__) gui_firewall_apply || true; continue ;;
|
||||||
__fwclose__) gui_firewall_close || true; continue ;;
|
__fwclose__) gui_firewall_close || true; continue ;;
|
||||||
__npm__) local f; f="$(mktemp)"
|
__npm__) local f; f="$(mktemp)"
|
||||||
{ NO_COLOR=1 cmd_npm_enable; NO_COLOR=1 cmd_npm_port; } >"$f" 2>&1 || true
|
( NO_COLOR=1 cmd_npm_enable; NO_COLOR=1 cmd_npm_port ) >"$f" 2>&1 || true
|
||||||
ui_text "NGINX Proxy Manager" "$f"; rm -f "$f"; continue ;;
|
ui_text "NGINX Proxy Manager" "$f"; rm -f "$f"; continue ;;
|
||||||
esac
|
esac
|
||||||
gui_settings_edit "$sel"
|
gui_settings_edit "$sel"
|
||||||
@@ -5649,8 +5830,8 @@ Datei: ${ENV_FILE:-$PROJECT_DIR/.env}" "${items[@]}")" || return 0
|
|||||||
back) return 0 ;;
|
back) return 0 ;;
|
||||||
jobs) gui_jobs_menu || true ;;
|
jobs) gui_jobs_menu || true ;;
|
||||||
show) local f; f="$(mktemp)"
|
show) local f; f="$(mktemp)"
|
||||||
{ printf '%-24s %-10s %s\n' "SCHLUESSEL" "BEREICH" "WERT"
|
( printf '%-24s %-10s %s\n' "SCHLUESSEL" "BEREICH" "WERT"
|
||||||
NO_COLOR=1 cmd_config list; } >"$f" 2>&1
|
NO_COLOR=1 cmd_config list ) >"$f" 2>&1 || true
|
||||||
ui_text "Alle Einstellungen" "$f"; rm -f "$f" ;;
|
ui_text "Alle Einstellungen" "$f"; rm -f "$f" ;;
|
||||||
editor) local ef="${ENV_FILE:-$PROJECT_DIR/.env}"
|
editor) local ef="${ENV_FILE:-$PROJECT_DIR/.env}"
|
||||||
if [ ! -f "$ef" ]; then ui_msg "Keine .env" "Die Datei $ef existiert nicht.\n\nAnlegen mit: cp .env.example .env"; continue; fi
|
if [ ! -f "$ef" ]; then ui_msg "Keine .env" "Die Datei $ef existiert nicht.\n\nAnlegen mit: cp .env.example .env"; continue; fi
|
||||||
@@ -5795,6 +5976,7 @@ Ziel : ${PROXY_FORWARD_HOST:-127.0.0.1}:${PROXY_FORWARD_PORT:-5000}" \
|
|||||||
show "Einzelheiten eines Proxy-Hosts (mit Pfaden)" \
|
show "Einzelheiten eines Proxy-Hosts (mit Pfaden)" \
|
||||||
certs "Vorhandene Zertifikate anzeigen" \
|
certs "Vorhandene Zertifikate anzeigen" \
|
||||||
ipzugang "HTTPS ueber die blanke IP (ohne Namen) ermoeglichen" \
|
ipzugang "HTTPS ueber die blanke IP (ohne Namen) ermoeglichen" \
|
||||||
|
adminui "Adminoberflaeche erreichbar machen (Name oder Wurzel)" \
|
||||||
neustart "Proxy Manager neu starten / nginx neu laden" \
|
neustart "Proxy Manager neu starten / nginx neu laden" \
|
||||||
del "Proxy-Host loeschen" \
|
del "Proxy-Host loeschen" \
|
||||||
status "Anmeldung pruefen" \
|
status "Anmeldung pruefen" \
|
||||||
@@ -5803,16 +5985,17 @@ Ziel : ${PROXY_FORWARD_HOST:-127.0.0.1}:${PROXY_FORWARD_PORT:-5000}" \
|
|||||||
case "$sel" in
|
case "$sel" in
|
||||||
anlegen) gui_proxy_add || true ;;
|
anlegen) gui_proxy_add || true ;;
|
||||||
edit) gui_proxy_edit || true ;;
|
edit) gui_proxy_edit || true ;;
|
||||||
list) local f; f="$(mktemp)"; NO_COLOR=1 cmd_proxy list >"$f" 2>&1 || true
|
list) local f; f="$(mktemp)"; ( NO_COLOR=1 cmd_proxy list ) >"$f" 2>&1 || true
|
||||||
ui_text "Proxy-Hosts" "$f"; rm -f "$f" ;;
|
ui_text "Proxy-Hosts" "$f"; rm -f "$f" ;;
|
||||||
show) local d3; d3="$(ui_input "Einzelheiten" "Name oder ID des Proxy-Hosts:" "${PROXY_DOMAIN:-}")" || continue
|
show) local d3; d3="$(ui_input "Einzelheiten" "Name oder ID des Proxy-Hosts:" "${PROXY_DOMAIN:-}")" || continue
|
||||||
[ -n "$d3" ] || continue
|
[ -n "$d3" ] || continue
|
||||||
local f3; f3="$(mktemp)"
|
local f3; f3="$(mktemp)"
|
||||||
NO_COLOR=1 cmd_proxy show --domain "$d3" >"$f3" 2>&1 || true
|
( NO_COLOR=1 cmd_proxy show --domain "$d3" ) >"$f3" 2>&1 || true
|
||||||
ui_text "Proxy-Host $d3" "$f3"; rm -f "$f3" ;;
|
ui_text "Proxy-Host $d3" "$f3"; rm -f "$f3" ;;
|
||||||
certs) local f2; f2="$(mktemp)"; NO_COLOR=1 cmd_proxy certs >"$f2" 2>&1 || true
|
certs) local f2; f2="$(mktemp)"; ( NO_COLOR=1 cmd_proxy certs ) >"$f2" 2>&1 || true
|
||||||
ui_text "Zertifikate" "$f2"; rm -f "$f2" ;;
|
ui_text "Zertifikate" "$f2"; rm -f "$f2" ;;
|
||||||
ipzugang) gui_proxy_default || true ;;
|
ipzugang) gui_proxy_default || true ;;
|
||||||
|
adminui) gui_proxy_admin || true ;;
|
||||||
neustart) gui_proxy_restart || true ;;
|
neustart) gui_proxy_restart || true ;;
|
||||||
del) gui_proxy_del || true ;;
|
del) gui_proxy_del || true ;;
|
||||||
status) ui_run "Anmeldung pruefen" bash -c "cd '$PROJECT_DIR' && NO_COLOR=1 '$SELF' $SELF_ENV proxy status" ;;
|
status) ui_run "Anmeldung pruefen" bash -c "cd '$PROJECT_DIR' && NO_COLOR=1 '$SELF' $SELF_ENV proxy status" ;;
|
||||||
@@ -5892,7 +6075,7 @@ Jede Aenderung wirkt sofort; alles Uebrige bleibt unangetastet." \
|
|||||||
case "$sel" in
|
case "$sel" in
|
||||||
back) return 0 ;;
|
back) return 0 ;;
|
||||||
zeigen) local f; f="$(mktemp)"
|
zeigen) local f; f="$(mktemp)"
|
||||||
NO_COLOR=1 cmd_proxy show --id "$pid" >"$f" 2>&1 || true
|
( NO_COLOR=1 cmd_proxy show --id "$pid" ) >"$f" 2>&1 || true
|
||||||
ui_text "Proxy-Host $pid" "$f"; rm -f "$f"; continue ;;
|
ui_text "Proxy-Host $pid" "$f"; rm -f "$f"; continue ;;
|
||||||
ziel) local h pt
|
ziel) local h pt
|
||||||
h="$(ui_input "Weiterleitungsziel" "Host:" "$(json_str "$o" forward_host)")" || continue
|
h="$(ui_input "Weiterleitungsziel" "Host:" "$(json_str "$o" forward_host)")" || continue
|
||||||
@@ -5965,7 +6148,7 @@ Mehrere Anweisungen durch \\\\n trennen." "$curadv")" || continue
|
|||||||
[ "${#args[@]}" -gt 0 ] || continue
|
[ "${#args[@]}" -gt 0 ] || continue
|
||||||
local f2 rc=0
|
local f2 rc=0
|
||||||
f2="$(mktemp)"
|
f2="$(mktemp)"
|
||||||
NO_COLOR=1 cmd_proxy edit --id "$pid" "${args[@]}" >"$f2" 2>&1 || rc=$?
|
( NO_COLOR=1 cmd_proxy edit --id "$pid" "${args[@]}" ) >"$f2" 2>&1 || rc=$?
|
||||||
if [ "$rc" -eq 0 ]; then
|
if [ "$rc" -eq 0 ]; then
|
||||||
ui_text "Proxy-Host $pid geaendert" "$f2"
|
ui_text "Proxy-Host $pid geaendert" "$f2"
|
||||||
else
|
else
|
||||||
@@ -5975,6 +6158,62 @@ Mehrere Anweisungen durch \\\\n trennen." "$curadv")" || continue
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gui_proxy_admin() {
|
||||||
|
local f; f="$(mktemp)"
|
||||||
|
( NO_COLOR=1 cmd_proxy admin ) >"$f" 2>&1 || true
|
||||||
|
ui_text "Adminoberflaeche erreichbar machen" "$f"; rm -f "$f"
|
||||||
|
|
||||||
|
local sel
|
||||||
|
sel="$(ui_menu "Adminoberflaeche erreichbar machen" \
|
||||||
|
"Die Oberflaeche des Proxy Managers laedt ihre Dateien ueber absolute
|
||||||
|
Pfade (/images, /api). Unter einem Unterpfad wie /npm kommt deshalb nur
|
||||||
|
die Startseite an - im Browser bleibt sie weiss.
|
||||||
|
|
||||||
|
Zwei Wege, beide mit nur einem freien Port:" \
|
||||||
|
name "Eigener Name (braucht Namensaufloesung im Netz)" \
|
||||||
|
wurzel "Wurzel -> Adminoberflaeche, Checkmk auf /${CMK_SITE_ID:-cmk}" \
|
||||||
|
zurueck "Wurzel wieder auf Checkmk zeigen lassen" \
|
||||||
|
back "zurueck")" || return 0
|
||||||
|
|
||||||
|
local -a args=()
|
||||||
|
case "$sel" in
|
||||||
|
back) return 0 ;;
|
||||||
|
name) local d c
|
||||||
|
d="$(ui_input "Eigener Name" "Name fuer die Adminoberflaeche:" \
|
||||||
|
"npm.${PROXY_DOMAIN:-example.local}")" || return 0
|
||||||
|
[ -n "$d" ] || return 0
|
||||||
|
c="$(ui_menu "Zertifikat" "Was soll ausgeliefert werden?" \
|
||||||
|
self "selbstsigniert (fuer das eigene Netz)" \
|
||||||
|
letsencrypt "Lets Encrypt (Server muss oeffentlich erreichbar sein)" \
|
||||||
|
none "keines - nur HTTP")" || return 0
|
||||||
|
args=(--domain "$d" --cert "$c") ;;
|
||||||
|
wurzel)
|
||||||
|
ui_yesno "Wurzel umlegen" "Die Wurzel zeigt danach auf die Adminoberflaeche,
|
||||||
|
das bisherige Ziel wandert auf /${CMK_SITE_ID:-cmk}.
|
||||||
|
|
||||||
|
https://<IP>/ Adminoberflaeche
|
||||||
|
https://<IP>/${CMK_SITE_ID:-cmk}/ Checkmk
|
||||||
|
|
||||||
|
Die Anmeldemaske liegt damit offen im Netz. Fortfahren?" || return 0
|
||||||
|
args=(--root) ;;
|
||||||
|
zurueck)
|
||||||
|
ui_yesno "Zuruecknehmen" "Die Wurzel soll wieder auf das urspruengliche Ziel zeigen
|
||||||
|
und der Pfad /${CMK_SITE_ID:-cmk} entfallen?" || return 0
|
||||||
|
args=(--root --off) ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
local f2 rc=0
|
||||||
|
f2="$(mktemp)"
|
||||||
|
( NO_COLOR=1 cmd_proxy admin "${args[@]}" ) >"$f2" 2>&1 || rc=$?
|
||||||
|
if [ "$rc" -eq 0 ]; then
|
||||||
|
ui_text "Adminoberflaeche" "$f2"
|
||||||
|
else
|
||||||
|
ui_text "Fehlgeschlagen" "$f2"
|
||||||
|
fi
|
||||||
|
rm -f "$f2"
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
gui_proxy_restart() {
|
gui_proxy_restart() {
|
||||||
local sel
|
local sel
|
||||||
sel="$(ui_menu "Proxy Manager neu starten" \
|
sel="$(ui_menu "Proxy Manager neu starten" \
|
||||||
@@ -5995,7 +6234,7 @@ haben oder nginx gar nicht mehr antwortet." \
|
|||||||
gui_proxy_default() {
|
gui_proxy_default() {
|
||||||
local f rc=0
|
local f rc=0
|
||||||
f="$(mktemp)"
|
f="$(mktemp)"
|
||||||
NO_COLOR=1 cmd_proxy default >"$f" 2>&1 || true
|
( NO_COLOR=1 cmd_proxy default ) >"$f" 2>&1 || true
|
||||||
ui_text "HTTPS ueber die blanke IP" "$f"; rm -f "$f"
|
ui_text "HTTPS ueber die blanke IP" "$f"; rm -f "$f"
|
||||||
|
|
||||||
local sel
|
local sel
|
||||||
@@ -6025,7 +6264,7 @@ Aufrufe mit Namen bleiben unberuehrt." \
|
|||||||
[ -n "$dom" ] || return 0
|
[ -n "$dom" ] || return 0
|
||||||
|
|
||||||
f="$(mktemp)"
|
f="$(mktemp)"
|
||||||
NO_COLOR=1 cmd_proxy default --domain "$dom" --restart >"$f" 2>&1 || rc=$?
|
( NO_COLOR=1 cmd_proxy default --domain "$dom" --restart ) >"$f" 2>&1 || rc=$?
|
||||||
if [ "$rc" -eq 0 ]; then
|
if [ "$rc" -eq 0 ]; then
|
||||||
ui_text "Standard-Server eingerichtet" "$f"
|
ui_text "Standard-Server eingerichtet" "$f"
|
||||||
else
|
else
|
||||||
@@ -6143,7 +6382,7 @@ Einen bereits vorhandenen Eintrag fuer diesen Namen ersetzen?
|
|||||||
|
|
||||||
gui_proxy_del() {
|
gui_proxy_del() {
|
||||||
local f; f="$(mktemp)"
|
local f; f="$(mktemp)"
|
||||||
NO_COLOR=1 cmd_proxy list >"$f" 2>&1 || true
|
( NO_COLOR=1 cmd_proxy list ) >"$f" 2>&1 || true
|
||||||
ui_text "Vorhandene Proxy-Hosts" "$f"; rm -f "$f"
|
ui_text "Vorhandene Proxy-Hosts" "$f"; rm -f "$f"
|
||||||
local id
|
local id
|
||||||
id="$(ui_input "Loeschen" "ID des zu loeschenden Proxy-Hosts:" "")" || return 0
|
id="$(ui_input "Loeschen" "ID des zu loeschenden Proxy-Hosts:" "")" || return 0
|
||||||
@@ -6168,7 +6407,7 @@ gui_cert() {
|
|||||||
gui_firewall() {
|
gui_firewall() {
|
||||||
local tmp rc=0
|
local tmp rc=0
|
||||||
tmp="$(mktemp)"
|
tmp="$(mktemp)"
|
||||||
cmd_firewall check >"$tmp" 2>&1 || rc=$?
|
( cmd_firewall check ) >"$tmp" 2>&1 || rc=$?
|
||||||
if [ "$rc" -eq 0 ]; then
|
if [ "$rc" -eq 0 ]; then
|
||||||
ui_text "Firewall - alles offen, was gebraucht wird" "$tmp"
|
ui_text "Firewall - alles offen, was gebraucht wird" "$tmp"
|
||||||
rm -f "$tmp"; return 0
|
rm -f "$tmp"; return 0
|
||||||
@@ -6200,7 +6439,7 @@ Nein = Freigabe fuer alle Quellen"; then
|
|||||||
if [ -n "$src" ]; then opt+=(--source "$src"); fi
|
if [ -n "$src" ]; then opt+=(--source "$src"); fi
|
||||||
|
|
||||||
tmp="$(mktemp)"
|
tmp="$(mktemp)"
|
||||||
cmd_firewall "${opt[@]}" >"$tmp" 2>&1 || rc=$?
|
( cmd_firewall "${opt[@]}" ) >"$tmp" 2>&1 || rc=$?
|
||||||
if [ "$rc" -eq 0 ]; then
|
if [ "$rc" -eq 0 ]; then
|
||||||
ui_text "Firewall - nichts zu tun" "$tmp"
|
ui_text "Firewall - nichts zu tun" "$tmp"
|
||||||
rm -f "$tmp"; return 0
|
rm -f "$tmp"; return 0
|
||||||
@@ -6223,7 +6462,7 @@ Bitte als root erneut aufrufen."
|
|||||||
|
|
||||||
# Zeigen, was dabei herausgekommen ist
|
# Zeigen, was dabei herausgekommen ist
|
||||||
tmp="$(mktemp)"
|
tmp="$(mktemp)"
|
||||||
cmd_firewall check >"$tmp" 2>&1 || true
|
( cmd_firewall check ) >"$tmp" 2>&1 || true
|
||||||
ui_text "Firewall - Stand danach" "$tmp"
|
ui_text "Firewall - Stand danach" "$tmp"
|
||||||
rm -f "$tmp"
|
rm -f "$tmp"
|
||||||
return 0
|
return 0
|
||||||
@@ -6233,7 +6472,7 @@ Bitte als root erneut aufrufen."
|
|||||||
gui_firewall_close() {
|
gui_firewall_close() {
|
||||||
local tmp rc=0 hat="" adminfall=""
|
local tmp rc=0 hat="" adminfall=""
|
||||||
tmp="$(mktemp)"
|
tmp="$(mktemp)"
|
||||||
cmd_firewall close >"$tmp" 2>&1 || rc=$?
|
( cmd_firewall close ) >"$tmp" 2>&1 || rc=$?
|
||||||
if ( set +o pipefail; grep -q 'Zum Schliessen' "$tmp" ); then hat=1; fi
|
if ( set +o pipefail; grep -q 'Zum Schliessen' "$tmp" ); then hat=1; fi
|
||||||
if ( set +o pipefail; grep -q 'Zugang dann nur lokal' "$tmp" ); then adminfall=1; fi
|
if ( set +o pipefail; grep -q 'Zugang dann nur lokal' "$tmp" ); then adminfall=1; fi
|
||||||
ui_text "Nicht mehr benoetigte Ports" "$tmp"
|
ui_text "Nicht mehr benoetigte Ports" "$tmp"
|
||||||
@@ -6269,7 +6508,7 @@ Bitte als root erneut aufrufen."
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
tmp="$(mktemp)"
|
tmp="$(mktemp)"
|
||||||
cmd_firewall check >"$tmp" 2>&1 || true
|
( cmd_firewall check ) >"$tmp" 2>&1 || true
|
||||||
ui_text "Firewall - Stand danach" "$tmp"
|
ui_text "Firewall - Stand danach" "$tmp"
|
||||||
rm -f "$tmp"
|
rm -f "$tmp"
|
||||||
return 0
|
return 0
|
||||||
|
|||||||
Reference in New Issue
Block a user