diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml deleted file mode 100644 index b8be3e7..0000000 --- a/.github/workflows/docker-publish.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: Docker Publish - -on: - push: - tags: [ "v*" ] - workflow_dispatch: - -jobs: - build-push: - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - steps: - - uses: actions/checkout@v4 - - - name: Log in to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Docker meta - id: meta - uses: docker/metadata-action@v5 - with: - images: ghcr.io/${{ github.repository }} - tags: | - type=ref,event=tag - type=raw,value=latest - - - name: Build and push - uses: docker/build-push-action@v6 - with: - context: . - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} diff --git a/Readme.md b/Readme.md index 1eb3d8e..9e655ae 100644 --- a/Readme.md +++ b/Readme.md @@ -11,7 +11,7 @@ Entwickelt von **[Loheide.eu](https://loheide.eu)** ![UniFi OS](https://img.shields.io/badge/UniFi%20OS-7.0%2B-0559C9?logo=ubiquiti&logoColor=white) ![License](https://img.shields.io/badge/Lizenz-MIT-green) ![Version](https://img.shields.io/badge/Version-2.9.0-blueviolet) -![Tests](https://img.shields.io/badge/Tests-PHPUnit%20%2B%20PHPStan-brightgreen) +[![CI](https://git.loheide.cloud/friloo/Unifi-Voucher-Tool/badges/workflows/ci.yml/badge.svg)](https://git.loheide.cloud/friloo/Unifi-Voucher-Tool/actions) [![Repository](https://img.shields.io/badge/Code-git.loheide.cloud-4b3ec4)](https://git.loheide.cloud/friloo/Unifi-Voucher-Tool) @@ -660,9 +660,10 @@ entsteht daraus ein reguläres Release mit derselben Mechanik. > `updater/storage/` nicht überschreiben – oder gleich den eingebauten Updater > verwenden, der genau diese Pfade schützt. -Voraussetzung ist ein registrierter **Forgejo-Actions-Runner**; ohne Runner -bleiben die Workflows in der Warteschlange stehen. Compose-Datei und Anleitung -dafür liegen in [`tools/runner/`](tools/runner/README.md). +Gebaut wird das von einem **Forgejo-Actions-Runner**, der auf dem Server läuft. +Compose-Datei und Einrichtungsanleitung liegen in +[`tools/runner/`](tools/runner/README.md) – nötig für eine Neuinstallation oder +wenn der Runner ersetzt wird. ### Mitwirken @@ -676,10 +677,10 @@ tea issues ls # offene Tickets ansehen ``` > Die Workflows unter `.github/workflows/` werden von Forgejo Actions -> mitgelesen; das Badge oben ist bewusst statisch, solange kein Runner -> registriert ist. `docker-publish.yml` veröffentlicht nach `ghcr.io` und -> stammt noch aus der GitHub-Zeit – für den Forgejo-Betrieb entweder auf die -> eigene Registry umstellen oder entfernen. +> mitgelesen – geblieben sind `ci.yml` (Lint, Tests, statische Analyse) und +> `release.yml` (Release-ZIP). Das frühere `docker-publish.yml` veröffentlichte +> nach `ghcr.io` und stammte noch aus der GitHub-Zeit; es ist entfernt. Das +> Image wird stattdessen lokal gebaut (siehe Abschnitt **Docker**). Der **Auto-Updater** ist davon unabhängig: er zieht seine Pakete über `update.loheide.eu` (Channels `stable` und `development`) und nicht direkt aus @@ -711,6 +712,11 @@ Lizenztexte liegen jeweils im zugehörigen Ordner unter `assets/vendor/`: Teil jedes Release-ZIPs – wer die Anwendung weitergibt, gibt die Hinweise also automatisch mit. +Dieselbe Übersicht steht in der laufenden Installation unter +**Administration → Integration & Wartung → Über diese Installation**, dort +zusammen mit Version und PHP-Version und mit Links auf die ausgelieferten +Lizenztexte. + --- ## 🗺️ Roadmap diff --git a/admin/integrations.php b/admin/integrations.php index 74a3bd3..2d75b79 100644 --- a/admin/integrations.php +++ b/admin/integrations.php @@ -203,6 +203,64 @@ $adminBase = ''; +
+

+

+ +
+
+
UniFi Voucher Management System
+ +
+
+ +
+
+ +
+
– + +
+ +
+
+ +
+
git.loheide.cloud
+
+ +

+

+
+ + + + + + + + + + + + + + + + + +
+ + + + + + + +
+
+
+ diff --git a/assets/global.css b/assets/global.css index bef64c9..e255c86 100644 --- a/assets/global.css +++ b/assets/global.css @@ -1445,6 +1445,35 @@ input.search-bar, .site-selector .search-bar { min-width: 240px; width: auto; fl .badge-secondary { background: var(--bg-hover); color: var(--text-secondary); border-color: var(--border-color); } .placeholder-list { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; } +/* Ueber-Karte: Kennwerte als zweispaltige Liste, auf schmalen Geraeten untereinander. */ +.about-card h3 { + margin: 26px 0 4px; + font-size: 15px; + font-weight: 650; + color: var(--text-primary); +} +.about-list { + display: grid; + grid-template-columns: max-content 1fr; + gap: 8px 22px; + margin: 16px 0 0; +} +.about-list dt { + color: var(--text-muted); + font-size: 13px; + font-weight: 600; +} +.about-list dd { + margin: 0; + color: var(--text-primary); + font-size: 13.5px; +} +.about-card .table-container { margin-top: 12px; } +@media (max-width: 560px) { + .about-list { grid-template-columns: 1fr; gap: 2px; } + .about-list dd { margin-bottom: 10px; } +} + /* Einstellungen: Tabs */ .tab-container { background: var(--bg-card); diff --git a/includes/Ui.php b/includes/Ui.php index 0c0d5b4..5cb0260 100644 --- a/includes/Ui.php +++ b/includes/Ui.php @@ -230,6 +230,35 @@ class Ui . self::CREDIT_NAME . '

'; } + /** Lizenz der Anwendung selbst (siehe LICENSE im Wurzelverzeichnis). */ + public const LICENSE = 'MIT'; + public const REPOSITORY_URL = 'https://git.loheide.cloud/friloo/Unifi-Voucher-Tool'; + public const LICENSE_URL = self::REPOSITORY_URL . '/src/branch/main/LICENSE'; + + /** + * Mitgelieferte Komponenten Dritter – dieselbe Liste wie in + * THIRD-PARTY-NOTICES.md, nur maschinenlesbar fuer die Uebersicht in der + * Administration. 'license_file' zeigt auf den ausgelieferten Lizenztext; + * ein Test stellt sicher, dass die Dateien wirklich vorhanden sind. + * + * @return array + */ + public static function thirdParty(): array + { + return [ + ['name' => 'Inter', 'version' => '4.0', 'license' => 'SIL OFL 1.1', + 'license_file' => 'assets/vendor/inter/LICENSE.txt', 'url' => 'https://github.com/rsms/inter'], + ['name' => 'Font Awesome Free', 'version' => '6.4.0', 'license' => 'CC BY 4.0 / SIL OFL 1.1 / MIT', + 'license_file' => 'assets/vendor/fontawesome/LICENSE.txt', 'url' => 'https://fontawesome.com'], + ['name' => 'Chart.js', 'version' => '4.4.0', 'license' => 'MIT', + 'license_file' => 'assets/vendor/chartjs/LICENSE.txt', 'url' => 'https://www.chartjs.org'], + ['name' => 'qrcodejs', 'version' => '1.0.0', 'license' => 'MIT', + 'license_file' => 'assets/vendor/qrcodejs/LICENSE.txt', 'url' => 'https://github.com/davidshimjs/qrcodejs'], + ['name' => 'TinyMCE', 'version' => '6.8.3', 'license' => 'MIT', + 'license_file' => 'assets/vendor/tinymce/license.txt', 'url' => 'https://www.tiny.cloud'], + ]; + } + /** * Standard-Druckvorlage (wird nur verwendet, solange keine eigene * Vorlage gespeichert ist). {QR_CODE} fuellt der Browser. diff --git a/lang/de.php b/lang/de.php index 18f705f..464be78 100644 --- a/lang/de.php +++ b/lang/de.php @@ -333,6 +333,20 @@ return [ 'int_cleanup_expired' => 'Abgelaufene Voucher', 'int_cleanup_audit' => 'Audit-Log', 'int_cleanup_logins' => 'Login-Versuche', + + // Ueber-Karte (Integration & Wartung) + 'about_title' => 'Über diese Installation', + 'about_hint' => 'Version, Lizenz und die mitgelieferten Komponenten Dritter.', + 'about_app' => 'Anwendung', + 'about_version' => 'Version', + 'about_php' => 'PHP-Version', + 'about_license' => 'Lizenz', + 'about_license_view' => 'Lizenztext ansehen', + 'about_developer' => 'Entwickelt von', + 'about_repository' => 'Quellcode', + 'about_third_party' => 'Komponenten Dritter', + 'about_third_party_hint' => 'Diese Bibliotheken werden lokal ausgeliefert und behalten ihre eigene Lizenz. Die vollständigen Texte liegen unter assets/vendor/, eine Übersicht in THIRD-PARTY-NOTICES.md.', + 'about_component' => 'Komponente', 'int_saved' => 'Einstellungen gespeichert.', 'int_webhook_sent' => 'Test-Webhook gesendet.', 'int_webhook_failed' => 'Test-Webhook fehlgeschlagen.', diff --git a/lang/en.php b/lang/en.php index 35229b1..3063b10 100644 --- a/lang/en.php +++ b/lang/en.php @@ -333,6 +333,20 @@ return [ 'int_cleanup_expired' => 'Expired vouchers', 'int_cleanup_audit' => 'Audit log', 'int_cleanup_logins' => 'Login attempts', + + // Ueber-Karte (Integration & Wartung) + 'about_title' => 'About this installation', + 'about_hint' => 'Version, license and the bundled third-party components.', + 'about_app' => 'Application', + 'about_version' => 'Version', + 'about_php' => 'PHP version', + 'about_license' => 'License', + 'about_license_view' => 'View license text', + 'about_developer' => 'Developed by', + 'about_repository' => 'Source code', + 'about_third_party' => 'Third-party components', + 'about_third_party_hint' => 'These libraries are served locally and keep their own license. The full texts are in assets/vendor/, an overview is in THIRD-PARTY-NOTICES.md.', + 'about_component' => 'Component', 'int_saved' => 'Settings saved.', 'int_webhook_sent' => 'Test webhook sent.', 'int_webhook_failed' => 'Test webhook failed.', diff --git a/tests/UiTest.php b/tests/UiTest.php index 8d55513..9944b17 100644 --- a/tests/UiTest.php +++ b/tests/UiTest.php @@ -90,4 +90,42 @@ class UiTest extends TestCase { $this->assertSame('../uploads/logo.png', \Ui::mediaUrl('uploads/logo.png', '../')); } + + /** + * Die Uebersicht in der Administration und THIRD-PARTY-NOTICES.md duerfen + * nicht auseinanderlaufen: jede gelistete Komponente muss ihren + * Lizenztext wirklich mitliefern. + */ + public function testEveryThirdPartyComponentShipsItsLicence(): void + { + $root = dirname(__DIR__); + + foreach (\Ui::thirdParty() as $component) { + $this->assertFileExists( + $root . '/' . $component['license_file'], + 'Lizenztext fehlt fuer ' . $component['name'] + ); + $this->assertNotSame('', trim($component['license']), 'Lizenz fehlt fuer ' . $component['name']); + $this->assertNotSame('', trim($component['version']), 'Version fehlt fuer ' . $component['name']); + } + } + + public function testThirdPartyComponentsAreListedInTheNotices(): void + { + $notices = (string)file_get_contents(dirname(__DIR__) . '/THIRD-PARTY-NOTICES.md'); + + foreach (\Ui::thirdParty() as $component) { + $this->assertStringContainsString( + $component['name'], + $notices, + $component['name'] . ' fehlt in THIRD-PARTY-NOTICES.md' + ); + } + } + + public function testProjectLicenceFileExists(): void + { + $this->assertFileExists(dirname(__DIR__) . '/LICENSE'); + $this->assertStringContainsString('MIT License', (string)file_get_contents(dirname(__DIR__) . '/LICENSE')); + } }