From 8a0af08ff9f06b6203f012e7915aa33ca9c222b7 Mon Sep 17 00:00:00 2001 From: Louis Date: Mon, 26 Oct 2026 20:58:16 +0100 Subject: [PATCH] docs: translate README to English and align structure Co-Authored-By: Claude Opus 5.5 --- README.md | 99 +++++++++++++++++++++++++++++++++---------------------- 1 file changed, 60 insertions(+), 39 deletions(-) diff --git a/README.md b/README.md index 1e40589..dd7f499 100644 --- a/README.md +++ b/README.md @@ -1,60 +1,81 @@ # NetBox Updater -Automatisiertes Upgrade-Skript für selbst gehostete NetBox-Installationen unter `/opt/netbox`. +Automated upgrade script for self-hosted NetBox installations under +`/opt/netbox`. -Erledigt automatisch: -- Download & Entpacken der neuen NetBox-Version -- Übernahme von `configuration.py`, `ldap_config.py`, `media/`, `scripts/`, `reports/`, `gunicorn.py` -- Übernahme/Erstellung der `local_requirements.txt` (Plugins), inkl. automatischem `django-auth-ldap`-Eintrag bei erkannter LDAP-Konfig -- Verzeichnistausch (`netbox` → `netbox_old`, neue Version → `netbox`) -- Ausführung von `upgrade.sh` +| | | +|---|---| +| **Type** | Bash script | +| **Platform** | Linux server running NetBox | +| **Repository** | | -## Ausführung per Oneliner +## Features -Direkt von Gitea herunterladen und ausführen (Version als Parameter, ohne führendes `v`): +- Downloads and extracts the requested NetBox release +- Carries over `configuration.py`, `ldap_config.py`, `media/`, `scripts/`, + `reports/` and `gunicorn.py` +- Carries over or creates `local_requirements.txt` (plugins), adding + `django-auth-ldap` automatically when an LDAP configuration is detected +- Swaps directories (`netbox` → `netbox_old`, new release → `netbox`) +- Runs NetBox's `upgrade.sh` + +## Requirements + +- Root privileges (`sudo`) +- An existing installation under `/opt/netbox` +- `wget`, `tar` and `curl` +- Neither `/opt/netbox_old` nor `/opt/netbox-` may exist; the script + aborts otherwise so nothing is overwritten + +## Usage + +Download and run in one step, passing the target version without a leading `v`: ```bash curl -fsSL https://git.mrblake.cc/MrBlake/NetBox-Updater/raw/branch/main/upgrade.sh | sudo bash -s -- 4.1.5 ``` -Alternativ mit `wget`: +Or with `wget`: ```bash wget -qO- https://git.mrblake.cc/MrBlake/NetBox-Updater/raw/branch/main/upgrade.sh | sudo bash -s -- 4.1.5 ``` -`4.1.5` durch die gewünschte Zielversion ersetzen (siehe [NetBox Releases](https://github.com/netbox-community/netbox/releases)). +Replace `4.1.5` with the desired target version (see +[NetBox releases](https://github.com/netbox-community/netbox/releases)). -## Voraussetzungen - -- Root-Rechte (`sudo`) -- Bestehende Installation unter `/opt/netbox` -- `wget`, `tar`, `curl` installiert -- Kein `/opt/netbox_old` und kein `/opt/netbox-` vorhanden (Skript bricht sonst ab, um nichts zu überschreiben) - -## Ablauf im Detail - -1. **Download**: Lädt `vX.Y.Z.tar.gz` von GitHub und entpackt es nach `/opt/netbox-X.Y.Z`. -2. **Kopieren**: Überträgt Konfiguration, Medien, Skripte, Reports und ggf. `gunicorn.py` aus der bestehenden Installation. -3. **Plugins**: Kopiert `local_requirements.txt` aus `/opt/netbox`. Existiert keine, wird eine Standardliste angelegt (in der Skriptdatei editierbar). Bei vorhandener `ldap_config.py` wird `django-auth-ldap` automatisch ergänzt. -4. **Pause zur Prüfung**: Das Skript hält an und bittet dich, `CSRF_TRUSTED_ORIGINS` in der neuen `configuration.py` zu kontrollieren, bevor es weitermacht (Enter zum Fortfahren, Strg+C zum Abbrechen). -5. **Verzeichnistausch**: `/opt/netbox` → `/opt/netbox_old`, `/opt/netbox-X.Y.Z` → `/opt/netbox`. -6. **Upgrade**: Führt `/opt/netbox/upgrade.sh` aus. -7. **Aufräumen**: Löscht den heruntergeladenen Tarball. - -## Nach dem Upgrade - -- NetBox testen (Login, Plugins, LDAP falls genutzt). -- Bei Problemen: Rollback möglich, da die alte Installation unter `/opt/netbox_old` erhalten bleibt. -- Nach erfolgreicher Prüfung kann `/opt/netbox_old` gelöscht werden: - ```bash - sudo rm -rf /opt/netbox_old - ``` - -## Lokale Ausführung (ohne Oneliner) +To review the script before running it, download it first: ```bash wget https://git.mrblake.cc/MrBlake/NetBox-Updater/raw/branch/main/upgrade.sh chmod +x upgrade.sh sudo ./upgrade.sh 4.1.5 -``` \ No newline at end of file +``` + +### Steps in detail + +1. **Download**: fetches `vX.Y.Z.tar.gz` from GitHub and extracts it to + `/opt/netbox-X.Y.Z`. +2. **Copy**: transfers configuration, media, scripts, reports and, if present, + `gunicorn.py` from the existing installation. +3. **Plugins**: copies `local_requirements.txt` from `/opt/netbox`. If none + exists, a default list is created (editable in the script). If + `ldap_config.py` exists, `django-auth-ldap` is added automatically. +4. **Pause for review**: the script stops and asks you to check + `CSRF_TRUSTED_ORIGINS` in the new `configuration.py` (Enter to continue, + Ctrl+C to abort). +5. **Directory swap**: `/opt/netbox` → `/opt/netbox_old`, + `/opt/netbox-X.Y.Z` → `/opt/netbox`. +6. **Upgrade**: runs `/opt/netbox/upgrade.sh`. +7. **Clean-up**: deletes the downloaded tarball. + +### After the upgrade + +- Test NetBox: login, plugins and LDAP if used. +- If something is wrong, roll back: the previous installation is kept under + `/opt/netbox_old`. +- Once everything works, remove the old installation: + + ```bash + sudo rm -rf /opt/netbox_old + ```