Files
InvoiceShelf/app/Http/Controllers/AppVersionController.php
Darko Gjorgjijoski 6f45b58933 feat(updater): disable the in-app updater in containerized installs
Consume the injected CONTAINERIZED flag: expose it on /app/version, block the update endpoints + console command, and show a 'docker compose pull' panel instead of the updater.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-14 23:43:18 +02:00

34 lines
850 B
PHP

<?php
namespace App\Http\Controllers;
use App\Models\Setting;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\File;
class AppVersionController extends Controller
{
/**
* Handle the incoming request.
*
* @return JsonResponse
*/
public function __invoke(Request $request)
{
$version = preg_replace('~[\r\n]+~', '', File::get(base_path('version.md')));
$channel = Setting::getSetting('updater_channel');
if (is_null($channel)) {
$channel = 'stable';
Setting::setSetting('updater_channel', 'stable'); // default.
}
return response()->json([
'version' => $version,
'channel' => $channel,
'containerized' => (bool) config('invoiceshelf.containerized'),
]);
}
}