An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.
PHP coolifydatabasesdeploymentdockerdocker-composeinertiajslaravelmariadbmysqlnextjsnodejsphppostgresredisself-hostedself-hostingserverstatic-sitesveltesvelte5
fix(security): redact dotted GitHub tokens and contain wide data tables
Andras Bacsaic5b7f726b06a
diff --git a/bootstrap/helpers/remoteProcess.php b/bootstrap/helpers/remoteProcess.phpindex 982dda5511..241368d388 100644--- a/bootstrap/helpers/remoteProcess.php+++ b/bootstrap/helpers/remoteProcess.php@@ -346,7 +346,7 @@ function remove_iip($text)$text = preg_replace('/Bearer\s+[A-Za-z0-9\-_]+\.[A-Za-z0-9\-_]+\.[A-Za-z0-9\-_]+/i', 'Bearer '.REDACTED, $text);// GitHub tokens (ghp_ = personal, gho_ = OAuth, ghu_ = user-to-server, ghs_ = server-to-server, ghr_ = refresh)- $text = preg_replace('/\b(gh[pousr]_[A-Za-z0-9_]{36,})\b/', REDACTED, $text);+ $text = preg_replace('/\bgh[pousr]_[A-Za-z0-9.\-_]{36,}(?![A-Za-z0-9.\-_])/', REDACTED, $text);// GitLab tokens (glpat- = personal access token, glcbt- = CI build token, glrt- = runner token)$text = preg_replace('/\b(gl(?:pat|cbt|rt)-[A-Za-z0-9\-_]{20,})\b/', REDACTED, $text);diff --git a/resources/css/app.css b/resources/css/app.cssindex 30ccf4ac02..b1ae74c09a 100644--- a/resources/css/app.css+++ b/resources/css/app.css@@ -2152,6 +2152,14 @@ input[type="search"]::-webkit-search-results-decoration {}/* Data table (layer-card body, full-bleed) */+.data-table {+ min-width: 0;+ max-width: 100%;+ overflow-x: auto;+ overscroll-behavior-x: contain;+ -webkit-overflow-scrolling: touch;+}+.data-table-header {display: grid;align-items: center;diff --git a/tests/Feature/StandardTableComponentsTest.php b/tests/Feature/StandardTableComponentsTest.phpindex 9741268bc7..30437c05b5 100644--- a/tests/Feature/StandardTableComponentsTest.php+++ b/tests/Feature/StandardTableComponentsTest.php@@ -3,6 +3,12 @@use Illuminate\Support\Facades\Blade;use Illuminate\Support\Facades\File;+it('contains wide data tables without overflowing their layout', function () {+ $css = file_get_contents(resource_path('css/app.css'));++ expect($css)->toContain(".data-table {\n min-width: 0;\n max-width: 100%;\n overflow-x: auto;");+});+it('renders the standard table toolbar controls', function () {$html = Blade::render(<<<'BLADE'<x-table.toolbar>diff --git a/tests/Unit/SanitizeLogsForExportTest.php b/tests/Unit/SanitizeLogsForExportTest.phpindex 285230ea4a..88c5950896 100644--- a/tests/Unit/SanitizeLogsForExportTest.php+++ b/tests/Unit/SanitizeLogsForExportTest.php@@ -108,14 +108,14 @@ it('removes GitHub tokens', function () {'gho_aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789' => 'gho_ OAuth token','ghu_aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789' => 'ghu_ user-to-server token','ghs_aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789' => 'ghs_ server-to-server token',+ 'ghs_eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiIxMjM0NTY3OCIsInN1YiI6Imluc3RhbGxhdGlvbi10b2tlbiJ9.signature-with_dots-and-hyphens' => 'ghs_ stateless server-to-server token','ghr_aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789' => 'ghr_ refresh token',];foreach ($testCases as $token => $description) {$input = "Token: {$token}";$result = sanitizeLogsForExport($input);- expect($result)->not->toContain($token, "Failed to redact {$description}");- expect($result)->toContain(REDACTED);+ expect($result)->toBe('Token: '.REDACTED, "Failed to redact {$description}");}});