Files
Netbox-Store/store/templates/installation.php
T
MrBlake 26aea40e6a
CI / php-store (push) Waiting to run
CI / python-components (push) Waiting to run
feat: install plugins from approved source commits
2026-08-24 21:37:17 +02:00

43 lines
2.7 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?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.54.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. Für reproduzierbare Installationen solltest du <code>main</code> durch einen geprüften Commit-SHA ersetzen.</p>
<pre><code>sudo sh -c 'printf "%s\n" "netbox-plugin-store @ git+https://git.mrblake.cc/MrBlake/Netbox-Store.git@main#subdirectory=netbox_plugin" &gt;&gt; /opt/netbox/local_requirements.txt'
sudo /opt/netbox/upgrade.sh</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'; ?>