ubuntu:navidrome
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende Überarbeitung | ||
| ubuntu:navidrome [2026/04/23 13:59] – [Spezialfall music library] Service-User der Anwendung zuweisen Sebastian Hetzel | ubuntu:navidrome [2026/07/29 22:28] (aktuell) – [Kennzahlen] Sebastian Hetzel | ||
|---|---|---|---|
| Zeile 52: | Zeile 52: | ||
| </ | </ | ||
| + | ==== Logrotate ==== | ||
| + | |||
| + | <file bash / | ||
| + | / | ||
| + | { | ||
| + | rotate 14 | ||
| + | daily | ||
| + | missingok | ||
| + | notifempty | ||
| + | delaycompress | ||
| + | compress | ||
| + | create 640 navidrome navidrome | ||
| + | postrotate | ||
| + | if service navidrome status > /dev/null 2>& | ||
| + | touch / | ||
| + | chown navidrome: | ||
| + | service navidrome restart > /dev/null 2>& | ||
| + | fi; | ||
| + | endscript | ||
| + | sharedscripts | ||
| + | } | ||
| + | </ | ||
| ==== Daten wiederherstellen (bei Migration) ==== | ==== Daten wiederherstellen (bei Migration) ==== | ||
| Zeile 105: | Zeile 127: | ||
| </ | </ | ||
| + | === Default Berechtigungen setzen === | ||
| + | |||
| + | <code bash> | ||
| + | apt install acl | ||
| + | setfacl -d -m u:: | ||
| + | </ | ||
| ==== Service-User der Anwendung zuweisen ==== | ==== Service-User der Anwendung zuweisen ==== | ||
| Zeile 161: | Zeile 189: | ||
| </ | </ | ||
| + | |||
| + | <code bash> | ||
| + | systemctl daemon-reload | ||
| + | systemctl start navidrome.service | ||
| + | systemctl status navidrome.service | ||
| + | </ | ||
| <code bash> | <code bash> | ||
| Zeile 229: | Zeile 263: | ||
| ===== Apache2 als Reverse-Proxy ===== | ===== Apache2 als Reverse-Proxy ===== | ||
| + | ==== Installation der Pakete ==== | ||
| - | < | + | < |
| - | < | + | apt update |
| - | <VirtualHost *:443> | + | apt install apache2 libapache2-mod-security2 |
| - | ServerName music.example.com | + | </code> |
| - | DocumentRoot / | + | |
| - | # Logs | + | Module im Apache aktivieren: |
| - | ErrorLog / | + | |
| - | CustomLog / | + | |
| - | # Proxy Settings | + | <code bash> |
| - | | + | a2enmod proxy proxy_http proxy_wstunnel headers rewrite ssl |
| - | | + | </code> |
| - | # WebSocket Support (Rewrites nur für Upgrade) | + | Dual Stack aktivieren --> '' |
| - | RewriteEngine On | + | |
| - | RewriteCond %{HTTP: | + | |
| - | RewriteRule | + | |
| - | # Normaler Proxy für alle anderen Requests | + | <code apache> |
| - | | + | Listen 80 |
| - | | + | Listen [::]:80 |
| + | Listen 443 | ||
| + | Listen [::]:443 | ||
| + | </code> | ||
| - | # Forwarded Headers | + | Apache-Version nicht bekannt geben --> ''/ |
| - | RequestHeader set X-Forwarded-Proto " | + | |
| - | RequestHeader set X-Forwarded-Port " | + | |
| - | RequestHeader set X-Forwarded-For " | + | |
| - | # Connection / Timeout Optimierungen | + | <code apache> |
| - | | + | # ServerTokens |
| - | MaxKeepAliveRequests 100 | + | # This directive configures what you return as the Server HTTP response |
| - | KeepAliveTimeout 5 | + | # Header. The default is ' |
| - | ProxyTimeout 300 | + | # and compiled in modules. |
| - | + | # Set to one of: Full | OS | Minimal | Minor | Major | Prod | |
| - | | + | # where Full conveys the most information, |
| - | # X-XSS-Protection ist veraltet, kann optional drinbleiben oder entfernt werden | + | # |
| - | # Header | + | ServerTokens Prod |
| - | Header always set X-Content-Type-Options " | + | # |
| - | | + | |
| - | + | ||
| - | | + | |
| - | Include / | + | |
| - | | + | |
| - | | + | |
| - | + | ||
| - | </ | + | |
| - | </ | + | |
| </ | </ | ||
| ===== ModSecurity-Konfiguration für Apache2 Reverse Proxy vor Navidrome ===== | ===== ModSecurity-Konfiguration für Apache2 Reverse Proxy vor Navidrome ===== | ||
| Zeile 295: | Zeile 315: | ||
| </ | </ | ||
| + | Einbindung in Apache unter '' | ||
| + | |||
| + | <file apache / | ||
| + | < | ||
| + | # Default Debian dir for modsecurity' | ||
| + | SecDataDir / | ||
| + | |||
| + | # Include all the *.conf files in / | ||
| + | # Keeping your local configuration in that directory | ||
| + | # will allow for an easy upgrade of THIS file and | ||
| + | # make your life easier | ||
| + | IncludeOptional / | ||
| + | # | ||
| + | IncludeOptional / | ||
| + | IncludeOptional / | ||
| + | |||
| + | # Include OWASP ModSecurity CRS rules if installed | ||
| + | # IncludeOptional / | ||
| + | |||
| + | # Defense against CVE-2021-44228 | ||
| + | SecRuleUpdateTargetById 932130 " | ||
| + | SecRuleUpdateTargetById 932130 " | ||
| + | |||
| + | </ | ||
| + | </ | ||
| ==== 2. Hauptkonfiguration ==== | ==== 2. Hauptkonfiguration ==== | ||
| Zeile 493: | Zeile 538: | ||
| <code apache> | <code apache> | ||
| - | < | + | < |
| - | ServerName music.example.com | + | < |
| + | ServerName music.example.de | ||
| + | ServerAlias music.example.net | ||
| + | DocumentRoot / | ||
| + | |||
| + | ErrorLog / | ||
| + | CustomLog / | ||
| + | |||
| + | ProxyPreserveHost On | ||
| + | Protocols http/1.1 | ||
| + | #ProxyPass "/ | ||
| + | |||
| + | # WebSocket-Unterstützung | ||
| + | RewriteEngine On | ||
| + | RewriteCond %{HTTP: | ||
| + | RewriteRule /(.*) | ||
| + | |||
| + | # Alles andere Proxy | ||
| + | ProxyPass / http:// | ||
| + | ProxyPassReverse / http:// | ||
| - | ProxyPreserveHost On | + | RequestHeader set X-Forwarded-Proto " |
| - | | + | |
| - | | + | RequestHeader set X-Forwarded-For " |
| + | | ||
| - | # Sicherheit | + | KeepAlive On |
| - | | + | |
| - | | + | |
| - | | + | |
| - | # Logging | + | Include / |
| - | | + | |
| - | | + | |
| + | SSLCertificateKeyFile | ||
| + | Header always set Strict-Transport-Security " | ||
| </ | </ | ||
| + | </ | ||
| </ | </ | ||
| - | |||
| ==== 7. Test & Debug ==== | ==== 7. Test & Debug ==== | ||
| Zeile 530: | Zeile 597: | ||
| | Test | DetectionOnly | | | Test | DetectionOnly | | ||
| | Produktion | On + gezielte Exclusions | | | Produktion | On + gezielte Exclusions | | ||
| + | |||
| + | ===== Datenbank ===== | ||
| + | |||
| + | ==== Tools ==== | ||
| + | |||
| + | <code |shell> | ||
| + | sudo apt update | ||
| + | sudo apt install sqlite3 | ||
| + | </ | ||
| + | |||
| + | ==== Kennzahlen ==== | ||
| + | |||
| + | <code |bash> | ||
| + | sqlite3 / | ||
| + | </ | ||
| + | |||
| + | <code |sql> | ||
| + | sqlite> select count(*) from media_file; | ||
| + | 89379 | ||
| + | sqlite> select count(*) from album; | ||
| + | 5224 | ||
| + | sqlite> SELECT COUNT(*) FROM artist; | ||
| + | 10954 | ||
| + | </ | ||
ubuntu/navidrome.1776945544.txt.gz · Zuletzt geändert: von Sebastian Hetzel
