50 lines
3.2 KiB
PHP
50 lines
3.2 KiB
PHP
<?php declare(strict_types=1); include __DIR__ . '/partials/head.php'; ?>
|
||
<section class="install-hero">
|
||
<div class="shell prose-shell">
|
||
<p class="eyebrow">NetBox 4.6.5–4.6.8</p>
|
||
<h1>NetBox Store Plugin installieren</h1>
|
||
<p>Das Plugin verbindet deine NetBox mit <code>https://netbox.mrblake.cc</code>. Docker ist nicht erforderlich.</p>
|
||
</div>
|
||
</section>
|
||
<section class="shell prose-shell install-guide">
|
||
<aside class="notice"><strong>Vorher sichern:</strong> Erstelle ein Backup von NetBox und der Datenbank. Führe die Befehle auf dem NetBox-Host aus.</aside>
|
||
<h2>1. Plugin aus git.mrblake.cc installieren</h2>
|
||
<p>Trage das Plugin dauerhaft in <code>/opt/netbox/local_requirements.txt</code> ein. Die empfohlene HTTPS-Archivvariante benötigt kein lokal installiertes Git. Für reproduzierbare Installationen solltest du <code>main</code> durch einen geprüften Commit-SHA ersetzen.</p>
|
||
<pre><code>sudo sh -c 'line="netbox-plugin-store @ https://git.mrblake.cc/MrBlake/Netbox-Store/archive/main.tar.gz#subdirectory=netbox_plugin"; grep -Fqx "$line" /opt/netbox/local_requirements.txt || printf "%s\n" "$line" >> /opt/netbox/local_requirements.txt'
|
||
sudo /opt/netbox/upgrade.sh</code></pre>
|
||
<h3>Alternative mit Git</h3>
|
||
<p>Wenn du stattdessen eine <code>git+https</code>-Requirement verwendest, muss das Programm <code>git</code> vor dem NetBox-Upgrade installiert sein:</p>
|
||
<pre><code>sudo apt update
|
||
sudo apt install -y git
|
||
|
||
# Requirement:
|
||
netbox-plugin-store @ git+https://git.mrblake.cc/MrBlake/Netbox-Store.git@main#subdirectory=netbox_plugin</code></pre>
|
||
<h2>2. Plugin in NetBox aktivieren</h2>
|
||
<p>Ergänze die NetBox-Konfiguration:</p>
|
||
<pre><code>PLUGINS = [
|
||
"netbox_plugin_store",
|
||
]
|
||
|
||
PLUGINS_CONFIG = {
|
||
"netbox_plugin_store": {
|
||
"store_url": "https://netbox.mrblake.cc",
|
||
"allowed_store_urls": ["https://netbox.mrblake.cc"],
|
||
"allowed_artifact_urls": [
|
||
"https://git.mrblake.cc",
|
||
"https://github.com",
|
||
"https://codeload.github.com",
|
||
],
|
||
"execution_mode": "dry_run",
|
||
}
|
||
}</code></pre>
|
||
<p>Führe danach Migrationen und statische Dateien aus und starte NetBox neu:</p>
|
||
<pre><code>sudo /opt/netbox/venv/bin/python /opt/netbox/netbox/manage.py migrate
|
||
sudo /opt/netbox/venv/bin/python /opt/netbox/netbox/manage.py collectstatic --no-input
|
||
sudo systemctl restart netbox netbox-rq</code></pre>
|
||
<h2>3. Sicheren Host-Agent einrichten</h2>
|
||
<p><code>dry_run</code> verändert das System nicht. Für Installieren, Aktualisieren, Aktivieren und Entfernen wird der mitgelieferte Linux Host-Agent benötigt. Installiere ihn aus <code>host_agent/</code>, prüfe <code>/etc/netbox-store-agent/agent.toml</code> und stelle anschließend <code>execution_mode</code> auf <code>agent</code>.</p>
|
||
<p>Source-Kandidaten werden nur nach Admin-Freigabe verarbeitet. Der Agent prüft Commitbindung, Größe und SHA-256, baut daraus lokal ein Wheel und installiert nicht direkt aus einem beweglichen Branch.</p>
|
||
<aside class="notice warning"><strong>Wichtig:</strong> Source-Builds führen den Build-Code des freigegebenen Repository-Commits aus. Gib nur vertrauenswürdige Kandidaten frei.</aside>
|
||
</section>
|
||
<?php include __DIR__ . '/partials/footer.php'; ?>
|