diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index a4ff129..c8327d3 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -6,7 +6,6 @@ on: env: REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository }} jobs: build-and-push: @@ -40,7 +39,9 @@ jobs: id: meta uses: docker/metadata-action@v5 with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + images: | + ${{ env.REGISTRY }}/usetrmnl/byos_laravel + ${{ env.REGISTRY }}/usetrmnl/larapaper tags: | type=semver,pattern={{version}} diff --git a/Dockerfile b/Dockerfile index c679db8..4dc531b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,8 +3,8 @@ ######################## FROM bnussbau/serversideup-php:8.4-fpm-nginx-alpine-imagick-chromium@sha256:ed705a4060d50143ddc538c1288afff217eaf76ad5791f7556a97943854cf745 AS base -LABEL org.opencontainers.image.source=https://github.com/usetrmnl/byos_laravel -LABEL org.opencontainers.image.description="TRMNL BYOS Laravel" +LABEL org.opencontainers.image.source=https://github.com/usetrmnl/larapaper +LABEL org.opencontainers.image.description="LaraPaper" LABEL org.opencontainers.image.licenses=MIT ARG APP_VERSION diff --git a/README.md b/README.md index 442cc15..c1ebafe 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -## TRMNL BYOS (PHP/Laravel) +## LaraPaper (PHP/Laravel) -[![tests](https://github.com/usetrmnl/byos_laravel/actions/workflows/test.yml/badge.svg)](https://github.com/usetrmnl/byos_laravel/actions/workflows/test.yml) +[![tests](https://github.com/usetrmnl/larapaper/actions/workflows/test.yml/badge.svg)](https://github.com/usetrmnl/larapaper/actions/workflows/test.yml) -TRMNL BYOS Laravel is a self-hostable implementation of a TRMNL server, built with Laravel. +LaraPaper is a self-hostable implementation of a TRMNL server (BYOS), built with Laravel. It allows you to manage TRMNL devices, generate screens using **native plugins** (Screens API, Markup), **recipes** (130+ from the [OSS community catalog](https://bnussbau.github.io/trmnl-recipe-catalog/), 700+ from the [TRMNL catalog](https://trmnl.com/recipes), or your own), or the **API**, and can also act as a **proxy** for the native cloud service (Core). With over 50k downloads and 200+ stars, it’s the most popular community-driven BYOS. ![Screenshot](README_byos-screenshot.png) @@ -26,7 +26,7 @@ It allows you to manage TRMNL devices, generate screens using **native plugins** * Custom ESP32 with TRMNL firmware * E-Reader Devices * KOReader ([trmnl-koreader](https://github.com/usetrmnl/trmnl-koreader)) - * Kindle ([trmnl-kindle](https://github.com/usetrmnl/byos_laravel/pull/27)) + * Kindle ([trmnl-kindle](https://github.com/usetrmnl/larapaper/pull/27)) * Nook ([trmnl-nook](https://github.com/usetrmnl/trmnl-nook)) * Kobo ([trmnl-kobo](https://github.com/usetrmnl/trmnl-kobo)) * Android Devices with [trmnl-android](https://github.com/usetrmnl/trmnl-android) @@ -61,7 +61,7 @@ Docker Compose file located at: [docker/prod/docker-compose.yml](docker/prod/doc ##### Backup Database ```sh -docker ps #find container id of byos_laravel container +docker ps #find container id of larapaper container docker cp {{CONTAINER_ID}}:/var/www/html/database/storage/database.sqlite database_backup.sqlite ``` @@ -73,11 +73,11 @@ docker compose up -d ``` #### VPS -If you’re using a VPS (e.g., Hetzner) and prefer an alternative to native Docker, you can install Dokploy and deploy BYOS Laravel using the integrated [Template](https://templates.dokploy.com/?q=trmnl+byos+laravel). +If you’re using a VPS (e.g., Hetzner) and prefer an alternative to native Docker, you can install Dokploy and deploy LaraPaper using the integrated [Template](https://templates.dokploy.com/?q=trmnl+byos+laravel). It’s a quick way to get started without having to manually manage Docker setup. #### PikaPods -You can vote for TRMNL BYOS Laravel to be included as PikaPods Template here: [feedback.pikapods.com](https://feedback.pikapods.com/posts/842/add-app-trmnl-byos-laravel) +You can vote for LaraPaper to be included as PikaPods Template here: [feedback.pikapods.com](https://feedback.pikapods.com/posts/842/add-app-trmnl-byos-laravel) #### Umbrel Umbrel is supported through a community store, [see](http://github.com/bnussbau/umbrel-store). @@ -173,13 +173,13 @@ See this YouTube guide: [https://www.youtube.com/watch?v=3xehPW-PCOM](https://ww ### ☁️ Activate fresh TRMNL Device with Cloud Proxy 1) Setup the TRMNL as in the official docs with the cloud service (connect one of the plugins to later verify it works) -2) Setup Laravel BYOS, create a user and login -3) In Laravel BYOS in the header bar, activate the toggle "Permit Auto-Join" +2) Setup LaraPaper, create a user and login +3) In LaraPaper in the header bar, activate the toggle "Permit Auto-Join" 4) Press and hold the button on the back of your TRMNL for 5 seconds to reactivate the captive portal (or reflash). -5) Go through the setup process again, in the screen where you provide the Wi-Fi credentials there is also option to set the Server URL. Use the local address of your Laravel BYOS +5) Go through the setup process again, in the screen where you provide the Wi-Fi credentials there is also option to set the Server URL. Use the local address of LaraPaper. 6) The device should automatically appear in the device list; you can deactivate the "Permit Auto-Join" toggle again. 7) In the devices list, activate the toggle "☁️ Proxy" for your device. (Make sure that the queue worker is active. In the docker image it should be running automatically.) -8) As long as no Laravel BYOS plugin is scheduled, the device will show your cloud plugins. +8) As long as no LaraPaper plugin is scheduled, the device will show your cloud plugins. ###### Troubleshooting diff --git a/app/Models/Plugin.php b/app/Models/Plugin.php index d99d988..0a39553 100644 --- a/app/Models/Plugin.php +++ b/app/Models/Plugin.php @@ -224,7 +224,7 @@ class Plugin extends Model if ($this->data_strategy !== 'polling' || ! $this->polling_url) { return; } - $headers = ['User-Agent' => 'usetrmnl/byos_laravel', 'Accept' => 'application/json']; + $headers = ['User-Agent' => 'usetrmnl/larapaper', 'Accept' => 'application/json']; // resolve headers if ($this->polling_header) { diff --git a/config/app.php b/config/app.php index fe8499c..176342e 100644 --- a/config/app.php +++ b/config/app.php @@ -13,7 +13,7 @@ return [ | */ - 'name' => env('APP_NAME', 'Laravel'), + 'name' => env('APP_NAME', 'LaraPaper'), /* |-------------------------------------------------------------------------- @@ -127,6 +127,8 @@ return [ 'enabled' => env('REGISTRATION_ENABLED', true), ], + 'pixel_logo_enabled' => env('PIXELLOGO_ENABLED', true), + 'force_https' => env('FORCE_HTTPS', false), 'puppeteer_docker' => env('PUPPETEER_DOCKER', false), 'puppeteer_mode' => env('PUPPETEER_MODE', 'local'), @@ -154,5 +156,5 @@ return [ 'catalog_url' => env('CATALOG_URL', 'https://raw.githubusercontent.com/bnussbau/trmnl-recipe-catalog/refs/heads/main/catalog.yaml'), - 'github_repo' => env('GITHUB_REPO', 'usetrmnl/byos_laravel'), + 'github_repo' => env('GITHUB_REPO', 'usetrmnl/larapaper'), ]; diff --git a/docker/prod/docker-compose.yml b/docker/prod/docker-compose.yml index fb7dfc6..eaa48fb 100644 --- a/docker/prod/docker-compose.yml +++ b/docker/prod/docker-compose.yml @@ -1,6 +1,6 @@ services: app: - image: ghcr.io/usetrmnl/byos_laravel:latest + image: ghcr.io/usetrmnl/larapaper:latest ports: - "4567:8080" environment: diff --git a/docs/DEVELOPMENT.md b/docs/DEVELOPMENT.md index 40bcbd3..e2246bc 100644 --- a/docs/DEVELOPMENT.md +++ b/docs/DEVELOPMENT.md @@ -9,7 +9,7 @@ #### Clone the repository ```bash -git clone git@github.com:usetrmnl/byos_laravel.git +git clone git@github.com:usetrmnl/larapaper.git ``` #### Copy environment file diff --git a/resources/views/components/app-logo.blade.php b/resources/views/components/app-logo.blade.php index 2bde6c1..f50634a 100644 --- a/resources/views/components/app-logo.blade.php +++ b/resources/views/components/app-logo.blade.php @@ -2,6 +2,9 @@
- {{-- TRMNL BYOS Laravel --}} - + @if(config('app.pixel_logo_enabled')) + + @else + LaraPaper + @endif
diff --git a/resources/views/components/auth-header.blade.php b/resources/views/components/auth-header.blade.php index 410a62e..78aa2e5 100644 --- a/resources/views/components/auth-header.blade.php +++ b/resources/views/components/auth-header.blade.php @@ -4,7 +4,10 @@ ])
-{{-- {{ $title }}--}} - + @if(config('app.pixel_logo_enabled')) + + @else + LaraPaper + @endif {{ $description }}
diff --git a/resources/views/default-screens/setup.blade.php b/resources/views/default-screens/setup.blade.php index ab7ec60..9113eb6 100644 --- a/resources/views/default-screens/setup.blade.php +++ b/resources/views/default-screens/setup.blade.php @@ -15,10 +15,10 @@ - Welcome to BYOS Laravel! + Welcome to LaraPaper! Your device is connected. - + diff --git a/resources/views/default-screens/sleep.blade.php b/resources/views/default-screens/sleep.blade.php index fa0c8cd..ef0a80c 100644 --- a/resources/views/default-screens/sleep.blade.php +++ b/resources/views/default-screens/sleep.blade.php @@ -25,6 +25,6 @@ Sleep Mode - + diff --git a/resources/views/livewire/plugins/index.blade.php b/resources/views/livewire/plugins/index.blade.php index 848fc67..0985841 100644 --- a/resources/views/livewire/plugins/index.blade.php +++ b/resources/views/livewire/plugins/index.blade.php @@ -264,7 +264,7 @@ new class extends Component {{--
  • date: "%N" is unsupported. Use date: "u" instead
  • --}} {{-- --}} - Please report issues on GitHub. Include your example zip file. + Please report issues on GitHub. Include your example zip file.
    @@ -315,7 +315,7 @@ new class extends Component
  • API responses in formats other than JSON are not yet fully supported.
  • There are limitations in payload size (Data Payload, Template).
  • - Please report issues, aside from the known limitations, on GitHub. Include the recipe URL. + Please report issues, aside from the known limitations, on GitHub. Include the recipe URL. diff --git a/resources/views/livewire/plugins/markup.blade.php b/resources/views/livewire/plugins/markup.blade.php index 150e626..392b0b9 100644 --- a/resources/views/livewire/plugins/markup.blade.php +++ b/resources/views/livewire/plugins/markup.blade.php @@ -72,8 +72,8 @@ new class extends Component - TRMNL BYOS Laravel - “This screen was rendered by BYOS Laravel” + LaraPaper + “This screen was rendered by BYOS LaraPaper” Benjamin Nussbaum diff --git a/resources/views/partials/head.blade.php b/resources/views/partials/head.blade.php index fa0f31a..26a42a6 100644 --- a/resources/views/partials/head.blade.php +++ b/resources/views/partials/head.blade.php @@ -1,7 +1,7 @@ -{{ $title ?? 'TRMNL BYOS Laravel' }} +{{ $title ?? 'LaraPaper' }} diff --git a/resources/views/welcome.blade.php b/resources/views/welcome.blade.php index abf6a69..ba608f9 100644 --- a/resources/views/welcome.blade.php +++ b/resources/views/welcome.blade.php @@ -1,6 +1,6 @@
    - +
    @if (Route::has('login')) @@ -33,7 +33,7 @@
    @auth @if(config('app.version')) - Version: Version: {{ config('app.version') }} @endif diff --git a/tests/Feature/PixelLogoConfigTest.php b/tests/Feature/PixelLogoConfigTest.php new file mode 100644 index 0000000..ba009c9 --- /dev/null +++ b/tests/Feature/PixelLogoConfigTest.php @@ -0,0 +1,46 @@ +get('/login'); + + $response->assertStatus(200); + $response->assertSee('viewBox="0 0 1000 150"', false); +}); + +test('auth pages show heading instead of pixel logo when pixel_logo_enabled is false', function (): void { + Config::set('app.pixel_logo_enabled', false); + + $response = $this->get('/login'); + + $response->assertStatus(200); + $response->assertDontSee('viewBox="0 0 1000 150"', false); + $response->assertSee('LaraPaper'); +}); + +test('app logo shows text when pixel_logo_enabled is false', function (): void { + Config::set('app.pixel_logo_enabled', false); + + $user = User::factory()->create(); + $response = $this->actingAs($user)->get(route('dashboard')); + + $response->assertStatus(200); + $response->assertSee('LaraPaper'); + $response->assertDontSee('viewBox="0 0 1000 150"', false); +}); + +test('app logo shows pixel logo SVG when pixel_logo_enabled is true', function (): void { + Config::set('app.pixel_logo_enabled', true); + + $user = User::factory()->create(); + $response = $this->actingAs($user)->get(route('dashboard')); + + $response->assertStatus(200); + $response->assertSee('viewBox="0 0 1000 150"', false); +});