docs: translate README to English and align structure

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
MrBlakeandClaude Opus 5.5 committed 2026-10-26 20:58:16 +01:00
1 parent 9cd30780ac
commit 8a0af08ff9
1 file changed
+60 -39
+60 -39
View File
@@ -1,60 +1,81 @@
# NetBox Updater # 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` | **Type** | Bash script |
- Übernahme/Erstellung der `local_requirements.txt` (Plugins), inkl. automatischem `django-auth-ldap`-Eintrag bei erkannter LDAP-Konfig | **Platform** | Linux server running NetBox |
- Verzeichnistausch (`netbox` → `netbox_old`, neue Version → `netbox`) | **Repository** | <https://git.mrblake.cc/MrBlake/NetBox-Updater> |
- Ausführung von `upgrade.sh`
## 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-<version>` 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 ```bash
curl -fsSL https://git.mrblake.cc/MrBlake/NetBox-Updater/raw/branch/main/upgrade.sh | sudo bash -s -- 4.1.5 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 ```bash
wget -qO- https://git.mrblake.cc/MrBlake/NetBox-Updater/raw/branch/main/upgrade.sh | sudo bash -s -- 4.1.5 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 To review the script before running it, download it first:
- Root-Rechte (`sudo`)
- Bestehende Installation unter `/opt/netbox`
- `wget`, `tar`, `curl` installiert
- Kein `/opt/netbox_old` und kein `/opt/netbox-<Version>` 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)
```bash ```bash
wget https://git.mrblake.cc/MrBlake/NetBox-Updater/raw/branch/main/upgrade.sh wget https://git.mrblake.cc/MrBlake/NetBox-Updater/raw/branch/main/upgrade.sh
chmod +x upgrade.sh chmod +x upgrade.sh
sudo ./upgrade.sh 4.1.5 sudo ./upgrade.sh 4.1.5
``` ```
### 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
```